@geekmidas/cli 10.0.0-alpha.11 → 10.0.0-alpha.13

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 (242) hide show
  1. package/README.md +13 -40
  2. package/dist/{HostingerProvider-BcyFRbqV.mjs → HostingerProvider-BY26bWwB.mjs} +20 -21
  3. package/dist/HostingerProvider-BY26bWwB.mjs.map +1 -0
  4. package/dist/{HostingerProvider-BOvsgATO.cjs → HostingerProvider-BZFGYYVA.cjs} +21 -22
  5. package/dist/HostingerProvider-BZFGYYVA.cjs.map +1 -0
  6. package/dist/{LocalStateProvider-yjXZXZDM.cjs → LocalStateProvider-7HR6SS2t.cjs} +11 -6
  7. package/dist/LocalStateProvider-7HR6SS2t.cjs.map +1 -0
  8. package/dist/{LocalStateProvider-Bq-0C0sg.mjs → LocalStateProvider-D7QyJoLM.mjs} +10 -4
  9. package/dist/LocalStateProvider-D7QyJoLM.mjs.map +1 -0
  10. package/dist/{Route53Provider-C0xmer8U.mjs → Route53Provider-Cvj40A8I.mjs} +12 -12
  11. package/dist/Route53Provider-Cvj40A8I.mjs.map +1 -0
  12. package/dist/{Route53Provider-CH9XH7bz.cjs → Route53Provider-DVILBsvV.cjs} +20 -21
  13. package/dist/Route53Provider-DVILBsvV.cjs.map +1 -0
  14. package/dist/{SSMStateProvider-DOZifZfE.mjs → SSMStateProvider-B0Hu1MKZ.mjs} +13 -4
  15. package/dist/SSMStateProvider-B0Hu1MKZ.mjs.map +1 -0
  16. package/dist/{SSMStateProvider-CXtNgPfy.cjs → SSMStateProvider-VrQ-yeqd.cjs} +17 -9
  17. package/dist/SSMStateProvider-VrQ-yeqd.cjs.map +1 -0
  18. package/dist/{backup-provisioner-cE2PuCTb.cjs → backup-provisioner-BmhIO_Yr.cjs} +21 -19
  19. package/dist/backup-provisioner-BmhIO_Yr.cjs.map +1 -0
  20. package/dist/{backup-provisioner-DXXg6FIL.mjs → backup-provisioner-DIVCbfee.mjs} +10 -7
  21. package/dist/backup-provisioner-DIVCbfee.mjs.map +1 -0
  22. package/dist/{bundler-CaTGtiaO.cjs → bundler-BeNDZdHQ.cjs} +10 -28
  23. package/dist/bundler-BeNDZdHQ.cjs.map +1 -0
  24. package/dist/{bundler-S3ek7ea-.mjs → bundler-BodTL4kf.mjs} +9 -26
  25. package/dist/bundler-BodTL4kf.mjs.map +1 -0
  26. package/dist/{config-HhDpJmLO.cjs → config-Q1rvKHvw.cjs} +74 -69
  27. package/dist/config-Q1rvKHvw.cjs.map +1 -0
  28. package/dist/{config-B0L2tvvC.mjs → config-pqGD3hF9.mjs} +26 -14
  29. package/dist/config-pqGD3hF9.mjs.map +1 -0
  30. package/dist/config.cjs +4 -5
  31. package/dist/config.d.cts +14 -17
  32. package/dist/config.d.cts.map +1 -1
  33. package/dist/config.d.mts +14 -17
  34. package/dist/config.d.mts.map +1 -1
  35. package/dist/config.mjs +3 -5
  36. package/dist/{credentials-CZrys9C5.mjs → credentials-BekkKtY_.mjs} +1331 -1100
  37. package/dist/credentials-BekkKtY_.mjs.map +1 -0
  38. package/dist/{credentials-B2Pyh3bJ.cjs → credentials-Q6F0uqJq.cjs} +1468 -1232
  39. package/dist/credentials-Q6F0uqJq.cjs.map +1 -0
  40. package/dist/deploy/sniffer-envkit-patch.cjs +18 -10
  41. package/dist/deploy/sniffer-envkit-patch.cjs.map +1 -1
  42. package/dist/deploy/sniffer-envkit-patch.d.cts +0 -2
  43. package/dist/deploy/sniffer-envkit-patch.d.cts.map +1 -1
  44. package/dist/deploy/sniffer-envkit-patch.d.mts +0 -2
  45. package/dist/deploy/sniffer-envkit-patch.d.mts.map +1 -1
  46. package/dist/deploy/sniffer-envkit-patch.mjs +10 -2
  47. package/dist/deploy/sniffer-envkit-patch.mjs.map +1 -1
  48. package/dist/deploy/sniffer-hooks.cjs +13 -7
  49. package/dist/deploy/sniffer-hooks.cjs.map +1 -1
  50. package/dist/deploy/sniffer-hooks.d.cts +1 -2
  51. package/dist/deploy/sniffer-hooks.d.cts.map +1 -1
  52. package/dist/deploy/sniffer-hooks.d.mts +1 -2
  53. package/dist/deploy/sniffer-hooks.d.mts.map +1 -1
  54. package/dist/deploy/sniffer-hooks.mjs +9 -2
  55. package/dist/deploy/sniffer-hooks.mjs.map +1 -1
  56. package/dist/deploy/sniffer-loader.cjs +16 -7
  57. package/dist/deploy/sniffer-loader.cjs.map +1 -1
  58. package/dist/deploy/sniffer-loader.d.cts +1 -1
  59. package/dist/deploy/sniffer-loader.d.mts +1 -1
  60. package/dist/deploy/sniffer-loader.mjs +13 -2
  61. package/dist/deploy/sniffer-loader.mjs.map +1 -1
  62. package/dist/deploy/sniffer-routes-worker.cjs +11 -11
  63. package/dist/deploy/sniffer-routes-worker.cjs.map +1 -1
  64. package/dist/deploy/sniffer-routes-worker.d.cts +1 -1
  65. package/dist/deploy/sniffer-routes-worker.d.mts +1 -1
  66. package/dist/deploy/sniffer-routes-worker.mjs +2 -2
  67. package/dist/deploy/sniffer-routes-worker.mjs.map +1 -1
  68. package/dist/deploy/sniffer-worker.cjs +15 -6
  69. package/dist/deploy/sniffer-worker.cjs.map +1 -1
  70. package/dist/deploy/sniffer-worker.d.cts +1 -3
  71. package/dist/deploy/sniffer-worker.d.cts.map +1 -1
  72. package/dist/deploy/sniffer-worker.d.mts +1 -3
  73. package/dist/deploy/sniffer-worker.d.mts.map +1 -1
  74. package/dist/deploy/sniffer-worker.mjs +15 -4
  75. package/dist/deploy/sniffer-worker.mjs.map +1 -1
  76. package/dist/{discover-DTmFeloL.cjs → discover-BERGFg8v.cjs} +81 -64
  77. package/dist/discover-BERGFg8v.cjs.map +1 -0
  78. package/dist/{discover-CAlFgYec.mjs → discover-CK-n3w6b.mjs} +35 -20
  79. package/dist/discover-CK-n3w6b.mjs.map +1 -0
  80. package/dist/{emit-CUD1BWls.cjs → emit-BdoPFjZf.cjs} +53 -36
  81. package/dist/emit-BdoPFjZf.cjs.map +1 -0
  82. package/dist/{emit-CIlvnDvV.mjs → emit-Bzq7JsMP.mjs} +24 -6
  83. package/dist/emit-Bzq7JsMP.mjs.map +1 -0
  84. package/dist/{fullstack-secrets-METaRLS1.mjs → fullstack-secrets-BET8gqwK.mjs} +9 -15
  85. package/dist/fullstack-secrets-BET8gqwK.mjs.map +1 -0
  86. package/dist/{fullstack-secrets-D6MyHhQP.cjs → fullstack-secrets-DXsWO-5m.cjs} +19 -38
  87. package/dist/fullstack-secrets-DXsWO-5m.cjs.map +1 -0
  88. package/dist/{generator-VE2JrFlY.mjs → generator-LfZU7NlU.mjs} +8 -14
  89. package/dist/generator-LfZU7NlU.mjs.map +1 -0
  90. package/dist/{generator-CNzBw7g5.cjs → generator-Wdfp0jCS.cjs} +38 -45
  91. package/dist/generator-Wdfp0jCS.cjs.map +1 -0
  92. package/dist/{github-BrvaPkFf.cjs → github-BfflNPVe.cjs} +36 -30
  93. package/dist/{github-BrvaPkFf.cjs.map → github-BfflNPVe.cjs.map} +1 -1
  94. package/dist/{github-CrpsXSfV.mjs → github-CRwnxKmD.mjs} +27 -20
  95. package/dist/github-CRwnxKmD.mjs.map +1 -0
  96. package/dist/{index-CR5urhWX.d.cts → index-Cd-qeOam.d.mts} +3 -12
  97. package/dist/index-Cd-qeOam.d.mts.map +1 -0
  98. package/dist/{index-Ayxg_DQY.d.mts → index-D-iAVHx-.d.cts} +3 -12
  99. package/dist/index-D-iAVHx-.d.cts.map +1 -0
  100. package/dist/index.cjs +3320 -2961
  101. package/dist/index.cjs.map +1 -1
  102. package/dist/index.d.cts +1 -1
  103. package/dist/index.d.mts +1 -1
  104. package/dist/index.mjs +3200 -2858
  105. package/dist/index.mjs.map +1 -1
  106. package/dist/{keystore-TxeYM7an.mjs → keystore-B4PRlbgE.mjs} +5 -7
  107. package/dist/keystore-B4PRlbgE.mjs.map +1 -0
  108. package/dist/{keystore-C9rint2E.cjs → keystore-DgGRj2Yy.cjs} +23 -26
  109. package/dist/keystore-DgGRj2Yy.cjs.map +1 -0
  110. package/dist/{openapi-DaKlTKxz.cjs → openapi-Dcbme-Us.cjs} +134 -171
  111. package/dist/openapi-Dcbme-Us.cjs.map +1 -0
  112. package/dist/openapi-react-query.cjs +156 -2
  113. package/dist/openapi-react-query.cjs.map +1 -0
  114. package/dist/openapi-react-query.d.cts +1 -3
  115. package/dist/openapi-react-query.d.cts.map +1 -1
  116. package/dist/openapi-react-query.d.mts +1 -3
  117. package/dist/openapi-react-query.d.mts.map +1 -1
  118. package/dist/openapi-react-query.mjs +156 -2
  119. package/dist/openapi-react-query.mjs.map +1 -0
  120. package/dist/{openapi-y1d7Kalt.mjs → openapi-vy4JzhUv.mjs} +76 -106
  121. package/dist/openapi-vy4JzhUv.mjs.map +1 -0
  122. package/dist/openapi.cjs +3 -6
  123. package/dist/openapi.d.cts +8 -11
  124. package/dist/openapi.d.cts.map +1 -1
  125. package/dist/openapi.d.mts +8 -11
  126. package/dist/openapi.d.mts.map +1 -1
  127. package/dist/openapi.mjs +2 -6
  128. package/dist/reconcile/public.cjs +4 -4
  129. package/dist/reconcile/public.d.cts +8 -26
  130. package/dist/reconcile/public.d.cts.map +1 -1
  131. package/dist/reconcile/public.d.mts +8 -26
  132. package/dist/reconcile/public.d.mts.map +1 -1
  133. package/dist/reconcile/public.mjs +3 -4
  134. package/dist/{reconcile-CYMhFSYy.cjs → reconcile-Dd2iyILf.cjs} +4 -7
  135. package/dist/reconcile-Dd2iyILf.cjs.map +1 -0
  136. package/dist/{reconcile-C13ERt1U.mjs → reconcile-DhQ00DpU.mjs} +4 -7
  137. package/dist/reconcile-DhQ00DpU.mjs.map +1 -0
  138. package/dist/rolldown-runtime-BhDjJH2R.mjs +15 -0
  139. package/dist/{chunk-CUT6urMc.cjs → rolldown-runtime-C0BPl7ul.cjs} +23 -10
  140. package/dist/{storage-CSNplaJn.cjs → storage-C-30BD1e.cjs} +59 -69
  141. package/dist/storage-C-30BD1e.cjs.map +1 -0
  142. package/dist/{storage-B020InPW.mjs → storage-P_b3w7uj.mjs} +22 -13
  143. package/dist/storage-P_b3w7uj.mjs.map +1 -0
  144. package/dist/{sync-CzHXiR9c.mjs → sync-B3xxXtJT.mjs} +18 -6
  145. package/dist/sync-B3xxXtJT.mjs.map +1 -0
  146. package/dist/{sync-0ILCb-1S.cjs → sync-D7uTIIEi.cjs} +43 -25
  147. package/dist/sync-D7uTIIEi.cjs.map +1 -0
  148. package/dist/types-BGo5TaNE.d.mts +6164 -0
  149. package/dist/types-BGo5TaNE.d.mts.map +1 -0
  150. package/dist/types-C5ZNpUad.d.cts +6165 -0
  151. package/dist/types-C5ZNpUad.d.cts.map +1 -0
  152. package/dist/workspace/index.cjs +3 -3
  153. package/dist/workspace/index.d.cts +3 -3
  154. package/dist/workspace/index.d.mts +3 -3
  155. package/dist/workspace/index.mjs +2 -3
  156. package/dist/{workspace-DaEX7FEg.mjs → workspace-CgwmXEtc.mjs} +725 -871
  157. package/dist/workspace-CgwmXEtc.mjs.map +1 -0
  158. package/dist/{workspace-C-a3G_U0.cjs → workspace-mFpI_ky_.cjs} +894 -1041
  159. package/dist/workspace-mFpI_ky_.cjs.map +1 -0
  160. package/package.json +14 -14
  161. package/dist/CachedStateProvider-BEBl2wQT.cjs +0 -60
  162. package/dist/CachedStateProvider-BEBl2wQT.cjs.map +0 -1
  163. package/dist/CachedStateProvider-C-8wtlto.mjs +0 -3
  164. package/dist/CachedStateProvider-Co4n5Wvs.mjs +0 -54
  165. package/dist/CachedStateProvider-Co4n5Wvs.mjs.map +0 -1
  166. package/dist/CachedStateProvider-DqhGpzsm.cjs +0 -3
  167. package/dist/HostingerProvider-BOvsgATO.cjs.map +0 -1
  168. package/dist/HostingerProvider-BcyFRbqV.mjs.map +0 -1
  169. package/dist/LocalStateProvider-Bq-0C0sg.mjs.map +0 -1
  170. package/dist/LocalStateProvider-yjXZXZDM.cjs.map +0 -1
  171. package/dist/Route53Provider-C0xmer8U.mjs.map +0 -1
  172. package/dist/Route53Provider-CH9XH7bz.cjs.map +0 -1
  173. package/dist/SSMStateProvider-CXtNgPfy.cjs.map +0 -1
  174. package/dist/SSMStateProvider-DOZifZfE.mjs.map +0 -1
  175. package/dist/backup-provisioner-DXXg6FIL.mjs.map +0 -1
  176. package/dist/backup-provisioner-cE2PuCTb.cjs.map +0 -1
  177. package/dist/bundler-CaTGtiaO.cjs.map +0 -1
  178. package/dist/bundler-S3ek7ea-.mjs.map +0 -1
  179. package/dist/chunk-Duj1WY3L.mjs +0 -7
  180. package/dist/config-B0L2tvvC.mjs.map +0 -1
  181. package/dist/config-HhDpJmLO.cjs.map +0 -1
  182. package/dist/credentials-B2Pyh3bJ.cjs.map +0 -1
  183. package/dist/credentials-B5zRHdAl.mjs +0 -141
  184. package/dist/credentials-B5zRHdAl.mjs.map +0 -1
  185. package/dist/credentials-BapzjyV5.cjs +0 -195
  186. package/dist/credentials-BapzjyV5.cjs.map +0 -1
  187. package/dist/credentials-CZrys9C5.mjs.map +0 -1
  188. package/dist/discover-CAlFgYec.mjs.map +0 -1
  189. package/dist/discover-DTmFeloL.cjs.map +0 -1
  190. package/dist/dokploy-api-5cK2InBm.cjs +0 -3
  191. package/dist/dokploy-api-D2Ny4Jrc.mjs +0 -3
  192. package/dist/dokploy-api-pdaBryoY.mjs +0 -706
  193. package/dist/dokploy-api-pdaBryoY.mjs.map +0 -1
  194. package/dist/dokploy-api-zqKe9lHH.cjs +0 -718
  195. package/dist/dokploy-api-zqKe9lHH.cjs.map +0 -1
  196. package/dist/emit-CIlvnDvV.mjs.map +0 -1
  197. package/dist/emit-CUD1BWls.cjs.map +0 -1
  198. package/dist/encryption-D2pL3tHH.cjs +0 -54
  199. package/dist/encryption-D2pL3tHH.cjs.map +0 -1
  200. package/dist/encryption-YDsXXi6w.mjs +0 -3
  201. package/dist/encryption-_4zwjOAR.mjs +0 -42
  202. package/dist/encryption-_4zwjOAR.mjs.map +0 -1
  203. package/dist/encryption-sQ2Oxx0d.cjs +0 -4
  204. package/dist/fullstack-secrets-D6MyHhQP.cjs.map +0 -1
  205. package/dist/fullstack-secrets-METaRLS1.mjs.map +0 -1
  206. package/dist/generator-CNzBw7g5.cjs.map +0 -1
  207. package/dist/generator-VE2JrFlY.mjs.map +0 -1
  208. package/dist/github-CrpsXSfV.mjs.map +0 -1
  209. package/dist/index-Ayxg_DQY.d.mts.map +0 -1
  210. package/dist/index-CR5urhWX.d.cts.map +0 -1
  211. package/dist/keystore-C9rint2E.cjs.map +0 -1
  212. package/dist/keystore-TxeYM7an.mjs.map +0 -1
  213. package/dist/openapi-DaKlTKxz.cjs.map +0 -1
  214. package/dist/openapi-react-query-BKH334Ug.cjs +0 -173
  215. package/dist/openapi-react-query-BKH334Ug.cjs.map +0 -1
  216. package/dist/openapi-react-query-DoR5CmzQ.mjs +0 -167
  217. package/dist/openapi-react-query-DoR5CmzQ.mjs.map +0 -1
  218. package/dist/openapi-y1d7Kalt.mjs.map +0 -1
  219. package/dist/reconcile-C13ERt1U.mjs.map +0 -1
  220. package/dist/reconcile-CYMhFSYy.cjs.map +0 -1
  221. package/dist/setup-BWgMs4gg.mjs +0 -12
  222. package/dist/setup-DOv92pIu.cjs +0 -473
  223. package/dist/setup-DOv92pIu.cjs.map +0 -1
  224. package/dist/setup-DQo_h_yK.mjs +0 -443
  225. package/dist/setup-DQo_h_yK.mjs.map +0 -1
  226. package/dist/setup-lCx_DcUo.cjs +0 -12
  227. package/dist/storage-B020InPW.mjs.map +0 -1
  228. package/dist/storage-CSNplaJn.cjs.map +0 -1
  229. package/dist/storage-DGBzMLZa.mjs +0 -4
  230. package/dist/storage-DlVol_oj.cjs +0 -8
  231. package/dist/sync-0ILCb-1S.cjs.map +0 -1
  232. package/dist/sync-CzHXiR9c.mjs.map +0 -1
  233. package/dist/sync-DYENfOt4.cjs +0 -4
  234. package/dist/sync-HAau6h_R.mjs +0 -3
  235. package/dist/types-CL7jPFM2.d.mts +0 -2220
  236. package/dist/types-CL7jPFM2.d.mts.map +0 -1
  237. package/dist/types-Y3fKQSAK.d.cts +0 -2220
  238. package/dist/types-Y3fKQSAK.d.cts.map +0 -1
  239. package/dist/workspace-C-a3G_U0.cjs.map +0 -1
  240. package/dist/workspace-DQxxs7Jk.cjs +0 -10
  241. package/dist/workspace-DaEX7FEg.mjs.map +0 -1
  242. package/dist/workspace-DbI580qS.mjs +0 -9
@@ -1,2220 +0,0 @@
1
- import { ConstructManifest } from "@geekmidas/manifest";
2
- import { z } from "zod/v4";
3
-
4
- //#region src/deploy/state.d.ts
5
-
6
- /**
7
- * Deploy state management for Dokploy deployments
8
- *
9
- * Stores resource IDs (applications, services) per stage to avoid
10
- * re-creating resources on subsequent deploys.
11
- */
12
- /**
13
- * Per-app database credentials
14
- */
15
- interface AppDbCredentials {
16
- dbUser: string;
17
- dbPassword: string;
18
- }
19
- /**
20
- * DNS verification record for a hostname
21
- */
22
- interface DnsVerificationRecord {
23
- serverIp: string;
24
- verifiedAt: string;
25
- }
26
- /**
27
- * A DNS record that was created during deploy
28
- */
29
- interface CreatedDnsRecord {
30
- /** The domain this record belongs to (e.g., 'example.com') */
31
- domain: string;
32
- /** Record name/subdomain (e.g., 'api' or '@' for root) */
33
- name: string;
34
- /** Record type (A, CNAME, etc.) */
35
- type: string;
36
- /** Record value (IP address, hostname, etc.) */
37
- value: string;
38
- /** TTL in seconds */
39
- ttl: number;
40
- /** When this record was created */
41
- createdAt: string;
42
- }
43
- /**
44
- * Backup destination state
45
- */
46
- interface BackupState {
47
- /** S3 bucket name for backups */
48
- bucketName: string;
49
- /** S3 bucket ARN */
50
- bucketArn: string;
51
- /** IAM user name created for backup access */
52
- iamUserName: string;
53
- /** IAM access key ID */
54
- iamAccessKeyId: string;
55
- /** IAM secret access key */
56
- iamSecretAccessKey: string;
57
- /** Dokploy destination ID */
58
- destinationId: string;
59
- /** Dokploy backup schedule ID for postgres (if configured) */
60
- postgresBackupId?: string;
61
- /** AWS region where bucket was created */
62
- region: string;
63
- /** Timestamp when backup was configured */
64
- createdAt: string;
65
- }
66
- /**
67
- * State for a single stage deployment
68
- */
69
- interface DokployStageState {
70
- provider: 'dokploy';
71
- stage: string;
72
- /** Dokploy project ID - created on first deploy */
73
- projectId: string;
74
- environmentId: string;
75
- applications: Record<string, string>;
76
- services: {
77
- postgresId?: string;
78
- redisId?: string;
79
- };
80
- /** Per-app database credentials for reuse on subsequent deploys */
81
- appCredentials?: Record<string, AppDbCredentials>;
82
- /** Auto-generated secrets per app (e.g., BETTER_AUTH_SECRET) */
83
- generatedSecrets?: Record<string, Record<string, string>>;
84
- /** DNS verification state per hostname */
85
- dnsVerified?: Record<string, DnsVerificationRecord>;
86
- /** DNS records created during deploy (keyed by "name:type", e.g., "api:A") */
87
- dnsRecords?: Record<string, CreatedDnsRecord>;
88
- /** Backup destination state */
89
- backups?: BackupState;
90
- lastDeployedAt: string;
91
- }
92
- /**
93
- * Read the deploy state for a stage
94
- * Returns null if state file doesn't exist
95
- */
96
- //#endregion
97
- //#region src/deploy/StateProvider.d.ts
98
- /**
99
- * Interface for deployment state storage providers.
100
- *
101
- * Implementations must handle:
102
- * - Reading state for a stage (returns null if not found)
103
- * - Writing state for a stage (creates or updates)
104
- */
105
- interface StateProvider {
106
- /**
107
- * Read deployment state for a stage.
108
- *
109
- * @param stage - The deployment stage (e.g., 'development', 'production')
110
- * @returns The state object or null if not found
111
- */
112
- read(stage: string): Promise<DokployStageState | null>;
113
- /**
114
- * Write deployment state for a stage.
115
- *
116
- * @param stage - The deployment stage
117
- * @param state - The state object to persist
118
- */
119
- write(stage: string, state: DokployStageState): Promise<void>;
120
- }
121
- /**
122
- * Valid AWS regions.
123
- */
124
- type AwsRegion = 'us-east-1' | 'us-east-2' | 'us-west-1' | 'us-west-2' | 'af-south-1' | 'ap-east-1' | 'ap-south-1' | 'ap-south-2' | 'ap-southeast-1' | 'ap-southeast-2' | 'ap-southeast-3' | 'ap-southeast-4' | 'ap-northeast-1' | 'ap-northeast-2' | 'ap-northeast-3' | 'ca-central-1' | 'eu-central-1' | 'eu-central-2' | 'eu-west-1' | 'eu-west-2' | 'eu-west-3' | 'eu-south-1' | 'eu-south-2' | 'eu-north-1' | 'me-south-1' | 'me-central-1' | 'sa-east-1';
125
- /**
126
- * Local state provider config.
127
- */
128
- interface LocalStateConfig {
129
- provider: 'local';
130
- }
131
- /**
132
- * SSM state provider config (requires region).
133
- */
134
- interface SSMStateConfig {
135
- provider: 'ssm';
136
- /** AWS region (required for SSM provider) */
137
- region: AwsRegion;
138
- /** AWS profile name (optional - uses default credential chain if not provided) */
139
- profile?: string;
140
- }
141
- /**
142
- * Custom state provider config.
143
- */
144
- interface CustomStateConfig {
145
- /** Custom StateProvider implementation */
146
- provider: StateProvider;
147
- }
148
- /**
149
- * State configuration types.
150
- */
151
- type StateConfig = LocalStateConfig | SSMStateConfig | CustomStateConfig;
152
- /**
153
- * Check if value is a StateProvider implementation.
154
- */
155
- //#endregion
156
- //#region src/workspace/schema.d.ts
157
- /**
158
- * Backend framework schema for non-gkm apps.
159
- */
160
- declare const BackendFrameworkSchema: z.ZodEnum<{
161
- hono: "hono";
162
- "better-auth": "better-auth";
163
- express: "express";
164
- fastify: "fastify";
165
- }>;
166
- /**
167
- * Backend framework types for apps that don't use gkm routes.
168
- * Derived from {@link BackendFrameworkSchema}.
169
- *
170
- * Used with `entry` to specify the framework for proper Docker builds.
171
- *
172
- * @example
173
- * ```ts
174
- * // Better Auth server
175
- * {
176
- * entry: './src/index.ts',
177
- * framework: 'better-auth',
178
- * port: 3001,
179
- * }
180
- *
181
- * // Hono app without gkm routes
182
- * {
183
- * entry: './src/server.ts',
184
- * framework: 'hono',
185
- * port: 3000,
186
- * }
187
- * ```
188
- */
189
- type BackendFramework = z.infer<typeof BackendFrameworkSchema>;
190
- /**
191
- * Frontend framework schema.
192
- */
193
- declare const FrontendFrameworkSchema: z.ZodEnum<{
194
- nextjs: "nextjs";
195
- remix: "remix";
196
- vite: "vite";
197
- "tanstack-start": "tanstack-start";
198
- }>;
199
- /**
200
- * Frontend framework types. Derived from {@link FrontendFrameworkSchema}.
201
- *
202
- * @example
203
- * ```ts
204
- * // Next.js app
205
- * {
206
- * type: 'web',
207
- * framework: 'nextjs',
208
- * port: 3000,
209
- * }
210
- *
211
- * // Vite SPA
212
- * {
213
- * type: 'web',
214
- * framework: 'vite',
215
- * port: 5173,
216
- * }
217
- *
218
- * // TanStack Start (Vite-based, full-stack)
219
- * {
220
- * type: 'web',
221
- * framework: 'tanstack-start',
222
- * port: 3000,
223
- * }
224
- * ```
225
- */
226
- type FrontendFramework = z.infer<typeof FrontendFrameworkSchema>;
227
- /**
228
- * Mobile framework schema.
229
- */
230
- declare const MobileFrameworkSchema: z.ZodEnum<{
231
- expo: "expo";
232
- }>;
233
- /**
234
- * Mobile framework types. Derived from {@link MobileFrameworkSchema}.
235
- *
236
- * Mobile apps deploy via their own toolchain (e.g. EAS Build for Expo)
237
- * rather than Docker/Dokploy. Only build-time public env vars
238
- * (e.g. `EXPO_PUBLIC_*`) reach the device — server secrets are dropped.
239
- *
240
- * @example
241
- * ```ts
242
- * {
243
- * type: 'mobile',
244
- * framework: 'expo',
245
- * path: 'apps/mobile',
246
- * port: 8081,
247
- * dependencies: ['api'],
248
- * }
249
- * ```
250
- */
251
- type MobileFramework = z.infer<typeof MobileFrameworkSchema>;
252
- /**
253
- * Combined framework schema (backend, frontend, or mobile).
254
- */
255
- declare const FrameworkSchema: z.ZodUnion<readonly [z.ZodEnum<{
256
- hono: "hono";
257
- "better-auth": "better-auth";
258
- express: "express";
259
- fastify: "fastify";
260
- }>, z.ZodEnum<{
261
- nextjs: "nextjs";
262
- remix: "remix";
263
- vite: "vite";
264
- "tanstack-start": "tanstack-start";
265
- }>, z.ZodEnum<{
266
- expo: "expo";
267
- }>]>;
268
- /**
269
- * Any framework value across backend, frontend, or mobile.
270
- * Derived from {@link FrameworkSchema}.
271
- */
272
- type Framework = z.infer<typeof FrameworkSchema>;
273
- /**
274
- * Supported deploy targets (Phase 1).
275
- */
276
- declare const SUPPORTED_DEPLOY_TARGETS: readonly ["dokploy"];
277
- /**
278
- * Phase 2 deploy targets (not yet implemented).
279
- */
280
- declare const PHASE_2_DEPLOY_TARGETS: readonly ["vercel", "cloudflare"];
281
- /**
282
- * Check if a deploy target is supported.
283
- */
284
- declare function isDeployTargetSupported(target: string): boolean;
285
- /**
286
- * Check if a deploy target is planned for Phase 2.
287
- */
288
- declare function isPhase2DeployTarget(target: string): boolean;
289
- /**
290
- * Get error message for unsupported deploy targets.
291
- */
292
- declare function getDeployTargetError(target: string, appName?: string): string;
293
- /**
294
- * DNS record types supported across providers.
295
- */
296
-
297
- /**
298
- * Combined DNS config that supports both new multi-domain and legacy single-domain formats.
299
- */
300
- declare const DnsConfigWithLegacySchema: z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
301
- provider: z.ZodLiteral<"hostinger">;
302
- ttl: z.ZodOptional<z.ZodNumber>;
303
- }, z.core.$strip>, z.ZodObject<{
304
- provider: z.ZodLiteral<"route53">;
305
- region: z.ZodOptional<z.ZodEnum<{
306
- "us-east-1": "us-east-1";
307
- "us-east-2": "us-east-2";
308
- "us-west-1": "us-west-1";
309
- "us-west-2": "us-west-2";
310
- "af-south-1": "af-south-1";
311
- "ap-east-1": "ap-east-1";
312
- "ap-south-1": "ap-south-1";
313
- "ap-south-2": "ap-south-2";
314
- "ap-southeast-1": "ap-southeast-1";
315
- "ap-southeast-2": "ap-southeast-2";
316
- "ap-southeast-3": "ap-southeast-3";
317
- "ap-southeast-4": "ap-southeast-4";
318
- "ap-northeast-1": "ap-northeast-1";
319
- "ap-northeast-2": "ap-northeast-2";
320
- "ap-northeast-3": "ap-northeast-3";
321
- "ca-central-1": "ca-central-1";
322
- "eu-central-1": "eu-central-1";
323
- "eu-central-2": "eu-central-2";
324
- "eu-west-1": "eu-west-1";
325
- "eu-west-2": "eu-west-2";
326
- "eu-west-3": "eu-west-3";
327
- "eu-south-1": "eu-south-1";
328
- "eu-south-2": "eu-south-2";
329
- "eu-north-1": "eu-north-1";
330
- "me-south-1": "me-south-1";
331
- "me-central-1": "me-central-1";
332
- "sa-east-1": "sa-east-1";
333
- }>>;
334
- profile: z.ZodOptional<z.ZodString>;
335
- hostedZoneId: z.ZodOptional<z.ZodString>;
336
- ttl: z.ZodOptional<z.ZodNumber>;
337
- }, z.core.$strip>, z.ZodObject<{
338
- provider: z.ZodLiteral<"cloudflare">;
339
- ttl: z.ZodOptional<z.ZodNumber>;
340
- }, z.core.$strip>, z.ZodObject<{
341
- provider: z.ZodLiteral<"manual">;
342
- }, z.core.$strip>], "provider">, z.ZodObject<{
343
- provider: z.ZodCustom<{
344
- name: string;
345
- getRecords: Function;
346
- upsertRecords: Function;
347
- }, {
348
- name: string;
349
- getRecords: Function;
350
- upsertRecords: Function;
351
- }>;
352
- ttl: z.ZodOptional<z.ZodNumber>;
353
- }, z.core.$strip>]>>, z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
354
- provider: z.ZodLiteral<"hostinger">;
355
- ttl: z.ZodOptional<z.ZodNumber>;
356
- domain: z.ZodString;
357
- }, z.core.$strip>, z.ZodObject<{
358
- provider: z.ZodLiteral<"route53">;
359
- region: z.ZodOptional<z.ZodEnum<{
360
- "us-east-1": "us-east-1";
361
- "us-east-2": "us-east-2";
362
- "us-west-1": "us-west-1";
363
- "us-west-2": "us-west-2";
364
- "af-south-1": "af-south-1";
365
- "ap-east-1": "ap-east-1";
366
- "ap-south-1": "ap-south-1";
367
- "ap-south-2": "ap-south-2";
368
- "ap-southeast-1": "ap-southeast-1";
369
- "ap-southeast-2": "ap-southeast-2";
370
- "ap-southeast-3": "ap-southeast-3";
371
- "ap-southeast-4": "ap-southeast-4";
372
- "ap-northeast-1": "ap-northeast-1";
373
- "ap-northeast-2": "ap-northeast-2";
374
- "ap-northeast-3": "ap-northeast-3";
375
- "ca-central-1": "ca-central-1";
376
- "eu-central-1": "eu-central-1";
377
- "eu-central-2": "eu-central-2";
378
- "eu-west-1": "eu-west-1";
379
- "eu-west-2": "eu-west-2";
380
- "eu-west-3": "eu-west-3";
381
- "eu-south-1": "eu-south-1";
382
- "eu-south-2": "eu-south-2";
383
- "eu-north-1": "eu-north-1";
384
- "me-south-1": "me-south-1";
385
- "me-central-1": "me-central-1";
386
- "sa-east-1": "sa-east-1";
387
- }>>;
388
- profile: z.ZodOptional<z.ZodString>;
389
- hostedZoneId: z.ZodOptional<z.ZodString>;
390
- ttl: z.ZodOptional<z.ZodNumber>;
391
- domain: z.ZodString;
392
- }, z.core.$strip>, z.ZodObject<{
393
- provider: z.ZodLiteral<"cloudflare">;
394
- ttl: z.ZodOptional<z.ZodNumber>;
395
- domain: z.ZodString;
396
- }, z.core.$strip>, z.ZodObject<{
397
- provider: z.ZodLiteral<"manual">;
398
- domain: z.ZodString;
399
- }, z.core.$strip>], "provider">, z.ZodObject<{
400
- provider: z.ZodCustom<{
401
- name: string;
402
- getRecords: Function;
403
- upsertRecords: Function;
404
- }, {
405
- name: string;
406
- getRecords: Function;
407
- upsertRecords: Function;
408
- }>;
409
- ttl: z.ZodOptional<z.ZodNumber>;
410
- domain: z.ZodString;
411
- }, z.core.$strip>]>]>;
412
- type DnsConfig = z.infer<typeof DnsConfigWithLegacySchema>;
413
- /**
414
- * Backups configuration schema.
415
- *
416
- * Configures automatic backup destinations for database services.
417
- * On first deploy, creates S3 bucket with unique name and IAM credentials.
418
- */
419
- declare const BackupsConfigSchema: z.ZodObject<{
420
- type: z.ZodLiteral<"s3">;
421
- profile: z.ZodOptional<z.ZodString>;
422
- region: z.ZodEnum<{
423
- "us-east-1": "us-east-1";
424
- "us-east-2": "us-east-2";
425
- "us-west-1": "us-west-1";
426
- "us-west-2": "us-west-2";
427
- "af-south-1": "af-south-1";
428
- "ap-east-1": "ap-east-1";
429
- "ap-south-1": "ap-south-1";
430
- "ap-south-2": "ap-south-2";
431
- "ap-southeast-1": "ap-southeast-1";
432
- "ap-southeast-2": "ap-southeast-2";
433
- "ap-southeast-3": "ap-southeast-3";
434
- "ap-southeast-4": "ap-southeast-4";
435
- "ap-northeast-1": "ap-northeast-1";
436
- "ap-northeast-2": "ap-northeast-2";
437
- "ap-northeast-3": "ap-northeast-3";
438
- "ca-central-1": "ca-central-1";
439
- "eu-central-1": "eu-central-1";
440
- "eu-central-2": "eu-central-2";
441
- "eu-west-1": "eu-west-1";
442
- "eu-west-2": "eu-west-2";
443
- "eu-west-3": "eu-west-3";
444
- "eu-south-1": "eu-south-1";
445
- "eu-south-2": "eu-south-2";
446
- "eu-north-1": "eu-north-1";
447
- "me-south-1": "me-south-1";
448
- "me-central-1": "me-central-1";
449
- "sa-east-1": "sa-east-1";
450
- }>;
451
- schedule: z.ZodOptional<z.ZodString>;
452
- retention: z.ZodOptional<z.ZodNumber>;
453
- }, z.core.$strip>;
454
- type BackupsConfig = z.infer<typeof BackupsConfigSchema>;
455
- /**
456
- * Workspace configuration schema.
457
- */
458
- declare const WorkspaceConfigSchema: z.ZodObject<{
459
- name: z.ZodOptional<z.ZodString>;
460
- constructs: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodObject<{
461
- paths: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
462
- partition: z.ZodCustom<(filepath: string) => string, (filepath: string) => string>;
463
- }, z.core.$strip>]>>;
464
- apps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
465
- type: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
466
- backend: "backend";
467
- web: "web";
468
- mobile: "mobile";
469
- }>>>;
470
- path: z.ZodString;
471
- port: z.ZodNumber;
472
- dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
473
- deploy: z.ZodOptional<z.ZodEnum<{
474
- dokploy: "dokploy";
475
- vercel: "vercel";
476
- cloudflare: "cloudflare";
477
- }>>;
478
- constructs: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodObject<{
479
- paths: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
480
- partition: z.ZodCustom<(filepath: string) => string, (filepath: string) => string>;
481
- }, z.core.$strip>]>>;
482
- routes: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodObject<{
483
- paths: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
484
- partition: z.ZodCustom<(filepath: string) => string, (filepath: string) => string>;
485
- }, z.core.$strip>]>>;
486
- functions: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodObject<{
487
- paths: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
488
- partition: z.ZodCustom<(filepath: string) => string, (filepath: string) => string>;
489
- }, z.core.$strip>]>>;
490
- crons: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodObject<{
491
- paths: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
492
- partition: z.ZodCustom<(filepath: string) => string, (filepath: string) => string>;
493
- }, z.core.$strip>]>>;
494
- queues: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodObject<{
495
- paths: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
496
- partition: z.ZodCustom<(filepath: string) => string, (filepath: string) => string>;
497
- }, z.core.$strip>]>>;
498
- topics: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodObject<{
499
- paths: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
500
- partition: z.ZodCustom<(filepath: string) => string, (filepath: string) => string>;
501
- }, z.core.$strip>]>>;
502
- subscribers: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodObject<{
503
- paths: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
504
- partition: z.ZodCustom<(filepath: string) => string, (filepath: string) => string>;
505
- }, z.core.$strip>]>>;
506
- envParser: z.ZodOptional<z.ZodString>;
507
- logger: z.ZodOptional<z.ZodString>;
508
- hooks: z.ZodOptional<z.ZodObject<{
509
- server: z.ZodOptional<z.ZodString>;
510
- }, z.core.$strip>>;
511
- telescope: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean, z.ZodObject<{
512
- enabled: z.ZodOptional<z.ZodBoolean>;
513
- port: z.ZodOptional<z.ZodNumber>;
514
- path: z.ZodOptional<z.ZodString>;
515
- ignore: z.ZodOptional<z.ZodArray<z.ZodString>>;
516
- recordBody: z.ZodOptional<z.ZodBoolean>;
517
- maxEntries: z.ZodOptional<z.ZodNumber>;
518
- websocket: z.ZodOptional<z.ZodBoolean>;
519
- }, z.core.$strip>]>>;
520
- studio: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean, z.ZodObject<{
521
- enabled: z.ZodOptional<z.ZodBoolean>;
522
- path: z.ZodOptional<z.ZodString>;
523
- schema: z.ZodOptional<z.ZodString>;
524
- }, z.core.$strip>]>>;
525
- openapi: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
526
- enabled: z.ZodOptional<z.ZodBoolean>;
527
- title: z.ZodOptional<z.ZodString>;
528
- version: z.ZodOptional<z.ZodString>;
529
- description: z.ZodOptional<z.ZodString>;
530
- }, z.core.$strip>]>>;
531
- runtime: z.ZodOptional<z.ZodEnum<{
532
- node: "node";
533
- bun: "bun";
534
- }>>;
535
- env: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
536
- entry: z.ZodOptional<z.ZodString>;
537
- framework: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
538
- hono: "hono";
539
- "better-auth": "better-auth";
540
- express: "express";
541
- fastify: "fastify";
542
- }>, z.ZodEnum<{
543
- nextjs: "nextjs";
544
- remix: "remix";
545
- vite: "vite";
546
- "tanstack-start": "tanstack-start";
547
- }>, z.ZodEnum<{
548
- expo: "expo";
549
- }>]>>;
550
- config: z.ZodOptional<z.ZodObject<{
551
- client: z.ZodOptional<z.ZodString>;
552
- server: z.ZodOptional<z.ZodString>;
553
- }, z.core.$strip>>;
554
- }, z.core.$strip>>>;
555
- shared: z.ZodOptional<z.ZodObject<{
556
- packages: z.ZodOptional<z.ZodArray<z.ZodString>>;
557
- models: z.ZodOptional<z.ZodObject<{
558
- path: z.ZodOptional<z.ZodString>;
559
- schema: z.ZodOptional<z.ZodEnum<{
560
- zod: "zod";
561
- }>>;
562
- }, z.core.$strip>>;
563
- }, z.core.$strip>>;
564
- deploy: z.ZodOptional<z.ZodObject<{
565
- default: z.ZodOptional<z.ZodEnum<{
566
- dokploy: "dokploy";
567
- vercel: "vercel";
568
- cloudflare: "cloudflare";
569
- }>>;
570
- dokploy: z.ZodOptional<z.ZodObject<{
571
- endpoint: z.ZodOptional<z.ZodURL>;
572
- endpoints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodURL>>;
573
- registry: z.ZodOptional<z.ZodString>;
574
- registryId: z.ZodOptional<z.ZodString>;
575
- domains: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
576
- }, z.core.$strip>>;
577
- dns: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
578
- provider: z.ZodLiteral<"hostinger">;
579
- ttl: z.ZodOptional<z.ZodNumber>;
580
- }, z.core.$strip>, z.ZodObject<{
581
- provider: z.ZodLiteral<"route53">;
582
- region: z.ZodOptional<z.ZodEnum<{
583
- "us-east-1": "us-east-1";
584
- "us-east-2": "us-east-2";
585
- "us-west-1": "us-west-1";
586
- "us-west-2": "us-west-2";
587
- "af-south-1": "af-south-1";
588
- "ap-east-1": "ap-east-1";
589
- "ap-south-1": "ap-south-1";
590
- "ap-south-2": "ap-south-2";
591
- "ap-southeast-1": "ap-southeast-1";
592
- "ap-southeast-2": "ap-southeast-2";
593
- "ap-southeast-3": "ap-southeast-3";
594
- "ap-southeast-4": "ap-southeast-4";
595
- "ap-northeast-1": "ap-northeast-1";
596
- "ap-northeast-2": "ap-northeast-2";
597
- "ap-northeast-3": "ap-northeast-3";
598
- "ca-central-1": "ca-central-1";
599
- "eu-central-1": "eu-central-1";
600
- "eu-central-2": "eu-central-2";
601
- "eu-west-1": "eu-west-1";
602
- "eu-west-2": "eu-west-2";
603
- "eu-west-3": "eu-west-3";
604
- "eu-south-1": "eu-south-1";
605
- "eu-south-2": "eu-south-2";
606
- "eu-north-1": "eu-north-1";
607
- "me-south-1": "me-south-1";
608
- "me-central-1": "me-central-1";
609
- "sa-east-1": "sa-east-1";
610
- }>>;
611
- profile: z.ZodOptional<z.ZodString>;
612
- hostedZoneId: z.ZodOptional<z.ZodString>;
613
- ttl: z.ZodOptional<z.ZodNumber>;
614
- }, z.core.$strip>, z.ZodObject<{
615
- provider: z.ZodLiteral<"cloudflare">;
616
- ttl: z.ZodOptional<z.ZodNumber>;
617
- }, z.core.$strip>, z.ZodObject<{
618
- provider: z.ZodLiteral<"manual">;
619
- }, z.core.$strip>], "provider">, z.ZodObject<{
620
- provider: z.ZodCustom<{
621
- name: string;
622
- getRecords: Function;
623
- upsertRecords: Function;
624
- }, {
625
- name: string;
626
- getRecords: Function;
627
- upsertRecords: Function;
628
- }>;
629
- ttl: z.ZodOptional<z.ZodNumber>;
630
- }, z.core.$strip>]>>, z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
631
- provider: z.ZodLiteral<"hostinger">;
632
- ttl: z.ZodOptional<z.ZodNumber>;
633
- domain: z.ZodString;
634
- }, z.core.$strip>, z.ZodObject<{
635
- provider: z.ZodLiteral<"route53">;
636
- region: z.ZodOptional<z.ZodEnum<{
637
- "us-east-1": "us-east-1";
638
- "us-east-2": "us-east-2";
639
- "us-west-1": "us-west-1";
640
- "us-west-2": "us-west-2";
641
- "af-south-1": "af-south-1";
642
- "ap-east-1": "ap-east-1";
643
- "ap-south-1": "ap-south-1";
644
- "ap-south-2": "ap-south-2";
645
- "ap-southeast-1": "ap-southeast-1";
646
- "ap-southeast-2": "ap-southeast-2";
647
- "ap-southeast-3": "ap-southeast-3";
648
- "ap-southeast-4": "ap-southeast-4";
649
- "ap-northeast-1": "ap-northeast-1";
650
- "ap-northeast-2": "ap-northeast-2";
651
- "ap-northeast-3": "ap-northeast-3";
652
- "ca-central-1": "ca-central-1";
653
- "eu-central-1": "eu-central-1";
654
- "eu-central-2": "eu-central-2";
655
- "eu-west-1": "eu-west-1";
656
- "eu-west-2": "eu-west-2";
657
- "eu-west-3": "eu-west-3";
658
- "eu-south-1": "eu-south-1";
659
- "eu-south-2": "eu-south-2";
660
- "eu-north-1": "eu-north-1";
661
- "me-south-1": "me-south-1";
662
- "me-central-1": "me-central-1";
663
- "sa-east-1": "sa-east-1";
664
- }>>;
665
- profile: z.ZodOptional<z.ZodString>;
666
- hostedZoneId: z.ZodOptional<z.ZodString>;
667
- ttl: z.ZodOptional<z.ZodNumber>;
668
- domain: z.ZodString;
669
- }, z.core.$strip>, z.ZodObject<{
670
- provider: z.ZodLiteral<"cloudflare">;
671
- ttl: z.ZodOptional<z.ZodNumber>;
672
- domain: z.ZodString;
673
- }, z.core.$strip>, z.ZodObject<{
674
- provider: z.ZodLiteral<"manual">;
675
- domain: z.ZodString;
676
- }, z.core.$strip>], "provider">, z.ZodObject<{
677
- provider: z.ZodCustom<{
678
- name: string;
679
- getRecords: Function;
680
- upsertRecords: Function;
681
- }, {
682
- name: string;
683
- getRecords: Function;
684
- upsertRecords: Function;
685
- }>;
686
- ttl: z.ZodOptional<z.ZodNumber>;
687
- domain: z.ZodString;
688
- }, z.core.$strip>]>]>>;
689
- backups: z.ZodOptional<z.ZodObject<{
690
- type: z.ZodLiteral<"s3">;
691
- profile: z.ZodOptional<z.ZodString>;
692
- region: z.ZodEnum<{
693
- "us-east-1": "us-east-1";
694
- "us-east-2": "us-east-2";
695
- "us-west-1": "us-west-1";
696
- "us-west-2": "us-west-2";
697
- "af-south-1": "af-south-1";
698
- "ap-east-1": "ap-east-1";
699
- "ap-south-1": "ap-south-1";
700
- "ap-south-2": "ap-south-2";
701
- "ap-southeast-1": "ap-southeast-1";
702
- "ap-southeast-2": "ap-southeast-2";
703
- "ap-southeast-3": "ap-southeast-3";
704
- "ap-southeast-4": "ap-southeast-4";
705
- "ap-northeast-1": "ap-northeast-1";
706
- "ap-northeast-2": "ap-northeast-2";
707
- "ap-northeast-3": "ap-northeast-3";
708
- "ca-central-1": "ca-central-1";
709
- "eu-central-1": "eu-central-1";
710
- "eu-central-2": "eu-central-2";
711
- "eu-west-1": "eu-west-1";
712
- "eu-west-2": "eu-west-2";
713
- "eu-west-3": "eu-west-3";
714
- "eu-south-1": "eu-south-1";
715
- "eu-south-2": "eu-south-2";
716
- "eu-north-1": "eu-north-1";
717
- "me-south-1": "me-south-1";
718
- "me-central-1": "me-central-1";
719
- "sa-east-1": "sa-east-1";
720
- }>;
721
- schedule: z.ZodOptional<z.ZodString>;
722
- retention: z.ZodOptional<z.ZodNumber>;
723
- }, z.core.$strip>>;
724
- }, z.core.$strip>>;
725
- services: z.ZodOptional<z.ZodObject<{
726
- db: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
727
- version: z.ZodOptional<z.ZodString>;
728
- image: z.ZodOptional<z.ZodString>;
729
- }, z.core.$strip>]>>;
730
- cache: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
731
- version: z.ZodOptional<z.ZodString>;
732
- image: z.ZodOptional<z.ZodString>;
733
- }, z.core.$strip>, z.ZodEnum<{
734
- upstash: "upstash";
735
- elasticache: "elasticache";
736
- db: "db";
737
- }>]>>;
738
- mail: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
739
- version: z.ZodOptional<z.ZodString>;
740
- image: z.ZodOptional<z.ZodString>;
741
- smtp: z.ZodOptional<z.ZodObject<{
742
- host: z.ZodString;
743
- port: z.ZodNumber;
744
- user: z.ZodOptional<z.ZodString>;
745
- pass: z.ZodOptional<z.ZodString>;
746
- }, z.core.$strip>>;
747
- }, z.core.$strip>, z.ZodEnum<{
748
- resend: "resend";
749
- ses: "ses";
750
- smtp: "smtp";
751
- }>]>>;
752
- storage: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
753
- version: z.ZodOptional<z.ZodString>;
754
- image: z.ZodOptional<z.ZodString>;
755
- }, z.core.$strip>, z.ZodEnum<{
756
- minio: "minio";
757
- s3: "s3";
758
- r2: "r2";
759
- }>]>>;
760
- events: z.ZodOptional<z.ZodEnum<{
761
- pgboss: "pgboss";
762
- sns: "sns";
763
- rabbitmq: "rabbitmq";
764
- }>>;
765
- trustLocalCa: z.ZodOptional<z.ZodBoolean>;
766
- }, z.core.$strip>>;
767
- stages: z.ZodObject<{
768
- local: z.ZodString;
769
- deployed: z.ZodArray<z.ZodString>;
770
- protected: z.ZodOptional<z.ZodArray<z.ZodString>>;
771
- }, z.core.$strip>;
772
- secrets: z.ZodOptional<z.ZodObject<{
773
- enabled: z.ZodOptional<z.ZodBoolean>;
774
- algorithm: z.ZodOptional<z.ZodString>;
775
- kdf: z.ZodOptional<z.ZodEnum<{
776
- scrypt: "scrypt";
777
- pbkdf2: "pbkdf2";
778
- }>>;
779
- }, z.core.$strip>>;
780
- state: z.ZodOptional<z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
781
- provider: z.ZodLiteral<"local">;
782
- }, z.core.$strip>, z.ZodObject<{
783
- provider: z.ZodLiteral<"ssm">;
784
- region: z.ZodEnum<{
785
- "us-east-1": "us-east-1";
786
- "us-east-2": "us-east-2";
787
- "us-west-1": "us-west-1";
788
- "us-west-2": "us-west-2";
789
- "af-south-1": "af-south-1";
790
- "ap-east-1": "ap-east-1";
791
- "ap-south-1": "ap-south-1";
792
- "ap-south-2": "ap-south-2";
793
- "ap-southeast-1": "ap-southeast-1";
794
- "ap-southeast-2": "ap-southeast-2";
795
- "ap-southeast-3": "ap-southeast-3";
796
- "ap-southeast-4": "ap-southeast-4";
797
- "ap-northeast-1": "ap-northeast-1";
798
- "ap-northeast-2": "ap-northeast-2";
799
- "ap-northeast-3": "ap-northeast-3";
800
- "ca-central-1": "ca-central-1";
801
- "eu-central-1": "eu-central-1";
802
- "eu-central-2": "eu-central-2";
803
- "eu-west-1": "eu-west-1";
804
- "eu-west-2": "eu-west-2";
805
- "eu-west-3": "eu-west-3";
806
- "eu-south-1": "eu-south-1";
807
- "eu-south-2": "eu-south-2";
808
- "eu-north-1": "eu-north-1";
809
- "me-south-1": "me-south-1";
810
- "me-central-1": "me-central-1";
811
- "sa-east-1": "sa-east-1";
812
- }>;
813
- profile: z.ZodOptional<z.ZodString>;
814
- }, z.core.$strip>], "provider">, z.ZodObject<{
815
- provider: z.ZodCustom<{
816
- read: Function;
817
- write: Function;
818
- }, {
819
- read: Function;
820
- write: Function;
821
- }>;
822
- }, z.core.$strip>]>>;
823
- }, z.core.$strip>;
824
- /**
825
- * Validate workspace configuration.
826
- * Throws ZodError with detailed messages on validation failure.
827
- */
828
- declare function validateWorkspaceConfig(config: unknown): z.infer<typeof WorkspaceConfigSchema>;
829
- /**
830
- * Safe validation that returns result instead of throwing.
831
- */
832
- declare function safeValidateWorkspaceConfig(config: unknown): {
833
- success: boolean;
834
- data?: z.infer<typeof WorkspaceConfigSchema>;
835
- error?: z.ZodError;
836
- };
837
- /**
838
- * Format Zod errors into user-friendly messages.
839
- */
840
- declare function formatValidationErrors(error: z.ZodError): string;
841
- //#endregion
842
- //#region src/workspace/types.d.ts
843
- /**
844
- * Deploy target for an app.
845
- *
846
- * Specifies where the app will be deployed.
847
- *
848
- * @example
849
- * ```ts
850
- * // Currently supported
851
- * deploy: 'dokploy'
852
- *
853
- * // Future support (not yet implemented)
854
- * deploy: 'vercel'
855
- * deploy: 'cloudflare'
856
- * ```
857
- */
858
- type DeployTarget = 'dokploy' | 'vercel' | 'cloudflare';
859
- /**
860
- * Service image configuration for custom Docker images.
861
- *
862
- * @example
863
- * ```ts
864
- * // Use specific version
865
- * db: { version: '18-alpine' }
866
- *
867
- * // Use custom image
868
- * db: { image: 'timescale/timescaledb:latest-pg16' }
869
- * ```
870
- */
871
- interface ServiceImageConfig {
872
- /** Docker image version/tag (e.g., '18-alpine') */
873
- version?: string;
874
- /** Full Docker image reference (overrides version) */
875
- image?: string;
876
- }
877
- /**
878
- * Mail service configuration.
879
- *
880
- * In development, uses Mailpit for email testing.
881
- * In production, uses SMTP configuration.
882
- *
883
- * @example
884
- * ```ts
885
- * services: {
886
- * mail: {
887
- * smtp: {
888
- * host: 'smtp.sendgrid.net',
889
- * port: 587,
890
- * user: 'apikey',
891
- * pass: process.env.SENDGRID_API_KEY,
892
- * }
893
- * }
894
- * }
895
- * ```
896
- */
897
- interface MailServiceConfig extends ServiceImageConfig {
898
- /** SMTP configuration for production */
899
- smtp?: {
900
- host: string;
901
- port: number;
902
- user?: string;
903
- pass?: string;
904
- };
905
- }
906
- /**
907
- * Development services configuration.
908
- *
909
- * Configures shared infrastructure services like databases and caches.
910
- * These are automatically provisioned in Dokploy during deployment.
911
- *
912
- * @example
913
- * ```ts
914
- * // Enable with defaults
915
- * services: {
916
- * db: true, // postgres:18-alpine
917
- * cache: true, // redis:8-alpine
918
- * }
919
- *
920
- * // Custom versions
921
- * services: {
922
- * db: { version: '18-alpine' },
923
- * cache: { version: '7-alpine' },
924
- * }
925
- *
926
- * // Custom images
927
- * services: {
928
- * db: { image: 'timescale/timescaledb:latest-pg16' },
929
- * }
930
- *
931
- * // With mail service
932
- * services: {
933
- * db: true,
934
- * cache: true,
935
- * mail: true, // Mailpit in dev
936
- * }
937
- *
938
- * // With event backend
939
- * services: {
940
- * db: true,
941
- * cache: true,
942
- * events: 'pgboss', // reuses postgres (auto-enables db)
943
- * // events: 'sns', // adds LocalStack container
944
- * // events: 'rabbitmq', // adds RabbitMQ container
945
- * }
946
- * ```
947
- */
948
- interface ServicesConfig {
949
- /**
950
- * Whether to install the local edge's certificate authority automatically.
951
- *
952
- * A declared `file-server` answers on `https://` locally, which needs a
953
- * certificate, which needs an authority this machine trusts. Everything gkm
954
- * starts trusts it already — reconcile injects `NODE_EXTRA_CA_CERTS` — but a
955
- * *browser* asks the operating system, and until the root is in its store a
956
- * local address reads as "not secure".
957
- *
958
- * Installing it needs `sudo`, so it is never silent by default:
959
- *
960
- * - unset — `gkm setup` asks once, on a machine that does not trust it yet,
961
- * and remembers a "no" so it stops asking.
962
- * - `true` — install without asking. For a team that has decided, and for
963
- * any machine where a prompt has nobody to answer it.
964
- * - `false` — never. Correct for CI, and for anyone who only ever reaches
965
- * these addresses from code, which trusts the root without any of this.
966
- */
967
- trustLocalCa?: boolean;
968
- /**
969
- * Where a declared cache lives — `'upstash'`, `'elasticache'` or `'db'`.
970
- *
971
- * A backend name and nothing else. Whether there *is* a cache comes from the
972
- * manifest: declaring one implies its container the way declaring a database
973
- * implies Postgres, so this only ever answers the second question.
974
- *
975
- * Defaults by target — see `DEFAULT_CACHE`.
976
- */
977
- cache?: CacheBackend;
978
- /**
979
- * Who delivers a declared app's mail — `'ses'`, `'resend'` or `'smtp'`.
980
- *
981
- * Locally every one of them is Mailpit, because every one speaks SMTP.
982
- */
983
- mail?: EmailBackend;
984
- /** Where a declared bucket lives — `'minio'`, `'s3'` or `'r2'`. */
985
- storage?: StorageBackend;
986
- /** What carries a declared queue or topic — pgboss, sns or rabbitmq. */
987
- events?: EventsBackend;
988
- /**
989
- * Image pins for the containers the manifest derives.
990
- *
991
- * Separate from the backend names above, because they answer unrelated
992
- * questions: a backend says where a thing lives, a pin says which image runs
993
- * locally. They shared one key until `cache: true` meant "start a Redis" —
994
- * which was the last way a container could exist because config asked for
995
- * it rather than because something declared it.
996
- *
997
- * ```ts
998
- * services: { cache: 'elasticache', images: { redis: 'redis:6-alpine' } }
999
- * ```
1000
- *
1001
- * Pinning an image for a container nothing declares is a no-op, not an
1002
- * error: it says which image *would* run, and nothing runs.
1003
- */
1004
- images?: Partial<Record<ComposeServiceName, string>>;
1005
- }
1006
- /**
1007
- * Stage-based domain configuration.
1008
- *
1009
- * Maps deployment stages to base domains. The main frontend app
1010
- * gets the base domain, other apps get `{appName}.{baseDomain}`.
1011
- *
1012
- * @example
1013
- * ```ts
1014
- * domains: {
1015
- * development: 'dev.myapp.com',
1016
- * staging: 'staging.myapp.com',
1017
- * production: 'myapp.com',
1018
- * }
1019
- *
1020
- * // Result for production stage:
1021
- * // - web (main frontend): myapp.com
1022
- * // - api: api.myapp.com
1023
- * // - auth: auth.myapp.com
1024
- * ```
1025
- */
1026
- type DokployDomainsConfig = Record<string, string>;
1027
- /**
1028
- * Per-app domain override configuration.
1029
- *
1030
- * Can be a single domain string (used for all stages) or
1031
- * stage-specific domains.
1032
- *
1033
- * @example
1034
- * ```ts
1035
- * // Single domain for all stages
1036
- * domain: 'api.custom.com'
1037
- *
1038
- * // Stage-specific domains
1039
- * domain: {
1040
- * development: 'api.dev.custom.com',
1041
- * staging: 'api.staging.custom.com',
1042
- * production: 'api.custom.com',
1043
- * }
1044
- * ```
1045
- */
1046
- type AppDomainConfig = string | Record<string, string>;
1047
- /**
1048
- * Dokploy workspace deployment configuration.
1049
- *
1050
- * Configures how the workspace is deployed to a Dokploy server.
1051
- * One workspace maps to one Dokploy project with stage-based environments.
1052
- * Project IDs are stored in deploy state (not config) and created on first deploy.
1053
- *
1054
- * @example Single endpoint for all stages:
1055
- * ```ts
1056
- * deploy: {
1057
- * default: 'dokploy',
1058
- * dokploy: {
1059
- * endpoint: 'https://dokploy.myserver.com',
1060
- * registry: 'ghcr.io/myorg',
1061
- * },
1062
- * }
1063
- * ```
1064
- *
1065
- * @example Per-stage endpoints (different Dokploy servers):
1066
- * ```ts
1067
- * deploy: {
1068
- * default: 'dokploy',
1069
- * dokploy: {
1070
- * endpoints: {
1071
- * development: 'https://dev-dokploy.myserver.com',
1072
- * production: 'https://dokploy.myserver.com',
1073
- * },
1074
- * registry: 'ghcr.io/myorg',
1075
- * },
1076
- * }
1077
- * ```
1078
- */
1079
- interface DokployWorkspaceConfig {
1080
- /** Dokploy API endpoint for all stages */
1081
- endpoint?: string;
1082
- /** Per-stage Dokploy API endpoints (overrides endpoint) */
1083
- endpoints?: Record<string, string>;
1084
- /** Container registry for Docker images (e.g., 'ghcr.io/myorg') */
1085
- registry?: string;
1086
- /** Registry ID in Dokploy (auto-configured) */
1087
- registryId?: string;
1088
- /**
1089
- * Stage-based domain configuration.
1090
- * The main frontend app gets the base domain.
1091
- * Other apps get {appName}.{baseDomain} by default.
1092
- */
1093
- domains?: DokployDomainsConfig;
1094
- }
1095
- /**
1096
- * DNS provider types for automatic DNS record creation.
1097
- */
1098
-
1099
- /**
1100
- * Deployment configuration for the workspace.
1101
- *
1102
- * @example
1103
- * ```ts
1104
- * // Minimal - just set default target
1105
- * deploy: {
1106
- * default: 'dokploy',
1107
- * }
1108
- *
1109
- * // Full configuration with DNS and backups
1110
- * deploy: {
1111
- * default: 'dokploy',
1112
- * dokploy: {
1113
- * endpoint: 'https://dokploy.myserver.com',
1114
- * projectId: 'proj_abc123',
1115
- * registry: 'ghcr.io/myorg',
1116
- * domains: {
1117
- * production: 'myapp.com',
1118
- * },
1119
- * },
1120
- * dns: {
1121
- * provider: 'hostinger',
1122
- * domain: 'myapp.com',
1123
- * },
1124
- * backups: {
1125
- * type: 's3',
1126
- * region: 'us-east-1',
1127
- * },
1128
- * }
1129
- * ```
1130
- */
1131
- interface DeployConfig {
1132
- /** Default deploy target for all apps (default: 'dokploy') */
1133
- default?: DeployTarget;
1134
- /** Dokploy-specific configuration */
1135
- dokploy?: DokployWorkspaceConfig;
1136
- /** DNS configuration for automatic record creation */
1137
- dns?: DnsConfig;
1138
- /** Backup destination configuration for database services */
1139
- backups?: BackupsConfig;
1140
- }
1141
- /**
1142
- * Models package configuration for shared schemas.
1143
- *
1144
- * Configures a shared models package containing Zod schemas
1145
- * that can be used across backend and frontend apps.
1146
- *
1147
- * @example
1148
- * ```ts
1149
- * shared: {
1150
- * models: {
1151
- * path: 'packages/models',
1152
- * schema: 'zod',
1153
- * },
1154
- * }
1155
- * ```
1156
- */
1157
- interface ModelsConfig {
1158
- /** Path to models package relative to workspace root (default: 'packages/models') */
1159
- path?: string;
1160
- /**
1161
- * Schema library to use (default: 'zod').
1162
- * Currently only 'zod' is supported.
1163
- * Future: any StandardSchema-compatible library
1164
- */
1165
- schema?: 'zod';
1166
- }
1167
- /**
1168
- * Shared packages configuration.
1169
- *
1170
- * Configures shared packages in the monorepo that are
1171
- * used by multiple apps.
1172
- *
1173
- * @example
1174
- * ```ts
1175
- * shared: {
1176
- * packages: ['packages/*', 'libs/*'],
1177
- * models: {
1178
- * path: 'packages/models',
1179
- * schema: 'zod',
1180
- * },
1181
- * }
1182
- * ```
1183
- */
1184
- interface SharedConfig {
1185
- /** Glob patterns for shared packages (default: ['packages/*']) */
1186
- packages?: string[];
1187
- /** Models package configuration */
1188
- models?: ModelsConfig;
1189
- }
1190
- /**
1191
- * The project's stages, named by the project.
1192
- *
1193
- * Stage names were literals scattered through the CLI — `gkm dev` ran as
1194
- * `development` and looked for `dev` secrets first, a deploy script said
1195
- * `production` — so a team that called its stages anything else was
1196
- * working against the tool. They are declared once, here, and read.
1197
- *
1198
- * @example
1199
- * ```ts
1200
- * stages: { local: 'dev', deployed: ['staging', 'prod'], protected: ['prod'] }
1201
- * ```
1202
- */
1203
- interface StagesConfig {
1204
- /**
1205
- * What `gkm dev`, `exec`, `setup` and `test` run as: the stage whose
1206
- * secrets are read locally, and whose containers carry no suffix.
1207
- *
1208
- * Never also a deployed stage. Secrets are stored per stage name, so a
1209
- * deployed stage sharing it would share its secrets with every laptop.
1210
- */
1211
- local: string;
1212
- /** The stages `gkm deploy --stage` accepts. */
1213
- deployed: string[];
1214
- /**
1215
- * Deployed stages whose resources outlive the stack that made them —
1216
- * retained on removal and protected, e.g. the stage users are on.
1217
- */
1218
- protected?: string[];
1219
- }
1220
- /**
1221
- * Secrets encryption configuration.
1222
- *
1223
- * Configures how secrets are encrypted for deployment.
1224
- * Secrets are stored encrypted in `.gkm/secrets/{stage}.json`
1225
- * with keys stored separately in `~/.gkm/{project}/{stage}.key`.
1226
- *
1227
- * @example
1228
- * ```ts
1229
- * secrets: {
1230
- * enabled: true,
1231
- * algorithm: 'aes-256-gcm',
1232
- * kdf: 'scrypt',
1233
- * }
1234
- * ```
1235
- */
1236
- interface SecretsConfig {
1237
- /** Enable encrypted secrets (default: true) */
1238
- enabled?: boolean;
1239
- /** Encryption algorithm (default: 'aes-256-gcm') */
1240
- algorithm?: string;
1241
- /** Key derivation function (default: 'scrypt') */
1242
- kdf?: 'scrypt' | 'pbkdf2';
1243
- }
1244
- /**
1245
- * Base app configuration properties (shared between input and normalized).
1246
- *
1247
- * @example
1248
- * ```ts
1249
- * // Backend app with gkm routes
1250
- * api: {
1251
- * type: 'backend',
1252
- * path: 'apps/api',
1253
- * port: 3000,
1254
- * routes: './src/endpoints/**\/*.ts',
1255
- * envParser: './src/config/env',
1256
- * logger: './src/config/logger',
1257
- * }
1258
- *
1259
- * // Backend app with entry point (e.g., Better Auth)
1260
- * auth: {
1261
- * type: 'backend',
1262
- * path: 'apps/auth',
1263
- * port: 3001,
1264
- * entry: './src/index.ts',
1265
- * framework: 'better-auth',
1266
- * requiredEnv: ['DATABASE_URL', 'BETTER_AUTH_SECRET'],
1267
- * }
1268
- *
1269
- * // Frontend app
1270
- * web: {
1271
- * type: 'web',
1272
- * path: 'apps/web',
1273
- * port: 3002,
1274
- * framework: 'nextjs',
1275
- * dependencies: ['api', 'auth'],
1276
- * }
1277
- * ```
1278
- */
1279
- interface AppConfigBase {
1280
- /**
1281
- * App type.
1282
- * - 'backend': Server-side app (API, auth service, etc.)
1283
- * - 'web': Client-side web app (Next.js, Vite, TanStack Start, etc.)
1284
- * - 'mobile': Native mobile app (Expo). Built/deployed via its own
1285
- * toolchain (e.g. EAS Build) — Docker/Dokploy steps are skipped.
1286
- * @default 'backend'
1287
- */
1288
- type?: 'backend' | 'web' | 'mobile';
1289
- /**
1290
- * Path to the app relative to workspace root.
1291
- * @example 'apps/api', 'apps/web', 'services/auth'
1292
- */
1293
- path: string;
1294
- /**
1295
- * Development server port.
1296
- * Must be unique across all apps in the workspace.
1297
- * @example 3000, 3001, 3002
1298
- */
1299
- port: number;
1300
- /**
1301
- * Per-app deploy target override.
1302
- * Overrides `deploy.default` for this specific app.
1303
- * @example 'dokploy', 'vercel'
1304
- */
1305
- deploy?: DeployTarget;
1306
- /**
1307
- * Constructs glob pattern — one glob, every kind.
1308
- *
1309
- * A glob per kind cannot find a resource, because a declared `ObjectStorage`
1310
- * has no kind to be listed under. This one is what reconcile reads to derive
1311
- * the containers a stage needs, and it replaces the per-kind globs below.
1312
- *
1313
- * @example './src/**\/*.ts'
1314
- */
1315
- constructs?: Routes;
1316
- /**
1317
- * Routes glob pattern for gkm endpoints.
1318
- * @example './src/endpoints/**\/*.ts'
1319
- */
1320
- routes?: Routes;
1321
- /**
1322
- * Functions glob pattern for Lambda functions.
1323
- * @example './src/functions/**\/*.ts'
1324
- */
1325
- functions?: Routes;
1326
- /**
1327
- * Crons glob pattern for scheduled tasks.
1328
- * @example './src/crons/**\/*.ts'
1329
- */
1330
- crons?: Routes;
1331
- /**
1332
- * Queues glob pattern for point-to-point workers.
1333
- * @example './src/queues/**\/*.ts'
1334
- */
1335
- queues?: Routes;
1336
- /**
1337
- * Topics glob pattern for the topics subscribers bind to.
1338
- * @example './src/topics/**\/*.ts'
1339
- */
1340
- topics?: Routes;
1341
- /**
1342
- * Subscribers glob pattern for event handlers.
1343
- * @example './src/subscribers/**\/*.ts'
1344
- */
1345
- subscribers?: Routes;
1346
- /**
1347
- * Path to environment parser module.
1348
- * @example './src/config/env'
1349
- */
1350
- envParser?: string;
1351
- /**
1352
- * Path to logger module.
1353
- * @example './src/config/logger'
1354
- */
1355
- logger?: string;
1356
- /** Provider configuration (AWS, Docker, etc.) */
1357
- providers?: ProvidersConfig;
1358
- /**
1359
- * Server lifecycle hooks.
1360
- * @example { beforeSetup: './src/hooks/setup.ts' }
1361
- */
1362
- hooks?: HooksConfig;
1363
- /**
1364
- * Telescope debugging dashboard configuration.
1365
- * @example true, './src/config/telescope', { enabled: true, path: '/__telescope' }
1366
- */
1367
- telescope?: string | boolean | TelescopeConfig;
1368
- /**
1369
- * Studio admin panel configuration.
1370
- * @example true, './src/config/studio'
1371
- */
1372
- studio?: string | boolean | StudioConfig;
1373
- /**
1374
- * OpenAPI documentation configuration.
1375
- * @example true, { output: './src/openapi.ts' }
1376
- */
1377
- openapi?: boolean | OpenApiConfig;
1378
- /**
1379
- * Runtime environment.
1380
- * @default 'node'
1381
- */
1382
- runtime?: Runtime;
1383
- /**
1384
- * Environment file(s) to load during development.
1385
- * @example '.env', ['.env', '.env.local']
1386
- */
1387
- env?: string | string[];
1388
- /**
1389
- * Entry file path for apps that don't use gkm routes.
1390
- *
1391
- * When specified, the app is run directly with tsx in development
1392
- * and bundled with esbuild for production Docker builds.
1393
- *
1394
- * Use this for:
1395
- * - Better Auth servers
1396
- * - Custom Hono/Express apps
1397
- * - Any backend that doesn't use gkm's endpoint builder
1398
- *
1399
- * @example './src/index.ts', './src/server.ts'
1400
- */
1401
- entry?: string;
1402
- /**
1403
- * Framework for the app.
1404
- *
1405
- * Backend frameworks: 'hono', 'better-auth', 'express', 'fastify'
1406
- * Frontend frameworks: 'nextjs', 'remix', 'vite', 'tanstack-start'
1407
- * Mobile frameworks: 'expo'
1408
- *
1409
- * @example 'nextjs', 'better-auth', 'hono', 'expo'
1410
- */
1411
- framework?: Framework;
1412
- /**
1413
- * Config file paths for frontend environment sniffing.
1414
- *
1415
- * Points to file(s) that call EnvironmentParser.parse() at import time.
1416
- * The sniffer imports these files and captures all env vars accessed.
1417
- *
1418
- * Dependencies are auto-generated as public-prefixed URL vars based on
1419
- * the app's framework (e.g. `NEXT_PUBLIC_{DEP}_URL` for Next.js,
1420
- * `VITE_{DEP}_URL` for Vite/TanStack Start, `EXPO_PUBLIC_{DEP}_URL`
1421
- * for Expo).
1422
- *
1423
- * @example
1424
- * ```ts
1425
- * config: {
1426
- * client: './src/config/client.ts', // public-prefixed vars for browser
1427
- * server: './src/config/server.ts', // server-only vars for SSR
1428
- * }
1429
- * ```
1430
- */
1431
- config?: {
1432
- /** Client-side config (public-prefixed vars, available in browser/device) */
1433
- client?: string;
1434
- /** Server-side config (all env vars, for SSR/API routes) */
1435
- server?: string;
1436
- };
1437
- /**
1438
- * Override domain for this app.
1439
- *
1440
- * By default, apps get `{appName}.{baseDomain}` (or just `{baseDomain}`
1441
- * for the main frontend). Use this to specify a custom domain.
1442
- *
1443
- * @example
1444
- * ```ts
1445
- * // Single domain for all stages
1446
- * domain: 'api.custom.com'
1447
- *
1448
- * // Stage-specific domains
1449
- * domain: {
1450
- * production: 'api.custom.com',
1451
- * staging: 'api.staging.custom.com',
1452
- * }
1453
- * ```
1454
- */
1455
- domain?: AppDomainConfig;
1456
- /**
1457
- * Required environment variables for entry-based apps.
1458
- *
1459
- * Use this instead of envParser for apps that don't use gkm routes.
1460
- * The deploy command uses this list to filter which secrets to embed
1461
- * in the Docker image.
1462
- *
1463
- * @example ['DATABASE_URL', 'BETTER_AUTH_SECRET', 'REDIS_URL']
1464
- */
1465
- requiredEnv?: string[];
1466
- }
1467
- /**
1468
- * App configuration input with type-safe dependencies.
1469
- *
1470
- * @template TAppNames - Union of valid app names in the workspace (auto-inferred)
1471
- *
1472
- * @example
1473
- * ```ts
1474
- * // Dependencies are type-checked against app names
1475
- * apps: {
1476
- * api: { path: 'apps/api', port: 3000 },
1477
- * auth: { path: 'apps/auth', port: 3001 },
1478
- * web: {
1479
- * path: 'apps/web',
1480
- * port: 3002,
1481
- * type: 'web',
1482
- * dependencies: ['api', 'auth'], // ✓ Valid
1483
- * // dependencies: ['invalid'], // ✗ Type error
1484
- * },
1485
- * }
1486
- * ```
1487
- */
1488
- interface AppConfigInput<TAppNames extends string = string> extends AppConfigBase {
1489
- /** Dependencies on other apps in the workspace (type-safe) */
1490
- dependencies?: TAppNames[];
1491
- }
1492
- /**
1493
- * App configuration (legacy, for backwards compatibility).
1494
- * @deprecated Use AppConfigInput for new code
1495
- */
1496
- interface AppConfig extends AppConfigBase {
1497
- /** Dependencies on other apps in the workspace */
1498
- dependencies?: string[];
1499
- }
1500
- /**
1501
- * Base app input type for type inference.
1502
- */
1503
- type AppInput = AppConfigBase & {
1504
- dependencies?: readonly string[];
1505
- };
1506
- /**
1507
- * Apps record type for workspace configuration.
1508
- */
1509
- type AppsRecord = Record<string, AppInput>;
1510
- /**
1511
- * Constrain apps so dependencies only reference valid app names.
1512
- * Dependencies must be an array of valid app names from the workspace.
1513
- */
1514
- type ConstrainedApps<TApps extends AppsRecord> = { [K in keyof TApps]: Omit<TApps[K], 'dependencies'> & {
1515
- dependencies?: readonly (keyof TApps & string)[];
1516
- } };
1517
- /**
1518
- * Full workspace input type with constrained dependencies.
1519
- *
1520
- * @example
1521
- * ```ts
1522
- * import { defineWorkspace } from '@geekmidas/cli';
1523
- *
1524
- * export default defineWorkspace({
1525
- * name: 'my-app',
1526
- * apps: {
1527
- * api: {
1528
- * path: 'apps/api',
1529
- * port: 3000,
1530
- * routes: './src/endpoints/**\/*.ts',
1531
- * },
1532
- * web: {
1533
- * type: 'web',
1534
- * path: 'apps/web',
1535
- * port: 3001,
1536
- * framework: 'nextjs',
1537
- * dependencies: ['api'],
1538
- * },
1539
- * },
1540
- * services: {
1541
- * db: true,
1542
- * cache: true,
1543
- * },
1544
- * deploy: {
1545
- * default: 'dokploy',
1546
- * },
1547
- * });
1548
- * ```
1549
- */
1550
- type WorkspaceInput<TApps extends AppsRecord> = {
1551
- /**
1552
- * Where the workspace's own constructs live, relative to its root.
1553
- *
1554
- * The product's infrastructure, declared once for every app that consumes
1555
- * it. Additive with an app's own glob rather than replacing it.
1556
- */
1557
- constructs?: Routes;
1558
- /** Workspace name (defaults to root package.json name) */
1559
- name?: string;
1560
- /**
1561
- * Apps that nothing declares.
1562
- *
1563
- * Normally absent: a `site` is an app and so is a `rest-api` that named
1564
- * one, so the list is read off the graph. This is the escape hatch for what
1565
- * no construct describes.
1566
- */
1567
- apps?: ConstrainedApps<TApps>;
1568
- /** Shared packages configuration */
1569
- shared?: SharedConfig;
1570
- /** Deployment configuration */
1571
- deploy?: DeployConfig;
1572
- /** Development services (db, cache, mail, storage, events) */
1573
- services?: ServicesConfig;
1574
- /** The project's stages: which one is local, which deploy */
1575
- stages: StagesConfig;
1576
- /** Encrypted secrets configuration */
1577
- secrets?: SecretsConfig;
1578
- /** State provider configuration (local filesystem by default, or SSM for team collaboration) */
1579
- state?: StateConfig;
1580
- };
1581
- /**
1582
- * Extract app names from apps record.
1583
- */
1584
- type InferAppNames<TApps extends AppsRecord> = keyof TApps & string;
1585
- /**
1586
- * Inferred workspace config with proper app name types.
1587
- */
1588
- type InferredWorkspaceConfig<TApps extends AppsRecord> = {
1589
- /**
1590
- * Where the workspace's own constructs live, relative to its root.
1591
- *
1592
- * The product's infrastructure, declared once for every app that consumes
1593
- * it. Additive with an app's own glob rather than replacing it.
1594
- */
1595
- constructs?: Routes;
1596
- name?: string;
1597
- apps?: { [K in keyof TApps]: Omit<TApps[K], 'dependencies'> & {
1598
- dependencies?: InferAppNames<TApps>[];
1599
- } };
1600
- shared?: SharedConfig;
1601
- deploy?: DeployConfig;
1602
- services?: ServicesConfig;
1603
- stages: StagesConfig;
1604
- secrets?: SecretsConfig;
1605
- state?: StateConfig;
1606
- };
1607
- /** @deprecated Use WorkspaceInput */
1608
-
1609
- /**
1610
- * Workspace configuration for multi-app monorepos.
1611
- *
1612
- * Use `defineWorkspace()` helper for type-safe configuration with
1613
- * auto-completion and dependency validation.
1614
- *
1615
- * @example
1616
- * ```ts
1617
- * // gkm.config.ts
1618
- * import { defineWorkspace } from '@geekmidas/cli';
1619
- *
1620
- * export default defineWorkspace({
1621
- * name: 'my-saas',
1622
- *
1623
- * // App definitions
1624
- * apps: {
1625
- * // Backend API with gkm routes
1626
- * api: {
1627
- * path: 'apps/api',
1628
- * port: 3000,
1629
- * routes: './src/endpoints/**\/*.ts',
1630
- * envParser: './src/config/env',
1631
- * logger: './src/config/logger',
1632
- * telescope: true,
1633
- * },
1634
- *
1635
- * // Better Auth service
1636
- * auth: {
1637
- * path: 'apps/auth',
1638
- * port: 3001,
1639
- * entry: './src/index.ts',
1640
- * framework: 'better-auth',
1641
- * requiredEnv: ['DATABASE_URL', 'BETTER_AUTH_SECRET'],
1642
- * },
1643
- *
1644
- * // Next.js frontend
1645
- * web: {
1646
- * type: 'web',
1647
- * path: 'apps/web',
1648
- * port: 3002,
1649
- * framework: 'nextjs',
1650
- * dependencies: ['api', 'auth'],
1651
- * },
1652
- * },
1653
- *
1654
- * // Infrastructure services
1655
- * services: {
1656
- * db: true, // PostgreSQL
1657
- * cache: true, // Redis
1658
- * },
1659
- *
1660
- * // Deployment configuration
1661
- * deploy: {
1662
- * default: 'dokploy',
1663
- * dokploy: {
1664
- * endpoint: 'https://dokploy.myserver.com',
1665
- * projectId: 'proj_abc123',
1666
- * registry: 'ghcr.io/myorg',
1667
- * domains: {
1668
- * production: 'myapp.com',
1669
- * staging: 'staging.myapp.com',
1670
- * },
1671
- * },
1672
- * },
1673
- *
1674
- * // Shared packages
1675
- * shared: {
1676
- * packages: ['packages/*'],
1677
- * models: { path: 'packages/models' },
1678
- * },
1679
- * });
1680
- * ```
1681
- *
1682
- * @deprecated Use WorkspaceInput with defineWorkspace for type inference
1683
- */
1684
- interface WorkspaceConfig {
1685
- /**
1686
- * Where the workspace's own constructs live, relative to its root.
1687
- *
1688
- * The product's infrastructure, declared once for every app that consumes
1689
- * it. Additive with an app's own glob rather than replacing it.
1690
- */
1691
- constructs?: Routes;
1692
- /** Workspace name (defaults to root package.json name) */
1693
- name?: string;
1694
- /** Apps that nothing declares. Normally absent — see `WorkspaceInput`. */
1695
- apps?: Record<string, AppConfig>;
1696
- /** Shared packages configuration */
1697
- shared?: SharedConfig;
1698
- /** Default deployment configuration */
1699
- deploy?: DeployConfig;
1700
- /** Development services (db, cache, mail, storage, events) */
1701
- services?: ServicesConfig;
1702
- /** The project's stages: which one is local, which deploy */
1703
- stages: StagesConfig;
1704
- /** Encrypted secrets configuration */
1705
- secrets?: SecretsConfig;
1706
- /** State provider configuration (local filesystem by default, or SSM for team collaboration) */
1707
- state?: StateConfig;
1708
- }
1709
- /**
1710
- * Normalized app configuration with resolved defaults.
1711
- *
1712
- * This is the internal representation after processing user input.
1713
- * All optional fields have been resolved to their defaults.
1714
- */
1715
- interface NormalizedAppConfig extends Omit<AppConfigBase, 'type'> {
1716
- /**
1717
- * Whether the base domain points at this site.
1718
- *
1719
- * Carried from the `site` declaration rather than configured, because which
1720
- * site is primary is structural — its *hostname* is what varies by stage,
1721
- * and that is `domain`.
1722
- */
1723
- root?: boolean;
1724
- /** App type (always defined after normalization) */
1725
- type: 'backend' | 'web' | 'mobile';
1726
- /** Path to the app */
1727
- path: string;
1728
- /** Development server port */
1729
- port: number;
1730
- /** Resolved dependencies array (empty array if none) */
1731
- dependencies: string[];
1732
- /** Resolved deploy target (app.deploy > deploy.default > 'dokploy') */
1733
- resolvedDeployTarget: DeployTarget;
1734
- /** Entry file path for non-gkm apps */
1735
- entry?: string;
1736
- /** Framework for the app */
1737
- framework?: Framework;
1738
- /** Override domain for this app */
1739
- domain?: AppDomainConfig;
1740
- /** Required environment variables for entry-based apps */
1741
- requiredEnv?: string[];
1742
- }
1743
- /**
1744
- * Normalized workspace configuration with resolved defaults.
1745
- *
1746
- * This is the internal representation after processing user input.
1747
- * All optional fields have been resolved to their defaults.
1748
- */
1749
- interface NormalizedWorkspace {
1750
- /** Workspace name (resolved from package.json if not specified) */
1751
- name: string;
1752
- /** Absolute path to workspace root */
1753
- root: string;
1754
- /**
1755
- * The workspace's own constructs glob, relative to `root`.
1756
- *
1757
- * Where the product's shared infrastructure is declared. Additive with each
1758
- * app's glob, so an app can still declare something only it uses.
1759
- */
1760
- constructs?: Routes;
1761
- /** Normalized app configurations */
1762
- apps: Record<string, NormalizedAppConfig>;
1763
- /** Services configuration (empty object if not specified) */
1764
- services: ServicesConfig;
1765
- /** Deploy configuration (empty object if not specified) */
1766
- deploy: DeployConfig;
1767
- /** Shared packages configuration (empty object if not specified) */
1768
- shared: SharedConfig;
1769
- /** The project's stages, as declared */
1770
- stages: StagesConfig;
1771
- /** Secrets configuration (empty object if not specified) */
1772
- secrets: SecretsConfig;
1773
- /** State provider configuration (undefined = local filesystem) */
1774
- state?: StateConfig;
1775
- }
1776
- /**
1777
- * Result of loading and processing a configuration.
1778
- */
1779
- interface LoadedConfig {
1780
- /** Whether this is a single-app or workspace config */
1781
- type: 'single' | 'workspace';
1782
- /** The raw configuration as loaded */
1783
- raw: GkmConfig | WorkspaceConfig;
1784
- /** Normalized workspace (always available) */
1785
- workspace: NormalizedWorkspace;
1786
- /**
1787
- * What the workspace's constructs declared, when it has any.
1788
- *
1789
- * Read once at load, because the apps above are derived from it and a
1790
- * caller that re-discovers would be answering the same question twice with
1791
- * two chances to disagree. Absent when the workspace declares no constructs.
1792
- */
1793
- manifest?: ConstructManifest;
1794
- }
1795
- /**
1796
- * Type guard to check if a config is a WorkspaceConfig.
1797
- *
1798
- * @example
1799
- * ```ts
1800
- * const config = await loadConfig();
1801
- * if (isWorkspaceConfig(config)) {
1802
- * // config.apps is available
1803
- * console.log(Object.keys(config.apps));
1804
- * }
1805
- * ```
1806
- */
1807
- declare function isWorkspaceConfig(config: GkmConfig | WorkspaceConfig): config is WorkspaceConfig;
1808
- //# sourceMappingURL=types.d.ts.map
1809
- //#endregion
1810
- //#region src/types.d.ts
1811
- interface PartitionedRoutes {
1812
- paths: string | string[];
1813
- partition: (filepath: string) => string;
1814
- }
1815
- type Routes = string | string[] | PartitionedRoutes;
1816
- interface ProviderConfig {
1817
- enabled?: boolean;
1818
- outputDir?: string;
1819
- }
1820
- interface AWSApiGatewayConfig extends ProviderConfig {}
1821
- interface AWSLambdaConfig extends ProviderConfig {}
1822
- interface ProductionConfig {
1823
- /** Enable production mode (default: false) */
1824
- enabled?: boolean;
1825
- /** Bundle server into single file (default: true) */
1826
- bundle?: boolean;
1827
- /** Minify bundled output (default: true) */
1828
- minify?: boolean;
1829
- /** Health check endpoint path (default: '/health') */
1830
- healthCheck?: string;
1831
- /** Enable graceful shutdown handling (default: true) */
1832
- gracefulShutdown?: boolean;
1833
- /** Packages to exclude from bundling (default: []) */
1834
- external?: string[];
1835
- /** Include subscribers in production build (default: 'exclude' for serverless) */
1836
- subscribers?: 'include' | 'exclude';
1837
- /** Include OpenAPI spec in production (default: false) */
1838
- openapi?: boolean;
1839
- /**
1840
- * Enable build-time optimized handler generation (default: true)
1841
- * Generates specialized handlers based on endpoint tier:
1842
- * - minimal: Near-raw-Hono performance for simple endpoints
1843
- * - standard: Optimized handlers for auth/services
1844
- * - full: Uses HonoEndpoint.addRoutes for complex endpoints
1845
- */
1846
- optimizedHandlers?: boolean;
1847
- }
1848
- /** Service-specific configuration for docker-compose */
1849
- interface ServiceConfig {
1850
- /**
1851
- * Full Docker image reference (e.g., 'postgis/postgis:16-3.4-alpine').
1852
- * When specified, overrides the default image entirely.
1853
- */
1854
- image?: string;
1855
- /**
1856
- * Docker image version/tag (e.g., '15-alpine' for postgres).
1857
- * Only used when `image` is not specified.
1858
- */
1859
- version?: string;
1860
- }
1861
- /**
1862
- * Supported event backend types.
1863
- *
1864
- * - `pgboss`: Reuses PostgreSQL with a dedicated user/schema. Auto-enables db service.
1865
- * - `sns`: Adds LocalStack container with SNS+SQS services.
1866
- * - `rabbitmq`: Adds RabbitMQ container.
1867
- *
1868
- * All backends generate EVENT_PUBLISHER_CONNECTION_STRING and EVENT_SUBSCRIBER_CONNECTION_STRING.
1869
- */
1870
- type EventsBackend = 'pgboss' | 'sns' | 'rabbitmq';
1871
- /**
1872
- * Where a declared cache actually lives.
1873
- *
1874
- * A deployment choice, not an application one — the same code caches into any
1875
- * of these — so it is config here beside `events` rather than a field on the
1876
- * construct. Each backend is consistent between local and deployed, which is
1877
- * the property worth having: a cache that behaves differently in the two places
1878
- * is worse than a slower one.
1879
- *
1880
- * - `upstash` (default) — HTTP with a token. Reachable from a Lambda with no
1881
- * VPC and no connection pool, which is why it is the default; locally the
1882
- * `serverless-redis-http` proxy in front of Redis speaks the same protocol.
1883
- * - `elasticache` — the Redis wire protocol, inside a VPC. Locally, plain Redis.
1884
- * - `db` — a table in the database the app already declared. No infrastructure
1885
- * at all, and the same relationship pg-boss has to Postgres: it creates its
1886
- * own table on first use and needs a declared database to live in.
1887
- */
1888
- type CacheBackend = 'upstash' | 'elasticache' | 'db';
1889
- /**
1890
- * Where a declared bucket actually lives.
1891
- *
1892
- * The fourth of these selectors and the last to arrive, which is why
1893
- * `UPLOADS_URL` had no answer on a container target: there was nothing to
1894
- * choose with. Like the others it changes no application code — the `s3://`
1895
- * scheme picks the driver, and every one of these speaks it.
1896
- *
1897
- * - `s3` — a real bucket. Nothing is created on the host; the URL is composed
1898
- * against credentials you already hold, the same way `resend` is an API key
1899
- * rather than infrastructure.
1900
- * - `r2` — Cloudflare's, reached through the same S3 API and differing only in
1901
- * its endpoint.
1902
- * - `minio` — a container. Everything the app declares lives on the box, which
1903
- * is what makes a single-host deploy self-contained, and what makes it a
1904
- * single disk with no replication. Locally this is what every backend is.
1905
- */
1906
- type StorageBackend = 'minio' | 's3' | 'r2';
1907
- /**
1908
- * The backend a project gets when it says nothing, by where it deploys.
1909
- *
1910
- * Flat defaults could not be right for both: `upstash` on a single box means a
1911
- * SaaS round-trip for a cache the database could have held, and `minio` on AWS
1912
- * means running a bucket beside S3. So the default is a function of the target,
1913
- * and an app that says nothing gets the obvious answer in both places — which
1914
- * is the whole of what "zero config" can mean once there is more than one
1915
- * target.
1916
- *
1917
- * `server` covers Dokploy and a bare host alike: the question these answer is
1918
- * whether the app is next to a managed cloud or next to its own containers, and
1919
- * on that question the two are the same.
1920
- *
1921
- * A per-construct, per-stage override is the layer above this — see
1922
- * `constructs-outstanding.md` — so two buckets in one app can differ. This is
1923
- * only what happens when nobody has said anything at all.
1924
- */
1925
-
1926
- /**
1927
- * Who delivers a declared app's mail.
1928
- *
1929
- * Unlike a cache, this changes *nothing* about the client. Every backend speaks
1930
- * SMTP, so the declaration's `smtp://` URL is true of all of them and only the
1931
- * provisioner differs — which is the same reason the declaration has no
1932
- * `provider` field and there is no `ses://` scheme.
1933
- *
1934
- * - `ses` (default) — the only backend that can be a *chain* of resources: an
1935
- * identity, a user, an access key, and an SMTP password derived from it,
1936
- * because SES issues IAM credentials rather than SMTP ones. Hand it a URL and
1937
- * it uses that instead, which is what you want when the credentials already
1938
- * exist — provisioning a second set of sending credentials for an identity
1939
- * that already has them is not a thing to do by default.
1940
- * - `resend` — an API key you hold, composed into an SMTP URL. Nothing to
1941
- * provision: a SaaS account is not infrastructure.
1942
- * - `smtp` — a URL supplied whole, for a relay somebody else runs.
1943
- *
1944
- * Locally every one of them is Mailpit, because locally none of it matters.
1945
- */
1946
- type EmailBackend = 'resend' | 'ses' | 'smtp';
1947
- /**
1948
- * Who delivers mail when nobody said.
1949
- *
1950
- * Flat, unlike the others, and deliberately: mail is a SaaS on every target.
1951
- * There is no self-hosted preset to default a container deploy to — Mailpit is
1952
- * a development inbox, not a sender — so `server` has no answer of its own to
1953
- * give and would only be `ses` written twice.
1954
- */
1955
-
1956
- /** Supported docker-compose service names */
1957
- type ComposeServiceName = 'postgres' | 'redis' | 'rabbitmq' | 'minio' | 'mailpit' | 'localstack';
1958
- /** Services configuration - can be boolean (use defaults) or object with version */
1959
- type ComposeServicesConfig = { [K in ComposeServiceName]?: boolean | ServiceConfig };
1960
- interface DockerConfig {
1961
- /** Container registry URL (e.g., 'ghcr.io/myorg') */
1962
- registry?: string;
1963
- /** Docker image name (default: derived from package.json name) */
1964
- imageName?: string;
1965
- /** Base Docker image (default: 'node:22-alpine') */
1966
- baseImage?: string;
1967
- /** Container port (default: 3000) */
1968
- port?: number;
1969
- /** docker-compose services to include */
1970
- compose?: {
1971
- /**
1972
- * Services to include in docker-compose.
1973
- * Can be an object with service configs or an array of service names (legacy).
1974
- *
1975
- * @example Object format (recommended)
1976
- * services: {
1977
- * postgres: { version: '15-alpine' },
1978
- * redis: true, // use default version
1979
- * }
1980
- *
1981
- * @example Array format (legacy, uses default versions)
1982
- * services: ['postgres', 'redis']
1983
- */
1984
- services?: ComposeServicesConfig | ComposeServiceName[];
1985
- };
1986
- }
1987
- interface ServerConfig extends ProviderConfig {
1988
- enableOpenApi?: boolean;
1989
- port?: number;
1990
- /** Production build configuration */
1991
- production?: ProductionConfig;
1992
- }
1993
- type Runtime = 'node' | 'bun';
1994
- interface TelescopeConfig {
1995
- /** Enable/disable telescope (default: true in development) */
1996
- enabled?: boolean;
1997
- /** Port for telescope to use (defaults to server port) */
1998
- port?: number;
1999
- /** Path prefix for telescope UI (default: /__telescope) */
2000
- path?: string;
2001
- /** Ignore patterns for telescope (e.g., ['/health', '/metrics']) */
2002
- ignore?: string[];
2003
- /** Record request/response bodies (default: true) */
2004
- recordBody?: boolean;
2005
- /** Maximum entries to keep in memory (default: 1000) */
2006
- maxEntries?: number;
2007
- /** Enable WebSocket for real-time updates (default: true, requires @hono/node-ws for Node.js) */
2008
- websocket?: boolean;
2009
- }
2010
- interface StudioConfig {
2011
- /** Enable/disable studio (default: true in development) */
2012
- enabled?: boolean;
2013
- /** Path prefix for studio UI (default: /__studio) */
2014
- path?: string;
2015
- /** Schema to introspect (default: 'public') */
2016
- schema?: string;
2017
- }
2018
- interface OpenApiConfig {
2019
- /** Enable OpenAPI generation (default: true) */
2020
- enabled?: boolean;
2021
- /** API title */
2022
- title?: string;
2023
- /** API version */
2024
- version?: string;
2025
- /** API description */
2026
- description?: string;
2027
- }
2028
- interface HooksConfig {
2029
- /**
2030
- * Path to a module exporting server lifecycle hooks.
2031
- * The module should export `beforeSetup` and/or `afterSetup` functions.
2032
- *
2033
- * @example
2034
- * ```typescript
2035
- * // src/config/hooks.ts
2036
- * import type { Hono } from 'hono';
2037
- * import type { Logger } from '@geekmidas/logger';
2038
- * import type { EnvironmentParser } from '@geekmidas/envkit';
2039
- *
2040
- * // Called BEFORE gkm endpoints are registered
2041
- * export function beforeSetup(app: Hono, ctx: { envParser: EnvironmentParser; logger: Logger }) {
2042
- * app.use('*', cors());
2043
- * app.get('/custom/health', (c) => c.json({ status: 'ok' }));
2044
- * }
2045
- *
2046
- * // Called AFTER gkm endpoints are registered
2047
- * export function afterSetup(app: Hono, ctx: { envParser: EnvironmentParser; logger: Logger }) {
2048
- * app.notFound((c) => c.json({ error: 'Not found' }, 404));
2049
- * app.onError((err, c) => c.json({ error: err.message }, 500));
2050
- * }
2051
- * ```
2052
- */
2053
- server?: string;
2054
- }
2055
- /** Dokploy deployment configuration */
2056
- interface DokployProviderConfig {
2057
- /** Dokploy API endpoint (e.g., 'https://dokploy.example.com') */
2058
- endpoint: string;
2059
- /** Project ID in Dokploy */
2060
- projectId: string;
2061
- /** Application ID in Dokploy */
2062
- applicationId: string;
2063
- /** Container registry (overrides docker.registry if set) */
2064
- registry?: string;
2065
- /** Registry ID in Dokploy (recommended for private registries) */
2066
- registryId?: string;
2067
- }
2068
- interface ProvidersConfig {
2069
- aws?: {
2070
- apiGateway?: {
2071
- v1?: boolean | AWSApiGatewayConfig;
2072
- v2?: boolean | AWSApiGatewayConfig;
2073
- };
2074
- lambda?: {
2075
- functions?: boolean | AWSLambdaConfig;
2076
- crons?: boolean | AWSLambdaConfig;
2077
- };
2078
- };
2079
- server?: boolean | ServerConfig;
2080
- /** Dokploy deployment configuration */
2081
- dokploy?: boolean | DokployProviderConfig;
2082
- }
2083
- interface GkmConfig {
2084
- /**
2085
- * What this app is called, and therefore how everything it declares is named.
2086
- *
2087
- * The same field `sst.config.ts` carries, doing the same job: every physical
2088
- * name is `{stage}-{name}-{construct}`, so `Database` in the `production`
2089
- * stage of `kitchen-sink` is `production-kitchen-sink-database` on AWS and on
2090
- * Dokploy alike. One statement, in the config, rather than a rule each
2091
- * provider restates.
2092
- *
2093
- * `defineWorkspace` has always had this. A single-app config did not, so its
2094
- * names fell back to whatever the directory happened to be called — the
2095
- * monorepo's package name for the project and the app's for the application,
2096
- * two accidents of layout standing in for a decision.
2097
- *
2098
- * Defaults to the package.json name with any scope stripped, then the
2099
- * directory name.
2100
- */
2101
- name?: string;
2102
- /** The project's stages: which one is local, which deploy */
2103
- stages: StagesConfig;
2104
- /**
2105
- * Where the things no construct implies live.
2106
- *
2107
- * The same block a workspace config carries, and the same split: `db` and
2108
- * `storage` are derived from the declared `KyselyDatabase` and
2109
- * `ObjectStorage` and are ignored here, while `cache`, `mail`, and `events`
2110
- * name a *backend* — where the cache lives, who delivers the mail, which
2111
- * broker carries events. A single-app project had no way to say any of that
2112
- * before, so its event backend could only be guessed.
2113
- */
2114
- services?: ServicesConfig;
2115
- /**
2116
- * Constructs glob pattern — one glob, every kind.
2117
- *
2118
- * What reconcile reads to derive the containers a stage needs: a database
2119
- * implies Postgres, objects imply MinIO, mail implies Mailpit. A glob per
2120
- * kind cannot find a resource, because a declared `ObjectStorage` has no
2121
- * kind to be listed under.
2122
- *
2123
- * @example './src/**\/*.ts'
2124
- */
2125
- constructs: Routes;
2126
- providers?: ProvidersConfig;
2127
- /**
2128
- * Server lifecycle hooks for customizing the Hono app.
2129
- * Allows adding custom routes, middleware, error handlers, etc.
2130
- *
2131
- * @example
2132
- * hooks: {
2133
- * server: './src/config/hooks'
2134
- * }
2135
- */
2136
- hooks?: HooksConfig;
2137
- /**
2138
- * Telescope configuration for debugging/monitoring.
2139
- * Can be:
2140
- * - A string path to a module that exports a Telescope instance (recommended)
2141
- * - A boolean to enable/disable with defaults
2142
- * - A TelescopeConfig object for inline configuration
2143
- */
2144
- telescope?: string | boolean | TelescopeConfig;
2145
- /**
2146
- * Studio configuration for database browsing.
2147
- * Can be:
2148
- * - A string path to a module that exports a Studio instance (recommended)
2149
- * - A boolean to enable/disable with defaults
2150
- * - A StudioConfig object for inline configuration
2151
- *
2152
- * Requires a database connection configured via services.
2153
- */
2154
- studio?: string | boolean | StudioConfig;
2155
- /**
2156
- * OpenAPI generation configuration.
2157
- * Can be:
2158
- * - A boolean to enable/disable with defaults (output: ./src/api/openapi.ts)
2159
- * - An OpenApiConfig object for customization
2160
- *
2161
- * When enabled, OpenAPI spec is generated on startup and regenerated on route changes.
2162
- *
2163
- * @example
2164
- * openapi: true
2165
- *
2166
- * @example
2167
- * openapi: {
2168
- * output: './src/api/openapi.ts',
2169
- * title: 'My API',
2170
- * version: '1.0.0',
2171
- * }
2172
- */
2173
- openapi?: boolean | OpenApiConfig;
2174
- /** Runtime to use for dev server (default: 'node') */
2175
- runtime?: Runtime;
2176
- /**
2177
- * Environment file(s) to load for development.
2178
- * Can be:
2179
- * - A string path to a single env file (e.g., '.env.local')
2180
- * - An array of paths to load in order (later files override earlier)
2181
- * - Defaults to '.env' if not specified
2182
- *
2183
- * @example
2184
- * env: '.env.local'
2185
- *
2186
- * @example
2187
- * env: ['.env', '.env.local']
2188
- */
2189
- env?: string | string[];
2190
- /**
2191
- * Docker deployment configuration.
2192
- * Used by `gkm docker` and `gkm prepack` commands.
2193
- *
2194
- * @example
2195
- * docker: {
2196
- * registry: 'ghcr.io/myorg',
2197
- * imageName: 'my-api',
2198
- * compose: {
2199
- * services: ['postgres', 'redis']
2200
- * }
2201
- * }
2202
- */
2203
- docker?: DockerConfig;
2204
- /**
2205
- * Where this app deploys, and what the target needs to know.
2206
- *
2207
- * Absent until now, which meant a single-app project could not configure a
2208
- * Dokploy deploy at all: the wrap that turns one into a workspace hardcoded
2209
- * `{ default: 'dokploy' }` and dropped everything else, so there was no
2210
- * endpoint, no registry and no domain — and `resolveHost` failed with "no
2211
- * domain configured for stage" on a config that had nowhere to put one.
2212
- *
2213
- * The same shape a workspace config uses, so moving from one to the other is
2214
- * a rename rather than a rewrite.
2215
- */
2216
- deploy?: DeployConfig;
2217
- }
2218
- //#endregion
2219
- export { AppConfig, AppConfigInput, AppInput, AppsRecord, BackendFramework, CacheBackend, ConstrainedApps, DeployConfig, DeployTarget, DokployWorkspaceConfig, EmailBackend, Framework, FrontendFramework, GkmConfig, InferAppNames, InferredWorkspaceConfig, LoadedConfig, MailServiceConfig, MobileFramework, ModelsConfig, NormalizedAppConfig, NormalizedWorkspace, OpenApiConfig, PHASE_2_DEPLOY_TARGETS, Routes, SUPPORTED_DEPLOY_TARGETS, SecretsConfig, ServiceImageConfig, ServicesConfig, SharedConfig, WorkspaceConfig, WorkspaceConfigSchema, WorkspaceInput, formatValidationErrors, getDeployTargetError, isDeployTargetSupported, isPhase2DeployTarget, isWorkspaceConfig, safeValidateWorkspaceConfig, validateWorkspaceConfig };
2220
- //# sourceMappingURL=types-Y3fKQSAK.d.cts.map