@geekmidas/cli 10.0.0-alpha.139 → 10.0.0-alpha.140

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 (221) hide show
  1. package/dist/{EndpointGenerator-DDfPq2AZ.mjs → EndpointGenerator-BMRL04ic.mjs} +2 -2
  2. package/dist/{EndpointGenerator-DDfPq2AZ.mjs.map → EndpointGenerator-BMRL04ic.mjs.map} +1 -1
  3. package/dist/{EndpointGenerator-BGKb_Ie6.cjs → EndpointGenerator-ePscnbwB.cjs} +2 -2
  4. package/dist/{EndpointGenerator-BGKb_Ie6.cjs.map → EndpointGenerator-ePscnbwB.cjs.map} +1 -1
  5. package/dist/{GoDaddyProvider-baMIwhIy.mjs → GoDaddyProvider-BgY6mqoH.mjs} +42 -17
  6. package/dist/GoDaddyProvider-BgY6mqoH.mjs.map +1 -0
  7. package/dist/{GoDaddyProvider-DA0rzRQt.cjs → GoDaddyProvider-C-rs22Zv.cjs} +42 -17
  8. package/dist/GoDaddyProvider-C-rs22Zv.cjs.map +1 -0
  9. package/dist/{HostingerProvider-Cjh_2Ml6.mjs → HostingerProvider-CgMuKgO_.mjs} +13 -4
  10. package/dist/HostingerProvider-CgMuKgO_.mjs.map +1 -0
  11. package/dist/{HostingerProvider-OdQmKXE3.cjs → HostingerProvider-DEqpvoiD.cjs} +13 -4
  12. package/dist/HostingerProvider-DEqpvoiD.cjs.map +1 -0
  13. package/dist/{LegacyStateStore-h1u5xlpb.cjs → LegacyStateStore-6xskEtld.cjs} +3 -3
  14. package/dist/{LegacyStateStore-h1u5xlpb.cjs.map → LegacyStateStore-6xskEtld.cjs.map} +1 -1
  15. package/dist/{LegacyStateStore-BSrw1yNS.mjs → LegacyStateStore-Dx65SWE9.mjs} +3 -3
  16. package/dist/{LegacyStateStore-BSrw1yNS.mjs.map → LegacyStateStore-Dx65SWE9.mjs.map} +1 -1
  17. package/dist/{LocalStateStore-HmKqUWkF.cjs → LocalStateStore-DFtTtHty.cjs} +2 -2
  18. package/dist/{LocalStateStore-HmKqUWkF.cjs.map → LocalStateStore-DFtTtHty.cjs.map} +1 -1
  19. package/dist/{LocalStateStore-BlH6Eanc.mjs → LocalStateStore-Dto39TCx.mjs} +2 -2
  20. package/dist/{LocalStateStore-BlH6Eanc.mjs.map → LocalStateStore-Dto39TCx.mjs.map} +1 -1
  21. package/dist/{OpenApiTsGenerator-DSy2gbfi.mjs → OpenApiTsGenerator-B-PQLx8X.mjs} +2 -2
  22. package/dist/{OpenApiTsGenerator-DSy2gbfi.mjs.map → OpenApiTsGenerator-B-PQLx8X.mjs.map} +1 -1
  23. package/dist/{OpenApiTsGenerator-B33Y_6oe.cjs → OpenApiTsGenerator-BvacdbiG.cjs} +2 -2
  24. package/dist/{OpenApiTsGenerator-B33Y_6oe.cjs.map → OpenApiTsGenerator-BvacdbiG.cjs.map} +1 -1
  25. package/dist/{S3StateStore-Ccz7J7Cf.cjs → S3StateStore-B-9ea-sX.cjs} +2 -2
  26. package/dist/{S3StateStore-Ccz7J7Cf.cjs.map → S3StateStore-B-9ea-sX.cjs.map} +1 -1
  27. package/dist/{S3StateStore-CwVWjNXJ.mjs → S3StateStore-C01zMOYm.mjs} +2 -2
  28. package/dist/{S3StateStore-CwVWjNXJ.mjs.map → S3StateStore-C01zMOYm.mjs.map} +1 -1
  29. package/dist/{SSMStateStore-CAxcx0U2.cjs → SSMStateStore-CKArcPUh.cjs} +2 -2
  30. package/dist/{SSMStateStore-CAxcx0U2.cjs.map → SSMStateStore-CKArcPUh.cjs.map} +1 -1
  31. package/dist/{SSMStateStore-CASt-lob.mjs → SSMStateStore-k-4XM7mb.mjs} +2 -2
  32. package/dist/{SSMStateStore-CASt-lob.mjs.map → SSMStateStore-k-4XM7mb.mjs.map} +1 -1
  33. package/dist/{SubscriberGenerator-zUd87wvg.mjs → SubscriberGenerator-DLPH-ynS.mjs} +148 -11
  34. package/dist/SubscriberGenerator-DLPH-ynS.mjs.map +1 -0
  35. package/dist/{SubscriberGenerator-DDCqRTbq.cjs → SubscriberGenerator-DR4Y7ihK.cjs} +170 -9
  36. package/dist/SubscriberGenerator-DR4Y7ihK.cjs.map +1 -0
  37. package/dist/{add-Cq7B_VSJ.cjs → add-BgzsYxUq.cjs} +6 -6
  38. package/dist/{add-Cq7B_VSJ.cjs.map → add-BgzsYxUq.cjs.map} +1 -1
  39. package/dist/{add-6tyL4tWq.mjs → add-CiIrpOb9.mjs} +6 -6
  40. package/dist/{add-6tyL4tWq.mjs.map → add-CiIrpOb9.mjs.map} +1 -1
  41. package/dist/{bundler-CXuVyqXY.mjs → bundler-C4uMSy8e.mjs} +5 -5
  42. package/dist/{bundler-CXuVyqXY.mjs.map → bundler-C4uMSy8e.mjs.map} +1 -1
  43. package/dist/{bundler-DRmdcbXx.cjs → bundler-DKxuDoVL.cjs} +5 -5
  44. package/dist/{bundler-DRmdcbXx.cjs.map → bundler-DKxuDoVL.cjs.map} +1 -1
  45. package/dist/{cli-DxtrQdRa.mjs → cli-Bm2is6R_.mjs} +3 -3
  46. package/dist/{cli-DxtrQdRa.mjs.map → cli-Bm2is6R_.mjs.map} +1 -1
  47. package/dist/{cli-DYru-gjk.cjs → cli-na0npMhC.cjs} +3 -3
  48. package/dist/{cli-DYru-gjk.cjs.map → cli-na0npMhC.cjs.map} +1 -1
  49. package/dist/{compose-Bdx2rqtO.mjs → compose-CVatM7Cl.mjs} +31 -7
  50. package/dist/compose-CVatM7Cl.mjs.map +1 -0
  51. package/dist/{compose-DJMHSSDI.cjs → compose-D8U9ygdm.cjs} +31 -7
  52. package/dist/compose-D8U9ygdm.cjs.map +1 -0
  53. package/dist/{config-B7HaIfYM.d.mts → config-BbivVpq0.d.mts} +3 -3
  54. package/dist/{config-B7HaIfYM.d.mts.map → config-BbivVpq0.d.mts.map} +1 -1
  55. package/dist/{config-DySjXKd2.d.cts → config-BcL1Fojs.d.cts} +3 -3
  56. package/dist/{config-DySjXKd2.d.cts.map → config-BcL1Fojs.d.cts.map} +1 -1
  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-DYzO2_yG.mjs → credentialSchemas-DUCSYl9a.mjs} +2 -2
  62. package/dist/{credentialSchemas-DYzO2_yG.mjs.map → credentialSchemas-DUCSYl9a.mjs.map} +1 -1
  63. package/dist/{credentialSchemas-BJMvQlks.cjs → credentialSchemas-DZ2Nh5li.cjs} +2 -2
  64. package/dist/{credentialSchemas-BJMvQlks.cjs.map → credentialSchemas-DZ2Nh5li.cjs.map} +1 -1
  65. package/dist/deploy/public.cjs +8 -8
  66. package/dist/deploy/public.d.cts +3 -8
  67. package/dist/deploy/public.d.cts.map +1 -1
  68. package/dist/deploy/public.d.mts +3 -8
  69. package/dist/deploy/public.d.mts.map +1 -1
  70. package/dist/deploy/public.mjs +8 -8
  71. package/dist/{deploy-o5n6l4MO.mjs → deploy-CDcO08Xz.mjs} +457 -47
  72. package/dist/deploy-CDcO08Xz.mjs.map +1 -0
  73. package/dist/{deploy-88E_1bHW.cjs → deploy-DrQB7ytj.cjs} +457 -46
  74. package/dist/deploy-DrQB7ytj.cjs.map +1 -0
  75. package/dist/{discover-DWtHjc1x.mjs → discover-B2m8ytyq.mjs} +2 -2
  76. package/dist/{discover-DWtHjc1x.mjs.map → discover-B2m8ytyq.mjs.map} +1 -1
  77. package/dist/{discover-B3G8eyWX.cjs → discover-yqeJ2Bx7.cjs} +2 -2
  78. package/dist/{discover-B3G8eyWX.cjs.map → discover-yqeJ2Bx7.cjs.map} +1 -1
  79. package/dist/{dokploy-al6V2P9s.cjs → dokploy-BKjPDvSN.cjs} +2 -2
  80. package/dist/{dokploy-al6V2P9s.cjs.map → dokploy-BKjPDvSN.cjs.map} +1 -1
  81. package/dist/{dokploy-C1QCPJ1t.mjs → dokploy-k4_ZN8zN.mjs} +2 -2
  82. package/dist/{dokploy-C1QCPJ1t.mjs.map → dokploy-k4_ZN8zN.mjs.map} +1 -1
  83. package/dist/{eas-D0jmXv7F.mjs → eas-B1wBvwPH.mjs} +2 -2
  84. package/dist/{eas-D0jmXv7F.mjs.map → eas-B1wBvwPH.mjs.map} +1 -1
  85. package/dist/{eas-DAsdU35R.cjs → eas-Bg4dI6n2.cjs} +2 -2
  86. package/dist/{eas-DAsdU35R.cjs.map → eas-Bg4dI6n2.cjs.map} +1 -1
  87. package/dist/{encryption-G8Ouiy55.mjs → encryption-Bve0PVOo.mjs} +3 -3
  88. package/dist/{encryption-G8Ouiy55.mjs.map → encryption-Bve0PVOo.mjs.map} +1 -1
  89. package/dist/{encryption-C5c50qvt.cjs → encryption-DL_y8t6V.cjs} +3 -3
  90. package/dist/{encryption-C5c50qvt.cjs.map → encryption-DL_y8t6V.cjs.map} +1 -1
  91. package/dist/{engine-9C68_A78.cjs → engine-BhR5lt_V.cjs} +5 -5
  92. package/dist/{engine-9C68_A78.cjs.map → engine-BhR5lt_V.cjs.map} +1 -1
  93. package/dist/{engine-bEuItjJN.mjs → engine-HMLf20iZ.mjs} +5 -5
  94. package/dist/{engine-bEuItjJN.mjs.map → engine-HMLf20iZ.mjs.map} +1 -1
  95. package/dist/{github-R-Pot7QV.cjs → github-B2hJVl-n.cjs} +6 -6
  96. package/dist/{github-R-Pot7QV.cjs.map → github-B2hJVl-n.cjs.map} +1 -1
  97. package/dist/{github-Buh2ldNN.mjs → github-DKn9ACi2.mjs} +6 -6
  98. package/dist/{github-Buh2ldNN.mjs.map → github-DKn9ACi2.mjs.map} +1 -1
  99. package/dist/{googlePlay-B_X_DJp0.mjs → googlePlay-CWq7ND_X.mjs} +3 -3
  100. package/dist/{googlePlay-B_X_DJp0.mjs.map → googlePlay-CWq7ND_X.mjs.map} +1 -1
  101. package/dist/{googlePlay-Bi5qneXA.cjs → googlePlay-DtuN0-7D.cjs} +3 -3
  102. package/dist/{googlePlay-Bi5qneXA.cjs.map → googlePlay-DtuN0-7D.cjs.map} +1 -1
  103. package/dist/{index-CTKfBwU3.d.cts → index-BZZeEWug.d.mts} +2 -2
  104. package/dist/{index-BymyHYdL.d.mts.map → index-BZZeEWug.d.mts.map} +1 -1
  105. package/dist/{index-BymyHYdL.d.mts → index-C1jffZ5_.d.cts} +2 -2
  106. package/dist/{index-CTKfBwU3.d.cts.map → index-C1jffZ5_.d.cts.map} +1 -1
  107. package/dist/index.cjs +61 -61
  108. package/dist/index.cjs.map +1 -1
  109. package/dist/index.mjs +61 -61
  110. package/dist/index.mjs.map +1 -1
  111. package/dist/{migrate-DjCvZL4P.cjs → migrate-BLVZqHtN.cjs} +3 -3
  112. package/dist/{migrate-DjCvZL4P.cjs.map → migrate-BLVZqHtN.cjs.map} +1 -1
  113. package/dist/{migrate-WkC0pay4.mjs → migrate-DCvD4RJW.mjs} +4 -4
  114. package/dist/{migrate-WkC0pay4.mjs.map → migrate-DCvD4RJW.mjs.map} +1 -1
  115. package/dist/{migrate-C9abovJK.mjs → migrate-W0ruUNb9.mjs} +3 -3
  116. package/dist/{migrate-C9abovJK.mjs.map → migrate-W0ruUNb9.mjs.map} +1 -1
  117. package/dist/{migrate-Bv4AqxYP.cjs → migrate-iUui7B4q.cjs} +4 -4
  118. package/dist/{migrate-Bv4AqxYP.cjs.map → migrate-iUui7B4q.cjs.map} +1 -1
  119. package/dist/openapi.cjs +3 -3
  120. package/dist/openapi.d.cts +1 -1
  121. package/dist/openapi.d.mts +1 -1
  122. package/dist/openapi.mjs +3 -3
  123. package/dist/{publish-BbJ7Ols2.cjs → publish-CqvDA5ry.cjs} +2 -2
  124. package/dist/{publish-BbJ7Ols2.cjs.map → publish-CqvDA5ry.cjs.map} +1 -1
  125. package/dist/{publish-BVsLFs-n.mjs → publish-CxIBBD3b.mjs} +2 -2
  126. package/dist/{publish-BVsLFs-n.mjs.map → publish-CxIBBD3b.mjs.map} +1 -1
  127. package/dist/{ready-B_to-BSY.mjs → ready-CGqJ74Kt.mjs} +5 -5
  128. package/dist/{ready-B_to-BSY.mjs.map → ready-CGqJ74Kt.mjs.map} +1 -1
  129. package/dist/{ready-C-nMK_FB.cjs → ready-DuU0FXSj.cjs} +5 -5
  130. package/dist/{ready-C-nMK_FB.cjs.map → ready-DuU0FXSj.cjs.map} +1 -1
  131. package/dist/reconcile/public.cjs +1 -1
  132. package/dist/reconcile/public.d.cts +1 -1
  133. package/dist/reconcile/public.d.mts +1 -1
  134. package/dist/reconcile/public.mjs +1 -1
  135. package/dist/{resolve-CBEFNYca.cjs → resolve-BEVVvi13.cjs} +3 -3
  136. package/dist/{resolve-CBEFNYca.cjs.map → resolve-BEVVvi13.cjs.map} +1 -1
  137. package/dist/{resolve-CTYtfl0x.mjs → resolve-CMC0MI0Z.mjs} +3 -3
  138. package/dist/{resolve-CTYtfl0x.mjs.map → resolve-CMC0MI0Z.mjs.map} +1 -1
  139. package/dist/{rollback-BT6oPcnZ.mjs → rollback-CZiQkukY.mjs} +5 -5
  140. package/dist/{rollback-BT6oPcnZ.mjs.map → rollback-CZiQkukY.mjs.map} +1 -1
  141. package/dist/{rollback-RzUJ728z.cjs → rollback-e0zGkaBx.cjs} +5 -5
  142. package/dist/{rollback-RzUJ728z.cjs.map → rollback-e0zGkaBx.cjs.map} +1 -1
  143. package/dist/{runtime-mR2O0z64.d.mts → runtime-Bvgyxm88.d.cts} +2 -2
  144. package/dist/{runtime-Dl601UcU.d.cts.map → runtime-Bvgyxm88.d.cts.map} +1 -1
  145. package/dist/{runtime-Dl601UcU.d.cts → runtime-CeAt1IJd.d.mts} +2 -2
  146. package/dist/{runtime-mR2O0z64.d.mts.map → runtime-CeAt1IJd.d.mts.map} +1 -1
  147. package/dist/{s3-BUkV5_fV.cjs → s3-BKnL6YGQ.cjs} +2 -2
  148. package/dist/{s3-BUkV5_fV.cjs.map → s3-BKnL6YGQ.cjs.map} +1 -1
  149. package/dist/{s3-VpdagzYE.mjs → s3-DW7SLsb8.mjs} +2 -2
  150. package/dist/{s3-VpdagzYE.mjs.map → s3-DW7SLsb8.mjs.map} +1 -1
  151. package/dist/sandbox/credentials-worker.cjs +2 -2
  152. package/dist/sandbox/credentials-worker.mjs +2 -2
  153. package/dist/sandbox/discover-worker.cjs +1 -1
  154. package/dist/sandbox/discover-worker.mjs +1 -1
  155. package/dist/sandbox/migrate-worker.cjs +1 -1
  156. package/dist/sandbox/migrate-worker.mjs +1 -1
  157. package/dist/{seeds-CcK_C30B.cjs → seeds-BR_7hJTw.cjs} +122 -13
  158. package/dist/seeds-BR_7hJTw.cjs.map +1 -0
  159. package/dist/{seeds-CSNYLc4p.mjs → seeds-nCxxlP5h.mjs} +111 -14
  160. package/dist/seeds-nCxxlP5h.mjs.map +1 -0
  161. package/dist/{serverSetup-DiJPhPOz.mjs → serverSetup-C3Tt9X1R.mjs} +6 -6
  162. package/dist/{serverSetup-DiJPhPOz.mjs.map → serverSetup-C3Tt9X1R.mjs.map} +1 -1
  163. package/dist/{serverSetup-C2U4-2i0.cjs → serverSetup-D2Xzsp2t.cjs} +6 -6
  164. package/dist/{serverSetup-C2U4-2i0.cjs.map → serverSetup-D2Xzsp2t.cjs.map} +1 -1
  165. package/dist/{sniffer-B1iineXX.cjs → sniffer-BWgXPFAt.cjs} +8 -8
  166. package/dist/{sniffer-B1iineXX.cjs.map → sniffer-BWgXPFAt.cjs.map} +1 -1
  167. package/dist/{sniffer-z-p2lTtc.mjs → sniffer-eEF_fIId.mjs} +8 -8
  168. package/dist/{sniffer-z-p2lTtc.mjs.map → sniffer-eEF_fIId.mjs.map} +1 -1
  169. package/dist/{snsSubscriptions-CYy7Faid.mjs → snsSubscriptions-BSoqUgsq.mjs} +28 -13
  170. package/dist/snsSubscriptions-BSoqUgsq.mjs.map +1 -0
  171. package/dist/{snsSubscriptions-C7wClS6U.cjs → snsSubscriptions-Y9declDd.cjs} +28 -13
  172. package/dist/snsSubscriptions-Y9declDd.cjs.map +1 -0
  173. package/dist/{stage-Cn3EEIB9.cjs → stage-BEcxppsu.cjs} +6 -6
  174. package/dist/{stage-Cn3EEIB9.cjs.map → stage-BEcxppsu.cjs.map} +1 -1
  175. package/dist/{stage-Cx1KKX_o.mjs → stage-DhcbcAar.mjs} +6 -6
  176. package/dist/{stage-Cx1KKX_o.mjs.map → stage-DhcbcAar.mjs.map} +1 -1
  177. package/dist/{stages-CuV3zh-h.cjs → stages--icWbhPy.cjs} +2 -2
  178. package/dist/{stages-CuV3zh-h.cjs.map → stages--icWbhPy.cjs.map} +1 -1
  179. package/dist/{stages-COSKjrfd.mjs → stages-CUwSy39f.mjs} +2 -2
  180. package/dist/{stages-COSKjrfd.mjs.map → stages-CUwSy39f.mjs.map} +1 -1
  181. package/dist/target/public.cjs +1 -1
  182. package/dist/target/public.d.cts +2 -2
  183. package/dist/target/public.d.mts +2 -2
  184. package/dist/target/public.mjs +1 -1
  185. package/dist/{terminal-BIZRxV-e.cjs → terminal-DURcYlVX.cjs} +2 -2
  186. package/dist/{terminal-BIZRxV-e.cjs.map → terminal-DURcYlVX.cjs.map} +1 -1
  187. package/dist/{terminal-PEvt24kO.mjs → terminal-yOZ7kKF9.mjs} +2 -2
  188. package/dist/{terminal-PEvt24kO.mjs.map → terminal-yOZ7kKF9.mjs.map} +1 -1
  189. package/dist/{types-DOYYfQme.d.cts → types-C6hDCkV2.d.mts} +168 -129
  190. package/dist/types-C6hDCkV2.d.mts.map +1 -0
  191. package/dist/{types-C-uwKr3O.d.mts → types-Dy1eV7yc.d.cts} +169 -128
  192. package/dist/types-Dy1eV7yc.d.cts.map +1 -0
  193. package/dist/vitest.cjs +1 -1
  194. package/dist/vitest.mjs +1 -1
  195. package/dist/workspace/index.cjs +1 -1
  196. package/dist/workspace/index.d.cts +2 -2
  197. package/dist/workspace/index.d.mts +2 -2
  198. package/dist/workspace/index.mjs +1 -1
  199. package/dist/{workspace-aiDQZMje.mjs → workspace-BbfBFtjn.mjs} +95 -10
  200. package/dist/workspace-BbfBFtjn.mjs.map +1 -0
  201. package/dist/{workspace-secxwA6K.cjs → workspace-Dkm3HL9e.cjs} +118 -9
  202. package/dist/workspace-Dkm3HL9e.cjs.map +1 -0
  203. package/package.json +16 -15
  204. package/dist/GoDaddyProvider-DA0rzRQt.cjs.map +0 -1
  205. package/dist/GoDaddyProvider-baMIwhIy.mjs.map +0 -1
  206. package/dist/HostingerProvider-Cjh_2Ml6.mjs.map +0 -1
  207. package/dist/HostingerProvider-OdQmKXE3.cjs.map +0 -1
  208. package/dist/SubscriberGenerator-DDCqRTbq.cjs.map +0 -1
  209. package/dist/SubscriberGenerator-zUd87wvg.mjs.map +0 -1
  210. package/dist/compose-Bdx2rqtO.mjs.map +0 -1
  211. package/dist/compose-DJMHSSDI.cjs.map +0 -1
  212. package/dist/deploy-88E_1bHW.cjs.map +0 -1
  213. package/dist/deploy-o5n6l4MO.mjs.map +0 -1
  214. package/dist/seeds-CSNYLc4p.mjs.map +0 -1
  215. package/dist/seeds-CcK_C30B.cjs.map +0 -1
  216. package/dist/snsSubscriptions-C7wClS6U.cjs.map +0 -1
  217. package/dist/snsSubscriptions-CYy7Faid.mjs.map +0 -1
  218. package/dist/types-C-uwKr3O.d.mts.map +0 -1
  219. package/dist/types-DOYYfQme.d.cts.map +0 -1
  220. package/dist/workspace-aiDQZMje.mjs.map +0 -1
  221. package/dist/workspace-secxwA6K.cjs.map +0 -1
@@ -1,21 +1,21 @@
1
1
  const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
2
2
  const require_errors = require("./errors-DMC4Umsb.cjs");
3
3
  const require_credentials = require("./credentials-D7XJypNd.cjs");
4
- const require_workspace = require("./workspace-secxwA6K.cjs");
5
- const require_snsSubscriptions = require("./snsSubscriptions-C7wClS6U.cjs");
4
+ const require_workspace = require("./workspace-Dkm3HL9e.cjs");
5
+ const require_snsSubscriptions = require("./snsSubscriptions-Y9declDd.cjs");
6
6
  const require_define = require("./define-crmMcXFS.cjs");
7
- const require_seeds = require("./seeds-CcK_C30B.cjs");
7
+ const require_seeds = require("./seeds-BR_7hJTw.cjs");
8
+ const require_SubscriberGenerator = require("./SubscriberGenerator-DR4Y7ihK.cjs");
8
9
  const require_derive = require("./derive-CgZfoBU2.cjs");
9
10
  const require_identity = require("./identity-CbLfgQNT.cjs");
10
- const require_discover = require("./discover-B3G8eyWX.cjs");
11
+ const require_discover = require("./discover-yqeJ2Bx7.cjs");
11
12
  const require_sandbox = require("./sandbox-CHv3OYXg.cjs");
12
13
  const require_config = require("./config.cjs");
13
- const require_SubscriberGenerator = require("./SubscriberGenerator-DDCqRTbq.cjs");
14
- const require_resolve = require("./resolve-CBEFNYca.cjs");
14
+ const require_resolve = require("./resolve-BEVVvi13.cjs");
15
15
  const require_local = require("./local-OPC9BCZt.cjs");
16
- const require_sniffer = require("./sniffer-B1iineXX.cjs");
16
+ const require_sniffer = require("./sniffer-BWgXPFAt.cjs");
17
17
  const require_projectBucket = require("./projectBucket-BBbQ1lHF.cjs");
18
- const require_credentialSchemas = require("./credentialSchemas-BJMvQlks.cjs");
18
+ const require_credentialSchemas = require("./credentialSchemas-DZ2Nh5li.cjs");
19
19
  let node_path = require("node:path");
20
20
  let node_crypto = require("node:crypto");
21
21
  let _geekmidas_manifest = require("@geekmidas/manifest");
@@ -252,6 +252,14 @@ function bucketPolicy(bucket, open = [], options = {}) {
252
252
  Action: "s3:GetObject",
253
253
  Resource: resources
254
254
  });
255
+ if (options.sesWrite) statements.push({
256
+ Sid: "GkmSesWritesMail",
257
+ Effect: "Allow",
258
+ Principal: { Service: "ses.amazonaws.com" },
259
+ Action: "s3:PutObject",
260
+ Resource: `${bucketArn(bucket)}/${options.sesWrite.prefix}*`,
261
+ Condition: { StringEquals: { "aws:SourceAccount": options.sesWrite.account } }
262
+ });
255
263
  return {
256
264
  Version: "2012-10-17",
257
265
  Statement: statements
@@ -812,11 +820,12 @@ async function verifyStageBackups(input) {
812
820
  //#region src/providers/dnsWriter.ts
813
821
  /**
814
822
  * The DNS records a provider asks for — a certificate's validation record, a
815
- * CDN's name — written through the stage's own DNS providers.
823
+ * CDN's name, a domain's MX — written through the stage's own DNS providers.
816
824
  *
817
825
  * The same machinery the deploy's DNS step uses for the stack's hosts
818
- * (`settleStackDns`), handed a plan of CNAMEs instead of the server's
819
- * addresses: a record holding its value is left alone, one with another value
826
+ * (`settleStackDns`), handed a plan of CNAMEs and MX records instead of the
827
+ * server's addresses — an MX's value in its zone-file form,
828
+ * `<priority> <host>`, which every DNS provider reads and writes: a record holding its value is left alone, one with another value
820
829
  * is replaced and printed, and what is written is read back. A host under no
821
830
  * domain in `dns`, or under a `manual` one, is printed for the person to
822
831
  * create and reported back, so the provider can say what it is waiting on.
@@ -828,10 +837,11 @@ async function writeProviderDns(records, options) {
828
837
  const domains = /* @__PURE__ */ new Map();
829
838
  for (const record of records) {
830
839
  const host = record.host.toLowerCase().replace(/\.$/, "");
831
- const value = record.value.replace(/\.$/, "");
840
+ const target = record.value.replace(/\.$/, "");
841
+ const value = record.type === "MX" ? require_seeds.mxValue(record.priority, target) : target;
832
842
  const domain = require_seeds.findRootDomain(host, dns);
833
843
  if (!domain) {
834
- log(` create at its DNS host: ${host} CNAME ${value}`);
844
+ log(` create at its DNS host: ${host} ${record.type} ${value}`);
835
845
  manual.push(host);
836
846
  continue;
837
847
  }
@@ -1158,7 +1168,7 @@ const defaultCdnClients = async (credential) => {
1158
1168
  };
1159
1169
  let makeCdnClients = defaultCdnClients;
1160
1170
  /** What an AWS SDK error is called, whichever field carries it. */
1161
- function errorName$2(error) {
1171
+ function errorName$3(error) {
1162
1172
  const e = error;
1163
1173
  return e?.Code ?? e?.name ?? "";
1164
1174
  }
@@ -1166,7 +1176,7 @@ async function readOr$2(read, missing) {
1166
1176
  try {
1167
1177
  return await read();
1168
1178
  } catch (error) {
1169
- if (missing.includes(errorName$2(error))) return void 0;
1179
+ if (missing.includes(errorName$3(error))) return void 0;
1170
1180
  throw error;
1171
1181
  }
1172
1182
  }
@@ -1669,7 +1679,11 @@ const defaultEventsClients = async (credential, region) => {
1669
1679
  };
1670
1680
  };
1671
1681
  let makeEventsClients = defaultEventsClients;
1672
- function errorName$1(error) {
1682
+ /** The stage's SNS, SQS and account, through the factory a test may replace. */
1683
+ function eventsClients(credential, region) {
1684
+ return makeEventsClients(credential, region);
1685
+ }
1686
+ function errorName$2(error) {
1673
1687
  const e = error;
1674
1688
  return e?.name ?? e?.Code ?? e?.code ?? "";
1675
1689
  }
@@ -1677,19 +1691,18 @@ async function readOr$1(read, missing) {
1677
1691
  try {
1678
1692
  return await read();
1679
1693
  } catch (error) {
1680
- if (missing.includes(errorName$1(error))) return void 0;
1694
+ if (missing.includes(errorName$2(error))) return void 0;
1681
1695
  throw error;
1682
1696
  }
1683
1697
  }
1684
1698
  /**
1685
- * The topic, its policy, the dead-letter queue and the bucket's notification
1686
- * entry for one watched bucket — created where missing, put back where they
1687
- * drifted.
1699
+ * An SNS topic of the stage's, created where missing, whose policy lets
1700
+ * exactly one AWS service publish to it — put back where it drifted. A
1701
+ * watched bucket's topic is published to by S3; an inbox's by SES.
1688
1702
  */
1689
- async function ensureBucketEvents(ctx, s3, input) {
1690
- const { id, bucket, region } = input;
1691
- const { SNS, SQS, sns, sqs, account } = await makeEventsClients(ctx.credential, region);
1692
- const topicName = eventsTopicName(bucket);
1703
+ async function ensureTopic(ctx, clients, input) {
1704
+ const { SNS, sns, account, region } = clients;
1705
+ const { id, topicName } = input;
1693
1706
  const topicArn = `arn:aws:sns:${region}:${account}:${topicName}`;
1694
1707
  const topicEntry = {
1695
1708
  key: `sns-topic:${id}`,
@@ -1709,12 +1722,12 @@ async function ensureBucketEvents(ctx, s3, input) {
1709
1722
  }));
1710
1723
  await ctx.state.ready(topicEntry, topicArn);
1711
1724
  });
1712
- const topicPolicy = eventsTopicPolicy(topicArn, bucket, account);
1725
+ const topicPolicy = input.policy(topicArn);
1713
1726
  const currentTopicPolicy = topic?.Attributes?.Policy;
1714
1727
  if (!currentTopicPolicy || canonicalPolicy(JSON.parse(currentTopicPolicy)) !== canonicalPolicy(topicPolicy)) await ctx.change({
1715
1728
  construct: id,
1716
1729
  resource: `SNS topic ${topicName}`,
1717
- change: `publishable by '${bucket}' only`
1730
+ change: `publishable by ${input.publisher} only`
1718
1731
  }, async () => {
1719
1732
  await sns.send(new SNS.SetTopicAttributesCommand({
1720
1733
  TopicArn: topicArn,
@@ -1722,6 +1735,24 @@ async function ensureBucketEvents(ctx, s3, input) {
1722
1735
  AttributeValue: JSON.stringify(topicPolicy)
1723
1736
  }));
1724
1737
  });
1738
+ return topicArn;
1739
+ }
1740
+ /**
1741
+ * The topic, its policy, the dead-letter queue and the bucket's notification
1742
+ * entry for one watched bucket — created where missing, put back where they
1743
+ * drifted.
1744
+ */
1745
+ async function ensureBucketEvents(ctx, s3, input) {
1746
+ const { id, bucket, region } = input;
1747
+ const clients = await makeEventsClients(ctx.credential, region);
1748
+ const { SQS, sns, sqs, account } = clients;
1749
+ const topicName = eventsTopicName(bucket);
1750
+ const topicArn = await ensureTopic(ctx, clients, {
1751
+ id,
1752
+ topicName,
1753
+ publisher: `'${bucket}'`,
1754
+ policy: (arn) => eventsTopicPolicy(arn, bucket, account)
1755
+ });
1725
1756
  const queueName = eventsDeadLetterName(bucket);
1726
1757
  const deadLetterArn = `arn:aws:sqs:${region}:${account}:${queueName}`;
1727
1758
  const queueEntry = {
@@ -1784,13 +1815,15 @@ async function ensureBucketEvents(ctx, s3, input) {
1784
1815
  };
1785
1816
  }
1786
1817
  /**
1787
- * The events key: the topic's address, signed by the bucket's own access key
1788
- * — read off the bucket's URL, so a rotated key rotates this one with it.
1818
+ * A topic's connection string: its address, signed by the access key in a
1819
+ * bucket's URL — read off that URL, so a rotated key rotates this one with
1820
+ * it. A watched bucket's events key by default; an inbox's topic, signed by
1821
+ * its own bucket's key, otherwise.
1789
1822
  */
1790
1823
  async function ensureEventsKey(ctx, input) {
1791
1824
  const { id, topicArn, region } = input;
1792
- const key = (0, _geekmidas_manifest.provideKey)(id, "eventsConnectionString");
1793
- const url = ctx.secrets[(0, _geekmidas_manifest.provideKey)(id, "url")];
1825
+ const key = input.key ?? (0, _geekmidas_manifest.provideKey)(id, "eventsConnectionString");
1826
+ const url = ctx.secrets[input.urlKey ?? (0, _geekmidas_manifest.provideKey)(id, "url")];
1794
1827
  let parsed;
1795
1828
  try {
1796
1829
  parsed = url ? _geekmidas_storage_s3_url.parse(url) : void 0;
@@ -1997,7 +2030,7 @@ function bucketPublicUrl(bucket, region, endpoint) {
1997
2030
  return `https://${bucket}.s3.${region}.amazonaws.com`;
1998
2031
  }
1999
2032
  /** What an AWS SDK error is called, whichever field carries it. */
2000
- function errorName(error) {
2033
+ function errorName$1(error) {
2001
2034
  const e = error;
2002
2035
  return e?.Code ?? e?.name ?? "";
2003
2036
  }
@@ -2011,7 +2044,7 @@ function s3Answer(error) {
2011
2044
  const id2 = e?.$metadata?.extendedRequestId ?? headers["x-amz-id-2"];
2012
2045
  return {
2013
2046
  ...status !== void 0 ? { status } : {},
2014
- name: errorName(error) || "Error",
2047
+ name: errorName$1(error) || "Error",
2015
2048
  message: e?.message ?? String(error),
2016
2049
  ...region ? { region } : {},
2017
2050
  ...requestId ? { requestId } : {},
@@ -2074,7 +2107,7 @@ async function readOr(read, missing) {
2074
2107
  try {
2075
2108
  return await read();
2076
2109
  } catch (error) {
2077
- if (missing.includes(errorName(error))) return void 0;
2110
+ if (missing.includes(errorName$1(error))) return void 0;
2078
2111
  throw error;
2079
2112
  }
2080
2113
  }
@@ -2208,6 +2241,49 @@ async function ensureBucket(ctx, stageClients, construct, watchers) {
2208
2241
  * The bucket's name: the recorded one, else the good name, else the good
2209
2242
  * name with a random suffix — up to {@link SUFFIX_ATTEMPTS} times.
2210
2243
  */
2244
+ /**
2245
+ * A private bucket a provider makes for a construct that owns one — an
2246
+ * inbox's — by the same steps as any of the stage's buckets: found or
2247
+ * created, its settings put back where they drifted, and reached by an IAM
2248
+ * user of its own whose key is written into `urlKey`. Nothing serves it and
2249
+ * nothing watches it.
2250
+ */
2251
+ async function ensureOwnedBucket(ctx, input) {
2252
+ const bucketCtx = ctx;
2253
+ const stageClients = await makeClients(ctx.credential, s3Region(bucketCtx));
2254
+ const nameInput = {
2255
+ scope: ctx.identity.scope,
2256
+ stage: ctx.stage,
2257
+ id: input.name
2258
+ };
2259
+ const located = await ensureBucketName(bucketCtx, stageClients, input.id, bucketName(nameInput));
2260
+ const clients = located.region === stageClients.region ? stageClients : await makeClients(ctx.credential, located.region);
2261
+ await ensureBucketSettings(bucketCtx, clients, {
2262
+ id: input.id,
2263
+ bucket: located.bucket,
2264
+ exists: located.exists,
2265
+ versioning: false,
2266
+ open: [],
2267
+ ...input.sesWrite ? { sesWrite: input.sesWrite } : {}
2268
+ });
2269
+ const user = await ensureIamUser(bucketCtx, clients, {
2270
+ id: input.id,
2271
+ user: iamUserName(nameInput),
2272
+ policyName: IAM_POLICY_NAME,
2273
+ policy: userPolicy(located.bucket, input.topicArn ? { eventsTopicArn: input.topicArn } : {}),
2274
+ describe: "this bucket only"
2275
+ });
2276
+ await ensureAccessKey(bucketCtx, clients, {
2277
+ id: input.id,
2278
+ bucket: located.bucket,
2279
+ urlKey: input.urlKey,
2280
+ ...user
2281
+ });
2282
+ return {
2283
+ bucket: located.bucket,
2284
+ region: clients.region
2285
+ };
2286
+ }
2211
2287
  async function ensureBucketName(ctx, clients, id, good) {
2212
2288
  const { S3, s3, region } = clients;
2213
2289
  const key = `s3-bucket:${id}`;
@@ -2258,7 +2334,7 @@ async function ensureBucketName(ctx, clients, id, good) {
2258
2334
  ...region === "us-east-1" ? {} : { CreateBucketConfiguration: { LocationConstraint: region } }
2259
2335
  }));
2260
2336
  } catch (error) {
2261
- const code = errorName(error);
2337
+ const code = errorName$1(error);
2262
2338
  if (code === "BucketAlreadyOwnedByYou") return "ours";
2263
2339
  if (code === "BucketAlreadyExists") return "taken";
2264
2340
  throw error;
@@ -2345,7 +2421,10 @@ async function ensureBucketSettings(ctx, clients, input) {
2345
2421
  PublicAccessBlockConfiguration: block
2346
2422
  })));
2347
2423
  };
2348
- const policy = bucketPolicy(bucket, input.open, input.cdn ? { cdn: input.cdn } : {});
2424
+ const policy = bucketPolicy(bucket, input.open, {
2425
+ ...input.cdn ? { cdn: input.cdn } : {},
2426
+ ...input.sesWrite ? { sesWrite: input.sesWrite } : {}
2427
+ });
2349
2428
  const ensurePolicy = async () => {
2350
2429
  const current = await read(() => s3.send(new S3.GetBucketPolicyCommand({ Bucket })), ["NoSuchBucketPolicy"]);
2351
2430
  if (!(current?.Policy !== void 0 && canonicalPolicy(JSON.parse(current.Policy)) === canonicalPolicy(policy))) await set(isOpen ? `policy: TLS only, public read on ${input.open.join(", ")}` : input.cdn && input.open.length > 0 ? `policy: TLS only, CloudFront reads ${input.open.join(", ")}` : "policy: TLS only", () => s3.send(new S3.PutBucketPolicyCommand({
@@ -2465,14 +2544,7 @@ async function verifyS3(ctx) {
2465
2544
  }
2466
2545
  }
2467
2546
  }
2468
- //#endregion
2469
- //#region src/providers/registry.ts
2470
- /**
2471
- * The providers gkm ships, by kind and name — registered the way a deploy
2472
- * target's built-ins are (`target/builtins.ts`). A provider from a package is
2473
- * one more entry here once there is a loading story for it.
2474
- */
2475
- const BUILTIN_PROVIDERS = { objects: { s3: {
2547
+ const s3Provider = {
2476
2548
  kind: "objects",
2477
2549
  name: "s3",
2478
2550
  check: require_workspace.checkS3Config,
@@ -2488,7 +2560,346 @@ const BUILTIN_PROVIDERS = { objects: { s3: {
2488
2560
  },
2489
2561
  ensure: ensureS3,
2490
2562
  verify: verifyS3
2491
- } } };
2563
+ };
2564
+ //#endregion
2565
+ //#region src/providers/ses/index.ts
2566
+ /**
2567
+ * The `ses` provider: what receives an inbox's mail on a deployed stage.
2568
+ *
2569
+ * `deploy.inbox.<stage> = { provider: 'ses', region? }` has the deploy create,
2570
+ * for each `Inbox`:
2571
+ *
2572
+ * - **its own bucket** — never one the stack or `deploy.objects` runs — by
2573
+ * the steps every bucket of the stage takes (`ensureOwnedBucket`), with SES
2574
+ * allowed to write under `messages/` and an IAM user of its own whose key
2575
+ * is the inbox's `<ID>_URL`;
2576
+ * - **its topic** on SNS, publishable by SES alone, whose `sns://` address —
2577
+ * signed by the same key — is the topic's connection string. The deploy's
2578
+ * push subscriptions for a topic on SNS (`topicPushes`) then subscribe each
2579
+ * inbox subscriber at its worker's route, unfiltered;
2580
+ * - **the stage's domain as an SES identity**, verified through Easy DKIM's
2581
+ * CNAMEs, and **MX records** pointing the domain — or every subdomain of it,
2582
+ * with `subdomains: true` — at the region's inbound endpoint, both through
2583
+ * the stage's DNS;
2584
+ * - **a receipt rule** in the region's *active* rule set: the inbox's
2585
+ * recipients, stored under `messages/` and announced on its topic. Never a
2586
+ * new set made active over another — only one is active per region, and
2587
+ * switching would stop every other stage's and app's rules. A set is made
2588
+ * active only where none is.
2589
+ *
2590
+ * A removed inbox's rule is deleted on the next deploy, by its name; nothing
2591
+ * else this provider did not make is touched.
2592
+ */
2593
+ /**
2594
+ * The regions SES receives mail in, each at `inbound-smtp.<region>.amazonaws.com`
2595
+ * — the AWS General Reference's "Email Receiving endpoints".
2596
+ */
2597
+ const SES_RECEIVING_REGIONS = [
2598
+ "us-east-1",
2599
+ "us-east-2",
2600
+ "us-west-1",
2601
+ "us-west-2",
2602
+ "af-south-1",
2603
+ "ap-southeast-3",
2604
+ "ap-south-1",
2605
+ "ap-northeast-3",
2606
+ "ap-northeast-2",
2607
+ "ap-southeast-1",
2608
+ "ap-southeast-2",
2609
+ "ap-northeast-1",
2610
+ "ca-central-1",
2611
+ "eu-central-1",
2612
+ "eu-west-1",
2613
+ "eu-west-2",
2614
+ "eu-south-1",
2615
+ "eu-west-3",
2616
+ "eu-north-1",
2617
+ "il-central-1",
2618
+ "me-south-1",
2619
+ "sa-east-1"
2620
+ ];
2621
+ /** Where mail for a domain is delivered in `region`: its MX target. */
2622
+ function inboundEndpoint(region) {
2623
+ return `inbound-smtp.${region}.amazonaws.com`;
2624
+ }
2625
+ /** Every inbox in the manifest. */
2626
+ function inboxConstructs(manifest) {
2627
+ return Object.values(manifest).filter((d) => d.kind === "inbox").sort((a, b) => a.id.localeCompare(b.id));
2628
+ }
2629
+ /** The name an inbox's receipt rule has: the prefix it is found by, and its id. */
2630
+ function receiptRuleName(scope, stage, inbox) {
2631
+ return `${rulePrefix(scope, stage)}${require_derive.appKey(inbox)}`.slice(0, 64);
2632
+ }
2633
+ /** What every rule this stage made is named with. */
2634
+ function rulePrefix(scope, stage) {
2635
+ return `gkm-${scope}-${stage}-`.replace(/[^A-Za-z0-9_.-]/g, "-");
2636
+ }
2637
+ /** The topic SES announces an inbox's mail on: publishable by SES, from this account. */
2638
+ function receiptTopicPolicy(topicArn, account) {
2639
+ return {
2640
+ Version: "2012-10-17",
2641
+ Statement: [{
2642
+ Sid: "GkmSesPublishes",
2643
+ Effect: "Allow",
2644
+ Principal: { Service: "ses.amazonaws.com" },
2645
+ Action: "sns:Publish",
2646
+ Resource: topicArn,
2647
+ Condition: { StringEquals: { "aws:SourceAccount": account } }
2648
+ }]
2649
+ };
2650
+ }
2651
+ const defaultSesClients = async (credential, region) => {
2652
+ const SES = await import("@aws-sdk/client-ses");
2653
+ const config = await require_snsSubscriptions.awsClientConfig(credential, region);
2654
+ const endpoint = require_snsSubscriptions.awsEndpoint(process.env, "SES");
2655
+ return {
2656
+ SES,
2657
+ ses: new SES.SESClient({
2658
+ ...config,
2659
+ ...endpoint ? { endpoint } : {}
2660
+ })
2661
+ };
2662
+ };
2663
+ let makeSesClients = defaultSesClients;
2664
+ function errorName(error) {
2665
+ const e = error;
2666
+ return e?.name ?? e?.Code ?? e?.code ?? "";
2667
+ }
2668
+ /** The stage's domain, which every inbox receives on. */
2669
+ function stageDomain(ctx) {
2670
+ const domain = ctx.workspace.domains?.[ctx.stage];
2671
+ if (!domain) throw new require_seeds.NoDomainForStage(ctx.stage);
2672
+ return domain;
2673
+ }
2674
+ async function ensureSes(ctx) {
2675
+ const region = s3Region(ctx);
2676
+ if (!SES_RECEIVING_REGIONS.includes(region)) throw new require_workspace.SesReceivingUnsupported(ctx.stage, region, SES_RECEIVING_REGIONS);
2677
+ const inboxes = inboxConstructs(ctx.manifest);
2678
+ const { SES, ses } = await makeSesClients(ctx.credential, region);
2679
+ try {
2680
+ const ruleSet = await activeRuleSet(ctx, {
2681
+ SES,
2682
+ ses
2683
+ }, inboxes.length > 0);
2684
+ if (inboxes.length > 0) {
2685
+ const domain = stageDomain(ctx);
2686
+ await ensureIdentity(ctx, {
2687
+ SES,
2688
+ ses
2689
+ }, domain);
2690
+ const events = await eventsClients(ctx.credential, region);
2691
+ try {
2692
+ for (const inbox of inboxes) await ensureInbox(ctx, {
2693
+ SES,
2694
+ ses
2695
+ }, events, {
2696
+ inbox,
2697
+ domain,
2698
+ region,
2699
+ ruleSet
2700
+ });
2701
+ } finally {
2702
+ events.sns.destroy();
2703
+ events.sqs.destroy();
2704
+ }
2705
+ await ensureMx(ctx, inboxes, domain, region);
2706
+ }
2707
+ if (ruleSet) await retireRules(ctx, {
2708
+ SES,
2709
+ ses
2710
+ }, ruleSet, inboxes);
2711
+ } finally {
2712
+ ses.destroy();
2713
+ }
2714
+ }
2715
+ /**
2716
+ * The region's active rule set. Made — and made active — only where none is
2717
+ * active and an inbox needs one: activating a set deactivates whichever was.
2718
+ */
2719
+ async function activeRuleSet(ctx, { SES, ses }, needed) {
2720
+ const name = (await ses.send(new SES.DescribeActiveReceiptRuleSetCommand({}))).Metadata?.Name;
2721
+ if (name || !needed) return name;
2722
+ await ctx.change({
2723
+ construct: "inbox",
2724
+ resource: `SES receipt rule set gkm`,
2725
+ change: "create and make active — the region has none"
2726
+ }, async () => {
2727
+ try {
2728
+ await ses.send(new SES.CreateReceiptRuleSetCommand({ RuleSetName: "gkm" }));
2729
+ } catch (error) {
2730
+ if (errorName(error) !== "AlreadyExistsException") throw error;
2731
+ }
2732
+ await ses.send(new SES.SetActiveReceiptRuleSetCommand({ RuleSetName: "gkm" }));
2733
+ });
2734
+ return "gkm";
2735
+ }
2736
+ /**
2737
+ * The stage's domain as an SES identity, verified by Easy DKIM: its three
2738
+ * CNAMEs, through the stage's DNS. Receiving requires a verified domain.
2739
+ */
2740
+ async function ensureIdentity(ctx, { SES, ses }, domain) {
2741
+ let tokens = [];
2742
+ await ctx.change({
2743
+ construct: "inbox",
2744
+ resource: `SES identity ${domain}`,
2745
+ change: "verify with DKIM"
2746
+ }, async () => {
2747
+ tokens = (await ses.send(new SES.VerifyDomainDkimCommand({ Domain: domain }))).DkimTokens ?? [];
2748
+ });
2749
+ if (tokens.length === 0) return;
2750
+ await ctx.writeDns(tokens.map((token) => ({
2751
+ host: `${token}._domainkey.${domain}`,
2752
+ type: "CNAME",
2753
+ value: `${token}.dkim.amazonses.com`
2754
+ })));
2755
+ }
2756
+ /** One inbox: its bucket, its topic and their keys, and its receipt rule. */
2757
+ async function ensureInbox(ctx, { SES, ses }, events, input) {
2758
+ const { inbox, domain, region, ruleSet } = input;
2759
+ const name = `${require_derive.appKey(inbox.id)}-mail`;
2760
+ const urlKey = (0, _geekmidas_manifest.provideKey)(inbox.id, "url");
2761
+ const topicArn = await ensureTopic(ctx, events, {
2762
+ id: inbox.id,
2763
+ topicName: `gkm-${ctx.identity.scope}-${ctx.stage}-${name}`.replace(/[^A-Za-z0-9_-]/g, "-").slice(0, 256),
2764
+ publisher: "SES",
2765
+ policy: (arn) => receiptTopicPolicy(arn, events.account)
2766
+ });
2767
+ const { bucket } = await ensureOwnedBucket(ctx, {
2768
+ id: inbox.id,
2769
+ name,
2770
+ urlKey,
2771
+ sesWrite: {
2772
+ prefix: _geekmidas_manifest.INBOX_MESSAGES_PREFIX,
2773
+ account: events.account
2774
+ },
2775
+ topicArn
2776
+ });
2777
+ await ensureEventsKey(ctx, {
2778
+ id: inbox.id,
2779
+ topicArn,
2780
+ region,
2781
+ key: (0, _geekmidas_manifest.provideKey)(inbox.topic, "publisherConnectionString"),
2782
+ urlKey
2783
+ });
2784
+ const rule = {
2785
+ Name: receiptRuleName(ctx.identity.scope, ctx.stage, inbox.id),
2786
+ Enabled: true,
2787
+ TlsPolicy: "Optional",
2788
+ ScanEnabled: true,
2789
+ Recipients: (0, _geekmidas_manifest.receiptRecipients)(inbox, domain),
2790
+ Actions: [{ S3Action: {
2791
+ BucketName: bucket,
2792
+ ObjectKeyPrefix: _geekmidas_manifest.INBOX_MESSAGES_PREFIX,
2793
+ TopicArn: topicArn
2794
+ } }]
2795
+ };
2796
+ const current = await ses.send(new SES.DescribeReceiptRuleCommand({
2797
+ RuleSetName: ruleSet,
2798
+ RuleName: rule.Name
2799
+ })).then((found) => found.Rule, (error) => {
2800
+ if (errorName(error) === "RuleDoesNotExistException") return void 0;
2801
+ throw error;
2802
+ });
2803
+ const entry = {
2804
+ key: `ses-receipt-rule:${inbox.id}`,
2805
+ type: "ses-receipt-rule"
2806
+ };
2807
+ if (current && sameRule(current, rule)) {
2808
+ await ctx.state.ready(entry, rule.Name);
2809
+ return;
2810
+ }
2811
+ await ctx.change({
2812
+ construct: inbox.id,
2813
+ resource: `SES receipt rule ${rule.Name}`,
2814
+ change: current ? `receive at ${rule.Recipients.join(", ")}` : `create, receiving at ${rule.Recipients.join(", ")}`
2815
+ }, async () => {
2816
+ await ctx.state.pending(entry);
2817
+ await ses.send(current ? new SES.UpdateReceiptRuleCommand({
2818
+ RuleSetName: ruleSet,
2819
+ Rule: rule
2820
+ }) : new SES.CreateReceiptRuleCommand({
2821
+ RuleSetName: ruleSet,
2822
+ Rule: rule
2823
+ }));
2824
+ await ctx.state.ready(entry, rule.Name);
2825
+ });
2826
+ }
2827
+ function sameRule(current, wanted) {
2828
+ const s3 = current.Actions?.[0]?.S3Action;
2829
+ const want = wanted.Actions[0].S3Action;
2830
+ return current.Enabled === wanted.Enabled && current.TlsPolicy === wanted.TlsPolicy && current.ScanEnabled === wanted.ScanEnabled && current.Actions?.length === 1 && s3?.BucketName === want.BucketName && s3?.ObjectKeyPrefix === want.ObjectKeyPrefix && s3?.TopicArn === want.TopicArn && [...current.Recipients ?? []].sort().join() === [...wanted.Recipients].sort().join();
2831
+ }
2832
+ /**
2833
+ * MX records for the stage's domain — and, for an inbox on its tenants'
2834
+ * subdomains, for every subdomain — at the region's inbound endpoint.
2835
+ */
2836
+ async function ensureMx(ctx, inboxes, domain, region) {
2837
+ const hosts = /* @__PURE__ */ new Set();
2838
+ for (const inbox of inboxes) hosts.add(inbox.subdomains ? `*.${domain}` : domain);
2839
+ await ctx.writeDns([...hosts].sort().map((host) => ({
2840
+ host,
2841
+ type: "MX",
2842
+ value: inboundEndpoint(region),
2843
+ priority: 10
2844
+ })));
2845
+ }
2846
+ /** Delete the rules this stage made for inboxes no longer declared — only those. */
2847
+ async function retireRules(ctx, { SES, ses }, ruleSet, inboxes) {
2848
+ const prefix = rulePrefix(ctx.identity.scope, ctx.stage);
2849
+ const kept = new Set(inboxes.map((inbox) => receiptRuleName(ctx.identity.scope, ctx.stage, inbox.id)));
2850
+ const set = await ses.send(new SES.DescribeReceiptRuleSetCommand({ RuleSetName: ruleSet }));
2851
+ for (const rule of set.Rules ?? []) {
2852
+ if (!rule.Name?.startsWith(prefix) || kept.has(rule.Name)) continue;
2853
+ await ctx.change({
2854
+ construct: "inbox",
2855
+ resource: `SES receipt rule ${rule.Name}`,
2856
+ change: "delete — its inbox is no longer declared"
2857
+ }, async () => {
2858
+ await ses.send(new SES.DeleteReceiptRuleCommand({
2859
+ RuleSetName: ruleSet,
2860
+ RuleName: rule.Name
2861
+ }));
2862
+ });
2863
+ }
2864
+ }
2865
+ /**
2866
+ * The cheap check every deploy runs: the region receives mail, the stage has
2867
+ * a domain, and each inbox's keys are in the stage's secrets.
2868
+ */
2869
+ async function verifySes(ctx) {
2870
+ const region = s3Region(ctx);
2871
+ if (!SES_RECEIVING_REGIONS.includes(region)) throw new require_workspace.SesReceivingUnsupported(ctx.stage, region, SES_RECEIVING_REGIONS);
2872
+ const inboxes = inboxConstructs(ctx.manifest);
2873
+ if (inboxes.length === 0) return;
2874
+ stageDomain(ctx);
2875
+ for (const inbox of inboxes) {
2876
+ const missing = [(0, _geekmidas_manifest.provideKey)(inbox.id, "url"), (0, _geekmidas_manifest.provideKey)(inbox.topic, "publisherConnectionString")].filter((key) => ctx.secrets[key] === void 0);
2877
+ if (missing.length > 0) throw new require_workspace.InboxNotProvisioned(ctx.stage, inbox.id, missing);
2878
+ }
2879
+ }
2880
+ const sesProvider = {
2881
+ kind: "inbox",
2882
+ name: "ses",
2883
+ check: require_workspace.checkSesConfig,
2884
+ provisioning: require_workspace.SES_PROVISIONING,
2885
+ credentials: require_snsSubscriptions.awsProvisioningCredentials,
2886
+ runtimeKeys(manifest) {
2887
+ return inboxConstructs(manifest).flatMap((inbox) => [(0, _geekmidas_manifest.provideKey)(inbox.id, "url"), (0, _geekmidas_manifest.provideKey)(inbox.topic, "publisherConnectionString")]);
2888
+ },
2889
+ ensure: ensureSes,
2890
+ verify: verifySes
2891
+ };
2892
+ //#endregion
2893
+ //#region src/providers/registry.ts
2894
+ /**
2895
+ * The providers gkm ships, by kind and name — registered the way a deploy
2896
+ * target's built-ins are (`target/builtins.ts`). A provider from a package is
2897
+ * one more entry here once there is a loading story for it.
2898
+ */
2899
+ const BUILTIN_PROVIDERS = {
2900
+ objects: { s3: s3Provider },
2901
+ inbox: { ses: sesProvider }
2902
+ };
2492
2903
  /** The provider `kind` names `name`, if gkm has one. */
2493
2904
  function builtinProvider(kind, name) {
2494
2905
  return Object.hasOwn(BUILTIN_PROVIDERS[kind], name) ? BUILTIN_PROVIDERS[kind][name] : void 0;
@@ -2585,13 +2996,13 @@ async function provisionStage(options) {
2585
2996
  };
2586
2997
  reports.push(report);
2587
2998
  const ids = constructsOf(manifest, kind);
2588
- if (ids.length === 0) continue;
2589
2999
  const credential = await provider.credentials({
2590
3000
  stage,
2591
3001
  env,
2592
3002
  ...options.profile ? { profile: options.profile } : {},
2593
3003
  ...options.home ? { home: options.home } : {}
2594
3004
  });
3005
+ if (ids.length === 0 && credential === void 0) continue;
2595
3006
  if (credential === void 0) throw new ProviderCredentialsMissing(stage, kind, provider.name, ids, provider.provisioning.env, provider.provisioning.describe, provider.provisioning.login);
2596
3007
  configured.push({
2597
3008
  kind,
@@ -3477,4 +3888,4 @@ Object.defineProperty(exports, "iamUserName", {
3477
3888
  }
3478
3889
  });
3479
3890
 
3480
- //# sourceMappingURL=deploy-88E_1bHW.cjs.map
3891
+ //# sourceMappingURL=deploy-DrQB7ytj.cjs.map