@geekmidas/cli 10.0.0-alpha.9 → 10.0.0-alpha.91

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 (457) hide show
  1. package/README.md +315 -414
  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-CVc6Oi1Y.mjs +1021 -0
  7. package/dist/EndpointGenerator-CVc6Oi1Y.mjs.map +1 -0
  8. package/dist/EndpointGenerator-CwLjBCFE.cjs +1080 -0
  9. package/dist/EndpointGenerator-CwLjBCFE.cjs.map +1 -0
  10. package/dist/GoDaddyProvider-DSStJVAv.mjs +387 -0
  11. package/dist/GoDaddyProvider-DSStJVAv.mjs.map +1 -0
  12. package/dist/GoDaddyProvider-DqZ1qD_F.cjs +387 -0
  13. package/dist/GoDaddyProvider-DqZ1qD_F.cjs.map +1 -0
  14. package/dist/{HostingerProvider-Cft7lEYr.mjs → HostingerProvider-BI6J7oJr.mjs} +22 -23
  15. package/dist/HostingerProvider-BI6J7oJr.mjs.map +1 -0
  16. package/dist/{HostingerProvider-h3EbEp-Z.cjs → HostingerProvider-CyTpG_jy.cjs} +22 -23
  17. package/dist/HostingerProvider-CyTpG_jy.cjs.map +1 -0
  18. package/dist/LegacyStateStore-DXmNA7hy.cjs +89 -0
  19. package/dist/LegacyStateStore-DXmNA7hy.cjs.map +1 -0
  20. package/dist/LegacyStateStore-ZkdmiUFZ.mjs +89 -0
  21. package/dist/LegacyStateStore-ZkdmiUFZ.mjs.map +1 -0
  22. package/dist/LocalStateStore-BBeTlRTH.cjs +178 -0
  23. package/dist/LocalStateStore-BBeTlRTH.cjs.map +1 -0
  24. package/dist/LocalStateStore-CU-O0SBp.mjs +167 -0
  25. package/dist/LocalStateStore-CU-O0SBp.mjs.map +1 -0
  26. package/dist/OpenApiTsGenerator-B--HV-sW.cjs +541 -0
  27. package/dist/OpenApiTsGenerator-B--HV-sW.cjs.map +1 -0
  28. package/dist/OpenApiTsGenerator-CkvsPdgg.mjs +536 -0
  29. package/dist/OpenApiTsGenerator-CkvsPdgg.mjs.map +1 -0
  30. package/dist/{Route53Provider-di2fMM5N.cjs → Route53Provider-Bllus2NR.cjs} +21 -22
  31. package/dist/Route53Provider-Bllus2NR.cjs.map +1 -0
  32. package/dist/{Route53Provider-RdpUDJQk.mjs → Route53Provider-QXxjkZO1.mjs} +13 -13
  33. package/dist/Route53Provider-QXxjkZO1.mjs.map +1 -0
  34. package/dist/S3StateStore-Br8VMY22.cjs +160 -0
  35. package/dist/S3StateStore-Br8VMY22.cjs.map +1 -0
  36. package/dist/S3StateStore-bwxcI_wQ.mjs +161 -0
  37. package/dist/S3StateStore-bwxcI_wQ.mjs.map +1 -0
  38. package/dist/SSMStateStore-CsOS0W1y.mjs +154 -0
  39. package/dist/SSMStateStore-CsOS0W1y.mjs.map +1 -0
  40. package/dist/SSMStateStore-DoZE1Wi1.cjs +153 -0
  41. package/dist/SSMStateStore-DoZE1Wi1.cjs.map +1 -0
  42. package/dist/SubscriberGenerator-BPqQf8fB.mjs +448 -0
  43. package/dist/SubscriberGenerator-BPqQf8fB.mjs.map +1 -0
  44. package/dist/SubscriberGenerator-BVn7cQ-2.cjs +489 -0
  45. package/dist/SubscriberGenerator-BVn7cQ-2.cjs.map +1 -0
  46. package/dist/add-BSHk5Ngn.mjs +747 -0
  47. package/dist/add-BSHk5Ngn.mjs.map +1 -0
  48. package/dist/add-DmmBDV2e.cjs +749 -0
  49. package/dist/add-DmmBDV2e.cjs.map +1 -0
  50. package/dist/appPorts-C9z9Pzn9.mjs +223 -0
  51. package/dist/appPorts-C9z9Pzn9.mjs.map +1 -0
  52. package/dist/appPorts-Cu79hJF6.cjs +264 -0
  53. package/dist/appPorts-Cu79hJF6.cjs.map +1 -0
  54. package/dist/aws-B-6uEhgP.mjs +71 -0
  55. package/dist/aws-B-6uEhgP.mjs.map +1 -0
  56. package/dist/aws-BTawF0F-.cjs +82 -0
  57. package/dist/aws-BTawF0F-.cjs.map +1 -0
  58. package/dist/awsStore-7VmS_cZR.cjs +54 -0
  59. package/dist/awsStore-7VmS_cZR.cjs.map +1 -0
  60. package/dist/awsStore-B529csle.mjs +43 -0
  61. package/dist/awsStore-B529csle.mjs.map +1 -0
  62. package/dist/{backup-provisioner-Bgj5Vi_L.mjs → backup-provisioner-C8DnCmxK.mjs} +11 -8
  63. package/dist/backup-provisioner-C8DnCmxK.mjs.map +1 -0
  64. package/dist/{backup-provisioner-BrsHwYG0.cjs → backup-provisioner-oDEsPj02.cjs} +22 -20
  65. package/dist/backup-provisioner-oDEsPj02.cjs.map +1 -0
  66. package/dist/{bundler-BY1OmV1e.cjs → bundler-BQJiB7Ub.cjs} +38 -35
  67. package/dist/bundler-BQJiB7Ub.cjs.map +1 -0
  68. package/dist/{bundler-Be8Zg4Wd.mjs → bundler-D6eBfVkl.mjs} +36 -32
  69. package/dist/bundler-D6eBfVkl.mjs.map +1 -0
  70. package/dist/cli-BE9mqeX8.cjs +69 -0
  71. package/dist/cli-BE9mqeX8.cjs.map +1 -0
  72. package/dist/cli-DD-Yk-I5.mjs +69 -0
  73. package/dist/cli-DD-Yk-I5.mjs.map +1 -0
  74. package/dist/compose-Bhmf0n4o.mjs +3140 -0
  75. package/dist/compose-Bhmf0n4o.mjs.map +1 -0
  76. package/dist/compose-CvpU6ooi.cjs +3265 -0
  77. package/dist/compose-CvpU6ooi.cjs.map +1 -0
  78. package/dist/config-CdEcTrjG.d.mts +269 -0
  79. package/dist/config-CdEcTrjG.d.mts.map +1 -0
  80. package/dist/config-pST7E0CS.d.cts +269 -0
  81. package/dist/config-pST7E0CS.d.cts.map +1 -0
  82. package/dist/config.cjs +420 -11
  83. package/dist/config.cjs.map +1 -0
  84. package/dist/config.d.cts +4 -120
  85. package/dist/config.d.mts +4 -120
  86. package/dist/config.mjs +404 -4
  87. package/dist/config.mjs.map +1 -0
  88. package/dist/credentialSchemas-BJqRJNK4.mjs +236 -0
  89. package/dist/credentialSchemas-BJqRJNK4.mjs.map +1 -0
  90. package/dist/credentialSchemas-DCR4Wd1W.cjs +271 -0
  91. package/dist/credentialSchemas-DCR4Wd1W.cjs.map +1 -0
  92. package/dist/credentials-BKfIugu2.cjs +513 -0
  93. package/dist/credentials-BKfIugu2.cjs.map +1 -0
  94. package/dist/credentials-CnVqoXMb.mjs +388 -0
  95. package/dist/credentials-CnVqoXMb.mjs.map +1 -0
  96. package/dist/databases-BY-pEImp.cjs +597 -0
  97. package/dist/databases-BY-pEImp.cjs.map +1 -0
  98. package/dist/databases-CzszQV0N.mjs +494 -0
  99. package/dist/databases-CzszQV0N.mjs.map +1 -0
  100. package/dist/define-DR8xGYfL.mjs +97 -0
  101. package/dist/define-DR8xGYfL.mjs.map +1 -0
  102. package/dist/define-DzRz8FgH.cjs +144 -0
  103. package/dist/define-DzRz8FgH.cjs.map +1 -0
  104. package/dist/deploy/public.cjs +208 -0
  105. package/dist/deploy/public.cjs.map +1 -0
  106. package/dist/deploy/public.d.cts +649 -0
  107. package/dist/deploy/public.d.cts.map +1 -0
  108. package/dist/deploy/public.d.mts +649 -0
  109. package/dist/deploy/public.d.mts.map +1 -0
  110. package/dist/deploy/public.mjs +142 -0
  111. package/dist/deploy/public.mjs.map +1 -0
  112. package/dist/deploy/sniffer-envkit-patch.cjs +18 -10
  113. package/dist/deploy/sniffer-envkit-patch.cjs.map +1 -1
  114. package/dist/deploy/sniffer-envkit-patch.d.cts +0 -2
  115. package/dist/deploy/sniffer-envkit-patch.d.cts.map +1 -1
  116. package/dist/deploy/sniffer-envkit-patch.d.mts +0 -2
  117. package/dist/deploy/sniffer-envkit-patch.d.mts.map +1 -1
  118. package/dist/deploy/sniffer-envkit-patch.mjs +10 -2
  119. package/dist/deploy/sniffer-envkit-patch.mjs.map +1 -1
  120. package/dist/deploy/sniffer-envparser-worker.cjs +54 -0
  121. package/dist/deploy/sniffer-envparser-worker.cjs.map +1 -0
  122. package/dist/deploy/sniffer-envparser-worker.d.cts +1 -0
  123. package/dist/deploy/sniffer-envparser-worker.d.mts +1 -0
  124. package/dist/deploy/sniffer-envparser-worker.mjs +55 -0
  125. package/dist/deploy/sniffer-envparser-worker.mjs.map +1 -0
  126. package/dist/deploy/sniffer-hooks.cjs +13 -7
  127. package/dist/deploy/sniffer-hooks.cjs.map +1 -1
  128. package/dist/deploy/sniffer-hooks.d.cts +1 -2
  129. package/dist/deploy/sniffer-hooks.d.cts.map +1 -1
  130. package/dist/deploy/sniffer-hooks.d.mts +1 -2
  131. package/dist/deploy/sniffer-hooks.d.mts.map +1 -1
  132. package/dist/deploy/sniffer-hooks.mjs +10 -3
  133. package/dist/deploy/sniffer-hooks.mjs.map +1 -1
  134. package/dist/deploy/sniffer-loader.cjs +16 -7
  135. package/dist/deploy/sniffer-loader.cjs.map +1 -1
  136. package/dist/deploy/sniffer-loader.d.cts +1 -1
  137. package/dist/deploy/sniffer-loader.d.mts +1 -1
  138. package/dist/deploy/sniffer-loader.mjs +14 -3
  139. package/dist/deploy/sniffer-loader.mjs.map +1 -1
  140. package/dist/deploy/sniffer-routes-worker.cjs +11 -11
  141. package/dist/deploy/sniffer-routes-worker.cjs.map +1 -1
  142. package/dist/deploy/sniffer-routes-worker.d.cts +1 -1
  143. package/dist/deploy/sniffer-routes-worker.d.mts +1 -1
  144. package/dist/deploy/sniffer-routes-worker.mjs +4 -4
  145. package/dist/deploy/sniffer-routes-worker.mjs.map +1 -1
  146. package/dist/deploy/sniffer-worker.cjs +15 -6
  147. package/dist/deploy/sniffer-worker.cjs.map +1 -1
  148. package/dist/deploy/sniffer-worker.d.cts +1 -3
  149. package/dist/deploy/sniffer-worker.d.cts.map +1 -1
  150. package/dist/deploy/sniffer-worker.d.mts +1 -3
  151. package/dist/deploy/sniffer-worker.d.mts.map +1 -1
  152. package/dist/deploy/sniffer-worker.mjs +15 -4
  153. package/dist/deploy/sniffer-worker.mjs.map +1 -1
  154. package/dist/deploy-CuHasEA4.cjs +554 -0
  155. package/dist/deploy-CuHasEA4.cjs.map +1 -0
  156. package/dist/deploy-QNtx_eWR.mjs +525 -0
  157. package/dist/deploy-QNtx_eWR.mjs.map +1 -0
  158. package/dist/derive-B4vDpzgP.mjs +150 -0
  159. package/dist/derive-B4vDpzgP.mjs.map +1 -0
  160. package/dist/derive-DAbo49sm.cjs +161 -0
  161. package/dist/derive-DAbo49sm.cjs.map +1 -0
  162. package/dist/discover-BPelzeGW.mjs +526 -0
  163. package/dist/discover-BPelzeGW.mjs.map +1 -0
  164. package/dist/discover-CU0paUyH.d.cts +108 -0
  165. package/dist/discover-CU0paUyH.d.cts.map +1 -0
  166. package/dist/discover-D1It5r_h.cjs +599 -0
  167. package/dist/discover-D1It5r_h.cjs.map +1 -0
  168. package/dist/discover-DFiJxwfv.d.mts +108 -0
  169. package/dist/discover-DFiJxwfv.d.mts.map +1 -0
  170. package/dist/dokploy-CYcMLh9-.mjs +38 -0
  171. package/dist/dokploy-CYcMLh9-.mjs.map +1 -0
  172. package/dist/dokploy-DIowwyIB.cjs +38 -0
  173. package/dist/dokploy-DIowwyIB.cjs.map +1 -0
  174. package/dist/drivers-DTZzxeIl.mjs +177 -0
  175. package/dist/drivers-DTZzxeIl.mjs.map +1 -0
  176. package/dist/drivers-LYSdQDmd.cjs +200 -0
  177. package/dist/drivers-LYSdQDmd.cjs.map +1 -0
  178. package/dist/{emit-CiZS_5Ub.mjs → emit-C1e8qD08.mjs} +13 -26
  179. package/dist/emit-C1e8qD08.mjs.map +1 -0
  180. package/dist/{emit-CbcRolsa.cjs → emit-Dmc1nvdS.cjs} +31 -57
  181. package/dist/emit-Dmc1nvdS.cjs.map +1 -0
  182. package/dist/encryption-BrEef7Jk.mjs +88 -0
  183. package/dist/encryption-BrEef7Jk.mjs.map +1 -0
  184. package/dist/encryption-CjYdUb2s.cjs +89 -0
  185. package/dist/encryption-CjYdUb2s.cjs.map +1 -0
  186. package/dist/engine-2h4k5ICq.mjs +3085 -0
  187. package/dist/engine-2h4k5ICq.mjs.map +1 -0
  188. package/dist/engine-BhJ7ZP9K.cjs +3198 -0
  189. package/dist/engine-BhJ7ZP9K.cjs.map +1 -0
  190. package/dist/github-B5Bw4HIu.cjs +669 -0
  191. package/dist/github-B5Bw4HIu.cjs.map +1 -0
  192. package/dist/github-BCDF6xVH.mjs +669 -0
  193. package/dist/github-BCDF6xVH.mjs.map +1 -0
  194. package/dist/{index-C6e-ULLx.d.mts → index-D-F_hTDz.d.cts} +39 -24
  195. package/dist/index-D-F_hTDz.d.cts.map +1 -0
  196. package/dist/{index-CR5urhWX.d.cts → index-YFNxR5Ns.d.mts} +39 -24
  197. package/dist/index-YFNxR5Ns.d.mts.map +1 -0
  198. package/dist/index.cjs +9487 -12080
  199. package/dist/index.cjs.map +1 -1
  200. package/dist/index.d.cts +1 -1
  201. package/dist/index.d.mts +1 -1
  202. package/dist/index.mjs +9420 -12026
  203. package/dist/index.mjs.map +1 -1
  204. package/dist/local-BjxDfPvy.cjs +241 -0
  205. package/dist/local-BjxDfPvy.cjs.map +1 -0
  206. package/dist/local-IuoIF3CT.mjs +224 -0
  207. package/dist/local-IuoIF3CT.mjs.map +1 -0
  208. package/dist/migrate-CGaancHY.cjs +93 -0
  209. package/dist/migrate-CGaancHY.cjs.map +1 -0
  210. package/dist/migrate-DWZz9kah.mjs +93 -0
  211. package/dist/migrate-DWZz9kah.mjs.map +1 -0
  212. package/dist/migrate-DbtcuOr_.mjs +265 -0
  213. package/dist/migrate-DbtcuOr_.mjs.map +1 -0
  214. package/dist/migrate-q2YYLJLE.cjs +270 -0
  215. package/dist/migrate-q2YYLJLE.cjs.map +1 -0
  216. package/dist/openapi.cjs +214 -10
  217. package/dist/openapi.cjs.map +1 -0
  218. package/dist/openapi.d.cts +47 -17
  219. package/dist/openapi.d.cts.map +1 -1
  220. package/dist/openapi.d.mts +47 -17
  221. package/dist/openapi.d.mts.map +1 -1
  222. package/dist/openapi.mjs +208 -5
  223. package/dist/openapi.mjs.map +1 -0
  224. package/dist/provider-C9_-45d5.cjs +56 -0
  225. package/dist/provider-C9_-45d5.cjs.map +1 -0
  226. package/dist/provider-q4lsYzYG.mjs +45 -0
  227. package/dist/provider-q4lsYzYG.mjs.map +1 -0
  228. package/dist/ready-BpNbORRB.cjs +402 -0
  229. package/dist/ready-BpNbORRB.cjs.map +1 -0
  230. package/dist/ready-b6vm0-W-.mjs +373 -0
  231. package/dist/ready-b6vm0-W-.mjs.map +1 -0
  232. package/dist/reconcile/public.cjs +3 -5
  233. package/dist/reconcile/public.d.cts +11 -87
  234. package/dist/reconcile/public.d.cts.map +1 -1
  235. package/dist/reconcile/public.d.mts +11 -87
  236. package/dist/reconcile/public.d.mts.map +1 -1
  237. package/dist/reconcile/public.mjs +3 -4
  238. package/dist/{reconcile-D0pimNiy.cjs → reconcile-CuCQBa5-.cjs} +5 -8
  239. package/dist/reconcile-CuCQBa5-.cjs.map +1 -0
  240. package/dist/{reconcile-CFs8C_1a.mjs → reconcile-Dh1Jk7WE.mjs} +4 -7
  241. package/dist/reconcile-Dh1Jk7WE.mjs.map +1 -0
  242. package/dist/resolve-Cns0v6dN.cjs +315 -0
  243. package/dist/resolve-Cns0v6dN.cjs.map +1 -0
  244. package/dist/resolve-DNg0icnh.mjs +262 -0
  245. package/dist/resolve-DNg0icnh.mjs.map +1 -0
  246. package/dist/rollback-CFrNLmxs.mjs +132 -0
  247. package/dist/rollback-CFrNLmxs.mjs.map +1 -0
  248. package/dist/rollback-UIjS25F1.cjs +161 -0
  249. package/dist/rollback-UIjS25F1.cjs.map +1 -0
  250. package/dist/rolldown-runtime-BhDjJH2R.mjs +15 -0
  251. package/dist/{chunk-CUT6urMc.cjs → rolldown-runtime-C0BPl7ul.cjs} +23 -10
  252. package/dist/runtime-CN_kmqxo.d.cts +90 -0
  253. package/dist/runtime-CN_kmqxo.d.cts.map +1 -0
  254. package/dist/runtime-Cjvon3oj.d.mts +90 -0
  255. package/dist/runtime-Cjvon3oj.d.mts.map +1 -0
  256. package/dist/sandbox/config-worker.cjs +43 -0
  257. package/dist/sandbox/config-worker.cjs.map +1 -0
  258. package/dist/sandbox/config-worker.d.cts +1 -0
  259. package/dist/sandbox/config-worker.d.mts +1 -0
  260. package/dist/sandbox/config-worker.mjs +44 -0
  261. package/dist/sandbox/config-worker.mjs.map +1 -0
  262. package/dist/sandbox/credentials-worker.cjs +54 -0
  263. package/dist/sandbox/credentials-worker.cjs.map +1 -0
  264. package/dist/sandbox/credentials-worker.d.cts +1 -0
  265. package/dist/sandbox/credentials-worker.d.mts +1 -0
  266. package/dist/sandbox/credentials-worker.mjs +55 -0
  267. package/dist/sandbox/credentials-worker.mjs.map +1 -0
  268. package/dist/sandbox/discover-worker.cjs +47 -0
  269. package/dist/sandbox/discover-worker.cjs.map +1 -0
  270. package/dist/sandbox/discover-worker.d.cts +1 -0
  271. package/dist/sandbox/discover-worker.d.mts +1 -0
  272. package/dist/sandbox/discover-worker.mjs +48 -0
  273. package/dist/sandbox/discover-worker.mjs.map +1 -0
  274. package/dist/sandbox/migrate-worker.cjs +75 -0
  275. package/dist/sandbox/migrate-worker.cjs.map +1 -0
  276. package/dist/sandbox/migrate-worker.d.cts +1 -0
  277. package/dist/sandbox/migrate-worker.d.mts +1 -0
  278. package/dist/sandbox/migrate-worker.mjs +76 -0
  279. package/dist/sandbox/migrate-worker.mjs.map +1 -0
  280. package/dist/sandbox-CL--ZDui.cjs +164 -0
  281. package/dist/sandbox-CL--ZDui.cjs.map +1 -0
  282. package/dist/sandbox-Dm247NGx.mjs +117 -0
  283. package/dist/sandbox-Dm247NGx.mjs.map +1 -0
  284. package/dist/sandbox-M8UnLhXE.d.cts +126 -0
  285. package/dist/sandbox-M8UnLhXE.d.cts.map +1 -0
  286. package/dist/sandbox-M8UnLhXE.d.mts +126 -0
  287. package/dist/sandbox-M8UnLhXE.d.mts.map +1 -0
  288. package/dist/{workspace-zoqRbihZ.mjs → schemas-BObwxB_t.cjs} +998 -1659
  289. package/dist/schemas-BObwxB_t.cjs.map +1 -0
  290. package/dist/{workspace-C6VJQVtG.cjs → schemas-D-xeKJDD.mjs} +913 -1842
  291. package/dist/schemas-D-xeKJDD.mjs.map +1 -0
  292. package/dist/secretsManager-Chs9VV2r.mjs +76 -0
  293. package/dist/secretsManager-Chs9VV2r.mjs.map +1 -0
  294. package/dist/secretsManager-DcMlHnRC.cjs +87 -0
  295. package/dist/secretsManager-DcMlHnRC.cjs.map +1 -0
  296. package/dist/seeds-CkIPFGNO.cjs +10560 -0
  297. package/dist/seeds-CkIPFGNO.cjs.map +1 -0
  298. package/dist/seeds-odfgSCmu.mjs +9538 -0
  299. package/dist/seeds-odfgSCmu.mjs.map +1 -0
  300. package/dist/sniffer-BTtX3NUM.mjs +1262 -0
  301. package/dist/sniffer-BTtX3NUM.mjs.map +1 -0
  302. package/dist/sniffer-IAQEpsQb.cjs +1333 -0
  303. package/dist/sniffer-IAQEpsQb.cjs.map +1 -0
  304. package/dist/sst-BgcOsaBi.cjs +453 -0
  305. package/dist/sst-BgcOsaBi.cjs.map +1 -0
  306. package/dist/sst-CJzvyrEz.mjs +430 -0
  307. package/dist/sst-CJzvyrEz.mjs.map +1 -0
  308. package/dist/stages-CUn6gvXL.cjs +174 -0
  309. package/dist/stages-CUn6gvXL.cjs.map +1 -0
  310. package/dist/stages-CnZRYmkI.mjs +174 -0
  311. package/dist/stages-CnZRYmkI.mjs.map +1 -0
  312. package/dist/target/public.cjs +15 -0
  313. package/dist/target/public.d.cts +28 -0
  314. package/dist/target/public.d.cts.map +1 -0
  315. package/dist/target/public.d.mts +28 -0
  316. package/dist/target/public.d.mts.map +1 -0
  317. package/dist/target/public.mjs +4 -0
  318. package/dist/terminal-D8TPK7o9.mjs +84 -0
  319. package/dist/terminal-D8TPK7o9.mjs.map +1 -0
  320. package/dist/terminal-DuapRxh6.cjs +84 -0
  321. package/dist/terminal-DuapRxh6.cjs.map +1 -0
  322. package/dist/types-NqX1Hz4P.d.cts +7454 -0
  323. package/dist/types-NqX1Hz4P.d.cts.map +1 -0
  324. package/dist/types-ZHuZ89hv.d.mts +7453 -0
  325. package/dist/types-ZHuZ89hv.d.mts.map +1 -0
  326. package/dist/utils-D2Nk1Nv2.cjs +205 -0
  327. package/dist/utils-D2Nk1Nv2.cjs.map +1 -0
  328. package/dist/utils-D_fxUqvU.mjs +156 -0
  329. package/dist/utils-D_fxUqvU.mjs.map +1 -0
  330. package/dist/vitest.cjs +65 -0
  331. package/dist/vitest.cjs.map +1 -0
  332. package/dist/vitest.d.cts +29 -0
  333. package/dist/vitest.d.cts.map +1 -0
  334. package/dist/vitest.d.mts +29 -0
  335. package/dist/vitest.d.mts.map +1 -0
  336. package/dist/vitest.mjs +65 -0
  337. package/dist/vitest.mjs.map +1 -0
  338. package/dist/workerRuntime-BXfhbe13.cjs +108 -0
  339. package/dist/workerRuntime-BXfhbe13.cjs.map +1 -0
  340. package/dist/workerRuntime-CsOyBRx2.mjs +79 -0
  341. package/dist/workerRuntime-CsOyBRx2.mjs.map +1 -0
  342. package/dist/workspace/index.cjs +8 -4
  343. package/dist/workspace/index.d.cts +3 -3
  344. package/dist/workspace/index.d.mts +3 -3
  345. package/dist/workspace/index.mjs +2 -3
  346. package/dist/workspace-CJ0lKFq-.mjs +1979 -0
  347. package/dist/workspace-CJ0lKFq-.mjs.map +1 -0
  348. package/dist/workspace-CwW3Gkru.cjs +2355 -0
  349. package/dist/workspace-CwW3Gkru.cjs.map +1 -0
  350. package/package.json +53 -22
  351. package/dist/CachedStateProvider-BLo7zv7S.cjs +0 -3
  352. package/dist/CachedStateProvider-BxoAm-B2.mjs +0 -3
  353. package/dist/CachedStateProvider-CqPdW7CB.cjs +0 -60
  354. package/dist/CachedStateProvider-CqPdW7CB.cjs.map +0 -1
  355. package/dist/CachedStateProvider-DTniehMP.mjs +0 -54
  356. package/dist/CachedStateProvider-DTniehMP.mjs.map +0 -1
  357. package/dist/HostingerProvider-Cft7lEYr.mjs.map +0 -1
  358. package/dist/HostingerProvider-h3EbEp-Z.cjs.map +0 -1
  359. package/dist/LocalStateProvider-Bn6tS-oL.mjs +0 -42
  360. package/dist/LocalStateProvider-Bn6tS-oL.mjs.map +0 -1
  361. package/dist/LocalStateProvider-Db9SEjyH.cjs +0 -43
  362. package/dist/LocalStateProvider-Db9SEjyH.cjs.map +0 -1
  363. package/dist/Route53Provider-RdpUDJQk.mjs.map +0 -1
  364. package/dist/Route53Provider-di2fMM5N.cjs.map +0 -1
  365. package/dist/SSMStateProvider-BRt2py-A.mjs +0 -66
  366. package/dist/SSMStateProvider-BRt2py-A.mjs.map +0 -1
  367. package/dist/SSMStateProvider-DyX8s9HI.cjs +0 -66
  368. package/dist/SSMStateProvider-DyX8s9HI.cjs.map +0 -1
  369. package/dist/backup-provisioner-Bgj5Vi_L.mjs.map +0 -1
  370. package/dist/backup-provisioner-BrsHwYG0.cjs.map +0 -1
  371. package/dist/bundler-BY1OmV1e.cjs.map +0 -1
  372. package/dist/bundler-Be8Zg4Wd.mjs.map +0 -1
  373. package/dist/chunk-Duj1WY3L.mjs +0 -7
  374. package/dist/config-BZ1F0WuA.cjs +0 -462
  375. package/dist/config-BZ1F0WuA.cjs.map +0 -1
  376. package/dist/config-DVVph9yz.mjs +0 -402
  377. package/dist/config-DVVph9yz.mjs.map +0 -1
  378. package/dist/config.d.cts.map +0 -1
  379. package/dist/config.d.mts.map +0 -1
  380. package/dist/credentials-B5zRHdAl.mjs +0 -141
  381. package/dist/credentials-B5zRHdAl.mjs.map +0 -1
  382. package/dist/credentials-BapzjyV5.cjs +0 -195
  383. package/dist/credentials-BapzjyV5.cjs.map +0 -1
  384. package/dist/credentials-Xamqe_NJ.cjs +0 -2681
  385. package/dist/credentials-Xamqe_NJ.cjs.map +0 -1
  386. package/dist/credentials-dP8vRVRv.mjs +0 -2549
  387. package/dist/credentials-dP8vRVRv.mjs.map +0 -1
  388. package/dist/discover-CAlFgYec.mjs +0 -229
  389. package/dist/discover-CAlFgYec.mjs.map +0 -1
  390. package/dist/discover-DTmFeloL.cjs +0 -271
  391. package/dist/discover-DTmFeloL.cjs.map +0 -1
  392. package/dist/dokploy-api-BS2xnJLZ.mjs +0 -3
  393. package/dist/dokploy-api-BsVH0y_s.cjs +0 -718
  394. package/dist/dokploy-api-BsVH0y_s.cjs.map +0 -1
  395. package/dist/dokploy-api-BuxDRo3l.cjs +0 -3
  396. package/dist/dokploy-api-aTFPz7_4.mjs +0 -706
  397. package/dist/dokploy-api-aTFPz7_4.mjs.map +0 -1
  398. package/dist/emit-CbcRolsa.cjs.map +0 -1
  399. package/dist/emit-CiZS_5Ub.mjs.map +0 -1
  400. package/dist/encryption-C6jaU0hE.cjs +0 -54
  401. package/dist/encryption-C6jaU0hE.cjs.map +0 -1
  402. package/dist/encryption-CHzzeR8a.cjs +0 -4
  403. package/dist/encryption-CQUncu7v.mjs +0 -3
  404. package/dist/encryption-D-abyhZx.mjs +0 -42
  405. package/dist/encryption-D-abyhZx.mjs.map +0 -1
  406. package/dist/fullstack-secrets-C-GGohke.cjs +0 -111
  407. package/dist/fullstack-secrets-C-GGohke.cjs.map +0 -1
  408. package/dist/fullstack-secrets-D1o9-G5l.mjs +0 -87
  409. package/dist/fullstack-secrets-D1o9-G5l.mjs.map +0 -1
  410. package/dist/generator-CNzBw7g5.cjs +0 -289
  411. package/dist/generator-CNzBw7g5.cjs.map +0 -1
  412. package/dist/generator-VE2JrFlY.mjs +0 -253
  413. package/dist/generator-VE2JrFlY.mjs.map +0 -1
  414. package/dist/index-C6e-ULLx.d.mts.map +0 -1
  415. package/dist/index-CR5urhWX.d.cts.map +0 -1
  416. package/dist/openapi-SjsgARie.cjs +0 -2075
  417. package/dist/openapi-SjsgARie.cjs.map +0 -1
  418. package/dist/openapi-Xx0A7Wg0.mjs +0 -2021
  419. package/dist/openapi-Xx0A7Wg0.mjs.map +0 -1
  420. package/dist/openapi-react-query-Byltvm_7.mjs +0 -167
  421. package/dist/openapi-react-query-Byltvm_7.mjs.map +0 -1
  422. package/dist/openapi-react-query-CmJ1xDbn.cjs +0 -173
  423. package/dist/openapi-react-query-CmJ1xDbn.cjs.map +0 -1
  424. package/dist/openapi-react-query.cjs +0 -4
  425. package/dist/openapi-react-query.d.cts +0 -11
  426. package/dist/openapi-react-query.d.cts.map +0 -1
  427. package/dist/openapi-react-query.d.mts +0 -11
  428. package/dist/openapi-react-query.d.mts.map +0 -1
  429. package/dist/openapi-react-query.mjs +0 -4
  430. package/dist/reconcile-CFs8C_1a.mjs.map +0 -1
  431. package/dist/reconcile-D0pimNiy.cjs.map +0 -1
  432. package/dist/setup-BA8ciTPU.mjs +0 -11
  433. package/dist/setup-BsZvZP6f.cjs +0 -11
  434. package/dist/setup-C8KOx8_8.mjs +0 -443
  435. package/dist/setup-C8KOx8_8.mjs.map +0 -1
  436. package/dist/setup-hC6hI86f.cjs +0 -473
  437. package/dist/setup-hC6hI86f.cjs.map +0 -1
  438. package/dist/storage-BJmzYxt8.cjs +0 -363
  439. package/dist/storage-BJmzYxt8.cjs.map +0 -1
  440. package/dist/storage-BM9hGpgv.cjs +0 -7
  441. package/dist/storage-Bi24WfoW.mjs +0 -297
  442. package/dist/storage-Bi24WfoW.mjs.map +0 -1
  443. package/dist/storage-CYlGwWTj.mjs +0 -3
  444. package/dist/sync-CmEuNZsB.mjs +0 -76
  445. package/dist/sync-CmEuNZsB.mjs.map +0 -1
  446. package/dist/sync-D306yOWu.cjs +0 -4
  447. package/dist/sync-SizaChmC.cjs +0 -93
  448. package/dist/sync-SizaChmC.cjs.map +0 -1
  449. package/dist/sync-hOqAWHR6.mjs +0 -3
  450. package/dist/types-6pkp2RRj.d.mts +0 -2220
  451. package/dist/types-6pkp2RRj.d.mts.map +0 -1
  452. package/dist/types-Y3fKQSAK.d.cts +0 -2220
  453. package/dist/types-Y3fKQSAK.d.cts.map +0 -1
  454. package/dist/workspace-BzrG_2SI.mjs +0 -8
  455. package/dist/workspace-C6VJQVtG.cjs.map +0 -1
  456. package/dist/workspace-XXtNhqJl.cjs +0 -9
  457. package/dist/workspace-zoqRbihZ.mjs.map +0 -1
@@ -0,0 +1,749 @@
1
+ const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
2
+ const require_schemas = require("./schemas-BObwxB_t.cjs");
3
+ const require_discover = require("./discover-D1It5r_h.cjs");
4
+ const require_derive = require("./derive-DAbo49sm.cjs");
5
+ const require_workspace = require("./workspace-CwW3Gkru.cjs");
6
+ const require_config = require("./config.cjs");
7
+ const require_seeds = require("./seeds-CkIPFGNO.cjs");
8
+ const require_credentialSchemas = require("./credentialSchemas-DCR4Wd1W.cjs");
9
+ const require_index = require("./index.cjs");
10
+ let _geekmidas_manifest = require("@geekmidas/manifest");
11
+ let node_net = require("node:net");
12
+ let prompts = require("prompts");
13
+ prompts = require_rolldown_runtime.__toESM(prompts, 1);
14
+ let _geekmidas_storage_s3_url = require("@geekmidas/storage/s3-url");
15
+ //#region src/secrets/stageKeys.ts
16
+ /**
17
+ * The keys a workspace's stage must be given — across every app, each once,
18
+ * with who reads it and whether the stage holds it.
19
+ *
20
+ * The keys themselves are `requiredStageKeys`'s, the list a deploy refuses a
21
+ * stage by. What this adds is the workspace: which constructs its apps read
22
+ * (`appEnvKeys`, the keys each app's environment is built from) and which of
23
+ * the keys the stage has set.
24
+ */
25
+ /** The keys of each kind of construct an app reads, that the stage supplies. */
26
+ function keysOf(id, kind) {
27
+ switch (kind) {
28
+ case "email": return [(0, _geekmidas_manifest.provideKey)(id, "url"), (0, _geekmidas_manifest.provideKey)(id, "from")];
29
+ case "objects":
30
+ case "file-server": return [(0, _geekmidas_manifest.provideKey)(id, "url")];
31
+ case "external-api":
32
+ case "credential": return [(0, _geekmidas_manifest.provideKey)(id, "credentials")];
33
+ default: return [];
34
+ }
35
+ }
36
+ /**
37
+ * Every key the stage must be given for the constructs its apps read — a
38
+ * file server's whenever its bucket is read, since its client reads both —
39
+ * and every file server's bucket, which serves it whether or not an app
40
+ * reads it directly.
41
+ */
42
+ function workspaceStageKeys(input) {
43
+ const { manifest } = input;
44
+ const reads = /* @__PURE__ */ new Map();
45
+ for (const [id, declaration] of Object.entries(manifest)) {
46
+ const { kind } = declaration;
47
+ if (kind !== "rest-api" && kind !== "site" && kind !== "mobile-app") continue;
48
+ const name = require_derive.appKey(id);
49
+ const keys = require_seeds.appEnvKeys(manifest, name, input.runnables);
50
+ if (keys) reads.set(name, keys);
51
+ }
52
+ const readers = (id, kind) => {
53
+ const keys = keysOf(id, kind);
54
+ return [...reads].filter(([, env]) => keys.some((key) => env.has(key))).map(([app]) => app).sort();
55
+ };
56
+ const services = [];
57
+ const credentials = [];
58
+ const buckets = /* @__PURE__ */ new Set();
59
+ for (const [id, declaration] of Object.entries(manifest)) {
60
+ const { kind } = declaration;
61
+ const apps = declaration.kind === "file-server" && declaration.of ? [.../* @__PURE__ */ new Set([...readers(id, kind), ...readers(declaration.of, "objects")])].sort() : readers(id, kind);
62
+ if (kind === "external-api" || kind === "credential") {
63
+ if (apps.length > 0) credentials.push({
64
+ id,
65
+ kind,
66
+ apps
67
+ });
68
+ continue;
69
+ }
70
+ if (kind !== "email" && kind !== "objects" && kind !== "file-server") continue;
71
+ if (apps.length === 0) continue;
72
+ const of = declaration.kind === "file-server" ? declaration.of : void 0;
73
+ services.push({
74
+ id,
75
+ kind,
76
+ ...of ? { of } : {},
77
+ apps
78
+ });
79
+ if (of) buckets.add(of);
80
+ }
81
+ for (const of of buckets) {
82
+ if (services.some((s) => s.id === of)) continue;
83
+ if (manifest[of]?.kind !== "objects") continue;
84
+ services.push({
85
+ id: of,
86
+ kind: "objects",
87
+ apps: readers(of, "objects")
88
+ });
89
+ }
90
+ return require_seeds.requiredStageKeys({
91
+ local: input.local,
92
+ services,
93
+ credentials,
94
+ ...input.domain ? { domain: input.domain } : {},
95
+ ...input.providers ? { providers: input.providers } : {},
96
+ ...input.server ? { server: true } : {}
97
+ }).map((key) => ({
98
+ ...key,
99
+ set: input.supplied[key.key] !== void 0
100
+ }));
101
+ }
102
+ //#endregion
103
+ //#region src/secrets/add.ts
104
+ /**
105
+ * `gkm secrets:add --stage <stage>` — the secrets a stage must be given,
106
+ * built key by key.
107
+ *
108
+ * It offers exactly the keys a deploy would refuse the stage without
109
+ * (`requiredStageKeys`), across every app in the workspace, each once: the
110
+ * stage's buckets, mail and file servers where it is deployed, and every
111
+ * third party's credentials. A key is built by what it is — a bucket from its
112
+ * provider, mail from its SMTP server, credentials field by field from their
113
+ * construct's schema — checked, and saved through the stage's own store, the
114
+ * one `gkm secrets:set` writes. No value is ever printed.
115
+ *
116
+ * The keys are walked one at a time — unset ones first — and each is a
117
+ * checkpoint: set it now, skip it, or stop here. A key is saved the moment it
118
+ * is built, so stopping, Ctrl-C or a failure keeps every key before it, and
119
+ * running the command again picks up what is still missing. A key a provider
120
+ * on the stage creates (a bucket under `deploy.objects.<stage>`, written by
121
+ * `gkm setup`) is not a checkpoint: it is listed, with what creates it.
122
+ *
123
+ * `--json` asks nothing: it prints the keys, for a script or an agent to set
124
+ * with `gkm secrets:set`.
125
+ */
126
+ /** `gkm secrets:add` with nobody at a terminal to answer it. */
127
+ var SecretsAddNeedsTerminal = class extends Error {
128
+ stage;
129
+ constructor(stage) {
130
+ 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}.`);
131
+ this.stage = stage;
132
+ this.name = "SecretsAddNeedsTerminal";
133
+ }
134
+ };
135
+ /**
136
+ * The person stopped the builder at a prompt (Ctrl-C). Every key saved
137
+ * before it is kept; the run ends with what was saved and what is missing.
138
+ */
139
+ var SecretsAddCancelled = class extends Error {
140
+ stage;
141
+ constructor(stage) {
142
+ super(`Stopped. Every key saved to the stage '${stage}' before it is kept.`);
143
+ this.stage = stage;
144
+ this.name = "SecretsAddCancelled";
145
+ }
146
+ };
147
+ const defaultIo = () => ({
148
+ log: (line) => console.log(line),
149
+ write: (chunk) => {
150
+ process.stdout.write(chunk);
151
+ },
152
+ interactive: process.stdin.isTTY === true && process.stdout.isTTY === true
153
+ });
154
+ /** `gkm secrets:add`. */
155
+ async function secretsAddCommand(options, io = defaultIo()) {
156
+ const { stage } = options;
157
+ const workspace = await require_config.loadWorkspaceSettings(options.cwd ?? process.cwd());
158
+ const local = stage === workspace.stages.local;
159
+ if (!local) require_workspace.assertDeployedStage(workspace.stages, stage);
160
+ const patterns = require_seeds.constructGlobs(workspace);
161
+ const runnables = {};
162
+ const manifest = await require_discover.discover({
163
+ patterns,
164
+ cwd: workspace.root,
165
+ runnables
166
+ });
167
+ const store = await require_seeds.secretsStoreFor(workspace, stage, { ...options.home ? { home: options.home } : {} });
168
+ const stored = await store.read(stage);
169
+ const domain = workspace.domains?.[stage];
170
+ const all = workspaceStageKeys({
171
+ manifest,
172
+ runnables,
173
+ local,
174
+ supplied: stored?.custom ?? {},
175
+ ...domain ? { domain } : {},
176
+ providers: require_seeds.stageProviderNotes(workspace, stage),
177
+ ...!local && domain && require_index.deploysWithCompose(workspace) ? { server: true } : {}
178
+ });
179
+ const scope = [...all.filter((k) => !k.set), ...all.filter((k) => k.set)];
180
+ const keys = options.missing ? scope.filter((k) => !k.set) : scope;
181
+ const objects = require_workspace.stageProvider(workspace, "objects", stage);
182
+ const provisioned = (k) => objects.mode === "provider" && k.hint !== void 0 && (k.kind === "bucket" || k.kind === "file-server");
183
+ if (options.json) {
184
+ const listed = keys.map((k) => ({
185
+ key: k.key,
186
+ kind: k.kind,
187
+ construct: k.id,
188
+ apps: [...k.apps ?? []],
189
+ set: k.set,
190
+ ...provisioned(k) ? { provisioned: true } : {}
191
+ }));
192
+ io.write(`${JSON.stringify(listed, null, 2)}\n`);
193
+ return {
194
+ keys,
195
+ saved: [],
196
+ skipped: [],
197
+ missing: []
198
+ };
199
+ }
200
+ if (!io.interactive) throw new SecretsAddNeedsTerminal(stage);
201
+ const offered = keys.filter((k) => !provisioned(k));
202
+ const created = keys.filter(provisioned);
203
+ if (created.length > 0 && objects.mode === "provider") {
204
+ io.log("Not offered — a provider on the stage creates them:");
205
+ for (const k of created) io.log(` ${k.key} — created by ${require_seeds.provisionCommand(stage)} (deploy.objects.${stage} is ${objects.name})`);
206
+ }
207
+ if (offered.length === 0) {
208
+ 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.`);
209
+ return {
210
+ keys: offered,
211
+ saved: [],
212
+ skipped: [],
213
+ missing: []
214
+ };
215
+ }
216
+ const ask = asker(stage);
217
+ let current = stored ?? require_seeds.initStageSecrets(stage);
218
+ const saved = [];
219
+ const skipped = [];
220
+ const has = (key) => current.custom?.[key] !== void 0;
221
+ let schemas;
222
+ const save = async (values) => {
223
+ current = {
224
+ ...current,
225
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
226
+ custom: {
227
+ ...current.custom,
228
+ ...values
229
+ }
230
+ };
231
+ await store.write(stage, current);
232
+ saved.push(...Object.keys(values));
233
+ io.log(` ✓ Saved ${Object.keys(values).join(", ")}.`);
234
+ };
235
+ const walk = async () => {
236
+ for (const [index, entry] of offered.entries()) {
237
+ io.log(`\n[${index + 1}/${offered.length}] ${entry.key} — ${entry.what}`);
238
+ if (entry.hint) io.log(` ${entry.hint}`);
239
+ const step = await ask({
240
+ type: "select",
241
+ message: `${entry.key} ${KIND_LABEL[entry.kind]} '${entry.id}'${entry.apps?.length ? ` · ${entry.apps.join(", ")}` : ""}${entry.set ? " · set" : ""}`,
242
+ choices: [
243
+ {
244
+ title: "Set it now",
245
+ value: "set"
246
+ },
247
+ {
248
+ title: "Skip",
249
+ value: "skip"
250
+ },
251
+ {
252
+ title: "Stop here",
253
+ value: "stop"
254
+ }
255
+ ],
256
+ initial: 0
257
+ });
258
+ if (step === "stop") return;
259
+ if (step !== "set") {
260
+ skipped.push(entry.key);
261
+ continue;
262
+ }
263
+ if (entry.set) {
264
+ if (!await ask({
265
+ type: "confirm",
266
+ message: `${entry.key} is set. Replace it?`,
267
+ initial: false
268
+ })) {
269
+ skipped.push(entry.key);
270
+ continue;
271
+ }
272
+ }
273
+ switch (entry.kind) {
274
+ case "bucket":
275
+ await save(await buildBucket(ask, io, entry, has));
276
+ break;
277
+ case "email":
278
+ await save({ [entry.key]: entry.key.endsWith("_FROM") ? await askFrom(ask, io) : await buildSmtpUrl(ask, io) });
279
+ break;
280
+ case "file-server":
281
+ await save({ [entry.key]: await askHttpUrl(ask, io, "Its public URL") });
282
+ break;
283
+ case "server":
284
+ await save(await buildServer(ask, io, has));
285
+ break;
286
+ case "external-api":
287
+ case "credential":
288
+ schemas ??= await require_credentialSchemas.loadCredentialSchemas({
289
+ root: workspace.root,
290
+ patterns
291
+ });
292
+ await save({ [entry.key]: await buildCredentials(ask, io, entry, schemas) });
293
+ }
294
+ }
295
+ };
296
+ try {
297
+ await walk();
298
+ } catch (error) {
299
+ if (!(error instanceof SecretsAddCancelled)) throw error;
300
+ io.log(`\n${error.message}`);
301
+ }
302
+ const missing = all.filter((k) => !provisioned(k) && !has(k.key)).map((k) => k.key);
303
+ io.log("");
304
+ io.log(saved.length > 0 ? `✓ Saved to the stage '${stage}' (${store.name} store): ${saved.join(", ")}` : "Nothing was saved.");
305
+ if (skipped.length > 0) io.log(` Skipped: ${skipped.join(", ")}`);
306
+ if (missing.length > 0) {
307
+ io.log(` Still missing: ${missing.join(", ")}`);
308
+ io.log(` Run gkm secrets:add --stage ${stage} --missing again to pick up where this left off.`);
309
+ }
310
+ return {
311
+ keys: offered,
312
+ saved,
313
+ skipped,
314
+ missing
315
+ };
316
+ }
317
+ const KIND_LABEL = {
318
+ bucket: "bucket",
319
+ email: "email",
320
+ "file-server": "file server",
321
+ "external-api": "external API",
322
+ credential: "credential",
323
+ server: "server address"
324
+ };
325
+ /** The server's IPv4 address, and — if it has one — its IPv6 address. */
326
+ async function buildServer(ask, io, has) {
327
+ const ipv4 = text(await askUntil(ask, io, {
328
+ type: "text",
329
+ message: "The server's public IPv4 address"
330
+ }, (value) => (0, node_net.isIPv4)(text(value)) ? void 0 : "An IPv4 address is required, e.g. 203.0.113.10."));
331
+ const values = { [require_workspace.SERVER_IPV4_KEY]: ipv4 };
332
+ if (has("GKM_SERVER_IPV6")) return values;
333
+ const ipv6 = text(await askUntil(ask, io, {
334
+ type: "text",
335
+ message: "Its public IPv6 address (empty for none — no AAAA records)"
336
+ }, (value) => !text(value) || (0, node_net.isIPv6)(text(value)) ? void 0 : "An IPv6 address, e.g. 2001:db8::10, or nothing."));
337
+ if (ipv6) values[require_workspace.SERVER_IPV6_KEY] = ipv6;
338
+ return values;
339
+ }
340
+ function asker(stage) {
341
+ return async (question) => {
342
+ return (await (0, prompts.default)({
343
+ ...question,
344
+ name: "value"
345
+ }, { onCancel: () => {
346
+ throw new SecretsAddCancelled(stage);
347
+ } })).value;
348
+ };
349
+ }
350
+ /** Ask until `accept` takes the answer; `accept` returns why it did not. */
351
+ async function askUntil(ask, io, question, accept) {
352
+ for (;;) {
353
+ const value = await ask(question);
354
+ const problem = accept(value);
355
+ if (!problem) return value;
356
+ io.log(` ✗ ${problem}`);
357
+ }
358
+ }
359
+ const required = (what) => (value) => value?.trim() ? void 0 : `${what} is required.`;
360
+ const text = (value) => String(value ?? "").trim();
361
+ /** An `http(s)://` URL. */
362
+ const HttpUrl = require_schemas.url({ protocol: /^https?$/ });
363
+ async function askHttpUrl(ask, io, message) {
364
+ return text(await askUntil(ask, io, {
365
+ type: "text",
366
+ message
367
+ }, (value) => HttpUrl.safeParse(text(value)).success ? void 0 : "An http:// or https:// URL is required."));
368
+ }
369
+ async function askFrom(ask, io) {
370
+ return text(await askUntil(ask, io, {
371
+ type: "text",
372
+ message: "The address it sends from"
373
+ }, (value) => require_schemas.email().safeParse(text(value)).success ? void 0 : "An email address is required, e.g. noreply@example.com."));
374
+ }
375
+ /**
376
+ * An SMTP server as the URL `@geekmidas/emailkit` reads: `smtp://` for
377
+ * STARTTLS, `smtps://` for TLS from the first byte, with the user and
378
+ * password percent-encoded.
379
+ *
380
+ * A known service fills in its own host, port and user; each from its docs:
381
+ * - Resend: smtp.resend.com, 465 implicit TLS, user `resend`, password the
382
+ * API key — https://resend.com/docs/send-with-smtp
383
+ * - Amazon SES: email-smtp.<region>.amazonaws.com, 587 STARTTLS, SMTP
384
+ * credentials — https://docs.aws.amazon.com/ses/latest/dg/smtp-connect.html,
385
+ * https://docs.aws.amazon.com/general/latest/gr/ses.html
386
+ * - Postmark: smtp.postmarkapp.com, 587 STARTTLS, the server API token as
387
+ * user and password —
388
+ * https://postmarkapp.com/developer/user-guide/send-email-with-smtp
389
+ * - Mailgun: smtp.mailgun.org (EU: smtp.eu.mailgun.org), 587 STARTTLS, the
390
+ * domain's SMTP credentials —
391
+ * https://documentation.mailgun.com/docs/mailgun/user-manual/sending-messages/send-smtp,
392
+ * https://documentation.mailgun.com/docs/mailgun/api-reference/api-overview
393
+ */
394
+ async function buildSmtpUrl(ask, io) {
395
+ const service = await ask({
396
+ type: "select",
397
+ message: "Which mail service?",
398
+ choices: [
399
+ {
400
+ title: "Resend",
401
+ value: "resend"
402
+ },
403
+ {
404
+ title: "Amazon SES",
405
+ value: "ses"
406
+ },
407
+ {
408
+ title: "Postmark",
409
+ value: "postmark"
410
+ },
411
+ {
412
+ title: "Mailgun",
413
+ value: "mailgun"
414
+ },
415
+ {
416
+ title: "Other SMTP server",
417
+ value: "other"
418
+ }
419
+ ],
420
+ initial: 0
421
+ });
422
+ const secret = async (message, what) => text(await askUntil(ask, io, {
423
+ type: "password",
424
+ message
425
+ }, required(what)));
426
+ const login = async (message, what) => text(await askUntil(ask, io, {
427
+ type: "text",
428
+ message
429
+ }, required(what)));
430
+ switch (service) {
431
+ case "resend": return smtpUrl({
432
+ tls: "tls",
433
+ host: "smtp.resend.com",
434
+ port: 465,
435
+ user: "resend",
436
+ password: await secret("API key (re_…)", "The API key")
437
+ });
438
+ case "ses": return smtpUrl({
439
+ tls: "starttls",
440
+ host: `email-smtp.${await login("Region", "The region")}.amazonaws.com`,
441
+ port: 587,
442
+ user: await login("SMTP user name", "The SMTP user name"),
443
+ password: await secret("SMTP password", "The SMTP password")
444
+ });
445
+ case "postmark": {
446
+ const token = await secret("Server API token", "The server API token");
447
+ return smtpUrl({
448
+ tls: "starttls",
449
+ host: "smtp.postmarkapp.com",
450
+ port: 587,
451
+ user: token,
452
+ password: token
453
+ });
454
+ }
455
+ case "mailgun": return smtpUrl({
456
+ tls: "starttls",
457
+ host: await ask({
458
+ type: "select",
459
+ message: "Region",
460
+ choices: [{
461
+ title: "US (smtp.mailgun.org)",
462
+ value: "us"
463
+ }, {
464
+ title: "EU (smtp.eu.mailgun.org)",
465
+ value: "eu"
466
+ }],
467
+ initial: 0
468
+ }) === "eu" ? "smtp.eu.mailgun.org" : "smtp.mailgun.org",
469
+ port: 587,
470
+ user: await login("SMTP login (e.g. postmaster@mg.example.com)", "The SMTP login"),
471
+ password: await secret("SMTP password", "The SMTP password")
472
+ });
473
+ }
474
+ const host = text(await askUntil(ask, io, {
475
+ type: "text",
476
+ message: "SMTP host"
477
+ }, required("The host")));
478
+ const port = await askUntil(ask, io, {
479
+ type: "text",
480
+ message: "Port",
481
+ initial: "587"
482
+ }, (value) => {
483
+ const n = Number(value);
484
+ return Number.isInteger(n) && n > 0 && n < 65536 ? void 0 : "A port number is required.";
485
+ });
486
+ const user = text(await ask({
487
+ type: "text",
488
+ message: "User (empty for none)"
489
+ }));
490
+ const password = user ? await ask({
491
+ type: "password",
492
+ message: "Password"
493
+ }) : "";
494
+ return smtpUrl({
495
+ tls: await ask({
496
+ type: "select",
497
+ message: "TLS",
498
+ choices: [{
499
+ title: "STARTTLS (smtp://, usually port 587)",
500
+ value: "starttls"
501
+ }, {
502
+ title: "TLS on connect (smtps://, usually port 465)",
503
+ value: "tls"
504
+ }],
505
+ initial: 0
506
+ }),
507
+ host,
508
+ port: Number(port),
509
+ user,
510
+ password
511
+ });
512
+ }
513
+ function smtpUrl(server) {
514
+ const url = new URL(`${server.tls === "tls" ? "smtps" : "smtp"}://${server.host}`);
515
+ url.port = String(server.port);
516
+ if (server.user) {
517
+ url.username = encodeURIComponent(server.user);
518
+ url.password = encodeURIComponent(server.password ?? "");
519
+ }
520
+ return url.toString().replace(/\/$/, "");
521
+ }
522
+ /**
523
+ * A bucket's URL, from its provider — and, optionally, a key for it alone in
524
+ * the URL, or the stage's shared pair. Credentials are never required: without
525
+ * them the SDK's own chain signs, a role included.
526
+ */
527
+ async function buildBucket(ask, io, entry, has) {
528
+ const provider = await ask({
529
+ type: "select",
530
+ message: "Where is the bucket?",
531
+ choices: [
532
+ {
533
+ title: "AWS S3",
534
+ value: "s3"
535
+ },
536
+ {
537
+ title: "Cloudflare R2",
538
+ value: "r2"
539
+ },
540
+ {
541
+ title: "MinIO, or another S3-compatible store",
542
+ value: "compatible"
543
+ },
544
+ {
545
+ title: "Paste an s3:// URL",
546
+ value: "url"
547
+ }
548
+ ],
549
+ initial: 0
550
+ });
551
+ const bucketName = async () => text(await askUntil(ask, io, {
552
+ type: "text",
553
+ message: "Bucket name"
554
+ }, required("The bucket name")));
555
+ let address;
556
+ switch (provider) {
557
+ case "s3":
558
+ address = {
559
+ bucket: await bucketName(),
560
+ region: text(await askUntil(ask, io, {
561
+ type: "text",
562
+ message: "Region",
563
+ initial: "eu-west-1"
564
+ }, required("The region")))
565
+ };
566
+ break;
567
+ case "r2": {
568
+ const account = text(await askUntil(ask, io, {
569
+ type: "text",
570
+ message: "Cloudflare account id, or the R2 endpoint URL"
571
+ }, required("The account id or endpoint")));
572
+ address = {
573
+ bucket: await bucketName(),
574
+ region: "auto",
575
+ endpoint: /^https?:\/\//.test(account) ? account : `https://${account}.r2.cloudflarestorage.com`
576
+ };
577
+ break;
578
+ }
579
+ case "compatible": {
580
+ const endpoint = await askHttpUrl(ask, io, "Endpoint URL");
581
+ const bucket = await bucketName();
582
+ const region = text(await ask({
583
+ type: "text",
584
+ message: "Region",
585
+ initial: "us-east-1"
586
+ }));
587
+ const forcePathStyle = await ask({
588
+ type: "confirm",
589
+ message: "Path-style addressing? (MinIO needs it)",
590
+ initial: true
591
+ });
592
+ address = {
593
+ bucket,
594
+ ...region ? { region } : {},
595
+ endpoint,
596
+ ...forcePathStyle ? { forcePathStyle } : {}
597
+ };
598
+ break;
599
+ }
600
+ case "url": {
601
+ const pasted = await askUntil(ask, io, {
602
+ type: "password",
603
+ message: "The s3:// URL"
604
+ }, (value) => {
605
+ try {
606
+ (0, _geekmidas_storage_s3_url.parse)(text(value));
607
+ return;
608
+ } catch (error) {
609
+ return `Not an s3:// URL the storage client can read (${error.name}).`;
610
+ }
611
+ });
612
+ address = (0, _geekmidas_storage_s3_url.parse)(text(pasted));
613
+ break;
614
+ }
615
+ }
616
+ if (!address.accessKeyId) {
617
+ if (await ask({
618
+ type: "confirm",
619
+ message: `A key for '${entry.id}' alone, in its URL? (optional)`,
620
+ initial: false
621
+ })) {
622
+ const accessKeyId = text(await askUntil(ask, io, {
623
+ type: "text",
624
+ message: "Access key id"
625
+ }, required("The access key id")));
626
+ const secretAccessKey = await askUntil(ask, io, {
627
+ type: "password",
628
+ message: "Secret access key"
629
+ }, required("The secret access key"));
630
+ address = {
631
+ ...address,
632
+ accessKeyId,
633
+ secretAccessKey
634
+ };
635
+ }
636
+ }
637
+ const values = { [entry.key]: (0, _geekmidas_storage_s3_url.build)(address) };
638
+ if (!address.accessKeyId && !has("AWS_ACCESS_KEY_ID")) {
639
+ if (await ask({
640
+ type: "confirm",
641
+ message: "Set the stage's shared AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY? (optional: without them a role signs)",
642
+ initial: false
643
+ })) {
644
+ values.AWS_ACCESS_KEY_ID = text(await askUntil(ask, io, {
645
+ type: "text",
646
+ message: "AWS_ACCESS_KEY_ID"
647
+ }, required("The access key id")));
648
+ values.AWS_SECRET_ACCESS_KEY = await askUntil(ask, io, {
649
+ type: "password",
650
+ message: "AWS_SECRET_ACCESS_KEY"
651
+ }, required("The secret access key"));
652
+ }
653
+ }
654
+ return values;
655
+ }
656
+ /** A field whose name says it is a secret, asked for without echo. */
657
+ const SECRET_FIELD = /secret|key|token|password/i;
658
+ /** The properties of an object schema, or nothing for any other shape. */
659
+ function objectProperties(info) {
660
+ const schema = info?.jsonSchema;
661
+ if (!schema || schema.type !== "object") return void 0;
662
+ const properties = schema.properties;
663
+ if (!properties || typeof properties !== "object") return void 0;
664
+ return {
665
+ properties,
666
+ required: Array.isArray(schema.required) ? schema.required : []
667
+ };
668
+ }
669
+ function typesOf(property) {
670
+ if (Array.isArray(property.type)) return property.type;
671
+ return property.type ? [property.type] : [];
672
+ }
673
+ /**
674
+ * Credentials, field by field where the construct's schema is an object it
675
+ * can describe, and as JSON otherwise — checked against the schema itself
676
+ * before anything is kept, and asked again, with each issue's path, until
677
+ * the schema takes it.
678
+ */
679
+ async function buildCredentials(ask, io, entry, schemas) {
680
+ const info = schemas.schemas.find((s) => s.key === entry.key);
681
+ const shape = objectProperties(info);
682
+ if (!info) io.log(` '${entry.id}' exposes no schema to check against; the value is stored as given.`);
683
+ for (;;) {
684
+ const raw = shape ? JSON.stringify(await askFields(ask, io, shape)) : text(await ask({
685
+ type: "password",
686
+ message: "The value, as JSON (or one opaque string)"
687
+ }));
688
+ const check = await schemas.check(entry.key, raw);
689
+ if (check.ok) return raw;
690
+ io.log(` ✗ The schema of '${entry.id}' refuses it:`);
691
+ for (const issue of check.issues) io.log(` ${require_credentialSchemas.issueLine(entry.key, issue)}`);
692
+ io.log(" Again:");
693
+ }
694
+ }
695
+ async function askFields(ask, io, shape) {
696
+ const value = {};
697
+ for (const [name, property] of Object.entries(shape.properties)) {
698
+ const optional = !shape.required.includes(name);
699
+ const label = `${name}${optional ? " (optional)" : ""}${property.description ? ` — ${property.description}` : ""}`;
700
+ const types = typesOf(property);
701
+ if (property.enum?.length) {
702
+ const choices = property.enum.map((option) => ({
703
+ title: String(option),
704
+ value: option
705
+ }));
706
+ const picked = await ask({
707
+ type: "select",
708
+ message: label,
709
+ choices: optional ? [{
710
+ title: "(none)",
711
+ value: void 0
712
+ }, ...choices] : choices
713
+ });
714
+ if (picked !== void 0) value[name] = picked;
715
+ continue;
716
+ }
717
+ if (types.includes("boolean")) {
718
+ value[name] = await ask({
719
+ type: "confirm",
720
+ message: label,
721
+ initial: false
722
+ });
723
+ continue;
724
+ }
725
+ const numeric = types.includes("number") || types.includes("integer");
726
+ const plain = types.length === 0 || types.includes("string");
727
+ const answer = await askUntil(ask, io, {
728
+ type: SECRET_FIELD.test(name) ? "password" : "text",
729
+ message: label
730
+ }, (given) => {
731
+ const typed = text(given);
732
+ if (!typed) return optional ? void 0 : `${name} is required.`;
733
+ if (numeric && !plain && Number.isNaN(Number(typed))) return `${name} is a number.`;
734
+ if (!numeric && !plain) try {
735
+ JSON.parse(typed);
736
+ } catch {
737
+ return `${name} is JSON (${types.join(" or ")}).`;
738
+ }
739
+ });
740
+ const typed = text(answer);
741
+ if (!typed) continue;
742
+ value[name] = plain ? typed : numeric ? Number(typed) : JSON.parse(typed);
743
+ }
744
+ return value;
745
+ }
746
+ //#endregion
747
+ exports.secretsAddCommand = secretsAddCommand;
748
+
749
+ //# sourceMappingURL=add-DmmBDV2e.cjs.map