@geekmidas/cli 10.0.0-alpha.60 → 10.0.0-alpha.62

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 (151) hide show
  1. package/dist/{HostingerProvider-DgzKa_Tj.mjs → HostingerProvider-B92qH4dC.mjs} +2 -2
  2. package/dist/{HostingerProvider-DgzKa_Tj.mjs.map → HostingerProvider-B92qH4dC.mjs.map} +1 -1
  3. package/dist/{HostingerProvider-BTZd2u0f.cjs → HostingerProvider-DyD1Hin8.cjs} +2 -2
  4. package/dist/{HostingerProvider-BTZd2u0f.cjs.map → HostingerProvider-DyD1Hin8.cjs.map} +1 -1
  5. package/dist/{LegacyStateStore-CToa2hga.mjs → LegacyStateStore-A8d2GdT7.mjs} +2 -2
  6. package/dist/{LegacyStateStore-CToa2hga.mjs.map → LegacyStateStore-A8d2GdT7.mjs.map} +1 -1
  7. package/dist/{LegacyStateStore-CidlPT0N.cjs → LegacyStateStore-UHJEBLdn.cjs} +2 -2
  8. package/dist/{LegacyStateStore-CidlPT0N.cjs.map → LegacyStateStore-UHJEBLdn.cjs.map} +1 -1
  9. package/dist/{LocalStateStore-BFLiOocU.mjs → LocalStateStore-B51rnfgn.mjs} +2 -2
  10. package/dist/{LocalStateStore-BFLiOocU.mjs.map → LocalStateStore-B51rnfgn.mjs.map} +1 -1
  11. package/dist/{LocalStateStore-Dpuqka1N.cjs → LocalStateStore-COW3Ldwa.cjs} +2 -2
  12. package/dist/{LocalStateStore-Dpuqka1N.cjs.map → LocalStateStore-COW3Ldwa.cjs.map} +1 -1
  13. package/dist/{OpenApiTsGenerator-BTuUumsV.cjs → OpenApiTsGenerator-BSrgw7B0.cjs} +31 -2
  14. package/dist/OpenApiTsGenerator-BSrgw7B0.cjs.map +1 -0
  15. package/dist/{OpenApiTsGenerator-CvVr1Ilz.mjs → OpenApiTsGenerator-q5B0z8Xg.mjs} +31 -2
  16. package/dist/OpenApiTsGenerator-q5B0z8Xg.mjs.map +1 -0
  17. package/dist/{S3StateStore-aaGkjcxO.mjs → S3StateStore-CJewPhgz.mjs} +2 -2
  18. package/dist/{S3StateStore-aaGkjcxO.mjs.map → S3StateStore-CJewPhgz.mjs.map} +1 -1
  19. package/dist/{S3StateStore-cnm813Xn.cjs → S3StateStore-WUJGdRNL.cjs} +2 -2
  20. package/dist/{S3StateStore-cnm813Xn.cjs.map → S3StateStore-WUJGdRNL.cjs.map} +1 -1
  21. package/dist/{SSMStateStore-DwaGprVX.cjs → SSMStateStore-Zejt42V8.cjs} +2 -2
  22. package/dist/{SSMStateStore-DwaGprVX.cjs.map → SSMStateStore-Zejt42V8.cjs.map} +1 -1
  23. package/dist/{SSMStateStore-BllaJKGo.mjs → SSMStateStore-iK5UKp9d.mjs} +2 -2
  24. package/dist/{SSMStateStore-BllaJKGo.mjs.map → SSMStateStore-iK5UKp9d.mjs.map} +1 -1
  25. package/dist/{bundler-CzXZPSBJ.cjs → bundler-CfH9frOS.cjs} +2 -2
  26. package/dist/{bundler-CzXZPSBJ.cjs.map → bundler-CfH9frOS.cjs.map} +1 -1
  27. package/dist/{bundler-DJVR4QlW.mjs → bundler-DN5r4x5b.mjs} +2 -2
  28. package/dist/{bundler-DJVR4QlW.mjs.map → bundler-DN5r4x5b.mjs.map} +1 -1
  29. package/dist/{cli-D_qTl20Z.cjs → cli-DOAUp80L.cjs} +12 -16
  30. package/dist/cli-DOAUp80L.cjs.map +1 -0
  31. package/dist/{cli-DzR1hpum.mjs → cli-DYwxmfsW.mjs} +10 -14
  32. package/dist/cli-DYwxmfsW.mjs.map +1 -0
  33. package/dist/{config-DXnkCEq0.cjs → config-BYh9S0cZ.cjs} +2 -2
  34. package/dist/config-BYh9S0cZ.cjs.map +1 -0
  35. package/dist/{config-C5-EEdmr.mjs → config-Bf4-bROQ.mjs} +2 -2
  36. package/dist/config-Bf4-bROQ.mjs.map +1 -0
  37. package/dist/config.cjs +2 -2
  38. package/dist/config.d.cts +2 -2
  39. package/dist/config.d.mts +2 -2
  40. package/dist/config.mjs +2 -2
  41. package/dist/define-CHBIEc5j.mjs +94 -0
  42. package/dist/define-CHBIEc5j.mjs.map +1 -0
  43. package/dist/define-Cv_QvDrg.cjs +141 -0
  44. package/dist/define-Cv_QvDrg.cjs.map +1 -0
  45. package/dist/deploy/public.cjs +28 -13
  46. package/dist/deploy/public.d.cts +38 -315
  47. package/dist/deploy/public.d.cts.map +1 -1
  48. package/dist/deploy/public.d.mts +38 -315
  49. package/dist/deploy/public.d.mts.map +1 -1
  50. package/dist/deploy/public.mjs +8 -3
  51. package/dist/{deploy-D6Q09OkA.mjs → deploy-B7jvUORo.mjs} +155 -682
  52. package/dist/deploy-B7jvUORo.mjs.map +1 -0
  53. package/dist/deploy-Cg9fae7a.mjs +133 -0
  54. package/dist/deploy-Cg9fae7a.mjs.map +1 -0
  55. package/dist/deploy-D8Qr-Xto.cjs +138 -0
  56. package/dist/deploy-D8Qr-Xto.cjs.map +1 -0
  57. package/dist/{deploy-0fBVeWO-.cjs → deploy-DSaCYvcO.cjs} +182 -727
  58. package/dist/deploy-DSaCYvcO.cjs.map +1 -0
  59. package/dist/dokploy-CD9PY-3D.mjs +32 -0
  60. package/dist/dokploy-CD9PY-3D.mjs.map +1 -0
  61. package/dist/dokploy-Ey2foJLv.cjs +32 -0
  62. package/dist/dokploy-Ey2foJLv.cjs.map +1 -0
  63. package/dist/{encryption-aDA2AzVx.mjs → encryption-CVwvGbsL.mjs} +4 -4
  64. package/dist/{encryption-aDA2AzVx.mjs.map → encryption-CVwvGbsL.mjs.map} +1 -1
  65. package/dist/{encryption-CML4UaPi.cjs → encryption-ChBk3hTj.cjs} +4 -4
  66. package/dist/{encryption-CML4UaPi.cjs.map → encryption-ChBk3hTj.cjs.map} +1 -1
  67. package/dist/{github-DmCj2u95.mjs → github-BCB3_LBX.mjs} +3 -3
  68. package/dist/{github-DmCj2u95.mjs.map → github-BCB3_LBX.mjs.map} +1 -1
  69. package/dist/{github-Cq57poPj.cjs → github-OUgPDlqg.cjs} +3 -3
  70. package/dist/{github-Cq57poPj.cjs.map → github-OUgPDlqg.cjs.map} +1 -1
  71. package/dist/{index-UiWCaGzU.d.cts → index-BtXDZQuF.d.cts} +2 -2
  72. package/dist/{index-Da1-oa9W.d.mts.map → index-BtXDZQuF.d.cts.map} +1 -1
  73. package/dist/{index-Da1-oa9W.d.mts → index-DrKzpHl-.d.mts} +2 -2
  74. package/dist/{index-UiWCaGzU.d.cts.map → index-DrKzpHl-.d.mts.map} +1 -1
  75. package/dist/index.cjs +1728 -146
  76. package/dist/index.cjs.map +1 -1
  77. package/dist/index.mjs +1719 -153
  78. package/dist/index.mjs.map +1 -1
  79. package/dist/migrate-BoHMqdCu.mjs +265 -0
  80. package/dist/migrate-BoHMqdCu.mjs.map +1 -0
  81. package/dist/migrate-dnaFMvOm.cjs +270 -0
  82. package/dist/migrate-dnaFMvOm.cjs.map +1 -0
  83. package/dist/openapi.cjs +2 -2
  84. package/dist/openapi.d.cts +1 -1
  85. package/dist/openapi.d.mts +1 -1
  86. package/dist/openapi.mjs +2 -2
  87. package/dist/{ready-CIHpnUc5.mjs → ready-DQIy21W5.mjs} +2 -2
  88. package/dist/{ready-CIHpnUc5.mjs.map → ready-DQIy21W5.mjs.map} +1 -1
  89. package/dist/{ready-CCLIAkwR.cjs → ready-XlNx-Gbo.cjs} +2 -2
  90. package/dist/{ready-CCLIAkwR.cjs.map → ready-XlNx-Gbo.cjs.map} +1 -1
  91. package/dist/reconcile/public.d.cts +1 -1
  92. package/dist/reconcile/public.d.mts +1 -1
  93. package/dist/resolve-CFCIkm7m.mjs +170 -0
  94. package/dist/resolve-CFCIkm7m.mjs.map +1 -0
  95. package/dist/resolve-wbv66HjD.cjs +217 -0
  96. package/dist/resolve-wbv66HjD.cjs.map +1 -0
  97. package/dist/runtime-CMwtq0AL.cjs +163 -0
  98. package/dist/runtime-CMwtq0AL.cjs.map +1 -0
  99. package/dist/runtime-CXPlkZzs.d.mts +90 -0
  100. package/dist/runtime-CXPlkZzs.d.mts.map +1 -0
  101. package/dist/runtime-DbakJS8u.mjs +134 -0
  102. package/dist/runtime-DbakJS8u.mjs.map +1 -0
  103. package/dist/runtime-Dn_n-29S.d.cts +90 -0
  104. package/dist/runtime-Dn_n-29S.d.cts.map +1 -0
  105. package/dist/{sniffer-DIv12ncU.cjs → sniffer-BsfPa-GA.cjs} +2581 -2170
  106. package/dist/sniffer-BsfPa-GA.cjs.map +1 -0
  107. package/dist/{sniffer-BM8fpCas.mjs → sniffer-DHE2Nafd.mjs} +2428 -2185
  108. package/dist/sniffer-DHE2Nafd.mjs.map +1 -0
  109. package/dist/target/public.cjs +15 -0
  110. package/dist/target/public.d.cts +28 -0
  111. package/dist/target/public.d.cts.map +1 -0
  112. package/dist/target/public.d.mts +28 -0
  113. package/dist/target/public.d.mts.map +1 -0
  114. package/dist/target/public.mjs +4 -0
  115. package/dist/terminal-6oL0vANs.cjs +576 -0
  116. package/dist/terminal-6oL0vANs.cjs.map +1 -0
  117. package/dist/terminal-ByZNjuig.mjs +517 -0
  118. package/dist/terminal-ByZNjuig.mjs.map +1 -0
  119. package/dist/{types-efNLu9xu.d.cts → types-CfLKGfC_.d.mts} +624 -34
  120. package/dist/types-CfLKGfC_.d.mts.map +1 -0
  121. package/dist/{types-Bp1mVxG0.d.mts → types-DIA7Li-J.d.cts} +626 -34
  122. package/dist/types-DIA7Li-J.d.cts.map +1 -0
  123. package/dist/vitest.cjs +1 -1
  124. package/dist/vitest.mjs +1 -1
  125. package/dist/workspace/index.cjs +1 -1
  126. package/dist/workspace/index.d.cts +3 -3
  127. package/dist/workspace/index.d.mts +3 -3
  128. package/dist/workspace/index.mjs +1 -1
  129. package/dist/{workspace-B64Xk1Mb.cjs → workspace-B6zQO6RY.cjs} +229 -23
  130. package/dist/workspace-B6zQO6RY.cjs.map +1 -0
  131. package/dist/{workspace-Bp1xVaOz.mjs → workspace-BFe57es7.mjs} +229 -23
  132. package/dist/workspace-BFe57es7.mjs.map +1 -0
  133. package/package.json +23 -13
  134. package/dist/OpenApiTsGenerator-BTuUumsV.cjs.map +0 -1
  135. package/dist/OpenApiTsGenerator-CvVr1Ilz.mjs.map +0 -1
  136. package/dist/cli-D_qTl20Z.cjs.map +0 -1
  137. package/dist/cli-DzR1hpum.mjs.map +0 -1
  138. package/dist/config-C5-EEdmr.mjs.map +0 -1
  139. package/dist/config-DXnkCEq0.cjs.map +0 -1
  140. package/dist/deploy-0fBVeWO-.cjs.map +0 -1
  141. package/dist/deploy-D6Q09OkA.mjs.map +0 -1
  142. package/dist/migrate-BTqIflwc.cjs +0 -743
  143. package/dist/migrate-BTqIflwc.cjs.map +0 -1
  144. package/dist/migrate-B_6KofUo.mjs +0 -736
  145. package/dist/migrate-B_6KofUo.mjs.map +0 -1
  146. package/dist/sniffer-BM8fpCas.mjs.map +0 -1
  147. package/dist/sniffer-DIv12ncU.cjs.map +0 -1
  148. package/dist/types-Bp1mVxG0.d.mts.map +0 -1
  149. package/dist/types-efNLu9xu.d.cts.map +0 -1
  150. package/dist/workspace-B64Xk1Mb.cjs.map +0 -1
  151. package/dist/workspace-Bp1xVaOz.mjs.map +0 -1
@@ -1,53 +1,7 @@
1
- import { B as StateVersionConflict, z as StateLocked } from "../types-efNLu9xu.cjs";
1
+ import { $ as DeployEventError, Q as DeployEvent, _t as StateVersionConflict, at as DeployResult, bt as deployIdentity, ct as CredentialKinds, dt as MissingCredential, et as DeployEventType, ft as StoredCredentialsOptions, ht as StateLocked, it as AppDeployResult, lt as CredentialProvider, mt as storedCredentials, nt as ResourceChange, ot as Credential, pt as chainCredentials, rt as ResourceVia, st as CredentialKind, tt as DeployPhase, ut as CredentialRequest, yt as DeployIdentity, z as AnyDeployTarget } from "../types-DIA7Li-J.cjs";
2
+ import { a as TargetRuntimeMismatch, c as DeployTargetNotYetSupported, i as TargetPackageInvalid, l as UnknownDeployTarget, n as InvalidTargetOptions, o as ProviderRemoved, r as TargetEntryInvalid, s as TargetPackageNotFound, t as TargetRuntimeUndeclared } from "../runtime-Dn_n-29S.cjs";
2
3
  import { ConstructManifest } from "@geekmidas/manifest";
3
- //#region src/deploy/identity.d.ts
4
- /**
5
- * Who a deploy is, on a target it shares with other workspaces.
6
- *
7
- * A Dokploy server is one flat namespace of projects, images and Docker
8
- * service names. Deploys used to identify everything they made by the
9
- * workspace name alone, so two workspaces called `shop` — or `Shop` and
10
- * `shop` — deploying to one server landed in the same project, pushed over
11
- * each other's images and redeployed each other's applications. A
12
- * `DeployIdentity` is what a deploy names and claims its resources by instead.
13
- */
14
- interface DeployIdentity {
15
- /**
16
- * Whose deploy this is — an organisation, a team, a repository. Two
17
- * workspaces with the same name are told apart by it. Defaults to the
18
- * kebab-cased workspace name; set `deploy.namespace` to choose one.
19
- */
20
- readonly namespace: string;
21
- /** The workspace name as the target spells it: lowercase, `[a-z0-9-]`. */
22
- readonly project: string;
23
- readonly stage: string;
24
- /**
25
- * `<namespace>/<project>`: what a Dokploy project is claimed by.
26
- *
27
- * The stage is not part of it because one Dokploy project holds every stage
28
- * of a workspace, each as an environment — the key has to be the same from
29
- * every stage that deploys into it.
30
- */
31
- readonly key: string;
32
- /**
33
- * The prefix every name on the target carries: the project alone in the
34
- * default namespace, `<namespace>-<project>` in any other.
35
- *
36
- * The default adds nothing so that a workspace that never set a namespace
37
- * keeps the names it was already deployed under — a Postgres is found by
38
- * its name, and a new name would be a new, empty database.
39
- */
40
- readonly scope: string;
41
- }
42
- /** What an identity is derived from: a workspace's name and namespace. */
43
- interface IdentitySource {
44
- name: string;
45
- deploy?: {
46
- namespace?: string;
47
- };
48
- }
49
- export declare function deployIdentity(workspace: IdentitySource, stage: string): DeployIdentity;
50
- //#endregion
4
+ import "@geekmidas/envkit/sniffer";
51
5
  //#region src/home.d.ts
52
6
  /**
53
7
  * Where the CLI keeps what belongs to a person rather than a project: stage
@@ -62,260 +16,6 @@ export declare const GKM_HOME_ENV = "GKM_HOME";
62
16
  /** The CLI's home: `GKM_HOME` if set, else `~/.gkm`. */
63
17
  export declare function gkmHome(env?: NodeJS.ProcessEnv): string;
64
18
  //#endregion
65
- //#region src/deploy/credentials.d.ts
66
- /**
67
- * How a deploy gets the credentials it acts with.
68
- *
69
- * `deploy()` never prompts and never reads a terminal: it asks a
70
- * `CredentialProvider` and, when the provider has nothing, stops with
71
- * `MissingCredential` naming what it needed and how to supply it. Whether to
72
- * ask a person, read a vault or fail is the caller's decision — `gkm deploy`
73
- * prompts at a terminal and stores what was typed; a CI job sets the
74
- * environment; a host passes its own provider.
75
- */
76
- /** What each kind of credential is asked for with, and what it is. */
77
- interface CredentialKinds {
78
- /** The Dokploy API a stage deploys through. */
79
- dokploy: {
80
- /** `deploy.dokploy.endpoint`, when the config names one. */
81
- request: {
82
- endpoint?: string;
83
- };
84
- value: {
85
- endpoint: string;
86
- token: string;
87
- };
88
- };
89
- /**
90
- * A container registry login, for Dokploy to pull with. Asked for only when
91
- * Dokploy has no registry for `deploy.dokploy.registry` and one has to be
92
- * created.
93
- */
94
- registry: {
95
- /** `deploy.dokploy.registry`. */
96
- request: {
97
- url: string;
98
- };
99
- value: {
100
- username: string;
101
- password: string;
102
- };
103
- };
104
- }
105
- type CredentialKind = keyof CredentialKinds;
106
- /** What a deploy asks a provider for. */
107
- type CredentialRequest<K extends CredentialKind = CredentialKind> = { [P in K]: {
108
- kind: P;
109
- } & CredentialKinds[P]['request']; }[K];
110
- /** What a provider answers with. */
111
- type Credential<K extends CredentialKind> = CredentialKinds[K]['value'];
112
- interface CredentialProvider {
113
- /**
114
- * The credential `request` asks for, or `undefined` when this provider has
115
- * none — the deploy then raises {@link MissingCredential}.
116
- */
117
- get<K extends CredentialKind>(request: CredentialRequest<K>, options?: {
118
- signal?: AbortSignal;
119
- }): Promise<Credential<K> | undefined>;
120
- }
121
- /** A deploy needed a credential, and its provider had none. */
122
- export declare class MissingCredential extends Error {
123
- readonly kind: CredentialKind;
124
- /** What it was for: the Dokploy endpoint or the registry URL. */
125
- readonly target: string | undefined;
126
- /** How to supply it. */
127
- readonly howToProvide: string;
128
- constructor(kind: CredentialKind,
129
- /** What it was for: the Dokploy endpoint or the registry URL. */
130
- target: string | undefined,
131
- /** How to supply it. */
132
- howToProvide?: string);
133
- }
134
- /** Whatever was asked for, from the first provider that has it. */
135
- export declare function chainCredentials(...providers: CredentialProvider[]): CredentialProvider;
136
- interface StoredCredentialsOptions {
137
- /** Where to read the variables from. Defaults to `process.env`. */
138
- env?: NodeJS.ProcessEnv;
139
- /**
140
- * The CLI's home, whose `credentials.json` holds stored logins. Defaults
141
- * to `GKM_HOME`, else `~/.gkm`.
142
- */
143
- home?: string;
144
- }
145
- /**
146
- * Credentials from the environment, then from what `gkm login` stored. What
147
- * `deploy()` uses when it is handed no provider.
148
- *
149
- * - Dokploy: `DOKPLOY_API_TOKEN` / `DOKPLOY_ENDPOINT`, each falling back to
150
- * the stored login, and the endpoint finally to `deploy.dokploy.endpoint`.
151
- * Each half is read on its own: a token is a secret and belongs in the
152
- * environment, an endpoint is configuration and belongs in the config.
153
- * - Registry: `DOCKER_REGISTRY_USERNAME` / `DOCKER_REGISTRY_PASSWORD`.
154
- */
155
- export declare function storedCredentials(options?: StoredCredentialsOptions): CredentialProvider;
156
- //#endregion
157
- //#region src/deploy/types.d.ts
158
- /** Result for a single app deployment in workspace mode */
159
- interface AppDeployResult {
160
- /** App name */
161
- appName: string;
162
- /** App type */
163
- type: 'backend' | 'web' | 'mobile';
164
- /** Whether deployment succeeded */
165
- success: boolean;
166
- /** Dokploy application ID */
167
- applicationId?: string;
168
- /** Docker image reference */
169
- imageRef?: string;
170
- /** The registry's digest for the image, `sha256:…`, once pushed */
171
- digest?: string;
172
- /** Deployment URL */
173
- url?: string;
174
- /** Error message if failed */
175
- error?: string;
176
- }
177
- /** Result from workspace deployment */
178
- interface WorkspaceDeployResult {
179
- /** Results for each app */
180
- apps: AppDeployResult[];
181
- /** Dokploy project ID */
182
- projectId: string;
183
- /** Total number of successful deployments */
184
- successCount: number;
185
- /** Total number of failed deployments */
186
- failedCount: number;
187
- }
188
- /**
189
- * What a deploy did — or, for a dry run, would do. Plain JSON, so it can be
190
- * written out as is (`gkm deploy --json` ends with it).
191
- */
192
- interface DeployResult extends WorkspaceDeployResult {
193
- stage: string;
194
- /** `<namespace>/<project>`. */
195
- identity: string;
196
- /** The image tag every app was built with. */
197
- tag: string;
198
- /** Whether this was a dry run: nothing was created, built or pushed. */
199
- dryRun: boolean;
200
- /** Dokploy's environment for the stage; empty when a dry run would create it. */
201
- environmentId: string;
202
- /** Apps left out, and why — a mobile app, another deploy target. */
203
- skipped: {
204
- app: string;
205
- reason: string;
206
- }[];
207
- /** Each deployed app's public URL. */
208
- urls: Record<string, string>;
209
- /**
210
- * Every resource the run touched, in order: what it applied, or for a dry
211
- * run, what it would.
212
- */
213
- changes: ResourceChange[];
214
- }
215
- //#endregion
216
- //#region src/deploy/events.d.ts
217
- /**
218
- * The stretch of a deploy an event belongs to.
219
- *
220
- * - `validate`: the config, the stage, the apps, the lock, the stage's secrets
221
- * and what each app reads from its environment
222
- * - `plan`: a dry run's lookups — what would be created and what reused
223
- * - `provision`: the Dokploy project, environment and registry, and the
224
- * declared constructs
225
- * - `release`: each app's image built, pushed and deployed
226
- * - `verify`: DNS records and Dokploy's domain validation
227
- */
228
- type DeployPhase = 'validate' | 'plan' | 'provision' | 'release' | 'verify';
229
- /** An error, as an event carries it. */
230
- interface DeployEventError {
231
- /** The error's class name — `MissingCredential`, `StateLocked`. */
232
- name: string;
233
- message: string;
234
- }
235
- /**
236
- * How a resource came to be used:
237
- * - `recorded`: the id the stage's state holds still resolves
238
- * - `resumed`: a run that died after creating it is picked up
239
- * - `found`: it existed and was looked up
240
- * - `created`: this run created it
241
- */
242
- type ResourceVia = 'recorded' | 'resumed' | 'found' | 'created';
243
- /** One resource a deploy touches, planned or applied. */
244
- interface ResourceChange {
245
- /** `<type>:<name>`, unique within the stage — `application:api`. */
246
- key: string;
247
- /** `project`, `environment`, `registry`, `application`, `domain`, `image`, or a construct's kind. */
248
- resourceType: string;
249
- /**
250
- * For a plan: whether the run would create it, reuse what exists, or
251
- * ensure it (look it up, and create it if missing). For an applied change:
252
- * what was done.
253
- */
254
- action: 'create' | 'reuse' | 'ensure' | 'build';
255
- /** The target's id, once there is one. */
256
- id?: string;
257
- }
258
- type DeployEvent = {
259
- type: 'deploy.started';
260
- stage: string;
261
- /** `<namespace>/<project>`. */
262
- identity: string;
263
- tag: string;
264
- /** The apps this run deploys, in order. */
265
- apps: string[];
266
- dryRun: boolean;
267
- } | {
268
- type: 'phase.started';
269
- phase: DeployPhase;
270
- } | {
271
- type: 'phase.finished';
272
- phase: DeployPhase;
273
- } |
274
- /**
275
- * A progress line, exactly as `gkm deploy` prints it — leading newline and
276
- * indentation included, so a terminal renderer prints `message` as is.
277
- */
278
- {
279
- type: 'log';
280
- level: 'info' | 'warn' | 'error';
281
- message: string;
282
- } | {
283
- type: 'app.skipped';
284
- app: string;
285
- reason: string;
286
- } | ({
287
- type: 'resource.planned';
288
- } & ResourceChange) | ({
289
- type: 'resource.applied';
290
- via: ResourceVia;
291
- } & ResourceChange & {
292
- id: string;
293
- }) | {
294
- type: 'artifact.built';
295
- app: string;
296
- imageRef: string;
297
- /** The registry's digest, `sha256:…`, once pushed. */
298
- digest?: string;
299
- } | {
300
- type: 'app.deployed';
301
- app: string;
302
- applicationId: string;
303
- imageRef: string;
304
- url: string;
305
- } | {
306
- type: 'app.failed';
307
- app: string;
308
- error: DeployEventError;
309
- } | {
310
- type: 'deploy.finished';
311
- result: DeployResult;
312
- } | {
313
- type: 'deploy.failed';
314
- error: DeployEventError;
315
- };
316
- /** Every `type` a deploy event can have. */
317
- type DeployEventType = DeployEvent['type'];
318
- //#endregion
319
19
  //#region src/deploy/deploy.d.ts
320
20
  /**
321
21
  * Where a run's progress lines go, besides its events. `@geekmidas/logger`'s
@@ -334,6 +34,17 @@ interface DeployInput {
334
34
  cwd: string;
335
35
  /** The stage to deploy — one of the config's deployed stages. */
336
36
  stage: string;
37
+ /**
38
+ * The target to deploy through, by name. Defaults to `deploy.default`,
39
+ * else `dokploy`.
40
+ */
41
+ target?: string;
42
+ /**
43
+ * The host's own targets, by name. Consulted before the built-ins and the
44
+ * config's `deploy.targets`, so a host can deploy through an
45
+ * implementation of its own — `{ dokploy: myDokploy }` included.
46
+ */
47
+ targets?: Record<string, AnyDeployTarget>;
337
48
  /** The image tag. Defaults to `<stage>-<timestamp>`. */
338
49
  tag?: string;
339
50
  /** Deploy only these apps (in dependency order). Defaults to all. */
@@ -397,17 +108,6 @@ interface DeployRun extends AsyncIterable<DeployEvent> {
397
108
  export declare function deploy(input: DeployInput): DeployRun;
398
109
  //#endregion
399
110
  //#region src/deploy/index.d.ts
400
- /** Apps were asked for by name that the workspace does not have. */
401
- export declare class UnknownDeployApps extends Error {
402
- readonly apps: readonly string[];
403
- readonly available: readonly string[];
404
- constructor(apps: readonly string[], available: readonly string[]);
405
- }
406
- /** Every app asked for deploys somewhere other than Dokploy. */
407
- export declare class NoDeployableApps extends Error {
408
- readonly stage: string;
409
- constructor(stage: string);
410
- }
411
111
  /** A backend failed, so the run stopped before deploying anything after it. */
412
112
  export declare class BackendDeployFailed extends Error {
413
113
  readonly app: string;
@@ -421,6 +121,29 @@ export declare class MissingEnvVars extends Error {
421
121
  constructor(app: string, missing: readonly string[], stage: string);
422
122
  }
423
123
  //#endregion
124
+ //#region src/deploy/orchestrate.d.ts
125
+ /** Apps were asked for by name that the workspace does not have. */
126
+ export declare class UnknownDeployApps extends Error {
127
+ readonly apps: readonly string[];
128
+ readonly available: readonly string[];
129
+ constructor(apps: readonly string[], available: readonly string[]);
130
+ }
131
+ /** Every app asked for deploys through some other target. */
132
+ export declare class NoDeployableApps extends Error {
133
+ readonly stage: string;
134
+ readonly target: string;
135
+ constructor(stage: string, target: string);
136
+ }
137
+ /** A failed rollback, after the failure that called for it. */
138
+ export declare class RollbackFailed extends Error {
139
+ readonly target: string;
140
+ /** What failed first, and was being rolled back. */
141
+ readonly failure: unknown;
142
+ constructor(target: string,
143
+ /** What failed first, and was being rolled back. */
144
+ failure: unknown, cause: unknown);
145
+ }
146
+ //#endregion
424
147
  //#region src/deploy/ownership.d.ts
425
148
  /**
426
149
  * A Dokploy project with the name this deploy would use exists, and nothing
@@ -455,5 +178,5 @@ export declare class RegistryAmbiguous extends Error {
455
178
  constructor(registry: string, registryIds: readonly string[]);
456
179
  }
457
180
  //#endregion
458
- export { type AppDeployResult, type Credential, type CredentialKind, type CredentialKinds, type CredentialProvider, type CredentialRequest, type DeployEvent, type DeployEventError, type DeployEventType, type DeployIdentity, type DeployInput, type DeployLogger, type DeployPhase, type DeployResult, type DeployRun, type ResourceChange, type ResourceVia, StateLocked, StateVersionConflict, type StoredCredentialsOptions };
181
+ export { type AppDeployResult, type Credential, type CredentialKind, type CredentialKinds, type CredentialProvider, type CredentialRequest, type DeployEvent, type DeployEventError, type DeployEventType, type DeployIdentity, type DeployInput, type DeployLogger, type DeployPhase, type DeployResult, type DeployRun, DeployTargetNotYetSupported, InvalidTargetOptions, MissingCredential, ProviderRemoved, type ResourceChange, type ResourceVia, StateLocked, StateVersionConflict, type StoredCredentialsOptions, TargetEntryInvalid, TargetPackageInvalid, TargetPackageNotFound, TargetRuntimeMismatch, TargetRuntimeUndeclared, UnknownDeployTarget, chainCredentials, deployIdentity, storedCredentials };
459
182
  //# sourceMappingURL=public.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"public.d.cts","names":[],"sources":["../../src/deploy/identity.ts","../../src/home.ts","../../src/deploy/credentials.ts","../../src/deploy/types.ts","../../src/deploy/events.ts","../../src/deploy/deploy.ts","../../src/deploy/index.ts","../../src/deploy/ownership.ts","../../src/deploy/registry.ts"],"mappings":";;;;;;;;;;;;;UAaiB;;;;;;WAMP;;WAEA;WACA;;;;;;;;WAQA;;;;;;;;;WASA;;;UA0CO;EAChB;EACA;IAAW;;;wBAGI,eACf,WAAW,gBACX,gBACE;;;;;;;;;;;;qBC5EU;;wBAGG,QAAQ,MAAK,OAAO;;;;;;;;;;;;;;UCFnB;;EAEhB;;IAEC;MAAW;;IACX;MAAS;MAAkB;;;;;;;;EAO5B;;IAEC;MAAW;;IACX;MAAS;MAAkB;;;;KAIjB,uBAAuB;;KAGvB,kBAAkB,UAAU,iBAAiB,qBACvD,KAAK;EAAM,MAAM;IAAM,gBAAgB,iBACvC;;KAGU,WAAW,UAAU,kBAAkB,gBAAgB;UAElD;;;;;EAKhB,IAAI,UAAU,gBACb,SAAS,kBAAkB,IAC3B;IAAY,SAAS;MACnB,QAAQ,WAAW;;;qBAYV,0BAA0B;WAE5B,MAAM;;WAEN;;WAEA;EALV,YACU,MAAM,gBAEN;;EAAA,4BAEA;;EAAA;;;wBAYK,oBACZ,WAAW,uBACZ;UAYc;;EAEhB,MAAM,OAAO;;;;;EAKb;;;;;;;;;;;;wBAae,kBACf,UAAS,2BACP;;;;UCzEc;;EAEhB;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;UAIgB;;EAEhB,MAAM;;EAEN;;EAEA;;EAEA;;;;;;UAOgB,qBAAqB;EACrC;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;IAAW;IAAa;;;EAExB,MAAM;;;;;EAKN,SAAS;;;;;;;;;;;;;;;KCtEE;;UAQK;;EAEhB;EACA;;;;;;;;;KAUW;;UAGK;;EAEhB;;EAEA;;;;;;EAMA;;EAEA;;KAGW;EAET;EACA;;EAEA;EACA;;EAEA;EACA;;EAEE;EAAuB,OAAO;;EAC9B;EAAwB,OAAO;;;;;;;EAK/B;EAAa;EAAkC;;EAC/C;EAAqB;EAAa;;EACjC;IAA6B;EAC7B;EAA0B,KAAK;IAAgB;EACjD;;EAGD;EACA;EACA;;EAEA;;EAGA;EACA;EACA;EACA;EACA;;EAEE;EAAoB;EAAa,OAAO;;EACxC;EAAyB,QAAQ;;EACjC;EAAuB,OAAO;;;KAGvB,kBAAkB;;;;;;;UChFb;EAChB,KAAK;EACL,KAAK;EACL,OAAO;;UAGS;;;;;EAKhB;;EAEA;;EAEA;;EAEA;;;;;;EAMA;;;;;;EAMA,cAAc;;EAEd,SAAS;;;;;;EAMT,SAAS;;;;;EAKT;;;;;EAKA;;;UAIgB,kBAAkB,cAAc;;;;;;WAMvC,QAAQ,QAAQ;;;;;;;;;;;;;;;;;;wBA2EV,OAAO,OAAO,cAAc;;;;qBCwX/B,0BAA0B;WAE5B;WACA;EAFV,YACU,yBACA;;;qBAWE,yBAAyB;WAChB;EAArB,YAAqB;;;qBAST,4BAA4B;WAE9B;EADV,YACU,aACT;;;qBAWW,uBAAuB;WAEzB;WACA;WACA;EAHV,YACU,aACA,4BACA;;;;;;;;qBCtiBE,wBAAwB;WAE1B;WACA;WACA;;WAEA;EALV,YACU,qBACA,mBACA,kBAEA;;EAAA;;;;;qBChBE,8BAA8B;WACrB;EAArB,YAAqB;;;qBAUT,yBAAyB;WAChB;EAArB,YAAqB;;;qBAUT,0BAA0B;WAE5B;WACA;EAFV,YACU,kBACA"}
1
+ {"version":3,"file":"public.d.cts","names":[],"sources":["../../src/home.ts","../../src/deploy/deploy.ts","../../src/deploy/index.ts","../../src/deploy/orchestrate.ts","../../src/deploy/ownership.ts","../../src/deploy/registry.ts"],"mappings":";;;;;;;;;;;;;;qBAaa;;wBAGG,QAAQ,MAAK,OAAO;;;;;;;UCanB;EAChB,KAAK;EACL,KAAK;EACL,OAAO;;UAGS;;;;;EAKhB;;EAEA;;;;;EAKA;;;;;;EAMA,UAAU,eAAe;;EAEzB;;EAEA;;;;;;EAMA;;;;;;EAMA,cAAc;;EAEd,SAAS;;;;;;EAMT,SAAS;;;;;EAKT;;;;;EAKA;;;UAIgB,kBAAkB,cAAc;;;;;;WAMvC,QAAQ,QAAQ;;;;;;;;;;;;;;;;;;wBAqEV,OAAO,OAAO,cAAc;;;;qBCqV/B,4BAA4B;WAE9B;EADV,YACU,aACT;;;qBAWW,uBAAuB;WAEzB;WACA;WACA;EAHV,YACU,aACA,4BACA;;;;;qBCvcE,0BAA0B;WAE5B;WACA;EAFV,YACU,yBACA;;;qBAWE,yBAAyB;WAE3B;WACA;EAFV,YACU,eACA;;;qBAUE,uBAAuB;WAEzB;;WAEA;EAHV,YACU,gBAEA;;EAAA,kBACT;;;;;;;;qBC1EW,wBAAwB;WAE1B;WACA;WACA;;WAEA;EALV,YACU,qBACA,mBACA,kBAEA;;EAAA;;;;;qBChBE,8BAA8B;WACrB;EAArB,YAAqB;;;qBAUT,yBAAyB;WAChB;EAArB,YAAqB;;;qBAUT,0BAA0B;WAE5B;WACA;EAFV,YACU,kBACA"}