@cat-factory/contracts 0.292.2 → 0.294.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/environments-kubernetes.d.ts +32 -0
- package/dist/environments-kubernetes.d.ts.map +1 -1
- package/dist/environments-kubernetes.js +8 -0
- package/dist/environments-kubernetes.js.map +1 -1
- package/dist/environments.d.ts +22 -0
- package/dist/environments.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/public-api.d.ts +48 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +12 -0
- package/dist/public-api.js.map +1 -1
- package/dist/public-provisioning.d.ts +698 -0
- package/dist/public-provisioning.d.ts.map +1 -0
- package/dist/public-provisioning.js +431 -0
- package/dist/public-provisioning.js.map +1 -0
- package/dist/routes/environmentUserHandlers.d.ts +6 -0
- package/dist/routes/environmentUserHandlers.d.ts.map +1 -1
- package/dist/routes/environments.d.ts +21 -0
- package/dist/routes/environments.d.ts.map +1 -1
- package/dist/routes/index.d.ts +1 -0
- package/dist/routes/index.d.ts.map +1 -1
- package/dist/routes/index.js +1 -0
- package/dist/routes/index.js.map +1 -1
- package/dist/routes/public-api.d.ts +14 -0
- package/dist/routes/public-api.d.ts.map +1 -1
- package/dist/routes/public-board.d.ts +14 -0
- package/dist/routes/public-board.d.ts.map +1 -1
- package/dist/routes/public-provisioning.d.ts +540 -0
- package/dist/routes/public-provisioning.d.ts.map +1 -0
- package/dist/routes/public-provisioning.js +128 -0
- package/dist/routes/public-provisioning.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,698 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
/**
|
|
3
|
+
* Create a repository from scratch (or from a reference architecture) and adapt it with an agent.
|
|
4
|
+
*
|
|
5
|
+
* The one act of board setup with no public counterpart at all: `POST /api/v1/services` can back a
|
|
6
|
+
* service with a repository that already EXISTS, and nothing on this surface could make one, so a
|
|
7
|
+
* deployment automating itself had to open a browser exactly once, at the very first step.
|
|
8
|
+
*
|
|
9
|
+
* Mirrors the internal bootstrap body's own rule rather than relaxing it: a run needs either a
|
|
10
|
+
* reference architecture to clone or a brief to scaffold from, and a request carrying neither
|
|
11
|
+
* describes no work.
|
|
12
|
+
*/
|
|
13
|
+
export declare const publicBootstrapRepoSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
14
|
+
/** Name for the new repository, under the owner the workspace's VCS connection names. */
|
|
15
|
+
readonly repoName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.RegexAction<string, "Only letters, digits, '.', '_' and '-' are allowed">, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
|
|
16
|
+
/** The repository's role on the board. Omitted ⇒ `service`. */
|
|
17
|
+
readonly type: v.OptionalSchema<v.PicklistSchema<["service", "frontend", "library", "document"], undefined>, undefined>;
|
|
18
|
+
readonly description: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
|
|
19
|
+
/** Whether the new repository is private. Omitted ⇒ private, which is the safe default. */
|
|
20
|
+
readonly private: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
21
|
+
/**
|
|
22
|
+
* The brief for the bootstrapper agent. With a reference architecture these are appended to
|
|
23
|
+
* its stored defaults; with none they are the whole brief.
|
|
24
|
+
*/
|
|
25
|
+
readonly instructions: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 8000, undefined>]>, undefined>;
|
|
26
|
+
/** A reference architecture to clone from; omit to scaffold from `instructions` alone. */
|
|
27
|
+
readonly referenceArchitectureId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
28
|
+
}, undefined>, v.CheckAction<{
|
|
29
|
+
repoName: string;
|
|
30
|
+
type?: "document" | "frontend" | "library" | "service" | undefined;
|
|
31
|
+
description?: string | undefined;
|
|
32
|
+
private?: boolean | undefined;
|
|
33
|
+
instructions?: string | undefined;
|
|
34
|
+
referenceArchitectureId?: string | undefined;
|
|
35
|
+
}, "Provide a reference architecture or freeform instructions to bootstrap from.">]>;
|
|
36
|
+
export type PublicBootstrapRepoInput = v.InferOutput<typeof publicBootstrapRepoSchema>;
|
|
37
|
+
/**
|
|
38
|
+
* One bootstrap run, as this surface reports it.
|
|
39
|
+
*
|
|
40
|
+
* `serviceId` is the board service frame the run materialises, named as this surface names a
|
|
41
|
+
* service everywhere else rather than as the `blockId` the engine calls it: a caller joins it
|
|
42
|
+
* straight onto `POST /api/v1/services/:serviceId` and `/api/v1/services/:serviceId/tasks`.
|
|
43
|
+
*
|
|
44
|
+
* `failureKind` is projected beside `error` because the two answer different questions: the string
|
|
45
|
+
* says what went wrong, the kind says whether a retry could plausibly help (a `preflight` refusal
|
|
46
|
+
* cannot be retried into success, an `evicted` container can).
|
|
47
|
+
*
|
|
48
|
+
* `failureDetail` and `failureHint` ride beside it because both are diagnostic PROSE the platform
|
|
49
|
+
* wrote for this moment, not engine internals: the hint is literally "where to look next". Omitting
|
|
50
|
+
* them would leave a headless caller re-deriving a worse version of a sentence the deployment
|
|
51
|
+
* already produced, which is the same reason the deployment's own config problems are relayed
|
|
52
|
+
* verbatim rather than paraphrased. What stays off is the structured remainder whose shape is
|
|
53
|
+
* genuinely internal (`reason`, kind-scoped and open-ended; `stepIndex`, documented as absent on a
|
|
54
|
+
* bootstrap; `occurredAt` and `lastSubtasks`, already answerable from the fields above).
|
|
55
|
+
*
|
|
56
|
+
* `failureKind` carries the FULL agent-failure vocabulary rather than the narrower list a bootstrap run is
|
|
57
|
+
* documented to produce, and deliberately so. The stored value is the shared `agentFailure`, so the
|
|
58
|
+
* narrow list is a claim about which members are REACHED, not a constraint on what a row can hold.
|
|
59
|
+
* Projecting through the narrow one would leave this mapper with a value outside its own type on
|
|
60
|
+
* exactly the path whose job is to name what went wrong, and the only ways out of that are to drop
|
|
61
|
+
* the kind (reporting a failure as having no classification) or to guess it onto a member nothing
|
|
62
|
+
* knows was meant. Reporting the recorded value is the honest third option, and a new internal kind
|
|
63
|
+
* reaches this surface as an additive enum member, which the SDKs tolerate by design.
|
|
64
|
+
*/
|
|
65
|
+
export declare const publicBootstrapJobSchema: v.ObjectSchema<{
|
|
66
|
+
readonly jobId: v.StringSchema<undefined>;
|
|
67
|
+
readonly status: v.PicklistSchema<["pending", "running", "succeeded", "failed"], undefined>;
|
|
68
|
+
readonly repoName: v.StringSchema<undefined>;
|
|
69
|
+
/** The owner the repository was created under, resolved at run time; null until known. */
|
|
70
|
+
readonly repoOwner: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
71
|
+
/** Web URL of the created repository; null until it succeeds. */
|
|
72
|
+
readonly repoUrl: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
73
|
+
/** The board service frame this run materialises; null when none was created. */
|
|
74
|
+
readonly serviceId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
75
|
+
/** Live subtask counts from the agent's todo list; null until it first reports. */
|
|
76
|
+
readonly progress: v.NullableSchema<v.ObjectSchema<{
|
|
77
|
+
readonly completed: v.NumberSchema<undefined>;
|
|
78
|
+
readonly inProgress: v.NumberSchema<undefined>;
|
|
79
|
+
readonly total: v.NumberSchema<undefined>;
|
|
80
|
+
readonly items: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
81
|
+
readonly label: v.StringSchema<undefined>;
|
|
82
|
+
readonly status: v.PicklistSchema<["pending", "in_progress", "completed"], undefined>;
|
|
83
|
+
}, undefined>, undefined>, undefined>;
|
|
84
|
+
}, undefined>, undefined>;
|
|
85
|
+
/** One-line failure reason when `status` is `failed`; null otherwise. */
|
|
86
|
+
readonly error: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
87
|
+
/** How the run faulted, when it did: the part that says whether a retry is worth it. */
|
|
88
|
+
readonly failureKind: v.NullableSchema<v.PicklistSchema<["preflight", "dispatch", "environment", "evicted", "timeout", "agent", "job_failed", "rejected", "companion_rejected", "stalled", "cancelled", "unknown"], undefined>, undefined>;
|
|
89
|
+
/** Extended detail behind `error` when the platform captured any (a harness reason, an HTTP body). */
|
|
90
|
+
readonly failureDetail: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
91
|
+
/** The platform's own "where to look next", relayed verbatim; null when it had none to offer. */
|
|
92
|
+
readonly failureHint: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
93
|
+
readonly createdAt: v.NumberSchema<undefined>;
|
|
94
|
+
readonly updatedAt: v.NumberSchema<undefined>;
|
|
95
|
+
}, undefined>;
|
|
96
|
+
export type PublicBootstrapJob = v.InferOutput<typeof publicBootstrapJobSchema>;
|
|
97
|
+
/**
|
|
98
|
+
* How the manifests at `path` are rendered. `raw` (the default) treats the path as a manifest file
|
|
99
|
+
* or a flat directory of valid YAML; `kustomize` treats it as an overlay directory, which only the
|
|
100
|
+
* container-backed deploy adapter can build.
|
|
101
|
+
*
|
|
102
|
+
* A projection of the internal renderer picklist rather than the picklist itself, for the reason
|
|
103
|
+
* the header states: these two Kubernetes shapes are the largest STRUCTURAL surfaces this file
|
|
104
|
+
* publishes, and a renderer the internal adapter grows is a public member only once someone adds it
|
|
105
|
+
* here.
|
|
106
|
+
*/
|
|
107
|
+
export declare const publicKubernetesRendererSchema: v.PicklistSchema<["raw", "kustomize"], undefined>;
|
|
108
|
+
export type PublicKubernetesRenderer = v.InferOutput<typeof publicKubernetesRendererSchema>;
|
|
109
|
+
/**
|
|
110
|
+
* Where a service's per-PR manifests are read from. `colocated` reads them from the service's own
|
|
111
|
+
* repository at the pull request's head; `separate` reads them from another repository, which is
|
|
112
|
+
* where a platform team's manifests usually live.
|
|
113
|
+
*/
|
|
114
|
+
export declare const publicKubernetesManifestSourceSchema: v.VariantSchema<"type", [v.ObjectSchema<{
|
|
115
|
+
readonly type: v.LiteralSchema<"colocated", undefined>;
|
|
116
|
+
/** File or directory path within the pull request's repository. */
|
|
117
|
+
readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
|
|
118
|
+
/** Omitted ⇒ `raw`. */
|
|
119
|
+
readonly renderer: v.OptionalSchema<v.PicklistSchema<["raw", "kustomize"], undefined>, undefined>;
|
|
120
|
+
}, undefined>, v.ObjectSchema<{
|
|
121
|
+
readonly type: v.LiteralSchema<"separate", undefined>;
|
|
122
|
+
/** `owner/repo` of the manifests repository. */
|
|
123
|
+
readonly repo: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.RegexAction<string, "must be \"owner/repo\"">]>;
|
|
124
|
+
/** Branch, tag or sha to read at; omitted ⇒ that repository's default branch. */
|
|
125
|
+
readonly ref: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
126
|
+
/** File or directory path within the manifests repository. */
|
|
127
|
+
readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
|
|
128
|
+
/** Omitted ⇒ `raw`. */
|
|
129
|
+
readonly renderer: v.OptionalSchema<v.PicklistSchema<["raw", "kustomize"], undefined>, undefined>;
|
|
130
|
+
}, undefined>], undefined>;
|
|
131
|
+
export type PublicKubernetesManifestSource = v.InferOutput<typeof publicKubernetesManifestSourceSchema>;
|
|
132
|
+
/**
|
|
133
|
+
* How the environment's URL is derived once the manifests are applied: from a host template the
|
|
134
|
+
* platform renders itself, or by reading the address back off one of four applied objects.
|
|
135
|
+
*/
|
|
136
|
+
export declare const publicKubernetesUrlSourceSchema: v.VariantSchema<"source", [v.ObjectSchema<{
|
|
137
|
+
readonly source: v.LiteralSchema<"ingressTemplate", undefined>;
|
|
138
|
+
/** Host template, e.g. `{{branch}}.preview.example.com`, rendered with the provision vars. */
|
|
139
|
+
readonly hostTemplate: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
|
|
140
|
+
/**
|
|
141
|
+
* Host port the ingress controller answers on, when it is not the scheme's default. Kept out
|
|
142
|
+
* of `hostTemplate` because the rendered template is also the Ingress `host` the manifests
|
|
143
|
+
* declare, and a Kubernetes `host` may not carry a port.
|
|
144
|
+
*/
|
|
145
|
+
readonly port: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 65535, undefined>]>, undefined>;
|
|
146
|
+
readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
|
|
147
|
+
}, undefined>, v.ObjectSchema<{
|
|
148
|
+
readonly source: v.LiteralSchema<"ingressStatus", undefined>;
|
|
149
|
+
/** Ingress to read `.status.loadBalancer` from; omitted ⇒ the only Ingress applied. */
|
|
150
|
+
readonly ingressName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
151
|
+
readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
|
|
152
|
+
}, undefined>, v.ObjectSchema<{
|
|
153
|
+
readonly source: v.LiteralSchema<"serviceStatus", undefined>;
|
|
154
|
+
/** Service to read `.status.loadBalancer` from. */
|
|
155
|
+
readonly serviceName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
|
|
156
|
+
readonly port: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 65535, undefined>]>, undefined>;
|
|
157
|
+
readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
|
|
158
|
+
}, undefined>, v.ObjectSchema<{
|
|
159
|
+
readonly source: v.LiteralSchema<"gatewayStatus", undefined>;
|
|
160
|
+
/** Gateway-API `Gateway` to read `.status.addresses[]` from; omitted ⇒ the only one applied. */
|
|
161
|
+
readonly gatewayName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
162
|
+
readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
|
|
163
|
+
}, undefined>, v.ObjectSchema<{
|
|
164
|
+
readonly source: v.LiteralSchema<"httpRouteStatus", undefined>;
|
|
165
|
+
/** `HTTPRoute` whose `parentRefs` resolve the address; omitted ⇒ the only one applied. */
|
|
166
|
+
readonly httpRouteName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
167
|
+
readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
|
|
168
|
+
}, undefined>], undefined>;
|
|
169
|
+
export type PublicKubernetesUrlSource = v.InferOutput<typeof publicKubernetesUrlSourceSchema>;
|
|
170
|
+
/**
|
|
171
|
+
* A Kubernetes cluster the platform provisions per-run environments against.
|
|
172
|
+
*
|
|
173
|
+
* Narrower than the internal engine config on purpose. Left off are the fields that only mean
|
|
174
|
+
* something to a specific execution shape the caller is not choosing here (`rolloutTimeoutSeconds`,
|
|
175
|
+
* belonging to the container deploy adapter; `helmReleases`, a cluster-singleton concern an
|
|
176
|
+
* operator owns). They can be ADDED later as optional fields, which is the additive direction this
|
|
177
|
+
* surface allows; they could never be removed once shipped, which is why they are not here now.
|
|
178
|
+
*/
|
|
179
|
+
export declare const publicKubernetesConnectionSchema: v.ObjectSchema<{
|
|
180
|
+
/** Human label for the connection, shown wherever the platform names the engine. */
|
|
181
|
+
readonly label: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
|
|
182
|
+
/** kube-apiserver root URL, e.g. `https://cluster.example:6443`. */
|
|
183
|
+
readonly apiServerUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
|
|
184
|
+
/** PEM CA bundle verifying the apiserver certificate. Omit only for a publicly-trusted CA. */
|
|
185
|
+
readonly caCertPem: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
186
|
+
/**
|
|
187
|
+
* Skip apiserver TLS verification. Throwaway clusters only, and stated as its own field rather
|
|
188
|
+
* than inferred from an absent CA, so turning verification off is always something a caller
|
|
189
|
+
* asked for in writing.
|
|
190
|
+
*/
|
|
191
|
+
readonly insecureSkipTlsVerify: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
192
|
+
/** Namespace template for the per-run environment, e.g. `env-{{pullNumber}}`. */
|
|
193
|
+
readonly namespaceTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
|
|
194
|
+
/** How the environment URL is derived once the manifests are applied. */
|
|
195
|
+
readonly url: v.VariantSchema<"source", [v.ObjectSchema<{
|
|
196
|
+
readonly source: v.LiteralSchema<"ingressTemplate", undefined>;
|
|
197
|
+
/** Host template, e.g. `{{branch}}.preview.example.com`, rendered with the provision vars. */
|
|
198
|
+
readonly hostTemplate: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
|
|
199
|
+
/**
|
|
200
|
+
* Host port the ingress controller answers on, when it is not the scheme's default. Kept out
|
|
201
|
+
* of `hostTemplate` because the rendered template is also the Ingress `host` the manifests
|
|
202
|
+
* declare, and a Kubernetes `host` may not carry a port.
|
|
203
|
+
*/
|
|
204
|
+
readonly port: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 65535, undefined>]>, undefined>;
|
|
205
|
+
readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
|
|
206
|
+
}, undefined>, v.ObjectSchema<{
|
|
207
|
+
readonly source: v.LiteralSchema<"ingressStatus", undefined>;
|
|
208
|
+
/** Ingress to read `.status.loadBalancer` from; omitted ⇒ the only Ingress applied. */
|
|
209
|
+
readonly ingressName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
210
|
+
readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
|
|
211
|
+
}, undefined>, v.ObjectSchema<{
|
|
212
|
+
readonly source: v.LiteralSchema<"serviceStatus", undefined>;
|
|
213
|
+
/** Service to read `.status.loadBalancer` from. */
|
|
214
|
+
readonly serviceName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
|
|
215
|
+
readonly port: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 65535, undefined>]>, undefined>;
|
|
216
|
+
readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
|
|
217
|
+
}, undefined>, v.ObjectSchema<{
|
|
218
|
+
readonly source: v.LiteralSchema<"gatewayStatus", undefined>;
|
|
219
|
+
/** Gateway-API `Gateway` to read `.status.addresses[]` from; omitted ⇒ the only one applied. */
|
|
220
|
+
readonly gatewayName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
221
|
+
readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
|
|
222
|
+
}, undefined>, v.ObjectSchema<{
|
|
223
|
+
readonly source: v.LiteralSchema<"httpRouteStatus", undefined>;
|
|
224
|
+
/** `HTTPRoute` whose `parentRefs` resolve the address; omitted ⇒ the only one applied. */
|
|
225
|
+
readonly httpRouteName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
226
|
+
readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
|
|
227
|
+
}, undefined>], undefined>;
|
|
228
|
+
/** Image reference exposed to the manifests as `{{image}}`. */
|
|
229
|
+
readonly imageTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
|
|
230
|
+
/** Backstop TTL (ms) after which an environment is swept and torn down. */
|
|
231
|
+
readonly defaultTtlMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 60000, undefined>]>, undefined>;
|
|
232
|
+
/** Extra labels stamped on the namespace and every applied resource. */
|
|
233
|
+
readonly labels: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
|
|
234
|
+
/** Extra annotations stamped on the namespace. */
|
|
235
|
+
readonly annotations: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
|
|
236
|
+
}, undefined>;
|
|
237
|
+
export type PublicKubernetesConnection = v.InferOutput<typeof publicKubernetesConnectionSchema>;
|
|
238
|
+
/**
|
|
239
|
+
* The engine a workspace provisions environments through, discriminated by `engine`.
|
|
240
|
+
*
|
|
241
|
+
* A one-member variant rather than a bare object, which is the whole point: `kubernetes` is the
|
|
242
|
+
* engine that is automatable today, and a second member is an additive enum value the SDKs already
|
|
243
|
+
* tolerate by design. A bare object would have to be RESHAPED to gain a sibling, and reshaping is
|
|
244
|
+
* the thing this surface may not do.
|
|
245
|
+
*
|
|
246
|
+
* The internal engine vocabulary splits Kubernetes in two (`local-k3s` and `remote-kubernetes`,
|
|
247
|
+
* which differ in how the deployment reaches the cluster, not in what a caller supplies). That
|
|
248
|
+
* split is not a public fact, and it is not a public DECISION either: one backend serves both
|
|
249
|
+
* names, both lower to the same provision type and the same config, so a connection made here is
|
|
250
|
+
* registered under the one name the controller states (`remote-kubernetes`) and nothing a run does
|
|
251
|
+
* can observe the difference. A caller describes its cluster; which internal name that is stored
|
|
252
|
+
* under is the platform's business.
|
|
253
|
+
*/
|
|
254
|
+
export declare const publicEnvironmentConnectionSchema: v.VariantSchema<"engine", [v.ObjectSchema<{
|
|
255
|
+
readonly engine: v.LiteralSchema<"kubernetes", undefined>;
|
|
256
|
+
readonly kubernetes: v.ObjectSchema<{
|
|
257
|
+
/** Human label for the connection, shown wherever the platform names the engine. */
|
|
258
|
+
readonly label: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
|
|
259
|
+
/** kube-apiserver root URL, e.g. `https://cluster.example:6443`. */
|
|
260
|
+
readonly apiServerUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
|
|
261
|
+
/** PEM CA bundle verifying the apiserver certificate. Omit only for a publicly-trusted CA. */
|
|
262
|
+
readonly caCertPem: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
263
|
+
/**
|
|
264
|
+
* Skip apiserver TLS verification. Throwaway clusters only, and stated as its own field rather
|
|
265
|
+
* than inferred from an absent CA, so turning verification off is always something a caller
|
|
266
|
+
* asked for in writing.
|
|
267
|
+
*/
|
|
268
|
+
readonly insecureSkipTlsVerify: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
269
|
+
/** Namespace template for the per-run environment, e.g. `env-{{pullNumber}}`. */
|
|
270
|
+
readonly namespaceTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
|
|
271
|
+
/** How the environment URL is derived once the manifests are applied. */
|
|
272
|
+
readonly url: v.VariantSchema<"source", [v.ObjectSchema<{
|
|
273
|
+
readonly source: v.LiteralSchema<"ingressTemplate", undefined>;
|
|
274
|
+
/** Host template, e.g. `{{branch}}.preview.example.com`, rendered with the provision vars. */
|
|
275
|
+
readonly hostTemplate: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
|
|
276
|
+
/**
|
|
277
|
+
* Host port the ingress controller answers on, when it is not the scheme's default. Kept out
|
|
278
|
+
* of `hostTemplate` because the rendered template is also the Ingress `host` the manifests
|
|
279
|
+
* declare, and a Kubernetes `host` may not carry a port.
|
|
280
|
+
*/
|
|
281
|
+
readonly port: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 65535, undefined>]>, undefined>;
|
|
282
|
+
readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
|
|
283
|
+
}, undefined>, v.ObjectSchema<{
|
|
284
|
+
readonly source: v.LiteralSchema<"ingressStatus", undefined>;
|
|
285
|
+
/** Ingress to read `.status.loadBalancer` from; omitted ⇒ the only Ingress applied. */
|
|
286
|
+
readonly ingressName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
287
|
+
readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
|
|
288
|
+
}, undefined>, v.ObjectSchema<{
|
|
289
|
+
readonly source: v.LiteralSchema<"serviceStatus", undefined>;
|
|
290
|
+
/** Service to read `.status.loadBalancer` from. */
|
|
291
|
+
readonly serviceName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
|
|
292
|
+
readonly port: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 65535, undefined>]>, undefined>;
|
|
293
|
+
readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
|
|
294
|
+
}, undefined>, v.ObjectSchema<{
|
|
295
|
+
readonly source: v.LiteralSchema<"gatewayStatus", undefined>;
|
|
296
|
+
/** Gateway-API `Gateway` to read `.status.addresses[]` from; omitted ⇒ the only one applied. */
|
|
297
|
+
readonly gatewayName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
298
|
+
readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
|
|
299
|
+
}, undefined>, v.ObjectSchema<{
|
|
300
|
+
readonly source: v.LiteralSchema<"httpRouteStatus", undefined>;
|
|
301
|
+
/** `HTTPRoute` whose `parentRefs` resolve the address; omitted ⇒ the only one applied. */
|
|
302
|
+
readonly httpRouteName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
303
|
+
readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
|
|
304
|
+
}, undefined>], undefined>;
|
|
305
|
+
/** Image reference exposed to the manifests as `{{image}}`. */
|
|
306
|
+
readonly imageTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
|
|
307
|
+
/** Backstop TTL (ms) after which an environment is swept and torn down. */
|
|
308
|
+
readonly defaultTtlMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 60000, undefined>]>, undefined>;
|
|
309
|
+
/** Extra labels stamped on the namespace and every applied resource. */
|
|
310
|
+
readonly labels: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
|
|
311
|
+
/** Extra annotations stamped on the namespace. */
|
|
312
|
+
readonly annotations: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
|
|
313
|
+
}, undefined>;
|
|
314
|
+
}, undefined>], undefined>;
|
|
315
|
+
export type PublicEnvironmentConnection = v.InferOutput<typeof publicEnvironmentConnectionSchema>;
|
|
316
|
+
/** Probe a candidate connection. Persists nothing, which is the reason it is its own call. */
|
|
317
|
+
export declare const testPublicEnvironmentConnectionSchema: v.ObjectSchema<{
|
|
318
|
+
readonly connection: v.VariantSchema<"engine", [v.ObjectSchema<{
|
|
319
|
+
readonly engine: v.LiteralSchema<"kubernetes", undefined>;
|
|
320
|
+
readonly kubernetes: v.ObjectSchema<{
|
|
321
|
+
/** Human label for the connection, shown wherever the platform names the engine. */
|
|
322
|
+
readonly label: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
|
|
323
|
+
/** kube-apiserver root URL, e.g. `https://cluster.example:6443`. */
|
|
324
|
+
readonly apiServerUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
|
|
325
|
+
/** PEM CA bundle verifying the apiserver certificate. Omit only for a publicly-trusted CA. */
|
|
326
|
+
readonly caCertPem: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
327
|
+
/**
|
|
328
|
+
* Skip apiserver TLS verification. Throwaway clusters only, and stated as its own field rather
|
|
329
|
+
* than inferred from an absent CA, so turning verification off is always something a caller
|
|
330
|
+
* asked for in writing.
|
|
331
|
+
*/
|
|
332
|
+
readonly insecureSkipTlsVerify: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
333
|
+
/** Namespace template for the per-run environment, e.g. `env-{{pullNumber}}`. */
|
|
334
|
+
readonly namespaceTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
|
|
335
|
+
/** How the environment URL is derived once the manifests are applied. */
|
|
336
|
+
readonly url: v.VariantSchema<"source", [v.ObjectSchema<{
|
|
337
|
+
readonly source: v.LiteralSchema<"ingressTemplate", undefined>;
|
|
338
|
+
/** Host template, e.g. `{{branch}}.preview.example.com`, rendered with the provision vars. */
|
|
339
|
+
readonly hostTemplate: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
|
|
340
|
+
/**
|
|
341
|
+
* Host port the ingress controller answers on, when it is not the scheme's default. Kept out
|
|
342
|
+
* of `hostTemplate` because the rendered template is also the Ingress `host` the manifests
|
|
343
|
+
* declare, and a Kubernetes `host` may not carry a port.
|
|
344
|
+
*/
|
|
345
|
+
readonly port: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 65535, undefined>]>, undefined>;
|
|
346
|
+
readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
|
|
347
|
+
}, undefined>, v.ObjectSchema<{
|
|
348
|
+
readonly source: v.LiteralSchema<"ingressStatus", undefined>;
|
|
349
|
+
/** Ingress to read `.status.loadBalancer` from; omitted ⇒ the only Ingress applied. */
|
|
350
|
+
readonly ingressName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
351
|
+
readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
|
|
352
|
+
}, undefined>, v.ObjectSchema<{
|
|
353
|
+
readonly source: v.LiteralSchema<"serviceStatus", undefined>;
|
|
354
|
+
/** Service to read `.status.loadBalancer` from. */
|
|
355
|
+
readonly serviceName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
|
|
356
|
+
readonly port: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 65535, undefined>]>, undefined>;
|
|
357
|
+
readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
|
|
358
|
+
}, undefined>, v.ObjectSchema<{
|
|
359
|
+
readonly source: v.LiteralSchema<"gatewayStatus", undefined>;
|
|
360
|
+
/** Gateway-API `Gateway` to read `.status.addresses[]` from; omitted ⇒ the only one applied. */
|
|
361
|
+
readonly gatewayName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
362
|
+
readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
|
|
363
|
+
}, undefined>, v.ObjectSchema<{
|
|
364
|
+
readonly source: v.LiteralSchema<"httpRouteStatus", undefined>;
|
|
365
|
+
/** `HTTPRoute` whose `parentRefs` resolve the address; omitted ⇒ the only one applied. */
|
|
366
|
+
readonly httpRouteName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
367
|
+
readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
|
|
368
|
+
}, undefined>], undefined>;
|
|
369
|
+
/** Image reference exposed to the manifests as `{{image}}`. */
|
|
370
|
+
readonly imageTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
|
|
371
|
+
/** Backstop TTL (ms) after which an environment is swept and torn down. */
|
|
372
|
+
readonly defaultTtlMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 60000, undefined>]>, undefined>;
|
|
373
|
+
/** Extra labels stamped on the namespace and every applied resource. */
|
|
374
|
+
readonly labels: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
|
|
375
|
+
/** Extra annotations stamped on the namespace. */
|
|
376
|
+
readonly annotations: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
|
|
377
|
+
}, undefined>;
|
|
378
|
+
}, undefined>], undefined>;
|
|
379
|
+
/** Secret bundle the engine authenticates with, e.g. `{ apiToken: '...' }`. */
|
|
380
|
+
readonly secrets: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
|
|
381
|
+
}, undefined>;
|
|
382
|
+
export type TestPublicEnvironmentConnectionInput = v.InferOutput<typeof testPublicEnvironmentConnectionSchema>;
|
|
383
|
+
/** The verdict of a probe. `ok: false` is an ANSWER, so it is a 200 rather than an error. */
|
|
384
|
+
export declare const publicEnvironmentConnectionTestSchema: v.ObjectSchema<{
|
|
385
|
+
readonly ok: v.BooleanSchema<undefined>;
|
|
386
|
+
/** What the probe read back, whether it succeeded or not; null when it had nothing to add. */
|
|
387
|
+
readonly message: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
388
|
+
}, undefined>;
|
|
389
|
+
export type PublicEnvironmentConnectionTest = v.InferOutput<typeof publicEnvironmentConnectionTestSchema>;
|
|
390
|
+
/**
|
|
391
|
+
* Bind a provision type to an engine connection. Idempotent: re-connecting REPLACES, so a caller
|
|
392
|
+
* re-running its own setup converges instead of accumulating handlers or having to delete first.
|
|
393
|
+
*/
|
|
394
|
+
export declare const connectPublicEnvironmentSchema: v.ObjectSchema<{
|
|
395
|
+
readonly connection: v.VariantSchema<"engine", [v.ObjectSchema<{
|
|
396
|
+
readonly engine: v.LiteralSchema<"kubernetes", undefined>;
|
|
397
|
+
readonly kubernetes: v.ObjectSchema<{
|
|
398
|
+
/** Human label for the connection, shown wherever the platform names the engine. */
|
|
399
|
+
readonly label: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
|
|
400
|
+
/** kube-apiserver root URL, e.g. `https://cluster.example:6443`. */
|
|
401
|
+
readonly apiServerUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
|
|
402
|
+
/** PEM CA bundle verifying the apiserver certificate. Omit only for a publicly-trusted CA. */
|
|
403
|
+
readonly caCertPem: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
404
|
+
/**
|
|
405
|
+
* Skip apiserver TLS verification. Throwaway clusters only, and stated as its own field rather
|
|
406
|
+
* than inferred from an absent CA, so turning verification off is always something a caller
|
|
407
|
+
* asked for in writing.
|
|
408
|
+
*/
|
|
409
|
+
readonly insecureSkipTlsVerify: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
410
|
+
/** Namespace template for the per-run environment, e.g. `env-{{pullNumber}}`. */
|
|
411
|
+
readonly namespaceTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
|
|
412
|
+
/** How the environment URL is derived once the manifests are applied. */
|
|
413
|
+
readonly url: v.VariantSchema<"source", [v.ObjectSchema<{
|
|
414
|
+
readonly source: v.LiteralSchema<"ingressTemplate", undefined>;
|
|
415
|
+
/** Host template, e.g. `{{branch}}.preview.example.com`, rendered with the provision vars. */
|
|
416
|
+
readonly hostTemplate: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
|
|
417
|
+
/**
|
|
418
|
+
* Host port the ingress controller answers on, when it is not the scheme's default. Kept out
|
|
419
|
+
* of `hostTemplate` because the rendered template is also the Ingress `host` the manifests
|
|
420
|
+
* declare, and a Kubernetes `host` may not carry a port.
|
|
421
|
+
*/
|
|
422
|
+
readonly port: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 65535, undefined>]>, undefined>;
|
|
423
|
+
readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
|
|
424
|
+
}, undefined>, v.ObjectSchema<{
|
|
425
|
+
readonly source: v.LiteralSchema<"ingressStatus", undefined>;
|
|
426
|
+
/** Ingress to read `.status.loadBalancer` from; omitted ⇒ the only Ingress applied. */
|
|
427
|
+
readonly ingressName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
428
|
+
readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
|
|
429
|
+
}, undefined>, v.ObjectSchema<{
|
|
430
|
+
readonly source: v.LiteralSchema<"serviceStatus", undefined>;
|
|
431
|
+
/** Service to read `.status.loadBalancer` from. */
|
|
432
|
+
readonly serviceName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
|
|
433
|
+
readonly port: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 65535, undefined>]>, undefined>;
|
|
434
|
+
readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
|
|
435
|
+
}, undefined>, v.ObjectSchema<{
|
|
436
|
+
readonly source: v.LiteralSchema<"gatewayStatus", undefined>;
|
|
437
|
+
/** Gateway-API `Gateway` to read `.status.addresses[]` from; omitted ⇒ the only one applied. */
|
|
438
|
+
readonly gatewayName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
439
|
+
readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
|
|
440
|
+
}, undefined>, v.ObjectSchema<{
|
|
441
|
+
readonly source: v.LiteralSchema<"httpRouteStatus", undefined>;
|
|
442
|
+
/** `HTTPRoute` whose `parentRefs` resolve the address; omitted ⇒ the only one applied. */
|
|
443
|
+
readonly httpRouteName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
444
|
+
readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
|
|
445
|
+
}, undefined>], undefined>;
|
|
446
|
+
/** Image reference exposed to the manifests as `{{image}}`. */
|
|
447
|
+
readonly imageTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
|
|
448
|
+
/** Backstop TTL (ms) after which an environment is swept and torn down. */
|
|
449
|
+
readonly defaultTtlMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 60000, undefined>]>, undefined>;
|
|
450
|
+
/** Extra labels stamped on the namespace and every applied resource. */
|
|
451
|
+
readonly labels: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
|
|
452
|
+
/** Extra annotations stamped on the namespace. */
|
|
453
|
+
readonly annotations: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
|
|
454
|
+
}, undefined>;
|
|
455
|
+
}, undefined>], undefined>;
|
|
456
|
+
readonly secrets: v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>;
|
|
457
|
+
}, undefined>;
|
|
458
|
+
export type ConnectPublicEnvironmentInput = v.InferOutput<typeof connectPublicEnvironmentSchema>;
|
|
459
|
+
/**
|
|
460
|
+
* A registered connection, as this surface reports it back.
|
|
461
|
+
*
|
|
462
|
+
* `secretKeys` and not the secrets: a caller confirming its own setup needs to know WHICH keys
|
|
463
|
+
* landed, and nothing on a read surface should be able to return a credential value. That holds
|
|
464
|
+
* even though the caller supplied it moments earlier, because the read is repeatable by anyone
|
|
465
|
+
* holding the key afterwards.
|
|
466
|
+
*/
|
|
467
|
+
export declare const publicEnvironmentConnectionViewSchema: v.ObjectSchema<{
|
|
468
|
+
/** The provision type this connection serves. */
|
|
469
|
+
readonly provisionType: v.StringSchema<undefined>;
|
|
470
|
+
readonly engine: v.LiteralSchema<"kubernetes", undefined>;
|
|
471
|
+
readonly label: v.StringSchema<undefined>;
|
|
472
|
+
readonly apiServerUrl: v.StringSchema<undefined>;
|
|
473
|
+
/** The secret-bundle keys this connection holds, never their values. */
|
|
474
|
+
readonly secretKeys: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
475
|
+
}, undefined>;
|
|
476
|
+
export type PublicEnvironmentConnectionView = v.InferOutput<typeof publicEnvironmentConnectionViewSchema>;
|
|
477
|
+
/**
|
|
478
|
+
* Where ONE service's per-run manifests live: the half the engine connection does not carry.
|
|
479
|
+
*
|
|
480
|
+
* The platform keeps these two apart deliberately (one cluster, many services, each with its own
|
|
481
|
+
* manifests), and this surface keeps the same seam rather than collapsing them into one call, so a
|
|
482
|
+
* caller adding a second service to an existing cluster changes one thing.
|
|
483
|
+
*/
|
|
484
|
+
export declare const publicServiceProvisioningSchema: v.VariantSchema<"type", [v.ObjectSchema<{
|
|
485
|
+
readonly type: v.LiteralSchema<"kubernetes", undefined>;
|
|
486
|
+
readonly manifestSource: v.VariantSchema<"type", [v.ObjectSchema<{
|
|
487
|
+
readonly type: v.LiteralSchema<"colocated", undefined>;
|
|
488
|
+
/** File or directory path within the pull request's repository. */
|
|
489
|
+
readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
|
|
490
|
+
/** Omitted ⇒ `raw`. */
|
|
491
|
+
readonly renderer: v.OptionalSchema<v.PicklistSchema<["raw", "kustomize"], undefined>, undefined>;
|
|
492
|
+
}, undefined>, v.ObjectSchema<{
|
|
493
|
+
readonly type: v.LiteralSchema<"separate", undefined>;
|
|
494
|
+
/** `owner/repo` of the manifests repository. */
|
|
495
|
+
readonly repo: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.RegexAction<string, "must be \"owner/repo\"">]>;
|
|
496
|
+
/** Branch, tag or sha to read at; omitted ⇒ that repository's default branch. */
|
|
497
|
+
readonly ref: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
498
|
+
/** File or directory path within the manifests repository. */
|
|
499
|
+
readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
|
|
500
|
+
/** Omitted ⇒ `raw`. */
|
|
501
|
+
readonly renderer: v.OptionalSchema<v.PicklistSchema<["raw", "kustomize"], undefined>, undefined>;
|
|
502
|
+
}, undefined>], undefined>;
|
|
503
|
+
}, undefined>], undefined>;
|
|
504
|
+
export type PublicServiceProvisioning = v.InferOutput<typeof publicServiceProvisioningSchema>;
|
|
505
|
+
/**
|
|
506
|
+
* Patch a service. Only the supplied fields change, and an omitted `provisioning` LEAVES the stored
|
|
507
|
+
* one alone rather than clearing it: a caller renaming a service must not silently un-deploy it.
|
|
508
|
+
*
|
|
509
|
+
* At least one field is REQUIRED, on the same reading as the bootstrap body above: a patch naming
|
|
510
|
+
* nothing describes no edit, and admitting it would spend a write, a re-read and a board-wide
|
|
511
|
+
* event broadcast on a request whose only possible outcome is the state it started in. The generated
|
|
512
|
+
* clients default the body, so an empty one is a call a caller makes by accident rather than on
|
|
513
|
+
* purpose.
|
|
514
|
+
*/
|
|
515
|
+
export declare const updatePublicServiceSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
516
|
+
readonly title: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
|
|
517
|
+
readonly description: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
|
|
518
|
+
readonly provisioning: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
|
|
519
|
+
readonly type: v.LiteralSchema<"kubernetes", undefined>;
|
|
520
|
+
readonly manifestSource: v.VariantSchema<"type", [v.ObjectSchema<{
|
|
521
|
+
readonly type: v.LiteralSchema<"colocated", undefined>;
|
|
522
|
+
/** File or directory path within the pull request's repository. */
|
|
523
|
+
readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
|
|
524
|
+
/** Omitted ⇒ `raw`. */
|
|
525
|
+
readonly renderer: v.OptionalSchema<v.PicklistSchema<["raw", "kustomize"], undefined>, undefined>;
|
|
526
|
+
}, undefined>, v.ObjectSchema<{
|
|
527
|
+
readonly type: v.LiteralSchema<"separate", undefined>;
|
|
528
|
+
/** `owner/repo` of the manifests repository. */
|
|
529
|
+
readonly repo: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.RegexAction<string, "must be \"owner/repo\"">]>;
|
|
530
|
+
/** Branch, tag or sha to read at; omitted ⇒ that repository's default branch. */
|
|
531
|
+
readonly ref: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
532
|
+
/** File or directory path within the manifests repository. */
|
|
533
|
+
readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
|
|
534
|
+
/** Omitted ⇒ `raw`. */
|
|
535
|
+
readonly renderer: v.OptionalSchema<v.PicklistSchema<["raw", "kustomize"], undefined>, undefined>;
|
|
536
|
+
}, undefined>], undefined>;
|
|
537
|
+
}, undefined>], undefined>, undefined>;
|
|
538
|
+
}, undefined>, v.CheckAction<{
|
|
539
|
+
title?: string | undefined;
|
|
540
|
+
description?: string | undefined;
|
|
541
|
+
provisioning?: {
|
|
542
|
+
type: "kubernetes";
|
|
543
|
+
manifestSource: {
|
|
544
|
+
type: "colocated";
|
|
545
|
+
path: string;
|
|
546
|
+
renderer?: "kustomize" | "raw" | undefined;
|
|
547
|
+
} | {
|
|
548
|
+
type: "separate";
|
|
549
|
+
repo: string;
|
|
550
|
+
ref?: string | undefined;
|
|
551
|
+
path: string;
|
|
552
|
+
renderer?: "kustomize" | "raw" | undefined;
|
|
553
|
+
};
|
|
554
|
+
} | undefined;
|
|
555
|
+
}, "Supply at least one of title, description or provisioning.">]>;
|
|
556
|
+
export type UpdatePublicServiceInput = v.InferOutput<typeof updatePublicServiceSchema>;
|
|
557
|
+
/**
|
|
558
|
+
* One model in the workspace's catalog, reduced to the question a caller actually has: can a run
|
|
559
|
+
* dispatch to this, and if not, is that because nobody configured it or because a policy refuses it?
|
|
560
|
+
*
|
|
561
|
+
* Those two are separated because they need OPPOSITE fixes, and conflating them is the specific
|
|
562
|
+
* failure this projection exists to prevent: telling an operator to add a provider key when every
|
|
563
|
+
* model is already configured and blocked by their account's model-family policy sends them to
|
|
564
|
+
* change a setting that is already correct.
|
|
565
|
+
*/
|
|
566
|
+
export declare const publicWiredModelSchema: v.ObjectSchema<{
|
|
567
|
+
readonly modelId: v.StringSchema<undefined>;
|
|
568
|
+
readonly label: v.StringSchema<undefined>;
|
|
569
|
+
/** Provider label for the flavour actually in use, e.g. `Cloudflare`, `Bedrock`. */
|
|
570
|
+
readonly provider: v.StringSchema<undefined>;
|
|
571
|
+
/** Whether a run can dispatch to it right now. */
|
|
572
|
+
readonly available: v.BooleanSchema<undefined>;
|
|
573
|
+
/** Whether it is unavailable specifically because an account model policy refuses its family. */
|
|
574
|
+
readonly policyBlocked: v.BooleanSchema<undefined>;
|
|
575
|
+
}, undefined>;
|
|
576
|
+
export type PublicWiredModel = v.InferOutput<typeof publicWiredModelSchema>;
|
|
577
|
+
/**
|
|
578
|
+
* The catalog, plus the one thing the catalog itself cannot say.
|
|
579
|
+
*
|
|
580
|
+
* `excludesUserScopedModels` reports that this deployment serves per-user locally-run model
|
|
581
|
+
* endpoints, which a key-authenticated read does not see: they are one developer's own machine, and
|
|
582
|
+
* an API key has no developer, so folding them in would attribute someone else's endpoints to the
|
|
583
|
+
* caller. Without this flag their absence is byte-for-byte "this deployment has nothing wired", and
|
|
584
|
+
* those two need OPPOSITE remedies: the first is a run that must be started by a signed-in user,
|
|
585
|
+
* the second is a provider key. That is the same conflation `policyBlocked` exists to prevent, one
|
|
586
|
+
* level up: a third state, stated rather than collapsed into a false.
|
|
587
|
+
*/
|
|
588
|
+
export declare const publicWiredModelListSchema: v.ObjectSchema<{
|
|
589
|
+
readonly models: v.ArraySchema<v.ObjectSchema<{
|
|
590
|
+
readonly modelId: v.StringSchema<undefined>;
|
|
591
|
+
readonly label: v.StringSchema<undefined>;
|
|
592
|
+
/** Provider label for the flavour actually in use, e.g. `Cloudflare`, `Bedrock`. */
|
|
593
|
+
readonly provider: v.StringSchema<undefined>;
|
|
594
|
+
/** Whether a run can dispatch to it right now. */
|
|
595
|
+
readonly available: v.BooleanSchema<undefined>;
|
|
596
|
+
/** Whether it is unavailable specifically because an account model policy refuses its family. */
|
|
597
|
+
readonly policyBlocked: v.BooleanSchema<undefined>;
|
|
598
|
+
}, undefined>, undefined>;
|
|
599
|
+
/** Whether per-user locally-run endpoints exist here that this read cannot enumerate. */
|
|
600
|
+
readonly excludesUserScopedModels: v.BooleanSchema<undefined>;
|
|
601
|
+
}, undefined>;
|
|
602
|
+
export type PublicWiredModelList = v.InferOutput<typeof publicWiredModelListSchema>;
|
|
603
|
+
/**
|
|
604
|
+
* The workspace's VCS connection, reduced to what it may DO.
|
|
605
|
+
*
|
|
606
|
+
* The two permission flags are the whole reason this is on the surface. Both are refused by the
|
|
607
|
+
* provider at PUSH time rather than at connect time, so a caller that cannot read them discovers a
|
|
608
|
+
* missing `workflows: write` as a repository that bootstrapped and then failed to gain its CI
|
|
609
|
+
* workflow, which reads like a broken bootstrap rather than a missing permission.
|
|
610
|
+
*/
|
|
611
|
+
export declare const publicVcsConnectionSchema: v.ObjectSchema<{
|
|
612
|
+
readonly provider: v.PicklistSchema<["github", "gitlab"], undefined>;
|
|
613
|
+
/** The account (user or organisation) the workspace is connected to. */
|
|
614
|
+
readonly accountLogin: v.StringSchema<undefined>;
|
|
615
|
+
/** How the workspace authenticates: an app installation, or a pasted token. */
|
|
616
|
+
readonly method: v.PicklistSchema<["app", "pat"], undefined>;
|
|
617
|
+
/** Whether the platform can create repositories under this account itself. */
|
|
618
|
+
readonly canCreateRepos: v.BooleanSchema<undefined>;
|
|
619
|
+
/** Whether the connection may write `.github/workflows/*`, which a CI gate depends on. */
|
|
620
|
+
readonly canManageWorkflows: v.BooleanSchema<undefined>;
|
|
621
|
+
}, undefined>;
|
|
622
|
+
export type PublicVcsConnection = v.InferOutput<typeof publicVcsConnectionSchema>;
|
|
623
|
+
/**
|
|
624
|
+
* `connection: null` is a real, reportable state (nothing connected), not an absence to 404 on: a
|
|
625
|
+
* caller setting a workspace up asks this question precisely when the answer may be "nothing yet".
|
|
626
|
+
*/
|
|
627
|
+
export declare const publicVcsConnectionViewSchema: v.ObjectSchema<{
|
|
628
|
+
readonly connection: v.NullableSchema<v.ObjectSchema<{
|
|
629
|
+
readonly provider: v.PicklistSchema<["github", "gitlab"], undefined>;
|
|
630
|
+
/** The account (user or organisation) the workspace is connected to. */
|
|
631
|
+
readonly accountLogin: v.StringSchema<undefined>;
|
|
632
|
+
/** How the workspace authenticates: an app installation, or a pasted token. */
|
|
633
|
+
readonly method: v.PicklistSchema<["app", "pat"], undefined>;
|
|
634
|
+
/** Whether the platform can create repositories under this account itself. */
|
|
635
|
+
readonly canCreateRepos: v.BooleanSchema<undefined>;
|
|
636
|
+
/** Whether the connection may write `.github/workflows/*`, which a CI gate depends on. */
|
|
637
|
+
readonly canManageWorkflows: v.BooleanSchema<undefined>;
|
|
638
|
+
}, undefined>, undefined>;
|
|
639
|
+
}, undefined>;
|
|
640
|
+
export type PublicVcsConnectionView = v.InferOutput<typeof publicVcsConnectionViewSchema>;
|
|
641
|
+
/**
|
|
642
|
+
* One merge preset, reduced to what decides whether a run can LAND without a person.
|
|
643
|
+
*
|
|
644
|
+
* `dryRunRoles` is projected even though a caller cannot resolve which role its own key runs
|
|
645
|
+
* under: a non-empty list is the difference between "this preset merges" and "this preset merges
|
|
646
|
+
* for everyone except the role you might be", and stating it lets a caller report the caveat
|
|
647
|
+
* rather than assert a verdict it has not earned.
|
|
648
|
+
*
|
|
649
|
+
* `submissionRestrictedRoles` is the SECOND such caveat and rides for the same reason. A preset
|
|
650
|
+
* carries two role-scoped bars on LANDING (ADR 0039's per-role change-class allowlist, enforced at
|
|
651
|
+
* both merge exits, and the dry-run list), and publishing one of them made the other read as
|
|
652
|
+
* absent: `autoMergeEnabled: true` with an empty `dryRunRoles` says "this preset merges" while a
|
|
653
|
+
* role allowlist holds every run outside its classes for a human. What is deliberately NOT here is
|
|
654
|
+
* the per-role narrowing of the score CEILINGS (`classRulesByRole`), on the same line this
|
|
655
|
+
* projection already draws for the ceilings themselves: it decides how much review landing takes,
|
|
656
|
+
* where these two decide whether landing happens at all.
|
|
657
|
+
*/
|
|
658
|
+
export declare const publicMergePresetSchema: v.ObjectSchema<{
|
|
659
|
+
readonly presetId: v.StringSchema<undefined>;
|
|
660
|
+
readonly name: v.StringSchema<undefined>;
|
|
661
|
+
/** Whether a task that pins no preset resolves this one. */
|
|
662
|
+
readonly isDefault: v.BooleanSchema<undefined>;
|
|
663
|
+
/** The master switch: false holds every pull request for a person. */
|
|
664
|
+
readonly autoMergeEnabled: v.BooleanSchema<undefined>;
|
|
665
|
+
/** How many times the `ci-fixer` may try to turn CI green before giving up. */
|
|
666
|
+
readonly ciMaxAttempts: v.NumberSchema<undefined>;
|
|
667
|
+
/** Workspace roles whose runs this preset forces into dry-run mode. */
|
|
668
|
+
readonly dryRunRoles: v.ArraySchema<v.PicklistSchema<readonly ["admin", "member", "viewer"], undefined>, undefined>;
|
|
669
|
+
/**
|
|
670
|
+
* Workspace roles whose runs may land only the change classes an allowlist names, so a run
|
|
671
|
+
* outside them is held for a person however good its scores are. A role absent from this list is
|
|
672
|
+
* unrestricted; the classes themselves are internal vocabulary and stay off this surface.
|
|
673
|
+
*/
|
|
674
|
+
readonly submissionRestrictedRoles: v.ArraySchema<v.PicklistSchema<readonly ["admin", "member", "viewer"], undefined>, undefined>;
|
|
675
|
+
}, undefined>;
|
|
676
|
+
export type PublicMergePreset = v.InferOutput<typeof publicMergePresetSchema>;
|
|
677
|
+
export declare const publicMergePresetListSchema: v.ObjectSchema<{
|
|
678
|
+
readonly presets: v.ArraySchema<v.ObjectSchema<{
|
|
679
|
+
readonly presetId: v.StringSchema<undefined>;
|
|
680
|
+
readonly name: v.StringSchema<undefined>;
|
|
681
|
+
/** Whether a task that pins no preset resolves this one. */
|
|
682
|
+
readonly isDefault: v.BooleanSchema<undefined>;
|
|
683
|
+
/** The master switch: false holds every pull request for a person. */
|
|
684
|
+
readonly autoMergeEnabled: v.BooleanSchema<undefined>;
|
|
685
|
+
/** How many times the `ci-fixer` may try to turn CI green before giving up. */
|
|
686
|
+
readonly ciMaxAttempts: v.NumberSchema<undefined>;
|
|
687
|
+
/** Workspace roles whose runs this preset forces into dry-run mode. */
|
|
688
|
+
readonly dryRunRoles: v.ArraySchema<v.PicklistSchema<readonly ["admin", "member", "viewer"], undefined>, undefined>;
|
|
689
|
+
/**
|
|
690
|
+
* Workspace roles whose runs may land only the change classes an allowlist names, so a run
|
|
691
|
+
* outside them is held for a person however good its scores are. A role absent from this list is
|
|
692
|
+
* unrestricted; the classes themselves are internal vocabulary and stay off this surface.
|
|
693
|
+
*/
|
|
694
|
+
readonly submissionRestrictedRoles: v.ArraySchema<v.PicklistSchema<readonly ["admin", "member", "viewer"], undefined>, undefined>;
|
|
695
|
+
}, undefined>, undefined>;
|
|
696
|
+
}, undefined>;
|
|
697
|
+
export type PublicMergePresetList = v.InferOutput<typeof publicMergePresetListSchema>;
|
|
698
|
+
//# sourceMappingURL=public-provisioning.d.ts.map
|