@geekmidas/cli 10.0.0-alpha.12 → 10.0.0-alpha.121

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 (517) hide show
  1. package/README.md +310 -377
  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-BDa6pPgE.cjs +1090 -0
  7. package/dist/EndpointGenerator-BDa6pPgE.cjs.map +1 -0
  8. package/dist/EndpointGenerator-CP_z_E3e.mjs +1031 -0
  9. package/dist/EndpointGenerator-CP_z_E3e.mjs.map +1 -0
  10. package/dist/GoDaddyProvider-3C8U_tVu.cjs +388 -0
  11. package/dist/GoDaddyProvider-3C8U_tVu.cjs.map +1 -0
  12. package/dist/GoDaddyProvider-D0MQoOM4.mjs +388 -0
  13. package/dist/GoDaddyProvider-D0MQoOM4.mjs.map +1 -0
  14. package/dist/{HostingerProvider-BcyFRbqV.mjs → HostingerProvider-BNpS9aRJ.mjs} +29 -25
  15. package/dist/HostingerProvider-BNpS9aRJ.mjs.map +1 -0
  16. package/dist/{HostingerProvider-BOvsgATO.cjs → HostingerProvider-DR1iws1P.cjs} +29 -25
  17. package/dist/HostingerProvider-DR1iws1P.cjs.map +1 -0
  18. package/dist/LegacyStateStore-CRi7TosX.mjs +124 -0
  19. package/dist/LegacyStateStore-CRi7TosX.mjs.map +1 -0
  20. package/dist/LegacyStateStore-DHsoQGOo.cjs +124 -0
  21. package/dist/LegacyStateStore-DHsoQGOo.cjs.map +1 -0
  22. package/dist/LocalStateStore-BQXTkeoS.cjs +178 -0
  23. package/dist/LocalStateStore-BQXTkeoS.cjs.map +1 -0
  24. package/dist/LocalStateStore-Dkth0jXX.mjs +167 -0
  25. package/dist/LocalStateStore-Dkth0jXX.mjs.map +1 -0
  26. package/dist/OpenApiTsGenerator-CsrukCE-.mjs +536 -0
  27. package/dist/OpenApiTsGenerator-CsrukCE-.mjs.map +1 -0
  28. package/dist/OpenApiTsGenerator-FNhY7Ssz.cjs +541 -0
  29. package/dist/OpenApiTsGenerator-FNhY7Ssz.cjs.map +1 -0
  30. package/dist/{Route53Provider-CH9XH7bz.cjs → Route53Provider-Bllus2NR.cjs} +21 -22
  31. package/dist/Route53Provider-Bllus2NR.cjs.map +1 -0
  32. package/dist/{Route53Provider-C0xmer8U.mjs → Route53Provider-QXxjkZO1.mjs} +13 -13
  33. package/dist/Route53Provider-QXxjkZO1.mjs.map +1 -0
  34. package/dist/S3StateStore-DGKZgyKz.cjs +222 -0
  35. package/dist/S3StateStore-DGKZgyKz.cjs.map +1 -0
  36. package/dist/S3StateStore-pZZnLLBd.mjs +223 -0
  37. package/dist/S3StateStore-pZZnLLBd.mjs.map +1 -0
  38. package/dist/SSMStateStore-CZRMERDA.mjs +205 -0
  39. package/dist/SSMStateStore-CZRMERDA.mjs.map +1 -0
  40. package/dist/SSMStateStore-DzkyjQ5D.cjs +204 -0
  41. package/dist/SSMStateStore-DzkyjQ5D.cjs.map +1 -0
  42. package/dist/SubscriberGenerator-C8CPxrCK.cjs +592 -0
  43. package/dist/SubscriberGenerator-C8CPxrCK.cjs.map +1 -0
  44. package/dist/SubscriberGenerator-y3pncae_.mjs +533 -0
  45. package/dist/SubscriberGenerator-y3pncae_.mjs.map +1 -0
  46. package/dist/add-C0kXOsWS.mjs +717 -0
  47. package/dist/add-C0kXOsWS.mjs.map +1 -0
  48. package/dist/add-Df8cmz0H.cjs +719 -0
  49. package/dist/add-Df8cmz0H.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/aws-8QQ8n-t6.mjs +89 -0
  55. package/dist/aws-8QQ8n-t6.mjs.map +1 -0
  56. package/dist/aws-DY9NqQIT.cjs +100 -0
  57. package/dist/aws-DY9NqQIT.cjs.map +1 -0
  58. package/dist/awsStore-Bx5nCFnS.mjs +121 -0
  59. package/dist/awsStore-Bx5nCFnS.mjs.map +1 -0
  60. package/dist/awsStore-u3ehhMoY.cjs +138 -0
  61. package/dist/awsStore-u3ehhMoY.cjs.map +1 -0
  62. package/dist/{backup-provisioner-DXXg6FIL.mjs → backup-provisioner-C8DnCmxK.mjs} +11 -8
  63. package/dist/backup-provisioner-C8DnCmxK.mjs.map +1 -0
  64. package/dist/{backup-provisioner-cE2PuCTb.cjs → backup-provisioner-oDEsPj02.cjs} +22 -20
  65. package/dist/backup-provisioner-oDEsPj02.cjs.map +1 -0
  66. package/dist/backups/runner.cjs +519 -0
  67. package/dist/backups/runner.cjs.map +1 -0
  68. package/dist/backups/runner.d.cts +102 -0
  69. package/dist/backups/runner.d.cts.map +1 -0
  70. package/dist/backups/runner.d.mts +102 -0
  71. package/dist/backups/runner.d.mts.map +1 -0
  72. package/dist/backups/runner.mjs +506 -0
  73. package/dist/backups/runner.mjs.map +1 -0
  74. package/dist/{bundler-Bux2iF-v.mjs → bundler-B-I4Du99.mjs} +35 -16
  75. package/dist/bundler-B-I4Du99.mjs.map +1 -0
  76. package/dist/{bundler-BMekgx7a.cjs → bundler-Dx_grUmc.cjs} +37 -19
  77. package/dist/bundler-Dx_grUmc.cjs.map +1 -0
  78. package/dist/cli-Cd9exatJ.cjs +71 -0
  79. package/dist/cli-Cd9exatJ.cjs.map +1 -0
  80. package/dist/cli-DL7GxGAe.mjs +71 -0
  81. package/dist/cli-DL7GxGAe.mjs.map +1 -0
  82. package/dist/compose-C43c03WZ.mjs +3284 -0
  83. package/dist/compose-C43c03WZ.mjs.map +1 -0
  84. package/dist/compose-Mdgea4Yt.cjs +3427 -0
  85. package/dist/compose-Mdgea4Yt.cjs.map +1 -0
  86. package/dist/config-D48erO2j.d.mts +269 -0
  87. package/dist/config-D48erO2j.d.mts.map +1 -0
  88. package/dist/config-DHDtsQrB.d.cts +269 -0
  89. package/dist/config-DHDtsQrB.d.cts.map +1 -0
  90. package/dist/config.cjs +421 -11
  91. package/dist/config.cjs.map +1 -0
  92. package/dist/config.d.cts +4 -120
  93. package/dist/config.d.mts +4 -120
  94. package/dist/config.mjs +405 -4
  95. package/dist/config.mjs.map +1 -0
  96. package/dist/credentialSchemas-B67WJOOm.cjs +272 -0
  97. package/dist/credentialSchemas-B67WJOOm.cjs.map +1 -0
  98. package/dist/credentialSchemas-DDOLRCLF.mjs +237 -0
  99. package/dist/credentialSchemas-DDOLRCLF.mjs.map +1 -0
  100. package/dist/credentials-B5N5yKk6.mjs +267 -0
  101. package/dist/credentials-B5N5yKk6.mjs.map +1 -0
  102. package/dist/credentials-Zqr3QQYB.cjs +350 -0
  103. package/dist/credentials-Zqr3QQYB.cjs.map +1 -0
  104. package/dist/databases-BPOgTn1u.mjs +522 -0
  105. package/dist/databases-BPOgTn1u.mjs.map +1 -0
  106. package/dist/databases-fOaoBInm.cjs +625 -0
  107. package/dist/databases-fOaoBInm.cjs.map +1 -0
  108. package/dist/define-6poNqm5O.mjs +106 -0
  109. package/dist/define-6poNqm5O.mjs.map +1 -0
  110. package/dist/define-crmMcXFS.cjs +153 -0
  111. package/dist/define-crmMcXFS.cjs.map +1 -0
  112. package/dist/deploy/public.cjs +212 -0
  113. package/dist/deploy/public.cjs.map +1 -0
  114. package/dist/deploy/public.d.cts +654 -0
  115. package/dist/deploy/public.d.cts.map +1 -0
  116. package/dist/deploy/public.d.mts +654 -0
  117. package/dist/deploy/public.d.mts.map +1 -0
  118. package/dist/deploy/public.mjs +145 -0
  119. package/dist/deploy/public.mjs.map +1 -0
  120. package/dist/deploy/sniffer-envkit-patch.cjs +18 -10
  121. package/dist/deploy/sniffer-envkit-patch.cjs.map +1 -1
  122. package/dist/deploy/sniffer-envkit-patch.d.cts +0 -2
  123. package/dist/deploy/sniffer-envkit-patch.d.cts.map +1 -1
  124. package/dist/deploy/sniffer-envkit-patch.d.mts +0 -2
  125. package/dist/deploy/sniffer-envkit-patch.d.mts.map +1 -1
  126. package/dist/deploy/sniffer-envkit-patch.mjs +10 -2
  127. package/dist/deploy/sniffer-envkit-patch.mjs.map +1 -1
  128. package/dist/deploy/sniffer-envparser-worker.cjs +54 -0
  129. package/dist/deploy/sniffer-envparser-worker.cjs.map +1 -0
  130. package/dist/deploy/sniffer-envparser-worker.d.cts +1 -0
  131. package/dist/deploy/sniffer-envparser-worker.d.mts +1 -0
  132. package/dist/deploy/sniffer-envparser-worker.mjs +55 -0
  133. package/dist/deploy/sniffer-envparser-worker.mjs.map +1 -0
  134. package/dist/deploy/sniffer-hooks.cjs +13 -7
  135. package/dist/deploy/sniffer-hooks.cjs.map +1 -1
  136. package/dist/deploy/sniffer-hooks.d.cts +1 -2
  137. package/dist/deploy/sniffer-hooks.d.cts.map +1 -1
  138. package/dist/deploy/sniffer-hooks.d.mts +1 -2
  139. package/dist/deploy/sniffer-hooks.d.mts.map +1 -1
  140. package/dist/deploy/sniffer-hooks.mjs +10 -3
  141. package/dist/deploy/sniffer-hooks.mjs.map +1 -1
  142. package/dist/deploy/sniffer-loader.cjs +16 -7
  143. package/dist/deploy/sniffer-loader.cjs.map +1 -1
  144. package/dist/deploy/sniffer-loader.d.cts +1 -1
  145. package/dist/deploy/sniffer-loader.d.mts +1 -1
  146. package/dist/deploy/sniffer-loader.mjs +14 -3
  147. package/dist/deploy/sniffer-loader.mjs.map +1 -1
  148. package/dist/deploy/sniffer-routes-worker.cjs +11 -11
  149. package/dist/deploy/sniffer-routes-worker.cjs.map +1 -1
  150. package/dist/deploy/sniffer-routes-worker.d.cts +1 -1
  151. package/dist/deploy/sniffer-routes-worker.d.mts +1 -1
  152. package/dist/deploy/sniffer-routes-worker.mjs +4 -4
  153. package/dist/deploy/sniffer-routes-worker.mjs.map +1 -1
  154. package/dist/deploy/sniffer-worker.cjs +15 -6
  155. package/dist/deploy/sniffer-worker.cjs.map +1 -1
  156. package/dist/deploy/sniffer-worker.d.cts +1 -3
  157. package/dist/deploy/sniffer-worker.d.cts.map +1 -1
  158. package/dist/deploy/sniffer-worker.d.mts +1 -3
  159. package/dist/deploy/sniffer-worker.d.mts.map +1 -1
  160. package/dist/deploy/sniffer-worker.mjs +15 -4
  161. package/dist/deploy/sniffer-worker.mjs.map +1 -1
  162. package/dist/deploy-BMM2hx-K.cjs +2401 -0
  163. package/dist/deploy-BMM2hx-K.cjs.map +1 -0
  164. package/dist/deploy-D5YhwDng.mjs +2328 -0
  165. package/dist/deploy-D5YhwDng.mjs.map +1 -0
  166. package/dist/derive-B4vDpzgP.mjs +150 -0
  167. package/dist/derive-B4vDpzgP.mjs.map +1 -0
  168. package/dist/derive-DAbo49sm.cjs +161 -0
  169. package/dist/derive-DAbo49sm.cjs.map +1 -0
  170. package/dist/discover-C5roJuc9.mjs +560 -0
  171. package/dist/discover-C5roJuc9.mjs.map +1 -0
  172. package/dist/discover-CSW_BMWa.d.cts +125 -0
  173. package/dist/discover-CSW_BMWa.d.cts.map +1 -0
  174. package/dist/discover-DozUKs8f.cjs +639 -0
  175. package/dist/discover-DozUKs8f.cjs.map +1 -0
  176. package/dist/discover-xtT7fgWg.d.mts +125 -0
  177. package/dist/discover-xtT7fgWg.d.mts.map +1 -0
  178. package/dist/dns-BIYf20p7.cjs +1057 -0
  179. package/dist/dns-BIYf20p7.cjs.map +1 -0
  180. package/dist/dns-agf2VCdV.mjs +926 -0
  181. package/dist/dns-agf2VCdV.mjs.map +1 -0
  182. package/dist/dokploy-2p4PK6ej.mjs +38 -0
  183. package/dist/dokploy-2p4PK6ej.mjs.map +1 -0
  184. package/dist/dokploy-BANMTroy.cjs +38 -0
  185. package/dist/dokploy-BANMTroy.cjs.map +1 -0
  186. package/dist/drivers-BjGDYfnC.mjs +195 -0
  187. package/dist/drivers-BjGDYfnC.mjs.map +1 -0
  188. package/dist/drivers-DbjiYpW6.cjs +224 -0
  189. package/dist/drivers-DbjiYpW6.cjs.map +1 -0
  190. package/dist/eas-CNi16SoO.cjs +337 -0
  191. package/dist/eas-CNi16SoO.cjs.map +1 -0
  192. package/dist/eas-iT2JDHCh.mjs +334 -0
  193. package/dist/eas-iT2JDHCh.mjs.map +1 -0
  194. package/dist/{emit-CIlvnDvV.mjs → emit-C1e8qD08.mjs} +13 -26
  195. package/dist/emit-C1e8qD08.mjs.map +1 -0
  196. package/dist/{emit-CUD1BWls.cjs → emit-Dmc1nvdS.cjs} +31 -57
  197. package/dist/emit-Dmc1nvdS.cjs.map +1 -0
  198. package/dist/encryption-DkXVbyZc.mjs +89 -0
  199. package/dist/encryption-DkXVbyZc.mjs.map +1 -0
  200. package/dist/encryption-d2lLtkYx.cjs +90 -0
  201. package/dist/encryption-d2lLtkYx.cjs.map +1 -0
  202. package/dist/engine-CatKW6E-.mjs +3089 -0
  203. package/dist/engine-CatKW6E-.mjs.map +1 -0
  204. package/dist/engine-DlEHexED.cjs +3202 -0
  205. package/dist/engine-DlEHexED.cjs.map +1 -0
  206. package/dist/errors-D8Gwp5kU.mjs +23 -0
  207. package/dist/errors-D8Gwp5kU.mjs.map +1 -0
  208. package/dist/errors-DMC4Umsb.cjs +34 -0
  209. package/dist/errors-DMC4Umsb.cjs.map +1 -0
  210. package/dist/github-BAeaC1Pl.cjs +833 -0
  211. package/dist/github-BAeaC1Pl.cjs.map +1 -0
  212. package/dist/github-DErsqKGN.mjs +832 -0
  213. package/dist/github-DErsqKGN.mjs.map +1 -0
  214. package/dist/googlePlay-BVcfFWRO.cjs +931 -0
  215. package/dist/googlePlay-BVcfFWRO.cjs.map +1 -0
  216. package/dist/googlePlay-BXJ5ZjMK.mjs +931 -0
  217. package/dist/googlePlay-BXJ5ZjMK.mjs.map +1 -0
  218. package/dist/identity-CBXr4wNi.mjs +129 -0
  219. package/dist/identity-CBXr4wNi.mjs.map +1 -0
  220. package/dist/identity-CbLfgQNT.cjs +182 -0
  221. package/dist/identity-CbLfgQNT.cjs.map +1 -0
  222. package/dist/{index-BzJ7QJ9c.d.mts → index-8OfpOtSI.d.cts} +39 -20
  223. package/dist/index-8OfpOtSI.d.cts.map +1 -0
  224. package/dist/{index-CfMjtdVC.d.cts → index-Dpji6Bxq.d.mts} +39 -20
  225. package/dist/index-Dpji6Bxq.d.mts.map +1 -0
  226. package/dist/index.cjs +14291 -11898
  227. package/dist/index.cjs.map +1 -1
  228. package/dist/index.d.cts +1 -1
  229. package/dist/index.d.mts +1 -1
  230. package/dist/index.mjs +13938 -11560
  231. package/dist/index.mjs.map +1 -1
  232. package/dist/local-BwC2v2Y8.mjs +224 -0
  233. package/dist/local-BwC2v2Y8.mjs.map +1 -0
  234. package/dist/local-DNhnkugT.cjs +241 -0
  235. package/dist/local-DNhnkugT.cjs.map +1 -0
  236. package/dist/migrate-Bb1MmGHl.mjs +181 -0
  237. package/dist/migrate-Bb1MmGHl.mjs.map +1 -0
  238. package/dist/migrate-D79GI0XM.cjs +271 -0
  239. package/dist/migrate-D79GI0XM.cjs.map +1 -0
  240. package/dist/migrate-L4a273dY.cjs +181 -0
  241. package/dist/migrate-L4a273dY.cjs.map +1 -0
  242. package/dist/migrate-s4QizIoM.mjs +266 -0
  243. package/dist/migrate-s4QizIoM.mjs.map +1 -0
  244. package/dist/openapi.cjs +214 -10
  245. package/dist/openapi.cjs.map +1 -0
  246. package/dist/openapi.d.cts +38 -17
  247. package/dist/openapi.d.cts.map +1 -1
  248. package/dist/openapi.d.mts +38 -17
  249. package/dist/openapi.d.mts.map +1 -1
  250. package/dist/openapi.mjs +208 -5
  251. package/dist/openapi.mjs.map +1 -0
  252. package/dist/projectBucket-BBbQ1lHF.cjs +263 -0
  253. package/dist/projectBucket-BBbQ1lHF.cjs.map +1 -0
  254. package/dist/projectBucket-C_DN4WzF.mjs +222 -0
  255. package/dist/projectBucket-C_DN4WzF.mjs.map +1 -0
  256. package/dist/provider-BqpjG9QM.cjs +57 -0
  257. package/dist/provider-BqpjG9QM.cjs.map +1 -0
  258. package/dist/provider-CEOKk8NS.mjs +46 -0
  259. package/dist/provider-CEOKk8NS.mjs.map +1 -0
  260. package/dist/publish-CcTlmJT6.mjs +123 -0
  261. package/dist/publish-CcTlmJT6.mjs.map +1 -0
  262. package/dist/publish-ydscCYsW.cjs +124 -0
  263. package/dist/publish-ydscCYsW.cjs.map +1 -0
  264. package/dist/ready-BFFP838V.cjs +404 -0
  265. package/dist/ready-BFFP838V.cjs.map +1 -0
  266. package/dist/ready-BOfogqzr.mjs +375 -0
  267. package/dist/ready-BOfogqzr.mjs.map +1 -0
  268. package/dist/reconcile/public.cjs +3 -5
  269. package/dist/reconcile/public.d.cts +11 -87
  270. package/dist/reconcile/public.d.cts.map +1 -1
  271. package/dist/reconcile/public.d.mts +11 -87
  272. package/dist/reconcile/public.d.mts.map +1 -1
  273. package/dist/reconcile/public.mjs +3 -4
  274. package/dist/{reconcile-BI0tWkwz.mjs → reconcile--I7V4Klj.mjs} +4 -7
  275. package/dist/reconcile--I7V4Klj.mjs.map +1 -0
  276. package/dist/{reconcile-Bhw5fmKu.cjs → reconcile-CuCQBa5-.cjs} +5 -8
  277. package/dist/reconcile-CuCQBa5-.cjs.map +1 -0
  278. package/dist/resolve-BLp2trep.mjs +263 -0
  279. package/dist/resolve-BLp2trep.mjs.map +1 -0
  280. package/dist/resolve-BgL-brF9.cjs +316 -0
  281. package/dist/resolve-BgL-brF9.cjs.map +1 -0
  282. package/dist/rollback-2cyLXEH1.cjs +165 -0
  283. package/dist/rollback-2cyLXEH1.cjs.map +1 -0
  284. package/dist/rollback-DwqZ8zzj.mjs +136 -0
  285. package/dist/rollback-DwqZ8zzj.mjs.map +1 -0
  286. package/dist/rolldown-runtime-BhDjJH2R.mjs +15 -0
  287. package/dist/{chunk-CUT6urMc.cjs → rolldown-runtime-C0BPl7ul.cjs} +23 -10
  288. package/dist/run-BJLIerMM.mjs +133 -0
  289. package/dist/run-BJLIerMM.mjs.map +1 -0
  290. package/dist/run-fVZ-rLnc.cjs +174 -0
  291. package/dist/run-fVZ-rLnc.cjs.map +1 -0
  292. package/dist/runtime-ACdfK59n.d.cts +82 -0
  293. package/dist/runtime-ACdfK59n.d.cts.map +1 -0
  294. package/dist/runtime-YyQuekxi.d.mts +82 -0
  295. package/dist/runtime-YyQuekxi.d.mts.map +1 -0
  296. package/dist/s3-CrPoA89T.cjs +215 -0
  297. package/dist/s3-CrPoA89T.cjs.map +1 -0
  298. package/dist/s3-DQXZdmCM.mjs +215 -0
  299. package/dist/s3-DQXZdmCM.mjs.map +1 -0
  300. package/dist/sandbox/config-worker.cjs +43 -0
  301. package/dist/sandbox/config-worker.cjs.map +1 -0
  302. package/dist/sandbox/config-worker.d.cts +1 -0
  303. package/dist/sandbox/config-worker.d.mts +1 -0
  304. package/dist/sandbox/config-worker.mjs +44 -0
  305. package/dist/sandbox/config-worker.mjs.map +1 -0
  306. package/dist/sandbox/credentials-worker.cjs +54 -0
  307. package/dist/sandbox/credentials-worker.cjs.map +1 -0
  308. package/dist/sandbox/credentials-worker.d.cts +1 -0
  309. package/dist/sandbox/credentials-worker.d.mts +1 -0
  310. package/dist/sandbox/credentials-worker.mjs +55 -0
  311. package/dist/sandbox/credentials-worker.mjs.map +1 -0
  312. package/dist/sandbox/discover-worker.cjs +50 -0
  313. package/dist/sandbox/discover-worker.cjs.map +1 -0
  314. package/dist/sandbox/discover-worker.d.cts +1 -0
  315. package/dist/sandbox/discover-worker.d.mts +1 -0
  316. package/dist/sandbox/discover-worker.mjs +51 -0
  317. package/dist/sandbox/discover-worker.mjs.map +1 -0
  318. package/dist/sandbox/migrate-worker.cjs +75 -0
  319. package/dist/sandbox/migrate-worker.cjs.map +1 -0
  320. package/dist/sandbox/migrate-worker.d.cts +1 -0
  321. package/dist/sandbox/migrate-worker.d.mts +1 -0
  322. package/dist/sandbox/migrate-worker.mjs +76 -0
  323. package/dist/sandbox/migrate-worker.mjs.map +1 -0
  324. package/dist/sandbox-C4g1eG31.d.mts +104 -0
  325. package/dist/sandbox-C4g1eG31.d.mts.map +1 -0
  326. package/dist/sandbox-CHv3OYXg.cjs +165 -0
  327. package/dist/sandbox-CHv3OYXg.cjs.map +1 -0
  328. package/dist/sandbox-CbVB7uOD.mjs +118 -0
  329. package/dist/sandbox-CbVB7uOD.mjs.map +1 -0
  330. package/dist/sandbox-CdKgQ3XU.d.cts +104 -0
  331. package/dist/sandbox-CdKgQ3XU.d.cts.map +1 -0
  332. package/dist/{workspace-DPV7FtAv.cjs → schemas-BCwKKA42.mjs} +958 -1816
  333. package/dist/schemas-BCwKKA42.mjs.map +1 -0
  334. package/dist/{workspace-CtnZnWsa.mjs → schemas-BQ_v0lEX.cjs} +1048 -1626
  335. package/dist/schemas-BQ_v0lEX.cjs.map +1 -0
  336. package/dist/secretsManager-CQORubp9.mjs +97 -0
  337. package/dist/secretsManager-CQORubp9.mjs.map +1 -0
  338. package/dist/secretsManager-RAGcEDX1.cjs +108 -0
  339. package/dist/secretsManager-RAGcEDX1.cjs.map +1 -0
  340. package/dist/seeds-C2w4UqVP.cjs +9347 -0
  341. package/dist/seeds-C2w4UqVP.cjs.map +1 -0
  342. package/dist/seeds-Cwtv-U9-.mjs +8350 -0
  343. package/dist/seeds-Cwtv-U9-.mjs.map +1 -0
  344. package/dist/serverSetup-BdFOD93s.cjs +631 -0
  345. package/dist/serverSetup-BdFOD93s.cjs.map +1 -0
  346. package/dist/serverSetup-utKsoyGH.mjs +631 -0
  347. package/dist/serverSetup-utKsoyGH.mjs.map +1 -0
  348. package/dist/sniffer-8C4q6Szd.mjs +1825 -0
  349. package/dist/sniffer-8C4q6Szd.mjs.map +1 -0
  350. package/dist/sniffer-CF7wNxMo.cjs +1998 -0
  351. package/dist/sniffer-CF7wNxMo.cjs.map +1 -0
  352. package/dist/sst-B-Uz4cvm.cjs +464 -0
  353. package/dist/sst-B-Uz4cvm.cjs.map +1 -0
  354. package/dist/sst-C1pxbFEd.mjs +441 -0
  355. package/dist/sst-C1pxbFEd.mjs.map +1 -0
  356. package/dist/stage-BvM_u2z4.mjs +302 -0
  357. package/dist/stage-BvM_u2z4.mjs.map +1 -0
  358. package/dist/stage-DEQJGW3r.cjs +313 -0
  359. package/dist/stage-DEQJGW3r.cjs.map +1 -0
  360. package/dist/stages-Cb9rqRbN.mjs +190 -0
  361. package/dist/stages-Cb9rqRbN.mjs.map +1 -0
  362. package/dist/stages-D4SnG5yl.cjs +190 -0
  363. package/dist/stages-D4SnG5yl.cjs.map +1 -0
  364. package/dist/target/public.cjs +15 -0
  365. package/dist/target/public.d.cts +28 -0
  366. package/dist/target/public.d.cts.map +1 -0
  367. package/dist/target/public.d.mts +28 -0
  368. package/dist/target/public.d.mts.map +1 -0
  369. package/dist/target/public.mjs +4 -0
  370. package/dist/terminal-CW_dWeTe.mjs +85 -0
  371. package/dist/terminal-CW_dWeTe.mjs.map +1 -0
  372. package/dist/terminal-DJlqcW_U.cjs +85 -0
  373. package/dist/terminal-DJlqcW_U.cjs.map +1 -0
  374. package/dist/types-B6UXlEkf.d.cts +7650 -0
  375. package/dist/types-B6UXlEkf.d.cts.map +1 -0
  376. package/dist/types-HqVPddRK.d.mts +7649 -0
  377. package/dist/types-HqVPddRK.d.mts.map +1 -0
  378. package/dist/utils-D2Nk1Nv2.cjs +205 -0
  379. package/dist/utils-D2Nk1Nv2.cjs.map +1 -0
  380. package/dist/utils-D_fxUqvU.mjs +156 -0
  381. package/dist/utils-D_fxUqvU.mjs.map +1 -0
  382. package/dist/vitest.cjs +65 -0
  383. package/dist/vitest.cjs.map +1 -0
  384. package/dist/vitest.d.cts +29 -0
  385. package/dist/vitest.d.cts.map +1 -0
  386. package/dist/vitest.d.mts +29 -0
  387. package/dist/vitest.d.mts.map +1 -0
  388. package/dist/vitest.mjs +65 -0
  389. package/dist/vitest.mjs.map +1 -0
  390. package/dist/workerRuntime-BXfhbe13.cjs +108 -0
  391. package/dist/workerRuntime-BXfhbe13.cjs.map +1 -0
  392. package/dist/workerRuntime-CsOyBRx2.mjs +79 -0
  393. package/dist/workerRuntime-CsOyBRx2.mjs.map +1 -0
  394. package/dist/workspace/index.cjs +8 -4
  395. package/dist/workspace/index.d.cts +3 -3
  396. package/dist/workspace/index.d.mts +3 -3
  397. package/dist/workspace/index.mjs +2 -3
  398. package/dist/workspace-BwqQnool.cjs +2806 -0
  399. package/dist/workspace-BwqQnool.cjs.map +1 -0
  400. package/dist/workspace-D1QbNd55.mjs +2394 -0
  401. package/dist/workspace-D1QbNd55.mjs.map +1 -0
  402. package/package.json +54 -22
  403. package/dist/CachedStateProvider-BEBl2wQT.cjs +0 -60
  404. package/dist/CachedStateProvider-BEBl2wQT.cjs.map +0 -1
  405. package/dist/CachedStateProvider-C-8wtlto.mjs +0 -3
  406. package/dist/CachedStateProvider-Co4n5Wvs.mjs +0 -54
  407. package/dist/CachedStateProvider-Co4n5Wvs.mjs.map +0 -1
  408. package/dist/CachedStateProvider-DqhGpzsm.cjs +0 -3
  409. package/dist/HostingerProvider-BOvsgATO.cjs.map +0 -1
  410. package/dist/HostingerProvider-BcyFRbqV.mjs.map +0 -1
  411. package/dist/LocalStateProvider-Bq-0C0sg.mjs +0 -42
  412. package/dist/LocalStateProvider-Bq-0C0sg.mjs.map +0 -1
  413. package/dist/LocalStateProvider-yjXZXZDM.cjs +0 -43
  414. package/dist/LocalStateProvider-yjXZXZDM.cjs.map +0 -1
  415. package/dist/Route53Provider-C0xmer8U.mjs.map +0 -1
  416. package/dist/Route53Provider-CH9XH7bz.cjs.map +0 -1
  417. package/dist/SSMStateProvider-CXtNgPfy.cjs +0 -66
  418. package/dist/SSMStateProvider-CXtNgPfy.cjs.map +0 -1
  419. package/dist/SSMStateProvider-DOZifZfE.mjs +0 -66
  420. package/dist/SSMStateProvider-DOZifZfE.mjs.map +0 -1
  421. package/dist/backup-provisioner-DXXg6FIL.mjs.map +0 -1
  422. package/dist/backup-provisioner-cE2PuCTb.cjs.map +0 -1
  423. package/dist/bundler-BMekgx7a.cjs.map +0 -1
  424. package/dist/bundler-Bux2iF-v.mjs.map +0 -1
  425. package/dist/chunk-Duj1WY3L.mjs +0 -7
  426. package/dist/config-DTsVjKZD.mjs +0 -402
  427. package/dist/config-DTsVjKZD.mjs.map +0 -1
  428. package/dist/config-RYR9j6EF.cjs +0 -462
  429. package/dist/config-RYR9j6EF.cjs.map +0 -1
  430. package/dist/config.d.cts.map +0 -1
  431. package/dist/config.d.mts.map +0 -1
  432. package/dist/credentials-B5zRHdAl.mjs +0 -141
  433. package/dist/credentials-B5zRHdAl.mjs.map +0 -1
  434. package/dist/credentials-BapzjyV5.cjs +0 -195
  435. package/dist/credentials-BapzjyV5.cjs.map +0 -1
  436. package/dist/credentials-DQRvPz2S.cjs +0 -2769
  437. package/dist/credentials-DQRvPz2S.cjs.map +0 -1
  438. package/dist/credentials-jMJC63qs.mjs +0 -2625
  439. package/dist/credentials-jMJC63qs.mjs.map +0 -1
  440. package/dist/discover-BYHQwQqu.mjs +0 -242
  441. package/dist/discover-BYHQwQqu.mjs.map +0 -1
  442. package/dist/discover-DmW9Bscc.cjs +0 -290
  443. package/dist/discover-DmW9Bscc.cjs.map +0 -1
  444. package/dist/dokploy-api-5cK2InBm.cjs +0 -3
  445. package/dist/dokploy-api-D2Ny4Jrc.mjs +0 -3
  446. package/dist/dokploy-api-pdaBryoY.mjs +0 -706
  447. package/dist/dokploy-api-pdaBryoY.mjs.map +0 -1
  448. package/dist/dokploy-api-zqKe9lHH.cjs +0 -718
  449. package/dist/dokploy-api-zqKe9lHH.cjs.map +0 -1
  450. package/dist/emit-CIlvnDvV.mjs.map +0 -1
  451. package/dist/emit-CUD1BWls.cjs.map +0 -1
  452. package/dist/encryption-D2pL3tHH.cjs +0 -54
  453. package/dist/encryption-D2pL3tHH.cjs.map +0 -1
  454. package/dist/encryption-YDsXXi6w.mjs +0 -3
  455. package/dist/encryption-_4zwjOAR.mjs +0 -42
  456. package/dist/encryption-_4zwjOAR.mjs.map +0 -1
  457. package/dist/encryption-sQ2Oxx0d.cjs +0 -4
  458. package/dist/fullstack-secrets-B6KBHf-g.mjs +0 -87
  459. package/dist/fullstack-secrets-B6KBHf-g.mjs.map +0 -1
  460. package/dist/fullstack-secrets-DL8v0y4D.cjs +0 -99
  461. package/dist/fullstack-secrets-DL8v0y4D.cjs.map +0 -1
  462. package/dist/generator-CNzBw7g5.cjs +0 -289
  463. package/dist/generator-CNzBw7g5.cjs.map +0 -1
  464. package/dist/generator-VE2JrFlY.mjs +0 -253
  465. package/dist/generator-VE2JrFlY.mjs.map +0 -1
  466. package/dist/github-BThvbf2W.cjs +0 -197
  467. package/dist/github-BThvbf2W.cjs.map +0 -1
  468. package/dist/github-DpMZurEK.mjs +0 -196
  469. package/dist/github-DpMZurEK.mjs.map +0 -1
  470. package/dist/index-BzJ7QJ9c.d.mts.map +0 -1
  471. package/dist/index-CfMjtdVC.d.cts.map +0 -1
  472. package/dist/keystore-C9rint2E.cjs +0 -101
  473. package/dist/keystore-C9rint2E.cjs.map +0 -1
  474. package/dist/keystore-TxeYM7an.mjs +0 -83
  475. package/dist/keystore-TxeYM7an.mjs.map +0 -1
  476. package/dist/openapi-Bs3-5q_r.mjs +0 -2021
  477. package/dist/openapi-Bs3-5q_r.mjs.map +0 -1
  478. package/dist/openapi-DWLTsYLL.cjs +0 -2075
  479. package/dist/openapi-DWLTsYLL.cjs.map +0 -1
  480. package/dist/openapi-react-query-Byltvm_7.mjs +0 -167
  481. package/dist/openapi-react-query-Byltvm_7.mjs.map +0 -1
  482. package/dist/openapi-react-query-CmJ1xDbn.cjs +0 -173
  483. package/dist/openapi-react-query-CmJ1xDbn.cjs.map +0 -1
  484. package/dist/openapi-react-query.cjs +0 -4
  485. package/dist/openapi-react-query.d.cts +0 -11
  486. package/dist/openapi-react-query.d.cts.map +0 -1
  487. package/dist/openapi-react-query.d.mts +0 -11
  488. package/dist/openapi-react-query.d.mts.map +0 -1
  489. package/dist/openapi-react-query.mjs +0 -4
  490. package/dist/reconcile-BI0tWkwz.mjs.map +0 -1
  491. package/dist/reconcile-Bhw5fmKu.cjs.map +0 -1
  492. package/dist/setup-BmLoNrDX.mjs +0 -12
  493. package/dist/setup-BrR1_xGy.cjs +0 -12
  494. package/dist/setup-BsNR2LBG.cjs +0 -467
  495. package/dist/setup-BsNR2LBG.cjs.map +0 -1
  496. package/dist/setup-D5-JMknk.mjs +0 -437
  497. package/dist/setup-D5-JMknk.mjs.map +0 -1
  498. package/dist/storage-B020InPW.mjs +0 -222
  499. package/dist/storage-B020InPW.mjs.map +0 -1
  500. package/dist/storage-CSNplaJn.cjs +0 -282
  501. package/dist/storage-CSNplaJn.cjs.map +0 -1
  502. package/dist/storage-DGBzMLZa.mjs +0 -4
  503. package/dist/storage-DlVol_oj.cjs +0 -8
  504. package/dist/sync-0ILCb-1S.cjs +0 -93
  505. package/dist/sync-0ILCb-1S.cjs.map +0 -1
  506. package/dist/sync-CzHXiR9c.mjs +0 -76
  507. package/dist/sync-CzHXiR9c.mjs.map +0 -1
  508. package/dist/sync-DYENfOt4.cjs +0 -4
  509. package/dist/sync-HAau6h_R.mjs +0 -3
  510. package/dist/types-DVIx8I1N.d.mts +0 -1950
  511. package/dist/types-DVIx8I1N.d.mts.map +0 -1
  512. package/dist/types-PMP_qXRY.d.cts +0 -1950
  513. package/dist/types-PMP_qXRY.d.cts.map +0 -1
  514. package/dist/workspace-Cji6lE8E.cjs +0 -10
  515. package/dist/workspace-CkJAtRIX.mjs +0 -9
  516. package/dist/workspace-CtnZnWsa.mjs.map +0 -1
  517. package/dist/workspace-DPV7FtAv.cjs.map +0 -1
@@ -0,0 +1,717 @@
1
+ import { t as GkmError } from "./errors-D8Gwp5kU.mjs";
2
+ import { N as assertDeployedStage, U as stageProvider, ft as SERVER_IPV4_KEY, pt as SERVER_IPV6_KEY } from "./workspace-D1QbNd55.mjs";
3
+ import { S as deploysWithCompose } from "./dns-agf2VCdV.mjs";
4
+ import { _ as url, o as email } from "./schemas-BCwKKA42.mjs";
5
+ import { It as secretsStoreFor, M as stageProviderNotes, at as appEnvKeys, ct as workerEnvKeys, dt as constructGlobs, j as provisionCommand, nt as requiredStageKeys, rt as stageServiceDeclarations, zt as initStageSecrets } from "./seeds-Cwtv-U9-.mjs";
6
+ import { t as appKey } from "./derive-B4vDpzgP.mjs";
7
+ import { i as discover } from "./discover-C5roJuc9.mjs";
8
+ import { loadWorkspaceSettings } from "./config.mjs";
9
+ import { i as issueLine, o as loadCredentialSchemas } from "./credentialSchemas-DDOLRCLF.mjs";
10
+ import { isIPv4, isIPv6 } from "node:net";
11
+ import { provideKey } from "@geekmidas/manifest";
12
+ import prompts from "prompts";
13
+ import { build, parse } from "@geekmidas/storage/s3-url";
14
+ //#region src/secrets/stageKeys.ts
15
+ /**
16
+ * The keys a workspace's stage must be given — across every app, each once,
17
+ * with who reads it and whether the stage holds it.
18
+ *
19
+ * The keys themselves are `requiredStageKeys`'s, and the mail and storage
20
+ * constructs `stageServiceDeclarations`' — the lists a deploy's readiness
21
+ * check refuses a stage by. What this adds is the workspace: which third
22
+ * parties' credentials its apps and workers read (`appEnvKeys`,
23
+ * `workerEnvKeys`) and which of the keys the stage has set.
24
+ */
25
+ /**
26
+ * Every key the stage must be given: each mail and storage construct's —
27
+ * the deploy's own list, `stageServiceDeclarations` — and each third party's
28
+ * credentials an app reads.
29
+ */
30
+ function workspaceStageKeys(input) {
31
+ const { manifest } = input;
32
+ const reads = /* @__PURE__ */ new Map();
33
+ for (const [id, declaration] of Object.entries(manifest)) {
34
+ const { kind } = declaration;
35
+ const name = appKey(id);
36
+ const keys = kind === "rest-api" || kind === "site" || kind === "mobile-app" ? appEnvKeys(manifest, name, input.runnables) : kind === "worker" ? workerEnvKeys(manifest, id, input.runnables) : void 0;
37
+ if (keys) reads.set(name, keys);
38
+ }
39
+ const readers = (id) => {
40
+ const key = provideKey(id, "credentials");
41
+ return [...reads].filter(([, env]) => env.has(key)).map(([app]) => app).sort();
42
+ };
43
+ const credentials = [];
44
+ for (const [id, declaration] of Object.entries(manifest)) {
45
+ const { kind } = declaration;
46
+ if (kind !== "external-api" && kind !== "credential") continue;
47
+ const apps = readers(id);
48
+ if (apps.length > 0) credentials.push({
49
+ id,
50
+ kind,
51
+ apps
52
+ });
53
+ }
54
+ const services = stageServiceDeclarations({
55
+ manifest,
56
+ ...input.runnables ? { runnables: input.runnables } : {}
57
+ });
58
+ return requiredStageKeys({
59
+ local: input.local,
60
+ services,
61
+ credentials,
62
+ ...input.domain ? { domain: input.domain } : {},
63
+ ...input.providers ? { providers: input.providers } : {},
64
+ ...input.server ? { server: true } : {}
65
+ }).map((key) => ({
66
+ ...key,
67
+ set: input.supplied[key.key] !== void 0
68
+ }));
69
+ }
70
+ //#endregion
71
+ //#region src/secrets/add.ts
72
+ /**
73
+ * `gkm secrets:add --stage <stage>` — the secrets a stage must be given,
74
+ * built key by key.
75
+ *
76
+ * It offers exactly the keys a deploy would refuse the stage without
77
+ * (`requiredStageKeys`), across every app in the workspace, each once: the
78
+ * stage's buckets, mail and file servers where it is deployed, and every
79
+ * third party's credentials. A key is built by what it is — a bucket from its
80
+ * provider, mail from its SMTP server, credentials field by field from their
81
+ * construct's schema — checked, and saved through the stage's own store, the
82
+ * one `gkm secrets:set` writes. No value is ever printed.
83
+ *
84
+ * The keys are walked one at a time — unset ones first — and each is a
85
+ * checkpoint: set it now, skip it, or stop here. A key is saved the moment it
86
+ * is built, so stopping, Ctrl-C or a failure keeps every key before it, and
87
+ * running the command again picks up what is still missing. A key a provider
88
+ * on the stage creates (a bucket under `deploy.objects.<stage>`, written by
89
+ * the deploy) is not a checkpoint: it is listed, with what creates it.
90
+ *
91
+ * `--json` asks nothing: it prints the keys, for a script or an agent to set
92
+ * with `gkm secrets:set`.
93
+ */
94
+ /** `gkm secrets:add` with nobody at a terminal to answer it. */
95
+ var SecretsAddNeedsTerminal = class extends GkmError {
96
+ stage;
97
+ constructor(stage) {
98
+ super(`gkm secrets:add asks for each key, and there is no terminal to ask at. List what the stage needs with gkm secrets:add --stage ${stage} --missing --json, and set each with gkm secrets:set <KEY> <value> --stage ${stage}.`);
99
+ this.stage = stage;
100
+ this.name = "SecretsAddNeedsTerminal";
101
+ }
102
+ };
103
+ /**
104
+ * The person stopped the builder at a prompt (Ctrl-C). Every key saved
105
+ * before it is kept; the run ends with what was saved and what is missing.
106
+ */
107
+ var SecretsAddCancelled = class extends Error {
108
+ stage;
109
+ constructor(stage) {
110
+ super(`Stopped. Every key saved to the stage '${stage}' before it is kept.`);
111
+ this.stage = stage;
112
+ this.name = "SecretsAddCancelled";
113
+ }
114
+ };
115
+ const defaultIo = () => ({
116
+ log: (line) => console.log(line),
117
+ write: (chunk) => {
118
+ process.stdout.write(chunk);
119
+ },
120
+ interactive: process.stdin.isTTY === true && process.stdout.isTTY === true
121
+ });
122
+ /** `gkm secrets:add`. */
123
+ async function secretsAddCommand(options, io = defaultIo()) {
124
+ const { stage } = options;
125
+ const workspace = await loadWorkspaceSettings(options.cwd ?? process.cwd());
126
+ const local = stage === workspace.stages.local;
127
+ if (!local) assertDeployedStage(workspace.stages, stage);
128
+ const patterns = constructGlobs(workspace);
129
+ const runnables = {};
130
+ const manifest = await discover({
131
+ patterns,
132
+ cwd: workspace.root,
133
+ runnables
134
+ });
135
+ const store = await secretsStoreFor(workspace, stage, { ...options.home ? { home: options.home } : {} });
136
+ const stored = await store.read(stage);
137
+ const domain = workspace.domains?.[stage];
138
+ const all = workspaceStageKeys({
139
+ manifest,
140
+ runnables,
141
+ local,
142
+ supplied: stored?.custom ?? {},
143
+ ...domain ? { domain } : {},
144
+ providers: stageProviderNotes(workspace, stage),
145
+ ...!local && domain && deploysWithCompose(workspace) ? { server: true } : {}
146
+ });
147
+ const scope = [...all.filter((k) => !k.set), ...all.filter((k) => k.set)];
148
+ const keys = options.missing ? scope.filter((k) => !k.set) : scope;
149
+ const objects = stageProvider(workspace, "objects", stage);
150
+ const provisioned = (k) => objects.mode === "provider" && k.hint !== void 0 && (k.kind === "bucket" || k.kind === "file-server");
151
+ if (options.json) {
152
+ const listed = keys.map((k) => ({
153
+ key: k.key,
154
+ kind: k.kind,
155
+ construct: k.id,
156
+ apps: [...k.apps ?? []],
157
+ set: k.set,
158
+ ...provisioned(k) ? { provisioned: true } : {}
159
+ }));
160
+ io.write(`${JSON.stringify(listed, null, 2)}\n`);
161
+ return {
162
+ keys,
163
+ saved: [],
164
+ skipped: [],
165
+ missing: []
166
+ };
167
+ }
168
+ if (!io.interactive) throw new SecretsAddNeedsTerminal(stage);
169
+ const offered = keys.filter((k) => !provisioned(k));
170
+ const created = keys.filter(provisioned);
171
+ if (created.length > 0 && objects.mode === "provider") {
172
+ io.log("Not offered — a provider on the stage creates them:");
173
+ for (const k of created) io.log(` ${k.key} — created by ${provisionCommand(stage)} (deploy.objects.${stage} is ${objects.name})`);
174
+ }
175
+ if (offered.length === 0) {
176
+ io.log(all.every(provisioned) ? `Nothing to add: no construct on '${stage}' needs a key only the stage can supply.` : `Nothing to add: the stage '${stage}' has every key it needs.`);
177
+ return {
178
+ keys: offered,
179
+ saved: [],
180
+ skipped: [],
181
+ missing: []
182
+ };
183
+ }
184
+ const ask = asker(stage);
185
+ let current = stored ?? initStageSecrets(stage);
186
+ const saved = [];
187
+ const skipped = [];
188
+ const has = (key) => current.custom?.[key] !== void 0;
189
+ let schemas;
190
+ const save = async (values) => {
191
+ current = {
192
+ ...current,
193
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
194
+ custom: {
195
+ ...current.custom,
196
+ ...values
197
+ }
198
+ };
199
+ await store.write(stage, current);
200
+ saved.push(...Object.keys(values));
201
+ io.log(` ✓ Saved ${Object.keys(values).join(", ")}.`);
202
+ };
203
+ const walk = async () => {
204
+ for (const [index, entry] of offered.entries()) {
205
+ io.log(`\n[${index + 1}/${offered.length}] ${entry.key} — ${entry.what}`);
206
+ if (entry.hint) io.log(` ${entry.hint}`);
207
+ const step = await ask({
208
+ type: "select",
209
+ message: `${entry.key} ${KIND_LABEL[entry.kind]} '${entry.id}'${entry.apps?.length ? ` · ${entry.apps.join(", ")}` : ""}${entry.set ? " · set" : ""}`,
210
+ choices: [
211
+ {
212
+ title: "Set it now",
213
+ value: "set"
214
+ },
215
+ {
216
+ title: "Skip",
217
+ value: "skip"
218
+ },
219
+ {
220
+ title: "Stop here",
221
+ value: "stop"
222
+ }
223
+ ],
224
+ initial: 0
225
+ });
226
+ if (step === "stop") return;
227
+ if (step !== "set") {
228
+ skipped.push(entry.key);
229
+ continue;
230
+ }
231
+ if (entry.set) {
232
+ if (!await ask({
233
+ type: "confirm",
234
+ message: `${entry.key} is set. Replace it?`,
235
+ initial: false
236
+ })) {
237
+ skipped.push(entry.key);
238
+ continue;
239
+ }
240
+ }
241
+ switch (entry.kind) {
242
+ case "bucket":
243
+ await save(await buildBucket(ask, io, entry, has));
244
+ break;
245
+ case "email":
246
+ await save({ [entry.key]: entry.key.endsWith("_FROM") ? await askFrom(ask, io) : await buildSmtpUrl(ask, io) });
247
+ break;
248
+ case "file-server":
249
+ await save({ [entry.key]: await askHttpUrl(ask, io, "Its public URL") });
250
+ break;
251
+ case "server":
252
+ await save(await buildServer(ask, io, has));
253
+ break;
254
+ case "external-api":
255
+ case "credential":
256
+ schemas ??= await loadCredentialSchemas({
257
+ root: workspace.root,
258
+ patterns
259
+ });
260
+ await save({ [entry.key]: await buildCredentials(ask, io, entry, schemas) });
261
+ }
262
+ }
263
+ };
264
+ try {
265
+ await walk();
266
+ } catch (error) {
267
+ if (!(error instanceof SecretsAddCancelled)) throw error;
268
+ io.log(`\n${error.message}`);
269
+ }
270
+ const missing = all.filter((k) => !provisioned(k) && !has(k.key)).map((k) => k.key);
271
+ io.log("");
272
+ io.log(saved.length > 0 ? `✓ Saved to the stage '${stage}' (${store.name} store): ${saved.join(", ")}` : "Nothing was saved.");
273
+ if (skipped.length > 0) io.log(` Skipped: ${skipped.join(", ")}`);
274
+ if (missing.length > 0) {
275
+ io.log(` Still missing: ${missing.join(", ")}`);
276
+ io.log(` Run gkm secrets:add --stage ${stage} --missing again to pick up where this left off.`);
277
+ }
278
+ return {
279
+ keys: offered,
280
+ saved,
281
+ skipped,
282
+ missing
283
+ };
284
+ }
285
+ const KIND_LABEL = {
286
+ bucket: "bucket",
287
+ email: "email",
288
+ "file-server": "file server",
289
+ "external-api": "external API",
290
+ credential: "credential",
291
+ server: "server address"
292
+ };
293
+ /** The server's IPv4 address, and — if it has one — its IPv6 address. */
294
+ async function buildServer(ask, io, has) {
295
+ const ipv4 = text(await askUntil(ask, io, {
296
+ type: "text",
297
+ message: "The server's public IPv4 address"
298
+ }, (value) => isIPv4(text(value)) ? void 0 : "An IPv4 address is required, e.g. 203.0.113.10."));
299
+ const values = { [SERVER_IPV4_KEY]: ipv4 };
300
+ if (has("GKM_SERVER_IPV6")) return values;
301
+ const ipv6 = text(await askUntil(ask, io, {
302
+ type: "text",
303
+ message: "Its public IPv6 address (empty for none — no AAAA records)"
304
+ }, (value) => !text(value) || isIPv6(text(value)) ? void 0 : "An IPv6 address, e.g. 2001:db8::10, or nothing."));
305
+ if (ipv6) values[SERVER_IPV6_KEY] = ipv6;
306
+ return values;
307
+ }
308
+ function asker(stage) {
309
+ return async (question) => {
310
+ return (await prompts({
311
+ ...question,
312
+ name: "value"
313
+ }, { onCancel: () => {
314
+ throw new SecretsAddCancelled(stage);
315
+ } })).value;
316
+ };
317
+ }
318
+ /** Ask until `accept` takes the answer; `accept` returns why it did not. */
319
+ async function askUntil(ask, io, question, accept) {
320
+ for (;;) {
321
+ const value = await ask(question);
322
+ const problem = accept(value);
323
+ if (!problem) return value;
324
+ io.log(` ✗ ${problem}`);
325
+ }
326
+ }
327
+ const required = (what) => (value) => value?.trim() ? void 0 : `${what} is required.`;
328
+ const text = (value) => String(value ?? "").trim();
329
+ /** An `http(s)://` URL. */
330
+ const HttpUrl = url({ protocol: /^https?$/ });
331
+ async function askHttpUrl(ask, io, message) {
332
+ return text(await askUntil(ask, io, {
333
+ type: "text",
334
+ message
335
+ }, (value) => HttpUrl.safeParse(text(value)).success ? void 0 : "An http:// or https:// URL is required."));
336
+ }
337
+ async function askFrom(ask, io) {
338
+ return text(await askUntil(ask, io, {
339
+ type: "text",
340
+ message: "The address it sends from"
341
+ }, (value) => email().safeParse(text(value)).success ? void 0 : "An email address is required, e.g. noreply@example.com."));
342
+ }
343
+ /**
344
+ * An SMTP server as the URL `@geekmidas/emailkit` reads: `smtp://` for
345
+ * STARTTLS, `smtps://` for TLS from the first byte, with the user and
346
+ * password percent-encoded.
347
+ *
348
+ * A known service fills in its own host, port and user; each from its docs:
349
+ * - Resend: smtp.resend.com, 465 implicit TLS, user `resend`, password the
350
+ * API key — https://resend.com/docs/send-with-smtp
351
+ * - Amazon SES: email-smtp.<region>.amazonaws.com, 587 STARTTLS, SMTP
352
+ * credentials — https://docs.aws.amazon.com/ses/latest/dg/smtp-connect.html,
353
+ * https://docs.aws.amazon.com/general/latest/gr/ses.html
354
+ * - Postmark: smtp.postmarkapp.com, 587 STARTTLS, the server API token as
355
+ * user and password —
356
+ * https://postmarkapp.com/developer/user-guide/send-email-with-smtp
357
+ * - Mailgun: smtp.mailgun.org (EU: smtp.eu.mailgun.org), 587 STARTTLS, the
358
+ * domain's SMTP credentials —
359
+ * https://documentation.mailgun.com/docs/mailgun/user-manual/sending-messages/send-smtp,
360
+ * https://documentation.mailgun.com/docs/mailgun/api-reference/api-overview
361
+ */
362
+ async function buildSmtpUrl(ask, io) {
363
+ const service = await ask({
364
+ type: "select",
365
+ message: "Which mail service?",
366
+ choices: [
367
+ {
368
+ title: "Resend",
369
+ value: "resend"
370
+ },
371
+ {
372
+ title: "Amazon SES",
373
+ value: "ses"
374
+ },
375
+ {
376
+ title: "Postmark",
377
+ value: "postmark"
378
+ },
379
+ {
380
+ title: "Mailgun",
381
+ value: "mailgun"
382
+ },
383
+ {
384
+ title: "Other SMTP server",
385
+ value: "other"
386
+ }
387
+ ],
388
+ initial: 0
389
+ });
390
+ const secret = async (message, what) => text(await askUntil(ask, io, {
391
+ type: "password",
392
+ message
393
+ }, required(what)));
394
+ const login = async (message, what) => text(await askUntil(ask, io, {
395
+ type: "text",
396
+ message
397
+ }, required(what)));
398
+ switch (service) {
399
+ case "resend": return smtpUrl({
400
+ tls: "tls",
401
+ host: "smtp.resend.com",
402
+ port: 465,
403
+ user: "resend",
404
+ password: await secret("API key (re_…)", "The API key")
405
+ });
406
+ case "ses": return smtpUrl({
407
+ tls: "starttls",
408
+ host: `email-smtp.${await login("Region", "The region")}.amazonaws.com`,
409
+ port: 587,
410
+ user: await login("SMTP user name", "The SMTP user name"),
411
+ password: await secret("SMTP password", "The SMTP password")
412
+ });
413
+ case "postmark": {
414
+ const token = await secret("Server API token", "The server API token");
415
+ return smtpUrl({
416
+ tls: "starttls",
417
+ host: "smtp.postmarkapp.com",
418
+ port: 587,
419
+ user: token,
420
+ password: token
421
+ });
422
+ }
423
+ case "mailgun": return smtpUrl({
424
+ tls: "starttls",
425
+ host: await ask({
426
+ type: "select",
427
+ message: "Region",
428
+ choices: [{
429
+ title: "US (smtp.mailgun.org)",
430
+ value: "us"
431
+ }, {
432
+ title: "EU (smtp.eu.mailgun.org)",
433
+ value: "eu"
434
+ }],
435
+ initial: 0
436
+ }) === "eu" ? "smtp.eu.mailgun.org" : "smtp.mailgun.org",
437
+ port: 587,
438
+ user: await login("SMTP login (e.g. postmaster@mg.example.com)", "The SMTP login"),
439
+ password: await secret("SMTP password", "The SMTP password")
440
+ });
441
+ }
442
+ const host = text(await askUntil(ask, io, {
443
+ type: "text",
444
+ message: "SMTP host"
445
+ }, required("The host")));
446
+ const port = await askUntil(ask, io, {
447
+ type: "text",
448
+ message: "Port",
449
+ initial: "587"
450
+ }, (value) => {
451
+ const n = Number(value);
452
+ return Number.isInteger(n) && n > 0 && n < 65536 ? void 0 : "A port number is required.";
453
+ });
454
+ const user = text(await ask({
455
+ type: "text",
456
+ message: "User (empty for none)"
457
+ }));
458
+ const password = user ? await ask({
459
+ type: "password",
460
+ message: "Password"
461
+ }) : "";
462
+ return smtpUrl({
463
+ tls: await ask({
464
+ type: "select",
465
+ message: "TLS",
466
+ choices: [{
467
+ title: "STARTTLS (smtp://, usually port 587)",
468
+ value: "starttls"
469
+ }, {
470
+ title: "TLS on connect (smtps://, usually port 465)",
471
+ value: "tls"
472
+ }],
473
+ initial: 0
474
+ }),
475
+ host,
476
+ port: Number(port),
477
+ user,
478
+ password
479
+ });
480
+ }
481
+ function smtpUrl(server) {
482
+ const url = new URL(`${server.tls === "tls" ? "smtps" : "smtp"}://${server.host}`);
483
+ url.port = String(server.port);
484
+ if (server.user) {
485
+ url.username = encodeURIComponent(server.user);
486
+ url.password = encodeURIComponent(server.password ?? "");
487
+ }
488
+ return url.toString().replace(/\/$/, "");
489
+ }
490
+ /**
491
+ * A bucket's URL, from its provider — and, optionally, a key for it alone in
492
+ * the URL, or the stage's shared pair. Credentials are never required: without
493
+ * them the SDK's own chain signs, a role included.
494
+ */
495
+ async function buildBucket(ask, io, entry, has) {
496
+ const provider = await ask({
497
+ type: "select",
498
+ message: "Where is the bucket?",
499
+ choices: [
500
+ {
501
+ title: "AWS S3",
502
+ value: "s3"
503
+ },
504
+ {
505
+ title: "Cloudflare R2",
506
+ value: "r2"
507
+ },
508
+ {
509
+ title: "MinIO, or another S3-compatible store",
510
+ value: "compatible"
511
+ },
512
+ {
513
+ title: "Paste an s3:// URL",
514
+ value: "url"
515
+ }
516
+ ],
517
+ initial: 0
518
+ });
519
+ const bucketName = async () => text(await askUntil(ask, io, {
520
+ type: "text",
521
+ message: "Bucket name"
522
+ }, required("The bucket name")));
523
+ let address;
524
+ switch (provider) {
525
+ case "s3":
526
+ address = {
527
+ bucket: await bucketName(),
528
+ region: text(await askUntil(ask, io, {
529
+ type: "text",
530
+ message: "Region",
531
+ initial: "eu-west-1"
532
+ }, required("The region")))
533
+ };
534
+ break;
535
+ case "r2": {
536
+ const account = text(await askUntil(ask, io, {
537
+ type: "text",
538
+ message: "Cloudflare account id, or the R2 endpoint URL"
539
+ }, required("The account id or endpoint")));
540
+ address = {
541
+ bucket: await bucketName(),
542
+ region: "auto",
543
+ endpoint: /^https?:\/\//.test(account) ? account : `https://${account}.r2.cloudflarestorage.com`
544
+ };
545
+ break;
546
+ }
547
+ case "compatible": {
548
+ const endpoint = await askHttpUrl(ask, io, "Endpoint URL");
549
+ const bucket = await bucketName();
550
+ const region = text(await ask({
551
+ type: "text",
552
+ message: "Region",
553
+ initial: "us-east-1"
554
+ }));
555
+ const forcePathStyle = await ask({
556
+ type: "confirm",
557
+ message: "Path-style addressing? (MinIO needs it)",
558
+ initial: true
559
+ });
560
+ address = {
561
+ bucket,
562
+ ...region ? { region } : {},
563
+ endpoint,
564
+ ...forcePathStyle ? { forcePathStyle } : {}
565
+ };
566
+ break;
567
+ }
568
+ case "url": {
569
+ const pasted = await askUntil(ask, io, {
570
+ type: "password",
571
+ message: "The s3:// URL"
572
+ }, (value) => {
573
+ try {
574
+ parse(text(value));
575
+ return;
576
+ } catch (error) {
577
+ return `Not an s3:// URL the storage client can read (${error.name}).`;
578
+ }
579
+ });
580
+ address = parse(text(pasted));
581
+ break;
582
+ }
583
+ }
584
+ if (!address.accessKeyId) {
585
+ if (await ask({
586
+ type: "confirm",
587
+ message: `A key for '${entry.id}' alone, in its URL? (optional)`,
588
+ initial: false
589
+ })) {
590
+ const accessKeyId = text(await askUntil(ask, io, {
591
+ type: "text",
592
+ message: "Access key id"
593
+ }, required("The access key id")));
594
+ const secretAccessKey = await askUntil(ask, io, {
595
+ type: "password",
596
+ message: "Secret access key"
597
+ }, required("The secret access key"));
598
+ address = {
599
+ ...address,
600
+ accessKeyId,
601
+ secretAccessKey
602
+ };
603
+ }
604
+ }
605
+ const values = { [entry.key]: build(address) };
606
+ if (!address.accessKeyId && !has("AWS_ACCESS_KEY_ID")) {
607
+ if (await ask({
608
+ type: "confirm",
609
+ message: "Set the stage's shared AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY? (optional: without them a role signs)",
610
+ initial: false
611
+ })) {
612
+ values.AWS_ACCESS_KEY_ID = text(await askUntil(ask, io, {
613
+ type: "text",
614
+ message: "AWS_ACCESS_KEY_ID"
615
+ }, required("The access key id")));
616
+ values.AWS_SECRET_ACCESS_KEY = await askUntil(ask, io, {
617
+ type: "password",
618
+ message: "AWS_SECRET_ACCESS_KEY"
619
+ }, required("The secret access key"));
620
+ }
621
+ }
622
+ return values;
623
+ }
624
+ /** A field whose name says it is a secret, asked for without echo. */
625
+ const SECRET_FIELD = /secret|key|token|password/i;
626
+ /** The properties of an object schema, or nothing for any other shape. */
627
+ function objectProperties(info) {
628
+ const schema = info?.jsonSchema;
629
+ if (!schema || schema.type !== "object") return void 0;
630
+ const properties = schema.properties;
631
+ if (!properties || typeof properties !== "object") return void 0;
632
+ return {
633
+ properties,
634
+ required: Array.isArray(schema.required) ? schema.required : []
635
+ };
636
+ }
637
+ function typesOf(property) {
638
+ if (Array.isArray(property.type)) return property.type;
639
+ return property.type ? [property.type] : [];
640
+ }
641
+ /**
642
+ * Credentials, field by field where the construct's schema is an object it
643
+ * can describe, and as JSON otherwise — checked against the schema itself
644
+ * before anything is kept, and asked again, with each issue's path, until
645
+ * the schema takes it.
646
+ */
647
+ async function buildCredentials(ask, io, entry, schemas) {
648
+ const info = schemas.schemas.find((s) => s.key === entry.key);
649
+ const shape = objectProperties(info);
650
+ if (!info) io.log(` '${entry.id}' exposes no schema to check against; the value is stored as given.`);
651
+ for (;;) {
652
+ const raw = shape ? JSON.stringify(await askFields(ask, io, shape)) : text(await ask({
653
+ type: "password",
654
+ message: "The value, as JSON (or one opaque string)"
655
+ }));
656
+ const check = await schemas.check(entry.key, raw);
657
+ if (check.ok) return raw;
658
+ io.log(` ✗ The schema of '${entry.id}' refuses it:`);
659
+ for (const issue of check.issues) io.log(` ${issueLine(entry.key, issue)}`);
660
+ io.log(" Again:");
661
+ }
662
+ }
663
+ async function askFields(ask, io, shape) {
664
+ const value = {};
665
+ for (const [name, property] of Object.entries(shape.properties)) {
666
+ const optional = !shape.required.includes(name);
667
+ const label = `${name}${optional ? " (optional)" : ""}${property.description ? ` — ${property.description}` : ""}`;
668
+ const types = typesOf(property);
669
+ if (property.enum?.length) {
670
+ const choices = property.enum.map((option) => ({
671
+ title: String(option),
672
+ value: option
673
+ }));
674
+ const picked = await ask({
675
+ type: "select",
676
+ message: label,
677
+ choices: optional ? [{
678
+ title: "(none)",
679
+ value: void 0
680
+ }, ...choices] : choices
681
+ });
682
+ if (picked !== void 0) value[name] = picked;
683
+ continue;
684
+ }
685
+ if (types.includes("boolean")) {
686
+ value[name] = await ask({
687
+ type: "confirm",
688
+ message: label,
689
+ initial: false
690
+ });
691
+ continue;
692
+ }
693
+ const numeric = types.includes("number") || types.includes("integer");
694
+ const plain = types.length === 0 || types.includes("string");
695
+ const answer = await askUntil(ask, io, {
696
+ type: SECRET_FIELD.test(name) ? "password" : "text",
697
+ message: label
698
+ }, (given) => {
699
+ const typed = text(given);
700
+ if (!typed) return optional ? void 0 : `${name} is required.`;
701
+ if (numeric && !plain && Number.isNaN(Number(typed))) return `${name} is a number.`;
702
+ if (!numeric && !plain) try {
703
+ JSON.parse(typed);
704
+ } catch {
705
+ return `${name} is JSON (${types.join(" or ")}).`;
706
+ }
707
+ });
708
+ const typed = text(answer);
709
+ if (!typed) continue;
710
+ value[name] = plain ? typed : numeric ? Number(typed) : JSON.parse(typed);
711
+ }
712
+ return value;
713
+ }
714
+ //#endregion
715
+ export { secretsAddCommand };
716
+
717
+ //# sourceMappingURL=add-C0kXOsWS.mjs.map