@geekmidas/cli 10.0.0-alpha.122 → 10.0.0-alpha.124

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 (263) hide show
  1. package/dist/{EndpointGenerator-BDa6pPgE.cjs → EndpointGenerator-B2MUa4M2.cjs} +2 -2
  2. package/dist/{EndpointGenerator-BDa6pPgE.cjs.map → EndpointGenerator-B2MUa4M2.cjs.map} +1 -1
  3. package/dist/{EndpointGenerator-CP_z_E3e.mjs → EndpointGenerator-Z_BUTocT.mjs} +2 -2
  4. package/dist/{EndpointGenerator-CP_z_E3e.mjs.map → EndpointGenerator-Z_BUTocT.mjs.map} +1 -1
  5. package/dist/{GoDaddyProvider-BJ9j9mR7.cjs → GoDaddyProvider-0z5RAN1k.cjs} +3 -3
  6. package/dist/{GoDaddyProvider-BJ9j9mR7.cjs.map → GoDaddyProvider-0z5RAN1k.cjs.map} +1 -1
  7. package/dist/{GoDaddyProvider-wIKYdm7V.mjs → GoDaddyProvider-55x4o-4z.mjs} +3 -3
  8. package/dist/{GoDaddyProvider-wIKYdm7V.mjs.map → GoDaddyProvider-55x4o-4z.mjs.map} +1 -1
  9. package/dist/{HostingerProvider-BNpS9aRJ.mjs → HostingerProvider-Cjh_2Ml6.mjs} +2 -2
  10. package/dist/{HostingerProvider-BNpS9aRJ.mjs.map → HostingerProvider-Cjh_2Ml6.mjs.map} +1 -1
  11. package/dist/{HostingerProvider-DR1iws1P.cjs → HostingerProvider-OdQmKXE3.cjs} +2 -2
  12. package/dist/{HostingerProvider-DR1iws1P.cjs.map → HostingerProvider-OdQmKXE3.cjs.map} +1 -1
  13. package/dist/{LegacyStateStore-CkXUJP7i.mjs → LegacyStateStore-C-vumKSN.mjs} +3 -3
  14. package/dist/{LegacyStateStore-CkXUJP7i.mjs.map → LegacyStateStore-C-vumKSN.mjs.map} +1 -1
  15. package/dist/{LegacyStateStore-D1S87I_B.cjs → LegacyStateStore-DRpB-yC5.cjs} +3 -3
  16. package/dist/{LegacyStateStore-D1S87I_B.cjs.map → LegacyStateStore-DRpB-yC5.cjs.map} +1 -1
  17. package/dist/{LocalStateStore-DmXfpvu4.cjs → LocalStateStore-C3ummuDT.cjs} +2 -2
  18. package/dist/{LocalStateStore-DmXfpvu4.cjs.map → LocalStateStore-C3ummuDT.cjs.map} +1 -1
  19. package/dist/{LocalStateStore-BWoWeSq0.mjs → LocalStateStore-CtOjpV1w.mjs} +2 -2
  20. package/dist/{LocalStateStore-BWoWeSq0.mjs.map → LocalStateStore-CtOjpV1w.mjs.map} +1 -1
  21. package/dist/{OpenApiTsGenerator-CsrukCE-.mjs → OpenApiTsGenerator-MtnMQL_g.mjs} +2 -2
  22. package/dist/{OpenApiTsGenerator-CsrukCE-.mjs.map → OpenApiTsGenerator-MtnMQL_g.mjs.map} +1 -1
  23. package/dist/{OpenApiTsGenerator-FNhY7Ssz.cjs → OpenApiTsGenerator-t3_E98Fi.cjs} +2 -2
  24. package/dist/{OpenApiTsGenerator-FNhY7Ssz.cjs.map → OpenApiTsGenerator-t3_E98Fi.cjs.map} +1 -1
  25. package/dist/{S3StateStore-D19JSGE9.mjs → S3StateStore-BC4Jm3Tw.mjs} +2 -2
  26. package/dist/{S3StateStore-D19JSGE9.mjs.map → S3StateStore-BC4Jm3Tw.mjs.map} +1 -1
  27. package/dist/{S3StateStore-BEdsjjP4.cjs → S3StateStore-BeArp0aF.cjs} +2 -2
  28. package/dist/{S3StateStore-BEdsjjP4.cjs.map → S3StateStore-BeArp0aF.cjs.map} +1 -1
  29. package/dist/{SSMStateStore-7xKw0Zz9.mjs → SSMStateStore-Crl76aYZ.mjs} +2 -2
  30. package/dist/{SSMStateStore-7xKw0Zz9.mjs.map → SSMStateStore-Crl76aYZ.mjs.map} +1 -1
  31. package/dist/{SSMStateStore--2bcxoiH.cjs → SSMStateStore-DcstR6cW.cjs} +2 -2
  32. package/dist/{SSMStateStore--2bcxoiH.cjs.map → SSMStateStore-DcstR6cW.cjs.map} +1 -1
  33. package/dist/{SubscriberGenerator-C8CPxrCK.cjs → SubscriberGenerator-C3QTae-R.cjs} +237 -54
  34. package/dist/SubscriberGenerator-C3QTae-R.cjs.map +1 -0
  35. package/dist/{SubscriberGenerator-y3pncae_.mjs → SubscriberGenerator-COAVPgM-.mjs} +227 -56
  36. package/dist/SubscriberGenerator-COAVPgM-.mjs.map +1 -0
  37. package/dist/{add-DlFUKdjX.cjs → add-BFjb6mMq.cjs} +7 -7
  38. package/dist/{add-DlFUKdjX.cjs.map → add-BFjb6mMq.cjs.map} +1 -1
  39. package/dist/{add-Bu6FkaTn.mjs → add-CIjmgzkb.mjs} +6 -6
  40. package/dist/{add-Bu6FkaTn.mjs.map → add-CIjmgzkb.mjs.map} +1 -1
  41. package/dist/{bundler-Bg0lPDoi.cjs → bundler-CiUoIsku.cjs} +5 -5
  42. package/dist/{bundler-Bg0lPDoi.cjs.map → bundler-CiUoIsku.cjs.map} +1 -1
  43. package/dist/{bundler-CgE5XTyr.mjs → bundler-D6KFNpQk.mjs} +5 -5
  44. package/dist/{bundler-CgE5XTyr.mjs.map → bundler-D6KFNpQk.mjs.map} +1 -1
  45. package/dist/{cli-z5S3bHyK.mjs → cli-DNtSTtMc.mjs} +4 -4
  46. package/dist/{cli-z5S3bHyK.mjs.map → cli-DNtSTtMc.mjs.map} +1 -1
  47. package/dist/{cli-Cvjlnpon.cjs → cli-r4eUr98C.cjs} +4 -4
  48. package/dist/{cli-Cvjlnpon.cjs.map → cli-r4eUr98C.cjs.map} +1 -1
  49. package/dist/{compose-bKLAtHLj.cjs → compose-BfXXWJSp.cjs} +362 -59
  50. package/dist/compose-BfXXWJSp.cjs.map +1 -0
  51. package/dist/{compose-CgBPA44v.mjs → compose-DJvvmF3X.mjs} +336 -33
  52. package/dist/compose-DJvvmF3X.mjs.map +1 -0
  53. package/dist/{config-D48erO2j.d.mts → config-IgK6YaGp.d.cts} +3 -4
  54. package/dist/config-IgK6YaGp.d.cts.map +1 -0
  55. package/dist/{config-DHDtsQrB.d.cts → config-kE-p5hxq.d.mts} +3 -4
  56. package/dist/config-kE-p5hxq.d.mts.map +1 -0
  57. package/dist/config.cjs +2 -2
  58. package/dist/config.d.cts +3 -3
  59. package/dist/config.d.mts +3 -3
  60. package/dist/config.mjs +2 -2
  61. package/dist/{credentialSchemas-B67WJOOm.cjs → credentialSchemas-AhIBuQxQ.cjs} +2 -2
  62. package/dist/{credentialSchemas-B67WJOOm.cjs.map → credentialSchemas-AhIBuQxQ.cjs.map} +1 -1
  63. package/dist/{credentialSchemas-DDOLRCLF.mjs → credentialSchemas-DLKbxYBy.mjs} +2 -2
  64. package/dist/{credentialSchemas-DDOLRCLF.mjs.map → credentialSchemas-DLKbxYBy.mjs.map} +1 -1
  65. package/dist/{credentials-Zqr3QQYB.cjs → credentials-D7XJypNd.cjs} +173 -3
  66. package/dist/credentials-D7XJypNd.cjs.map +1 -0
  67. package/dist/{credentials-B5N5yKk6.mjs → credentials-DpfnUvIR.mjs} +132 -4
  68. package/dist/credentials-DpfnUvIR.mjs.map +1 -0
  69. package/dist/deploy/public.cjs +16 -17
  70. package/dist/deploy/public.cjs.map +1 -1
  71. package/dist/deploy/public.d.cts +3 -5
  72. package/dist/deploy/public.d.cts.map +1 -1
  73. package/dist/deploy/public.d.mts +3 -5
  74. package/dist/deploy/public.d.mts.map +1 -1
  75. package/dist/deploy/public.mjs +11 -12
  76. package/dist/deploy/public.mjs.map +1 -1
  77. package/dist/{deploy-CI85F6dr.cjs → deploy-BbI1UMh3.cjs} +477 -156
  78. package/dist/deploy-BbI1UMh3.cjs.map +1 -0
  79. package/dist/{deploy-Ddy8UBoE.mjs → deploy-CiRYwFmr.mjs} +456 -117
  80. package/dist/deploy-CiRYwFmr.mjs.map +1 -0
  81. package/dist/{discover-C5roJuc9.mjs → discover-BvJOVsYG.mjs} +66 -14
  82. package/dist/discover-BvJOVsYG.mjs.map +1 -0
  83. package/dist/{discover-DozUKs8f.cjs → discover-ojkcbxHw.cjs} +88 -12
  84. package/dist/discover-ojkcbxHw.cjs.map +1 -0
  85. package/dist/{dokploy-CiozgdKO.cjs → dokploy-C0aQrCgs.cjs} +2 -2
  86. package/dist/{dokploy-CiozgdKO.cjs.map → dokploy-C0aQrCgs.cjs.map} +1 -1
  87. package/dist/{dokploy-Boj1NSHV.mjs → dokploy-MM7c3IE0.mjs} +2 -2
  88. package/dist/{dokploy-Boj1NSHV.mjs.map → dokploy-MM7c3IE0.mjs.map} +1 -1
  89. package/dist/{drivers-DbjiYpW6.cjs → drivers-CQ32PB5w.cjs} +2 -2
  90. package/dist/{drivers-DbjiYpW6.cjs.map → drivers-CQ32PB5w.cjs.map} +1 -1
  91. package/dist/{drivers-BjGDYfnC.mjs → drivers-Chb5Akov.mjs} +2 -2
  92. package/dist/{drivers-BjGDYfnC.mjs.map → drivers-Chb5Akov.mjs.map} +1 -1
  93. package/dist/{eas-DCg41jKK.mjs → eas-1Ee6kql0.mjs} +2 -2
  94. package/dist/{eas-DCg41jKK.mjs.map → eas-1Ee6kql0.mjs.map} +1 -1
  95. package/dist/{eas-BmBjIFf_.cjs → eas-CJoys9yh.cjs} +2 -2
  96. package/dist/{eas-BmBjIFf_.cjs.map → eas-CJoys9yh.cjs.map} +1 -1
  97. package/dist/{emit-C1e8qD08.mjs → emit-CNpuV_6Q.mjs} +17 -1
  98. package/dist/emit-CNpuV_6Q.mjs.map +1 -0
  99. package/dist/{emit-Dmc1nvdS.cjs → emit-qvHxMV9b.cjs} +17 -1
  100. package/dist/emit-qvHxMV9b.cjs.map +1 -0
  101. package/dist/{encryption-QOQbGXgV.mjs → encryption-B8Bk1Mvu.mjs} +3 -3
  102. package/dist/{encryption-QOQbGXgV.mjs.map → encryption-B8Bk1Mvu.mjs.map} +1 -1
  103. package/dist/{encryption-CwLWV2ig.cjs → encryption-Bo9VlRnl.cjs} +3 -3
  104. package/dist/{encryption-CwLWV2ig.cjs.map → encryption-Bo9VlRnl.cjs.map} +1 -1
  105. package/dist/{engine-HVqo3mQu.mjs → engine-BuinpJfS.mjs} +7 -8
  106. package/dist/{engine-HVqo3mQu.mjs.map → engine-BuinpJfS.mjs.map} +1 -1
  107. package/dist/{engine-D7YNY3v7.cjs → engine-esxTxcIx.cjs} +10 -11
  108. package/dist/{engine-D7YNY3v7.cjs.map → engine-esxTxcIx.cjs.map} +1 -1
  109. package/dist/{github-CO8W9SDs.cjs → github-BEA4K3_X.cjs} +80 -47
  110. package/dist/github-BEA4K3_X.cjs.map +1 -0
  111. package/dist/{github-CQt3xc3o.mjs → github-BUlKJfOV.mjs} +78 -45
  112. package/dist/github-BUlKJfOV.mjs.map +1 -0
  113. package/dist/{googlePlay-Cfu17aEp.mjs → googlePlay-CK05QiTq.mjs} +4 -4
  114. package/dist/{googlePlay-Cfu17aEp.mjs.map → googlePlay-CK05QiTq.mjs.map} +1 -1
  115. package/dist/{googlePlay-DSuF6jbF.cjs → googlePlay-CiqAS2ma.cjs} +5 -5
  116. package/dist/{googlePlay-DSuF6jbF.cjs.map → googlePlay-CiqAS2ma.cjs.map} +1 -1
  117. package/dist/{index-8OfpOtSI.d.cts → index-4CO0HD27.d.cts} +2 -2
  118. package/dist/{index-8OfpOtSI.d.cts.map → index-4CO0HD27.d.cts.map} +1 -1
  119. package/dist/{index-Dpji6Bxq.d.mts → index-DhUf0B0m.d.mts} +2 -2
  120. package/dist/{index-Dpji6Bxq.d.mts.map → index-DhUf0B0m.d.mts.map} +1 -1
  121. package/dist/index.cjs +81 -82
  122. package/dist/index.cjs.map +1 -1
  123. package/dist/index.mjs +64 -65
  124. package/dist/index.mjs.map +1 -1
  125. package/dist/{local-BwC2v2Y8.mjs → local-B7Zv1NoA.mjs} +2 -2
  126. package/dist/{local-BwC2v2Y8.mjs.map → local-B7Zv1NoA.mjs.map} +1 -1
  127. package/dist/{local-DNhnkugT.cjs → local-OPC9BCZt.cjs} +3 -3
  128. package/dist/{local-DNhnkugT.cjs.map → local-OPC9BCZt.cjs.map} +1 -1
  129. package/dist/{migrate-CGkir5LM.mjs → migrate-BzCHT9qs.mjs} +3 -3
  130. package/dist/{migrate-CGkir5LM.mjs.map → migrate-BzCHT9qs.mjs.map} +1 -1
  131. package/dist/{migrate-CXsMaHbb.cjs → migrate-C-hmbjpG.cjs} +3 -3
  132. package/dist/{migrate-CXsMaHbb.cjs.map → migrate-C-hmbjpG.cjs.map} +1 -1
  133. package/dist/{migrate-Bkz8BGaZ.mjs → migrate-CnbvrVag.mjs} +4 -4
  134. package/dist/{migrate-Bkz8BGaZ.mjs.map → migrate-CnbvrVag.mjs.map} +1 -1
  135. package/dist/{migrate-dbAI2XF8.cjs → migrate-DeQJBexh.cjs} +4 -4
  136. package/dist/{migrate-dbAI2XF8.cjs.map → migrate-DeQJBexh.cjs.map} +1 -1
  137. package/dist/openapi.cjs +3 -3
  138. package/dist/openapi.d.cts +1 -1
  139. package/dist/openapi.d.mts +1 -1
  140. package/dist/openapi.mjs +3 -3
  141. package/dist/{publish-eUcWvSdP.mjs → publish-BISBrrqR.mjs} +2 -2
  142. package/dist/{publish-eUcWvSdP.mjs.map → publish-BISBrrqR.mjs.map} +1 -1
  143. package/dist/{publish-Bbd-2PI2.cjs → publish-DtSIB-hZ.cjs} +2 -2
  144. package/dist/{publish-Bbd-2PI2.cjs.map → publish-DtSIB-hZ.cjs.map} +1 -1
  145. package/dist/{ready-BOfogqzr.mjs → ready-DqsyadOs.mjs} +6 -6
  146. package/dist/{ready-BOfogqzr.mjs.map → ready-DqsyadOs.mjs.map} +1 -1
  147. package/dist/{ready-BFFP838V.cjs → ready-IVGu-q18.cjs} +6 -6
  148. package/dist/{ready-BFFP838V.cjs.map → ready-IVGu-q18.cjs.map} +1 -1
  149. package/dist/reconcile/public.cjs +2 -2
  150. package/dist/reconcile/public.d.cts +1 -2
  151. package/dist/reconcile/public.d.cts.map +1 -1
  152. package/dist/reconcile/public.d.mts +1 -2
  153. package/dist/reconcile/public.d.mts.map +1 -1
  154. package/dist/reconcile/public.mjs +2 -2
  155. package/dist/{resolve-DSilYpzm.mjs → resolve-BT7fkPN5.mjs} +4 -4
  156. package/dist/{resolve-DSilYpzm.mjs.map → resolve-BT7fkPN5.mjs.map} +1 -1
  157. package/dist/{resolve-CyprRcQo.cjs → resolve-C7GKQcE4.cjs} +4 -4
  158. package/dist/{resolve-CyprRcQo.cjs.map → resolve-C7GKQcE4.cjs.map} +1 -1
  159. package/dist/{rollback-DfwsnwGO.cjs → rollback-BEiB-Pje.cjs} +7 -7
  160. package/dist/{rollback-DfwsnwGO.cjs.map → rollback-BEiB-Pje.cjs.map} +1 -1
  161. package/dist/{rollback-C4ri3h7i.mjs → rollback-DbP0KuDw.mjs} +7 -7
  162. package/dist/{rollback-C4ri3h7i.mjs.map → rollback-DbP0KuDw.mjs.map} +1 -1
  163. package/dist/{runtime-ACdfK59n.d.cts → runtime-BFJQNqwd.d.mts} +2 -2
  164. package/dist/{runtime-ACdfK59n.d.cts.map → runtime-BFJQNqwd.d.mts.map} +1 -1
  165. package/dist/{runtime-YyQuekxi.d.mts → runtime-BJO-FFef.d.cts} +2 -2
  166. package/dist/{runtime-YyQuekxi.d.mts.map → runtime-BJO-FFef.d.cts.map} +1 -1
  167. package/dist/{s3-DQXZdmCM.mjs → s3-B4FTQQkV.mjs} +2 -2
  168. package/dist/{s3-DQXZdmCM.mjs.map → s3-B4FTQQkV.mjs.map} +1 -1
  169. package/dist/{s3-CrPoA89T.cjs → s3-DwKLXwUT.cjs} +2 -2
  170. package/dist/{s3-CrPoA89T.cjs.map → s3-DwKLXwUT.cjs.map} +1 -1
  171. package/dist/sandbox/credentials-worker.cjs +2 -2
  172. package/dist/sandbox/credentials-worker.mjs +2 -2
  173. package/dist/sandbox/discover-worker.cjs +1 -1
  174. package/dist/sandbox/discover-worker.mjs +1 -1
  175. package/dist/sandbox/migrate-worker.cjs +1 -1
  176. package/dist/sandbox/migrate-worker.mjs +1 -1
  177. package/dist/{seeds-CFG-f24B.cjs → seeds-DOfxmDRO.cjs} +362 -34
  178. package/dist/seeds-DOfxmDRO.cjs.map +1 -0
  179. package/dist/{seeds-oY0qDqui.mjs → seeds-rG-Evfz9.mjs} +341 -31
  180. package/dist/seeds-rG-Evfz9.mjs.map +1 -0
  181. package/dist/{serverSetup-CQZt0OT6.cjs → serverSetup-CWWVcU6Y.cjs} +6 -6
  182. package/dist/{serverSetup-CQZt0OT6.cjs.map → serverSetup-CWWVcU6Y.cjs.map} +1 -1
  183. package/dist/{serverSetup-D8nngcNL.mjs → serverSetup-xGw1fxuZ.mjs} +6 -6
  184. package/dist/{serverSetup-D8nngcNL.mjs.map → serverSetup-xGw1fxuZ.mjs.map} +1 -1
  185. package/dist/{sniffer-BAmtXzou.cjs → sniffer-C7O9Pna_.cjs} +9 -9
  186. package/dist/{sniffer-BAmtXzou.cjs.map → sniffer-C7O9Pna_.cjs.map} +1 -1
  187. package/dist/{sniffer-Cgx608Tl.mjs → sniffer-DVPgfyHr.mjs} +9 -9
  188. package/dist/{sniffer-Cgx608Tl.mjs.map → sniffer-DVPgfyHr.mjs.map} +1 -1
  189. package/dist/{dns-CfEZHt7r.cjs → snsSubscriptions-CSkteK2J.cjs} +520 -3
  190. package/dist/snsSubscriptions-CSkteK2J.cjs.map +1 -0
  191. package/dist/{dns-BgxvvcQa.mjs → snsSubscriptions-CvBIGGp0.mjs} +431 -6
  192. package/dist/snsSubscriptions-CvBIGGp0.mjs.map +1 -0
  193. package/dist/{sst-C1pxbFEd.mjs → sst-CTqZZl1_.mjs} +3 -4
  194. package/dist/{sst-C1pxbFEd.mjs.map → sst-CTqZZl1_.mjs.map} +1 -1
  195. package/dist/{sst-B-Uz4cvm.cjs → sst-lEkBwzGc.cjs} +4 -5
  196. package/dist/{sst-B-Uz4cvm.cjs.map → sst-lEkBwzGc.cjs.map} +1 -1
  197. package/dist/{stage-BKDdQm65.mjs → stage-2EKpzPQ1.mjs} +6 -6
  198. package/dist/{stage-BKDdQm65.mjs.map → stage-2EKpzPQ1.mjs.map} +1 -1
  199. package/dist/{stage-CJysBXWB.cjs → stage-fRfFtLwj.cjs} +7 -7
  200. package/dist/{stage-CJysBXWB.cjs.map → stage-fRfFtLwj.cjs.map} +1 -1
  201. package/dist/{stages-D4SnG5yl.cjs → stages-B7mCWI_R.cjs} +2 -2
  202. package/dist/{stages-D4SnG5yl.cjs.map → stages-B7mCWI_R.cjs.map} +1 -1
  203. package/dist/{stages-Cb9rqRbN.mjs → stages-DSltTW2d.mjs} +2 -2
  204. package/dist/{stages-Cb9rqRbN.mjs.map → stages-DSltTW2d.mjs.map} +1 -1
  205. package/dist/target/public.cjs +1 -1
  206. package/dist/target/public.d.cts +2 -2
  207. package/dist/target/public.d.mts +2 -2
  208. package/dist/target/public.mjs +1 -1
  209. package/dist/{terminal-CW_dWeTe.mjs → terminal-BAVrDhhN.mjs} +3 -3
  210. package/dist/{terminal-CW_dWeTe.mjs.map → terminal-BAVrDhhN.mjs.map} +1 -1
  211. package/dist/{terminal-DJlqcW_U.cjs → terminal-D1aeTkgv.cjs} +3 -3
  212. package/dist/{terminal-DJlqcW_U.cjs.map → terminal-D1aeTkgv.cjs.map} +1 -1
  213. package/dist/{types-HqVPddRK.d.mts → types-CFU2uvrz.d.cts} +263 -4
  214. package/dist/types-CFU2uvrz.d.cts.map +1 -0
  215. package/dist/{types-B6UXlEkf.d.cts → types-D3BeGucy.d.mts} +262 -5
  216. package/dist/types-D3BeGucy.d.mts.map +1 -0
  217. package/dist/vitest.cjs +1 -1
  218. package/dist/vitest.mjs +1 -1
  219. package/dist/workspace/index.cjs +1 -1
  220. package/dist/workspace/index.d.cts +2 -2
  221. package/dist/workspace/index.d.mts +2 -2
  222. package/dist/workspace/index.mjs +1 -1
  223. package/dist/{workspace-BwqQnool.cjs → workspace-C82GLPnf.cjs} +8 -2
  224. package/dist/workspace-C82GLPnf.cjs.map +1 -0
  225. package/dist/{workspace-D1QbNd55.mjs → workspace-DUnnVjqC.mjs} +8 -2
  226. package/dist/workspace-DUnnVjqC.mjs.map +1 -0
  227. package/package.json +17 -16
  228. package/dist/SubscriberGenerator-C8CPxrCK.cjs.map +0 -1
  229. package/dist/SubscriberGenerator-y3pncae_.mjs.map +0 -1
  230. package/dist/compose-CgBPA44v.mjs.map +0 -1
  231. package/dist/compose-bKLAtHLj.cjs.map +0 -1
  232. package/dist/config-D48erO2j.d.mts.map +0 -1
  233. package/dist/config-DHDtsQrB.d.cts.map +0 -1
  234. package/dist/credentials-B5N5yKk6.mjs.map +0 -1
  235. package/dist/credentials-Zqr3QQYB.cjs.map +0 -1
  236. package/dist/deploy-CI85F6dr.cjs.map +0 -1
  237. package/dist/deploy-Ddy8UBoE.mjs.map +0 -1
  238. package/dist/discover-C5roJuc9.mjs.map +0 -1
  239. package/dist/discover-CSW_BMWa.d.cts +0 -125
  240. package/dist/discover-CSW_BMWa.d.cts.map +0 -1
  241. package/dist/discover-DozUKs8f.cjs.map +0 -1
  242. package/dist/discover-xtT7fgWg.d.mts +0 -125
  243. package/dist/discover-xtT7fgWg.d.mts.map +0 -1
  244. package/dist/dns-BgxvvcQa.mjs.map +0 -1
  245. package/dist/dns-CfEZHt7r.cjs.map +0 -1
  246. package/dist/emit-C1e8qD08.mjs.map +0 -1
  247. package/dist/emit-Dmc1nvdS.cjs.map +0 -1
  248. package/dist/github-CO8W9SDs.cjs.map +0 -1
  249. package/dist/github-CQt3xc3o.mjs.map +0 -1
  250. package/dist/run-BJLIerMM.mjs +0 -133
  251. package/dist/run-BJLIerMM.mjs.map +0 -1
  252. package/dist/run-fVZ-rLnc.cjs +0 -174
  253. package/dist/run-fVZ-rLnc.cjs.map +0 -1
  254. package/dist/sandbox-C4g1eG31.d.mts +0 -104
  255. package/dist/sandbox-C4g1eG31.d.mts.map +0 -1
  256. package/dist/sandbox-CdKgQ3XU.d.cts +0 -104
  257. package/dist/sandbox-CdKgQ3XU.d.cts.map +0 -1
  258. package/dist/seeds-CFG-f24B.cjs.map +0 -1
  259. package/dist/seeds-oY0qDqui.mjs.map +0 -1
  260. package/dist/types-B6UXlEkf.d.cts.map +0 -1
  261. package/dist/types-HqVPddRK.d.mts.map +0 -1
  262. package/dist/workspace-BwqQnool.cjs.map +0 -1
  263. package/dist/workspace-D1QbNd55.mjs.map +0 -1
@@ -1,97 +1,24 @@
1
1
  import { t as GkmError } from "./errors-D8Gwp5kU.mjs";
2
- import { s as gkmHome } from "./run-BJLIerMM.mjs";
3
- import { r as storedCredentials } from "./credentials-B5N5yKk6.mjs";
4
- import { $ as IamUserNotOwned, G as checkS3Config, J as BucketNameUnavailable, K as AccessKeyLimit, L as resolveStageTelemetry, N as assertDeployedStage, Q as BucketRegionUnknown, U as stageProvider, W as S3_PROVISIONING, X as BucketProbeFailed, Y as BucketOwnedByAnotherProject, Z as BucketRegionMismatch, et as ProvisionedBucketUnreachable, ht as isReservedStageKey, nt as RotationInProgress, q as BucketKeySetElsewhere, rt as S3RegionRequired, tt as RecordedBucketUnreachable, u as getAppBuildOrder } from "./workspace-D1QbNd55.mjs";
5
- import { S as deploysWithCompose, _ as backupExpiries, c as stageDnsDomains, d as BACKUPS_URL_KEY, n as dnsCredentials, u as BACKUPS_SERVICE, x as stageBackups, y as backupsPrefix } from "./dns-BgxvvcQa.mjs";
2
+ import { r as storedCredentials, x as gkmHome } from "./credentials-DpfnUvIR.mjs";
3
+ import { $ as IamUserNotOwned, G as checkS3Config, J as BucketNameUnavailable, K as AccessKeyLimit, L as resolveStageTelemetry, N as assertDeployedStage, Q as BucketRegionUnknown, U as stageProvider, W as S3_PROVISIONING, X as BucketProbeFailed, Y as BucketOwnedByAnotherProject, Z as BucketRegionMismatch, et as ProvisionedBucketUnreachable, ht as isReservedStageKey, nt as RotationInProgress, q as BucketKeySetElsewhere, rt as S3RegionRequired, tt as RecordedBucketUnreachable, u as getAppBuildOrder } from "./workspace-DUnnVjqC.mjs";
4
+ import { E as BACKUPS_URL_KEY, I as stageBackups, L as deploysWithCompose, M as backupExpiries, P as backupsPrefix, T as BACKUPS_SERVICE, _ as awsClientConfig, a as subscriptionKey, b as assertSitePasswordTarget, h as stageDnsDomains, l as dnsCredentials, o as subscriptionResource, v as awsEndpoint, y as awsProvisioningCredentials } from "./snsSubscriptions-CvBIGGp0.mjs";
6
5
  import { o as builtinTarget } from "./define-6poNqm5O.mjs";
7
- import { Bt as initStageSecrets, Lt as secretsStoreFor, N as stageProviderNotes, P as PROVIDER_KINDS, X as DevServicesNeedServerTarget, Z as ExternalServicesNotConfigured, d as DeployJournal, dn as mergeLifecycle, et as devServicesUsed, ft as constructGlobs, it as stageServiceDeclarations, j as assertStageProvidersEnabled, nr as isMainFrontendApp, nt as reportDevServices, ot as appEnvKeys, rr as resolveHost, tr as NoDomainForStage, tt as externalServices, v as createComposeState, y as createEmptyState, zn as usesTelemetry } from "./seeds-oY0qDqui.mjs";
6
+ import { Bn as usesTelemetry, Bt as initStageSecrets, Lt as secretsStoreFor, N as stageProviderNotes, P as PROVIDER_KINDS, X as DevServicesNeedServerTarget, Z as ExternalServicesNotConfigured, ar as isMainFrontendApp, d as DeployJournal, et as devServicesUsed, fn as mergeLifecycle, ft as constructGlobs, ir as NoDomainForStage, it as stageServiceDeclarations, j as assertStageProvidersEnabled, nt as reportDevServices, or as resolveHost, ot as appEnvKeys, tt as externalServices, v as createComposeState, y as createEmptyState } from "./seeds-rG-Evfz9.mjs";
8
7
  import { n as derivedApps, t as appKey } from "./derive-B4vDpzgP.mjs";
8
+ import { s as subscriberRoute } from "./SubscriberGenerator-COAVPgM-.mjs";
9
9
  import { n as deployIdentity, t as applicationName } from "./identity-CBXr4wNi.mjs";
10
- import { i as discover, p as withOutput } from "./discover-C5roJuc9.mjs";
10
+ import { i as discover, m as eventsEdge, p as withOutput } from "./discover-BvJOVsYG.mjs";
11
11
  import { c as withSandbox } from "./sandbox-CbVB7uOD.mjs";
12
12
  import { findWorkspaceRoot, loadWorkspaceConfig } from "./config.mjs";
13
- import { a as parseTargetOptions, o as resolveTarget } from "./resolve-DSilYpzm.mjs";
14
- import { t as LocalSandbox } from "./local-BwC2v2Y8.mjs";
15
- import { E as eventError, S as createStateStore, v as assertStateOutlivesRun, y as assertStateRoom } from "./sniffer-Cgx608Tl.mjs";
13
+ import { a as parseTargetOptions, o as resolveTarget } from "./resolve-BT7fkPN5.mjs";
14
+ import { t as LocalSandbox } from "./local-B7Zv1NoA.mjs";
15
+ import { E as eventError, S as createStateStore, v as assertStateOutlivesRun, y as assertStateRoom } from "./sniffer-DVPgfyHr.mjs";
16
16
  import { a as findProjectBucket, i as ensureProjectBucket, o as projectBucketName, r as callerAccountId, s as reconcileProjectBucketLifecycle } from "./projectBucket-C_DN4WzF.mjs";
17
- import { n as assertStageCredentials } from "./credentialSchemas-DDOLRCLF.mjs";
17
+ import { n as assertStageCredentials } from "./credentialSchemas-DLKbxYBy.mjs";
18
18
  import { resolve } from "node:path";
19
19
  import { randomInt } from "node:crypto";
20
20
  import { dependentsOf, kebabCase, provideKey, providedKeyFor } from "@geekmidas/manifest";
21
21
  import * as s3Url from "@geekmidas/storage/s3-url";
22
- //#region src/providers/aws.ts
23
- /**
24
- * The AWS account a provider provisions in — the stage's, found the way the
25
- * SSM and Secrets Manager stores find it.
26
- *
27
- * 1. `--profile`, resolved on its own: exported keys left over from another
28
- * account never win over a profile someone named.
29
- * 2. `AWS_PROFILE`, else `AWS_ACCESS_KEY_ID`/`AWS_SECRET_ACCESS_KEY` — the
30
- * deploy's own `aws` credential kind (`storedCredentials`).
31
- * 3. The SDK's default chain: `~/.aws` default profile, SSO, a role. In CI,
32
- * whatever `aws-actions/configure-aws-credentials` exported.
33
- *
34
- * None of them: the provider has no provisioning credentials, and the stage
35
- * is treated as `external`.
36
- */
37
- async function awsProvisioningCredentials(lookup) {
38
- const region = lookup.env.AWS_REGION ?? lookup.env.AWS_DEFAULT_REGION;
39
- const where = region ? { region } : {};
40
- if (lookup.profile) return {
41
- profile: lookup.profile,
42
- ...where
43
- };
44
- const stored = await storedCredentials({
45
- env: lookup.env,
46
- ...lookup.home ? { home: lookup.home } : {}
47
- }).get({
48
- kind: "aws",
49
- stage: lookup.stage
50
- });
51
- if (stored) return stored;
52
- try {
53
- const { fromNodeProviderChain } = await import("@aws-sdk/credential-providers");
54
- await fromNodeProviderChain({
55
- timeout: 1e3,
56
- maxRetries: 0
57
- })();
58
- return {
59
- chain: true,
60
- ...where
61
- };
62
- } catch {
63
- return;
64
- }
65
- }
66
- /**
67
- * An S3-compatible endpoint the environment points the SDK at — the AWS
68
- * emulator in tests. The SDK reads it itself; it is read here too, because
69
- * an emulator takes path-style requests, and a key written for one has to
70
- * say where it is.
71
- */
72
- function awsEndpoint(env, service) {
73
- return env[`AWS_ENDPOINT_URL_${service}`] ?? env.AWS_ENDPOINT_URL;
74
- }
75
- /** An SDK client's config for a provisioning credential. */
76
- async function awsClientConfig(credential, region) {
77
- if ("profile" in credential) {
78
- const { fromIni } = await import("@aws-sdk/credential-providers");
79
- return {
80
- region,
81
- credentials: fromIni({ profile: credential.profile })
82
- };
83
- }
84
- if ("accessKeyId" in credential) return {
85
- region,
86
- credentials: {
87
- accessKeyId: credential.accessKeyId,
88
- secretAccessKey: credential.secretAccessKey,
89
- ...credential.sessionToken ? { sessionToken: credential.sessionToken } : {}
90
- }
91
- };
92
- return { region };
93
- }
94
- //#endregion
95
22
  //#region src/target/secrets.ts
96
23
  /**
97
24
  * A stage's secrets as a target sees them: read and written through the
@@ -247,28 +174,37 @@ const bucketArn = (bucket) => `arn:aws:s3:::${bucket}`;
247
174
  function userPolicy(bucket, options = {}) {
248
175
  return {
249
176
  Version: "2012-10-17",
250
- Statement: [{
251
- Sid: "GkmObjects",
252
- Effect: "Allow",
253
- Action: [
254
- "s3:GetObject",
255
- "s3:PutObject",
256
- "s3:DeleteObject",
257
- "s3:AbortMultipartUpload",
258
- "s3:ListMultipartUploadParts",
259
- ...options.versioning ? ["s3:GetObjectVersion"] : []
260
- ],
261
- Resource: `${bucketArn(bucket)}/*`
262
- }, {
263
- Sid: "GkmBucket",
264
- Effect: "Allow",
265
- Action: [
266
- "s3:ListBucket",
267
- "s3:GetBucketLocation",
268
- "s3:ListBucketMultipartUploads"
269
- ],
270
- Resource: bucketArn(bucket)
271
- }]
177
+ Statement: [
178
+ {
179
+ Sid: "GkmObjects",
180
+ Effect: "Allow",
181
+ Action: [
182
+ "s3:GetObject",
183
+ "s3:PutObject",
184
+ "s3:DeleteObject",
185
+ "s3:AbortMultipartUpload",
186
+ "s3:ListMultipartUploadParts",
187
+ ...options.versioning ? ["s3:GetObjectVersion"] : []
188
+ ],
189
+ Resource: `${bucketArn(bucket)}/*`
190
+ },
191
+ {
192
+ Sid: "GkmBucket",
193
+ Effect: "Allow",
194
+ Action: [
195
+ "s3:ListBucket",
196
+ "s3:GetBucketLocation",
197
+ "s3:ListBucketMultipartUploads"
198
+ ],
199
+ Resource: bucketArn(bucket)
200
+ },
201
+ ...options.eventsTopicArn ? [{
202
+ Sid: "GkmEvents",
203
+ Effect: "Allow",
204
+ Action: "sns:ConfirmSubscription",
205
+ Resource: options.eventsTopicArn
206
+ }] : []
207
+ ]
272
208
  };
273
209
  }
274
210
  /**
@@ -395,7 +331,7 @@ function identityTags(ctx, id) {
395
331
  ];
396
332
  }
397
333
  /** A read whose "there is none" answer is one of `missing`. */
398
- async function readOr$1(read, missing) {
334
+ async function readOr$2(read, missing) {
399
335
  try {
400
336
  return await read();
401
337
  } catch (error) {
@@ -425,7 +361,7 @@ async function ensureIamUser(ctx, clients, input) {
425
361
  key: `iam-user:${id}`,
426
362
  type: "iam-user"
427
363
  };
428
- const found = await readOr$1(() => iam.send(new IAM.GetUserCommand({ UserName: user })), ["NoSuchEntity", "NoSuchEntityException"]);
364
+ const found = await readOr$2(() => iam.send(new IAM.GetUserCommand({ UserName: user })), ["NoSuchEntity", "NoSuchEntityException"]);
429
365
  if (found?.User) {
430
366
  const tags = await iam.send(new IAM.ListUserTagsCommand({ UserName: user }));
431
367
  const tag = (key) => tags.Tags?.find((t) => t.Key === key)?.Value;
@@ -445,7 +381,7 @@ async function ensureIamUser(ctx, clients, input) {
445
381
  await ctx.state.ready(entry, user);
446
382
  });
447
383
  const exists = Boolean(found?.User) || !ctx.dryRun;
448
- const current = exists ? await readOr$1(() => iam.send(new IAM.GetUserPolicyCommand({
384
+ const current = exists ? await readOr$2(() => iam.send(new IAM.GetUserPolicyCommand({
449
385
  UserName: user,
450
386
  PolicyName: input.policyName
451
387
  })), ["NoSuchEntity", "NoSuchEntityException"]) : void 0;
@@ -859,6 +795,376 @@ async function verifyStageBackups(input) {
859
795
  }
860
796
  }
861
797
  //#endregion
798
+ //#region src/providers/s3/events.ts
799
+ /** What S3 tells the topic about: every object written, and every removed. */
800
+ const BUCKET_EVENTS = ["s3:ObjectCreated:*", "s3:ObjectRemoved:*"];
801
+ /**
802
+ * Each bucket a subscriber watches, with the subscribers discovery could name.
803
+ *
804
+ * A bucket is watched when a process consumes its events — discovery records
805
+ * the edge, and the subscriber by its export — or when a build put a
806
+ * subscriber in its declaration. Only a named subscriber can be subscribed: a
807
+ * route is named after its export.
808
+ */
809
+ function bucketWatchers(manifest, runnables, subscribers = {}) {
810
+ const watched = /* @__PURE__ */ new Map();
811
+ for (const [id, declaration] of Object.entries(manifest)) {
812
+ if (declaration.kind !== "objects") continue;
813
+ const key = provideKey(id, "eventsConnectionString");
814
+ const named = Object.entries(subscribers).flatMap(([worker, bound]) => bound.filter((s) => s.connectionKey === key).map((s) => ({
815
+ worker,
816
+ name: s.name
817
+ }))).sort((a, b) => `${a.worker}/${a.name}`.localeCompare(`${b.worker}/${b.name}`));
818
+ const edged = Object.values(runnables).some((edges) => edges.includes(eventsEdge(id)));
819
+ const declared = (declaration.subscribers?.length ?? 0) > 0;
820
+ if (named.length > 0 || edged || declared) watched.set(id, named);
821
+ }
822
+ return watched;
823
+ }
824
+ /** The topic a bucket's changes are published to. */
825
+ function eventsTopicName(bucket) {
826
+ return `${bucket.replaceAll(".", "-")}-events`;
827
+ }
828
+ /** What SNS gives up delivering, kept. */
829
+ function eventsDeadLetterName(bucket) {
830
+ return `${eventsTopicName(bucket)}-dlq`;
831
+ }
832
+ /** Only this bucket, in this account, may publish to its topic. */
833
+ function eventsTopicPolicy(topicArn, bucket, account) {
834
+ return {
835
+ Version: "2012-10-17",
836
+ Statement: [{
837
+ Sid: "GkmBucketPublishes",
838
+ Effect: "Allow",
839
+ Principal: { Service: "s3.amazonaws.com" },
840
+ Action: "sns:Publish",
841
+ Resource: topicArn,
842
+ Condition: {
843
+ ArnLike: { "aws:SourceArn": `arn:aws:s3:::${bucket}` },
844
+ StringEquals: { "aws:SourceAccount": account }
845
+ }
846
+ }]
847
+ };
848
+ }
849
+ /** Only the bucket's topic may send to its dead-letter queue. */
850
+ function eventsDeadLetterPolicy(queueArn, topicArn) {
851
+ return {
852
+ Version: "2012-10-17",
853
+ Statement: [{
854
+ Sid: "GkmTopicDeadLetters",
855
+ Effect: "Allow",
856
+ Principal: { Service: "sns.amazonaws.com" },
857
+ Action: "sqs:SendMessage",
858
+ Resource: queueArn,
859
+ Condition: { ArnEquals: { "aws:SourceArn": topicArn } }
860
+ }]
861
+ };
862
+ }
863
+ /** The id this provider's notification entry goes under. */
864
+ const notificationId = (id) => `gkm-${id}`;
865
+ /**
866
+ * The bucket's notifications with this provider's entry put back, and whether
867
+ * that changed anything. Every other entry — a queue, a function, a topic
868
+ * somebody added by hand — is kept exactly as it was.
869
+ */
870
+ function mergedNotifications(current, id, topicArn) {
871
+ const own = notificationId(id);
872
+ const wanted = {
873
+ Id: own,
874
+ TopicArn: topicArn,
875
+ Events: [...BUCKET_EVENTS]
876
+ };
877
+ const topics = current.TopicConfigurations ?? [];
878
+ const existing = topics.find((t) => t.Id === own);
879
+ const same = existing !== void 0 && existing.TopicArn === topicArn && JSON.stringify([...existing.Events ?? []].sort()) === JSON.stringify([...BUCKET_EVENTS].sort()) && existing.Filter === void 0;
880
+ const { ResponseMetadata: _, ...rest } = current;
881
+ return {
882
+ config: {
883
+ ...rest,
884
+ TopicConfigurations: [...topics.filter((t) => t.Id !== own), wanted]
885
+ },
886
+ changed: !same
887
+ };
888
+ }
889
+ /** S3 refused the entry because another one already covers these events. */
890
+ var BucketNotificationsOverlap = class extends GkmError {
891
+ bucket;
892
+ detail;
893
+ constructor(bucket, detail) {
894
+ super(`'${bucket}' already sends object creates or deletes somewhere else, and S3 sends each event to one place only, so the deploy cannot add its own entry. Remove the other notification from the bucket, or give it a prefix, and deploy again. S3 said: ${detail}`);
895
+ this.bucket = bucket;
896
+ this.detail = detail;
897
+ this.name = "BucketNotificationsOverlap";
898
+ }
899
+ };
900
+ const defaultEventsClients = async (credential, region) => {
901
+ const SNS = await import("@aws-sdk/client-sns");
902
+ const SQS = await import("@aws-sdk/client-sqs");
903
+ const { STSClient, GetCallerIdentityCommand } = await import("@aws-sdk/client-sts");
904
+ const config = await awsClientConfig(credential, region);
905
+ const endpoint = awsEndpoint(process.env, "SNS");
906
+ const sts = new STSClient({
907
+ ...config,
908
+ ...awsEndpoint(process.env, "STS") ? { endpoint: awsEndpoint(process.env, "STS") } : {}
909
+ });
910
+ const { Account } = await sts.send(new GetCallerIdentityCommand({}));
911
+ sts.destroy();
912
+ return {
913
+ SNS,
914
+ SQS,
915
+ sns: new SNS.SNSClient({
916
+ ...config,
917
+ ...endpoint ? { endpoint } : {}
918
+ }),
919
+ sqs: new SQS.SQSClient({
920
+ ...config,
921
+ ...awsEndpoint(process.env, "SQS") ? { endpoint: awsEndpoint(process.env, "SQS") } : {}
922
+ }),
923
+ account: Account,
924
+ region,
925
+ ...endpoint ? { endpoint } : {}
926
+ };
927
+ };
928
+ let makeEventsClients = defaultEventsClients;
929
+ function errorName$1(error) {
930
+ const e = error;
931
+ return e?.name ?? e?.Code ?? e?.code ?? "";
932
+ }
933
+ async function readOr$1(read, missing) {
934
+ try {
935
+ return await read();
936
+ } catch (error) {
937
+ if (missing.includes(errorName$1(error))) return void 0;
938
+ throw error;
939
+ }
940
+ }
941
+ /**
942
+ * The topic, its policy, the dead-letter queue and the bucket's notification
943
+ * entry for one watched bucket — created where missing, put back where they
944
+ * drifted.
945
+ */
946
+ async function ensureBucketEvents(ctx, s3, input) {
947
+ const { id, bucket, region } = input;
948
+ const { SNS, SQS, sns, sqs, account } = await makeEventsClients(ctx.credential, region);
949
+ const topicName = eventsTopicName(bucket);
950
+ const topicArn = `arn:aws:sns:${region}:${account}:${topicName}`;
951
+ const topicEntry = {
952
+ key: `sns-topic:${id}`,
953
+ type: "sns-topic"
954
+ };
955
+ const topic = await readOr$1(() => sns.send(new SNS.GetTopicAttributesCommand({ TopicArn: topicArn })), ["NotFound", "NotFoundException"]);
956
+ if (topic) await ctx.state.ready(topicEntry, topicArn);
957
+ else await ctx.change({
958
+ construct: id,
959
+ resource: `SNS topic ${topicName}`,
960
+ change: "create"
961
+ }, async () => {
962
+ await ctx.state.pending(topicEntry);
963
+ await sns.send(new SNS.CreateTopicCommand({
964
+ Name: topicName,
965
+ Tags: identityTags(ctx, id)
966
+ }));
967
+ await ctx.state.ready(topicEntry, topicArn);
968
+ });
969
+ const topicPolicy = eventsTopicPolicy(topicArn, bucket, account);
970
+ const currentTopicPolicy = topic?.Attributes?.Policy;
971
+ if (!currentTopicPolicy || canonicalPolicy(JSON.parse(currentTopicPolicy)) !== canonicalPolicy(topicPolicy)) await ctx.change({
972
+ construct: id,
973
+ resource: `SNS topic ${topicName}`,
974
+ change: `publishable by '${bucket}' only`
975
+ }, async () => {
976
+ await sns.send(new SNS.SetTopicAttributesCommand({
977
+ TopicArn: topicArn,
978
+ AttributeName: "Policy",
979
+ AttributeValue: JSON.stringify(topicPolicy)
980
+ }));
981
+ });
982
+ const queueName = eventsDeadLetterName(bucket);
983
+ const deadLetterArn = `arn:aws:sqs:${region}:${account}:${queueName}`;
984
+ const queueEntry = {
985
+ key: `sqs-queue:${id}-events-dlq`,
986
+ type: "sqs-queue"
987
+ };
988
+ const queue = await readOr$1(() => sqs.send(new SQS.GetQueueUrlCommand({ QueueName: queueName })), ["QueueDoesNotExist", "AWS.SimpleQueueService.NonExistentQueue"]);
989
+ let queueUrl = queue?.QueueUrl;
990
+ if (queueUrl) await ctx.state.ready(queueEntry, deadLetterArn);
991
+ else await ctx.change({
992
+ construct: id,
993
+ resource: `SQS queue ${queueName}`,
994
+ change: "create"
995
+ }, async () => {
996
+ await ctx.state.pending(queueEntry);
997
+ queueUrl = (await sqs.send(new SQS.CreateQueueCommand({
998
+ QueueName: queueName,
999
+ Attributes: { MessageRetentionPeriod: "1209600" },
1000
+ tags: Object.fromEntries(identityTags(ctx, id).map((t) => [t.Key, t.Value]))
1001
+ }))).QueueUrl;
1002
+ await ctx.state.ready(queueEntry, deadLetterArn);
1003
+ });
1004
+ const queuePolicy = eventsDeadLetterPolicy(deadLetterArn, topicArn);
1005
+ const currentQueuePolicy = queue?.QueueUrl ? (await sqs.send(new SQS.GetQueueAttributesCommand({
1006
+ QueueUrl: queue.QueueUrl,
1007
+ AttributeNames: ["Policy"]
1008
+ }))).Attributes?.Policy : void 0;
1009
+ if (!currentQueuePolicy || canonicalPolicy(JSON.parse(currentQueuePolicy)) !== canonicalPolicy(queuePolicy)) await ctx.change({
1010
+ construct: id,
1011
+ resource: `SQS queue ${queueName}`,
1012
+ change: `receives what ${topicName} cannot deliver`
1013
+ }, async () => {
1014
+ await sqs.send(new SQS.SetQueueAttributesCommand({
1015
+ QueueUrl: queueUrl,
1016
+ Attributes: { Policy: JSON.stringify(queuePolicy) }
1017
+ }));
1018
+ });
1019
+ const merged = mergedNotifications(await readOr$1(() => s3.s3.send(new s3.S3.GetBucketNotificationConfigurationCommand({ Bucket: bucket })), ["NoSuchBucket"]) ?? {}, id, topicArn);
1020
+ if (merged.changed) await ctx.change({
1021
+ construct: id,
1022
+ resource: `bucket ${bucket}`,
1023
+ change: `send object creates and deletes to ${topicName}`
1024
+ }, async () => {
1025
+ try {
1026
+ await s3.s3.send(new s3.S3.PutBucketNotificationConfigurationCommand({
1027
+ Bucket: bucket,
1028
+ NotificationConfiguration: merged.config
1029
+ }));
1030
+ } catch (error) {
1031
+ const message = error.message ?? "";
1032
+ if (/overlap/i.test(message)) throw new BucketNotificationsOverlap(bucket, message);
1033
+ throw error;
1034
+ }
1035
+ });
1036
+ sns.destroy();
1037
+ sqs.destroy();
1038
+ return {
1039
+ topicArn,
1040
+ deadLetterArn
1041
+ };
1042
+ }
1043
+ /**
1044
+ * The events key: the topic's address, signed by the bucket's own access key
1045
+ * — read off the bucket's URL, so a rotated key rotates this one with it.
1046
+ */
1047
+ async function ensureEventsKey(ctx, input) {
1048
+ const { id, topicArn, region } = input;
1049
+ const key = provideKey(id, "eventsConnectionString");
1050
+ const url = ctx.secrets[provideKey(id, "url")];
1051
+ let parsed;
1052
+ try {
1053
+ parsed = url ? s3Url.parse(url) : void 0;
1054
+ } catch {
1055
+ parsed = void 0;
1056
+ }
1057
+ if (!parsed?.accessKeyId || !parsed.secretAccessKey) {
1058
+ await ctx.change({
1059
+ construct: id,
1060
+ resource: key,
1061
+ change: "set to the topic’s address"
1062
+ }, async () => {});
1063
+ return;
1064
+ }
1065
+ const { snsUrl } = await import("@geekmidas/events/sns");
1066
+ const endpoint = awsEndpoint(process.env, "SNS");
1067
+ const address = new URL(snsUrl.build({
1068
+ topicArn,
1069
+ region,
1070
+ ...endpoint ? { endpoint } : {}
1071
+ }));
1072
+ address.searchParams.set("accessKeyId", parsed.accessKeyId);
1073
+ address.searchParams.set("secretAccessKey", parsed.secretAccessKey);
1074
+ const value = address.toString();
1075
+ const entry = {
1076
+ key: `events-key:${id}`,
1077
+ type: "url"
1078
+ };
1079
+ if (ctx.secrets[key] === value) {
1080
+ await ctx.state.ready(entry, topicArn);
1081
+ return;
1082
+ }
1083
+ await ctx.change({
1084
+ construct: id,
1085
+ resource: key,
1086
+ change: `set to ${topicArn}`
1087
+ }, async () => {
1088
+ await ctx.writeSecrets({ [key]: value });
1089
+ await ctx.state.ready(entry, topicArn);
1090
+ });
1091
+ }
1092
+ /** Where SNS pushes to a worker: its own host on the stage's domain. */
1093
+ function workerPushHost(worker, domain) {
1094
+ return `${appKey(worker)}.${domain}`;
1095
+ }
1096
+ /**
1097
+ * One HTTP subscription per subscriber to the bucket's topic, at its route on
1098
+ * its worker's host, with the bucket's dead-letter queue — and each ARN
1099
+ * recorded, which is what the worker accepts deliveries under.
1100
+ *
1101
+ * Unfiltered: a bucket's notifications carry no `type` attribute, and the
1102
+ * subscriber's own filter — events, prefix, suffix — is what decides. Only a
1103
+ * compose stage pushes to a worker; any other is told so and left alone.
1104
+ */
1105
+ async function ensurePushSubscriptions(ctx, input) {
1106
+ const { id, events, region, watchers } = input;
1107
+ if (!deploysWithCompose(ctx.workspace)) {
1108
+ ctx.log(` '${id}' is watched, and only a compose stage pushes a bucket's changes to a worker: its subscribers receive nothing on '${ctx.stage}'`);
1109
+ return;
1110
+ }
1111
+ if (watchers.length === 0) return;
1112
+ const domain = ctx.workspace.domains?.[ctx.stage];
1113
+ if (!domain) throw new NoDomainForStage(ctx.stage);
1114
+ const { SNSConnection, reconcileHttpSubscriptions } = await import("@geekmidas/events/sns");
1115
+ const { credentials } = await awsClientConfig(ctx.credential, region);
1116
+ const endpoint = awsEndpoint(process.env, "SNS");
1117
+ const byWorker = /* @__PURE__ */ new Map();
1118
+ for (const watcher of watchers) byWorker.set(watcher.worker, [...byWorker.get(watcher.worker) ?? [], watcher]);
1119
+ for (const [worker, own] of byWorker) {
1120
+ const host = workerPushHost(worker, domain);
1121
+ const endpoints = own.map(({ name }) => ({
1122
+ name,
1123
+ endpoint: `https://${host}${subscriberRoute(name)}`,
1124
+ deadLetterQueueArn: events.deadLetterArn
1125
+ }));
1126
+ const unrecorded = own.filter(({ name }) => ctx.state.record(subscriptionKey(worker, name))?.status !== "ready");
1127
+ if (ctx.dryRun) {
1128
+ if (unrecorded.length > 0) await ctx.change({
1129
+ construct: id,
1130
+ resource: `SNS subscriptions on ${host}`,
1131
+ change: `subscribe ${unrecorded.map((w) => w.name).join(", ")}`
1132
+ }, async () => {});
1133
+ continue;
1134
+ }
1135
+ const connection = new SNSConnection({
1136
+ topicArn: events.topicArn,
1137
+ region,
1138
+ ...endpoint ? { endpoint } : {},
1139
+ ...credentials ? { credentials } : {}
1140
+ });
1141
+ const result = await reconcileHttpSubscriptions(connection, {
1142
+ endpoints,
1143
+ ownedHost: host
1144
+ });
1145
+ await connection.close();
1146
+ for (const spec of endpoints) {
1147
+ const arn = result.subscriptions[spec.name];
1148
+ const pending = result.pending.includes(spec.name);
1149
+ if (ctx.state.record(subscriptionKey(worker, spec.name))?.id !== arn) ctx.log(` ✓ '${spec.name}' subscribed to ${events.topicArn.split(":").pop()} at ${spec.endpoint}`);
1150
+ const { key, type, data } = subscriptionResource({
1151
+ worker,
1152
+ name: spec.name,
1153
+ topicArn: events.topicArn,
1154
+ endpoint: spec.endpoint,
1155
+ deadLetterQueueArn: events.deadLetterArn,
1156
+ pending
1157
+ }, arn);
1158
+ await ctx.state.ready({
1159
+ key,
1160
+ type,
1161
+ ...data ? { data } : {}
1162
+ }, arn);
1163
+ }
1164
+ for (const arn of result.removed) ctx.log(` – unsubscribed ${arn}: no subscriber wants it any more`);
1165
+ }
1166
+ }
1167
+ //#endregion
862
1168
  //#region src/providers/s3/origins.ts
863
1169
  /**
864
1170
  * Which browser origins may call a bucket: the stage's sites that depend on
@@ -1052,9 +1358,10 @@ let makeClients = defaultClients;
1052
1358
  async function ensureS3(ctx) {
1053
1359
  const region = s3Region(ctx);
1054
1360
  const clients = await makeClients(ctx.credential, region);
1055
- for (const construct of bucketConstructs(ctx.manifest)) await ensureBucket(ctx, clients, construct);
1361
+ const watched = bucketWatchers(ctx.manifest, ctx.runnables, ctx.subscribers);
1362
+ for (const construct of bucketConstructs(ctx.manifest)) await ensureBucket(ctx, clients, construct, watched.get(construct.id));
1056
1363
  }
1057
- async function ensureBucket(ctx, stageClients, construct) {
1364
+ async function ensureBucket(ctx, stageClients, construct, watchers) {
1058
1365
  const { id } = construct;
1059
1366
  const nameInput = {
1060
1367
  scope: ctx.identity.scope,
@@ -1078,11 +1385,19 @@ async function ensureBucket(ctx, stageClients, construct) {
1078
1385
  open,
1079
1386
  ...construct.expire ? { expire: construct.expire } : {}
1080
1387
  });
1388
+ const events = watchers ? await ensureBucketEvents(ctx, clients, {
1389
+ id,
1390
+ bucket,
1391
+ region: clients.region
1392
+ }) : void 0;
1081
1393
  const user = await ensureIamUser(ctx, clients, {
1082
1394
  id,
1083
1395
  user: iamUserName(nameInput),
1084
1396
  policyName: IAM_POLICY_NAME,
1085
- policy: userPolicy(bucket, { versioning }),
1397
+ policy: userPolicy(bucket, {
1398
+ versioning,
1399
+ ...events ? { eventsTopicArn: events.topicArn } : {}
1400
+ }),
1086
1401
  describe: "this bucket only"
1087
1402
  });
1088
1403
  await ensureAccessKey(ctx, clients, {
@@ -1091,6 +1406,19 @@ async function ensureBucket(ctx, stageClients, construct) {
1091
1406
  urlKey: provideKey(id, "url"),
1092
1407
  ...user
1093
1408
  });
1409
+ if (events && watchers) {
1410
+ await ensureEventsKey(ctx, {
1411
+ id,
1412
+ topicArn: events.topicArn,
1413
+ region: clients.region
1414
+ });
1415
+ await ensurePushSubscriptions(ctx, {
1416
+ id,
1417
+ events,
1418
+ region: clients.region,
1419
+ watchers
1420
+ });
1421
+ }
1094
1422
  const publicUrl = bucketPublicUrl(bucket, clients.region, clients.endpoint);
1095
1423
  for (const server of construct.servers) {
1096
1424
  const key = provideKey(server.id, "url");
@@ -1393,8 +1721,13 @@ const BUILTIN_PROVIDERS = { objects: { s3: {
1393
1721
  check: checkS3Config,
1394
1722
  provisioning: S3_PROVISIONING,
1395
1723
  credentials: awsProvisioningCredentials,
1396
- runtimeKeys(manifest) {
1397
- return bucketConstructs(manifest).flatMap((b) => [provideKey(b.id, "url"), ...b.servers.map((s) => provideKey(s.id, "url"))]);
1724
+ runtimeKeys(manifest, runnables = {}) {
1725
+ const watched = bucketWatchers(manifest, runnables);
1726
+ return bucketConstructs(manifest).flatMap((b) => [
1727
+ provideKey(b.id, "url"),
1728
+ ...watched.has(b.id) ? [provideKey(b.id, "eventsConnectionString")] : [],
1729
+ ...b.servers.map((s) => provideKey(s.id, "url"))
1730
+ ]);
1398
1731
  },
1399
1732
  ensure: ensureS3,
1400
1733
  verify: verifyS3
@@ -1519,7 +1852,7 @@ async function provisionStage(options) {
1519
1852
  }
1520
1853
  const identity = deployIdentity(workspace, stage);
1521
1854
  let secrets = (await options.secrets.read())?.custom ?? {};
1522
- for (const entry of configured) entry.report.planned = entry.provider.runtimeKeys(manifest).filter((key) => secrets[key] === void 0);
1855
+ for (const entry of configured) entry.report.planned = entry.provider.runtimeKeys(manifest, runnables).filter((key) => secrets[key] === void 0);
1523
1856
  const state = dryRun ? await readOnlyState(options.state, stage) : journalState(await DeployJournal.open(options.state, stage, () => deploysWithCompose(workspace) ? createComposeState(stage) : createEmptyState(stage, "", "")));
1524
1857
  const writeSecrets = async (values) => {
1525
1858
  if (dryRun) return;
@@ -1541,6 +1874,7 @@ async function provisionStage(options) {
1541
1874
  workspace,
1542
1875
  manifest,
1543
1876
  runnables,
1877
+ ...options.subscribers ? { subscribers: options.subscribers } : {},
1544
1878
  stage,
1545
1879
  identity,
1546
1880
  config: entry.config,
@@ -1993,6 +2327,7 @@ async function provisionResources(phaseCtx, request, ctx, store, emit) {
1993
2327
  stage: phaseCtx.stage,
1994
2328
  manifest: phaseCtx.manifest,
1995
2329
  runnables: phaseCtx.runnables ?? {},
2330
+ ...phaseCtx.subscribers ? { subscribers: phaseCtx.subscribers } : {},
1996
2331
  secrets: phaseCtx.secrets,
1997
2332
  state: store,
1998
2333
  dryRun: ctx.dryRun,
@@ -2084,13 +2419,16 @@ async function prepare(source, request, ctx, emit, redactor) {
2084
2419
  const options = await parseTargetOptions(resolved);
2085
2420
  const allowDevServices = request.allowDevServices === true;
2086
2421
  if (allowDevServices && resolved.target.runtime === "aws") throw new DevServicesNeedServerTarget(targetName);
2422
+ assertSitePasswordTarget(configured, stage, resolved.target.name);
2087
2423
  const runnables = {};
2088
2424
  const background = {};
2425
+ const subscribers = {};
2089
2426
  const manifest = await discover({
2090
2427
  patterns: constructGlobs(configured),
2091
2428
  cwd: configured.root,
2092
2429
  runnables,
2093
- background
2430
+ background,
2431
+ subscribers
2094
2432
  });
2095
2433
  resolveStageTelemetry({
2096
2434
  ...configured.deploy?.telemetry ? { telemetry: configured.deploy.telemetry } : {},
@@ -2171,6 +2509,7 @@ async function prepare(source, request, ctx, emit, redactor) {
2171
2509
  manifest,
2172
2510
  runnables,
2173
2511
  background,
2512
+ subscribers,
2174
2513
  options,
2175
2514
  dryRun: ctx.dryRun,
2176
2515
  atomic: request.atomic ?? false,
@@ -2323,6 +2662,6 @@ async function load(input, sandbox) {
2323
2662
  return workspace;
2324
2663
  }
2325
2664
  //#endregion
2326
- export { UnknownDeployApps as a, bucketName as c, awsEndpoint as d, awsProvisioningCredentials as f, TargetBuildsNothing as i, iamUserName as l, NoDeployableApps as n, backupsUserName as o, RollbackFailed as r, IAM_USER_PATH as s, deploy as t, awsClientConfig as u };
2665
+ 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 };
2327
2666
 
2328
- //# sourceMappingURL=deploy-Ddy8UBoE.mjs.map
2667
+ //# sourceMappingURL=deploy-CiRYwFmr.mjs.map