@geekmidas/cli 10.0.0-alpha.98 → 10.0.0

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 (684) hide show
  1. package/CHANGELOG.md +667 -0
  2. package/FUNCTION_CRON_SUPPORT.md +266 -0
  3. package/README.md +533 -382
  4. package/bin/gkm.mjs +2 -16
  5. package/dist/CachedStateProvider-BdX7klRc.cjs +3 -0
  6. package/dist/CachedStateProvider-CzyFct42.mjs +54 -0
  7. package/dist/CachedStateProvider-CzyFct42.mjs.map +1 -0
  8. package/dist/CachedStateProvider-GcGziXh1.mjs +3 -0
  9. package/dist/CachedStateProvider-klLWZXWF.cjs +60 -0
  10. package/dist/CachedStateProvider-klLWZXWF.cjs.map +1 -0
  11. package/dist/{HostingerProvider-BNpS9aRJ.mjs → HostingerProvider-B2ZYz7Yc.mjs} +26 -31
  12. package/dist/HostingerProvider-B2ZYz7Yc.mjs.map +1 -0
  13. package/dist/{HostingerProvider-DR1iws1P.cjs → HostingerProvider-CrHfsgz9.cjs} +26 -31
  14. package/dist/HostingerProvider-CrHfsgz9.cjs.map +1 -0
  15. package/dist/LocalStateProvider-CP49rjzt.mjs +42 -0
  16. package/dist/LocalStateProvider-CP49rjzt.mjs.map +1 -0
  17. package/dist/LocalStateProvider-CalzNfNA.cjs +43 -0
  18. package/dist/LocalStateProvider-CalzNfNA.cjs.map +1 -0
  19. package/dist/{Route53Provider-Bllus2NR.cjs → Route53Provider-DwgXiLxt.cjs} +22 -21
  20. package/dist/Route53Provider-DwgXiLxt.cjs.map +1 -0
  21. package/dist/{Route53Provider-QXxjkZO1.mjs → Route53Provider-tlgBzrRQ.mjs} +13 -13
  22. package/dist/Route53Provider-tlgBzrRQ.mjs.map +1 -0
  23. package/dist/SSMStateProvider-BlrTiV5m.mjs +66 -0
  24. package/dist/SSMStateProvider-BlrTiV5m.mjs.map +1 -0
  25. package/dist/SSMStateProvider-Bt6r8CTL.cjs +66 -0
  26. package/dist/SSMStateProvider-Bt6r8CTL.cjs.map +1 -0
  27. package/dist/{backup-provisioner-oDEsPj02.cjs → backup-provisioner-B3HBN-2k.cjs} +20 -22
  28. package/dist/backup-provisioner-B3HBN-2k.cjs.map +1 -0
  29. package/dist/{backup-provisioner-C8DnCmxK.mjs → backup-provisioner-Xunq-p_8.mjs} +9 -12
  30. package/dist/backup-provisioner-Xunq-p_8.mjs.map +1 -0
  31. package/dist/bundler-DkA4qzUD.mjs +135 -0
  32. package/dist/bundler-DkA4qzUD.mjs.map +1 -0
  33. package/dist/bundler-Dufq3uvI.cjs +136 -0
  34. package/dist/bundler-Dufq3uvI.cjs.map +1 -0
  35. package/dist/{rolldown-runtime-C0BPl7ul.cjs → chunk-CUT6urMc.cjs} +10 -23
  36. package/dist/chunk-Duj1WY3L.mjs +7 -0
  37. package/dist/config-Bbu1JKvf.mjs +211 -0
  38. package/dist/config-Bbu1JKvf.mjs.map +1 -0
  39. package/dist/config-DujV8DbR.cjs +253 -0
  40. package/dist/config-DujV8DbR.cjs.map +1 -0
  41. package/dist/config.cjs +10 -421
  42. package/dist/config.d.cts +120 -4
  43. package/dist/config.d.cts.map +1 -0
  44. package/dist/config.d.mts +120 -4
  45. package/dist/config.d.mts.map +1 -0
  46. package/dist/config.mjs +3 -405
  47. package/dist/credentials-C8DWtnMY.cjs +174 -0
  48. package/dist/credentials-C8DWtnMY.cjs.map +1 -0
  49. package/dist/credentials-s1kLcIzK.mjs +126 -0
  50. package/dist/credentials-s1kLcIzK.mjs.map +1 -0
  51. package/dist/deploy/sniffer-envkit-patch.cjs +10 -18
  52. package/dist/deploy/sniffer-envkit-patch.cjs.map +1 -1
  53. package/dist/deploy/sniffer-envkit-patch.d.cts +2 -0
  54. package/dist/deploy/sniffer-envkit-patch.d.cts.map +1 -1
  55. package/dist/deploy/sniffer-envkit-patch.d.mts +2 -0
  56. package/dist/deploy/sniffer-envkit-patch.d.mts.map +1 -1
  57. package/dist/deploy/sniffer-envkit-patch.mjs +2 -10
  58. package/dist/deploy/sniffer-envkit-patch.mjs.map +1 -1
  59. package/dist/deploy/sniffer-hooks.cjs +7 -13
  60. package/dist/deploy/sniffer-hooks.cjs.map +1 -1
  61. package/dist/deploy/sniffer-hooks.d.cts +2 -1
  62. package/dist/deploy/sniffer-hooks.d.cts.map +1 -1
  63. package/dist/deploy/sniffer-hooks.d.mts +2 -1
  64. package/dist/deploy/sniffer-hooks.d.mts.map +1 -1
  65. package/dist/deploy/sniffer-hooks.mjs +3 -10
  66. package/dist/deploy/sniffer-hooks.mjs.map +1 -1
  67. package/dist/deploy/sniffer-loader.cjs +7 -16
  68. package/dist/deploy/sniffer-loader.cjs.map +1 -1
  69. package/dist/deploy/sniffer-loader.d.cts +1 -1
  70. package/dist/deploy/sniffer-loader.d.mts +1 -1
  71. package/dist/deploy/sniffer-loader.mjs +3 -14
  72. package/dist/deploy/sniffer-loader.mjs.map +1 -1
  73. package/dist/deploy/sniffer-routes-worker.cjs +13 -17
  74. package/dist/deploy/sniffer-routes-worker.cjs.map +1 -1
  75. package/dist/deploy/sniffer-routes-worker.d.cts +1 -1
  76. package/dist/deploy/sniffer-routes-worker.d.mts +1 -1
  77. package/dist/deploy/sniffer-routes-worker.mjs +6 -10
  78. package/dist/deploy/sniffer-routes-worker.mjs.map +1 -1
  79. package/dist/deploy/sniffer-worker.cjs +6 -15
  80. package/dist/deploy/sniffer-worker.cjs.map +1 -1
  81. package/dist/deploy/sniffer-worker.d.cts +3 -1
  82. package/dist/deploy/sniffer-worker.d.cts.map +1 -1
  83. package/dist/deploy/sniffer-worker.d.mts +3 -1
  84. package/dist/deploy/sniffer-worker.d.mts.map +1 -1
  85. package/dist/deploy/sniffer-worker.mjs +4 -15
  86. package/dist/deploy/sniffer-worker.mjs.map +1 -1
  87. package/dist/dokploy-api-BPYkG-ZZ.cjs +3 -0
  88. package/dist/dokploy-api-BiSzWM4v.mjs +3 -0
  89. package/dist/dokploy-api-CqOIKHme.cjs +609 -0
  90. package/dist/dokploy-api-CqOIKHme.cjs.map +1 -0
  91. package/dist/dokploy-api-sfZFlWuE.mjs +597 -0
  92. package/dist/dokploy-api-sfZFlWuE.mjs.map +1 -0
  93. package/dist/encryption-BVS7Vmzs.cjs +4 -0
  94. package/dist/encryption-Bd_m4q3g.mjs +3 -0
  95. package/dist/encryption-CO5Q4Bhf.mjs +42 -0
  96. package/dist/encryption-CO5Q4Bhf.mjs.map +1 -0
  97. package/dist/encryption-MfXAiFTm.cjs +54 -0
  98. package/dist/encryption-MfXAiFTm.cjs.map +1 -0
  99. package/dist/fullstack-secrets-BYzi6Hwl.cjs +402 -0
  100. package/dist/fullstack-secrets-BYzi6Hwl.cjs.map +1 -0
  101. package/dist/fullstack-secrets-l8s3II_H.mjs +336 -0
  102. package/dist/fullstack-secrets-l8s3II_H.mjs.map +1 -0
  103. package/dist/index-CoVW_fFS.d.cts +1737 -0
  104. package/dist/index-CoVW_fFS.d.cts.map +1 -0
  105. package/dist/index-oWibAYQY.d.mts +1737 -0
  106. package/dist/index-oWibAYQY.d.mts.map +1 -0
  107. package/dist/index.cjs +11337 -10263
  108. package/dist/index.cjs.map +1 -1
  109. package/dist/index.d.cts +1 -1
  110. package/dist/index.d.mts +1 -1
  111. package/dist/index.mjs +11303 -10217
  112. package/dist/index.mjs.map +1 -1
  113. package/dist/openapi-BzNOC7_i.cjs +1931 -0
  114. package/dist/openapi-BzNOC7_i.cjs.map +1 -0
  115. package/dist/openapi-Cfwi0fqF.mjs +1883 -0
  116. package/dist/openapi-Cfwi0fqF.mjs.map +1 -0
  117. package/dist/openapi-react-query-C4iIvpPf.mjs +167 -0
  118. package/dist/openapi-react-query-C4iIvpPf.mjs.map +1 -0
  119. package/dist/openapi-react-query-CYWik72n.cjs +173 -0
  120. package/dist/openapi-react-query-CYWik72n.cjs.map +1 -0
  121. package/dist/openapi-react-query.cjs +4 -0
  122. package/dist/openapi-react-query.d.cts +11 -0
  123. package/dist/openapi-react-query.d.cts.map +1 -0
  124. package/dist/openapi-react-query.d.mts +11 -0
  125. package/dist/openapi-react-query.d.mts.map +1 -0
  126. package/dist/openapi-react-query.mjs +4 -0
  127. package/dist/openapi.cjs +7 -214
  128. package/dist/openapi.d.cts +15 -72
  129. package/dist/openapi.d.cts.map +1 -1
  130. package/dist/openapi.d.mts +15 -72
  131. package/dist/openapi.d.mts.map +1 -1
  132. package/dist/openapi.mjs +4 -208
  133. package/dist/{reconcile--I7V4Klj.mjs → reconcile-B2FoJE0a.mjs} +8 -6
  134. package/dist/reconcile-B2FoJE0a.mjs.map +1 -0
  135. package/dist/{reconcile-CuCQBa5-.cjs → reconcile-BzqKJ2Rt.cjs} +8 -6
  136. package/dist/reconcile-BzqKJ2Rt.cjs.map +1 -0
  137. package/dist/setup-DDXUXzzl.mjs +765 -0
  138. package/dist/setup-DDXUXzzl.mjs.map +1 -0
  139. package/dist/setup-DLwhfyt-.cjs +8 -0
  140. package/dist/setup-Dh-B7YTX.mjs +8 -0
  141. package/dist/setup-WZ-xqAQO.cjs +849 -0
  142. package/dist/setup-WZ-xqAQO.cjs.map +1 -0
  143. package/dist/storage-B1wvztiJ.cjs +363 -0
  144. package/dist/storage-B1wvztiJ.cjs.map +1 -0
  145. package/dist/storage-Cs4WBsc4.mjs +3 -0
  146. package/dist/storage-DOEtT2Hr.cjs +7 -0
  147. package/dist/storage-dbb9RyBl.mjs +297 -0
  148. package/dist/storage-dbb9RyBl.mjs.map +1 -0
  149. package/dist/sync-B5UHXwRM.mjs +3 -0
  150. package/dist/sync-BLA94rgC.cjs +4 -0
  151. package/dist/sync-CSooqRQ8.mjs +76 -0
  152. package/dist/sync-CSooqRQ8.mjs.map +1 -0
  153. package/dist/sync-o_CtEbvR.cjs +93 -0
  154. package/dist/sync-o_CtEbvR.cjs.map +1 -0
  155. package/dist/types-B3GQUg3k.d.mts +280 -0
  156. package/dist/types-B3GQUg3k.d.mts.map +1 -0
  157. package/dist/types-BWQDiooe.d.cts +280 -0
  158. package/dist/types-BWQDiooe.d.cts.map +1 -0
  159. package/dist/workspace/index.cjs +4 -12
  160. package/dist/workspace/index.d.cts +3 -3
  161. package/dist/workspace/index.d.mts +3 -3
  162. package/dist/workspace/index.mjs +3 -2
  163. package/dist/workspace-CQTT7HJQ.cjs +4361 -0
  164. package/dist/workspace-CQTT7HJQ.cjs.map +1 -0
  165. package/dist/workspace-D-37Ylqo.mjs +4236 -0
  166. package/dist/workspace-D-37Ylqo.mjs.map +1 -0
  167. package/docs/OPENAPI_TYPESCRIPT_DESIGN.md +408 -0
  168. package/docs/dev-server-resilience-design.md +189 -0
  169. package/docs/manifest-refactor-design.md +287 -0
  170. package/examples/cron-example.ts +45 -0
  171. package/examples/env.ts +33 -0
  172. package/examples/function-example.ts +40 -0
  173. package/examples/gkm.config.json +22 -0
  174. package/examples/gkm.config.ts +14 -0
  175. package/examples/gkm.minimal.config.json +7 -0
  176. package/examples/gkm.production.config.json +27 -0
  177. package/examples/logger.ts +10 -0
  178. package/package.json +37 -87
  179. package/scripts/sync-versions.ts +108 -0
  180. package/src/__tests__/EndpointGenerator.hooks.spec.ts +204 -0
  181. package/src/__tests__/config.spec.ts +422 -0
  182. package/src/__tests__/loadEnvFiles.spec.ts +131 -0
  183. package/src/__tests__/normalizeHooksConfig.spec.ts +63 -0
  184. package/src/__tests__/openapi-react-query.spec.ts +506 -0
  185. package/src/__tests__/openapi.spec.ts +625 -0
  186. package/src/__tests__/test-helpers.ts +180 -0
  187. package/src/auth/__tests__/credentials.spec.ts +331 -0
  188. package/src/auth/__tests__/index.spec.ts +237 -0
  189. package/src/auth/credentials.ts +286 -0
  190. package/src/auth/index.ts +233 -0
  191. package/src/build/__tests__/bundler.spec.ts +446 -0
  192. package/src/build/__tests__/endpoint-analyzer.spec.ts +623 -0
  193. package/src/build/__tests__/handler-templates.spec.ts +1287 -0
  194. package/src/build/__tests__/index-new.spec.ts +550 -0
  195. package/src/build/__tests__/manifests.spec.ts +583 -0
  196. package/src/build/__tests__/partitions.spec.ts +110 -0
  197. package/src/build/__tests__/workspace-build.spec.ts +215 -0
  198. package/src/build/bundler.ts +256 -0
  199. package/src/build/endpoint-analyzer.ts +236 -0
  200. package/src/build/handler-templates.ts +1253 -0
  201. package/src/build/index.ts +616 -0
  202. package/src/build/manifests.ts +285 -0
  203. package/src/build/partitions.ts +58 -0
  204. package/src/build/providerResolver.ts +184 -0
  205. package/src/build/types.ts +104 -0
  206. package/src/config.ts +330 -0
  207. package/src/credentials/__tests__/fullDockerPorts.spec.ts +144 -0
  208. package/src/credentials/__tests__/helpers.ts +112 -0
  209. package/src/credentials/__tests__/prepareEntryCredentials.spec.ts +125 -0
  210. package/src/credentials/__tests__/readonlyDockerPorts.spec.ts +190 -0
  211. package/src/credentials/__tests__/workspaceCredentials.spec.ts +209 -0
  212. package/src/credentials/index.ts +843 -0
  213. package/src/debug.ts +68 -0
  214. package/src/deploy/CachedStateProvider.ts +86 -0
  215. package/src/deploy/LocalStateProvider.ts +57 -0
  216. package/src/deploy/SSMStateProvider.ts +117 -0
  217. package/src/deploy/StateProvider.ts +175 -0
  218. package/src/deploy/__tests__/CachedStateProvider.spec.ts +235 -0
  219. package/src/deploy/__tests__/HostingerProvider.spec.ts +347 -0
  220. package/src/deploy/__tests__/LocalStateProvider.spec.ts +130 -0
  221. package/src/deploy/__tests__/Route53Provider.spec.ts +425 -0
  222. package/src/deploy/__tests__/SSMStateProvider.spec.ts +201 -0
  223. package/src/deploy/__tests__/__fixtures__/entry-apps/async-entry.ts +24 -0
  224. package/src/deploy/__tests__/__fixtures__/entry-apps/nested-config-entry.ts +24 -0
  225. package/src/deploy/__tests__/__fixtures__/entry-apps/no-env-entry.ts +12 -0
  226. package/src/deploy/__tests__/__fixtures__/entry-apps/simple-entry.ts +14 -0
  227. package/src/deploy/__tests__/__fixtures__/entry-apps/throwing-entry.ts +16 -0
  228. package/src/deploy/__tests__/__fixtures__/env-parsers/non-function-export.ts +10 -0
  229. package/src/deploy/__tests__/__fixtures__/env-parsers/optional-env-parser.ts +21 -0
  230. package/src/deploy/__tests__/__fixtures__/env-parsers/parseable-env-parser.ts +18 -0
  231. package/src/deploy/__tests__/__fixtures__/env-parsers/throwing-env-parser.ts +16 -0
  232. package/src/deploy/__tests__/__fixtures__/env-parsers/valid-env-parser.ts +16 -0
  233. package/src/deploy/__tests__/__fixtures__/route-apps/endpoints/auth.ts +16 -0
  234. package/src/deploy/__tests__/__fixtures__/route-apps/endpoints/health.ts +13 -0
  235. package/src/deploy/__tests__/__fixtures__/route-apps/endpoints/users.ts +15 -0
  236. package/src/deploy/__tests__/__fixtures__/route-apps/services.ts +55 -0
  237. package/src/deploy/__tests__/backup-provisioner.spec.ts +428 -0
  238. package/src/deploy/__tests__/createDnsProvider.spec.ts +195 -0
  239. package/src/deploy/__tests__/createStateProvider.spec.ts +126 -0
  240. package/src/deploy/__tests__/dns-orchestration.spec.ts +192 -0
  241. package/src/deploy/__tests__/dns-verification.spec.ts +229 -0
  242. package/src/deploy/__tests__/docker.spec.ts +149 -0
  243. package/src/deploy/__tests__/dokploy-api.spec.ts +697 -0
  244. package/src/deploy/__tests__/dokploy.spec.ts +435 -0
  245. package/src/deploy/__tests__/domain.spec.ts +235 -0
  246. package/src/deploy/__tests__/env-resolver.spec.ts +903 -0
  247. package/src/deploy/__tests__/index.spec.ts +1091 -0
  248. package/src/deploy/__tests__/init.spec.ts +793 -0
  249. package/src/deploy/__tests__/secrets.spec.ts +303 -0
  250. package/src/deploy/__tests__/sniffer.spec.ts +838 -0
  251. package/src/deploy/__tests__/state-e2e.spec.ts +387 -0
  252. package/src/deploy/__tests__/state.spec.ts +876 -0
  253. package/src/deploy/__tests__/undeploy.spec.ts +758 -0
  254. package/src/deploy/backup-provisioner.ts +316 -0
  255. package/src/deploy/dns/DnsProvider.ts +201 -0
  256. package/src/deploy/dns/HostingerProvider.ts +174 -0
  257. package/src/deploy/dns/Route53Provider.ts +340 -0
  258. package/src/deploy/dns/hostinger-api.ts +261 -0
  259. package/src/deploy/dns/index.ts +627 -0
  260. package/src/deploy/docker.ts +260 -0
  261. package/src/deploy/dokploy-api.ts +1101 -0
  262. package/src/deploy/dokploy.ts +177 -0
  263. package/src/deploy/domain.ts +134 -0
  264. package/src/deploy/env-resolver.ts +305 -0
  265. package/src/deploy/index.ts +2094 -0
  266. package/src/deploy/init.ts +427 -0
  267. package/src/deploy/secrets.ts +187 -0
  268. package/src/deploy/sniffer-envkit-patch.ts +61 -0
  269. package/src/deploy/sniffer-hooks.ts +57 -0
  270. package/src/deploy/sniffer-loader.ts +28 -0
  271. package/src/deploy/sniffer-routes-worker.ts +104 -0
  272. package/src/deploy/sniffer-worker.ts +75 -0
  273. package/src/deploy/sniffer.ts +578 -0
  274. package/src/deploy/state-commands.ts +274 -0
  275. package/src/deploy/state.ts +482 -0
  276. package/src/deploy/types.ts +102 -0
  277. package/src/deploy/undeploy.ts +407 -0
  278. package/src/dev/__tests__/entry-integration.spec.ts +347 -0
  279. package/src/dev/__tests__/entry.spec.ts +144 -0
  280. package/src/dev/__tests__/index.spec.ts +2084 -0
  281. package/src/dev/index.ts +1649 -0
  282. package/src/docker/__tests__/compose.spec.ts +1142 -0
  283. package/src/docker/__tests__/templates.spec.ts +694 -0
  284. package/src/docker/compose.ts +812 -0
  285. package/src/docker/index.ts +523 -0
  286. package/src/docker/templates.ts +1067 -0
  287. package/src/exec/index.ts +118 -0
  288. package/src/generators/CronGenerator.ts +105 -0
  289. package/src/generators/EndpointGenerator.ts +954 -0
  290. package/src/generators/FunctionGenerator.ts +117 -0
  291. package/src/generators/Generator.ts +147 -0
  292. package/src/generators/OpenApiTsGenerator.ts +821 -0
  293. package/src/generators/QueueGenerator.ts +245 -0
  294. package/src/generators/SubscriberGenerator.ts +282 -0
  295. package/src/generators/TopicGenerator.ts +45 -0
  296. package/src/generators/__tests__/CronGenerator.spec.ts +445 -0
  297. package/src/generators/__tests__/EndpointGenerator.spec.ts +544 -0
  298. package/src/generators/__tests__/FunctionGenerator.spec.ts +256 -0
  299. package/src/generators/__tests__/Generator.bustCache.spec.ts +72 -0
  300. package/src/generators/__tests__/OpenApiTsGenerator.registry.spec.ts +98 -0
  301. package/src/generators/__tests__/OpenApiTsGenerator.responseType.spec.ts +56 -0
  302. package/src/generators/__tests__/QueueGenerator.spec.ts +141 -0
  303. package/src/generators/__tests__/SubscriberGenerator.spec.ts +410 -0
  304. package/src/generators/index.ts +11 -0
  305. package/src/index.ts +972 -0
  306. package/src/init/__tests__/generators.spec.ts +1072 -0
  307. package/src/init/__tests__/init.spec.ts +577 -0
  308. package/src/init/__tests__/utils.spec.ts +104 -0
  309. package/src/init/generators/auth.ts +225 -0
  310. package/src/init/generators/config.ts +316 -0
  311. package/src/init/generators/docker.ts +388 -0
  312. package/src/init/generators/env.ts +62 -0
  313. package/src/init/generators/index.ts +6 -0
  314. package/src/init/generators/mobile-expo.ts +576 -0
  315. package/src/init/generators/models.ts +153 -0
  316. package/src/init/generators/monorepo.ts +475 -0
  317. package/src/init/generators/package.ts +95 -0
  318. package/src/init/generators/source.ts +15 -0
  319. package/src/init/generators/test.ts +178 -0
  320. package/src/init/generators/ui.ts +1473 -0
  321. package/src/init/generators/web-tanstack.ts +348 -0
  322. package/src/init/generators/web.ts +363 -0
  323. package/src/init/index.ts +542 -0
  324. package/src/init/templates/api.ts +404 -0
  325. package/src/init/templates/index.ts +342 -0
  326. package/src/init/templates/minimal.ts +207 -0
  327. package/src/init/templates/serverless.ts +148 -0
  328. package/src/init/templates/worker.ts +216 -0
  329. package/src/init/utils.ts +197 -0
  330. package/src/init/versions.ts +52 -0
  331. package/src/openapi-react-query.ts +288 -0
  332. package/src/openapi.ts +259 -0
  333. package/src/secrets/__tests__/encryption.spec.ts +226 -0
  334. package/src/secrets/__tests__/generator.spec.ts +575 -0
  335. package/src/secrets/__tests__/index.spec.ts +91 -0
  336. package/src/secrets/__tests__/reconcile.spec.ts +123 -0
  337. package/src/secrets/__tests__/storage.spec.ts +645 -0
  338. package/src/secrets/encryption.ts +91 -0
  339. package/src/secrets/generator.ts +329 -0
  340. package/src/secrets/index.ts +417 -0
  341. package/src/secrets/keystore.ts +144 -0
  342. package/src/secrets/reconcile.ts +53 -0
  343. package/src/secrets/storage.ts +337 -0
  344. package/src/secrets/sync.ts +136 -0
  345. package/src/secrets/types.ts +70 -0
  346. package/src/setup/__tests__/auto-setup.spec.ts +147 -0
  347. package/src/setup/__tests__/reconcile-secrets.spec.ts +439 -0
  348. package/src/setup/fullstack-secrets.ts +140 -0
  349. package/src/setup/index.ts +411 -0
  350. package/src/test/__tests__/__fixtures__/workspace.ts +104 -0
  351. package/src/test/__tests__/api.spec.ts +199 -0
  352. package/src/test/__tests__/auth.spec.ts +162 -0
  353. package/src/test/__tests__/index.spec.ts +502 -0
  354. package/src/test/__tests__/web.spec.ts +210 -0
  355. package/src/test/index.ts +198 -0
  356. package/src/types.ts +363 -0
  357. package/src/upgrade/__tests__/index.spec.ts +354 -0
  358. package/src/upgrade/index.ts +253 -0
  359. package/src/workspace/__tests__/client-generator.spec.ts +326 -0
  360. package/src/workspace/__tests__/index.spec.ts +766 -0
  361. package/src/workspace/__tests__/publicEnv.spec.ts +64 -0
  362. package/src/workspace/__tests__/schema.spec.ts +737 -0
  363. package/src/workspace/__tests__/type-inference.spec.ts +251 -0
  364. package/src/workspace/client-generator.ts +109 -0
  365. package/src/workspace/index.ts +433 -0
  366. package/src/workspace/publicEnv.ts +57 -0
  367. package/src/workspace/schema.ts +861 -0
  368. package/src/workspace/types.ts +943 -0
  369. package/tsconfig.json +9 -0
  370. package/tsdown.config.ts +22 -0
  371. package/bin/adjacent-tsconfig.mjs +0 -97
  372. package/bin/owning-tsconfig-jsx-register.mjs +0 -18
  373. package/bin/owning-tsconfig-jsx.mjs +0 -108
  374. package/dist/EndpointGenerator-Bor2tZCm.mjs +0 -1031
  375. package/dist/EndpointGenerator-Bor2tZCm.mjs.map +0 -1
  376. package/dist/EndpointGenerator-De03t1hd.cjs +0 -1090
  377. package/dist/EndpointGenerator-De03t1hd.cjs.map +0 -1
  378. package/dist/GoDaddyProvider-C2fK-zeQ.mjs +0 -388
  379. package/dist/GoDaddyProvider-C2fK-zeQ.mjs.map +0 -1
  380. package/dist/GoDaddyProvider-SLlyDwD1.cjs +0 -388
  381. package/dist/GoDaddyProvider-SLlyDwD1.cjs.map +0 -1
  382. package/dist/HostingerProvider-BNpS9aRJ.mjs.map +0 -1
  383. package/dist/HostingerProvider-DR1iws1P.cjs.map +0 -1
  384. package/dist/LegacyStateStore-CAvxM8U5.cjs +0 -124
  385. package/dist/LegacyStateStore-CAvxM8U5.cjs.map +0 -1
  386. package/dist/LegacyStateStore-D9QDWCst.mjs +0 -124
  387. package/dist/LegacyStateStore-D9QDWCst.mjs.map +0 -1
  388. package/dist/LocalStateStore-DPQSqkSb.mjs +0 -167
  389. package/dist/LocalStateStore-DPQSqkSb.mjs.map +0 -1
  390. package/dist/LocalStateStore-QcrdjCl6.cjs +0 -178
  391. package/dist/LocalStateStore-QcrdjCl6.cjs.map +0 -1
  392. package/dist/OpenApiTsGenerator-CS_RtWOz.cjs +0 -541
  393. package/dist/OpenApiTsGenerator-CS_RtWOz.cjs.map +0 -1
  394. package/dist/OpenApiTsGenerator-DWAF-7Fu.mjs +0 -536
  395. package/dist/OpenApiTsGenerator-DWAF-7Fu.mjs.map +0 -1
  396. package/dist/Route53Provider-Bllus2NR.cjs.map +0 -1
  397. package/dist/Route53Provider-QXxjkZO1.mjs.map +0 -1
  398. package/dist/S3StateStore-C16tVikU.cjs +0 -222
  399. package/dist/S3StateStore-C16tVikU.cjs.map +0 -1
  400. package/dist/S3StateStore-jorgKaee.mjs +0 -223
  401. package/dist/S3StateStore-jorgKaee.mjs.map +0 -1
  402. package/dist/SSMStateStore-Dvjt_INw.mjs +0 -205
  403. package/dist/SSMStateStore-Dvjt_INw.mjs.map +0 -1
  404. package/dist/SSMStateStore-mPAEr2P2.cjs +0 -204
  405. package/dist/SSMStateStore-mPAEr2P2.cjs.map +0 -1
  406. package/dist/SubscriberGenerator-CyN2VF5X.mjs +0 -449
  407. package/dist/SubscriberGenerator-CyN2VF5X.mjs.map +0 -1
  408. package/dist/SubscriberGenerator-Dvz7EzqK.cjs +0 -490
  409. package/dist/SubscriberGenerator-Dvz7EzqK.cjs.map +0 -1
  410. package/dist/add-CZIIsTcv.mjs +0 -718
  411. package/dist/add-CZIIsTcv.mjs.map +0 -1
  412. package/dist/add-SRk65Udu.cjs +0 -720
  413. package/dist/add-SRk65Udu.cjs.map +0 -1
  414. package/dist/appPorts-C9z9Pzn9.mjs +0 -223
  415. package/dist/appPorts-C9z9Pzn9.mjs.map +0 -1
  416. package/dist/appPorts-Cu79hJF6.cjs +0 -264
  417. package/dist/appPorts-Cu79hJF6.cjs.map +0 -1
  418. package/dist/aws-8QQ8n-t6.mjs +0 -89
  419. package/dist/aws-8QQ8n-t6.mjs.map +0 -1
  420. package/dist/aws-DY9NqQIT.cjs +0 -100
  421. package/dist/aws-DY9NqQIT.cjs.map +0 -1
  422. package/dist/awsStore-Bx5nCFnS.mjs +0 -121
  423. package/dist/awsStore-Bx5nCFnS.mjs.map +0 -1
  424. package/dist/awsStore-u3ehhMoY.cjs +0 -138
  425. package/dist/awsStore-u3ehhMoY.cjs.map +0 -1
  426. package/dist/backup-provisioner-C8DnCmxK.mjs.map +0 -1
  427. package/dist/backup-provisioner-oDEsPj02.cjs.map +0 -1
  428. package/dist/bundler-B0Pj5FXT.cjs +0 -169
  429. package/dist/bundler-B0Pj5FXT.cjs.map +0 -1
  430. package/dist/bundler-DxJ-cIEt.mjs +0 -169
  431. package/dist/bundler-DxJ-cIEt.mjs.map +0 -1
  432. package/dist/cli-CRDJWWmZ.cjs +0 -73
  433. package/dist/cli-CRDJWWmZ.cjs.map +0 -1
  434. package/dist/cli-CV85bY3-.mjs +0 -73
  435. package/dist/cli-CV85bY3-.mjs.map +0 -1
  436. package/dist/compose-CQQRRJC3.mjs +0 -1511
  437. package/dist/compose-CQQRRJC3.mjs.map +0 -1
  438. package/dist/compose-DMY4ouEk.cjs +0 -1558
  439. package/dist/compose-DMY4ouEk.cjs.map +0 -1
  440. package/dist/config-CS76CzXM.d.cts +0 -269
  441. package/dist/config-CS76CzXM.d.cts.map +0 -1
  442. package/dist/config-pBzLfNef.d.mts +0 -269
  443. package/dist/config-pBzLfNef.d.mts.map +0 -1
  444. package/dist/config.cjs.map +0 -1
  445. package/dist/config.mjs.map +0 -1
  446. package/dist/credentialSchemas-BJFvfkaz.mjs +0 -237
  447. package/dist/credentialSchemas-BJFvfkaz.mjs.map +0 -1
  448. package/dist/credentialSchemas-CAPKFkrG.cjs +0 -272
  449. package/dist/credentialSchemas-CAPKFkrG.cjs.map +0 -1
  450. package/dist/credentials-B5N5yKk6.mjs +0 -267
  451. package/dist/credentials-B5N5yKk6.mjs.map +0 -1
  452. package/dist/credentials-Zqr3QQYB.cjs +0 -350
  453. package/dist/credentials-Zqr3QQYB.cjs.map +0 -1
  454. package/dist/databases-BeGP5eDh.mjs +0 -495
  455. package/dist/databases-BeGP5eDh.mjs.map +0 -1
  456. package/dist/databases-DGALFDG3.cjs +0 -598
  457. package/dist/databases-DGALFDG3.cjs.map +0 -1
  458. package/dist/define-6poNqm5O.mjs +0 -106
  459. package/dist/define-6poNqm5O.mjs.map +0 -1
  460. package/dist/define-crmMcXFS.cjs +0 -153
  461. package/dist/define-crmMcXFS.cjs.map +0 -1
  462. package/dist/deploy/public.cjs +0 -211
  463. package/dist/deploy/public.cjs.map +0 -1
  464. package/dist/deploy/public.d.cts +0 -664
  465. package/dist/deploy/public.d.cts.map +0 -1
  466. package/dist/deploy/public.d.mts +0 -664
  467. package/dist/deploy/public.d.mts.map +0 -1
  468. package/dist/deploy/public.mjs +0 -144
  469. package/dist/deploy/public.mjs.map +0 -1
  470. package/dist/deploy/sniffer-envparser-worker.cjs +0 -54
  471. package/dist/deploy/sniffer-envparser-worker.cjs.map +0 -1
  472. package/dist/deploy/sniffer-envparser-worker.d.cts +0 -1
  473. package/dist/deploy/sniffer-envparser-worker.d.mts +0 -1
  474. package/dist/deploy/sniffer-envparser-worker.mjs +0 -55
  475. package/dist/deploy/sniffer-envparser-worker.mjs.map +0 -1
  476. package/dist/deploy-277jek46.cjs +0 -2068
  477. package/dist/deploy-277jek46.cjs.map +0 -1
  478. package/dist/deploy-Dw8g3sLY.mjs +0 -2019
  479. package/dist/deploy-Dw8g3sLY.mjs.map +0 -1
  480. package/dist/derive-B4vDpzgP.mjs +0 -150
  481. package/dist/derive-B4vDpzgP.mjs.map +0 -1
  482. package/dist/derive-DAbo49sm.cjs +0 -161
  483. package/dist/derive-DAbo49sm.cjs.map +0 -1
  484. package/dist/discover-CU1LjCOf.d.cts +0 -108
  485. package/dist/discover-CU1LjCOf.d.cts.map +0 -1
  486. package/dist/discover-DJCCgimv.d.mts +0 -108
  487. package/dist/discover-DJCCgimv.d.mts.map +0 -1
  488. package/dist/discover-DPgu-ScS.cjs +0 -600
  489. package/dist/discover-DPgu-ScS.cjs.map +0 -1
  490. package/dist/discover-qjFapetL.mjs +0 -527
  491. package/dist/discover-qjFapetL.mjs.map +0 -1
  492. package/dist/dns-4RAiVFa7.cjs +0 -55
  493. package/dist/dns-4RAiVFa7.cjs.map +0 -1
  494. package/dist/dns-CU22K_i0.mjs +0 -44
  495. package/dist/dns-CU22K_i0.mjs.map +0 -1
  496. package/dist/dns-Dhjbnjgl.cjs +0 -663
  497. package/dist/dns-Dhjbnjgl.cjs.map +0 -1
  498. package/dist/dns-LqWzPb8l.mjs +0 -610
  499. package/dist/dns-LqWzPb8l.mjs.map +0 -1
  500. package/dist/dokploy-D_uCbZQ7.mjs +0 -38
  501. package/dist/dokploy-D_uCbZQ7.mjs.map +0 -1
  502. package/dist/dokploy-Dw4oCXqR.cjs +0 -38
  503. package/dist/dokploy-Dw4oCXqR.cjs.map +0 -1
  504. package/dist/drivers-CTaWrA_L.mjs +0 -177
  505. package/dist/drivers-CTaWrA_L.mjs.map +0 -1
  506. package/dist/drivers-DDojgzz0.cjs +0 -200
  507. package/dist/drivers-DDojgzz0.cjs.map +0 -1
  508. package/dist/emit-C1e8qD08.mjs +0 -193
  509. package/dist/emit-C1e8qD08.mjs.map +0 -1
  510. package/dist/emit-Dmc1nvdS.cjs +0 -210
  511. package/dist/emit-Dmc1nvdS.cjs.map +0 -1
  512. package/dist/encryption-C0uKYE9v.mjs +0 -89
  513. package/dist/encryption-C0uKYE9v.mjs.map +0 -1
  514. package/dist/encryption-CtVPHWWq.cjs +0 -90
  515. package/dist/encryption-CtVPHWWq.cjs.map +0 -1
  516. package/dist/engine-BE5PdE8S.mjs +0 -3080
  517. package/dist/engine-BE5PdE8S.mjs.map +0 -1
  518. package/dist/engine-HI8aLw1M.cjs +0 -3193
  519. package/dist/engine-HI8aLw1M.cjs.map +0 -1
  520. package/dist/errors-D8Gwp5kU.mjs +0 -23
  521. package/dist/errors-D8Gwp5kU.mjs.map +0 -1
  522. package/dist/errors-DMC4Umsb.cjs +0 -34
  523. package/dist/errors-DMC4Umsb.cjs.map +0 -1
  524. package/dist/github-BCdfZ9zO.cjs +0 -818
  525. package/dist/github-BCdfZ9zO.cjs.map +0 -1
  526. package/dist/github-CT3X720_.mjs +0 -818
  527. package/dist/github-CT3X720_.mjs.map +0 -1
  528. package/dist/index-DKtB01YC.d.cts +0 -190
  529. package/dist/index-DKtB01YC.d.cts.map +0 -1
  530. package/dist/index-ZAUrXH6Q.d.mts +0 -190
  531. package/dist/index-ZAUrXH6Q.d.mts.map +0 -1
  532. package/dist/local-BwC2v2Y8.mjs +0 -224
  533. package/dist/local-BwC2v2Y8.mjs.map +0 -1
  534. package/dist/local-DNhnkugT.cjs +0 -241
  535. package/dist/local-DNhnkugT.cjs.map +0 -1
  536. package/dist/migrate-CCZUgxMK.mjs +0 -266
  537. package/dist/migrate-CCZUgxMK.mjs.map +0 -1
  538. package/dist/migrate-Cs7kQxD5.cjs +0 -271
  539. package/dist/migrate-Cs7kQxD5.cjs.map +0 -1
  540. package/dist/migrate-DBGyoBvZ.cjs +0 -181
  541. package/dist/migrate-DBGyoBvZ.cjs.map +0 -1
  542. package/dist/migrate-DH-lOK3j.mjs +0 -181
  543. package/dist/migrate-DH-lOK3j.mjs.map +0 -1
  544. package/dist/openapi.cjs.map +0 -1
  545. package/dist/openapi.mjs.map +0 -1
  546. package/dist/projectBucket-BjeDcAYy.cjs +0 -206
  547. package/dist/projectBucket-BjeDcAYy.cjs.map +0 -1
  548. package/dist/projectBucket-DrkEht-j.mjs +0 -177
  549. package/dist/projectBucket-DrkEht-j.mjs.map +0 -1
  550. package/dist/provider-BqpjG9QM.cjs +0 -57
  551. package/dist/provider-BqpjG9QM.cjs.map +0 -1
  552. package/dist/provider-CEOKk8NS.mjs +0 -46
  553. package/dist/provider-CEOKk8NS.mjs.map +0 -1
  554. package/dist/ready-D3PIjx3S.cjs +0 -403
  555. package/dist/ready-D3PIjx3S.cjs.map +0 -1
  556. package/dist/ready-naOSJpeJ.mjs +0 -374
  557. package/dist/ready-naOSJpeJ.mjs.map +0 -1
  558. package/dist/reconcile/public.cjs +0 -7
  559. package/dist/reconcile/public.d.cts +0 -49
  560. package/dist/reconcile/public.d.cts.map +0 -1
  561. package/dist/reconcile/public.d.mts +0 -49
  562. package/dist/reconcile/public.d.mts.map +0 -1
  563. package/dist/reconcile/public.mjs +0 -3
  564. package/dist/reconcile--I7V4Klj.mjs.map +0 -1
  565. package/dist/reconcile-CuCQBa5-.cjs.map +0 -1
  566. package/dist/resolve-CScrqgdC.cjs +0 -316
  567. package/dist/resolve-CScrqgdC.cjs.map +0 -1
  568. package/dist/resolve-OfLaxaxY.mjs +0 -263
  569. package/dist/resolve-OfLaxaxY.mjs.map +0 -1
  570. package/dist/rollback-D7p4wJNO.cjs +0 -165
  571. package/dist/rollback-D7p4wJNO.cjs.map +0 -1
  572. package/dist/rollback-DQBSN-i7.mjs +0 -136
  573. package/dist/rollback-DQBSN-i7.mjs.map +0 -1
  574. package/dist/rolldown-runtime-BhDjJH2R.mjs +0 -15
  575. package/dist/run-BJLIerMM.mjs +0 -133
  576. package/dist/run-BJLIerMM.mjs.map +0 -1
  577. package/dist/run-fVZ-rLnc.cjs +0 -174
  578. package/dist/run-fVZ-rLnc.cjs.map +0 -1
  579. package/dist/runtime-BlHOVx8L.d.cts +0 -82
  580. package/dist/runtime-BlHOVx8L.d.cts.map +0 -1
  581. package/dist/runtime-DMq9C3KB.d.mts +0 -82
  582. package/dist/runtime-DMq9C3KB.d.mts.map +0 -1
  583. package/dist/s3-CUKzBBae.mjs +0 -215
  584. package/dist/s3-CUKzBBae.mjs.map +0 -1
  585. package/dist/s3-QQi4sNOQ.cjs +0 -215
  586. package/dist/s3-QQi4sNOQ.cjs.map +0 -1
  587. package/dist/sandbox/config-worker.cjs +0 -43
  588. package/dist/sandbox/config-worker.cjs.map +0 -1
  589. package/dist/sandbox/config-worker.d.cts +0 -1
  590. package/dist/sandbox/config-worker.d.mts +0 -1
  591. package/dist/sandbox/config-worker.mjs +0 -44
  592. package/dist/sandbox/config-worker.mjs.map +0 -1
  593. package/dist/sandbox/credentials-worker.cjs +0 -54
  594. package/dist/sandbox/credentials-worker.cjs.map +0 -1
  595. package/dist/sandbox/credentials-worker.d.cts +0 -1
  596. package/dist/sandbox/credentials-worker.d.mts +0 -1
  597. package/dist/sandbox/credentials-worker.mjs +0 -55
  598. package/dist/sandbox/credentials-worker.mjs.map +0 -1
  599. package/dist/sandbox/discover-worker.cjs +0 -47
  600. package/dist/sandbox/discover-worker.cjs.map +0 -1
  601. package/dist/sandbox/discover-worker.d.cts +0 -1
  602. package/dist/sandbox/discover-worker.d.mts +0 -1
  603. package/dist/sandbox/discover-worker.mjs +0 -48
  604. package/dist/sandbox/discover-worker.mjs.map +0 -1
  605. package/dist/sandbox/migrate-worker.cjs +0 -75
  606. package/dist/sandbox/migrate-worker.cjs.map +0 -1
  607. package/dist/sandbox/migrate-worker.d.cts +0 -1
  608. package/dist/sandbox/migrate-worker.d.mts +0 -1
  609. package/dist/sandbox/migrate-worker.mjs +0 -76
  610. package/dist/sandbox/migrate-worker.mjs.map +0 -1
  611. package/dist/sandbox-ArJ_hEKk.d.cts +0 -104
  612. package/dist/sandbox-ArJ_hEKk.d.cts.map +0 -1
  613. package/dist/sandbox-CHv3OYXg.cjs +0 -165
  614. package/dist/sandbox-CHv3OYXg.cjs.map +0 -1
  615. package/dist/sandbox-CbVB7uOD.mjs +0 -118
  616. package/dist/sandbox-CbVB7uOD.mjs.map +0 -1
  617. package/dist/sandbox-Cm4X6HRh.d.mts +0 -104
  618. package/dist/sandbox-Cm4X6HRh.d.mts.map +0 -1
  619. package/dist/schemas-BObwxB_t.cjs +0 -6017
  620. package/dist/schemas-BObwxB_t.cjs.map +0 -1
  621. package/dist/schemas-D-xeKJDD.mjs +0 -5916
  622. package/dist/schemas-D-xeKJDD.mjs.map +0 -1
  623. package/dist/secrets-AA_tQUl-.mjs +0 -36
  624. package/dist/secrets-AA_tQUl-.mjs.map +0 -1
  625. package/dist/secrets-B_biKsKx.cjs +0 -47
  626. package/dist/secrets-B_biKsKx.cjs.map +0 -1
  627. package/dist/secretsManager-CQORubp9.mjs +0 -97
  628. package/dist/secretsManager-CQORubp9.mjs.map +0 -1
  629. package/dist/secretsManager-RAGcEDX1.cjs +0 -108
  630. package/dist/secretsManager-RAGcEDX1.cjs.map +0 -1
  631. package/dist/seeds-BvxWUGKJ.mjs +0 -8263
  632. package/dist/seeds-BvxWUGKJ.mjs.map +0 -1
  633. package/dist/seeds-Df4BI-T3.cjs +0 -9266
  634. package/dist/seeds-Df4BI-T3.cjs.map +0 -1
  635. package/dist/sniffer-BqjXvcaK.mjs +0 -1825
  636. package/dist/sniffer-BqjXvcaK.mjs.map +0 -1
  637. package/dist/sniffer-DZeQJKty.cjs +0 -1998
  638. package/dist/sniffer-DZeQJKty.cjs.map +0 -1
  639. package/dist/sst-CGdjHn2A.mjs +0 -441
  640. package/dist/sst-CGdjHn2A.mjs.map +0 -1
  641. package/dist/sst-DGuHDxVU.cjs +0 -464
  642. package/dist/sst-DGuHDxVU.cjs.map +0 -1
  643. package/dist/stack-A6MAFZ6u.mjs +0 -1201
  644. package/dist/stack-A6MAFZ6u.mjs.map +0 -1
  645. package/dist/stack-BpkZEEfB.cjs +0 -1308
  646. package/dist/stack-BpkZEEfB.cjs.map +0 -1
  647. package/dist/stages-6SEoRA4x.mjs +0 -190
  648. package/dist/stages-6SEoRA4x.mjs.map +0 -1
  649. package/dist/stages-DH5z89eT.cjs +0 -190
  650. package/dist/stages-DH5z89eT.cjs.map +0 -1
  651. package/dist/target/public.cjs +0 -15
  652. package/dist/target/public.d.cts +0 -28
  653. package/dist/target/public.d.cts.map +0 -1
  654. package/dist/target/public.d.mts +0 -28
  655. package/dist/target/public.d.mts.map +0 -1
  656. package/dist/target/public.mjs +0 -4
  657. package/dist/terminal-CPHuH4S1.cjs +0 -85
  658. package/dist/terminal-CPHuH4S1.cjs.map +0 -1
  659. package/dist/terminal-iNmAXXjs.mjs +0 -85
  660. package/dist/terminal-iNmAXXjs.mjs.map +0 -1
  661. package/dist/types-DipUP9zp.d.cts +0 -7606
  662. package/dist/types-DipUP9zp.d.cts.map +0 -1
  663. package/dist/types-Drpl9HX9.d.mts +0 -7605
  664. package/dist/types-Drpl9HX9.d.mts.map +0 -1
  665. package/dist/utils-D2Nk1Nv2.cjs +0 -205
  666. package/dist/utils-D2Nk1Nv2.cjs.map +0 -1
  667. package/dist/utils-D_fxUqvU.mjs +0 -156
  668. package/dist/utils-D_fxUqvU.mjs.map +0 -1
  669. package/dist/vitest.cjs +0 -65
  670. package/dist/vitest.cjs.map +0 -1
  671. package/dist/vitest.d.cts +0 -29
  672. package/dist/vitest.d.cts.map +0 -1
  673. package/dist/vitest.d.mts +0 -29
  674. package/dist/vitest.d.mts.map +0 -1
  675. package/dist/vitest.mjs +0 -65
  676. package/dist/vitest.mjs.map +0 -1
  677. package/dist/workerRuntime-BXfhbe13.cjs +0 -108
  678. package/dist/workerRuntime-BXfhbe13.cjs.map +0 -1
  679. package/dist/workerRuntime-CsOyBRx2.mjs +0 -79
  680. package/dist/workerRuntime-CsOyBRx2.mjs.map +0 -1
  681. package/dist/workspace-BBeT6Pil.mjs +0 -2088
  682. package/dist/workspace-BBeT6Pil.mjs.map +0 -1
  683. package/dist/workspace-BJ78Bgvm.cjs +0 -2494
  684. package/dist/workspace-BJ78Bgvm.cjs.map +0 -1
@@ -1,2494 +0,0 @@
1
- const require_errors = require("./errors-DMC4Umsb.cjs");
2
- const require_schemas = require("./schemas-BObwxB_t.cjs");
3
- const require_define = require("./define-crmMcXFS.cjs");
4
- let node_path = require("node:path");
5
- let node_net = require("node:net");
6
- //#region src/secrets/providers.ts
7
- /**
8
- * The secrets stores gkm ships, by name — with no imports, so the config
9
- * loader can check `secrets.store` without loading any store.
10
- */
11
- /** The stores this package ships, by the name `secrets.store` gives them. */
12
- const SECRETS_STORE_PROVIDERS = [
13
- "file",
14
- "ssm",
15
- "secrets-manager",
16
- "s3"
17
- ];
18
- /**
19
- * `secrets.store` names a provider this package does not ship — a typo such
20
- * as `'secretsmanager'` or `'ssm-parameter'`. Refused rather than read as the
21
- * file, which would leave a deployed stage's secrets on one machine.
22
- */
23
- var UnknownSecretsStoreProvider = class extends require_errors.GkmError {
24
- provider;
25
- constructor(provider) {
26
- super(`secrets.store names the provider ${JSON.stringify(provider)}, which is not one gkm ships. Use 'file', { provider: 's3' }, { provider: 'ssm', region }, { provider: 'secrets-manager', region }, or { provider: <an object with name, read() and write()> } in gkm.config.ts.`);
27
- this.provider = provider;
28
- this.name = "UnknownSecretsStoreProvider";
29
- }
30
- };
31
- /**
32
- * Refuse a `secrets.store` naming a provider that is not one, before the
33
- * schema reduces it to a generic validation failure.
34
- */
35
- function assertKnownSecretsStore(store) {
36
- if (store === void 0) return;
37
- const provider = typeof store === "object" && store !== null && "provider" in store ? store.provider : store;
38
- if (typeof provider === "string" && !SECRETS_STORE_PROVIDERS.includes(provider)) throw new UnknownSecretsStoreProvider(provider);
39
- }
40
- /**
41
- * An `s3` secrets store names no region, and the deploy state is not in S3 to
42
- * take one from.
43
- */
44
- var S3SecretsStoreNeedsRegion = class extends require_errors.GkmError {
45
- constructor() {
46
- super("secrets.store is { provider: 's3' } with no region, and the deploy state is not in S3 to take one from. Name it — secrets: { store: { provider: 's3', region: '<region>' } } — or keep the state beside it: state: { provider: 's3', region: '<region>' }.");
47
- this.name = "S3SecretsStoreNeedsRegion";
48
- }
49
- };
50
- /**
51
- * Where an `s3` store keeps a stage's secrets. With no bucket named it is the
52
- * project bucket, beside the deploy state; region and prefix default to the
53
- * state's when that is in S3 too, so the two are written once.
54
- *
55
- * @throws {S3SecretsStoreNeedsRegion} when no region is named or inherited
56
- */
57
- function s3SecretsLocation(store, state) {
58
- const s3State = typeof state === "object" && state !== null && state.provider === "s3" ? state : void 0;
59
- const region = store.region ?? s3State?.region;
60
- if (!region) throw new S3SecretsStoreNeedsRegion();
61
- return {
62
- bucket: store.bucket,
63
- region,
64
- prefix: (store.prefix ?? s3State?.prefix ?? "gkm").replace(/\/+$/, "")
65
- };
66
- }
67
- /** The key a stage's secrets are kept at: `<prefix>/<project>/<stage>/secrets.json`. */
68
- function s3SecretsKey(prefix, project, stage) {
69
- const path = `${project}/${stage}/secrets.json`;
70
- return prefix ? `${prefix}/${path}` : path;
71
- }
72
- //#endregion
73
- //#region src/compose/dnsConfig.ts
74
- /**
75
- * `dns['<root domain>'].records` — how a domain's hosts point at a compose
76
- * stage's server — checked and read. Pure, and kept apart from the DNS step
77
- * so the workspace schema checks a config with the same rules and the same
78
- * named errors the step applies.
79
- */
80
- /** The stage-secret key holding the server's public IPv4 address. */
81
- const SERVER_IPV4_KEY = "GKM_SERVER_IPV4";
82
- /** The stage-secret key holding the server's public IPv6 address, if any. */
83
- const SERVER_IPV6_KEY = "GKM_SERVER_IPV6";
84
- /**
85
- * Whether a stage secret is gkm's own — the server's address — and so never
86
- * written into an app's or a worker's environment.
87
- */
88
- function isReservedStageKey(key) {
89
- return key.startsWith("GKM_SERVER_");
90
- }
91
- /** A DNS hostname: dot-separated labels of letters, digits and inner '-'. */
92
- const HOSTNAME = /^(?=.{1,253}$)([a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)(\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+$/i;
93
- /** Whether `value` is a DNS hostname with at least two labels. */
94
- function isHostname(value) {
95
- return typeof value === "string" && HOSTNAME.test(value);
96
- }
97
- /** A CNAME target that is not a hostname under its own domain. */
98
- var DnsTargetInvalid = class extends require_errors.GkmError {
99
- domain;
100
- target;
101
- stage;
102
- constructor(domain, target, stage) {
103
- super(`dns['${domain}'].records.target${stage ? ` for '${stage}'` : ""} is ${JSON.stringify(target)}, which is not a hostname under ${domain}. Every host's CNAME points at it and gkm writes its A record, so it must be a name in the same zone — like 'server.${domain}'.`);
104
- this.domain = domain;
105
- this.target = target;
106
- this.stage = stage;
107
- this.name = "DnsTargetInvalid";
108
- }
109
- };
110
- /** The CNAME target names under one domain, by the stage they are for, checked. */
111
- function targets(records) {
112
- const { target } = records;
113
- if (target && typeof target === "object" && !Array.isArray(target)) return Object.entries(target);
114
- return [[void 0, target]];
115
- }
116
- /**
117
- * One domain's records mode checked.
118
- *
119
- * @throws {DnsTargetInvalid} for a target that is not a hostname under it
120
- */
121
- function checkDnsRecordsMode(domain, records) {
122
- if (!records || typeof records !== "object") return;
123
- const mode = records;
124
- if (mode.mode !== "cname") return;
125
- for (const [stage, target] of targets(mode)) {
126
- const name = typeof target === "string" ? target.toLowerCase() : target;
127
- if (!isHostname(name) || !name.endsWith(`.${domain.toLowerCase()}`)) throw new DnsTargetInvalid(domain, target, stage);
128
- }
129
- }
130
- /**
131
- * The CNAME target a domain's hosts point at on `stage`, or `undefined` for
132
- * A records — including a per-stage map that names no target for it.
133
- */
134
- function cnameTarget(records, stage) {
135
- if (!records || records === "a") return void 0;
136
- return (typeof records.target === "string" ? records.target : records.target[stage])?.toLowerCase();
137
- }
138
- //#endregion
139
- //#region src/compose/proxy.ts
140
- /**
141
- * Which proxy a stage's stack is served by, and with whose certificate —
142
- * `deploy.compose.proxy` and `deploy.compose.tls`, resolved for one stage.
143
- *
144
- * Pure, and kept apart from the stack so the workspace schema can check a
145
- * config with the same rules — and the same named errors — the stack applies.
146
- */
147
- /** A per-stage setting keyed by a stage the workspace does not have. */
148
- var ComposeStageUnknown = class extends require_errors.GkmError {
149
- setting;
150
- stage;
151
- stages;
152
- constructor(setting, stage, stages) {
153
- super(`deploy.compose.${setting} names the stage '${stage}', which is not one of this workspace's (${stages.join(", ")}). Use a stage from stages.local or stages.deployed.`);
154
- this.setting = setting;
155
- this.stage = stage;
156
- this.stages = stages;
157
- this.name = "ComposeStageUnknown";
158
- }
159
- };
160
- /**
161
- * A certificate for the local stage, whose certificates are always Caddy's
162
- * own CA — the one `gkm trust` installs.
163
- */
164
- var ComposeTlsOnLocalStage = class extends require_errors.GkmError {
165
- stage;
166
- constructor(stage) {
167
- super(`deploy.compose.tls sets a certificate for '${stage}', the local stage, whose certificates always come from Caddy's local CA (\`gkm trust\` installs it). Remove it, or set it for a deployed stage.`);
168
- this.stage = stage;
169
- this.name = "ComposeTlsOnLocalStage";
170
- }
171
- };
172
- /** The stage's certificate or key file is not there to read. */
173
- var ComposeTlsFileMissing = class extends require_errors.GkmError {
174
- stage;
175
- file;
176
- constructor(stage, file) {
177
- super(`deploy.compose.tls for '${stage}' names ${file}, and there is no file there. Point certFile and keyFile at the PEM certificate (with its chain) and key — relative to the workspace root, or absolute.`);
178
- this.stage = stage;
179
- this.file = file;
180
- this.name = "ComposeTlsFileMissing";
181
- }
182
- };
183
- /**
184
- * The proxy a stage's stack is served by. The local stage is always Caddy —
185
- * its internal CA and `gkm trust` — whatever is configured.
186
- */
187
- function proxyFor(config, stage, local) {
188
- if (local) return "caddy";
189
- const proxy = config?.proxy;
190
- if (!proxy) return "caddy";
191
- if (typeof proxy === "string") return proxy;
192
- return proxy[stage] ?? "caddy";
193
- }
194
- /** A deployed stage's own certificate, its paths absolute, when it sets one. */
195
- function certificateFor(config, stage, root) {
196
- const tls = config?.tls?.[stage];
197
- if (!tls) return void 0;
198
- const absolute = (file) => (0, node_path.isAbsolute)(file) ? file : (0, node_path.resolve)(root, file);
199
- return {
200
- certFile: absolute(tls.certFile),
201
- keyFile: absolute(tls.keyFile)
202
- };
203
- }
204
- /**
205
- * Throws the named error for the first thing wrong with the per-stage
206
- * settings: a stage the workspace does not have, or a certificate for the
207
- * local stage.
208
- */
209
- function checkComposeStages(config, stages) {
210
- const known = [stages.local, ...stages.deployed];
211
- if (config?.proxy && typeof config.proxy === "object") {
212
- for (const stage of Object.keys(config.proxy)) if (!known.includes(stage)) throw new ComposeStageUnknown("proxy", stage, known);
213
- }
214
- for (const stage of Object.keys(config?.tls ?? {})) {
215
- if (stage === stages.local) throw new ComposeTlsOnLocalStage(stage);
216
- if (!known.includes(stage)) throw new ComposeStageUnknown("tls", stage, known);
217
- }
218
- }
219
- //#endregion
220
- //#region src/providers/s3/errors.ts
221
- /** What the `s3` provider refuses, and how each is put right. */
222
- /** An `objects` entry for `s3` with a field it does not take or cannot use. */
223
- var S3ProviderConfigInvalid = class extends require_errors.GkmError {
224
- stage;
225
- field;
226
- value;
227
- expected;
228
- constructor(stage, field, value, expected) {
229
- super(`deploy.objects.${stage}.${field} is ${JSON.stringify(value)}; ${expected}.`);
230
- this.stage = stage;
231
- this.field = field;
232
- this.value = value;
233
- this.expected = expected;
234
- this.name = "S3ProviderConfigInvalid";
235
- }
236
- };
237
- /** No region anywhere to create the stage's buckets in. */
238
- var S3RegionRequired = class extends require_errors.GkmError {
239
- stage;
240
- constructor(stage) {
241
- super(`The s3 provider has no region for the stage '${stage}'. Name one in gkm.config.ts: deploy: { objects: { ${stage}: { provider: 's3', region: 'eu-west-1' } } } — or set AWS_REGION.`);
242
- this.stage = stage;
243
- this.name = "S3RegionRequired";
244
- }
245
- };
246
- /** The good name and every suffixed one are taken by other accounts. */
247
- var BucketNameUnavailable = class extends require_errors.GkmError {
248
- id;
249
- tried;
250
- constructor(id, tried) {
251
- super(`Every name tried for the bucket '${id}' is taken by another AWS account: ${tried.join(", ")}. Set deploy.namespace in gkm.config.ts to something more particular to you, and run the provision again.`);
252
- this.id = id;
253
- this.tried = tried;
254
- this.name = "BucketNameUnavailable";
255
- }
256
- };
257
- /** A bucket in this account carries another project's tag. */
258
- var BucketOwnedByAnotherProject = class extends require_errors.GkmError {
259
- bucket;
260
- owner;
261
- project;
262
- constructor(bucket, owner, project) {
263
- super(`The bucket '${bucket}' is in this account and tagged gkm:project=${owner}, not ${project}: another project's. gkm never adopts it. Set deploy.namespace in gkm.config.ts so this project names its buckets differently.`);
264
- this.bucket = bucket;
265
- this.owner = owner;
266
- this.project = project;
267
- this.name = "BucketOwnedByAnotherProject";
268
- }
269
- };
270
- /** The bucket the stage's state names exists, and this account cannot reach it. */
271
- var RecordedBucketUnreachable = class extends require_errors.GkmError {
272
- id;
273
- bucket;
274
- constructor(id, bucket) {
275
- super(`The stage's state records '${bucket}' as the bucket for '${id}', and this account cannot reach it — it is in another account, or the credentials are not the stage account's. Run with the account that created it (--profile).`);
276
- this.id = id;
277
- this.bucket = bucket;
278
- this.name = "RecordedBucketUnreachable";
279
- }
280
- };
281
- /** An IAM user by gkm's name exists, and gkm did not create it for this stage. */
282
- var IamUserNotOwned = class extends require_errors.GkmError {
283
- user;
284
- project;
285
- stage;
286
- constructor(user, project, stage) {
287
- super(`The IAM user '${user}' exists and is not tagged gkm:project=${project}, gkm:stage=${stage}, so gkm leaves it alone. Rename or delete it, or set deploy.namespace in gkm.config.ts so gkm names its users differently.`);
288
- this.user = user;
289
- this.project = project;
290
- this.stage = stage;
291
- this.name = "IamUserNotOwned";
292
- }
293
- };
294
- /** The user already has the two access keys IAM allows. */
295
- var AccessKeyLimit = class extends require_errors.GkmError {
296
- user;
297
- keys;
298
- constructor(user, keys) {
299
- super(`The IAM user '${user}' already has two access keys (${keys.join(", ")}), the most IAM allows, and gkm needs to issue one. Delete the one the stage does not use (aws iam delete-access-key --user-name ${user} --access-key-id …), then run the provision again.`);
300
- this.user = user;
301
- this.keys = keys;
302
- this.name = "AccessKeyLimit";
303
- }
304
- };
305
- /** `--rotate-keys` while the last rotation's old key is still active. */
306
- var RotationInProgress = class extends require_errors.GkmError {
307
- id;
308
- previous;
309
- stage;
310
- constructor(id, previous, stage) {
311
- super(`The bucket '${id}' is mid-rotation: its old key ${previous} is still active until '${stage}' is deployed with the new one: deploy it (gkm deploy --stage ${stage}) — the next deploy after that deletes the old key — or pass --retire-old-keys to delete it now, before rotating again.`);
312
- this.id = id;
313
- this.previous = previous;
314
- this.stage = stage;
315
- this.name = "RotationInProgress";
316
- }
317
- };
318
- /** The stage's secrets point the bucket's key at a bucket gkm did not provision. */
319
- var BucketKeySetElsewhere = class extends require_errors.GkmError {
320
- key;
321
- bucket;
322
- found;
323
- stage;
324
- constructor(key, bucket, found, stage) {
325
- super(`${key} in the stage '${stage}' points at the bucket '${found}', and the s3 provider manages '${bucket}' for it. Remove the key (gkm secrets:unset ${key} --stage ${stage}) to have the provider write its own, or set deploy.objects.${stage} to 'external' to keep yours.`);
326
- this.key = key;
327
- this.bucket = bucket;
328
- this.found = found;
329
- this.stage = stage;
330
- this.name = "BucketKeySetElsewhere";
331
- }
332
- };
333
- /** `verify()`: a provisioned bucket the stage's key cannot reach. */
334
- var ProvisionedBucketUnreachable = class extends require_errors.GkmError {
335
- id;
336
- bucket;
337
- stage;
338
- reason;
339
- constructor(id, bucket, stage, reason) {
340
- super(`The bucket '${bucket}' (${id}) cannot be reached with the key in the stage '${stage}''s secrets: ${reason}. Deploy '${stage}' with the stage account's credentials (gkm deploy --stage ${stage}), which creates or repairs it — a run with --skip-resources does not.`);
341
- this.id = id;
342
- this.bucket = bucket;
343
- this.stage = stage;
344
- this.reason = reason;
345
- this.name = "ProvisionedBucketUnreachable";
346
- }
347
- };
348
- /**
349
- * `verify()`: the bucket answers from another region than the one its URL
350
- * names — S3 redirects (301) or refuses the signature (400) and says where
351
- * the bucket is.
352
- */
353
- var BucketRegionMismatch = class extends require_errors.GkmError {
354
- id;
355
- bucket;
356
- stage;
357
- key;
358
- bucketRegion;
359
- urlRegion;
360
- askedRegion;
361
- answer;
362
- constructor(id, bucket, stage, key, bucketRegion, urlRegion, askedRegion, answer) {
363
- const says = urlRegion ? `says ${urlRegion}` : `names no region, so ${askedRegion} was asked`;
364
- super(`The bucket '${bucket}' (${id}) is in ${bucketRegion}, but ${key} in the stage '${stage}''s secrets ${says} (${answer}). Deploy '${stage}' with the stage account's credentials (gkm deploy --stage ${stage}): the s3 provider reads the bucket's region and rewrites ${key} with it. Set deploy.objects.${stage}.region to '${bucketRegion}' in gkm.config.ts so the stage's config says where its buckets are.`);
365
- this.id = id;
366
- this.bucket = bucket;
367
- this.stage = stage;
368
- this.key = key;
369
- this.bucketRegion = bucketRegion;
370
- this.urlRegion = urlRegion;
371
- this.askedRegion = askedRegion;
372
- this.answer = answer;
373
- this.name = "BucketRegionMismatch";
374
- }
375
- };
376
- /** Neither `HeadBucket` nor `GetBucketLocation` says where a bucket is. */
377
- var BucketRegionUnknown = class extends require_errors.GkmError {
378
- bucket;
379
- head;
380
- location;
381
- constructor(bucket, head, location) {
382
- super(`gkm cannot tell which region the bucket '${bucket}' is in: HeadBucket answered ${head}, and GetBucketLocation ${location}. Check that the provisioning credentials are the stage account's and may call s3:GetBucketLocation on it, then run the deploy again.`);
383
- this.bucket = bucket;
384
- this.head = head;
385
- this.location = location;
386
- this.name = "BucketRegionUnknown";
387
- }
388
- };
389
- /** `HeadBucket` answered neither yes, no, nor "another account's". */
390
- var BucketProbeFailed = class extends require_errors.GkmError {
391
- bucket;
392
- answer;
393
- constructor(bucket, answer) {
394
- super(`gkm asked S3 whether the bucket '${bucket}' exists and got ${answer}. Check the provisioning credentials and the stage's region, then run the deploy again.`);
395
- this.bucket = bucket;
396
- this.answer = answer;
397
- this.name = "BucketProbeFailed";
398
- }
399
- };
400
- //#endregion
401
- //#region src/providers/s3/config.ts
402
- const FIELDS = [
403
- "provider",
404
- "region",
405
- "versioning"
406
- ];
407
- /** An AWS region code: `eu-west-1`, `us-gov-west-1`, `ap-southeast-4`. */
408
- const REGION = /^[a-z]{2}(-[a-z]+)+-\d+$/;
409
- function checkS3Config(stage, config) {
410
- const entry = config;
411
- for (const field of Object.keys(entry)) if (!FIELDS.includes(field)) throw new S3ProviderConfigInvalid(stage, field, entry[field], `the s3 provider takes ${FIELDS.slice(1).join(" and ")} only`);
412
- if (entry.region !== void 0) {
413
- if (typeof entry.region !== "string" || !REGION.test(entry.region)) throw new S3ProviderConfigInvalid(stage, "region", entry.region, "set it to an AWS region code, like 'eu-west-1'");
414
- }
415
- if (entry.versioning !== void 0 && typeof entry.versioning !== "boolean") throw new S3ProviderConfigInvalid(stage, "versioning", entry.versioning, "set it to true to keep previous versions of every object, or leave it out");
416
- return entry;
417
- }
418
- /** How the s3 provider's provisioning credentials are supplied. */
419
- const S3_PROVISIONING = {
420
- env: [
421
- "AWS_PROFILE",
422
- "AWS_ACCESS_KEY_ID",
423
- "AWS_SECRET_ACCESS_KEY",
424
- "AWS_SESSION_TOKEN"
425
- ],
426
- describe: "the stage's AWS account — AWS_PROFILE, or AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY (in CI, what aws-actions/configure-aws-credentials exports)"
427
- };
428
- //#endregion
429
- //#region src/providers/config.ts
430
- /**
431
- * `deploy.<kind>.<stage>`, read: what backs one kind of construct on a stage.
432
- *
433
- * Kept free of the providers themselves — of the AWS SDK and the graph — so
434
- * the workspace schema can check an entry with the words a deploy would use,
435
- * the way `checkStageTelemetry` does for `deploy.telemetry`.
436
- */
437
- /** Each provider's config check, by kind and name. */
438
- const CHECKS = { objects: { s3: checkS3Config } };
439
- /** How each provider's provisioning credentials are supplied, by kind and name. */
440
- const PROVISIONING = { objects: { s3: S3_PROVISIONING } };
441
- /** How `name`'s provisioning credentials are supplied, for messages. */
442
- function provisioningOf(kind, name) {
443
- return Object.hasOwn(PROVISIONING[kind], name) ? PROVISIONING[kind][name] : void 0;
444
- }
445
- /** The `provider:` names a kind accepts. */
446
- function providerNamesOf(kind) {
447
- return Object.keys(CHECKS[kind]).sort();
448
- }
449
- /** What `deploy.<kind>.<stage>` may be, for messages. */
450
- function accepted(kind) {
451
- return [
452
- "'external'",
453
- ...providerNamesOf(kind).map((name) => `{ provider: '${name}' }`),
454
- "false"
455
- ].join(", ");
456
- }
457
- /** An entry that names no provider gkm has, or is not an entry at all. */
458
- var UnknownStageProvider = class extends require_errors.GkmError {
459
- kind;
460
- stage;
461
- value;
462
- constructor(kind, stage, value) {
463
- super(`deploy.${kind}.${stage} is ${JSON.stringify(value)}, which is not a provider gkm has for ${kind}. It takes ${accepted(kind)}.`);
464
- this.kind = kind;
465
- this.stage = stage;
466
- this.value = value;
467
- this.name = "UnknownStageProvider";
468
- }
469
- };
470
- /**
471
- * One stage's entry checked: `'external'`, `false`, or a provider's object
472
- * that its own check accepts.
473
- *
474
- * @throws {UnknownStageProvider} for anything else — `'minio'` included
475
- */
476
- function checkStageProvider(kind, stage, value) {
477
- if (value === "external" || value === false) return value;
478
- if (value && typeof value === "object" && !Array.isArray(value)) {
479
- const name = value.provider;
480
- const check = typeof name === "string" && Object.hasOwn(CHECKS[kind], name) ? CHECKS[kind][name] : void 0;
481
- if (check) return check(stage, value);
482
- }
483
- throw new UnknownStageProvider(kind, stage, value);
484
- }
485
- /**
486
- * What backs `kind` on `stage`: the local stage is always `external` here —
487
- * `gkm dev` runs its own — and a deployed stage that names nothing is too.
488
- */
489
- function stageProvider(workspace, kind, stage) {
490
- if (stage === workspace.stages?.local) return { mode: "external" };
491
- const value = workspace.deploy?.[kind]?.[stage];
492
- if (value === void 0) return { mode: "external" };
493
- const entry = checkStageProvider(kind, stage, value);
494
- if (entry === "external") return { mode: "external" };
495
- if (entry === false) return { mode: "none" };
496
- return {
497
- mode: "provider",
498
- name: entry.provider,
499
- config: entry
500
- };
501
- }
502
- //#endregion
503
- //#region src/compose/logsConfig.ts
504
- /**
505
- * The self-hosted telemetry provider's options, read: how the stack's
506
- * OpenObserve is run and reached — `deploy.telemetry.<stage>` with
507
- * `provider: 'self-hosted'`.
508
- *
509
- * Kept apart from the stack so the workspace schema can check a config with
510
- * the same rules — and the same named errors — the stack applies.
511
- */
512
- /** The port OpenObserve listens on, and the one it is published on by default. */
513
- const LOGS_PORT = 5080;
514
- /** `public` with no address to allow: nobody could reach it. */
515
- var LogsAllowEmpty = class extends require_errors.GkmError {
516
- stage;
517
- constructor(stage) {
518
- super(`deploy.telemetry.${stage}.public.allow is empty, so the logs site would answer every request with 403. List the addresses that may reach it (public: { allow: ['203.0.113.7', '10.0.0.0/8'] }), or remove public and reach it through an SSH tunnel.`);
519
- this.stage = stage;
520
- this.name = "LogsAllowEmpty";
521
- }
522
- };
523
- /** An `allow` entry that is not an IP address or a CIDR range. */
524
- var LogsAllowEntryInvalid = class extends require_errors.GkmError {
525
- stage;
526
- entry;
527
- constructor(stage, entry) {
528
- super(`deploy.telemetry.${stage}.public.allow has '${entry}', which is not an IP address or a CIDR range. Write one like '203.0.113.7', '10.0.0.0/8' or '2001:db8::/32'.`);
529
- this.stage = stage;
530
- this.entry = entry;
531
- this.name = "LogsAllowEntryInvalid";
532
- }
533
- };
534
- /** A retention OpenObserve would refuse to start with. */
535
- var LogsRetentionInvalid = class extends require_errors.GkmError {
536
- stage;
537
- retentionDays;
538
- constructor(stage, retentionDays) {
539
- super(`deploy.telemetry.${stage}.retentionDays is ${String(retentionDays)}; it must be a whole number of days, at least 3 — OpenObserve refuses to start with fewer. Leave it out for 30.`);
540
- this.stage = stage;
541
- this.retentionDays = retentionDays;
542
- this.name = "LogsRetentionInvalid";
543
- }
544
- };
545
- /** A port that is not one. */
546
- var LogsPortInvalid = class extends require_errors.GkmError {
547
- stage;
548
- port;
549
- constructor(stage, port) {
550
- super(`deploy.telemetry.${stage}.port is ${String(port)}; set it to a number between 1 and 65535, or leave it out for ${LOGS_PORT}.`);
551
- this.stage = stage;
552
- this.port = port;
553
- this.name = "LogsPortInvalid";
554
- }
555
- };
556
- /** Whether `entry` is an IP address, or an address and a prefix length. */
557
- function isAddressOrRange(entry) {
558
- const [address = "", prefix, ...rest] = entry.split("/");
559
- if (rest.length > 0) return false;
560
- const family = (0, node_net.isIP)(address);
561
- if (family === 0) return false;
562
- if (prefix === void 0) return true;
563
- if (!/^\d{1,3}$/.test(prefix)) return false;
564
- return Number(prefix) <= (family === 4 ? 32 : 128);
565
- }
566
- /**
567
- * The self-hosted provider's options with their defaults — `{}` for all of
568
- * them. Throws the named error for the first thing wrong with them.
569
- */
570
- function resolveSelfHosted(config, stage) {
571
- const port = config.port ?? 5080;
572
- if (!Number.isInteger(port) || port < 1 || port > 65535) throw new LogsPortInvalid(stage, config.port);
573
- const retentionDays = config.retentionDays ?? 30;
574
- if (!Number.isInteger(retentionDays) || retentionDays < 3) throw new LogsRetentionInvalid(stage, config.retentionDays);
575
- if (config.public) {
576
- const allow = config.public.allow ?? [];
577
- if (allow.length === 0) throw new LogsAllowEmpty(stage);
578
- for (const entry of allow) if (!isAddressOrRange(entry)) throw new LogsAllowEntryInvalid(stage, entry);
579
- return {
580
- port,
581
- retentionDays,
582
- public: { allow: [...allow] }
583
- };
584
- }
585
- return {
586
- port,
587
- retentionDays
588
- };
589
- }
590
- //#endregion
591
- //#region src/telemetry/config.ts
592
- /**
593
- * `deploy.telemetry`, read: where one stage's telemetry goes, and how much.
594
- *
595
- * The application says what it emits (the `Telemetry` construct). This says
596
- * where it is sent, per stage, and is the only place that does:
597
- *
598
- * - **self-hosted** — the target runs OpenObserve beside the apps (#189's
599
- * stack service). A server target that can run it uses it when a stage
600
- * names nothing.
601
- * - **otlp** — any OTLP/HTTP endpoint, with its headers.
602
- * - **false** — nothing is sent.
603
- *
604
- * Vendor presets (a known endpoint and header shape, with the stage secret
605
- * `TELEMETRY_CREDENTIALS`) are one more entry in {@link PROVIDERS}: a
606
- * resolver from the stage's config to a {@link ResolvedTelemetry}, which
607
- * every target already consumes through {@link telemetryEnv}.
608
- *
609
- * The local stage ignores all of it: `gkm dev` and `gkm compose` on it run
610
- * OpenObserve and keep every trace.
611
- */
612
- /** A deployed stage uses telemetry and its target cannot choose for it. */
613
- var TelemetryProviderRequired = class extends require_errors.GkmError {
614
- stage;
615
- target;
616
- constructor(stage, target) {
617
- super(`The stage '${stage}' deploys through ${target}, which cannot run telemetry itself, and a process uses a Telemetry construct. Say where it goes in gkm.config.ts: deploy: { telemetry: { ${stage}: { provider: 'otlp', endpoint: 'https://…' } } } — or deploy: { telemetry: { ${stage}: false } } to send nothing.`);
618
- this.stage = stage;
619
- this.target = target;
620
- this.name = "TelemetryProviderRequired";
621
- }
622
- };
623
- /** A stage asks for the self-hosted provider on a target that cannot run it. */
624
- var SelfHostedTelemetryUnavailable = class extends require_errors.GkmError {
625
- stage;
626
- target;
627
- constructor(stage, target) {
628
- super(`deploy.telemetry.${stage} is 'self-hosted', and ${target} does not run OpenObserve beside the apps — the compose target does. Deploy '${stage}' through compose, or send its telemetry elsewhere: deploy: { telemetry: { ${stage}: { provider: 'otlp', endpoint: 'https://…' } } }.`);
629
- this.stage = stage;
630
- this.target = target;
631
- this.name = "SelfHostedTelemetryUnavailable";
632
- }
633
- };
634
- /** A sample rate that is not a fraction. */
635
- var TelemetrySampleRateInvalid = class extends require_errors.GkmError {
636
- stage;
637
- sampleRate;
638
- constructor(stage, sampleRate) {
639
- super(`deploy.telemetry.${stage}.sampleRate is ${String(sampleRate)}; set it to a number from 0 to 1 — the fraction of traces kept — or leave it out to keep every one.`);
640
- this.stage = stage;
641
- this.sampleRate = sampleRate;
642
- this.name = "TelemetrySampleRateInvalid";
643
- }
644
- };
645
- /** An OTLP endpoint that is not an http(s) URL. */
646
- var TelemetryEndpointInvalid = class extends require_errors.GkmError {
647
- stage;
648
- endpoint;
649
- constructor(stage, endpoint) {
650
- super(`deploy.telemetry.${stage}.endpoint is ${JSON.stringify(endpoint)}; set it to the collector's OTLP/HTTP base URL, like 'https://otlp.example.com' — /v1/traces and /v1/logs are added to it.`);
651
- this.stage = stage;
652
- this.endpoint = endpoint;
653
- this.name = "TelemetryEndpointInvalid";
654
- }
655
- };
656
- /** The sample rate a stage keeps, checked. */
657
- function sampleRateOf(stage, sampleRate) {
658
- const rate = sampleRate ?? 1;
659
- if (!Number.isFinite(rate) || rate < 0 || rate > 1) throw new TelemetrySampleRateInvalid(stage, sampleRate);
660
- return rate;
661
- }
662
- /**
663
- * Each provider's resolver: a stage's config to what the targets consume.
664
- * A vendor preset is one more entry here.
665
- */
666
- const PROVIDERS = {
667
- "self-hosted": (config, stage) => {
668
- const { provider: _, sampleRate, ...options } = config;
669
- return {
670
- provider: "self-hosted",
671
- selfHosted: resolveSelfHosted(options, stage),
672
- sampleRate: sampleRateOf(stage, sampleRate)
673
- };
674
- },
675
- otlp: (config, stage) => {
676
- if (typeof config.endpoint !== "string" || !isHttpUrl(config.endpoint)) throw new TelemetryEndpointInvalid(stage, config.endpoint);
677
- return {
678
- provider: "otlp",
679
- endpoint: config.endpoint.replace(/\/+$/, ""),
680
- headers: { ...config.headers },
681
- sampleRate: sampleRateOf(stage, config.sampleRate)
682
- };
683
- }
684
- };
685
- function isHttpUrl(value) {
686
- try {
687
- const url = new URL(value);
688
- return url.protocol === "http:" || url.protocol === "https:";
689
- } catch {
690
- return false;
691
- }
692
- }
693
- /**
694
- * One stage's entry, checked on its own — what the workspace schema runs, so
695
- * a bad config fails to load with the words a deploy would fail with.
696
- */
697
- function checkStageTelemetry(stage, config) {
698
- if (config === false) return void 0;
699
- const entry = config === "self-hosted" ? { provider: "self-hosted" } : config;
700
- const resolve = PROVIDERS[entry.provider];
701
- return resolve(entry, stage);
702
- }
703
- /**
704
- * Where a stage's telemetry goes, or undefined when nothing is sent — no
705
- * process uses a `Telemetry` node, or the stage opted out with `false`.
706
- *
707
- * The local stage always runs the self-hosted provider with its defaults and
708
- * keeps every trace, whatever `deploy.telemetry` says. A deployed stage that
709
- * names nothing gets the self-hosted provider where its target runs one, and
710
- * {@link TelemetryProviderRequired} where it cannot — AWS has none.
711
- */
712
- function resolveStageTelemetry(input) {
713
- const { stage } = input;
714
- if (!input.used) return void 0;
715
- if (input.local) return {
716
- provider: "self-hosted",
717
- selfHosted: resolveSelfHosted({}, stage),
718
- sampleRate: 1
719
- };
720
- const config = input.telemetry?.[stage];
721
- if (config === void 0) {
722
- if (input.runtime === "server" && input.selfHosted) return checkStageTelemetry(stage, "self-hosted");
723
- throw new TelemetryProviderRequired(stage, input.target);
724
- }
725
- const resolved = checkStageTelemetry(stage, config);
726
- if (resolved?.provider === "self-hosted" && !input.selfHosted) throw new SelfHostedTelemetryUnavailable(stage, input.target);
727
- return resolved;
728
- }
729
- /** The sampler every process with the edge runs, per the stage's rate. */
730
- const TRACES_SAMPLER = "parentbased_traceidratio";
731
- /**
732
- * `OTEL_EXPORTER_OTLP_HEADERS` for a set of headers: `key=value` pairs,
733
- * comma-separated, each value percent-encoded — the W3C baggage format the
734
- * SDK parses.
735
- */
736
- function otlpHeaderString(headers) {
737
- return Object.entries(headers).map(([key, value]) => `${key}=${encodeURIComponent(value)}`).join(",");
738
- }
739
- /**
740
- * The `OTEL_*` values a stage resolves for its `Telemetry` node, before any
741
- * one process is named: where to export, how to sign, and how much to keep.
742
- * `OTEL_SERVICE_NAME` is each process's own — see `scopeTelemetryEnv`.
743
- */
744
- function telemetryEnv(destination, sampleRate) {
745
- return {
746
- OTEL_EXPORTER_OTLP_ENDPOINT: destination.endpoint,
747
- ...destination.headers ? { OTEL_EXPORTER_OTLP_HEADERS: destination.headers } : {},
748
- OTEL_TRACES_SAMPLER: TRACES_SAMPLER,
749
- OTEL_TRACES_SAMPLER_ARG: String(sampleRate)
750
- };
751
- }
752
- /** What an `otlp` stage resolves, for every process with the edge. */
753
- function otlpTelemetryEnv(resolved) {
754
- const headers = otlpHeaderString(resolved.headers);
755
- return telemetryEnv({
756
- endpoint: resolved.endpoint,
757
- ...headers ? { headers } : {}
758
- }, resolved.sampleRate);
759
- }
760
- /**
761
- * The sample rate a stage's browsers trace page views at — a public value,
762
- * the same rate its servers sample at — or undefined when the stage sends no
763
- * telemetry. The local stage keeps every trace.
764
- *
765
- * Lenient where `resolveStageTelemetry` is strict: a site's client is built
766
- * before, and apart from, the deploy that refuses a stage with no provider.
767
- */
768
- function stageSampleRate(telemetry, stage, local) {
769
- if (local) return 1;
770
- const config = telemetry?.[stage];
771
- if (config === false) return void 0;
772
- if (config === void 0 || config === "self-hosted") return 1;
773
- return sampleRateOf(stage, config.sampleRate);
774
- }
775
- //#endregion
776
- //#region src/workspace/stages.ts
777
- /**
778
- * What `gkm test` runs as. The CLI's own, so no project stage may take it:
779
- * its containers are torn down and rebuilt between runs.
780
- */
781
- const TEST_STAGE = "test";
782
- /** A stage becomes part of every physical name, so it has to fit in one. */
783
- const STAGE_NAME = /^[a-z][a-z0-9-]*$/;
784
- /** Everything wrong with one stage name, or nothing. */
785
- function nameProblems(name) {
786
- const problems = [];
787
- if (!STAGE_NAME.test(name)) problems.push(`stage "${name}" must be lowercase letters, digits and hyphens, starting with a letter`);
788
- if (name === "test") problems.push(`stage "${TEST_STAGE}" is reserved for gkm test`);
789
- return problems;
790
- }
791
- /** Everything wrong with a list of deployed stages on its own. */
792
- function deployedProblems(deployed) {
793
- const problems = deployed.flatMap(nameProblems);
794
- const seen = /* @__PURE__ */ new Set();
795
- for (const name of deployed) {
796
- if (seen.has(name)) problems.push(`stage "${name}" is listed twice`);
797
- seen.add(name);
798
- }
799
- return problems;
800
- }
801
- /** Everything wrong with a stages block, or nothing. */
802
- function stageProblems(stages) {
803
- if (!stages) return ["`stages` is required, e.g. stages: { local: 'dev', deployed: ['prod'] }"];
804
- const { local, deployed, protected: kept = [] } = stages;
805
- const problems = [...nameProblems(local), ...deployedProblems(deployed)];
806
- if (deployed.includes(local)) problems.push(`"${local}" is both the local stage and a deployed one; they would share secrets`);
807
- for (const name of kept) if (!deployed.includes(name)) problems.push(`protected stage "${name}" is not a deployed stage`);
808
- return problems;
809
- }
810
- /** The stages block, or an error naming everything wrong with it. */
811
- function validateStages(stages) {
812
- const problems = stageProblems(stages);
813
- if (problems.length) throw new InvalidStages(problems);
814
- return stages;
815
- }
816
- /** Refuses a stage the project does not deploy to. */
817
- function assertDeployedStage(stages, stage) {
818
- if (!stages.deployed.includes(stage)) throw new UndeclaredStage(stage, stages.deployed);
819
- }
820
- /** A stages block — in gkm.config.ts or from `gkm init`'s flags — that breaks a rule. */
821
- var InvalidStages = class extends require_errors.GkmError {
822
- problems;
823
- constructor(problems) {
824
- super(`Invalid stages:\n ${problems.join("\n ")}`);
825
- this.problems = problems;
826
- this.name = "InvalidStages";
827
- }
828
- };
829
- /**
830
- * A stage the project does not deploy to. Refused before anything is
831
- * provisioned, so a typo does not become a second environment.
832
- */
833
- var UndeclaredStage = class extends require_errors.GkmError {
834
- stage;
835
- deployed;
836
- constructor(stage, deployed) {
837
- super(`"${stage}" is not a deployed stage. gkm.config.ts deploys to: ${deployed.join(", ") || "nothing yet"}.`);
838
- this.stage = stage;
839
- this.deployed = deployed;
840
- this.name = "UndeclaredStage";
841
- }
842
- };
843
- /**
844
- * A per-stage setting keyed by a stage the workspace does not deploy: a typo,
845
- * a stage since removed, or the local stage, which none of them apply to.
846
- */
847
- var UnknownStageKey = class extends require_errors.GkmError {
848
- setting;
849
- stage;
850
- deployed;
851
- local;
852
- constructor(setting, stage, deployed, local) {
853
- super(`${setting} names the stage '${stage}', ` + (stage === local ? `the local stage — ${setting} is read for deployed stages only. ` : "which is not one of this workspace's deployed stages. ") + `It takes ${deployed.length > 0 ? deployed.map((s) => `'${s}'`).join(", ") : "no stage: stages.deployed is empty"} — the stages in stages.deployed.`);
854
- this.setting = setting;
855
- this.stage = stage;
856
- this.deployed = deployed;
857
- this.local = local;
858
- this.name = "UnknownStageKey";
859
- }
860
- };
861
- /**
862
- * The first key of a per-stage map that is not a deployed stage.
863
- *
864
- * @throws {UnknownStageKey}
865
- */
866
- function assertDeployedStageKeys(setting, map, stages) {
867
- if (!map || !stages?.deployed) return;
868
- for (const key of Object.keys(map)) if (!stages.deployed.includes(key)) throw new UnknownStageKey(setting, key, stages.deployed, stages.local);
869
- }
870
- //#endregion
871
- //#region src/workspace/schema.ts
872
- /** Routes are a glob, or a list of them. */
873
- const RoutesSchema = require_schemas.union([require_schemas.string(), require_schemas.array(require_schemas.string())]);
874
- /**
875
- * Telescope configuration schema.
876
- */
877
- const TelescopeConfigSchema = require_schemas.object({
878
- enabled: require_schemas.boolean().optional(),
879
- port: require_schemas.number().optional(),
880
- path: require_schemas.string().optional(),
881
- ignore: require_schemas.array(require_schemas.string()).optional(),
882
- recordBody: require_schemas.boolean().optional(),
883
- maxEntries: require_schemas.number().optional(),
884
- websocket: require_schemas.boolean().optional()
885
- });
886
- /**
887
- * OpenAPI configuration schema.
888
- */
889
- const OpenApiConfigSchema = require_schemas.object({
890
- enabled: require_schemas.boolean().optional(),
891
- title: require_schemas.string().optional(),
892
- version: require_schemas.string().optional(),
893
- description: require_schemas.string().optional()
894
- });
895
- /**
896
- * Hooks configuration schema.
897
- */
898
- const HooksConfigSchema = require_schemas.object({ server: require_schemas.string().optional() });
899
- /**
900
- * Backend framework schema for non-gkm apps.
901
- */
902
- const BackendFrameworkSchema = require_schemas._enum([
903
- "hono",
904
- "better-auth",
905
- "express",
906
- "fastify"
907
- ]);
908
- /**
909
- * Frontend framework schema.
910
- */
911
- const FrontendFrameworkSchema = require_schemas._enum([
912
- "nextjs",
913
- "remix",
914
- "vite",
915
- "tanstack-start"
916
- ]);
917
- /**
918
- * Mobile framework schema.
919
- */
920
- const MobileFrameworkSchema = require_schemas._enum(["expo"]);
921
- /**
922
- * Combined framework schema (backend, frontend, or mobile).
923
- */
924
- const FrameworkSchema = require_schemas.union([
925
- BackendFrameworkSchema,
926
- FrontendFrameworkSchema,
927
- MobileFrameworkSchema
928
- ]);
929
- /** Frontend framework values, kept in sync with FrontendFrameworkSchema. */
930
- const FRONTEND_FRAMEWORKS = [
931
- "nextjs",
932
- "remix",
933
- "vite",
934
- "tanstack-start"
935
- ];
936
- /** Mobile framework values, kept in sync with MobileFrameworkSchema. */
937
- const MOBILE_FRAMEWORKS = ["expo"];
938
- /**
939
- * A deploy target's name. Which names exist is the workspace's to say — the
940
- * built-ins and its own `deploy.targets` — so it is checked against both
941
- * once the whole config is read.
942
- */
943
- const DeployTargetSchema = require_schemas.string().min(1);
944
- /**
945
- * The built-in targets a config may name, both deployed by `gkm deploy`:
946
- * `dokploy`, and `sst`, which runs `sst deploy` on the manifest `gkm build`
947
- * writes.
948
- */
949
- const SUPPORTED_DEPLOY_TARGETS = require_define.configurableBuiltins();
950
- /** Built-in names reserved for targets that do not exist yet. */
951
- const PHASE_2_DEPLOY_TARGETS = Object.entries(require_define.BUILTIN_TARGETS).filter(([, target]) => target.status === "planned").map(([name]) => name);
952
- /**
953
- * Whether a config may name `target`: a usable built-in, or one of its own
954
- * `deploy.targets`.
955
- */
956
- function isDeployTargetSupported(target, targets = {}) {
957
- return SUPPORTED_DEPLOY_TARGETS.includes(target) || Object.hasOwn(targets, target);
958
- }
959
- /**
960
- * Check if a deploy target is planned for Phase 2.
961
- */
962
- function isPhase2DeployTarget(target) {
963
- return PHASE_2_DEPLOY_TARGETS.includes(target);
964
- }
965
- /**
966
- * Get error message for unsupported deploy targets.
967
- */
968
- function getDeployTargetError(target, appName) {
969
- if (isPhase2DeployTarget(target)) return `Deploy target "${target}"${appName ? ` for app "${appName}"` : ""} is coming in Phase 2. Currently "dokploy" and "sst" are supported.`;
970
- return `Unknown deploy target: ${target}. Built in: ${SUPPORTED_DEPLOY_TARGETS.join(", ")}; any other is named in deploy.targets with the package that provides it. Coming in Phase 2: ${PHASE_2_DEPLOY_TARGETS.join(", ")}.`;
971
- }
972
- /**
973
- * One `deploy.targets` entry: a package name, a target object, or either
974
- * with options.
975
- */
976
- const DeployTargetEntrySchema = require_schemas.union([
977
- require_schemas.string().min(1, "A target package name cannot be empty"),
978
- require_schemas.custom((value) => require_define.isDeployTarget(value), { message: "Expected a package name, a target (defineTarget), or [package or target, options]" }),
979
- require_schemas.tuple([require_schemas.union([require_schemas.string().min(1), require_schemas.custom((value) => require_define.isDeployTarget(value), { message: "Expected a package name or a target (defineTarget)" })]), require_schemas.unknown()])
980
- ]);
981
- /**
982
- * Dokploy workspace configuration schema.
983
- * Supports either a single endpoint or per-stage endpoints.
984
- */
985
- const DokployWorkspaceConfigSchema = require_schemas.object({
986
- /** Single endpoint for all stages */
987
- endpoint: require_schemas.url("Dokploy endpoint must be a valid URL").optional(),
988
- /** Per-stage endpoints (stage name -> endpoint URL) */
989
- endpoints: require_schemas.record(require_schemas.string(), require_schemas.url("Endpoint must be a valid URL")).optional(),
990
- registryId: require_schemas.string().optional(),
991
- verify: require_schemas.object({
992
- deploymentTimeoutMs: require_schemas.number().int().positive().optional(),
993
- healthCheckPath: require_schemas.string().startsWith("/", "healthCheckPath must start with /").optional(),
994
- healthyAfter: require_schemas.number().int().positive().optional(),
995
- intervalMs: require_schemas.number().int().positive().optional(),
996
- healthTimeoutMs: require_schemas.number().int().positive().optional()
997
- }).optional()
998
- }).refine((data) => data.endpoint || data.endpoints, { message: "Either endpoint or endpoints must be provided" });
999
- /**
1000
- * Valid AWS regions.
1001
- */
1002
- const AwsRegionSchema = require_schemas._enum([
1003
- "us-east-1",
1004
- "us-east-2",
1005
- "us-west-1",
1006
- "us-west-2",
1007
- "af-south-1",
1008
- "ap-east-1",
1009
- "ap-south-1",
1010
- "ap-south-2",
1011
- "ap-southeast-1",
1012
- "ap-southeast-2",
1013
- "ap-southeast-3",
1014
- "ap-southeast-4",
1015
- "ap-northeast-1",
1016
- "ap-northeast-2",
1017
- "ap-northeast-3",
1018
- "ca-central-1",
1019
- "eu-central-1",
1020
- "eu-central-2",
1021
- "eu-west-1",
1022
- "eu-west-2",
1023
- "eu-west-3",
1024
- "eu-south-1",
1025
- "eu-south-2",
1026
- "eu-north-1",
1027
- "me-south-1",
1028
- "me-central-1",
1029
- "sa-east-1"
1030
- ]);
1031
- /**
1032
- * DNS record types supported across providers.
1033
- */
1034
- const DnsRecordTypeSchema = require_schemas._enum([
1035
- "A",
1036
- "AAAA",
1037
- "CNAME",
1038
- "MX",
1039
- "TXT",
1040
- "NS",
1041
- "SRV",
1042
- "CAA"
1043
- ]);
1044
- require_schemas.object({
1045
- /** Subdomain name (e.g., 'api' for api.example.com, '@' for root) */
1046
- name: require_schemas.string(),
1047
- /** Record type */
1048
- type: DnsRecordTypeSchema,
1049
- /** TTL in seconds */
1050
- ttl: require_schemas.number().int().positive(),
1051
- /** Record values */
1052
- values: require_schemas.array(require_schemas.string())
1053
- });
1054
- /**
1055
- * A DNS record to create or update.
1056
- */
1057
- const UpsertDnsRecordSchema = require_schemas.object({
1058
- /** Subdomain name (e.g., 'api' for api.example.com, '@' for root) */
1059
- name: require_schemas.string(),
1060
- /** Record type */
1061
- type: DnsRecordTypeSchema,
1062
- /** TTL in seconds */
1063
- ttl: require_schemas.number().int().positive(),
1064
- /** Record value (IP address, hostname, etc.) */
1065
- value: require_schemas.string()
1066
- });
1067
- require_schemas.object({
1068
- /** The record that was upserted */
1069
- record: UpsertDnsRecordSchema,
1070
- /** Whether the record was created (true) or updated (false) */
1071
- created: require_schemas.boolean(),
1072
- /** Whether the record already existed with the same value */
1073
- unchanged: require_schemas.boolean()
1074
- });
1075
- /**
1076
- * How a domain's hosts point at a compose stage's server: an A (and AAAA)
1077
- * record each (`'a'`, the default), or one A record for `target` and a CNAME
1078
- * to it for every other host but the apex. `target` is one name, or one per
1079
- * stage; it must be under the domain.
1080
- */
1081
- const DnsRecordsModeSchema = require_schemas.union([require_schemas.literal("a"), require_schemas.object({
1082
- mode: require_schemas.literal("cname"),
1083
- target: require_schemas.union([require_schemas.string(), require_schemas.record(require_schemas.string(), require_schemas.string())])
1084
- }).strict()]);
1085
- /**
1086
- * Hostinger DNS provider config (without domain - domain is the record key).
1087
- */
1088
- const HostingerDnsProviderSchema = require_schemas.object({
1089
- provider: require_schemas.literal("hostinger"),
1090
- /** How the hosts point at a compose stage's server — see {@link DnsRecordsModeSchema}. */
1091
- records: DnsRecordsModeSchema.optional(),
1092
- /** TTL in seconds (default: 300) */
1093
- ttl: require_schemas.number().int().positive().optional()
1094
- });
1095
- /**
1096
- * Route53 DNS provider config (without domain - domain is the record key).
1097
- */
1098
- const Route53DnsProviderSchema = require_schemas.object({
1099
- provider: require_schemas.literal("route53"),
1100
- /** How the hosts point at a compose stage's server — see {@link DnsRecordsModeSchema}. */
1101
- records: DnsRecordsModeSchema.optional(),
1102
- /** AWS region (optional - uses AWS_REGION env var if not provided) */
1103
- region: AwsRegionSchema.optional(),
1104
- /** AWS profile name (optional - uses default credential chain if not provided) */
1105
- profile: require_schemas.string().optional(),
1106
- /** Hosted zone ID (optional - auto-detected from domain if not provided) */
1107
- hostedZoneId: require_schemas.string().optional(),
1108
- /** TTL in seconds (default: 300) */
1109
- ttl: require_schemas.number().int().positive().optional()
1110
- });
1111
- /**
1112
- * GoDaddy DNS provider config (without domain - domain is the record key).
1113
- *
1114
- * Credentials: `GODADDY_API_TOKEN` (a Personal Access Token scoped to
1115
- * `domains.dns:update`), else `gkm login --provider godaddy`. GoDaddy refuses
1116
- * a TTL under 600 seconds.
1117
- */
1118
- const GoDaddyDnsProviderSchema = require_schemas.object({
1119
- provider: require_schemas.literal("godaddy"),
1120
- /** How the hosts point at a compose stage's server — see {@link DnsRecordsModeSchema}. */
1121
- records: DnsRecordsModeSchema.optional(),
1122
- /** TTL in seconds (default and minimum: 600) */
1123
- ttl: require_schemas.number().int().min(600, "GoDaddy's minimum TTL is 600 seconds").optional()
1124
- });
1125
- /**
1126
- * Cloudflare DNS provider config (placeholder for future).
1127
- */
1128
- const CloudflareDnsProviderSchema = require_schemas.object({
1129
- provider: require_schemas.literal("cloudflare"),
1130
- /** How the hosts point at a compose stage's server — see {@link DnsRecordsModeSchema}. */
1131
- records: DnsRecordsModeSchema.optional(),
1132
- /** TTL in seconds (default: 300) */
1133
- ttl: require_schemas.number().int().positive().optional()
1134
- });
1135
- /**
1136
- * Manual DNS configuration (user handles DNS themselves).
1137
- */
1138
- const ManualDnsProviderSchema = require_schemas.object({
1139
- provider: require_schemas.literal("manual"),
1140
- /** How the hosts point at a compose stage's server — see {@link DnsRecordsModeSchema}. */
1141
- records: DnsRecordsModeSchema.optional()
1142
- });
1143
- /**
1144
- * Custom DNS provider config (user-provided implementation).
1145
- */
1146
- const CustomDnsProviderSchema = require_schemas.object({
1147
- /** Custom DnsProvider implementation */
1148
- provider: require_schemas.custom((val) => typeof val === "object" && val !== null && typeof val.name === "string" && typeof val.getRecords === "function" && typeof val.upsertRecords === "function", { message: "Custom DNS provider must implement name, getRecords(), and upsertRecords() methods" }),
1149
- /** How the hosts point at a compose stage's server — see {@link DnsRecordsModeSchema}. */
1150
- records: DnsRecordsModeSchema.optional(),
1151
- /** TTL in seconds (default: 300) */
1152
- ttl: require_schemas.number().int().positive().optional()
1153
- });
1154
- /**
1155
- * Built-in DNS provider config (discriminated union).
1156
- */
1157
- const BuiltInDnsProviderSchema = require_schemas.discriminatedUnion("provider", [
1158
- HostingerDnsProviderSchema,
1159
- Route53DnsProviderSchema,
1160
- GoDaddyDnsProviderSchema,
1161
- CloudflareDnsProviderSchema,
1162
- ManualDnsProviderSchema
1163
- ]);
1164
- /**
1165
- * Single DNS provider config (for one domain).
1166
- */
1167
- const DnsProviderSchema = require_schemas.union([BuiltInDnsProviderSchema, CustomDnsProviderSchema]);
1168
- /**
1169
- * DNS configuration schema.
1170
- *
1171
- * Maps root domains to their DNS provider configuration.
1172
- * Example:
1173
- * ```
1174
- * dns: {
1175
- * 'geekmidas.dev': { provider: 'hostinger' },
1176
- * 'geekmidas.com': { provider: 'route53' },
1177
- * }
1178
- * ```
1179
- *
1180
- * Supported providers:
1181
- * - 'hostinger': Use Hostinger DNS API
1182
- * - 'route53': Use AWS Route53
1183
- * - 'godaddy': Use GoDaddy's v1 DNS API
1184
- * - 'cloudflare': Use Cloudflare DNS API (future)
1185
- * - 'manual': Don't create records, just print required records
1186
- * - Custom: Provide a DnsProvider implementation
1187
- */
1188
- const DnsConfigSchema = require_schemas.record(require_schemas.string(), DnsProviderSchema);
1189
- const HostingerDnsConfigSchema = HostingerDnsProviderSchema.extend({ domain: require_schemas.string().min(1, "Domain is required") });
1190
- const Route53DnsConfigSchema = Route53DnsProviderSchema.extend({ domain: require_schemas.string().min(1, "Domain is required") });
1191
- const GoDaddyDnsConfigSchema = GoDaddyDnsProviderSchema.extend({ domain: require_schemas.string().min(1, "Domain is required") });
1192
- const CloudflareDnsConfigSchema = CloudflareDnsProviderSchema.extend({ domain: require_schemas.string().min(1, "Domain is required") });
1193
- const ManualDnsConfigSchema = ManualDnsProviderSchema.extend({ domain: require_schemas.string().min(1, "Domain is required") });
1194
- const CustomDnsConfigSchema = CustomDnsProviderSchema.extend({ domain: require_schemas.string().min(1, "Domain is required") });
1195
- const BuiltInDnsConfigSchema = require_schemas.discriminatedUnion("provider", [
1196
- HostingerDnsConfigSchema,
1197
- Route53DnsConfigSchema,
1198
- GoDaddyDnsConfigSchema,
1199
- CloudflareDnsConfigSchema,
1200
- ManualDnsConfigSchema
1201
- ]);
1202
- const LegacyDnsConfigSchema = require_schemas.union([BuiltInDnsConfigSchema, CustomDnsConfigSchema]);
1203
- require_schemas.union([DnsConfigSchema, LegacyDnsConfigSchema]);
1204
- /**
1205
- * Backups configuration schema.
1206
- *
1207
- * Configures automatic backup destinations for database services.
1208
- * On first deploy, creates S3 bucket with unique name and IAM credentials.
1209
- */
1210
- const BackupsConfigSchema = require_schemas.object({
1211
- /** Backup storage type (currently only 's3' supported) */
1212
- type: require_schemas.literal("s3"),
1213
- /** AWS profile name for creating bucket/IAM resources */
1214
- profile: require_schemas.string().optional(),
1215
- /** AWS region for the backup bucket */
1216
- region: AwsRegionSchema,
1217
- /** Cron schedule for backups (default: '0 2 * * *' = 2 AM daily) */
1218
- schedule: require_schemas.string().optional(),
1219
- /** Number of backups to retain (default: 30) */
1220
- retention: require_schemas.number().optional()
1221
- });
1222
- /** `deploy.compose` — what the compose target runs beside the apps. */
1223
- const ComposeWorkspaceConfigSchema = require_schemas.object({
1224
- proxy: require_schemas.union([require_schemas._enum(["caddy", "traefik"]), require_schemas.record(require_schemas.string(), require_schemas._enum(["caddy", "traefik"]))]).optional(),
1225
- tls: require_schemas.record(require_schemas.string(), require_schemas.object({
1226
- certFile: require_schemas.string().min(1),
1227
- keyFile: require_schemas.string().min(1)
1228
- }).strict()).optional()
1229
- }).strict();
1230
- const TelemetrySampleRate = require_schemas.number().optional();
1231
- /**
1232
- * `deploy.telemetry` — where each stage's telemetry goes. The rules past the
1233
- * shape are `checkStageTelemetry`'s, so the schema and a deploy refuse the
1234
- * same configs with the same words.
1235
- */
1236
- const TelemetryConfigSchema = require_schemas.record(require_schemas.string(), require_schemas.union([
1237
- require_schemas.literal(false),
1238
- require_schemas.literal("self-hosted"),
1239
- require_schemas.object({
1240
- provider: require_schemas.literal("self-hosted"),
1241
- port: require_schemas.number().optional(),
1242
- retentionDays: require_schemas.number().optional(),
1243
- public: require_schemas.object({ allow: require_schemas.array(require_schemas.string()) }).optional(),
1244
- sampleRate: TelemetrySampleRate
1245
- }).strict(),
1246
- require_schemas.object({
1247
- provider: require_schemas.literal("otlp"),
1248
- endpoint: require_schemas.string(),
1249
- headers: require_schemas.record(require_schemas.string(), require_schemas.string()).optional(),
1250
- sampleRate: TelemetrySampleRate
1251
- }).strict()
1252
- ])).superRefine((telemetry, ctx) => {
1253
- for (const [stage, config] of Object.entries(telemetry)) try {
1254
- checkStageTelemetry(stage, config);
1255
- } catch (error) {
1256
- ctx.addIssue({
1257
- code: "custom",
1258
- message: error instanceof Error ? error.message : String(error),
1259
- path: [stage]
1260
- });
1261
- }
1262
- });
1263
- /**
1264
- * `deploy.objects` — what backs each deployed stage's buckets. The rules are
1265
- * `checkStageProvider`'s, so the schema and a provision run refuse the same
1266
- * entries with the same words.
1267
- */
1268
- const ObjectsConfigSchema = require_schemas.record(require_schemas.string(), require_schemas.unknown()).superRefine((entries, ctx) => {
1269
- for (const [stage, value] of Object.entries(entries)) try {
1270
- checkStageProvider("objects", stage, value);
1271
- } catch (error) {
1272
- ctx.addIssue({
1273
- code: "custom",
1274
- message: error instanceof Error ? error.message : String(error),
1275
- path: [stage]
1276
- });
1277
- }
1278
- });
1279
- /**
1280
- * Deploy configuration schema.
1281
- */
1282
- const DeployConfigSchema = require_schemas.object({
1283
- default: DeployTargetSchema.optional(),
1284
- targets: require_schemas.record(require_schemas.string(), DeployTargetEntrySchema).superRefine((targets, ctx) => {
1285
- for (const name of Object.keys(targets)) if (require_define.builtinTarget(name)) ctx.addIssue({
1286
- code: "custom",
1287
- message: `"${name}" is a built-in target; give this one a name of its own`,
1288
- path: [name]
1289
- });
1290
- }).optional(),
1291
- /** Whose deploy this is, on a target shared with other workspaces. */
1292
- namespace: require_schemas.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, "deploy.namespace must be lowercase letters and digits with single '-' between them").optional(),
1293
- /** Where every target pushes and pulls the apps' images. */
1294
- registry: require_schemas.string().min(1).optional(),
1295
- dokploy: DokployWorkspaceConfigSchema.optional(),
1296
- compose: ComposeWorkspaceConfigSchema.optional(),
1297
- telemetry: TelemetryConfigSchema.optional(),
1298
- objects: ObjectsConfigSchema.optional(),
1299
- backups: BackupsConfigSchema.optional()
1300
- });
1301
- /**
1302
- * Models configuration schema.
1303
- */
1304
- const ModelsConfigSchema = require_schemas.object({
1305
- path: require_schemas.string().optional(),
1306
- schema: require_schemas._enum(["zod"]).optional()
1307
- });
1308
- /**
1309
- * Shared configuration schema.
1310
- */
1311
- const SharedConfigSchema = require_schemas.object({
1312
- packages: require_schemas.array(require_schemas.string()).optional(),
1313
- models: ModelsConfigSchema.optional()
1314
- });
1315
- /**
1316
- * Secrets configuration schema.
1317
- */
1318
- const StagesConfigSchema = require_schemas.object({
1319
- local: require_schemas.string(),
1320
- deployed: require_schemas.array(require_schemas.string()),
1321
- protected: require_schemas.array(require_schemas.string()).optional()
1322
- }).superRefine((stages, ctx) => {
1323
- for (const message of stageProblems(stages)) ctx.addIssue({
1324
- code: "custom",
1325
- message
1326
- });
1327
- });
1328
- const SecretsStoreSchema = require_schemas.union([
1329
- require_schemas.literal("file"),
1330
- require_schemas.object({
1331
- provider: require_schemas.literal("s3"),
1332
- /** A bucket that exists; omitted, the project bucket. */
1333
- bucket: require_schemas.string().min(1).optional(),
1334
- /** Omitted, the S3 deploy state's region. */
1335
- region: AwsRegionSchema.optional(),
1336
- /** Omitted, the S3 deploy state's prefix, else 'gkm'. */
1337
- prefix: require_schemas.string().optional()
1338
- }).strict(),
1339
- require_schemas.object({
1340
- provider: require_schemas.literal("ssm"),
1341
- region: AwsRegionSchema
1342
- }).strict(),
1343
- require_schemas.object({
1344
- provider: require_schemas.literal("secrets-manager"),
1345
- region: AwsRegionSchema,
1346
- kmsKeyId: require_schemas.string().min(1).optional()
1347
- }).strict(),
1348
- require_schemas.object({
1349
- /** Any backend: an object implementing SecretsStore */
1350
- provider: require_schemas.custom((val) => typeof val === "object" && val !== null && typeof val.name === "string" && typeof val.read === "function" && typeof val.write === "function", { message: "a secrets store has a name, read() and write()" }) })
1351
- ]);
1352
- const SecretsConfigSchema = require_schemas.object({
1353
- enabled: require_schemas.boolean().optional(),
1354
- store: SecretsStoreSchema.optional(),
1355
- algorithm: require_schemas.string().optional(),
1356
- kdf: require_schemas._enum(["scrypt", "pbkdf2"]).optional()
1357
- });
1358
- /**
1359
- * Local state provider config.
1360
- */
1361
- const LocalStateConfigSchema = require_schemas.object({ provider: require_schemas.literal("local") });
1362
- /**
1363
- * SSM state provider config (requires region).
1364
- */
1365
- const SSMStateConfigSchema = require_schemas.object({
1366
- provider: require_schemas.literal("ssm"),
1367
- /** AWS region (required for SSM provider) */
1368
- region: AwsRegionSchema,
1369
- /** AWS profile name (optional - uses default credential chain if not provided) */
1370
- profile: require_schemas.string().optional()
1371
- });
1372
- /**
1373
- * S3 state provider config: conditional writes and a lock object in a bucket.
1374
- */
1375
- const S3StateConfigSchema = require_schemas.object({
1376
- provider: require_schemas.literal("s3"),
1377
- /**
1378
- * Bucket the state lives in (must already exist). Omitted, the project
1379
- * bucket, created by the first deploy.
1380
- */
1381
- bucket: require_schemas.string().min(1).optional(),
1382
- /** AWS region of the bucket */
1383
- region: AwsRegionSchema,
1384
- /** Key prefix inside the bucket (default: 'gkm') */
1385
- prefix: require_schemas.string().optional(),
1386
- /** AWS profile name (optional - uses default credential chain if not provided) */
1387
- profile: require_schemas.string().optional()
1388
- });
1389
- /**
1390
- * Custom state provider config (user-provided implementation).
1391
- */
1392
- const CustomStateConfigSchema = require_schemas.object({
1393
- /** Custom StateProvider implementation */
1394
- provider: require_schemas.custom((val) => typeof val === "object" && val !== null && typeof val.read === "function" && typeof val.write === "function", { message: "Custom provider must implement read() and write() methods" }) });
1395
- /**
1396
- * Built-in state provider config (discriminated union).
1397
- */
1398
- const BuiltInStateConfigSchema = require_schemas.discriminatedUnion("provider", [
1399
- LocalStateConfigSchema,
1400
- SSMStateConfigSchema,
1401
- S3StateConfigSchema
1402
- ]);
1403
- /**
1404
- * State configuration schema.
1405
- *
1406
- * Configures how deployment state is stored.
1407
- * - 'local': Store in .gkm/deploy-{stage}.json (default)
1408
- * - 'ssm': Store in AWS SSM Parameter Store (requires region)
1409
- * - 's3': Store in an S3 bucket with conditional writes (requires region; the
1410
- * project bucket is created when no bucket is named)
1411
- * - Custom: Provide a StateStore, or a StateProvider with read/write methods
1412
- */
1413
- const StateConfigSchema = require_schemas.union([BuiltInStateConfigSchema, CustomStateConfigSchema]);
1414
- /**
1415
- * App configuration schema.
1416
- */
1417
- const AppConfigSchema = require_schemas.object({
1418
- type: require_schemas._enum([
1419
- "backend",
1420
- "web",
1421
- "mobile"
1422
- ]).optional().default("backend"),
1423
- path: require_schemas.string().min(1, "App path is required"),
1424
- port: require_schemas.number().int().positive("Port must be a positive integer"),
1425
- dependencies: require_schemas.array(require_schemas.string()).optional(),
1426
- deploy: DeployTargetSchema.optional(),
1427
- constructs: RoutesSchema.optional(),
1428
- routes: RoutesSchema.optional(),
1429
- functions: RoutesSchema.optional(),
1430
- crons: RoutesSchema.optional(),
1431
- queues: RoutesSchema.optional(),
1432
- topics: RoutesSchema.optional(),
1433
- subscribers: RoutesSchema.optional(),
1434
- envParser: require_schemas.string().optional(),
1435
- logger: require_schemas.string().optional(),
1436
- hooks: HooksConfigSchema.optional(),
1437
- telescope: require_schemas.union([
1438
- require_schemas.string(),
1439
- require_schemas.boolean(),
1440
- TelescopeConfigSchema
1441
- ]).optional(),
1442
- openapi: require_schemas.union([require_schemas.boolean(), OpenApiConfigSchema]).optional(),
1443
- runtime: require_schemas._enum(["node", "bun"]).optional(),
1444
- env: require_schemas.union([require_schemas.string(), require_schemas.array(require_schemas.string())]).optional(),
1445
- entry: require_schemas.string().optional(),
1446
- framework: FrameworkSchema.optional(),
1447
- config: require_schemas.object({
1448
- client: require_schemas.string().optional(),
1449
- server: require_schemas.string().optional()
1450
- }).optional()
1451
- }).refine((data) => {
1452
- if (data.type === "web") {
1453
- if (!data.framework || !FRONTEND_FRAMEWORKS.includes(data.framework)) return false;
1454
- }
1455
- return true;
1456
- }, {
1457
- message: `Web apps must have a valid web framework (${FRONTEND_FRAMEWORKS.join(", ")})`,
1458
- path: ["framework"]
1459
- }).refine((data) => {
1460
- if (data.type === "mobile") {
1461
- if (!data.framework || !MOBILE_FRAMEWORKS.includes(data.framework)) return false;
1462
- }
1463
- return true;
1464
- }, {
1465
- message: `Mobile apps must have a valid mobile framework (${MOBILE_FRAMEWORKS.join(", ")})`,
1466
- path: ["framework"]
1467
- });
1468
- /** What `gkm test` hands a feature test. */
1469
- const TestConfigSchema = require_schemas.object({
1470
- /** The folder of per-database factories; `test/factories` by default. */
1471
- factories: require_schemas.string().optional() }).strict();
1472
- /** How `gkm dev` is reached from outside the apps it runs. */
1473
- const DevConfigSchema = require_schemas.object({
1474
- /** Browser origins that may read the discovery endpoint. */
1475
- allowedOrigins: require_schemas.array(require_schemas.url().refine((value) => URL.canParse(value) && new URL(value).origin === value, { message: "An origin is a scheme, host and port only, e.g. https://console.example.com — no path or trailing slash" })).optional(),
1476
- /** The discovery endpoint's loopback port; 4983 by default. */
1477
- discoveryPort: require_schemas.number().int().min(0).max(65535).optional()
1478
- }).strict();
1479
- /**
1480
- * Workspace configuration schema.
1481
- */
1482
- const WorkspaceConfigSchema = require_schemas.object({
1483
- name: require_schemas.string().optional(),
1484
- /**
1485
- * Where the workspace's own constructs live, relative to its root.
1486
- *
1487
- * Infrastructure is a fact about the product, not about the process that
1488
- * happens to import it — so a database two apps share is declared once,
1489
- * at the top, and both find it. An app-level glob still works and is
1490
- * additive, for something only one app uses.
1491
- */
1492
- constructs: RoutesSchema.optional(),
1493
- /**
1494
- * Apps that nothing declares.
1495
- *
1496
- * Optional, and normally absent: a `site` is an app and so is a
1497
- * `rest-api` that named one, so the list is read off the graph. This is
1498
- * the escape hatch for what no construct describes — a mobile app, a
1499
- * process someone runs by hand — and for overriding one field of a
1500
- * derived app without restating it.
1501
- */
1502
- apps: require_schemas.record(require_schemas.string(), AppConfigSchema).optional(),
1503
- shared: SharedConfigSchema.optional(),
1504
- /** Each deployed stage's base domain (stage name -> domain). */
1505
- domains: require_schemas.record(require_schemas.string(), require_schemas.string()).optional(),
1506
- /** Each root domain's DNS provider, and how its hosts are pointed. */
1507
- dns: DnsConfigSchema.optional(),
1508
- deploy: DeployConfigSchema.optional(),
1509
- stages: StagesConfigSchema,
1510
- secrets: SecretsConfigSchema.optional(),
1511
- state: StateConfigSchema.optional(),
1512
- test: TestConfigSchema.optional(),
1513
- dev: DevConfigSchema.optional()
1514
- }).strict().refine((data) => {
1515
- const appNames = Object.keys(data.apps ?? {});
1516
- for (const [appName, app] of Object.entries(data.apps ?? {})) for (const dep of app.dependencies ?? []) {
1517
- if (!appNames.includes(dep)) return false;
1518
- if (dep === appName) return false;
1519
- }
1520
- return true;
1521
- }, { message: "App dependencies must reference existing apps and cannot be self-referential" }).refine((data) => {
1522
- const appNames = Object.keys(data.apps ?? {});
1523
- const visited = /* @__PURE__ */ new Set();
1524
- const recStack = /* @__PURE__ */ new Set();
1525
- function hasCycle(app) {
1526
- if (recStack.has(app)) return true;
1527
- if (visited.has(app)) return false;
1528
- visited.add(app);
1529
- recStack.add(app);
1530
- const deps = data.apps?.[app]?.dependencies ?? [];
1531
- for (const dep of deps) if (hasCycle(dep)) return true;
1532
- recStack.delete(app);
1533
- return false;
1534
- }
1535
- for (const app of appNames) {
1536
- visited.clear();
1537
- recStack.clear();
1538
- if (hasCycle(app)) return false;
1539
- }
1540
- return true;
1541
- }, { message: "Circular dependencies detected between apps" }).superRefine((data, ctx) => {
1542
- const defaultTarget = data.deploy?.default;
1543
- const ownTargets = data.deploy?.targets ?? {};
1544
- if (defaultTarget && !isDeployTargetSupported(defaultTarget, ownTargets)) {
1545
- ctx.addIssue({
1546
- code: "custom",
1547
- message: getDeployTargetError(defaultTarget),
1548
- path: ["deploy", "default"]
1549
- });
1550
- return;
1551
- }
1552
- for (const [appName, app] of Object.entries(data.apps ?? {})) if (app.deploy && !isDeployTargetSupported(app.deploy, ownTargets)) {
1553
- ctx.addIssue({
1554
- code: "custom",
1555
- message: getDeployTargetError(app.deploy, appName),
1556
- path: [
1557
- "apps",
1558
- appName,
1559
- "deploy"
1560
- ]
1561
- });
1562
- return;
1563
- }
1564
- const store = data.secrets?.store;
1565
- if (typeof store === "object" && store.provider === "s3") try {
1566
- s3SecretsLocation(store, data.state);
1567
- } catch (error) {
1568
- ctx.addIssue({
1569
- code: "custom",
1570
- message: error instanceof Error ? error.message : String(error),
1571
- path: ["secrets", "store"]
1572
- });
1573
- }
1574
- try {
1575
- checkComposeStages(data.deploy?.compose, data.stages);
1576
- } catch (error) {
1577
- ctx.addIssue({
1578
- code: "custom",
1579
- message: error instanceof Error ? error.message : String(error),
1580
- path: ["deploy", "compose"]
1581
- });
1582
- }
1583
- const perStage = [
1584
- [
1585
- "domains",
1586
- ["domains"],
1587
- data.domains
1588
- ],
1589
- [
1590
- "deploy.objects",
1591
- ["deploy", "objects"],
1592
- data.deploy?.objects
1593
- ],
1594
- [
1595
- "deploy.telemetry",
1596
- ["deploy", "telemetry"],
1597
- data.deploy?.telemetry
1598
- ],
1599
- ...Object.entries(data.dns ?? {}).map(([domain, entry]) => {
1600
- const records = entry.records;
1601
- const target = records && typeof records === "object" ? records.target : void 0;
1602
- return [
1603
- `dns['${domain}'].records.target`,
1604
- [
1605
- "dns",
1606
- domain,
1607
- "records",
1608
- "target"
1609
- ],
1610
- target && typeof target === "object" ? target : void 0
1611
- ];
1612
- })
1613
- ];
1614
- for (const [setting, path, map] of perStage) try {
1615
- assertDeployedStageKeys(setting, map, data.stages);
1616
- } catch (error) {
1617
- ctx.addIssue({
1618
- code: "custom",
1619
- message: error instanceof Error ? error.message : String(error),
1620
- path
1621
- });
1622
- }
1623
- for (const [domain, entry] of Object.entries(data.dns ?? {})) try {
1624
- checkDnsRecordsMode(domain, entry.records);
1625
- } catch (error) {
1626
- ctx.addIssue({
1627
- code: "custom",
1628
- message: error instanceof Error ? error.message : String(error),
1629
- path: [
1630
- "dns",
1631
- domain,
1632
- "records"
1633
- ]
1634
- });
1635
- }
1636
- if (data.state?.provider === "ssm" && !data.name) ctx.addIssue({
1637
- code: "custom",
1638
- message: "Workspace name is required when using SSM state provider. Add \"name\" to your gkm.config.ts.",
1639
- path: ["name"]
1640
- });
1641
- });
1642
- /**
1643
- * Validate workspace configuration.
1644
- * Throws ZodError with detailed messages on validation failure.
1645
- */
1646
- function validateWorkspaceConfig(config) {
1647
- return WorkspaceConfigSchema.parse(config);
1648
- }
1649
- /**
1650
- * Safe validation that returns result instead of throwing.
1651
- */
1652
- function safeValidateWorkspaceConfig(config) {
1653
- const result = WorkspaceConfigSchema.safeParse(config);
1654
- if (result.success) return {
1655
- success: true,
1656
- data: result.data
1657
- };
1658
- return {
1659
- success: false,
1660
- error: result.error
1661
- };
1662
- }
1663
- /**
1664
- * Format Zod errors into user-friendly messages.
1665
- */
1666
- function formatValidationErrors(error) {
1667
- return `Workspace configuration validation failed:\n${error.issues.map((issue) => {
1668
- const path = issue.path.join(".");
1669
- return path ? ` - ${path}: ${issue.message}` : ` - ${issue.message}`;
1670
- }).join("\n")}`;
1671
- }
1672
- //#endregion
1673
- //#region src/workspace/types.ts
1674
- /**
1675
- * Type guard to check if a config is a WorkspaceConfig.
1676
- *
1677
- * @example
1678
- * ```ts
1679
- * const config = await loadConfig();
1680
- * if (isWorkspaceConfig(config)) {
1681
- * // config.apps is available
1682
- * console.log(Object.keys(config.apps));
1683
- * }
1684
- * ```
1685
- */
1686
- function isWorkspaceConfig(config) {
1687
- if (typeof config !== "object" || config === null) return false;
1688
- if ("apps" in config && typeof config.apps === "object") return true;
1689
- return "constructs" in config && Object.keys(config).every((key) => WORKSPACE_KEYS.has(key));
1690
- }
1691
- /** Every top-level key a workspace config has — see `WorkspaceConfigSchema`. */
1692
- const WORKSPACE_KEYS = /* @__PURE__ */ new Set([
1693
- "name",
1694
- "constructs",
1695
- "apps",
1696
- "shared",
1697
- "domains",
1698
- "dns",
1699
- "deploy",
1700
- "stages",
1701
- "secrets",
1702
- "state"
1703
- ]);
1704
- //#endregion
1705
- //#region src/workspace/publicEnv.ts
1706
- /**
1707
- * All public env-var prefixes the toolbox understands.
1708
- *
1709
- * Used when resolving incoming var names back to a dependency
1710
- * (e.g. `VITE_AUTH_URL` → `auth`). A var matching any of these
1711
- * is considered safe to inline into a client bundle.
1712
- */
1713
- const PUBLIC_ENV_PREFIXES = [
1714
- "NEXT_PUBLIC_",
1715
- "VITE_",
1716
- "EXPO_PUBLIC_"
1717
- ];
1718
- /**
1719
- * Resolve the public env-var prefix that a frontend framework's bundler
1720
- * inlines into client code at build time:
1721
- *
1722
- * - `nextjs` → `NEXT_PUBLIC_`
1723
- * - `vite` → `VITE_`
1724
- * - `tanstack-start` → `VITE_` (uses Vite under the hood)
1725
- * - `expo` → `EXPO_PUBLIC_`
1726
- * - `remix` → `''` (Remix exposes via loaders, no prefix convention)
1727
- *
1728
- * For backend frameworks or unspecified, falls back to `NEXT_PUBLIC_` to
1729
- * preserve the historical default. Backend apps never read these vars
1730
- * from a bundle, so the prefix only affects scaffolding/symmetry.
1731
- */
1732
- function getPublicEnvPrefix(framework) {
1733
- switch (framework) {
1734
- case "vite":
1735
- case "tanstack-start": return "VITE_";
1736
- case "expo": return "EXPO_PUBLIC_";
1737
- case "remix": return "";
1738
- case "nextjs": return "NEXT_PUBLIC_";
1739
- default: return "NEXT_PUBLIC_";
1740
- }
1741
- }
1742
- /**
1743
- * Strip a known public prefix from a var name.
1744
- * Returns the un-prefixed name, or `null` if no prefix matched.
1745
- */
1746
- function stripPublicPrefix(name) {
1747
- for (const prefix of PUBLIC_ENV_PREFIXES) if (prefix && name.startsWith(prefix)) return name.slice(prefix.length);
1748
- return null;
1749
- }
1750
- //#endregion
1751
- //#region src/workspace/index.ts
1752
- /**
1753
- * Validate that all dependencies reference existing apps.
1754
- * Returns the config if valid, throws otherwise.
1755
- */
1756
- function validateDependencies(apps) {
1757
- const appNames = new Set(Object.keys(apps));
1758
- for (const [appName, app] of Object.entries(apps)) for (const dep of app.dependencies ?? []) {
1759
- if (!appNames.has(dep)) throw new Error(`Invalid dependency: App "${appName}" depends on "${dep}" which does not exist. Valid apps are: ${[...appNames].join(", ")}`);
1760
- if (dep === appName) throw new Error(`Invalid dependency: App "${appName}" cannot depend on itself.`);
1761
- }
1762
- }
1763
- /**
1764
- * Define workspace configuration with full TypeScript support and type inference.
1765
- *
1766
- * Uses `const` type parameter to infer literal app names, providing:
1767
- * - Autocomplete for app names in dependencies
1768
- * - Type errors for invalid dependency references
1769
- * - Full type inference for the returned config
1770
- *
1771
- * @example
1772
- * ```ts
1773
- * // gkm.config.ts
1774
- * import { defineWorkspace } from '@geekmidas/cli';
1775
- *
1776
- * export default defineWorkspace({
1777
- * name: 'my-saas',
1778
- * apps: {
1779
- * api: {
1780
- * type: 'backend',
1781
- * path: 'apps/api',
1782
- * port: 3000,
1783
- * routes: './src/endpoints/**\/*.ts',
1784
- * envParser: './src/config/env',
1785
- * logger: './src/logger',
1786
- * },
1787
- * web: {
1788
- * type: 'web',
1789
- * framework: 'nextjs',
1790
- * path: 'apps/web',
1791
- * port: 3001,
1792
- * dependencies: ['api'], // <- autocomplete shows 'api' | 'web'
1793
- * },
1794
- * },
1795
- * });
1796
- *
1797
- * // config.apps.api <- full type inference
1798
- * // config.apps.foo <- TypeScript error
1799
- * ```
1800
- */
1801
- function defineWorkspace(config) {
1802
- assertNoMovedDeployKeys(config.deploy);
1803
- assertKnownSecretsStore(config.secrets?.store);
1804
- if (config.apps) validateDependencies(config.apps);
1805
- const result = safeValidateWorkspaceConfig(config);
1806
- if (!result.success && result.error) throw new Error(formatValidationErrors(result.error));
1807
- return config;
1808
- }
1809
- /**
1810
- * Get the package name from package.json in the given directory.
1811
- */
1812
- function getPackageName(cwd) {
1813
- try {
1814
- return require(`${cwd}/package.json`).name?.replace(/^@[^/]+\//, "");
1815
- } catch {
1816
- return;
1817
- }
1818
- }
1819
- /**
1820
- * Normalize a workspace configuration with resolved defaults.
1821
- */
1822
- function normalizeWorkspace(config, cwd) {
1823
- const name = config.name ?? getPackageName(cwd) ?? (0, node_path.basename)(cwd);
1824
- const defaultTarget = config.deploy?.default ?? "dokploy";
1825
- const normalizedApps = {};
1826
- for (const [appName, app] of Object.entries(config.apps ?? {})) normalizedApps[appName] = normalizeAppConfig(app, defaultTarget);
1827
- return {
1828
- name,
1829
- root: cwd,
1830
- ...config.constructs ? { constructs: config.constructs } : {},
1831
- apps: normalizedApps,
1832
- ...config.domains ? { domains: config.domains } : {},
1833
- ...config.dns ? { dns: config.dns } : {},
1834
- deploy: config.deploy ?? { default: "dokploy" },
1835
- shared: config.shared ?? { packages: ["packages/*"] },
1836
- stages: validateStages(config.stages),
1837
- secrets: config.secrets ?? {},
1838
- state: config.state,
1839
- test: config.test ?? {},
1840
- ...config.dev ? { dev: config.dev } : {}
1841
- };
1842
- }
1843
- /**
1844
- * Normalize an app configuration with resolved defaults.
1845
- * @param app - App configuration
1846
- * @param defaultTarget - Default deploy target from workspace config
1847
- */
1848
- function normalizeAppConfig(app, defaultTarget) {
1849
- return {
1850
- ...app,
1851
- type: app.type ?? "backend",
1852
- port: app.port,
1853
- path: app.path,
1854
- dependencies: app.dependencies ?? [],
1855
- resolvedDeployTarget: app.deploy ?? defaultTarget
1856
- };
1857
- }
1858
- /**
1859
- * Wrap a single-app GkmConfig as a workspace.
1860
- * This allows existing single-app configs to work seamlessly.
1861
- */
1862
- function wrapSingleAppAsWorkspace(config, cwd) {
1863
- return {
1864
- name: config.name ?? getPackageName(cwd) ?? (0, node_path.basename)(cwd),
1865
- root: cwd,
1866
- apps: { api: {
1867
- type: "backend",
1868
- path: ".",
1869
- port: 3e3,
1870
- dependencies: [],
1871
- resolvedDeployTarget: config.deploy?.default ?? "dokploy",
1872
- constructs: config.constructs,
1873
- hooks: config.hooks,
1874
- telescope: config.telescope,
1875
- openapi: config.openapi,
1876
- runtime: config.runtime,
1877
- env: config.env
1878
- } },
1879
- ...config.domains ? { domains: config.domains } : {},
1880
- ...config.dns ? { dns: config.dns } : {},
1881
- deploy: {
1882
- default: "dokploy",
1883
- ...config.deploy
1884
- },
1885
- shared: { packages: [] },
1886
- stages: validateStages(config.stages),
1887
- secrets: config.secrets ?? {},
1888
- test: config.test ?? {},
1889
- ...config.dev ? { dev: config.dev } : {}
1890
- };
1891
- }
1892
- /**
1893
- * Process a loaded configuration (either single-app or workspace).
1894
- * Returns a normalized workspace in both cases.
1895
- */
1896
- /**
1897
- * `deploy.dokploy.registry`, which became `deploy.registry`: every target
1898
- * pushes and pulls through the one registry, so it is not Dokploy's to hold.
1899
- *
1900
- * Refused by name rather than dropped: the schema strips keys it does not
1901
- * know, and a registry silently gone would deploy images under no registry.
1902
- */
1903
- var DokployRegistryMoved = class extends require_errors.GkmError {
1904
- registry;
1905
- constructor(registry) {
1906
- super(`deploy.dokploy.registry is now deploy.registry, read by every deploy target. In gkm.config.ts, move it up one level: deploy: { registry: ${JSON.stringify(registry)}, dokploy: { … } }.`);
1907
- this.registry = registry;
1908
- this.name = "DokployRegistryMoved";
1909
- }
1910
- };
1911
- /**
1912
- * `deploy.domains`, which became `domains` at the root of the config: a stage's
1913
- * domain is a fact about the product every target and every command reads,
1914
- * not a deploy setting.
1915
- */
1916
- var DomainsMoved = class extends require_errors.GkmError {
1917
- domains;
1918
- constructor(domains) {
1919
- super(`deploy.domains is now domains, at the root of gkm.config.ts. Move it out of deploy: defineWorkspace({ …, domains: ${JSON.stringify(domains)}, deploy: { … } }).`);
1920
- this.domains = domains;
1921
- this.name = "DomainsMoved";
1922
- }
1923
- };
1924
- /**
1925
- * `deploy.dns`, which became `dns` at the root of the config, keyed by root
1926
- * domain.
1927
- */
1928
- var DnsMoved = class extends require_errors.GkmError {
1929
- dns;
1930
- constructor(dns) {
1931
- const legacy = dns && typeof dns === "object" && "domain" in dns && "provider" in dns;
1932
- const { domain, ...rest } = legacy ? dns : {};
1933
- super(`deploy.dns is now dns, at the root of gkm.config.ts, keyed by root domain. Move it out of deploy: defineWorkspace({ …, dns: ${JSON.stringify(legacy ? { [String(domain)]: rest } : dns)}, deploy: { … } }).`);
1934
- this.dns = dns;
1935
- this.name = "DnsMoved";
1936
- }
1937
- };
1938
- /** Refuse a deploy key that has moved, naming where it lives now. */
1939
- function assertNoMovedDeployKeys(deploy) {
1940
- const dokploy = deploy?.dokploy;
1941
- if (dokploy && typeof dokploy === "object" && "registry" in dokploy) throw new DokployRegistryMoved(dokploy.registry);
1942
- if (deploy && typeof deploy === "object") {
1943
- if ("domains" in deploy) throw new DomainsMoved(deploy.domains);
1944
- if ("dns" in deploy) throw new DnsMoved(deploy.dns);
1945
- }
1946
- }
1947
- function processConfig(config, cwd) {
1948
- assertNoMovedDeployKeys(config.deploy);
1949
- if (isWorkspaceConfig(config)) {
1950
- assertKnownSecretsStore(config.secrets?.store);
1951
- if (config.stages === void 0) throw new InvalidStages(stageProblems(void 0));
1952
- const result = safeValidateWorkspaceConfig(config);
1953
- if (!result.success && result.error) throw new InvalidWorkspaceConfig(formatValidationErrors(result.error));
1954
- return {
1955
- type: "workspace",
1956
- raw: config,
1957
- workspace: normalizeWorkspace(config, cwd)
1958
- };
1959
- }
1960
- return {
1961
- type: "single",
1962
- raw: config,
1963
- workspace: wrapSingleAppAsWorkspace(config, cwd)
1964
- };
1965
- }
1966
- /** A workspace config the schema refuses; the message lists every issue. */
1967
- var InvalidWorkspaceConfig = class extends require_errors.GkmError {
1968
- constructor(message) {
1969
- super(message);
1970
- this.name = "InvalidWorkspaceConfig";
1971
- }
1972
- };
1973
- /**
1974
- * The workspace's own constructs globs, absolute.
1975
- *
1976
- * Infrastructure two apps share is a fact about the product, and declaring it
1977
- * inside one of them makes moving that app a change to the other's database.
1978
- */
1979
- function workspaceConstructGlobs(workspace) {
1980
- return constructPatterns(workspace.constructs).map((pattern) => (0, node_path.isAbsolute)(pattern) ? pattern : (0, node_path.join)(workspace.root, pattern));
1981
- }
1982
- /**
1983
- * Every constructs glob an app can see, absolute.
1984
- *
1985
- * The workspace's own first, then the app's. Absolute because the app builds
1986
- * from its own directory while the workspace's constructs live above it —
1987
- * a relative glob resolved from the app would look for the product's
1988
- * infrastructure inside one of its consumers and find nothing.
1989
- *
1990
- * Additive, not overriding: an app that declares its own constructs still sees
1991
- * the ones the workspace declared for everybody.
1992
- */
1993
- function appConstructGlobs(workspace, appName) {
1994
- const globs = workspaceConstructGlobs(workspace);
1995
- const app = workspace.apps[appName];
1996
- if (app) {
1997
- const root = (0, node_path.isAbsolute)(app.path) ? app.path : (0, node_path.join)(workspace.root, app.path);
1998
- for (const pattern of constructPatterns(app.constructs)) globs.push((0, node_path.isAbsolute)(pattern) ? pattern : (0, node_path.join)(root, pattern));
1999
- }
2000
- return globs;
2001
- }
2002
- /**
2003
- * Every constructs glob in the workspace: its own, plus each app's.
2004
- *
2005
- * One list, so what a deploy provisions and what an app's entry point
2006
- * registers drivers for are read off the same globs.
2007
- */
2008
- function allConstructGlobs(workspace) {
2009
- const globs = [...workspaceConstructGlobs(workspace), ...Object.keys(workspace.apps).flatMap((appName) => appConstructGlobs(workspace, appName))];
2010
- return [...new Set(globs)];
2011
- }
2012
- /** A `Routes` in any of its accepted shapes, as a flat list of patterns. */
2013
- function constructPatterns(routes) {
2014
- if (!routes) return [];
2015
- return typeof routes === "string" ? [routes] : routes;
2016
- }
2017
- /**
2018
- * Get the GkmConfig for a specific app in a workspace.
2019
- * Useful for running existing single-app commands on a specific app.
2020
- */
2021
- function getAppGkmConfig(workspace, appName) {
2022
- const app = workspace.apps[appName];
2023
- if (!app || app.type !== "backend") return;
2024
- return {
2025
- ...workspace.deploy ? { deploy: workspace.deploy } : {},
2026
- stages: workspace.stages,
2027
- constructs: appConstructGlobs(workspace, appName),
2028
- hooks: app.hooks,
2029
- telescope: app.telescope,
2030
- openapi: app.openapi,
2031
- runtime: app.runtime,
2032
- env: app.env
2033
- };
2034
- }
2035
- /**
2036
- * Get topologically sorted app names based on dependencies.
2037
- * Apps with no dependencies come first, then apps that depend on them.
2038
- */
2039
- function getAppBuildOrder(workspace) {
2040
- const appNames = Object.keys(workspace.apps);
2041
- const visited = /* @__PURE__ */ new Set();
2042
- const result = [];
2043
- function visit(name) {
2044
- if (visited.has(name)) return;
2045
- visited.add(name);
2046
- const app = workspace.apps[name];
2047
- if (app) for (const dep of app.dependencies) visit(dep);
2048
- result.push(name);
2049
- }
2050
- for (const name of appNames) visit(name);
2051
- return result;
2052
- }
2053
- /**
2054
- * Resolve the Dokploy endpoint for a specific stage.
2055
- *
2056
- * Uses per-stage endpoint from `endpoints` if available,
2057
- * otherwise falls back to the global `endpoint`.
2058
- *
2059
- * @param dokployConfig - Dokploy workspace configuration
2060
- * @param stage - Deployment stage (e.g., 'development', 'production')
2061
- * @returns The endpoint URL for the stage, or undefined if not configured
2062
- *
2063
- * @example
2064
- * ```ts
2065
- * // With per-stage endpoints
2066
- * const config = {
2067
- * endpoints: {
2068
- * development: 'https://dev.dokploy.example.com:3000',
2069
- * production: 'https://prod.dokploy.example.com:3000',
2070
- * },
2071
- * };
2072
- * getEndpointForStage(config, 'production'); // => 'https://prod.dokploy.example.com:3000'
2073
- *
2074
- * // With single endpoint
2075
- * const config = { endpoint: 'https://dokploy.example.com:3000' };
2076
- * getEndpointForStage(config, 'production'); // => 'https://dokploy.example.com:3000'
2077
- * ```
2078
- */
2079
- function getEndpointForStage(dokployConfig, stage) {
2080
- if (!dokployConfig) return void 0;
2081
- if (dokployConfig.endpoints?.[stage]) return dokployConfig.endpoints[stage];
2082
- return dokployConfig.endpoint;
2083
- }
2084
- //#endregion
2085
- Object.defineProperty(exports, "AccessKeyLimit", {
2086
- enumerable: true,
2087
- get: function() {
2088
- return AccessKeyLimit;
2089
- }
2090
- });
2091
- Object.defineProperty(exports, "BucketKeySetElsewhere", {
2092
- enumerable: true,
2093
- get: function() {
2094
- return BucketKeySetElsewhere;
2095
- }
2096
- });
2097
- Object.defineProperty(exports, "BucketNameUnavailable", {
2098
- enumerable: true,
2099
- get: function() {
2100
- return BucketNameUnavailable;
2101
- }
2102
- });
2103
- Object.defineProperty(exports, "BucketOwnedByAnotherProject", {
2104
- enumerable: true,
2105
- get: function() {
2106
- return BucketOwnedByAnotherProject;
2107
- }
2108
- });
2109
- Object.defineProperty(exports, "BucketProbeFailed", {
2110
- enumerable: true,
2111
- get: function() {
2112
- return BucketProbeFailed;
2113
- }
2114
- });
2115
- Object.defineProperty(exports, "BucketRegionMismatch", {
2116
- enumerable: true,
2117
- get: function() {
2118
- return BucketRegionMismatch;
2119
- }
2120
- });
2121
- Object.defineProperty(exports, "BucketRegionUnknown", {
2122
- enumerable: true,
2123
- get: function() {
2124
- return BucketRegionUnknown;
2125
- }
2126
- });
2127
- Object.defineProperty(exports, "ComposeTlsFileMissing", {
2128
- enumerable: true,
2129
- get: function() {
2130
- return ComposeTlsFileMissing;
2131
- }
2132
- });
2133
- Object.defineProperty(exports, "DnsMoved", {
2134
- enumerable: true,
2135
- get: function() {
2136
- return DnsMoved;
2137
- }
2138
- });
2139
- Object.defineProperty(exports, "DokployRegistryMoved", {
2140
- enumerable: true,
2141
- get: function() {
2142
- return DokployRegistryMoved;
2143
- }
2144
- });
2145
- Object.defineProperty(exports, "DomainsMoved", {
2146
- enumerable: true,
2147
- get: function() {
2148
- return DomainsMoved;
2149
- }
2150
- });
2151
- Object.defineProperty(exports, "IamUserNotOwned", {
2152
- enumerable: true,
2153
- get: function() {
2154
- return IamUserNotOwned;
2155
- }
2156
- });
2157
- Object.defineProperty(exports, "InvalidStages", {
2158
- enumerable: true,
2159
- get: function() {
2160
- return InvalidStages;
2161
- }
2162
- });
2163
- Object.defineProperty(exports, "InvalidWorkspaceConfig", {
2164
- enumerable: true,
2165
- get: function() {
2166
- return InvalidWorkspaceConfig;
2167
- }
2168
- });
2169
- Object.defineProperty(exports, "LOGS_PORT", {
2170
- enumerable: true,
2171
- get: function() {
2172
- return LOGS_PORT;
2173
- }
2174
- });
2175
- Object.defineProperty(exports, "PHASE_2_DEPLOY_TARGETS", {
2176
- enumerable: true,
2177
- get: function() {
2178
- return PHASE_2_DEPLOY_TARGETS;
2179
- }
2180
- });
2181
- Object.defineProperty(exports, "PUBLIC_ENV_PREFIXES", {
2182
- enumerable: true,
2183
- get: function() {
2184
- return PUBLIC_ENV_PREFIXES;
2185
- }
2186
- });
2187
- Object.defineProperty(exports, "ProvisionedBucketUnreachable", {
2188
- enumerable: true,
2189
- get: function() {
2190
- return ProvisionedBucketUnreachable;
2191
- }
2192
- });
2193
- Object.defineProperty(exports, "RecordedBucketUnreachable", {
2194
- enumerable: true,
2195
- get: function() {
2196
- return RecordedBucketUnreachable;
2197
- }
2198
- });
2199
- Object.defineProperty(exports, "RotationInProgress", {
2200
- enumerable: true,
2201
- get: function() {
2202
- return RotationInProgress;
2203
- }
2204
- });
2205
- Object.defineProperty(exports, "S3RegionRequired", {
2206
- enumerable: true,
2207
- get: function() {
2208
- return S3RegionRequired;
2209
- }
2210
- });
2211
- Object.defineProperty(exports, "S3_PROVISIONING", {
2212
- enumerable: true,
2213
- get: function() {
2214
- return S3_PROVISIONING;
2215
- }
2216
- });
2217
- Object.defineProperty(exports, "SECRETS_STORE_PROVIDERS", {
2218
- enumerable: true,
2219
- get: function() {
2220
- return SECRETS_STORE_PROVIDERS;
2221
- }
2222
- });
2223
- Object.defineProperty(exports, "SERVER_IPV4_KEY", {
2224
- enumerable: true,
2225
- get: function() {
2226
- return SERVER_IPV4_KEY;
2227
- }
2228
- });
2229
- Object.defineProperty(exports, "SERVER_IPV6_KEY", {
2230
- enumerable: true,
2231
- get: function() {
2232
- return SERVER_IPV6_KEY;
2233
- }
2234
- });
2235
- Object.defineProperty(exports, "SUPPORTED_DEPLOY_TARGETS", {
2236
- enumerable: true,
2237
- get: function() {
2238
- return SUPPORTED_DEPLOY_TARGETS;
2239
- }
2240
- });
2241
- Object.defineProperty(exports, "TEST_STAGE", {
2242
- enumerable: true,
2243
- get: function() {
2244
- return TEST_STAGE;
2245
- }
2246
- });
2247
- Object.defineProperty(exports, "UndeclaredStage", {
2248
- enumerable: true,
2249
- get: function() {
2250
- return UndeclaredStage;
2251
- }
2252
- });
2253
- Object.defineProperty(exports, "UnknownSecretsStoreProvider", {
2254
- enumerable: true,
2255
- get: function() {
2256
- return UnknownSecretsStoreProvider;
2257
- }
2258
- });
2259
- Object.defineProperty(exports, "UnknownStageProvider", {
2260
- enumerable: true,
2261
- get: function() {
2262
- return UnknownStageProvider;
2263
- }
2264
- });
2265
- Object.defineProperty(exports, "WorkspaceConfigSchema", {
2266
- enumerable: true,
2267
- get: function() {
2268
- return WorkspaceConfigSchema;
2269
- }
2270
- });
2271
- Object.defineProperty(exports, "allConstructGlobs", {
2272
- enumerable: true,
2273
- get: function() {
2274
- return allConstructGlobs;
2275
- }
2276
- });
2277
- Object.defineProperty(exports, "appConstructGlobs", {
2278
- enumerable: true,
2279
- get: function() {
2280
- return appConstructGlobs;
2281
- }
2282
- });
2283
- Object.defineProperty(exports, "assertDeployedStage", {
2284
- enumerable: true,
2285
- get: function() {
2286
- return assertDeployedStage;
2287
- }
2288
- });
2289
- Object.defineProperty(exports, "assertNoMovedDeployKeys", {
2290
- enumerable: true,
2291
- get: function() {
2292
- return assertNoMovedDeployKeys;
2293
- }
2294
- });
2295
- Object.defineProperty(exports, "certificateFor", {
2296
- enumerable: true,
2297
- get: function() {
2298
- return certificateFor;
2299
- }
2300
- });
2301
- Object.defineProperty(exports, "checkS3Config", {
2302
- enumerable: true,
2303
- get: function() {
2304
- return checkS3Config;
2305
- }
2306
- });
2307
- Object.defineProperty(exports, "cnameTarget", {
2308
- enumerable: true,
2309
- get: function() {
2310
- return cnameTarget;
2311
- }
2312
- });
2313
- Object.defineProperty(exports, "constructPatterns", {
2314
- enumerable: true,
2315
- get: function() {
2316
- return constructPatterns;
2317
- }
2318
- });
2319
- Object.defineProperty(exports, "defineWorkspace", {
2320
- enumerable: true,
2321
- get: function() {
2322
- return defineWorkspace;
2323
- }
2324
- });
2325
- Object.defineProperty(exports, "deployedProblems", {
2326
- enumerable: true,
2327
- get: function() {
2328
- return deployedProblems;
2329
- }
2330
- });
2331
- Object.defineProperty(exports, "formatValidationErrors", {
2332
- enumerable: true,
2333
- get: function() {
2334
- return formatValidationErrors;
2335
- }
2336
- });
2337
- Object.defineProperty(exports, "getAppBuildOrder", {
2338
- enumerable: true,
2339
- get: function() {
2340
- return getAppBuildOrder;
2341
- }
2342
- });
2343
- Object.defineProperty(exports, "getAppGkmConfig", {
2344
- enumerable: true,
2345
- get: function() {
2346
- return getAppGkmConfig;
2347
- }
2348
- });
2349
- Object.defineProperty(exports, "getDeployTargetError", {
2350
- enumerable: true,
2351
- get: function() {
2352
- return getDeployTargetError;
2353
- }
2354
- });
2355
- Object.defineProperty(exports, "getEndpointForStage", {
2356
- enumerable: true,
2357
- get: function() {
2358
- return getEndpointForStage;
2359
- }
2360
- });
2361
- Object.defineProperty(exports, "getPublicEnvPrefix", {
2362
- enumerable: true,
2363
- get: function() {
2364
- return getPublicEnvPrefix;
2365
- }
2366
- });
2367
- Object.defineProperty(exports, "isDeployTargetSupported", {
2368
- enumerable: true,
2369
- get: function() {
2370
- return isDeployTargetSupported;
2371
- }
2372
- });
2373
- Object.defineProperty(exports, "isPhase2DeployTarget", {
2374
- enumerable: true,
2375
- get: function() {
2376
- return isPhase2DeployTarget;
2377
- }
2378
- });
2379
- Object.defineProperty(exports, "isReservedStageKey", {
2380
- enumerable: true,
2381
- get: function() {
2382
- return isReservedStageKey;
2383
- }
2384
- });
2385
- Object.defineProperty(exports, "isWorkspaceConfig", {
2386
- enumerable: true,
2387
- get: function() {
2388
- return isWorkspaceConfig;
2389
- }
2390
- });
2391
- Object.defineProperty(exports, "normalizeWorkspace", {
2392
- enumerable: true,
2393
- get: function() {
2394
- return normalizeWorkspace;
2395
- }
2396
- });
2397
- Object.defineProperty(exports, "otlpTelemetryEnv", {
2398
- enumerable: true,
2399
- get: function() {
2400
- return otlpTelemetryEnv;
2401
- }
2402
- });
2403
- Object.defineProperty(exports, "processConfig", {
2404
- enumerable: true,
2405
- get: function() {
2406
- return processConfig;
2407
- }
2408
- });
2409
- Object.defineProperty(exports, "provisioningOf", {
2410
- enumerable: true,
2411
- get: function() {
2412
- return provisioningOf;
2413
- }
2414
- });
2415
- Object.defineProperty(exports, "proxyFor", {
2416
- enumerable: true,
2417
- get: function() {
2418
- return proxyFor;
2419
- }
2420
- });
2421
- Object.defineProperty(exports, "resolveStageTelemetry", {
2422
- enumerable: true,
2423
- get: function() {
2424
- return resolveStageTelemetry;
2425
- }
2426
- });
2427
- Object.defineProperty(exports, "s3SecretsKey", {
2428
- enumerable: true,
2429
- get: function() {
2430
- return s3SecretsKey;
2431
- }
2432
- });
2433
- Object.defineProperty(exports, "s3SecretsLocation", {
2434
- enumerable: true,
2435
- get: function() {
2436
- return s3SecretsLocation;
2437
- }
2438
- });
2439
- Object.defineProperty(exports, "safeValidateWorkspaceConfig", {
2440
- enumerable: true,
2441
- get: function() {
2442
- return safeValidateWorkspaceConfig;
2443
- }
2444
- });
2445
- Object.defineProperty(exports, "stageProblems", {
2446
- enumerable: true,
2447
- get: function() {
2448
- return stageProblems;
2449
- }
2450
- });
2451
- Object.defineProperty(exports, "stageProvider", {
2452
- enumerable: true,
2453
- get: function() {
2454
- return stageProvider;
2455
- }
2456
- });
2457
- Object.defineProperty(exports, "stageSampleRate", {
2458
- enumerable: true,
2459
- get: function() {
2460
- return stageSampleRate;
2461
- }
2462
- });
2463
- Object.defineProperty(exports, "stripPublicPrefix", {
2464
- enumerable: true,
2465
- get: function() {
2466
- return stripPublicPrefix;
2467
- }
2468
- });
2469
- Object.defineProperty(exports, "telemetryEnv", {
2470
- enumerable: true,
2471
- get: function() {
2472
- return telemetryEnv;
2473
- }
2474
- });
2475
- Object.defineProperty(exports, "validateWorkspaceConfig", {
2476
- enumerable: true,
2477
- get: function() {
2478
- return validateWorkspaceConfig;
2479
- }
2480
- });
2481
- Object.defineProperty(exports, "workspaceConstructGlobs", {
2482
- enumerable: true,
2483
- get: function() {
2484
- return workspaceConstructGlobs;
2485
- }
2486
- });
2487
- Object.defineProperty(exports, "wrapSingleAppAsWorkspace", {
2488
- enumerable: true,
2489
- get: function() {
2490
- return wrapSingleAppAsWorkspace;
2491
- }
2492
- });
2493
-
2494
- //# sourceMappingURL=workspace-BJ78Bgvm.cjs.map