@geekmidas/cli 10.0.0-alpha.14 → 10.0.0-alpha.141

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 (424) hide show
  1. package/README.md +313 -380
  2. package/bin/adjacent-tsconfig.mjs +46 -8
  3. package/bin/gkm.mjs +11 -3
  4. package/bin/owning-tsconfig-jsx-register.mjs +18 -0
  5. package/bin/owning-tsconfig-jsx.mjs +108 -0
  6. package/dist/EndpointGenerator-BMRL04ic.mjs +1037 -0
  7. package/dist/EndpointGenerator-BMRL04ic.mjs.map +1 -0
  8. package/dist/EndpointGenerator-ePscnbwB.cjs +1096 -0
  9. package/dist/EndpointGenerator-ePscnbwB.cjs.map +1 -0
  10. package/dist/GoDaddyProvider-DxFAueU4.mjs +413 -0
  11. package/dist/GoDaddyProvider-DxFAueU4.mjs.map +1 -0
  12. package/dist/GoDaddyProvider-hAc0q5s-.cjs +413 -0
  13. package/dist/GoDaddyProvider-hAc0q5s-.cjs.map +1 -0
  14. package/dist/{HostingerProvider-BY26bWwB.mjs → HostingerProvider-CgMuKgO_.mjs} +23 -9
  15. package/dist/HostingerProvider-CgMuKgO_.mjs.map +1 -0
  16. package/dist/{HostingerProvider-BZFGYYVA.cjs → HostingerProvider-DEqpvoiD.cjs} +23 -9
  17. package/dist/HostingerProvider-DEqpvoiD.cjs.map +1 -0
  18. package/dist/LegacyStateStore-BPY8Acgs.mjs +124 -0
  19. package/dist/LegacyStateStore-BPY8Acgs.mjs.map +1 -0
  20. package/dist/LegacyStateStore-BqSVgWi1.cjs +124 -0
  21. package/dist/LegacyStateStore-BqSVgWi1.cjs.map +1 -0
  22. package/dist/LocalStateStore-5pVR26KA.mjs +167 -0
  23. package/dist/LocalStateStore-5pVR26KA.mjs.map +1 -0
  24. package/dist/LocalStateStore-Df4RyGi2.cjs +178 -0
  25. package/dist/LocalStateStore-Df4RyGi2.cjs.map +1 -0
  26. package/dist/OpenApiTsGenerator-B-PQLx8X.mjs +534 -0
  27. package/dist/OpenApiTsGenerator-B-PQLx8X.mjs.map +1 -0
  28. package/dist/OpenApiTsGenerator-BvacdbiG.cjs +539 -0
  29. package/dist/OpenApiTsGenerator-BvacdbiG.cjs.map +1 -0
  30. package/dist/{Route53Provider-Cvj40A8I.mjs → Route53Provider-Di_SD9CF.mjs} +3 -3
  31. package/dist/Route53Provider-Di_SD9CF.mjs.map +1 -0
  32. package/dist/{Route53Provider-DVILBsvV.cjs → Route53Provider-emLuQHVw.cjs} +3 -3
  33. package/dist/Route53Provider-emLuQHVw.cjs.map +1 -0
  34. package/dist/S3StateStore-Do1DwEMX.mjs +223 -0
  35. package/dist/S3StateStore-Do1DwEMX.mjs.map +1 -0
  36. package/dist/S3StateStore-uykstvZI.cjs +222 -0
  37. package/dist/S3StateStore-uykstvZI.cjs.map +1 -0
  38. package/dist/SSMStateStore-DQXFWqkE.cjs +204 -0
  39. package/dist/SSMStateStore-DQXFWqkE.cjs.map +1 -0
  40. package/dist/SSMStateStore-xQ-Ce91W.mjs +205 -0
  41. package/dist/SSMStateStore-xQ-Ce91W.mjs.map +1 -0
  42. package/dist/SubscriberGenerator-DLPH-ynS.mjs +783 -0
  43. package/dist/SubscriberGenerator-DLPH-ynS.mjs.map +1 -0
  44. package/dist/SubscriberGenerator-DR4Y7ihK.cjs +848 -0
  45. package/dist/SubscriberGenerator-DR4Y7ihK.cjs.map +1 -0
  46. package/dist/add-DLkN488n.mjs +711 -0
  47. package/dist/add-DLkN488n.mjs.map +1 -0
  48. package/dist/add-Y_nPkjIf.cjs +713 -0
  49. package/dist/add-Y_nPkjIf.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-DIVCbfee.mjs → backup-provisioner-C8DnCmxK.mjs} +2 -2
  63. package/dist/backup-provisioner-C8DnCmxK.mjs.map +1 -0
  64. package/dist/{backup-provisioner-BmhIO_Yr.cjs → backup-provisioner-oDEsPj02.cjs} +2 -2
  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-BeNDZdHQ.cjs → bundler-COOvv27I.cjs} +59 -14
  75. package/dist/bundler-COOvv27I.cjs.map +1 -0
  76. package/dist/{bundler-BodTL4kf.mjs → bundler-DFyrGST-.mjs} +59 -14
  77. package/dist/bundler-DFyrGST-.mjs.map +1 -0
  78. package/dist/cli-DKsV-Myw.cjs +71 -0
  79. package/dist/cli-DKsV-Myw.cjs.map +1 -0
  80. package/dist/cli-iAX4BQ3t.mjs +71 -0
  81. package/dist/cli-iAX4BQ3t.mjs.map +1 -0
  82. package/dist/compose-CGXx22Wy.cjs +4416 -0
  83. package/dist/compose-CGXx22Wy.cjs.map +1 -0
  84. package/dist/compose-ofZIpp2q.mjs +4273 -0
  85. package/dist/compose-ofZIpp2q.mjs.map +1 -0
  86. package/dist/config-BbivVpq0.d.mts +268 -0
  87. package/dist/config-BbivVpq0.d.mts.map +1 -0
  88. package/dist/config-BcL1Fojs.d.cts +268 -0
  89. package/dist/config-BcL1Fojs.d.cts.map +1 -0
  90. package/dist/config.cjs +420 -9
  91. package/dist/config.cjs.map +1 -0
  92. package/dist/config.d.cts +4 -117
  93. package/dist/config.d.mts +4 -117
  94. package/dist/config.mjs +406 -3
  95. package/dist/config.mjs.map +1 -0
  96. package/dist/credentialSchemas-DUCSYl9a.mjs +237 -0
  97. package/dist/credentialSchemas-DUCSYl9a.mjs.map +1 -0
  98. package/dist/credentialSchemas-DZ2Nh5li.cjs +272 -0
  99. package/dist/credentialSchemas-DZ2Nh5li.cjs.map +1 -0
  100. package/dist/credentials-D7XJypNd.cjs +520 -0
  101. package/dist/credentials-D7XJypNd.cjs.map +1 -0
  102. package/dist/credentials-DpfnUvIR.mjs +395 -0
  103. package/dist/credentials-DpfnUvIR.mjs.map +1 -0
  104. package/dist/databases-Db48ZIXL.mjs +588 -0
  105. package/dist/databases-Db48ZIXL.mjs.map +1 -0
  106. package/dist/databases-P824RTnx.cjs +703 -0
  107. package/dist/databases-P824RTnx.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 +211 -0
  113. package/dist/deploy/public.cjs.map +1 -0
  114. package/dist/deploy/public.d.cts +647 -0
  115. package/dist/deploy/public.d.cts.map +1 -0
  116. package/dist/deploy/public.d.mts +647 -0
  117. package/dist/deploy/public.d.mts.map +1 -0
  118. package/dist/deploy/public.mjs +144 -0
  119. package/dist/deploy/public.mjs.map +1 -0
  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 +1 -1
  127. package/dist/deploy/sniffer-hooks.mjs +1 -1
  128. package/dist/deploy/sniffer-loader.cjs +2 -2
  129. package/dist/deploy/sniffer-loader.mjs +1 -1
  130. package/dist/deploy/sniffer-routes-worker.cjs +2 -2
  131. package/dist/deploy/sniffer-routes-worker.mjs +1 -1
  132. package/dist/deploy-BibGpDAz.cjs +3891 -0
  133. package/dist/deploy-BibGpDAz.cjs.map +1 -0
  134. package/dist/deploy-C4QQkHK7.mjs +3835 -0
  135. package/dist/deploy-C4QQkHK7.mjs.map +1 -0
  136. package/dist/derive-Cd7Hl3r2.mjs +259 -0
  137. package/dist/derive-Cd7Hl3r2.mjs.map +1 -0
  138. package/dist/derive-CgZfoBU2.cjs +282 -0
  139. package/dist/derive-CgZfoBU2.cjs.map +1 -0
  140. package/dist/discover-B2m8ytyq.mjs +831 -0
  141. package/dist/discover-B2m8ytyq.mjs.map +1 -0
  142. package/dist/discover-yqeJ2Bx7.cjs +934 -0
  143. package/dist/discover-yqeJ2Bx7.cjs.map +1 -0
  144. package/dist/dokploy-B_VX3nLM.cjs +38 -0
  145. package/dist/dokploy-B_VX3nLM.cjs.map +1 -0
  146. package/dist/dokploy-pSrsileA.mjs +38 -0
  147. package/dist/dokploy-pSrsileA.mjs.map +1 -0
  148. package/dist/drivers-C47nm-wB.cjs +311 -0
  149. package/dist/drivers-C47nm-wB.cjs.map +1 -0
  150. package/dist/drivers-CDjpjakg.mjs +252 -0
  151. package/dist/drivers-CDjpjakg.mjs.map +1 -0
  152. package/dist/eas-Bou-_M76.mjs +334 -0
  153. package/dist/eas-Bou-_M76.mjs.map +1 -0
  154. package/dist/eas-cSSc8Lex.cjs +337 -0
  155. package/dist/eas-cSSc8Lex.cjs.map +1 -0
  156. package/dist/emit-Bj6XSivk.mjs +136 -0
  157. package/dist/emit-Bj6XSivk.mjs.map +1 -0
  158. package/dist/emit-CDC__ubE.cjs +147 -0
  159. package/dist/emit-CDC__ubE.cjs.map +1 -0
  160. package/dist/encryption-Bps9As2D.mjs +89 -0
  161. package/dist/encryption-Bps9As2D.mjs.map +1 -0
  162. package/dist/encryption-CElaAwJs.cjs +90 -0
  163. package/dist/encryption-CElaAwJs.cjs.map +1 -0
  164. package/dist/engine-CXE4UOHj.mjs +3210 -0
  165. package/dist/engine-CXE4UOHj.mjs.map +1 -0
  166. package/dist/engine-CiG7Wfyc.cjs +3323 -0
  167. package/dist/engine-CiG7Wfyc.cjs.map +1 -0
  168. package/dist/errors-D8Gwp5kU.mjs +23 -0
  169. package/dist/errors-D8Gwp5kU.mjs.map +1 -0
  170. package/dist/errors-DMC4Umsb.cjs +34 -0
  171. package/dist/errors-DMC4Umsb.cjs.map +1 -0
  172. package/dist/github-BzppIvpw.cjs +901 -0
  173. package/dist/github-BzppIvpw.cjs.map +1 -0
  174. package/dist/github-CvFJlFWA.mjs +900 -0
  175. package/dist/github-CvFJlFWA.mjs.map +1 -0
  176. package/dist/googlePlay-BJnMCWoa.cjs +931 -0
  177. package/dist/googlePlay-BJnMCWoa.cjs.map +1 -0
  178. package/dist/googlePlay-RSe9wOfZ.mjs +931 -0
  179. package/dist/googlePlay-RSe9wOfZ.mjs.map +1 -0
  180. package/dist/identity-CBXr4wNi.mjs +129 -0
  181. package/dist/identity-CBXr4wNi.mjs.map +1 -0
  182. package/dist/identity-CbLfgQNT.cjs +182 -0
  183. package/dist/identity-CbLfgQNT.cjs.map +1 -0
  184. package/dist/{index-D-iAVHx-.d.cts → index-BZZeEWug.d.mts} +39 -15
  185. package/dist/index-BZZeEWug.d.mts.map +1 -0
  186. package/dist/{index-Cd-qeOam.d.mts → index-C1jffZ5_.d.cts} +39 -15
  187. package/dist/index-C1jffZ5_.d.cts.map +1 -0
  188. package/dist/index.cjs +13502 -12269
  189. package/dist/index.cjs.map +1 -1
  190. package/dist/index.mjs +13522 -12287
  191. package/dist/index.mjs.map +1 -1
  192. package/dist/local-B7Zv1NoA.mjs +224 -0
  193. package/dist/local-B7Zv1NoA.mjs.map +1 -0
  194. package/dist/local-OPC9BCZt.cjs +241 -0
  195. package/dist/local-OPC9BCZt.cjs.map +1 -0
  196. package/dist/migrate-B0nQra2W.mjs +181 -0
  197. package/dist/migrate-B0nQra2W.mjs.map +1 -0
  198. package/dist/migrate-BCBs0BMn.cjs +181 -0
  199. package/dist/migrate-BCBs0BMn.cjs.map +1 -0
  200. package/dist/migrate-BPCJBL7_.mjs +265 -0
  201. package/dist/migrate-BPCJBL7_.mjs.map +1 -0
  202. package/dist/migrate-Dmh5Dbcr.cjs +270 -0
  203. package/dist/migrate-Dmh5Dbcr.cjs.map +1 -0
  204. package/dist/openapi.cjs +214 -7
  205. package/dist/openapi.cjs.map +1 -0
  206. package/dist/openapi.d.cts +32 -8
  207. package/dist/openapi.d.cts.map +1 -1
  208. package/dist/openapi.d.mts +32 -8
  209. package/dist/openapi.d.mts.map +1 -1
  210. package/dist/openapi.mjs +209 -2
  211. package/dist/openapi.mjs.map +1 -0
  212. package/dist/projectBucket-BBbQ1lHF.cjs +263 -0
  213. package/dist/projectBucket-BBbQ1lHF.cjs.map +1 -0
  214. package/dist/projectBucket-C_DN4WzF.mjs +222 -0
  215. package/dist/projectBucket-C_DN4WzF.mjs.map +1 -0
  216. package/dist/provider-BqpjG9QM.cjs +57 -0
  217. package/dist/provider-BqpjG9QM.cjs.map +1 -0
  218. package/dist/provider-CEOKk8NS.mjs +46 -0
  219. package/dist/provider-CEOKk8NS.mjs.map +1 -0
  220. package/dist/publish-DKy3hn8a.cjs +124 -0
  221. package/dist/publish-DKy3hn8a.cjs.map +1 -0
  222. package/dist/publish-cthyGGQt.mjs +123 -0
  223. package/dist/publish-cthyGGQt.mjs.map +1 -0
  224. package/dist/ready-CGqJ74Kt.mjs +375 -0
  225. package/dist/ready-CGqJ74Kt.mjs.map +1 -0
  226. package/dist/ready-DuU0FXSj.cjs +404 -0
  227. package/dist/ready-DuU0FXSj.cjs.map +1 -0
  228. package/dist/reconcile/public.cjs +3 -5
  229. package/dist/reconcile/public.d.cts +31 -89
  230. package/dist/reconcile/public.d.cts.map +1 -1
  231. package/dist/reconcile/public.d.mts +31 -89
  232. package/dist/reconcile/public.d.mts.map +1 -1
  233. package/dist/reconcile/public.mjs +3 -3
  234. package/dist/{reconcile-DhQ00DpU.mjs → reconcile--I7V4Klj.mjs} +2 -2
  235. package/dist/{reconcile-DhQ00DpU.mjs.map → reconcile--I7V4Klj.mjs.map} +1 -1
  236. package/dist/{reconcile-Dd2iyILf.cjs → reconcile-CuCQBa5-.cjs} +3 -3
  237. package/dist/{reconcile-Dd2iyILf.cjs.map → reconcile-CuCQBa5-.cjs.map} +1 -1
  238. package/dist/resolve-AYtMIgoq.cjs +316 -0
  239. package/dist/resolve-AYtMIgoq.cjs.map +1 -0
  240. package/dist/resolve-BaRqJlqV.mjs +263 -0
  241. package/dist/resolve-BaRqJlqV.mjs.map +1 -0
  242. package/dist/rollback-CQ184yFu.cjs +165 -0
  243. package/dist/rollback-CQ184yFu.cjs.map +1 -0
  244. package/dist/rollback-DqV6t9oo.mjs +136 -0
  245. package/dist/rollback-DqV6t9oo.mjs.map +1 -0
  246. package/dist/runtime-Bvgyxm88.d.cts +82 -0
  247. package/dist/runtime-Bvgyxm88.d.cts.map +1 -0
  248. package/dist/runtime-CeAt1IJd.d.mts +82 -0
  249. package/dist/runtime-CeAt1IJd.d.mts.map +1 -0
  250. package/dist/s3-BKnL6YGQ.cjs +215 -0
  251. package/dist/s3-BKnL6YGQ.cjs.map +1 -0
  252. package/dist/s3-DW7SLsb8.mjs +215 -0
  253. package/dist/s3-DW7SLsb8.mjs.map +1 -0
  254. package/dist/sandbox/config-worker.cjs +43 -0
  255. package/dist/sandbox/config-worker.cjs.map +1 -0
  256. package/dist/sandbox/config-worker.d.cts +1 -0
  257. package/dist/sandbox/config-worker.d.mts +1 -0
  258. package/dist/sandbox/config-worker.mjs +44 -0
  259. package/dist/sandbox/config-worker.mjs.map +1 -0
  260. package/dist/sandbox/credentials-worker.cjs +54 -0
  261. package/dist/sandbox/credentials-worker.cjs.map +1 -0
  262. package/dist/sandbox/credentials-worker.d.cts +1 -0
  263. package/dist/sandbox/credentials-worker.d.mts +1 -0
  264. package/dist/sandbox/credentials-worker.mjs +55 -0
  265. package/dist/sandbox/credentials-worker.mjs.map +1 -0
  266. package/dist/sandbox/discover-worker.cjs +47 -0
  267. package/dist/sandbox/discover-worker.cjs.map +1 -0
  268. package/dist/sandbox/discover-worker.d.cts +1 -0
  269. package/dist/sandbox/discover-worker.d.mts +1 -0
  270. package/dist/sandbox/discover-worker.mjs +48 -0
  271. package/dist/sandbox/discover-worker.mjs.map +1 -0
  272. package/dist/sandbox/migrate-worker.cjs +76 -0
  273. package/dist/sandbox/migrate-worker.cjs.map +1 -0
  274. package/dist/sandbox/migrate-worker.d.cts +1 -0
  275. package/dist/sandbox/migrate-worker.d.mts +1 -0
  276. package/dist/sandbox/migrate-worker.mjs +77 -0
  277. package/dist/sandbox/migrate-worker.mjs.map +1 -0
  278. package/dist/sandbox-CHv3OYXg.cjs +165 -0
  279. package/dist/sandbox-CHv3OYXg.cjs.map +1 -0
  280. package/dist/sandbox-CbVB7uOD.mjs +118 -0
  281. package/dist/sandbox-CbVB7uOD.mjs.map +1 -0
  282. package/dist/{workspace-mFpI_ky_.cjs → schemas-BCwKKA42.mjs} +399 -1162
  283. package/dist/schemas-BCwKKA42.mjs.map +1 -0
  284. package/dist/{workspace-CgwmXEtc.mjs → schemas-BQ_v0lEX.cjs} +487 -971
  285. package/dist/schemas-BQ_v0lEX.cjs.map +1 -0
  286. package/dist/secretsManager-CQORubp9.mjs +97 -0
  287. package/dist/secretsManager-CQORubp9.mjs.map +1 -0
  288. package/dist/secretsManager-RAGcEDX1.cjs +108 -0
  289. package/dist/secretsManager-RAGcEDX1.cjs.map +1 -0
  290. package/dist/seeds-DndMeyzm.cjs +10669 -0
  291. package/dist/seeds-DndMeyzm.cjs.map +1 -0
  292. package/dist/seeds-o6x6BTRo.mjs +9534 -0
  293. package/dist/seeds-o6x6BTRo.mjs.map +1 -0
  294. package/dist/serverSetup-AfG0-at8.mjs +651 -0
  295. package/dist/serverSetup-AfG0-at8.mjs.map +1 -0
  296. package/dist/serverSetup-Dnw9Kdel.cjs +651 -0
  297. package/dist/serverSetup-Dnw9Kdel.cjs.map +1 -0
  298. package/dist/sniffer-BHhJ8DiC.mjs +1825 -0
  299. package/dist/sniffer-BHhJ8DiC.mjs.map +1 -0
  300. package/dist/sniffer-taO-AXSk.cjs +1998 -0
  301. package/dist/sniffer-taO-AXSk.cjs.map +1 -0
  302. package/dist/snsSubscriptions-CC-WM1zC.cjs +1720 -0
  303. package/dist/snsSubscriptions-CC-WM1zC.cjs.map +1 -0
  304. package/dist/snsSubscriptions-D_IBKhni.mjs +1497 -0
  305. package/dist/snsSubscriptions-D_IBKhni.mjs.map +1 -0
  306. package/dist/sst-Bz2HJlqc.mjs +440 -0
  307. package/dist/sst-Bz2HJlqc.mjs.map +1 -0
  308. package/dist/sst-lvCHdYsY.cjs +463 -0
  309. package/dist/sst-lvCHdYsY.cjs.map +1 -0
  310. package/dist/stage-CTibxcpA.cjs +310 -0
  311. package/dist/stage-CTibxcpA.cjs.map +1 -0
  312. package/dist/stage-dd9dtLfh.mjs +299 -0
  313. package/dist/stage-dd9dtLfh.mjs.map +1 -0
  314. package/dist/stages--icWbhPy.cjs +190 -0
  315. package/dist/stages--icWbhPy.cjs.map +1 -0
  316. package/dist/stages-CUwSy39f.mjs +190 -0
  317. package/dist/stages-CUwSy39f.mjs.map +1 -0
  318. package/dist/target/public.cjs +15 -0
  319. package/dist/target/public.d.cts +28 -0
  320. package/dist/target/public.d.cts.map +1 -0
  321. package/dist/target/public.d.mts +28 -0
  322. package/dist/target/public.d.mts.map +1 -0
  323. package/dist/target/public.mjs +4 -0
  324. package/dist/terminal-DURcYlVX.cjs +85 -0
  325. package/dist/terminal-DURcYlVX.cjs.map +1 -0
  326. package/dist/terminal-yOZ7kKF9.mjs +85 -0
  327. package/dist/terminal-yOZ7kKF9.mjs.map +1 -0
  328. package/dist/{types-C5ZNpUad.d.cts → types-C6hDCkV2.d.mts} +2229 -456
  329. package/dist/types-C6hDCkV2.d.mts.map +1 -0
  330. package/dist/{types-BGo5TaNE.d.mts → types-Dy1eV7yc.d.cts} +2231 -456
  331. package/dist/types-Dy1eV7yc.d.cts.map +1 -0
  332. package/dist/utils-D2Nk1Nv2.cjs +205 -0
  333. package/dist/utils-D2Nk1Nv2.cjs.map +1 -0
  334. package/dist/utils-D_fxUqvU.mjs +156 -0
  335. package/dist/utils-D_fxUqvU.mjs.map +1 -0
  336. package/dist/vitest.cjs +65 -0
  337. package/dist/vitest.cjs.map +1 -0
  338. package/dist/vitest.d.cts +29 -0
  339. package/dist/vitest.d.cts.map +1 -0
  340. package/dist/vitest.d.mts +29 -0
  341. package/dist/vitest.d.mts.map +1 -0
  342. package/dist/vitest.mjs +65 -0
  343. package/dist/vitest.mjs.map +1 -0
  344. package/dist/workerRuntime-BXfhbe13.cjs +108 -0
  345. package/dist/workerRuntime-BXfhbe13.cjs.map +1 -0
  346. package/dist/workerRuntime-CsOyBRx2.mjs +79 -0
  347. package/dist/workerRuntime-CsOyBRx2.mjs.map +1 -0
  348. package/dist/workspace/index.cjs +6 -2
  349. package/dist/workspace/index.d.cts +3 -3
  350. package/dist/workspace/index.d.mts +3 -3
  351. package/dist/workspace/index.mjs +2 -2
  352. package/dist/workspace-BbfBFtjn.mjs +2488 -0
  353. package/dist/workspace-BbfBFtjn.mjs.map +1 -0
  354. package/dist/workspace-Dkm3HL9e.cjs +2924 -0
  355. package/dist/workspace-Dkm3HL9e.cjs.map +1 -0
  356. package/package.json +61 -14
  357. package/dist/HostingerProvider-BY26bWwB.mjs.map +0 -1
  358. package/dist/HostingerProvider-BZFGYYVA.cjs.map +0 -1
  359. package/dist/LocalStateProvider-7HR6SS2t.cjs +0 -48
  360. package/dist/LocalStateProvider-7HR6SS2t.cjs.map +0 -1
  361. package/dist/LocalStateProvider-D7QyJoLM.mjs +0 -48
  362. package/dist/LocalStateProvider-D7QyJoLM.mjs.map +0 -1
  363. package/dist/Route53Provider-Cvj40A8I.mjs.map +0 -1
  364. package/dist/Route53Provider-DVILBsvV.cjs.map +0 -1
  365. package/dist/SSMStateProvider-B0Hu1MKZ.mjs +0 -75
  366. package/dist/SSMStateProvider-B0Hu1MKZ.mjs.map +0 -1
  367. package/dist/SSMStateProvider-VrQ-yeqd.cjs +0 -74
  368. package/dist/SSMStateProvider-VrQ-yeqd.cjs.map +0 -1
  369. package/dist/backup-provisioner-BmhIO_Yr.cjs.map +0 -1
  370. package/dist/backup-provisioner-DIVCbfee.mjs.map +0 -1
  371. package/dist/bundler-BeNDZdHQ.cjs.map +0 -1
  372. package/dist/bundler-BodTL4kf.mjs.map +0 -1
  373. package/dist/config-Q1rvKHvw.cjs +0 -467
  374. package/dist/config-Q1rvKHvw.cjs.map +0 -1
  375. package/dist/config-pqGD3hF9.mjs +0 -414
  376. package/dist/config-pqGD3hF9.mjs.map +0 -1
  377. package/dist/config.d.cts.map +0 -1
  378. package/dist/config.d.mts.map +0 -1
  379. package/dist/credentials-BekkKtY_.mjs +0 -2780
  380. package/dist/credentials-BekkKtY_.mjs.map +0 -1
  381. package/dist/credentials-Q6F0uqJq.cjs +0 -2917
  382. package/dist/credentials-Q6F0uqJq.cjs.map +0 -1
  383. package/dist/discover-BERGFg8v.cjs +0 -288
  384. package/dist/discover-BERGFg8v.cjs.map +0 -1
  385. package/dist/discover-CK-n3w6b.mjs +0 -244
  386. package/dist/discover-CK-n3w6b.mjs.map +0 -1
  387. package/dist/emit-BdoPFjZf.cjs +0 -253
  388. package/dist/emit-BdoPFjZf.cjs.map +0 -1
  389. package/dist/emit-Bzq7JsMP.mjs +0 -224
  390. package/dist/emit-Bzq7JsMP.mjs.map +0 -1
  391. package/dist/fullstack-secrets-BET8gqwK.mjs +0 -81
  392. package/dist/fullstack-secrets-BET8gqwK.mjs.map +0 -1
  393. package/dist/fullstack-secrets-DXsWO-5m.cjs +0 -92
  394. package/dist/fullstack-secrets-DXsWO-5m.cjs.map +0 -1
  395. package/dist/generator-LfZU7NlU.mjs +0 -247
  396. package/dist/generator-LfZU7NlU.mjs.map +0 -1
  397. package/dist/generator-Wdfp0jCS.cjs +0 -282
  398. package/dist/generator-Wdfp0jCS.cjs.map +0 -1
  399. package/dist/github-BfflNPVe.cjs +0 -203
  400. package/dist/github-BfflNPVe.cjs.map +0 -1
  401. package/dist/github-CRwnxKmD.mjs +0 -203
  402. package/dist/github-CRwnxKmD.mjs.map +0 -1
  403. package/dist/index-Cd-qeOam.d.mts.map +0 -1
  404. package/dist/index-D-iAVHx-.d.cts.map +0 -1
  405. package/dist/keystore-B4PRlbgE.mjs +0 -81
  406. package/dist/keystore-B4PRlbgE.mjs.map +0 -1
  407. package/dist/keystore-DgGRj2Yy.cjs +0 -98
  408. package/dist/keystore-DgGRj2Yy.cjs.map +0 -1
  409. package/dist/openapi-Dcbme-Us.cjs +0 -2038
  410. package/dist/openapi-Dcbme-Us.cjs.map +0 -1
  411. package/dist/openapi-vy4JzhUv.mjs +0 -1991
  412. package/dist/openapi-vy4JzhUv.mjs.map +0 -1
  413. package/dist/storage-C-30BD1e.cjs +0 -272
  414. package/dist/storage-C-30BD1e.cjs.map +0 -1
  415. package/dist/storage-P_b3w7uj.mjs +0 -231
  416. package/dist/storage-P_b3w7uj.mjs.map +0 -1
  417. package/dist/sync-B3xxXtJT.mjs +0 -88
  418. package/dist/sync-B3xxXtJT.mjs.map +0 -1
  419. package/dist/sync-D7uTIIEi.cjs +0 -111
  420. package/dist/sync-D7uTIIEi.cjs.map +0 -1
  421. package/dist/types-BGo5TaNE.d.mts.map +0 -1
  422. package/dist/types-C5ZNpUad.d.cts.map +0 -1
  423. package/dist/workspace-CgwmXEtc.mjs.map +0 -1
  424. package/dist/workspace-mFpI_ky_.cjs.map +0 -1
@@ -0,0 +1,43 @@
1
+ const require_workerRuntime = require("../workerRuntime-BXfhbe13.cjs");
2
+ let node_fs_promises = require("node:fs/promises");
3
+ let node_url = require("node:url");
4
+ //#region src/sandbox/config-worker.ts
5
+ /**
6
+ * Loads `gkm.config.ts` in a sandbox and answers with it as data.
7
+ *
8
+ * Usage (by `loadWorkspaceConfig` with a sandbox, never by hand):
9
+ * node --import=<tsx> config-worker.ts /path/to/gkm.config.ts
10
+ *
11
+ * Answers `{ reason: 'loaded', config }`, `{ reason: 'live', paths }` when the
12
+ * config holds something JSON cannot carry, or `{ reason: 'failed', error }`
13
+ * when it could not be loaded at all.
14
+ */
15
+ async function load(configPath) {
16
+ if (configPath.endsWith(".json")) return JSON.parse(await (0, node_fs_promises.readFile)(configPath, "utf8"));
17
+ return (await import((0, node_url.pathToFileURL)(configPath).href)).default;
18
+ }
19
+ async function main() {
20
+ const configPath = process.argv[2];
21
+ try {
22
+ if (!configPath) throw new TypeError("No config path was given.");
23
+ await require_workerRuntime.registerAdjacentTsconfig();
24
+ const config = await load(configPath);
25
+ const paths = require_workerRuntime.liveValuePaths(config);
26
+ require_workerRuntime.answer(paths.length > 0 ? {
27
+ reason: "live",
28
+ paths
29
+ } : {
30
+ reason: "loaded",
31
+ config
32
+ });
33
+ } catch (error) {
34
+ require_workerRuntime.answer({
35
+ reason: "failed",
36
+ error: require_workerRuntime.errorData(error)
37
+ });
38
+ }
39
+ }
40
+ main();
41
+ //#endregion
42
+
43
+ //# sourceMappingURL=config-worker.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-worker.cjs","names":["readFile","pathToFileURL","registerAdjacentTsconfig","liveValuePaths","errorData"],"sources":["../../src/sandbox/config-worker.ts"],"sourcesContent":["/**\n * Loads `gkm.config.ts` in a sandbox and answers with it as data.\n *\n * Usage (by `loadWorkspaceConfig` with a sandbox, never by hand):\n * node --import=<tsx> config-worker.ts /path/to/gkm.config.ts\n *\n * Answers `{ reason: 'loaded', config }`, `{ reason: 'live', paths }` when the\n * config holds something JSON cannot carry, or `{ reason: 'failed', error }`\n * when it could not be loaded at all.\n */\n\nimport { readFile } from 'node:fs/promises';\nimport { pathToFileURL } from 'node:url';\nimport {\n\tanswer,\n\terrorData,\n\tliveValuePaths,\n\tregisterAdjacentTsconfig,\n} from './workerRuntime';\n\nasync function load(configPath: string): Promise<unknown> {\n\tif (configPath.endsWith('.json')) {\n\t\treturn JSON.parse(await readFile(configPath, 'utf8'));\n\t}\n\tconst module = await import(pathToFileURL(configPath).href);\n\treturn module.default;\n}\n\nasync function main(): Promise<void> {\n\tconst configPath = process.argv[2];\n\ttry {\n\t\tif (!configPath) throw new TypeError('No config path was given.');\n\t\tawait registerAdjacentTsconfig();\n\t\tconst config = await load(configPath);\n\t\tconst paths = liveValuePaths(config);\n\t\tanswer(\n\t\t\tpaths.length > 0\n\t\t\t\t? { reason: 'live', paths }\n\t\t\t\t: { reason: 'loaded', config },\n\t\t);\n\t} catch (error) {\n\t\tanswer({ reason: 'failed', error: errorData(error) });\n\t}\n}\n\nvoid main();\n"],"mappings":";;;;;;;;;;;;;;AAoBA,eAAe,KAAK,YAAsC;CACzD,IAAI,WAAW,SAAS,OAAO,GAC9B,OAAO,KAAK,MAAM,OAAA,GAAMA,iBAAAA,SAAAA,CAAS,YAAY,MAAM,CAAC;CAGrD,QAAO,MADc,QAAA,GAAOC,SAAAA,cAAAA,CAAc,UAAU,CAAC,CAAC,MAAA,CACxC;AACf;AAEA,eAAe,OAAsB;CACpC,MAAM,aAAa,QAAQ,KAAK;CAChC,IAAI;EACH,IAAI,CAAC,YAAY,MAAM,IAAI,UAAU,2BAA2B;EAChE,MAAMC,sBAAAA,yBAAyB;EAC/B,MAAM,SAAS,MAAM,KAAK,UAAU;EACpC,MAAM,QAAQC,sBAAAA,eAAe,MAAM;EACnC,sBAAA,OACC,MAAM,SAAS,IACZ;GAAE,QAAQ;GAAQ;EAAM,IACxB;GAAE,QAAQ;GAAU;EAAO,CAC/B;CACD,SAAS,OAAO;EACf,sBAAA,OAAO;GAAE,QAAQ;GAAU,OAAOC,sBAAAA,UAAU,KAAK;EAAE,CAAC;CACrD;AACD;AAEK,KAAK"}
@@ -0,0 +1 @@
1
+ export {}
@@ -0,0 +1 @@
1
+ export {}
@@ -0,0 +1,44 @@
1
+ import { a as registerAdjacentTsconfig, i as liveValuePaths, n as answer, r as errorData } from "../workerRuntime-CsOyBRx2.mjs";
2
+ import { readFile } from "node:fs/promises";
3
+ import { pathToFileURL } from "node:url";
4
+ //#region src/sandbox/config-worker.ts
5
+ /**
6
+ * Loads `gkm.config.ts` in a sandbox and answers with it as data.
7
+ *
8
+ * Usage (by `loadWorkspaceConfig` with a sandbox, never by hand):
9
+ * node --import=<tsx> config-worker.ts /path/to/gkm.config.ts
10
+ *
11
+ * Answers `{ reason: 'loaded', config }`, `{ reason: 'live', paths }` when the
12
+ * config holds something JSON cannot carry, or `{ reason: 'failed', error }`
13
+ * when it could not be loaded at all.
14
+ */
15
+ async function load(configPath) {
16
+ if (configPath.endsWith(".json")) return JSON.parse(await readFile(configPath, "utf8"));
17
+ return (await import(pathToFileURL(configPath).href)).default;
18
+ }
19
+ async function main() {
20
+ const configPath = process.argv[2];
21
+ try {
22
+ if (!configPath) throw new TypeError("No config path was given.");
23
+ await registerAdjacentTsconfig();
24
+ const config = await load(configPath);
25
+ const paths = liveValuePaths(config);
26
+ answer(paths.length > 0 ? {
27
+ reason: "live",
28
+ paths
29
+ } : {
30
+ reason: "loaded",
31
+ config
32
+ });
33
+ } catch (error) {
34
+ answer({
35
+ reason: "failed",
36
+ error: errorData(error)
37
+ });
38
+ }
39
+ }
40
+ main();
41
+ //#endregion
42
+ export {};
43
+
44
+ //# sourceMappingURL=config-worker.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-worker.mjs","names":[],"sources":["../../src/sandbox/config-worker.ts"],"sourcesContent":["/**\n * Loads `gkm.config.ts` in a sandbox and answers with it as data.\n *\n * Usage (by `loadWorkspaceConfig` with a sandbox, never by hand):\n * node --import=<tsx> config-worker.ts /path/to/gkm.config.ts\n *\n * Answers `{ reason: 'loaded', config }`, `{ reason: 'live', paths }` when the\n * config holds something JSON cannot carry, or `{ reason: 'failed', error }`\n * when it could not be loaded at all.\n */\n\nimport { readFile } from 'node:fs/promises';\nimport { pathToFileURL } from 'node:url';\nimport {\n\tanswer,\n\terrorData,\n\tliveValuePaths,\n\tregisterAdjacentTsconfig,\n} from './workerRuntime';\n\nasync function load(configPath: string): Promise<unknown> {\n\tif (configPath.endsWith('.json')) {\n\t\treturn JSON.parse(await readFile(configPath, 'utf8'));\n\t}\n\tconst module = await import(pathToFileURL(configPath).href);\n\treturn module.default;\n}\n\nasync function main(): Promise<void> {\n\tconst configPath = process.argv[2];\n\ttry {\n\t\tif (!configPath) throw new TypeError('No config path was given.');\n\t\tawait registerAdjacentTsconfig();\n\t\tconst config = await load(configPath);\n\t\tconst paths = liveValuePaths(config);\n\t\tanswer(\n\t\t\tpaths.length > 0\n\t\t\t\t? { reason: 'live', paths }\n\t\t\t\t: { reason: 'loaded', config },\n\t\t);\n\t} catch (error) {\n\t\tanswer({ reason: 'failed', error: errorData(error) });\n\t}\n}\n\nvoid main();\n"],"mappings":";;;;;;;;;;;;;;AAoBA,eAAe,KAAK,YAAsC;CACzD,IAAI,WAAW,SAAS,OAAO,GAC9B,OAAO,KAAK,MAAM,MAAM,SAAS,YAAY,MAAM,CAAC;CAGrD,QAAO,MADc,OAAO,cAAc,UAAU,CAAC,CAAC,MAAA,CACxC;AACf;AAEA,eAAe,OAAsB;CACpC,MAAM,aAAa,QAAQ,KAAK;CAChC,IAAI;EACH,IAAI,CAAC,YAAY,MAAM,IAAI,UAAU,2BAA2B;EAChE,MAAM,yBAAyB;EAC/B,MAAM,SAAS,MAAM,KAAK,UAAU;EACpC,MAAM,QAAQ,eAAe,MAAM;EACnC,OACC,MAAM,SAAS,IACZ;GAAE,QAAQ;GAAQ;EAAM,IACxB;GAAE,QAAQ;GAAU;EAAO,CAC/B;CACD,SAAS,OAAO;EACf,OAAO;GAAE,QAAQ;GAAU,OAAO,UAAU,KAAK;EAAE,CAAC;CACrD;AACD;AAEK,KAAK"}
@@ -0,0 +1,54 @@
1
+ const require_discover = require("../discover-yqeJ2Bx7.cjs");
2
+ const require_sandbox = require("../sandbox-CHv3OYXg.cjs");
3
+ const require_workerRuntime = require("../workerRuntime-BXfhbe13.cjs");
4
+ const require_credentialSchemas = require("../credentialSchemas-DZ2Nh5li.cjs");
5
+ let node_path = require("node:path");
6
+ let node_fs_promises = require("node:fs/promises");
7
+ //#region src/sandbox/credentials-worker.ts
8
+ /**
9
+ * Loads a project's constructs in a sandbox and answers with what their
10
+ * credentials schemas say, as data: each schema as JSON Schema, and whether
11
+ * each value it was handed passes.
12
+ *
13
+ * Usage (by `inspectCredentials` under a sandbox, never by hand):
14
+ * node --import=<tsx> credentials-worker.ts '{"patterns":[…],"cwd":"…"}'
15
+ *
16
+ * The schemas are the project's code, which is why they run here. Each value
17
+ * arrives as a file in `GKM_SECRETS_DIR` named by its key, is read into this
18
+ * process's memory only, and never comes back: an answer carries issue paths
19
+ * and messages, not values.
20
+ */
21
+ /** Every secret file the sandbox mounted, by name. */
22
+ async function mountedSecrets() {
23
+ const dir = process.env[require_sandbox.SECRETS_DIR_ENV];
24
+ if (!dir) return {};
25
+ const secrets = {};
26
+ for (const name of await (0, node_fs_promises.readdir)(dir)) secrets[name] = (await (0, node_fs_promises.readFile)((0, node_path.join)(dir, name), "utf8")).trim();
27
+ return secrets;
28
+ }
29
+ async function main() {
30
+ try {
31
+ const request = JSON.parse(process.argv[2] ?? "{}");
32
+ await require_workerRuntime.registerAdjacentTsconfig();
33
+ const sources = {};
34
+ const manifest = await require_discover.discover({
35
+ patterns: request.patterns,
36
+ cwd: request.cwd,
37
+ sources
38
+ });
39
+ const inspection = await require_credentialSchemas.inspectLive(require_credentialSchemas.liveCredentials(manifest, sources), await mountedSecrets());
40
+ require_workerRuntime.answer({
41
+ reason: "inspected",
42
+ ...inspection
43
+ });
44
+ } catch (error) {
45
+ require_workerRuntime.answer({
46
+ reason: "failed",
47
+ error: require_workerRuntime.errorData(error)
48
+ });
49
+ }
50
+ }
51
+ main();
52
+ //#endregion
53
+
54
+ //# sourceMappingURL=credentials-worker.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credentials-worker.cjs","names":["SECRETS_DIR_ENV","readdir","readFile","join","registerAdjacentTsconfig","discover","inspectLive","liveCredentials","errorData"],"sources":["../../src/sandbox/credentials-worker.ts"],"sourcesContent":["/**\n * Loads a project's constructs in a sandbox and answers with what their\n * credentials schemas say, as data: each schema as JSON Schema, and whether\n * each value it was handed passes.\n *\n * Usage (by `inspectCredentials` under a sandbox, never by hand):\n * node --import=<tsx> credentials-worker.ts '{\"patterns\":[…],\"cwd\":\"…\"}'\n *\n * The schemas are the project's code, which is why they run here. Each value\n * arrives as a file in `GKM_SECRETS_DIR` named by its key, is read into this\n * process's memory only, and never comes back: an answer carries issue paths\n * and messages, not values.\n */\n\nimport { readdir, readFile } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { type ConstructSource, discover } from '../reconcile/discover';\nimport { inspectLive, liveCredentials } from '../secrets/credentialSchemas';\nimport { SECRETS_DIR_ENV } from './sandbox';\nimport { answer, errorData, registerAdjacentTsconfig } from './workerRuntime';\n\n/** Every secret file the sandbox mounted, by name. */\nasync function mountedSecrets(): Promise<Record<string, string>> {\n\tconst dir = process.env[SECRETS_DIR_ENV];\n\tif (!dir) return {};\n\n\tconst secrets: Record<string, string> = {};\n\tfor (const name of await readdir(dir)) {\n\t\tsecrets[name] = (await readFile(join(dir, name), 'utf8')).trim();\n\t}\n\treturn secrets;\n}\n\nasync function main(): Promise<void> {\n\ttry {\n\t\tconst request = JSON.parse(process.argv[2] ?? '{}') as {\n\t\t\tpatterns: string[];\n\t\t\tcwd: string;\n\t\t};\n\t\tawait registerAdjacentTsconfig();\n\n\t\tconst sources: Record<string, ConstructSource> = {};\n\t\tconst manifest = await discover({\n\t\t\tpatterns: request.patterns,\n\t\t\tcwd: request.cwd,\n\t\t\tsources,\n\t\t});\n\n\t\tconst inspection = await inspectLive(\n\t\t\tliveCredentials(manifest, sources),\n\t\t\tawait mountedSecrets(),\n\t\t);\n\t\tanswer({ reason: 'inspected', ...inspection });\n\t} catch (error) {\n\t\tanswer({ reason: 'failed', error: errorData(error) });\n\t}\n}\n\nvoid main();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsBA,eAAe,iBAAkD;CAChE,MAAM,MAAM,QAAQ,IAAIA,gBAAAA;CACxB,IAAI,CAAC,KAAK,OAAO,CAAC;CAElB,MAAM,UAAkC,CAAC;CACzC,KAAK,MAAM,QAAQ,OAAA,GAAMC,iBAAAA,QAAAA,CAAQ,GAAG,GACnC,QAAQ,SAAS,OAAA,GAAMC,iBAAAA,SAAAA,EAAAA,GAASC,UAAAA,KAAAA,CAAK,KAAK,IAAI,GAAG,MAAM,EAAA,CAAG,KAAK;CAEhE,OAAO;AACR;AAEA,eAAe,OAAsB;CACpC,IAAI;EACH,MAAM,UAAU,KAAK,MAAM,QAAQ,KAAK,MAAM,IAAI;EAIlD,MAAMC,sBAAAA,yBAAyB;EAE/B,MAAM,UAA2C,CAAC;EAClD,MAAM,WAAW,MAAMC,iBAAAA,SAAS;GAC/B,UAAU,QAAQ;GAClB,KAAK,QAAQ;GACb;EACD,CAAC;EAED,MAAM,aAAa,MAAMC,0BAAAA,YACxBC,0BAAAA,gBAAgB,UAAU,OAAO,GACjC,MAAM,eAAe,CACtB;EACA,sBAAA,OAAO;GAAE,QAAQ;GAAa,GAAG;EAAW,CAAC;CAC9C,SAAS,OAAO;EACf,sBAAA,OAAO;GAAE,QAAQ;GAAU,OAAOC,sBAAAA,UAAU,KAAK;EAAE,CAAC;CACrD;AACD;AAEK,KAAK"}
@@ -0,0 +1 @@
1
+ export {}
@@ -0,0 +1 @@
1
+ export {}
@@ -0,0 +1,55 @@
1
+ import { i as discover } from "../discover-B2m8ytyq.mjs";
2
+ import { t as SECRETS_DIR_ENV } from "../sandbox-CbVB7uOD.mjs";
3
+ import { a as registerAdjacentTsconfig, n as answer, r as errorData } from "../workerRuntime-CsOyBRx2.mjs";
4
+ import { a as liveCredentials, r as inspectLive } from "../credentialSchemas-DUCSYl9a.mjs";
5
+ import { join } from "node:path";
6
+ import { readFile, readdir } from "node:fs/promises";
7
+ //#region src/sandbox/credentials-worker.ts
8
+ /**
9
+ * Loads a project's constructs in a sandbox and answers with what their
10
+ * credentials schemas say, as data: each schema as JSON Schema, and whether
11
+ * each value it was handed passes.
12
+ *
13
+ * Usage (by `inspectCredentials` under a sandbox, never by hand):
14
+ * node --import=<tsx> credentials-worker.ts '{"patterns":[…],"cwd":"…"}'
15
+ *
16
+ * The schemas are the project's code, which is why they run here. Each value
17
+ * arrives as a file in `GKM_SECRETS_DIR` named by its key, is read into this
18
+ * process's memory only, and never comes back: an answer carries issue paths
19
+ * and messages, not values.
20
+ */
21
+ /** Every secret file the sandbox mounted, by name. */
22
+ async function mountedSecrets() {
23
+ const dir = process.env[SECRETS_DIR_ENV];
24
+ if (!dir) return {};
25
+ const secrets = {};
26
+ for (const name of await readdir(dir)) secrets[name] = (await readFile(join(dir, name), "utf8")).trim();
27
+ return secrets;
28
+ }
29
+ async function main() {
30
+ try {
31
+ const request = JSON.parse(process.argv[2] ?? "{}");
32
+ await registerAdjacentTsconfig();
33
+ const sources = {};
34
+ const manifest = await discover({
35
+ patterns: request.patterns,
36
+ cwd: request.cwd,
37
+ sources
38
+ });
39
+ const inspection = await inspectLive(liveCredentials(manifest, sources), await mountedSecrets());
40
+ answer({
41
+ reason: "inspected",
42
+ ...inspection
43
+ });
44
+ } catch (error) {
45
+ answer({
46
+ reason: "failed",
47
+ error: errorData(error)
48
+ });
49
+ }
50
+ }
51
+ main();
52
+ //#endregion
53
+ export {};
54
+
55
+ //# sourceMappingURL=credentials-worker.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credentials-worker.mjs","names":[],"sources":["../../src/sandbox/credentials-worker.ts"],"sourcesContent":["/**\n * Loads a project's constructs in a sandbox and answers with what their\n * credentials schemas say, as data: each schema as JSON Schema, and whether\n * each value it was handed passes.\n *\n * Usage (by `inspectCredentials` under a sandbox, never by hand):\n * node --import=<tsx> credentials-worker.ts '{\"patterns\":[…],\"cwd\":\"…\"}'\n *\n * The schemas are the project's code, which is why they run here. Each value\n * arrives as a file in `GKM_SECRETS_DIR` named by its key, is read into this\n * process's memory only, and never comes back: an answer carries issue paths\n * and messages, not values.\n */\n\nimport { readdir, readFile } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { type ConstructSource, discover } from '../reconcile/discover';\nimport { inspectLive, liveCredentials } from '../secrets/credentialSchemas';\nimport { SECRETS_DIR_ENV } from './sandbox';\nimport { answer, errorData, registerAdjacentTsconfig } from './workerRuntime';\n\n/** Every secret file the sandbox mounted, by name. */\nasync function mountedSecrets(): Promise<Record<string, string>> {\n\tconst dir = process.env[SECRETS_DIR_ENV];\n\tif (!dir) return {};\n\n\tconst secrets: Record<string, string> = {};\n\tfor (const name of await readdir(dir)) {\n\t\tsecrets[name] = (await readFile(join(dir, name), 'utf8')).trim();\n\t}\n\treturn secrets;\n}\n\nasync function main(): Promise<void> {\n\ttry {\n\t\tconst request = JSON.parse(process.argv[2] ?? '{}') as {\n\t\t\tpatterns: string[];\n\t\t\tcwd: string;\n\t\t};\n\t\tawait registerAdjacentTsconfig();\n\n\t\tconst sources: Record<string, ConstructSource> = {};\n\t\tconst manifest = await discover({\n\t\t\tpatterns: request.patterns,\n\t\t\tcwd: request.cwd,\n\t\t\tsources,\n\t\t});\n\n\t\tconst inspection = await inspectLive(\n\t\t\tliveCredentials(manifest, sources),\n\t\t\tawait mountedSecrets(),\n\t\t);\n\t\tanswer({ reason: 'inspected', ...inspection });\n\t} catch (error) {\n\t\tanswer({ reason: 'failed', error: errorData(error) });\n\t}\n}\n\nvoid main();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsBA,eAAe,iBAAkD;CAChE,MAAM,MAAM,QAAQ,IAAI;CACxB,IAAI,CAAC,KAAK,OAAO,CAAC;CAElB,MAAM,UAAkC,CAAC;CACzC,KAAK,MAAM,QAAQ,MAAM,QAAQ,GAAG,GACnC,QAAQ,SAAS,MAAM,SAAS,KAAK,KAAK,IAAI,GAAG,MAAM,EAAA,CAAG,KAAK;CAEhE,OAAO;AACR;AAEA,eAAe,OAAsB;CACpC,IAAI;EACH,MAAM,UAAU,KAAK,MAAM,QAAQ,KAAK,MAAM,IAAI;EAIlD,MAAM,yBAAyB;EAE/B,MAAM,UAA2C,CAAC;EAClD,MAAM,WAAW,MAAM,SAAS;GAC/B,UAAU,QAAQ;GAClB,KAAK,QAAQ;GACb;EACD,CAAC;EAED,MAAM,aAAa,MAAM,YACxB,gBAAgB,UAAU,OAAO,GACjC,MAAM,eAAe,CACtB;EACA,OAAO;GAAE,QAAQ;GAAa,GAAG;EAAW,CAAC;CAC9C,SAAS,OAAO;EACf,OAAO;GAAE,QAAQ;GAAU,OAAO,UAAU,KAAK;EAAE,CAAC;CACrD;AACD;AAEK,KAAK"}
@@ -0,0 +1,47 @@
1
+ const require_discover = require("../discover-yqeJ2Bx7.cjs");
2
+ const require_workerRuntime = require("../workerRuntime-BXfhbe13.cjs");
3
+ //#region src/sandbox/discover-worker.ts
4
+ /**
5
+ * Discovers a project's constructs in a sandbox and answers with the
6
+ * manifest as data.
7
+ *
8
+ * Usage (by `discover` under a sandbox, never by hand):
9
+ * node --import=<tsx> discover-worker.ts '{"patterns":[…],"cwd":"…"}'
10
+ *
11
+ * Discovery imports every construct module — the project's code — which is
12
+ * why it runs here rather than in the deploy. Its warnings go to stderr, where
13
+ * the host passes them on.
14
+ */
15
+ async function main() {
16
+ try {
17
+ const request = JSON.parse(process.argv[2] ?? "{}");
18
+ await require_workerRuntime.registerAdjacentTsconfig();
19
+ const background = {};
20
+ const subscribers = {};
21
+ const manifest = await require_discover.discover({
22
+ patterns: request.patterns,
23
+ cwd: request.cwd,
24
+ background,
25
+ subscribers
26
+ });
27
+ const paths = require_workerRuntime.liveValuePaths(manifest);
28
+ require_workerRuntime.answer(paths.length > 0 ? {
29
+ reason: "live",
30
+ paths
31
+ } : {
32
+ reason: "discovered",
33
+ manifest,
34
+ background,
35
+ subscribers
36
+ });
37
+ } catch (error) {
38
+ require_workerRuntime.answer({
39
+ reason: "failed",
40
+ error: require_workerRuntime.errorData(error)
41
+ });
42
+ }
43
+ }
44
+ main();
45
+ //#endregion
46
+
47
+ //# sourceMappingURL=discover-worker.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discover-worker.cjs","names":["registerAdjacentTsconfig","discover","liveValuePaths","errorData"],"sources":["../../src/sandbox/discover-worker.ts"],"sourcesContent":["/**\n * Discovers a project's constructs in a sandbox and answers with the\n * manifest as data.\n *\n * Usage (by `discover` under a sandbox, never by hand):\n * node --import=<tsx> discover-worker.ts '{\"patterns\":[…],\"cwd\":\"…\"}'\n *\n * Discovery imports every construct module — the project's code — which is\n * why it runs here rather than in the deploy. Its warnings go to stderr, where\n * the host passes them on.\n */\n\nimport { type BoundSubscriber, discover } from '../reconcile/discover';\nimport {\n\tanswer,\n\terrorData,\n\tliveValuePaths,\n\tregisterAdjacentTsconfig,\n} from './workerRuntime';\n\nasync function main(): Promise<void> {\n\ttry {\n\t\tconst request = JSON.parse(process.argv[2] ?? '{}') as {\n\t\t\tpatterns: string[];\n\t\t\tcwd: string;\n\t\t};\n\t\tawait registerAdjacentTsconfig();\n\n\t\tconst background: Record<string, string[]> = {};\n\t\tconst subscribers: Record<string, BoundSubscriber[]> = {};\n\t\tconst manifest = await discover({\n\t\t\tpatterns: request.patterns,\n\t\t\tcwd: request.cwd,\n\t\t\tbackground,\n\t\t\tsubscribers,\n\t\t});\n\n\t\tconst paths = liveValuePaths(manifest);\n\t\tanswer(\n\t\t\tpaths.length > 0\n\t\t\t\t? { reason: 'live', paths }\n\t\t\t\t: {\n\t\t\t\t\t\treason: 'discovered',\n\t\t\t\t\t\tmanifest,\n\t\t\t\t\t\tbackground,\n\t\t\t\t\t\tsubscribers,\n\t\t\t\t\t},\n\t\t);\n\t} catch (error) {\n\t\tanswer({ reason: 'failed', error: errorData(error) });\n\t}\n}\n\nvoid main();\n"],"mappings":";;;;;;;;;;;;;;AAoBA,eAAe,OAAsB;CACpC,IAAI;EACH,MAAM,UAAU,KAAK,MAAM,QAAQ,KAAK,MAAM,IAAI;EAIlD,MAAMA,sBAAAA,yBAAyB;EAE/B,MAAM,aAAuC,CAAC;EAC9C,MAAM,cAAiD,CAAC;EACxD,MAAM,WAAW,MAAMC,iBAAAA,SAAS;GAC/B,UAAU,QAAQ;GAClB,KAAK,QAAQ;GACb;GACA;EACD,CAAC;EAED,MAAM,QAAQC,sBAAAA,eAAe,QAAQ;EACrC,sBAAA,OACC,MAAM,SAAS,IACZ;GAAE,QAAQ;GAAQ;EAAM,IACxB;GACA,QAAQ;GACR;GACA;GACA;EACD,CACH;CACD,SAAS,OAAO;EACf,sBAAA,OAAO;GAAE,QAAQ;GAAU,OAAOC,sBAAAA,UAAU,KAAK;EAAE,CAAC;CACrD;AACD;AAEK,KAAK"}
@@ -0,0 +1 @@
1
+ export {}
@@ -0,0 +1 @@
1
+ export {}
@@ -0,0 +1,48 @@
1
+ import { i as discover } from "../discover-B2m8ytyq.mjs";
2
+ import { a as registerAdjacentTsconfig, i as liveValuePaths, n as answer, r as errorData } from "../workerRuntime-CsOyBRx2.mjs";
3
+ //#region src/sandbox/discover-worker.ts
4
+ /**
5
+ * Discovers a project's constructs in a sandbox and answers with the
6
+ * manifest as data.
7
+ *
8
+ * Usage (by `discover` under a sandbox, never by hand):
9
+ * node --import=<tsx> discover-worker.ts '{"patterns":[…],"cwd":"…"}'
10
+ *
11
+ * Discovery imports every construct module — the project's code — which is
12
+ * why it runs here rather than in the deploy. Its warnings go to stderr, where
13
+ * the host passes them on.
14
+ */
15
+ async function main() {
16
+ try {
17
+ const request = JSON.parse(process.argv[2] ?? "{}");
18
+ await registerAdjacentTsconfig();
19
+ const background = {};
20
+ const subscribers = {};
21
+ const manifest = await discover({
22
+ patterns: request.patterns,
23
+ cwd: request.cwd,
24
+ background,
25
+ subscribers
26
+ });
27
+ const paths = liveValuePaths(manifest);
28
+ answer(paths.length > 0 ? {
29
+ reason: "live",
30
+ paths
31
+ } : {
32
+ reason: "discovered",
33
+ manifest,
34
+ background,
35
+ subscribers
36
+ });
37
+ } catch (error) {
38
+ answer({
39
+ reason: "failed",
40
+ error: errorData(error)
41
+ });
42
+ }
43
+ }
44
+ main();
45
+ //#endregion
46
+ export {};
47
+
48
+ //# sourceMappingURL=discover-worker.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discover-worker.mjs","names":[],"sources":["../../src/sandbox/discover-worker.ts"],"sourcesContent":["/**\n * Discovers a project's constructs in a sandbox and answers with the\n * manifest as data.\n *\n * Usage (by `discover` under a sandbox, never by hand):\n * node --import=<tsx> discover-worker.ts '{\"patterns\":[…],\"cwd\":\"…\"}'\n *\n * Discovery imports every construct module — the project's code — which is\n * why it runs here rather than in the deploy. Its warnings go to stderr, where\n * the host passes them on.\n */\n\nimport { type BoundSubscriber, discover } from '../reconcile/discover';\nimport {\n\tanswer,\n\terrorData,\n\tliveValuePaths,\n\tregisterAdjacentTsconfig,\n} from './workerRuntime';\n\nasync function main(): Promise<void> {\n\ttry {\n\t\tconst request = JSON.parse(process.argv[2] ?? '{}') as {\n\t\t\tpatterns: string[];\n\t\t\tcwd: string;\n\t\t};\n\t\tawait registerAdjacentTsconfig();\n\n\t\tconst background: Record<string, string[]> = {};\n\t\tconst subscribers: Record<string, BoundSubscriber[]> = {};\n\t\tconst manifest = await discover({\n\t\t\tpatterns: request.patterns,\n\t\t\tcwd: request.cwd,\n\t\t\tbackground,\n\t\t\tsubscribers,\n\t\t});\n\n\t\tconst paths = liveValuePaths(manifest);\n\t\tanswer(\n\t\t\tpaths.length > 0\n\t\t\t\t? { reason: 'live', paths }\n\t\t\t\t: {\n\t\t\t\t\t\treason: 'discovered',\n\t\t\t\t\t\tmanifest,\n\t\t\t\t\t\tbackground,\n\t\t\t\t\t\tsubscribers,\n\t\t\t\t\t},\n\t\t);\n\t} catch (error) {\n\t\tanswer({ reason: 'failed', error: errorData(error) });\n\t}\n}\n\nvoid main();\n"],"mappings":";;;;;;;;;;;;;;AAoBA,eAAe,OAAsB;CACpC,IAAI;EACH,MAAM,UAAU,KAAK,MAAM,QAAQ,KAAK,MAAM,IAAI;EAIlD,MAAM,yBAAyB;EAE/B,MAAM,aAAuC,CAAC;EAC9C,MAAM,cAAiD,CAAC;EACxD,MAAM,WAAW,MAAM,SAAS;GAC/B,UAAU,QAAQ;GAClB,KAAK,QAAQ;GACb;GACA;EACD,CAAC;EAED,MAAM,QAAQ,eAAe,QAAQ;EACrC,OACC,MAAM,SAAS,IACZ;GAAE,QAAQ;GAAQ;EAAM,IACxB;GACA,QAAQ;GACR;GACA;GACA;EACD,CACH;CACD,SAAS,OAAO;EACf,OAAO;GAAE,QAAQ;GAAU,OAAO,UAAU,KAAK;EAAE,CAAC;CACrD;AACD;AAEK,KAAK"}
@@ -0,0 +1,76 @@
1
+ const require_discover = require("../discover-yqeJ2Bx7.cjs");
2
+ const require_sandbox = require("../sandbox-CHv3OYXg.cjs");
3
+ const require_workerRuntime = require("../workerRuntime-BXfhbe13.cjs");
4
+ const require_databases = require("../databases-P824RTnx.cjs");
5
+ let node_path = require("node:path");
6
+ let node_fs_promises = require("node:fs/promises");
7
+ //#region src/sandbox/migrate-worker.ts
8
+ /**
9
+ * Applies a deployed stage's migrations, then runs its seeds, in a sandbox —
10
+ * what `gkm seed` runs, against URLs the deploy hands it as secret files.
11
+ *
12
+ * Usage (by the Dokploy target's release, never by hand):
13
+ * node --import=<tsx> migrate-worker.ts '{"root":"…","stage":"…","manifest":{…},"patterns":[…],"backends":{…}}'
14
+ *
15
+ * Migrations and seeds are the project's own code, which is why they run
16
+ * here rather than in the deploy. Each owner URL arrives as a file in `GKM_SECRETS_DIR`,
17
+ * named by its key, and is read into this process's memory only: never into
18
+ * `process.env`, where a child the migration starts would inherit it.
19
+ */
20
+ /** Every secret file the sandbox mounted, by name. */
21
+ async function mountedSecrets() {
22
+ const dir = process.env[require_sandbox.SECRETS_DIR_ENV];
23
+ if (!dir) return {};
24
+ const secrets = {};
25
+ for (const name of await (0, node_fs_promises.readdir)(dir)) secrets[name] = (await (0, node_fs_promises.readFile)((0, node_path.join)(dir, name), "utf8")).trim();
26
+ return secrets;
27
+ }
28
+ async function main() {
29
+ try {
30
+ const request = JSON.parse(process.argv[2] ?? "{}");
31
+ await require_workerRuntime.registerAdjacentTsconfig();
32
+ const sources = {};
33
+ if (request.patterns.length > 0) await require_discover.discover({
34
+ patterns: request.patterns,
35
+ cwd: request.root,
36
+ sources
37
+ });
38
+ const options = {
39
+ root: request.root,
40
+ manifest: request.manifest,
41
+ sources,
42
+ env: await mountedSecrets()
43
+ };
44
+ const runs = await require_databases.migrateDatabases(options);
45
+ const seeds = await require_databases.seedDatabases({
46
+ ...options,
47
+ stage: request.stage,
48
+ backends: request.backends
49
+ });
50
+ require_workerRuntime.answer({
51
+ reason: "migrated",
52
+ runs: runs.map(({ target, applied }) => ({
53
+ construct: target.id,
54
+ migrations: target.migrations,
55
+ applied
56
+ })),
57
+ seeds: seeds.map(({ target, seeded }) => ({
58
+ construct: target.id,
59
+ seeds: target.seeds,
60
+ seeded
61
+ }))
62
+ });
63
+ } catch (error) {
64
+ require_workerRuntime.answer({
65
+ reason: "failed",
66
+ error: {
67
+ ...require_workerRuntime.errorData(error),
68
+ ...error instanceof require_databases.SeedFailed ? { cause: require_workerRuntime.errorData(error.cause) } : {}
69
+ }
70
+ });
71
+ }
72
+ }
73
+ main();
74
+ //#endregion
75
+
76
+ //# sourceMappingURL=migrate-worker.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrate-worker.cjs","names":["SECRETS_DIR_ENV","readdir","readFile","join","registerAdjacentTsconfig","discover","migrateDatabases","seedDatabases","errorData","SeedFailed"],"sources":["../../src/sandbox/migrate-worker.ts"],"sourcesContent":["/**\n * Applies a deployed stage's migrations, then runs its seeds, in a sandbox —\n * what `gkm seed` runs, against URLs the deploy hands it as secret files.\n *\n * Usage (by the Dokploy target's release, never by hand):\n * node --import=<tsx> migrate-worker.ts '{\"root\":\"…\",\"stage\":\"…\",\"manifest\":{…},\"patterns\":[…],\"backends\":{…}}'\n *\n * Migrations and seeds are the project's own code, which is why they run\n * here rather than in the deploy. Each owner URL arrives as a file in `GKM_SECRETS_DIR`,\n * named by its key, and is read into this process's memory only: never into\n * `process.env`, where a child the migration starts would inherit it.\n */\n\nimport { readdir, readFile } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport type { ConstructManifest } from '@geekmidas/manifest';\nimport {\n\tmigrateDatabases,\n\tSeedFailed,\n\tseedDatabases,\n} from '../migrate/databases';\nimport type { SeedBackends } from '../migrate/seedDrivers';\nimport { type ConstructSource, discover } from '../reconcile/discover';\nimport { SECRETS_DIR_ENV } from './sandbox';\nimport { answer, errorData, registerAdjacentTsconfig } from './workerRuntime';\n\n/** Every secret file the sandbox mounted, by name. */\nasync function mountedSecrets(): Promise<Record<string, string>> {\n\tconst dir = process.env[SECRETS_DIR_ENV];\n\tif (!dir) return {};\n\n\tconst secrets: Record<string, string> = {};\n\tfor (const name of await readdir(dir)) {\n\t\tsecrets[name] = (await readFile(join(dir, name), 'utf8')).trim();\n\t}\n\treturn secrets;\n}\n\nasync function main(): Promise<void> {\n\ttry {\n\t\tconst request = JSON.parse(process.argv[2] ?? '{}') as {\n\t\t\troot: string;\n\t\t\tstage: string;\n\t\t\tmanifest: ConstructManifest;\n\t\t\tpatterns: string[];\n\t\t\tbackends: SeedBackends;\n\t\t};\n\t\tawait registerAdjacentTsconfig();\n\n\t\t// Where each construct is declared, so a migration runs with the Kysely\n\t\t// its own file resolves. The manifest itself is the deploy's: what it\n\t\t// provisioned is what gets migrated, not a second reading of the files.\n\t\tconst sources: Record<string, ConstructSource> = {};\n\t\tif (request.patterns.length > 0) {\n\t\t\tawait discover({\n\t\t\t\tpatterns: request.patterns,\n\t\t\t\tcwd: request.root,\n\t\t\t\tsources,\n\t\t\t});\n\t\t}\n\n\t\tconst options = {\n\t\t\troot: request.root,\n\t\t\tmanifest: request.manifest,\n\t\t\tsources,\n\t\t\tenv: await mountedSecrets(),\n\t\t};\n\t\tconst runs = await migrateDatabases(options);\n\t\t// Every seed, every time, after the schema it was written for.\n\t\tconst seeds = await seedDatabases({\n\t\t\t...options,\n\t\t\tstage: request.stage,\n\t\t\tbackends: request.backends,\n\t\t});\n\n\t\tanswer({\n\t\t\treason: 'migrated',\n\t\t\truns: runs.map(({ target, applied }) => ({\n\t\t\t\tconstruct: target.id,\n\t\t\t\tmigrations: target.migrations,\n\t\t\t\tapplied,\n\t\t\t})),\n\t\t\tseeds: seeds.map(({ target, seeded }) => ({\n\t\t\t\tconstruct: target.id,\n\t\t\t\tseeds: target.seeds,\n\t\t\t\tseeded,\n\t\t\t})),\n\t\t});\n\t} catch (error) {\n\t\t// A seed's cause is the database's error — an Error, which `errorData`\n\t\t// leaves out — and it is what says what to fix.\n\t\tanswer({\n\t\t\treason: 'failed',\n\t\t\terror: {\n\t\t\t\t...errorData(error),\n\t\t\t\t...(error instanceof SeedFailed\n\t\t\t\t\t? { cause: errorData(error.cause) }\n\t\t\t\t\t: {}),\n\t\t\t},\n\t\t});\n\t}\n}\n\nvoid main();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2BA,eAAe,iBAAkD;CAChE,MAAM,MAAM,QAAQ,IAAIA,gBAAAA;CACxB,IAAI,CAAC,KAAK,OAAO,CAAC;CAElB,MAAM,UAAkC,CAAC;CACzC,KAAK,MAAM,QAAQ,OAAA,GAAMC,iBAAAA,QAAAA,CAAQ,GAAG,GACnC,QAAQ,SAAS,OAAA,GAAMC,iBAAAA,SAAAA,EAAAA,GAASC,UAAAA,KAAAA,CAAK,KAAK,IAAI,GAAG,MAAM,EAAA,CAAG,KAAK;CAEhE,OAAO;AACR;AAEA,eAAe,OAAsB;CACpC,IAAI;EACH,MAAM,UAAU,KAAK,MAAM,QAAQ,KAAK,MAAM,IAAI;EAOlD,MAAMC,sBAAAA,yBAAyB;EAK/B,MAAM,UAA2C,CAAC;EAClD,IAAI,QAAQ,SAAS,SAAS,GAC7B,MAAMC,iBAAAA,SAAS;GACd,UAAU,QAAQ;GAClB,KAAK,QAAQ;GACb;EACD,CAAC;EAGF,MAAM,UAAU;GACf,MAAM,QAAQ;GACd,UAAU,QAAQ;GAClB;GACA,KAAK,MAAM,eAAe;EAC3B;EACA,MAAM,OAAO,MAAMC,kBAAAA,iBAAiB,OAAO;EAE3C,MAAM,QAAQ,MAAMC,kBAAAA,cAAc;GACjC,GAAG;GACH,OAAO,QAAQ;GACf,UAAU,QAAQ;EACnB,CAAC;EAED,sBAAA,OAAO;GACN,QAAQ;GACR,MAAM,KAAK,KAAK,EAAE,QAAQ,eAAe;IACxC,WAAW,OAAO;IAClB,YAAY,OAAO;IACnB;GACD,EAAE;GACF,OAAO,MAAM,KAAK,EAAE,QAAQ,cAAc;IACzC,WAAW,OAAO;IAClB,OAAO,OAAO;IACd;GACD,EAAE;EACH,CAAC;CACF,SAAS,OAAO;EAGf,sBAAA,OAAO;GACN,QAAQ;GACR,OAAO;IACN,GAAGC,sBAAAA,UAAU,KAAK;IAClB,GAAI,iBAAiBC,kBAAAA,aAClB,EAAE,OAAOD,sBAAAA,UAAU,MAAM,KAAK,EAAE,IAChC,CAAC;GACL;EACD,CAAC;CACF;AACD;AAEK,KAAK"}
@@ -0,0 +1 @@
1
+ export {}
@@ -0,0 +1 @@
1
+ export {}
@@ -0,0 +1,77 @@
1
+ import { i as discover } from "../discover-B2m8ytyq.mjs";
2
+ import { t as SECRETS_DIR_ENV } from "../sandbox-CbVB7uOD.mjs";
3
+ import { a as registerAdjacentTsconfig, n as answer, r as errorData } from "../workerRuntime-CsOyBRx2.mjs";
4
+ import { o as SeedFailed, p as seedDatabases, u as migrateDatabases } from "../databases-Db48ZIXL.mjs";
5
+ import { join } from "node:path";
6
+ import { readFile, readdir } from "node:fs/promises";
7
+ //#region src/sandbox/migrate-worker.ts
8
+ /**
9
+ * Applies a deployed stage's migrations, then runs its seeds, in a sandbox —
10
+ * what `gkm seed` runs, against URLs the deploy hands it as secret files.
11
+ *
12
+ * Usage (by the Dokploy target's release, never by hand):
13
+ * node --import=<tsx> migrate-worker.ts '{"root":"…","stage":"…","manifest":{…},"patterns":[…],"backends":{…}}'
14
+ *
15
+ * Migrations and seeds are the project's own code, which is why they run
16
+ * here rather than in the deploy. Each owner URL arrives as a file in `GKM_SECRETS_DIR`,
17
+ * named by its key, and is read into this process's memory only: never into
18
+ * `process.env`, where a child the migration starts would inherit it.
19
+ */
20
+ /** Every secret file the sandbox mounted, by name. */
21
+ async function mountedSecrets() {
22
+ const dir = process.env[SECRETS_DIR_ENV];
23
+ if (!dir) return {};
24
+ const secrets = {};
25
+ for (const name of await readdir(dir)) secrets[name] = (await readFile(join(dir, name), "utf8")).trim();
26
+ return secrets;
27
+ }
28
+ async function main() {
29
+ try {
30
+ const request = JSON.parse(process.argv[2] ?? "{}");
31
+ await registerAdjacentTsconfig();
32
+ const sources = {};
33
+ if (request.patterns.length > 0) await discover({
34
+ patterns: request.patterns,
35
+ cwd: request.root,
36
+ sources
37
+ });
38
+ const options = {
39
+ root: request.root,
40
+ manifest: request.manifest,
41
+ sources,
42
+ env: await mountedSecrets()
43
+ };
44
+ const runs = await migrateDatabases(options);
45
+ const seeds = await seedDatabases({
46
+ ...options,
47
+ stage: request.stage,
48
+ backends: request.backends
49
+ });
50
+ answer({
51
+ reason: "migrated",
52
+ runs: runs.map(({ target, applied }) => ({
53
+ construct: target.id,
54
+ migrations: target.migrations,
55
+ applied
56
+ })),
57
+ seeds: seeds.map(({ target, seeded }) => ({
58
+ construct: target.id,
59
+ seeds: target.seeds,
60
+ seeded
61
+ }))
62
+ });
63
+ } catch (error) {
64
+ answer({
65
+ reason: "failed",
66
+ error: {
67
+ ...errorData(error),
68
+ ...error instanceof SeedFailed ? { cause: errorData(error.cause) } : {}
69
+ }
70
+ });
71
+ }
72
+ }
73
+ main();
74
+ //#endregion
75
+ export {};
76
+
77
+ //# sourceMappingURL=migrate-worker.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrate-worker.mjs","names":[],"sources":["../../src/sandbox/migrate-worker.ts"],"sourcesContent":["/**\n * Applies a deployed stage's migrations, then runs its seeds, in a sandbox —\n * what `gkm seed` runs, against URLs the deploy hands it as secret files.\n *\n * Usage (by the Dokploy target's release, never by hand):\n * node --import=<tsx> migrate-worker.ts '{\"root\":\"…\",\"stage\":\"…\",\"manifest\":{…},\"patterns\":[…],\"backends\":{…}}'\n *\n * Migrations and seeds are the project's own code, which is why they run\n * here rather than in the deploy. Each owner URL arrives as a file in `GKM_SECRETS_DIR`,\n * named by its key, and is read into this process's memory only: never into\n * `process.env`, where a child the migration starts would inherit it.\n */\n\nimport { readdir, readFile } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport type { ConstructManifest } from '@geekmidas/manifest';\nimport {\n\tmigrateDatabases,\n\tSeedFailed,\n\tseedDatabases,\n} from '../migrate/databases';\nimport type { SeedBackends } from '../migrate/seedDrivers';\nimport { type ConstructSource, discover } from '../reconcile/discover';\nimport { SECRETS_DIR_ENV } from './sandbox';\nimport { answer, errorData, registerAdjacentTsconfig } from './workerRuntime';\n\n/** Every secret file the sandbox mounted, by name. */\nasync function mountedSecrets(): Promise<Record<string, string>> {\n\tconst dir = process.env[SECRETS_DIR_ENV];\n\tif (!dir) return {};\n\n\tconst secrets: Record<string, string> = {};\n\tfor (const name of await readdir(dir)) {\n\t\tsecrets[name] = (await readFile(join(dir, name), 'utf8')).trim();\n\t}\n\treturn secrets;\n}\n\nasync function main(): Promise<void> {\n\ttry {\n\t\tconst request = JSON.parse(process.argv[2] ?? '{}') as {\n\t\t\troot: string;\n\t\t\tstage: string;\n\t\t\tmanifest: ConstructManifest;\n\t\t\tpatterns: string[];\n\t\t\tbackends: SeedBackends;\n\t\t};\n\t\tawait registerAdjacentTsconfig();\n\n\t\t// Where each construct is declared, so a migration runs with the Kysely\n\t\t// its own file resolves. The manifest itself is the deploy's: what it\n\t\t// provisioned is what gets migrated, not a second reading of the files.\n\t\tconst sources: Record<string, ConstructSource> = {};\n\t\tif (request.patterns.length > 0) {\n\t\t\tawait discover({\n\t\t\t\tpatterns: request.patterns,\n\t\t\t\tcwd: request.root,\n\t\t\t\tsources,\n\t\t\t});\n\t\t}\n\n\t\tconst options = {\n\t\t\troot: request.root,\n\t\t\tmanifest: request.manifest,\n\t\t\tsources,\n\t\t\tenv: await mountedSecrets(),\n\t\t};\n\t\tconst runs = await migrateDatabases(options);\n\t\t// Every seed, every time, after the schema it was written for.\n\t\tconst seeds = await seedDatabases({\n\t\t\t...options,\n\t\t\tstage: request.stage,\n\t\t\tbackends: request.backends,\n\t\t});\n\n\t\tanswer({\n\t\t\treason: 'migrated',\n\t\t\truns: runs.map(({ target, applied }) => ({\n\t\t\t\tconstruct: target.id,\n\t\t\t\tmigrations: target.migrations,\n\t\t\t\tapplied,\n\t\t\t})),\n\t\t\tseeds: seeds.map(({ target, seeded }) => ({\n\t\t\t\tconstruct: target.id,\n\t\t\t\tseeds: target.seeds,\n\t\t\t\tseeded,\n\t\t\t})),\n\t\t});\n\t} catch (error) {\n\t\t// A seed's cause is the database's error — an Error, which `errorData`\n\t\t// leaves out — and it is what says what to fix.\n\t\tanswer({\n\t\t\treason: 'failed',\n\t\t\terror: {\n\t\t\t\t...errorData(error),\n\t\t\t\t...(error instanceof SeedFailed\n\t\t\t\t\t? { cause: errorData(error.cause) }\n\t\t\t\t\t: {}),\n\t\t\t},\n\t\t});\n\t}\n}\n\nvoid main();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2BA,eAAe,iBAAkD;CAChE,MAAM,MAAM,QAAQ,IAAI;CACxB,IAAI,CAAC,KAAK,OAAO,CAAC;CAElB,MAAM,UAAkC,CAAC;CACzC,KAAK,MAAM,QAAQ,MAAM,QAAQ,GAAG,GACnC,QAAQ,SAAS,MAAM,SAAS,KAAK,KAAK,IAAI,GAAG,MAAM,EAAA,CAAG,KAAK;CAEhE,OAAO;AACR;AAEA,eAAe,OAAsB;CACpC,IAAI;EACH,MAAM,UAAU,KAAK,MAAM,QAAQ,KAAK,MAAM,IAAI;EAOlD,MAAM,yBAAyB;EAK/B,MAAM,UAA2C,CAAC;EAClD,IAAI,QAAQ,SAAS,SAAS,GAC7B,MAAM,SAAS;GACd,UAAU,QAAQ;GAClB,KAAK,QAAQ;GACb;EACD,CAAC;EAGF,MAAM,UAAU;GACf,MAAM,QAAQ;GACd,UAAU,QAAQ;GAClB;GACA,KAAK,MAAM,eAAe;EAC3B;EACA,MAAM,OAAO,MAAM,iBAAiB,OAAO;EAE3C,MAAM,QAAQ,MAAM,cAAc;GACjC,GAAG;GACH,OAAO,QAAQ;GACf,UAAU,QAAQ;EACnB,CAAC;EAED,OAAO;GACN,QAAQ;GACR,MAAM,KAAK,KAAK,EAAE,QAAQ,eAAe;IACxC,WAAW,OAAO;IAClB,YAAY,OAAO;IACnB;GACD,EAAE;GACF,OAAO,MAAM,KAAK,EAAE,QAAQ,cAAc;IACzC,WAAW,OAAO;IAClB,OAAO,OAAO;IACd;GACD,EAAE;EACH,CAAC;CACF,SAAS,OAAO;EAGf,OAAO;GACN,QAAQ;GACR,OAAO;IACN,GAAG,UAAU,KAAK;IAClB,GAAI,iBAAiB,aAClB,EAAE,OAAO,UAAU,MAAM,KAAK,EAAE,IAChC,CAAC;GACL;EACD,CAAC;CACF;AACD;AAEK,KAAK"}