@geekmidas/cli 10.0.0-alpha.15 → 10.0.0-alpha.150

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 (438) hide show
  1. package/README.md +313 -380
  2. package/bin/adjacent-tsconfig.mjs +46 -8
  3. package/bin/gkm.mjs +11 -3
  4. package/bin/owning-tsconfig-jsx-register.mjs +18 -0
  5. package/bin/owning-tsconfig-jsx.mjs +108 -0
  6. package/dist/EndpointGenerator-CusLH-9S.mjs +1037 -0
  7. package/dist/EndpointGenerator-CusLH-9S.mjs.map +1 -0
  8. package/dist/EndpointGenerator-DyLMYClE.cjs +1096 -0
  9. package/dist/EndpointGenerator-DyLMYClE.cjs.map +1 -0
  10. package/dist/GoDaddyProvider-CytuBrRm.cjs +412 -0
  11. package/dist/GoDaddyProvider-CytuBrRm.cjs.map +1 -0
  12. package/dist/GoDaddyProvider-W0Dxd5v9.mjs +412 -0
  13. package/dist/GoDaddyProvider-W0Dxd5v9.mjs.map +1 -0
  14. package/dist/{HostingerProvider-BZFGYYVA.cjs → HostingerProvider-CCc9xoBN.cjs} +23 -9
  15. package/dist/HostingerProvider-CCc9xoBN.cjs.map +1 -0
  16. package/dist/{HostingerProvider-BY26bWwB.mjs → HostingerProvider-DaQr2ueR.mjs} +23 -9
  17. package/dist/HostingerProvider-DaQr2ueR.mjs.map +1 -0
  18. package/dist/LegacyStateStore-BDA0rx3b.cjs +124 -0
  19. package/dist/LegacyStateStore-BDA0rx3b.cjs.map +1 -0
  20. package/dist/LegacyStateStore-BTcTbCGk.mjs +124 -0
  21. package/dist/LegacyStateStore-BTcTbCGk.mjs.map +1 -0
  22. package/dist/LocalStateStore-BNuQoZYe.cjs +178 -0
  23. package/dist/LocalStateStore-BNuQoZYe.cjs.map +1 -0
  24. package/dist/LocalStateStore-CqpCKVvi.mjs +167 -0
  25. package/dist/LocalStateStore-CqpCKVvi.mjs.map +1 -0
  26. package/dist/OpenApiTsGenerator-BTMuu1WS.mjs +534 -0
  27. package/dist/OpenApiTsGenerator-BTMuu1WS.mjs.map +1 -0
  28. package/dist/OpenApiTsGenerator-CI-tceXV.cjs +539 -0
  29. package/dist/OpenApiTsGenerator-CI-tceXV.cjs.map +1 -0
  30. package/dist/{Route53Provider-Cvj40A8I.mjs → Route53Provider-Di_SD9CF.mjs} +3 -3
  31. package/dist/Route53Provider-Di_SD9CF.mjs.map +1 -0
  32. package/dist/{Route53Provider-DVILBsvV.cjs → Route53Provider-emLuQHVw.cjs} +3 -3
  33. package/dist/Route53Provider-emLuQHVw.cjs.map +1 -0
  34. package/dist/S3StateStore-BpsGWDMK.mjs +223 -0
  35. package/dist/S3StateStore-BpsGWDMK.mjs.map +1 -0
  36. package/dist/S3StateStore-nrmSClXN.cjs +222 -0
  37. package/dist/S3StateStore-nrmSClXN.cjs.map +1 -0
  38. package/dist/SSMStateStore-DrPCC_VN.mjs +205 -0
  39. package/dist/SSMStateStore-DrPCC_VN.mjs.map +1 -0
  40. package/dist/SSMStateStore-hexM8C7n.cjs +204 -0
  41. package/dist/SSMStateStore-hexM8C7n.cjs.map +1 -0
  42. package/dist/SubscriberGenerator-BNJyPmXJ.cjs +848 -0
  43. package/dist/SubscriberGenerator-BNJyPmXJ.cjs.map +1 -0
  44. package/dist/SubscriberGenerator-CzPrixYu.mjs +783 -0
  45. package/dist/SubscriberGenerator-CzPrixYu.mjs.map +1 -0
  46. package/dist/add-DXMYV5ak.mjs +711 -0
  47. package/dist/add-DXMYV5ak.mjs.map +1 -0
  48. package/dist/add-DgAeo6ht.cjs +713 -0
  49. package/dist/add-DgAeo6ht.cjs.map +1 -0
  50. package/dist/appPorts-BoXMwolc.mjs +249 -0
  51. package/dist/appPorts-BoXMwolc.mjs.map +1 -0
  52. package/dist/appPorts-IW-OZmRi.cjs +296 -0
  53. package/dist/appPorts-IW-OZmRi.cjs.map +1 -0
  54. package/dist/apps-Bb05wCBm.mjs +5534 -0
  55. package/dist/apps-Bb05wCBm.mjs.map +1 -0
  56. package/dist/apps-CMLyyVGQ.cjs +6148 -0
  57. package/dist/apps-CMLyyVGQ.cjs.map +1 -0
  58. package/dist/aws-8QQ8n-t6.mjs +89 -0
  59. package/dist/aws-8QQ8n-t6.mjs.map +1 -0
  60. package/dist/aws-DY9NqQIT.cjs +100 -0
  61. package/dist/aws-DY9NqQIT.cjs.map +1 -0
  62. package/dist/awsStore-Bx5nCFnS.mjs +121 -0
  63. package/dist/awsStore-Bx5nCFnS.mjs.map +1 -0
  64. package/dist/awsStore-u3ehhMoY.cjs +138 -0
  65. package/dist/awsStore-u3ehhMoY.cjs.map +1 -0
  66. package/dist/{backup-provisioner-DIVCbfee.mjs → backup-provisioner-C8DnCmxK.mjs} +2 -2
  67. package/dist/backup-provisioner-C8DnCmxK.mjs.map +1 -0
  68. package/dist/{backup-provisioner-BmhIO_Yr.cjs → backup-provisioner-oDEsPj02.cjs} +2 -2
  69. package/dist/backup-provisioner-oDEsPj02.cjs.map +1 -0
  70. package/dist/backups/runner.cjs +519 -0
  71. package/dist/backups/runner.cjs.map +1 -0
  72. package/dist/backups/runner.d.cts +102 -0
  73. package/dist/backups/runner.d.cts.map +1 -0
  74. package/dist/backups/runner.d.mts +102 -0
  75. package/dist/backups/runner.d.mts.map +1 -0
  76. package/dist/backups/runner.mjs +506 -0
  77. package/dist/backups/runner.mjs.map +1 -0
  78. package/dist/{bundler-BodTL4kf.mjs → bundler-C1kDZyQ-.mjs} +59 -14
  79. package/dist/bundler-C1kDZyQ-.mjs.map +1 -0
  80. package/dist/{bundler-BeNDZdHQ.cjs → bundler-CD9Ug2uu.cjs} +59 -14
  81. package/dist/bundler-CD9Ug2uu.cjs.map +1 -0
  82. package/dist/cli-35yoGg9o.cjs +71 -0
  83. package/dist/cli-35yoGg9o.cjs.map +1 -0
  84. package/dist/cli-BAcJaRG7.mjs +71 -0
  85. package/dist/cli-BAcJaRG7.mjs.map +1 -0
  86. package/dist/compose-BZTh5HR3.mjs +1560 -0
  87. package/dist/compose-BZTh5HR3.mjs.map +1 -0
  88. package/dist/compose-CAhGIfG8.mjs +2877 -0
  89. package/dist/compose-CAhGIfG8.mjs.map +1 -0
  90. package/dist/compose-DF08HNJE.cjs +2966 -0
  91. package/dist/compose-DF08HNJE.cjs.map +1 -0
  92. package/dist/compose-KV6q3cEz.cjs +1919 -0
  93. package/dist/compose-KV6q3cEz.cjs.map +1 -0
  94. package/dist/config-BLrAd7Of.mjs +659 -0
  95. package/dist/config-BLrAd7Of.mjs.map +1 -0
  96. package/dist/config-CRk2vdSp.d.mts +268 -0
  97. package/dist/config-CRk2vdSp.d.mts.map +1 -0
  98. package/dist/config-juUyBlb1.cjs +772 -0
  99. package/dist/config-juUyBlb1.cjs.map +1 -0
  100. package/dist/config-oBgsbLip.d.cts +268 -0
  101. package/dist/config-oBgsbLip.d.cts.map +1 -0
  102. package/dist/config.cjs +11 -3
  103. package/dist/config.d.cts +4 -117
  104. package/dist/config.d.mts +4 -117
  105. package/dist/config.mjs +3 -3
  106. package/dist/credentialSchemas-BAklWDna.cjs +271 -0
  107. package/dist/credentialSchemas-BAklWDna.cjs.map +1 -0
  108. package/dist/credentialSchemas-mz9QZTYh.mjs +236 -0
  109. package/dist/credentialSchemas-mz9QZTYh.mjs.map +1 -0
  110. package/dist/credentials-B72Jrk66.mjs +1817 -0
  111. package/dist/credentials-B72Jrk66.mjs.map +1 -0
  112. package/dist/credentials-Dmhuj3FX.cjs +2272 -0
  113. package/dist/credentials-Dmhuj3FX.cjs.map +1 -0
  114. package/dist/databases-DawSdqBI.cjs +703 -0
  115. package/dist/databases-DawSdqBI.cjs.map +1 -0
  116. package/dist/databases-mzSUFBTw.mjs +588 -0
  117. package/dist/databases-mzSUFBTw.mjs.map +1 -0
  118. package/dist/define-6poNqm5O.mjs +106 -0
  119. package/dist/define-6poNqm5O.mjs.map +1 -0
  120. package/dist/define-crmMcXFS.cjs +153 -0
  121. package/dist/define-crmMcXFS.cjs.map +1 -0
  122. package/dist/deploy/public.cjs +211 -0
  123. package/dist/deploy/public.cjs.map +1 -0
  124. package/dist/deploy/public.d.cts +647 -0
  125. package/dist/deploy/public.d.cts.map +1 -0
  126. package/dist/deploy/public.d.mts +647 -0
  127. package/dist/deploy/public.d.mts.map +1 -0
  128. package/dist/deploy/public.mjs +144 -0
  129. package/dist/deploy/public.mjs.map +1 -0
  130. package/dist/deploy/sniffer-envparser-worker.cjs +54 -0
  131. package/dist/deploy/sniffer-envparser-worker.cjs.map +1 -0
  132. package/dist/deploy/sniffer-envparser-worker.d.cts +1 -0
  133. package/dist/deploy/sniffer-envparser-worker.d.mts +1 -0
  134. package/dist/deploy/sniffer-envparser-worker.mjs +55 -0
  135. package/dist/deploy/sniffer-envparser-worker.mjs.map +1 -0
  136. package/dist/deploy/sniffer-hooks.cjs +1 -1
  137. package/dist/deploy/sniffer-hooks.mjs +1 -1
  138. package/dist/deploy/sniffer-loader.cjs +2 -2
  139. package/dist/deploy/sniffer-loader.mjs +1 -1
  140. package/dist/deploy/sniffer-routes-worker.cjs +2 -2
  141. package/dist/deploy/sniffer-routes-worker.mjs +1 -1
  142. package/dist/deploy-BV6Tw73K.cjs +3892 -0
  143. package/dist/deploy-BV6Tw73K.cjs.map +1 -0
  144. package/dist/deploy-C4XjPy-a.mjs +3836 -0
  145. package/dist/deploy-C4XjPy-a.mjs.map +1 -0
  146. package/dist/discover-CRywE7yc.cjs +1085 -0
  147. package/dist/discover-CRywE7yc.cjs.map +1 -0
  148. package/dist/discover-DbDrCQ8h.mjs +940 -0
  149. package/dist/discover-DbDrCQ8h.mjs.map +1 -0
  150. package/dist/docker-B0di7_Ub.cjs +1514 -0
  151. package/dist/docker-B0di7_Ub.cjs.map +1 -0
  152. package/dist/docker-D_NN2Z6W.mjs +1407 -0
  153. package/dist/docker-D_NN2Z6W.mjs.map +1 -0
  154. package/dist/dokploy-DDyZ0o4M.mjs +38 -0
  155. package/dist/dokploy-DDyZ0o4M.mjs.map +1 -0
  156. package/dist/dokploy-FFNHKz37.cjs +38 -0
  157. package/dist/dokploy-FFNHKz37.cjs.map +1 -0
  158. package/dist/drivers-aM87NQJi.cjs +224 -0
  159. package/dist/drivers-aM87NQJi.cjs.map +1 -0
  160. package/dist/drivers-uxLBq3e3.mjs +195 -0
  161. package/dist/drivers-uxLBq3e3.mjs.map +1 -0
  162. package/dist/eas-6_Z1ImVg.mjs +334 -0
  163. package/dist/eas-6_Z1ImVg.mjs.map +1 -0
  164. package/dist/eas-BetrZzjq.cjs +337 -0
  165. package/dist/eas-BetrZzjq.cjs.map +1 -0
  166. package/dist/emit-Bj6XSivk.mjs +136 -0
  167. package/dist/emit-Bj6XSivk.mjs.map +1 -0
  168. package/dist/emit-CDC__ubE.cjs +147 -0
  169. package/dist/emit-CDC__ubE.cjs.map +1 -0
  170. package/dist/encryption-BrRVjItb.cjs +90 -0
  171. package/dist/encryption-BrRVjItb.cjs.map +1 -0
  172. package/dist/encryption-DGnfdO68.mjs +89 -0
  173. package/dist/encryption-DGnfdO68.mjs.map +1 -0
  174. package/dist/engine-8TjM26dd.mjs +3217 -0
  175. package/dist/engine-8TjM26dd.mjs.map +1 -0
  176. package/dist/engine-C36N8por.cjs +3330 -0
  177. package/dist/engine-C36N8por.cjs.map +1 -0
  178. package/dist/errors-D8Gwp5kU.mjs +23 -0
  179. package/dist/errors-D8Gwp5kU.mjs.map +1 -0
  180. package/dist/errors-DMC4Umsb.cjs +34 -0
  181. package/dist/errors-DMC4Umsb.cjs.map +1 -0
  182. package/dist/github-BOu0bETi.cjs +901 -0
  183. package/dist/github-BOu0bETi.cjs.map +1 -0
  184. package/dist/github-Ct6XDkzE.mjs +900 -0
  185. package/dist/github-Ct6XDkzE.mjs.map +1 -0
  186. package/dist/googlePlay-BaRsxlJo.mjs +931 -0
  187. package/dist/googlePlay-BaRsxlJo.mjs.map +1 -0
  188. package/dist/googlePlay-JAxXMaGu.cjs +931 -0
  189. package/dist/googlePlay-JAxXMaGu.cjs.map +1 -0
  190. package/dist/{index-D-iAVHx-.d.cts → index-B35vTdAW.d.cts} +39 -15
  191. package/dist/index-B35vTdAW.d.cts.map +1 -0
  192. package/dist/{index-Cd-qeOam.d.mts → index-Dv1Zj86i.d.mts} +39 -15
  193. package/dist/index-Dv1Zj86i.d.mts.map +1 -0
  194. package/dist/index.cjs +13594 -12347
  195. package/dist/index.cjs.map +1 -1
  196. package/dist/index.mjs +13541 -12292
  197. package/dist/index.mjs.map +1 -1
  198. package/dist/local-D7WVQcJJ.mjs +224 -0
  199. package/dist/local-D7WVQcJJ.mjs.map +1 -0
  200. package/dist/local-DFPeCIJi.cjs +241 -0
  201. package/dist/local-DFPeCIJi.cjs.map +1 -0
  202. package/dist/migrate-BMIUYmpM.mjs +267 -0
  203. package/dist/migrate-BMIUYmpM.mjs.map +1 -0
  204. package/dist/migrate-CnE-X40v.mjs +181 -0
  205. package/dist/migrate-CnE-X40v.mjs.map +1 -0
  206. package/dist/migrate-CvuWFjos.cjs +181 -0
  207. package/dist/migrate-CvuWFjos.cjs.map +1 -0
  208. package/dist/migrate-DdE8kF0j.cjs +272 -0
  209. package/dist/migrate-DdE8kF0j.cjs.map +1 -0
  210. package/dist/notes-C_4SO0x4.mjs +399 -0
  211. package/dist/notes-C_4SO0x4.mjs.map +1 -0
  212. package/dist/notes-ORze6zXA.cjs +500 -0
  213. package/dist/notes-ORze6zXA.cjs.map +1 -0
  214. package/dist/openapi.cjs +213 -7
  215. package/dist/openapi.cjs.map +1 -0
  216. package/dist/openapi.d.cts +32 -8
  217. package/dist/openapi.d.cts.map +1 -1
  218. package/dist/openapi.d.mts +32 -8
  219. package/dist/openapi.d.mts.map +1 -1
  220. package/dist/openapi.mjs +208 -2
  221. package/dist/openapi.mjs.map +1 -0
  222. package/dist/projectBucket-C9x0gzEO.cjs +263 -0
  223. package/dist/projectBucket-C9x0gzEO.cjs.map +1 -0
  224. package/dist/projectBucket-CdRj4IyR.mjs +222 -0
  225. package/dist/projectBucket-CdRj4IyR.mjs.map +1 -0
  226. package/dist/provider-BqpjG9QM.cjs +57 -0
  227. package/dist/provider-BqpjG9QM.cjs.map +1 -0
  228. package/dist/provider-CEOKk8NS.mjs +46 -0
  229. package/dist/provider-CEOKk8NS.mjs.map +1 -0
  230. package/dist/publish-CL376jrq.cjs +124 -0
  231. package/dist/publish-CL376jrq.cjs.map +1 -0
  232. package/dist/publish-DkkWS3Pj.mjs +123 -0
  233. package/dist/publish-DkkWS3Pj.mjs.map +1 -0
  234. package/dist/ready-BNh3zsSn.cjs +404 -0
  235. package/dist/ready-BNh3zsSn.cjs.map +1 -0
  236. package/dist/ready-g25dcGzK.mjs +375 -0
  237. package/dist/ready-g25dcGzK.mjs.map +1 -0
  238. package/dist/reconcile/public.cjs +3 -5
  239. package/dist/reconcile/public.d.cts +31 -89
  240. package/dist/reconcile/public.d.cts.map +1 -1
  241. package/dist/reconcile/public.d.mts +31 -89
  242. package/dist/reconcile/public.d.mts.map +1 -1
  243. package/dist/reconcile/public.mjs +3 -3
  244. package/dist/{reconcile-DhQ00DpU.mjs → reconcile--I7V4Klj.mjs} +2 -2
  245. package/dist/{reconcile-DhQ00DpU.mjs.map → reconcile--I7V4Klj.mjs.map} +1 -1
  246. package/dist/{reconcile-Dd2iyILf.cjs → reconcile-CuCQBa5-.cjs} +3 -3
  247. package/dist/{reconcile-Dd2iyILf.cjs.map → reconcile-CuCQBa5-.cjs.map} +1 -1
  248. package/dist/resolve-BXzDwYUS.cjs +316 -0
  249. package/dist/resolve-BXzDwYUS.cjs.map +1 -0
  250. package/dist/resolve-CZ_Wel7j.mjs +263 -0
  251. package/dist/resolve-CZ_Wel7j.mjs.map +1 -0
  252. package/dist/rollback-D_FXI_K5.mjs +136 -0
  253. package/dist/rollback-D_FXI_K5.mjs.map +1 -0
  254. package/dist/rollback-p1y0KlED.cjs +165 -0
  255. package/dist/rollback-p1y0KlED.cjs.map +1 -0
  256. package/dist/runtime-CFvcLEJW.d.cts +82 -0
  257. package/dist/runtime-CFvcLEJW.d.cts.map +1 -0
  258. package/dist/runtime-dwsH6ddo.d.mts +82 -0
  259. package/dist/runtime-dwsH6ddo.d.mts.map +1 -0
  260. package/dist/s3-CV5baYeq.mjs +215 -0
  261. package/dist/s3-CV5baYeq.mjs.map +1 -0
  262. package/dist/s3-DTX4Kkmn.cjs +215 -0
  263. package/dist/s3-DTX4Kkmn.cjs.map +1 -0
  264. package/dist/sandbox/config-worker.cjs +43 -0
  265. package/dist/sandbox/config-worker.cjs.map +1 -0
  266. package/dist/sandbox/config-worker.d.cts +1 -0
  267. package/dist/sandbox/config-worker.d.mts +1 -0
  268. package/dist/sandbox/config-worker.mjs +44 -0
  269. package/dist/sandbox/config-worker.mjs.map +1 -0
  270. package/dist/sandbox/credentials-worker.cjs +53 -0
  271. package/dist/sandbox/credentials-worker.cjs.map +1 -0
  272. package/dist/sandbox/credentials-worker.d.cts +1 -0
  273. package/dist/sandbox/credentials-worker.d.mts +1 -0
  274. package/dist/sandbox/credentials-worker.mjs +54 -0
  275. package/dist/sandbox/credentials-worker.mjs.map +1 -0
  276. package/dist/sandbox/discover-worker.cjs +47 -0
  277. package/dist/sandbox/discover-worker.cjs.map +1 -0
  278. package/dist/sandbox/discover-worker.d.cts +1 -0
  279. package/dist/sandbox/discover-worker.d.mts +1 -0
  280. package/dist/sandbox/discover-worker.mjs +48 -0
  281. package/dist/sandbox/discover-worker.mjs.map +1 -0
  282. package/dist/sandbox/migrate-worker.cjs +75 -0
  283. package/dist/sandbox/migrate-worker.cjs.map +1 -0
  284. package/dist/sandbox/migrate-worker.d.cts +1 -0
  285. package/dist/sandbox/migrate-worker.d.mts +1 -0
  286. package/dist/sandbox/migrate-worker.mjs +76 -0
  287. package/dist/sandbox/migrate-worker.mjs.map +1 -0
  288. package/dist/{workspace-mFpI_ky_.cjs → schemas-BCwKKA42.mjs} +399 -1162
  289. package/dist/schemas-BCwKKA42.mjs.map +1 -0
  290. package/dist/{workspace-CgwmXEtc.mjs → schemas-BQ_v0lEX.cjs} +487 -971
  291. package/dist/schemas-BQ_v0lEX.cjs.map +1 -0
  292. package/dist/secretsManager-CQORubp9.mjs +97 -0
  293. package/dist/secretsManager-CQORubp9.mjs.map +1 -0
  294. package/dist/secretsManager-RAGcEDX1.cjs +108 -0
  295. package/dist/secretsManager-RAGcEDX1.cjs.map +1 -0
  296. package/dist/seeds-B3xvUAQf.cjs +363 -0
  297. package/dist/seeds-B3xvUAQf.cjs.map +1 -0
  298. package/dist/seeds-BCC8vAXR.mjs +298 -0
  299. package/dist/seeds-BCC8vAXR.mjs.map +1 -0
  300. package/dist/serverSetup-BykJrnYe.cjs +652 -0
  301. package/dist/serverSetup-BykJrnYe.cjs.map +1 -0
  302. package/dist/serverSetup-CkuvIoej.mjs +652 -0
  303. package/dist/serverSetup-CkuvIoej.mjs.map +1 -0
  304. package/dist/sniffer-BIpoMNGz.mjs +1824 -0
  305. package/dist/sniffer-BIpoMNGz.mjs.map +1 -0
  306. package/dist/sniffer-DiBMi93N.cjs +1997 -0
  307. package/dist/sniffer-DiBMi93N.cjs.map +1 -0
  308. package/dist/snsSubscriptions-CkO_zk0j.cjs +1173 -0
  309. package/dist/snsSubscriptions-CkO_zk0j.cjs.map +1 -0
  310. package/dist/snsSubscriptions-CrmfcJfv.mjs +1048 -0
  311. package/dist/snsSubscriptions-CrmfcJfv.mjs.map +1 -0
  312. package/dist/sst-BZ9sTG8H.mjs +462 -0
  313. package/dist/sst-BZ9sTG8H.mjs.map +1 -0
  314. package/dist/sst-D233GoQY.cjs +485 -0
  315. package/dist/sst-D233GoQY.cjs.map +1 -0
  316. package/dist/stack-1yXKqI83.cjs +2287 -0
  317. package/dist/stack-1yXKqI83.cjs.map +1 -0
  318. package/dist/stack-pUz70Rmw.mjs +2124 -0
  319. package/dist/stack-pUz70Rmw.mjs.map +1 -0
  320. package/dist/stage-D6E_TlvR.mjs +302 -0
  321. package/dist/stage-D6E_TlvR.mjs.map +1 -0
  322. package/dist/stage-DAhomyUk.cjs +313 -0
  323. package/dist/stage-DAhomyUk.cjs.map +1 -0
  324. package/dist/stages-Bs1THSy7.cjs +190 -0
  325. package/dist/stages-Bs1THSy7.cjs.map +1 -0
  326. package/dist/stages-_xCG4Ymu.mjs +190 -0
  327. package/dist/stages-_xCG4Ymu.mjs.map +1 -0
  328. package/dist/target/public.cjs +15 -0
  329. package/dist/target/public.d.cts +28 -0
  330. package/dist/target/public.d.cts.map +1 -0
  331. package/dist/target/public.d.mts +28 -0
  332. package/dist/target/public.d.mts.map +1 -0
  333. package/dist/target/public.mjs +4 -0
  334. package/dist/terminal-CKBLsg6b.cjs +85 -0
  335. package/dist/terminal-CKBLsg6b.cjs.map +1 -0
  336. package/dist/terminal-CRinpE1t.mjs +85 -0
  337. package/dist/terminal-CRinpE1t.mjs.map +1 -0
  338. package/dist/types-Bl_CwZC9.cjs +90 -0
  339. package/dist/types-Bl_CwZC9.cjs.map +1 -0
  340. package/dist/{types-BGo5TaNE.d.mts → types-Dk--xVOT.d.cts} +2234 -439
  341. package/dist/types-Dk--xVOT.d.cts.map +1 -0
  342. package/dist/{types-C5ZNpUad.d.cts → types-DwQYpd_0.d.mts} +2232 -439
  343. package/dist/types-DwQYpd_0.d.mts.map +1 -0
  344. package/dist/types-Y1NfWlyG.mjs +61 -0
  345. package/dist/types-Y1NfWlyG.mjs.map +1 -0
  346. package/dist/utils-D2Nk1Nv2.cjs +205 -0
  347. package/dist/utils-D2Nk1Nv2.cjs.map +1 -0
  348. package/dist/utils-D_fxUqvU.mjs +156 -0
  349. package/dist/utils-D_fxUqvU.mjs.map +1 -0
  350. package/dist/vitest.cjs +65 -0
  351. package/dist/vitest.cjs.map +1 -0
  352. package/dist/vitest.d.cts +29 -0
  353. package/dist/vitest.d.cts.map +1 -0
  354. package/dist/vitest.d.mts +29 -0
  355. package/dist/vitest.d.mts.map +1 -0
  356. package/dist/vitest.mjs +65 -0
  357. package/dist/vitest.mjs.map +1 -0
  358. package/dist/workerRuntime-BXfhbe13.cjs +108 -0
  359. package/dist/workerRuntime-BXfhbe13.cjs.map +1 -0
  360. package/dist/workerRuntime-CsOyBRx2.mjs +79 -0
  361. package/dist/workerRuntime-CsOyBRx2.mjs.map +1 -0
  362. package/dist/workspace/index.cjs +6 -2
  363. package/dist/workspace/index.d.cts +3 -3
  364. package/dist/workspace/index.d.mts +3 -3
  365. package/dist/workspace/index.mjs +2 -2
  366. package/dist/workspace-1szcahj9.cjs +2916 -0
  367. package/dist/workspace-1szcahj9.cjs.map +1 -0
  368. package/dist/workspace-DFGsrjGD.mjs +2480 -0
  369. package/dist/workspace-DFGsrjGD.mjs.map +1 -0
  370. package/package.json +66 -14
  371. package/dist/HostingerProvider-BY26bWwB.mjs.map +0 -1
  372. package/dist/HostingerProvider-BZFGYYVA.cjs.map +0 -1
  373. package/dist/LocalStateProvider-7HR6SS2t.cjs +0 -48
  374. package/dist/LocalStateProvider-7HR6SS2t.cjs.map +0 -1
  375. package/dist/LocalStateProvider-D7QyJoLM.mjs +0 -48
  376. package/dist/LocalStateProvider-D7QyJoLM.mjs.map +0 -1
  377. package/dist/Route53Provider-Cvj40A8I.mjs.map +0 -1
  378. package/dist/Route53Provider-DVILBsvV.cjs.map +0 -1
  379. package/dist/SSMStateProvider-B0Hu1MKZ.mjs +0 -75
  380. package/dist/SSMStateProvider-B0Hu1MKZ.mjs.map +0 -1
  381. package/dist/SSMStateProvider-VrQ-yeqd.cjs +0 -74
  382. package/dist/SSMStateProvider-VrQ-yeqd.cjs.map +0 -1
  383. package/dist/backup-provisioner-BmhIO_Yr.cjs.map +0 -1
  384. package/dist/backup-provisioner-DIVCbfee.mjs.map +0 -1
  385. package/dist/bundler-BeNDZdHQ.cjs.map +0 -1
  386. package/dist/bundler-BodTL4kf.mjs.map +0 -1
  387. package/dist/config-Q1rvKHvw.cjs +0 -467
  388. package/dist/config-Q1rvKHvw.cjs.map +0 -1
  389. package/dist/config-pqGD3hF9.mjs +0 -414
  390. package/dist/config-pqGD3hF9.mjs.map +0 -1
  391. package/dist/config.d.cts.map +0 -1
  392. package/dist/config.d.mts.map +0 -1
  393. package/dist/credentials-BekkKtY_.mjs +0 -2780
  394. package/dist/credentials-BekkKtY_.mjs.map +0 -1
  395. package/dist/credentials-Q6F0uqJq.cjs +0 -2917
  396. package/dist/credentials-Q6F0uqJq.cjs.map +0 -1
  397. package/dist/discover-BERGFg8v.cjs +0 -288
  398. package/dist/discover-BERGFg8v.cjs.map +0 -1
  399. package/dist/discover-CK-n3w6b.mjs +0 -244
  400. package/dist/discover-CK-n3w6b.mjs.map +0 -1
  401. package/dist/emit-BdoPFjZf.cjs +0 -253
  402. package/dist/emit-BdoPFjZf.cjs.map +0 -1
  403. package/dist/emit-Bzq7JsMP.mjs +0 -224
  404. package/dist/emit-Bzq7JsMP.mjs.map +0 -1
  405. package/dist/fullstack-secrets-BET8gqwK.mjs +0 -81
  406. package/dist/fullstack-secrets-BET8gqwK.mjs.map +0 -1
  407. package/dist/fullstack-secrets-DXsWO-5m.cjs +0 -92
  408. package/dist/fullstack-secrets-DXsWO-5m.cjs.map +0 -1
  409. package/dist/generator-LfZU7NlU.mjs +0 -247
  410. package/dist/generator-LfZU7NlU.mjs.map +0 -1
  411. package/dist/generator-Wdfp0jCS.cjs +0 -282
  412. package/dist/generator-Wdfp0jCS.cjs.map +0 -1
  413. package/dist/github-BfflNPVe.cjs +0 -203
  414. package/dist/github-BfflNPVe.cjs.map +0 -1
  415. package/dist/github-CRwnxKmD.mjs +0 -203
  416. package/dist/github-CRwnxKmD.mjs.map +0 -1
  417. package/dist/index-Cd-qeOam.d.mts.map +0 -1
  418. package/dist/index-D-iAVHx-.d.cts.map +0 -1
  419. package/dist/keystore-B4PRlbgE.mjs +0 -81
  420. package/dist/keystore-B4PRlbgE.mjs.map +0 -1
  421. package/dist/keystore-DgGRj2Yy.cjs +0 -98
  422. package/dist/keystore-DgGRj2Yy.cjs.map +0 -1
  423. package/dist/openapi-Dcbme-Us.cjs +0 -2038
  424. package/dist/openapi-Dcbme-Us.cjs.map +0 -1
  425. package/dist/openapi-vy4JzhUv.mjs +0 -1991
  426. package/dist/openapi-vy4JzhUv.mjs.map +0 -1
  427. package/dist/storage-C-30BD1e.cjs +0 -272
  428. package/dist/storage-C-30BD1e.cjs.map +0 -1
  429. package/dist/storage-P_b3w7uj.mjs +0 -231
  430. package/dist/storage-P_b3w7uj.mjs.map +0 -1
  431. package/dist/sync-B3xxXtJT.mjs +0 -88
  432. package/dist/sync-B3xxXtJT.mjs.map +0 -1
  433. package/dist/sync-D7uTIIEi.cjs +0 -111
  434. package/dist/sync-D7uTIIEi.cjs.map +0 -1
  435. package/dist/types-BGo5TaNE.d.mts.map +0 -1
  436. package/dist/types-C5ZNpUad.d.cts.map +0 -1
  437. package/dist/workspace-CgwmXEtc.mjs.map +0 -1
  438. package/dist/workspace-mFpI_ky_.cjs.map +0 -1
@@ -0,0 +1,147 @@
1
+ let _geekmidas_manifest = require("@geekmidas/manifest");
2
+ //#region src/reconcile/emit.ts
3
+ /**
4
+ * Point each handler discovery found at the entry the build generated for it.
5
+ *
6
+ * Discovery already nested every endpoint, route, cron, function, consumer,
7
+ * subscriber and processor, with its edges — the graph is the same for every
8
+ * command. A build adds one fact: where it wrote each handler. So this
9
+ * replaces `handler` and nothing else, and a handler the build generated no
10
+ * entry of its own for keeps its source.
11
+ *
12
+ * That is the `server` provider's whole application: it generates one
13
+ * catch-all — `ALL *` pointing at the Hono app that routes in-process — which
14
+ * matches no endpoint, so every endpoint keeps the source it was found at.
15
+ */
16
+ function withHandlers(manifest, generated) {
17
+ const next = { ...manifest };
18
+ const at = (list, id, handler) => list.map((item) => item.id === id ? {
19
+ ...item,
20
+ handler
21
+ } : item);
22
+ for (const route of generated.routes ?? []) for (const [id, declaration] of Object.entries(next)) {
23
+ if (declaration.kind !== "rest-api") continue;
24
+ if (route.surface && route.surface !== id) continue;
25
+ next[id] = {
26
+ ...declaration,
27
+ endpoints: declaration.endpoints.map((endpoint) => endpoint.method === route.method && endpoint.path === route.path ? {
28
+ ...endpoint,
29
+ handler: route.handler
30
+ } : endpoint)
31
+ };
32
+ }
33
+ for (const fn of [...generated.functions ?? [], ...generated.crons ?? []]) {
34
+ const declaration = next[fn.name];
35
+ if (declaration?.kind === "function" || declaration?.kind === "cron") next[fn.name] = {
36
+ ...declaration,
37
+ handler: fn.handler
38
+ };
39
+ }
40
+ for (const consumer of generated.queues ?? []) {
41
+ const queue = next[(0, _geekmidas_manifest.canonicalId)(consumer.name)];
42
+ if (queue?.kind !== "queue") continue;
43
+ next[queue.id] = {
44
+ ...queue,
45
+ worker: {
46
+ ...queue.worker,
47
+ handler: consumer.handler
48
+ }
49
+ };
50
+ }
51
+ for (const subscriber of generated.subscribers ?? []) {
52
+ const bucket = subscriber.bucket ? next[(0, _geekmidas_manifest.canonicalId)(subscriber.bucket)] : void 0;
53
+ if (bucket?.kind === "objects") {
54
+ next[bucket.id] = {
55
+ ...bucket,
56
+ subscribers: at(bucket.subscribers ?? [], subscriber.name, subscriber.handler)
57
+ };
58
+ continue;
59
+ }
60
+ const topic = subscriber.topic ? next[(0, _geekmidas_manifest.canonicalId)(subscriber.topic)] : void 0;
61
+ if (topic?.kind !== "topic") continue;
62
+ next[topic.id] = {
63
+ ...topic,
64
+ subscribers: at(topic.subscribers, subscriber.name, subscriber.handler)
65
+ };
66
+ }
67
+ for (const processor of generated.processors ?? []) {
68
+ const server = next[processor.fileServer];
69
+ if (server?.kind !== "file-server") continue;
70
+ next[server.id] = {
71
+ ...server,
72
+ processors: at(server.processors ?? [], processor.name, processor.handler)
73
+ };
74
+ }
75
+ return next;
76
+ }
77
+ /**
78
+ * The manifest as TypeScript source.
79
+ *
80
+ * Pure, so what gets written can be asserted without touching a filesystem.
81
+ */
82
+ function manifestModule(manifest, backends = {}) {
83
+ return `${HEADER}
84
+ export const constructs = ${serialise(manifest)} as const satisfies ConstructManifest;
85
+
86
+ /**
87
+ * Where the backends that are *config* rather than declaration resolved to.
88
+ *
89
+ * Recorded because they were being answered twice: once by the build, which
90
+ * registers exactly one cache driver, and once by a deploy config, which told
91
+ * the provisioner something else. The result was a deployed URL the running code
92
+ * had no driver for — two documents disagreeing about one fact, which is what
93
+ * this manifest exists to stop.
94
+ */
95
+ export const backends = ${serialise(backends)} as const;
96
+
97
+ // Derived types
98
+ export type Ids = IdsOf<typeof constructs>;
99
+ export type Construct<Id extends Ids> = DeclarationOf<typeof constructs, Id>;
100
+ export type Kind = Construct<Ids>['kind'];
101
+
102
+ // Useful union types
103
+ export type ProvidedKeys = AllProvidedKeys<typeof constructs>;
104
+ export type Surfaces = IdsOfKind<typeof constructs, 'rest-api'>;
105
+ export type CacheBackend = (typeof backends)['cache'];
106
+ export type EmailBackend = (typeof backends)['email'];
107
+ `;
108
+ }
109
+ const HEADER = `// Generated by \`gkm build\`. Do not edit.
110
+ //
111
+ // Discovery imports application code, so it runs once here rather than in every
112
+ // consumer — a deploy config that discovered for itself would evaluate the whole
113
+ // runtime graph inside its own toolchain. This is the result, as literals.
114
+
115
+ import type {
116
+ AllProvidedKeys,
117
+ ConstructManifest,
118
+ DeclarationOf,
119
+ IdsOf,
120
+ IdsOfKind,
121
+ } from '@geekmidas/manifest';
122
+ `;
123
+ /**
124
+ * JSON, re-indented with tabs and with keys left unquoted where they can be.
125
+ *
126
+ * Cosmetic, and worth it: this file is read by people trying to work out what
127
+ * their app declares, and a wall of quoted keys reads as output rather than as
128
+ * something anyone is expected to understand.
129
+ */
130
+ function serialise(value) {
131
+ return JSON.stringify(value, null, " ").replace(/^(\t*)"([A-Za-z_$][\w$]*)":/gm, "$1$2:").replace(/"/g, "'");
132
+ }
133
+ //#endregion
134
+ Object.defineProperty(exports, "manifestModule", {
135
+ enumerable: true,
136
+ get: function() {
137
+ return manifestModule;
138
+ }
139
+ });
140
+ Object.defineProperty(exports, "withHandlers", {
141
+ enumerable: true,
142
+ get: function() {
143
+ return withHandlers;
144
+ }
145
+ });
146
+
147
+ //# sourceMappingURL=emit-CDC__ubE.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emit-CDC__ubE.cjs","names":["canonicalId"],"sources":["../src/reconcile/emit.ts"],"sourcesContent":["/**\n * The manifest, written out as a module.\n *\n * Discovery imports the application's own code — that is how it finds\n * constructs — so anything calling it evaluates the whole runtime graph: React\n * email templates, database clients, modules that read env at import time. That\n * is fine inside `gkm dev`, which is already running the app. It is not fine\n * inside a deploy config, where it fails on the first thing the deploy toolchain\n * does not expect and would keep failing on the next.\n *\n * So discovery happens once, in the build, and everything downstream reads what\n * it wrote. The same split `RestApi` makes by naming a routes glob rather than\n * importing route modules.\n *\n * A module rather than JSON, because a manifest is not just data to this\n * codebase — `as const satisfies ConstructManifest` is what keeps every id,\n * kind and provided key a *literal*, so `IdsOf`, `ProvidedKeys` and the rest\n * can select out of it. `JSON.parse` returns `any` and gives all of that up.\n */\n\nimport type {\n\tConstructManifest,\n\tCronInfo,\n\tDeclaration,\n\tFunctionInfo,\n\tProcessorInfo,\n\tQueueInfo,\n\tRouteInfo,\n\tSubscriberInfo,\n} from '@geekmidas/manifest';\nimport { canonicalId } from '@geekmidas/manifest';\nimport type { CacheBackend, EmailBackend } from '../types.js';\n\n/** What a build generated: the entry each handler was written to. */\nexport interface GeneratedHandlers {\n\t/** Each route, with the surface the app that generated it serves. */\n\troutes?: readonly (RouteInfo & { surface?: string })[];\n\tfunctions?: readonly FunctionInfo[];\n\tcrons?: readonly CronInfo[];\n\tqueues?: readonly QueueInfo[];\n\tsubscribers?: readonly SubscriberInfo[];\n\tprocessors?: readonly ProcessorInfo[];\n}\n\n/**\n * Point each handler discovery found at the entry the build generated for it.\n *\n * Discovery already nested every endpoint, route, cron, function, consumer,\n * subscriber and processor, with its edges — the graph is the same for every\n * command. A build adds one fact: where it wrote each handler. So this\n * replaces `handler` and nothing else, and a handler the build generated no\n * entry of its own for keeps its source.\n *\n * That is the `server` provider's whole application: it generates one\n * catch-all — `ALL *` pointing at the Hono app that routes in-process — which\n * matches no endpoint, so every endpoint keeps the source it was found at.\n */\nexport function withHandlers(\n\tmanifest: ConstructManifest,\n\tgenerated: GeneratedHandlers,\n): ConstructManifest {\n\tconst next: Record<string, Declaration> = { ...manifest };\n\tconst at = <T extends { id: string; handler: string }>(\n\t\tlist: readonly T[],\n\t\tid: string,\n\t\thandler: string,\n\t): T[] => list.map((item) => (item.id === id ? { ...item, handler } : item));\n\n\tfor (const route of generated.routes ?? []) {\n\t\tfor (const [id, declaration] of Object.entries(next)) {\n\t\t\tif (declaration.kind !== 'rest-api') continue;\n\t\t\tif (route.surface && route.surface !== id) continue;\n\t\t\tnext[id] = {\n\t\t\t\t...declaration,\n\t\t\t\tendpoints: declaration.endpoints.map((endpoint) =>\n\t\t\t\t\tendpoint.method === route.method && endpoint.path === route.path\n\t\t\t\t\t\t? { ...endpoint, handler: route.handler }\n\t\t\t\t\t\t: endpoint,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\t}\n\n\tfor (const fn of [\n\t\t...(generated.functions ?? []),\n\t\t...(generated.crons ?? []),\n\t]) {\n\t\tconst declaration = next[fn.name];\n\t\tif (declaration?.kind === 'function' || declaration?.kind === 'cron') {\n\t\t\tnext[fn.name] = { ...declaration, handler: fn.handler };\n\t\t}\n\t}\n\n\tfor (const consumer of generated.queues ?? []) {\n\t\tconst queue = next[canonicalId(consumer.name)];\n\t\tif (queue?.kind !== 'queue') continue;\n\t\tnext[queue.id] = {\n\t\t\t...queue,\n\t\t\tworker: { ...queue.worker, handler: consumer.handler },\n\t\t};\n\t}\n\n\tfor (const subscriber of generated.subscribers ?? []) {\n\t\tconst bucket = subscriber.bucket\n\t\t\t? next[canonicalId(subscriber.bucket)]\n\t\t\t: undefined;\n\t\tif (bucket?.kind === 'objects') {\n\t\t\tnext[bucket.id] = {\n\t\t\t\t...bucket,\n\t\t\t\tsubscribers: at(\n\t\t\t\t\tbucket.subscribers ?? [],\n\t\t\t\t\tsubscriber.name,\n\t\t\t\t\tsubscriber.handler,\n\t\t\t\t),\n\t\t\t};\n\t\t\tcontinue;\n\t\t}\n\t\tconst topic = subscriber.topic\n\t\t\t? next[canonicalId(subscriber.topic)]\n\t\t\t: undefined;\n\t\tif (topic?.kind !== 'topic') continue;\n\t\tnext[topic.id] = {\n\t\t\t...topic,\n\t\t\tsubscribers: at(topic.subscribers, subscriber.name, subscriber.handler),\n\t\t};\n\t}\n\n\tfor (const processor of generated.processors ?? []) {\n\t\tconst server = next[processor.fileServer];\n\t\tif (server?.kind !== 'file-server') continue;\n\t\tnext[server.id] = {\n\t\t\t...server,\n\t\t\tprocessors: at(\n\t\t\t\tserver.processors ?? [],\n\t\t\t\tprocessor.name,\n\t\t\t\tprocessor.handler,\n\t\t\t),\n\t\t};\n\t}\n\n\treturn next;\n}\n\n/**\n * The manifest as TypeScript source.\n *\n * Pure, so what gets written can be asserted without touching a filesystem.\n */\nexport function manifestModule(\n\tmanifest: ConstructManifest,\n\tbackends: Backends = {},\n): string {\n\treturn `${HEADER}\nexport const constructs = ${serialise(manifest)} as const satisfies ConstructManifest;\n\n/**\n * Where the backends that are *config* rather than declaration resolved to.\n *\n * Recorded because they were being answered twice: once by the build, which\n * registers exactly one cache driver, and once by a deploy config, which told\n * the provisioner something else. The result was a deployed URL the running code\n * had no driver for — two documents disagreeing about one fact, which is what\n * this manifest exists to stop.\n */\nexport const backends = ${serialise(backends)} as const;\n\n// Derived types\nexport type Ids = IdsOf<typeof constructs>;\nexport type Construct<Id extends Ids> = DeclarationOf<typeof constructs, Id>;\nexport type Kind = Construct<Ids>['kind'];\n\n// Useful union types\nexport type ProvidedKeys = AllProvidedKeys<typeof constructs>;\nexport type Surfaces = IdsOfKind<typeof constructs, 'rest-api'>;\nexport type CacheBackend = (typeof backends)['cache'];\nexport type EmailBackend = (typeof backends)['email'];\n`;\n}\n\n/** The choices that are deployment config rather than declaration. */\nexport interface Backends {\n\tcache?: CacheBackend;\n\temail?: EmailBackend;\n\t/**\n\t * The labels no tenant of the wildcard site may take — every app's own\n\t * and the workspace's `protectedSubdomains`. Config the AWS target cannot\n\t * read for itself, so it travels with the manifest.\n\t */\n\tprotectedSubdomains?: readonly string[];\n}\n\nconst HEADER = `// Generated by \\`gkm build\\`. Do not edit.\n//\n// Discovery imports application code, so it runs once here rather than in every\n// consumer — a deploy config that discovered for itself would evaluate the whole\n// runtime graph inside its own toolchain. This is the result, as literals.\n\nimport type {\n\tAllProvidedKeys,\n\tConstructManifest,\n\tDeclarationOf,\n\tIdsOf,\n\tIdsOfKind,\n} from '@geekmidas/manifest';\n`;\n\n/**\n * JSON, re-indented with tabs and with keys left unquoted where they can be.\n *\n * Cosmetic, and worth it: this file is read by people trying to work out what\n * their app declares, and a wall of quoted keys reads as output rather than as\n * something anyone is expected to understand.\n */\nfunction serialise(value: object): string {\n\treturn JSON.stringify(value, null, '\\t')\n\t\t.replace(/^(\\t*)\"([A-Za-z_$][\\w$]*)\":/gm, '$1$2:')\n\t\t.replace(/\"/g, \"'\");\n}\n"],"mappings":";;;;;;;;;;;;;;;AAyDA,SAAgB,aACf,UACA,WACoB;CACpB,MAAM,OAAoC,EAAE,GAAG,SAAS;CACxD,MAAM,MACL,MACA,IACA,YACS,KAAK,KAAK,SAAU,KAAK,OAAO,KAAK;EAAE,GAAG;EAAM;CAAQ,IAAI,IAAK;CAE3E,KAAK,MAAM,SAAS,UAAU,UAAU,CAAC,GACxC,KAAK,MAAM,CAAC,IAAI,gBAAgB,OAAO,QAAQ,IAAI,GAAG;EACrD,IAAI,YAAY,SAAS,YAAY;EACrC,IAAI,MAAM,WAAW,MAAM,YAAY,IAAI;EAC3C,KAAK,MAAM;GACV,GAAG;GACH,WAAW,YAAY,UAAU,KAAK,aACrC,SAAS,WAAW,MAAM,UAAU,SAAS,SAAS,MAAM,OACzD;IAAE,GAAG;IAAU,SAAS,MAAM;GAAQ,IACtC,QACJ;EACD;CACD;CAGD,KAAK,MAAM,MAAM,CAChB,GAAI,UAAU,aAAa,CAAC,GAC5B,GAAI,UAAU,SAAS,CAAC,CACzB,GAAG;EACF,MAAM,cAAc,KAAK,GAAG;EAC5B,IAAI,aAAa,SAAS,cAAc,aAAa,SAAS,QAC7D,KAAK,GAAG,QAAQ;GAAE,GAAG;GAAa,SAAS,GAAG;EAAQ;CAExD;CAEA,KAAK,MAAM,YAAY,UAAU,UAAU,CAAC,GAAG;EAC9C,MAAM,QAAQ,MAAA,GAAKA,oBAAAA,YAAAA,CAAY,SAAS,IAAI;EAC5C,IAAI,OAAO,SAAS,SAAS;EAC7B,KAAK,MAAM,MAAM;GAChB,GAAG;GACH,QAAQ;IAAE,GAAG,MAAM;IAAQ,SAAS,SAAS;GAAQ;EACtD;CACD;CAEA,KAAK,MAAM,cAAc,UAAU,eAAe,CAAC,GAAG;EACrD,MAAM,SAAS,WAAW,SACvB,MAAA,GAAKA,oBAAAA,YAAAA,CAAY,WAAW,MAAM,KAClC,KAAA;EACH,IAAI,QAAQ,SAAS,WAAW;GAC/B,KAAK,OAAO,MAAM;IACjB,GAAG;IACH,aAAa,GACZ,OAAO,eAAe,CAAC,GACvB,WAAW,MACX,WAAW,OACZ;GACD;GACA;EACD;EACA,MAAM,QAAQ,WAAW,QACtB,MAAA,GAAKA,oBAAAA,YAAAA,CAAY,WAAW,KAAK,KACjC,KAAA;EACH,IAAI,OAAO,SAAS,SAAS;EAC7B,KAAK,MAAM,MAAM;GAChB,GAAG;GACH,aAAa,GAAG,MAAM,aAAa,WAAW,MAAM,WAAW,OAAO;EACvE;CACD;CAEA,KAAK,MAAM,aAAa,UAAU,cAAc,CAAC,GAAG;EACnD,MAAM,SAAS,KAAK,UAAU;EAC9B,IAAI,QAAQ,SAAS,eAAe;EACpC,KAAK,OAAO,MAAM;GACjB,GAAG;GACH,YAAY,GACX,OAAO,cAAc,CAAC,GACtB,UAAU,MACV,UAAU,OACX;EACD;CACD;CAEA,OAAO;AACR;;;;;;AAOA,SAAgB,eACf,UACA,WAAqB,CAAC,GACb;CACT,OAAO,GAAG,OAAO;4BACU,UAAU,QAAQ,EAAE;;;;;;;;;;;0BAWtB,UAAU,QAAQ,EAAE;;;;;;;;;;;;;AAa9C;AAcA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;AAsBf,SAAS,UAAU,OAAuB;CACzC,OAAO,KAAK,UAAU,OAAO,MAAM,GAAI,CAAC,CACtC,QAAQ,iCAAiC,OAAO,CAAC,CACjD,QAAQ,MAAM,GAAG;AACpB"}
@@ -0,0 +1,90 @@
1
+ const require_errors = require("./errors-DMC4Umsb.cjs");
2
+ const require_credentials = require("./credentials-Dmhuj3FX.cjs");
3
+ const require_workspace = require("./workspace-1szcahj9.cjs");
4
+ const require_config = require("./config-juUyBlb1.cjs");
5
+ let _geekmidas_manifest = require("@geekmidas/manifest");
6
+ let _geekmidas_constructs_encryption = require("@geekmidas/constructs/encryption");
7
+ //#region src/encryption/index.ts
8
+ /**
9
+ * `gkm encryption:rotate` and `gkm encryption:retire` — the keyring of an
10
+ * `Encryption` construct on a server stage.
11
+ *
12
+ * Rotating adds a key in front and keeps every older one, so what they wrote
13
+ * still opens. Retiring removes one, and is the half that makes rotating worth
14
+ * doing: until a key is gone, it still opens everything it ever wrote. It is
15
+ * never automatic, because the only thing that knows nothing is left under a
16
+ * key is the sweep that re-encrypted the column — so it is done after one,
17
+ * deliberately, by name.
18
+ *
19
+ * Neither applies everywhere, and each says so rather than doing something
20
+ * that looks right: a local stage's keyring is derived and would be replaced on
21
+ * the next `gkm dev`, and on AWS the key is KMS's, which rotates it itself and
22
+ * never strands a value.
23
+ */
24
+ const logger = console;
25
+ var LocalKeyringIsDerived = class extends require_errors.GkmError {
26
+ construct;
27
+ stage;
28
+ constructor(construct, stage) {
29
+ super(`'${stage}' is the local stage, where ${construct}'s keyring is derived from the project and stage — nothing stored there would be read. Rotate a deployed stage: gkm encryption:rotate ${construct} --stage <stage>.`);
30
+ this.construct = construct;
31
+ this.stage = stage;
32
+ this.name = "LocalKeyringIsDerived";
33
+ }
34
+ };
35
+ var KmsRotatesItself = class extends require_errors.GkmError {
36
+ construct;
37
+ constructor(construct) {
38
+ super(`${construct} is a KMS key on AWS: KMS rotates it yearly and keeps every version, so no value is ever stranded and there is no key to retire. Nothing to do here.`);
39
+ this.construct = construct;
40
+ this.name = "KmsRotatesItself";
41
+ }
42
+ };
43
+ var NoKeyringYet = class extends require_errors.GkmError {
44
+ construct;
45
+ stage;
46
+ key;
47
+ constructor(construct, stage, key) {
48
+ super(`'${stage}' has no ${key} yet. The first deploy generates ${construct}'s keyring: gkm deploy --stage ${stage}.`);
49
+ this.construct = construct;
50
+ this.stage = stage;
51
+ this.key = key;
52
+ this.name = "NoKeyringYet";
53
+ }
54
+ };
55
+ async function encryptionRotateCommand(construct, options, context = {}) {
56
+ return updateKeyring(construct, options, context, (id, url) => {
57
+ const next = (0, _geekmidas_constructs_encryption.rotateKeyring)(id, url);
58
+ const [current, ...older] = (0, _geekmidas_constructs_encryption.parseKeyring)(id, next).keys.map(({ id }) => id);
59
+ logger.log(`\n✓ ${id} on '${options.stage}' now writes with '${current}'.`);
60
+ logger.log(` Still opening: ${older.join(", ")}. Redeploy to start writing with '${current}', reencrypt what is stored, then: gkm encryption:retire ${id} <key> --stage ${options.stage}`);
61
+ return next;
62
+ });
63
+ }
64
+ async function encryptionRetireCommand(construct, keyId, options, context = {}) {
65
+ return updateKeyring(construct, options, context, (id, url) => {
66
+ const next = (0, _geekmidas_constructs_encryption.retireKey)(id, url, keyId);
67
+ logger.log(`\n✓ ${id} on '${options.stage}' no longer holds '${keyId}'. Anything still under it cannot be read after the next deploy.`);
68
+ return next;
69
+ });
70
+ }
71
+ async function updateKeyring(construct, { stage }, context, update) {
72
+ const workspace = context.workspace ?? await require_config.loadWorkspaceSettings();
73
+ const id = (0, _geekmidas_manifest.canonicalId)(construct);
74
+ if (stage === workspace.stages.local) throw new LocalKeyringIsDerived(id, stage);
75
+ require_workspace.assertDeployedStage(workspace.stages, stage);
76
+ if (require_credentials.providerOf(workspace) === "aws") throw new KmsRotatesItself(id);
77
+ const store = context.store ?? await require_credentials.secretsStoreFor(workspace, stage);
78
+ const key = (0, _geekmidas_manifest.provideKey)(id, "url");
79
+ const secrets = await store.read(stage);
80
+ const url = secrets?.custom[key];
81
+ if (!secrets || !url) throw new NoKeyringYet(id, stage, key);
82
+ const next = update(id, url);
83
+ await store.write(stage, require_credentials.withCustomSecret(secrets, key, next));
84
+ return next;
85
+ }
86
+ //#endregion
87
+ exports.encryptionRetireCommand = encryptionRetireCommand;
88
+ exports.encryptionRotateCommand = encryptionRotateCommand;
89
+
90
+ //# sourceMappingURL=encryption-BrRVjItb.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encryption-BrRVjItb.cjs","names":["GkmError","rotateKeyring","parseKeyring","retireKey","loadWorkspaceSettings","canonicalId","providerOf","secretsStoreFor","provideKey","withCustomSecret"],"sources":["../src/encryption/index.ts"],"sourcesContent":["/**\n * `gkm encryption:rotate` and `gkm encryption:retire` — the keyring of an\n * `Encryption` construct on a server stage.\n *\n * Rotating adds a key in front and keeps every older one, so what they wrote\n * still opens. Retiring removes one, and is the half that makes rotating worth\n * doing: until a key is gone, it still opens everything it ever wrote. It is\n * never automatic, because the only thing that knows nothing is left under a\n * key is the sweep that re-encrypted the column — so it is done after one,\n * deliberately, by name.\n *\n * Neither applies everywhere, and each says so rather than doing something\n * that looks right: a local stage's keyring is derived and would be replaced on\n * the next `gkm dev`, and on AWS the key is KMS's, which rotates it itself and\n * never strands a value.\n */\n\nimport {\n\tparseKeyring,\n\tretireKey,\n\trotateKeyring,\n} from '@geekmidas/constructs/encryption';\nimport { canonicalId, provideKey } from '@geekmidas/manifest';\nimport { loadWorkspaceSettings } from '../config';\nimport { GkmError } from '../errors';\nimport { withCustomSecret } from '../secrets/storage.js';\nimport { type SecretsStore, secretsStoreFor } from '../secrets/store.js';\nimport { providerOf } from '../workspace/backends.js';\nimport { assertDeployedStage } from '../workspace/stages.js';\nimport type { NormalizedWorkspace } from '../workspace/types.js';\n\nconst logger = console;\n\nexport class LocalKeyringIsDerived extends GkmError {\n\tconstructor(\n\t\treadonly construct: string,\n\t\treadonly stage: string,\n\t) {\n\t\tsuper(\n\t\t\t`'${stage}' is the local stage, where ${construct}'s keyring is derived from the project and stage — nothing stored there would be read. Rotate a deployed stage: gkm encryption:rotate ${construct} --stage <stage>.`,\n\t\t);\n\t\tthis.name = 'LocalKeyringIsDerived';\n\t}\n}\n\nexport class KmsRotatesItself extends GkmError {\n\tconstructor(readonly construct: string) {\n\t\tsuper(\n\t\t\t`${construct} is a KMS key on AWS: KMS rotates it yearly and keeps every version, so no value is ever stranded and there is no key to retire. Nothing to do here.`,\n\t\t);\n\t\tthis.name = 'KmsRotatesItself';\n\t}\n}\n\nexport class NoKeyringYet extends GkmError {\n\tconstructor(\n\t\treadonly construct: string,\n\t\treadonly stage: string,\n\t\treadonly key: string,\n\t) {\n\t\tsuper(\n\t\t\t`'${stage}' has no ${key} yet. The first deploy generates ${construct}'s keyring: gkm deploy --stage ${stage}.`,\n\t\t);\n\t\tthis.name = 'NoKeyringYet';\n\t}\n}\n\nexport interface EncryptionCommandOptions {\n\tstage: string;\n}\n\n/** Where a command reads and writes; the real ones unless a test says. */\nexport interface EncryptionCommandContext {\n\tworkspace?: NormalizedWorkspace;\n\tstore?: SecretsStore;\n}\n\nexport async function encryptionRotateCommand(\n\tconstruct: string,\n\toptions: EncryptionCommandOptions,\n\tcontext: EncryptionCommandContext = {},\n): Promise<string> {\n\treturn updateKeyring(construct, options, context, (id, url) => {\n\t\tconst next = rotateKeyring(id, url);\n\t\tconst [current, ...older] = parseKeyring(id, next).keys.map(({ id }) => id);\n\n\t\tlogger.log(`\\n✓ ${id} on '${options.stage}' now writes with '${current}'.`);\n\t\tlogger.log(\n\t\t\t` Still opening: ${older.join(', ')}. Redeploy to start writing with '${current}', reencrypt what is stored, then: gkm encryption:retire ${id} <key> --stage ${options.stage}`,\n\t\t);\n\t\treturn next;\n\t});\n}\n\nexport async function encryptionRetireCommand(\n\tconstruct: string,\n\tkeyId: string,\n\toptions: EncryptionCommandOptions,\n\tcontext: EncryptionCommandContext = {},\n): Promise<string> {\n\treturn updateKeyring(construct, options, context, (id, url) => {\n\t\tconst next = retireKey(id, url, keyId);\n\n\t\tlogger.log(\n\t\t\t`\\n✓ ${id} on '${options.stage}' no longer holds '${keyId}'. Anything still under it cannot be read after the next deploy.`,\n\t\t);\n\t\treturn next;\n\t});\n}\n\nasync function updateKeyring(\n\tconstruct: string,\n\t{ stage }: EncryptionCommandOptions,\n\tcontext: EncryptionCommandContext,\n\tupdate: (id: string, url: string) => string,\n): Promise<string> {\n\tconst workspace = context.workspace ?? (await loadWorkspaceSettings());\n\tconst id = canonicalId(construct);\n\n\tif (stage === workspace.stages.local) {\n\t\tthrow new LocalKeyringIsDerived(id, stage);\n\t}\n\tassertDeployedStage(workspace.stages, stage);\n\tif (providerOf(workspace) === 'aws') throw new KmsRotatesItself(id);\n\n\tconst store = context.store ?? (await secretsStoreFor(workspace, stage));\n\tconst key = provideKey(id, 'url');\n\tconst secrets = await store.read(stage);\n\tconst url = secrets?.custom[key];\n\tif (!secrets || !url) throw new NoKeyringYet(id, stage, key);\n\n\tconst next = update(id, url);\n\tawait store.write(stage, withCustomSecret(secrets, key, next));\n\treturn next;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAM,SAAS;AAEf,IAAa,wBAAb,cAA2CA,eAAAA,SAAS;CAEzC;CACA;CAFV,YACC,WACA,OACC;EACD,MACC,IAAI,MAAM,8BAA8B,UAAU,wIAAwI,UAAU,kBACrM;EALS,KAAA,YAAA;EACA,KAAA,QAAA;EAKT,KAAK,OAAO;CACb;AACD;AAEA,IAAa,mBAAb,cAAsCA,eAAAA,SAAS;CACzB;CAArB,YAAY,WAA4B;EACvC,MACC,GAAG,UAAU,qJACd;EAHoB,KAAA,YAAA;EAIpB,KAAK,OAAO;CACb;AACD;AAEA,IAAa,eAAb,cAAkCA,eAAAA,SAAS;CAEhC;CACA;CACA;CAHV,YACC,WACA,OACA,KACC;EACD,MACC,IAAI,MAAM,WAAW,IAAI,mCAAmC,UAAU,iCAAiC,MAAM,EAC9G;EANS,KAAA,YAAA;EACA,KAAA,QAAA;EACA,KAAA,MAAA;EAKT,KAAK,OAAO;CACb;AACD;AAYA,eAAsB,wBACrB,WACA,SACA,UAAoC,CAAC,GACnB;CAClB,OAAO,cAAc,WAAW,SAAS,UAAU,IAAI,QAAQ;EAC9D,MAAM,QAAA,GAAOC,iCAAAA,cAAAA,CAAc,IAAI,GAAG;EAClC,MAAM,CAAC,SAAS,GAAG,UAAA,GAASC,iCAAAA,aAAAA,CAAa,IAAI,IAAI,CAAC,CAAC,KAAK,KAAK,EAAE,SAAS,EAAE;EAE1E,OAAO,IAAI,OAAO,GAAG,OAAO,QAAQ,MAAM,qBAAqB,QAAQ,GAAG;EAC1E,OAAO,IACN,oBAAoB,MAAM,KAAK,IAAI,EAAE,oCAAoC,QAAQ,2DAA2D,GAAG,iBAAiB,QAAQ,OACzK;EACA,OAAO;CACR,CAAC;AACF;AAEA,eAAsB,wBACrB,WACA,OACA,SACA,UAAoC,CAAC,GACnB;CAClB,OAAO,cAAc,WAAW,SAAS,UAAU,IAAI,QAAQ;EAC9D,MAAM,QAAA,GAAOC,iCAAAA,UAAAA,CAAU,IAAI,KAAK,KAAK;EAErC,OAAO,IACN,OAAO,GAAG,OAAO,QAAQ,MAAM,qBAAqB,MAAM,iEAC3D;EACA,OAAO;CACR,CAAC;AACF;AAEA,eAAe,cACd,WACA,EAAE,SACF,SACA,QACkB;CAClB,MAAM,YAAY,QAAQ,aAAc,MAAMC,eAAAA,sBAAsB;CACpE,MAAM,MAAA,GAAKC,oBAAAA,YAAAA,CAAY,SAAS;CAEhC,IAAI,UAAU,UAAU,OAAO,OAC9B,MAAM,IAAI,sBAAsB,IAAI,KAAK;CAE1C,kBAAA,oBAAoB,UAAU,QAAQ,KAAK;CAC3C,IAAIC,oBAAAA,WAAW,SAAS,MAAM,OAAO,MAAM,IAAI,iBAAiB,EAAE;CAElE,MAAM,QAAQ,QAAQ,SAAU,MAAMC,oBAAAA,gBAAgB,WAAW,KAAK;CACtE,MAAM,OAAA,GAAMC,oBAAAA,WAAAA,CAAW,IAAI,KAAK;CAChC,MAAM,UAAU,MAAM,MAAM,KAAK,KAAK;CACtC,MAAM,MAAM,SAAS,OAAO;CAC5B,IAAI,CAAC,WAAW,CAAC,KAAK,MAAM,IAAI,aAAa,IAAI,OAAO,GAAG;CAE3D,MAAM,OAAO,OAAO,IAAI,GAAG;CAC3B,MAAM,MAAM,MAAM,OAAOC,oBAAAA,iBAAiB,SAAS,KAAK,IAAI,CAAC;CAC7D,OAAO;AACR"}
@@ -0,0 +1,89 @@
1
+ import { t as GkmError } from "./errors-D8Gwp5kU.mjs";
2
+ import { E as providerOf, I as withCustomSecret, k as secretsStoreFor } from "./credentials-B72Jrk66.mjs";
3
+ import { N as assertDeployedStage } from "./workspace-DFGsrjGD.mjs";
4
+ import { m as loadWorkspaceSettings } from "./config-BLrAd7Of.mjs";
5
+ import { canonicalId, provideKey } from "@geekmidas/manifest";
6
+ import { parseKeyring, retireKey, rotateKeyring } from "@geekmidas/constructs/encryption";
7
+ //#region src/encryption/index.ts
8
+ /**
9
+ * `gkm encryption:rotate` and `gkm encryption:retire` — the keyring of an
10
+ * `Encryption` construct on a server stage.
11
+ *
12
+ * Rotating adds a key in front and keeps every older one, so what they wrote
13
+ * still opens. Retiring removes one, and is the half that makes rotating worth
14
+ * doing: until a key is gone, it still opens everything it ever wrote. It is
15
+ * never automatic, because the only thing that knows nothing is left under a
16
+ * key is the sweep that re-encrypted the column — so it is done after one,
17
+ * deliberately, by name.
18
+ *
19
+ * Neither applies everywhere, and each says so rather than doing something
20
+ * that looks right: a local stage's keyring is derived and would be replaced on
21
+ * the next `gkm dev`, and on AWS the key is KMS's, which rotates it itself and
22
+ * never strands a value.
23
+ */
24
+ const logger = console;
25
+ var LocalKeyringIsDerived = class extends GkmError {
26
+ construct;
27
+ stage;
28
+ constructor(construct, stage) {
29
+ super(`'${stage}' is the local stage, where ${construct}'s keyring is derived from the project and stage — nothing stored there would be read. Rotate a deployed stage: gkm encryption:rotate ${construct} --stage <stage>.`);
30
+ this.construct = construct;
31
+ this.stage = stage;
32
+ this.name = "LocalKeyringIsDerived";
33
+ }
34
+ };
35
+ var KmsRotatesItself = class extends GkmError {
36
+ construct;
37
+ constructor(construct) {
38
+ super(`${construct} is a KMS key on AWS: KMS rotates it yearly and keeps every version, so no value is ever stranded and there is no key to retire. Nothing to do here.`);
39
+ this.construct = construct;
40
+ this.name = "KmsRotatesItself";
41
+ }
42
+ };
43
+ var NoKeyringYet = class extends GkmError {
44
+ construct;
45
+ stage;
46
+ key;
47
+ constructor(construct, stage, key) {
48
+ super(`'${stage}' has no ${key} yet. The first deploy generates ${construct}'s keyring: gkm deploy --stage ${stage}.`);
49
+ this.construct = construct;
50
+ this.stage = stage;
51
+ this.key = key;
52
+ this.name = "NoKeyringYet";
53
+ }
54
+ };
55
+ async function encryptionRotateCommand(construct, options, context = {}) {
56
+ return updateKeyring(construct, options, context, (id, url) => {
57
+ const next = rotateKeyring(id, url);
58
+ const [current, ...older] = parseKeyring(id, next).keys.map(({ id }) => id);
59
+ logger.log(`\n✓ ${id} on '${options.stage}' now writes with '${current}'.`);
60
+ logger.log(` Still opening: ${older.join(", ")}. Redeploy to start writing with '${current}', reencrypt what is stored, then: gkm encryption:retire ${id} <key> --stage ${options.stage}`);
61
+ return next;
62
+ });
63
+ }
64
+ async function encryptionRetireCommand(construct, keyId, options, context = {}) {
65
+ return updateKeyring(construct, options, context, (id, url) => {
66
+ const next = retireKey(id, url, keyId);
67
+ logger.log(`\n✓ ${id} on '${options.stage}' no longer holds '${keyId}'. Anything still under it cannot be read after the next deploy.`);
68
+ return next;
69
+ });
70
+ }
71
+ async function updateKeyring(construct, { stage }, context, update) {
72
+ const workspace = context.workspace ?? await loadWorkspaceSettings();
73
+ const id = canonicalId(construct);
74
+ if (stage === workspace.stages.local) throw new LocalKeyringIsDerived(id, stage);
75
+ assertDeployedStage(workspace.stages, stage);
76
+ if (providerOf(workspace) === "aws") throw new KmsRotatesItself(id);
77
+ const store = context.store ?? await secretsStoreFor(workspace, stage);
78
+ const key = provideKey(id, "url");
79
+ const secrets = await store.read(stage);
80
+ const url = secrets?.custom[key];
81
+ if (!secrets || !url) throw new NoKeyringYet(id, stage, key);
82
+ const next = update(id, url);
83
+ await store.write(stage, withCustomSecret(secrets, key, next));
84
+ return next;
85
+ }
86
+ //#endregion
87
+ export { encryptionRetireCommand, encryptionRotateCommand };
88
+
89
+ //# sourceMappingURL=encryption-DGnfdO68.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encryption-DGnfdO68.mjs","names":[],"sources":["../src/encryption/index.ts"],"sourcesContent":["/**\n * `gkm encryption:rotate` and `gkm encryption:retire` — the keyring of an\n * `Encryption` construct on a server stage.\n *\n * Rotating adds a key in front and keeps every older one, so what they wrote\n * still opens. Retiring removes one, and is the half that makes rotating worth\n * doing: until a key is gone, it still opens everything it ever wrote. It is\n * never automatic, because the only thing that knows nothing is left under a\n * key is the sweep that re-encrypted the column — so it is done after one,\n * deliberately, by name.\n *\n * Neither applies everywhere, and each says so rather than doing something\n * that looks right: a local stage's keyring is derived and would be replaced on\n * the next `gkm dev`, and on AWS the key is KMS's, which rotates it itself and\n * never strands a value.\n */\n\nimport {\n\tparseKeyring,\n\tretireKey,\n\trotateKeyring,\n} from '@geekmidas/constructs/encryption';\nimport { canonicalId, provideKey } from '@geekmidas/manifest';\nimport { loadWorkspaceSettings } from '../config';\nimport { GkmError } from '../errors';\nimport { withCustomSecret } from '../secrets/storage.js';\nimport { type SecretsStore, secretsStoreFor } from '../secrets/store.js';\nimport { providerOf } from '../workspace/backends.js';\nimport { assertDeployedStage } from '../workspace/stages.js';\nimport type { NormalizedWorkspace } from '../workspace/types.js';\n\nconst logger = console;\n\nexport class LocalKeyringIsDerived extends GkmError {\n\tconstructor(\n\t\treadonly construct: string,\n\t\treadonly stage: string,\n\t) {\n\t\tsuper(\n\t\t\t`'${stage}' is the local stage, where ${construct}'s keyring is derived from the project and stage — nothing stored there would be read. Rotate a deployed stage: gkm encryption:rotate ${construct} --stage <stage>.`,\n\t\t);\n\t\tthis.name = 'LocalKeyringIsDerived';\n\t}\n}\n\nexport class KmsRotatesItself extends GkmError {\n\tconstructor(readonly construct: string) {\n\t\tsuper(\n\t\t\t`${construct} is a KMS key on AWS: KMS rotates it yearly and keeps every version, so no value is ever stranded and there is no key to retire. Nothing to do here.`,\n\t\t);\n\t\tthis.name = 'KmsRotatesItself';\n\t}\n}\n\nexport class NoKeyringYet extends GkmError {\n\tconstructor(\n\t\treadonly construct: string,\n\t\treadonly stage: string,\n\t\treadonly key: string,\n\t) {\n\t\tsuper(\n\t\t\t`'${stage}' has no ${key} yet. The first deploy generates ${construct}'s keyring: gkm deploy --stage ${stage}.`,\n\t\t);\n\t\tthis.name = 'NoKeyringYet';\n\t}\n}\n\nexport interface EncryptionCommandOptions {\n\tstage: string;\n}\n\n/** Where a command reads and writes; the real ones unless a test says. */\nexport interface EncryptionCommandContext {\n\tworkspace?: NormalizedWorkspace;\n\tstore?: SecretsStore;\n}\n\nexport async function encryptionRotateCommand(\n\tconstruct: string,\n\toptions: EncryptionCommandOptions,\n\tcontext: EncryptionCommandContext = {},\n): Promise<string> {\n\treturn updateKeyring(construct, options, context, (id, url) => {\n\t\tconst next = rotateKeyring(id, url);\n\t\tconst [current, ...older] = parseKeyring(id, next).keys.map(({ id }) => id);\n\n\t\tlogger.log(`\\n✓ ${id} on '${options.stage}' now writes with '${current}'.`);\n\t\tlogger.log(\n\t\t\t` Still opening: ${older.join(', ')}. Redeploy to start writing with '${current}', reencrypt what is stored, then: gkm encryption:retire ${id} <key> --stage ${options.stage}`,\n\t\t);\n\t\treturn next;\n\t});\n}\n\nexport async function encryptionRetireCommand(\n\tconstruct: string,\n\tkeyId: string,\n\toptions: EncryptionCommandOptions,\n\tcontext: EncryptionCommandContext = {},\n): Promise<string> {\n\treturn updateKeyring(construct, options, context, (id, url) => {\n\t\tconst next = retireKey(id, url, keyId);\n\n\t\tlogger.log(\n\t\t\t`\\n✓ ${id} on '${options.stage}' no longer holds '${keyId}'. Anything still under it cannot be read after the next deploy.`,\n\t\t);\n\t\treturn next;\n\t});\n}\n\nasync function updateKeyring(\n\tconstruct: string,\n\t{ stage }: EncryptionCommandOptions,\n\tcontext: EncryptionCommandContext,\n\tupdate: (id: string, url: string) => string,\n): Promise<string> {\n\tconst workspace = context.workspace ?? (await loadWorkspaceSettings());\n\tconst id = canonicalId(construct);\n\n\tif (stage === workspace.stages.local) {\n\t\tthrow new LocalKeyringIsDerived(id, stage);\n\t}\n\tassertDeployedStage(workspace.stages, stage);\n\tif (providerOf(workspace) === 'aws') throw new KmsRotatesItself(id);\n\n\tconst store = context.store ?? (await secretsStoreFor(workspace, stage));\n\tconst key = provideKey(id, 'url');\n\tconst secrets = await store.read(stage);\n\tconst url = secrets?.custom[key];\n\tif (!secrets || !url) throw new NoKeyringYet(id, stage, key);\n\n\tconst next = update(id, url);\n\tawait store.write(stage, withCustomSecret(secrets, key, next));\n\treturn next;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAM,SAAS;AAEf,IAAa,wBAAb,cAA2C,SAAS;CAEzC;CACA;CAFV,YACC,WACA,OACC;EACD,MACC,IAAI,MAAM,8BAA8B,UAAU,wIAAwI,UAAU,kBACrM;EALS,KAAA,YAAA;EACA,KAAA,QAAA;EAKT,KAAK,OAAO;CACb;AACD;AAEA,IAAa,mBAAb,cAAsC,SAAS;CACzB;CAArB,YAAY,WAA4B;EACvC,MACC,GAAG,UAAU,qJACd;EAHoB,KAAA,YAAA;EAIpB,KAAK,OAAO;CACb;AACD;AAEA,IAAa,eAAb,cAAkC,SAAS;CAEhC;CACA;CACA;CAHV,YACC,WACA,OACA,KACC;EACD,MACC,IAAI,MAAM,WAAW,IAAI,mCAAmC,UAAU,iCAAiC,MAAM,EAC9G;EANS,KAAA,YAAA;EACA,KAAA,QAAA;EACA,KAAA,MAAA;EAKT,KAAK,OAAO;CACb;AACD;AAYA,eAAsB,wBACrB,WACA,SACA,UAAoC,CAAC,GACnB;CAClB,OAAO,cAAc,WAAW,SAAS,UAAU,IAAI,QAAQ;EAC9D,MAAM,OAAO,cAAc,IAAI,GAAG;EAClC,MAAM,CAAC,SAAS,GAAG,SAAS,aAAa,IAAI,IAAI,CAAC,CAAC,KAAK,KAAK,EAAE,SAAS,EAAE;EAE1E,OAAO,IAAI,OAAO,GAAG,OAAO,QAAQ,MAAM,qBAAqB,QAAQ,GAAG;EAC1E,OAAO,IACN,oBAAoB,MAAM,KAAK,IAAI,EAAE,oCAAoC,QAAQ,2DAA2D,GAAG,iBAAiB,QAAQ,OACzK;EACA,OAAO;CACR,CAAC;AACF;AAEA,eAAsB,wBACrB,WACA,OACA,SACA,UAAoC,CAAC,GACnB;CAClB,OAAO,cAAc,WAAW,SAAS,UAAU,IAAI,QAAQ;EAC9D,MAAM,OAAO,UAAU,IAAI,KAAK,KAAK;EAErC,OAAO,IACN,OAAO,GAAG,OAAO,QAAQ,MAAM,qBAAqB,MAAM,iEAC3D;EACA,OAAO;CACR,CAAC;AACF;AAEA,eAAe,cACd,WACA,EAAE,SACF,SACA,QACkB;CAClB,MAAM,YAAY,QAAQ,aAAc,MAAM,sBAAsB;CACpE,MAAM,KAAK,YAAY,SAAS;CAEhC,IAAI,UAAU,UAAU,OAAO,OAC9B,MAAM,IAAI,sBAAsB,IAAI,KAAK;CAE1C,oBAAoB,UAAU,QAAQ,KAAK;CAC3C,IAAI,WAAW,SAAS,MAAM,OAAO,MAAM,IAAI,iBAAiB,EAAE;CAElE,MAAM,QAAQ,QAAQ,SAAU,MAAM,gBAAgB,WAAW,KAAK;CACtE,MAAM,MAAM,WAAW,IAAI,KAAK;CAChC,MAAM,UAAU,MAAM,MAAM,KAAK,KAAK;CACtC,MAAM,MAAM,SAAS,OAAO;CAC5B,IAAI,CAAC,WAAW,CAAC,KAAK,MAAM,IAAI,aAAa,IAAI,OAAO,GAAG;CAE3D,MAAM,OAAO,OAAO,IAAI,GAAG;CAC3B,MAAM,MAAM,MAAM,OAAO,iBAAiB,SAAS,KAAK,IAAI,CAAC;CAC7D,OAAO;AACR"}