@cdwr/fly-node 0.3.0 → 0.3.2
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/CHANGELOG.md +61 -0
- package/LICENSE +21 -0
- package/README.md +129 -1
- package/api.cjs +517 -0
- package/api.js +483 -0
- package/index.cjs +1170 -207
- package/index.js +1157 -202
- package/package.json +7 -2
- package/src/api.d.ts +15 -0
- package/src/index.d.ts +2 -1
- package/src/lib/fly-api.class.d.ts +193 -0
- package/src/lib/fly.class.d.ts +227 -11
- package/src/lib/mocks.d.ts +8 -1
- package/src/lib/schemas/apps-create.schema.d.ts +3 -3
- package/src/lib/schemas/apps-list.schema.d.ts +14 -14
- package/src/lib/schemas/build-response.schema.d.ts +11 -0
- package/src/lib/schemas/certificate.schema.d.ts +392 -0
- package/src/lib/schemas/ips-list.schema.d.ts +75 -0
- package/src/lib/schemas/machine.schema.d.ts +44 -0
- package/src/lib/schemas/postgres-list.d.ts +9 -9
- package/src/lib/schemas/status-extended.schema.d.ts +123 -21
- package/src/lib/schemas/status.schema.d.ts +229 -37
- package/src/lib/types.d.ts +101 -2
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* A certificate as the Fly GraphQL API returns it.
|
|
4
|
+
*
|
|
5
|
+
* Field names are Fly's own, verbatim — `isConfigured` rather than a friendlier
|
|
6
|
+
* `configured` — so anything read here can be cross-referenced against Fly's
|
|
7
|
+
* schema without a translation step. The CLI schemas in this package normalise
|
|
8
|
+
* CLI output instead; where the two overlap (`hostname`, `clientStatus`,
|
|
9
|
+
* `createdAt`) they agree.
|
|
10
|
+
*
|
|
11
|
+
* Strict about the fields a caller acts on and tolerant about the rest: Fly
|
|
12
|
+
* owns this schema, and a domains screen should not stop rendering because a
|
|
13
|
+
* peripheral field changed shape.
|
|
14
|
+
*/
|
|
15
|
+
export declare const CertificateApiResponseSchema: z.ZodObject<{
|
|
16
|
+
hostname: z.ZodString;
|
|
17
|
+
/** Issued and serving. This is what decides whether a domain is usable */
|
|
18
|
+
isConfigured: z.ZodBoolean;
|
|
19
|
+
id: z.ZodOptional<z.ZodString>;
|
|
20
|
+
/** The apex or a subdomain — apex domains cannot use a CNAME */
|
|
21
|
+
isApex: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
isWildcard: z.ZodOptional<z.ZodBoolean>;
|
|
23
|
+
/** Which ACME challenge has been satisfied, if any */
|
|
24
|
+
isAcmeDnsConfigured: z.ZodOptional<z.ZodBoolean>;
|
|
25
|
+
isAcmeAlpnConfigured: z.ZodOptional<z.ZodBoolean>;
|
|
26
|
+
isAcmeHttpConfigured: z.ZodOptional<z.ZodBoolean>;
|
|
27
|
+
certificateAuthority: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
28
|
+
certificateRequestedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
29
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
30
|
+
domain: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
31
|
+
dnsProvider: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
32
|
+
/** Hostname the validation record must be created on */
|
|
33
|
+
dnsValidationHostname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
34
|
+
/** Value that record must contain */
|
|
35
|
+
dnsValidationTarget: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
36
|
+
/** Fly's own prose describing the records to create */
|
|
37
|
+
dnsValidationInstructions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
38
|
+
/** Fly's summary of where issuance has got to */
|
|
39
|
+
clientStatus: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
40
|
+
/**
|
|
41
|
+
* Set when Let's Encrypt has rate-limited further attempts for this domain.
|
|
42
|
+
*
|
|
43
|
+
* Worth surfacing rather than swallowing: it is the one failure a customer
|
|
44
|
+
* cannot fix by correcting DNS, and retrying only makes it worse.
|
|
45
|
+
*/
|
|
46
|
+
rateLimitedUntil: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
47
|
+
source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
48
|
+
/**
|
|
49
|
+
* Fly's own prose for a failed issuance attempt — what the dashboard shows,
|
|
50
|
+
* unlike `HostnameCheck.errors`, which is SCREAMING_SNAKE_CASE codes
|
|
51
|
+
*/
|
|
52
|
+
validationErrors: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
53
|
+
message: z.ZodString;
|
|
54
|
+
timestamp: z.ZodString;
|
|
55
|
+
}, "strip", z.ZodTypeAny, {
|
|
56
|
+
message: string;
|
|
57
|
+
timestamp: string;
|
|
58
|
+
}, {
|
|
59
|
+
message: string;
|
|
60
|
+
timestamp: string;
|
|
61
|
+
}>, "many">>>;
|
|
62
|
+
/**
|
|
63
|
+
* The certificates actually issued for this hostname, once any have been.
|
|
64
|
+
*
|
|
65
|
+
* A connection rather than a list because that is how Fly models it. Two
|
|
66
|
+
* nodes is the normal count — one RSA and one ECDSA — sharing an expiry,
|
|
67
|
+
* which is why a caller usually wants the expiry rather than the rows.
|
|
68
|
+
*/
|
|
69
|
+
issued: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
70
|
+
nodes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
71
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
72
|
+
/** Key type, e.g. `RSA` or `ECDSA` */
|
|
73
|
+
type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
74
|
+
hostname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
75
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
76
|
+
}, "strip", z.ZodTypeAny, {
|
|
77
|
+
hostname?: string | null | undefined;
|
|
78
|
+
id?: string | null | undefined;
|
|
79
|
+
type?: string | null | undefined;
|
|
80
|
+
expiresAt?: string | null | undefined;
|
|
81
|
+
}, {
|
|
82
|
+
hostname?: string | null | undefined;
|
|
83
|
+
id?: string | null | undefined;
|
|
84
|
+
type?: string | null | undefined;
|
|
85
|
+
expiresAt?: string | null | undefined;
|
|
86
|
+
}>, "many">>>;
|
|
87
|
+
}, "strip", z.ZodTypeAny, {
|
|
88
|
+
nodes?: {
|
|
89
|
+
hostname?: string | null | undefined;
|
|
90
|
+
id?: string | null | undefined;
|
|
91
|
+
type?: string | null | undefined;
|
|
92
|
+
expiresAt?: string | null | undefined;
|
|
93
|
+
}[] | null | undefined;
|
|
94
|
+
}, {
|
|
95
|
+
nodes?: {
|
|
96
|
+
hostname?: string | null | undefined;
|
|
97
|
+
id?: string | null | undefined;
|
|
98
|
+
type?: string | null | undefined;
|
|
99
|
+
expiresAt?: string | null | undefined;
|
|
100
|
+
}[] | null | undefined;
|
|
101
|
+
}>>>;
|
|
102
|
+
}, "strip", z.ZodTypeAny, {
|
|
103
|
+
hostname: string;
|
|
104
|
+
isConfigured: boolean;
|
|
105
|
+
id?: string | undefined;
|
|
106
|
+
isApex?: boolean | undefined;
|
|
107
|
+
isWildcard?: boolean | undefined;
|
|
108
|
+
isAcmeDnsConfigured?: boolean | undefined;
|
|
109
|
+
isAcmeAlpnConfigured?: boolean | undefined;
|
|
110
|
+
isAcmeHttpConfigured?: boolean | undefined;
|
|
111
|
+
certificateAuthority?: string | null | undefined;
|
|
112
|
+
certificateRequestedAt?: string | null | undefined;
|
|
113
|
+
createdAt?: string | null | undefined;
|
|
114
|
+
domain?: string | null | undefined;
|
|
115
|
+
dnsProvider?: string | null | undefined;
|
|
116
|
+
dnsValidationHostname?: string | null | undefined;
|
|
117
|
+
dnsValidationTarget?: string | null | undefined;
|
|
118
|
+
dnsValidationInstructions?: string | null | undefined;
|
|
119
|
+
clientStatus?: string | null | undefined;
|
|
120
|
+
rateLimitedUntil?: string | null | undefined;
|
|
121
|
+
source?: string | null | undefined;
|
|
122
|
+
validationErrors?: {
|
|
123
|
+
message: string;
|
|
124
|
+
timestamp: string;
|
|
125
|
+
}[] | null | undefined;
|
|
126
|
+
issued?: {
|
|
127
|
+
nodes?: {
|
|
128
|
+
hostname?: string | null | undefined;
|
|
129
|
+
id?: string | null | undefined;
|
|
130
|
+
type?: string | null | undefined;
|
|
131
|
+
expiresAt?: string | null | undefined;
|
|
132
|
+
}[] | null | undefined;
|
|
133
|
+
} | null | undefined;
|
|
134
|
+
}, {
|
|
135
|
+
hostname: string;
|
|
136
|
+
isConfigured: boolean;
|
|
137
|
+
id?: string | undefined;
|
|
138
|
+
isApex?: boolean | undefined;
|
|
139
|
+
isWildcard?: boolean | undefined;
|
|
140
|
+
isAcmeDnsConfigured?: boolean | undefined;
|
|
141
|
+
isAcmeAlpnConfigured?: boolean | undefined;
|
|
142
|
+
isAcmeHttpConfigured?: boolean | undefined;
|
|
143
|
+
certificateAuthority?: string | null | undefined;
|
|
144
|
+
certificateRequestedAt?: string | null | undefined;
|
|
145
|
+
createdAt?: string | null | undefined;
|
|
146
|
+
domain?: string | null | undefined;
|
|
147
|
+
dnsProvider?: string | null | undefined;
|
|
148
|
+
dnsValidationHostname?: string | null | undefined;
|
|
149
|
+
dnsValidationTarget?: string | null | undefined;
|
|
150
|
+
dnsValidationInstructions?: string | null | undefined;
|
|
151
|
+
clientStatus?: string | null | undefined;
|
|
152
|
+
rateLimitedUntil?: string | null | undefined;
|
|
153
|
+
source?: string | null | undefined;
|
|
154
|
+
validationErrors?: {
|
|
155
|
+
message: string;
|
|
156
|
+
timestamp: string;
|
|
157
|
+
}[] | null | undefined;
|
|
158
|
+
issued?: {
|
|
159
|
+
nodes?: {
|
|
160
|
+
hostname?: string | null | undefined;
|
|
161
|
+
id?: string | null | undefined;
|
|
162
|
+
type?: string | null | undefined;
|
|
163
|
+
expiresAt?: string | null | undefined;
|
|
164
|
+
}[] | null | undefined;
|
|
165
|
+
} | null | undefined;
|
|
166
|
+
}>;
|
|
167
|
+
export type Certificate = z.infer<typeof CertificateApiResponseSchema>;
|
|
168
|
+
/**
|
|
169
|
+
* What Fly sees when it resolves the hostname right now.
|
|
170
|
+
*
|
|
171
|
+
* Returned alongside a newly requested certificate. This is live DNS
|
|
172
|
+
* resolution rather than stored state, which is what makes it the right thing
|
|
173
|
+
* to show someone who has just edited their records and wants to know whether
|
|
174
|
+
* it worked.
|
|
175
|
+
*/
|
|
176
|
+
export declare const HostnameCheckApiResponseSchema: z.ZodObject<{
|
|
177
|
+
aRecords: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
178
|
+
aaaaRecords: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
179
|
+
cnameRecords: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
180
|
+
caaRecords: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
181
|
+
soa: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
182
|
+
dnsProvider: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
183
|
+
dnsVerificationRecord: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
184
|
+
dnsConfigured: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
185
|
+
acmeDnsConfigured: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
186
|
+
resolvedAddresses: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
187
|
+
isProxied: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
188
|
+
errors: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
189
|
+
}, "strip", z.ZodTypeAny, {
|
|
190
|
+
dnsProvider?: string | null | undefined;
|
|
191
|
+
aRecords?: string[] | null | undefined;
|
|
192
|
+
aaaaRecords?: string[] | null | undefined;
|
|
193
|
+
cnameRecords?: string[] | null | undefined;
|
|
194
|
+
caaRecords?: string[] | null | undefined;
|
|
195
|
+
soa?: string | null | undefined;
|
|
196
|
+
dnsVerificationRecord?: string | null | undefined;
|
|
197
|
+
dnsConfigured?: boolean | null | undefined;
|
|
198
|
+
acmeDnsConfigured?: boolean | null | undefined;
|
|
199
|
+
resolvedAddresses?: string[] | null | undefined;
|
|
200
|
+
isProxied?: boolean | null | undefined;
|
|
201
|
+
errors?: string[] | null | undefined;
|
|
202
|
+
}, {
|
|
203
|
+
dnsProvider?: string | null | undefined;
|
|
204
|
+
aRecords?: string[] | null | undefined;
|
|
205
|
+
aaaaRecords?: string[] | null | undefined;
|
|
206
|
+
cnameRecords?: string[] | null | undefined;
|
|
207
|
+
caaRecords?: string[] | null | undefined;
|
|
208
|
+
soa?: string | null | undefined;
|
|
209
|
+
dnsVerificationRecord?: string | null | undefined;
|
|
210
|
+
dnsConfigured?: boolean | null | undefined;
|
|
211
|
+
acmeDnsConfigured?: boolean | null | undefined;
|
|
212
|
+
resolvedAddresses?: string[] | null | undefined;
|
|
213
|
+
isProxied?: boolean | null | undefined;
|
|
214
|
+
errors?: string[] | null | undefined;
|
|
215
|
+
}>;
|
|
216
|
+
export type HostnameCheck = z.infer<typeof HostnameCheckApiResponseSchema>;
|
|
217
|
+
/**
|
|
218
|
+
* The records a customer has to create, extracted from a certificate.
|
|
219
|
+
*
|
|
220
|
+
* `isApex` matters here: an apex domain cannot be pointed with a CNAME, so the
|
|
221
|
+
* instructions differ, and a UI needs to know which case it is showing.
|
|
222
|
+
*/
|
|
223
|
+
export declare const DnsInstructionsSchema: z.ZodObject<{
|
|
224
|
+
hostname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
225
|
+
target: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
226
|
+
instructions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
227
|
+
isApex: z.ZodOptional<z.ZodBoolean>;
|
|
228
|
+
}, "strip", z.ZodTypeAny, {
|
|
229
|
+
hostname?: string | null | undefined;
|
|
230
|
+
isApex?: boolean | undefined;
|
|
231
|
+
target?: string | null | undefined;
|
|
232
|
+
instructions?: string | null | undefined;
|
|
233
|
+
}, {
|
|
234
|
+
hostname?: string | null | undefined;
|
|
235
|
+
isApex?: boolean | undefined;
|
|
236
|
+
target?: string | null | undefined;
|
|
237
|
+
instructions?: string | null | undefined;
|
|
238
|
+
}>;
|
|
239
|
+
export type DnsInstructions = z.infer<typeof DnsInstructionsSchema>;
|
|
240
|
+
/** Certificates listed for an app */
|
|
241
|
+
export declare const CertificateListApiResponseSchema: z.ZodArray<z.ZodObject<{
|
|
242
|
+
hostname: z.ZodString;
|
|
243
|
+
/** Issued and serving. This is what decides whether a domain is usable */
|
|
244
|
+
isConfigured: z.ZodBoolean;
|
|
245
|
+
id: z.ZodOptional<z.ZodString>;
|
|
246
|
+
/** The apex or a subdomain — apex domains cannot use a CNAME */
|
|
247
|
+
isApex: z.ZodOptional<z.ZodBoolean>;
|
|
248
|
+
isWildcard: z.ZodOptional<z.ZodBoolean>;
|
|
249
|
+
/** Which ACME challenge has been satisfied, if any */
|
|
250
|
+
isAcmeDnsConfigured: z.ZodOptional<z.ZodBoolean>;
|
|
251
|
+
isAcmeAlpnConfigured: z.ZodOptional<z.ZodBoolean>;
|
|
252
|
+
isAcmeHttpConfigured: z.ZodOptional<z.ZodBoolean>;
|
|
253
|
+
certificateAuthority: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
254
|
+
certificateRequestedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
255
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
256
|
+
domain: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
257
|
+
dnsProvider: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
258
|
+
/** Hostname the validation record must be created on */
|
|
259
|
+
dnsValidationHostname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
260
|
+
/** Value that record must contain */
|
|
261
|
+
dnsValidationTarget: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
262
|
+
/** Fly's own prose describing the records to create */
|
|
263
|
+
dnsValidationInstructions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
264
|
+
/** Fly's summary of where issuance has got to */
|
|
265
|
+
clientStatus: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
266
|
+
/**
|
|
267
|
+
* Set when Let's Encrypt has rate-limited further attempts for this domain.
|
|
268
|
+
*
|
|
269
|
+
* Worth surfacing rather than swallowing: it is the one failure a customer
|
|
270
|
+
* cannot fix by correcting DNS, and retrying only makes it worse.
|
|
271
|
+
*/
|
|
272
|
+
rateLimitedUntil: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
273
|
+
source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
274
|
+
/**
|
|
275
|
+
* Fly's own prose for a failed issuance attempt — what the dashboard shows,
|
|
276
|
+
* unlike `HostnameCheck.errors`, which is SCREAMING_SNAKE_CASE codes
|
|
277
|
+
*/
|
|
278
|
+
validationErrors: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
279
|
+
message: z.ZodString;
|
|
280
|
+
timestamp: z.ZodString;
|
|
281
|
+
}, "strip", z.ZodTypeAny, {
|
|
282
|
+
message: string;
|
|
283
|
+
timestamp: string;
|
|
284
|
+
}, {
|
|
285
|
+
message: string;
|
|
286
|
+
timestamp: string;
|
|
287
|
+
}>, "many">>>;
|
|
288
|
+
/**
|
|
289
|
+
* The certificates actually issued for this hostname, once any have been.
|
|
290
|
+
*
|
|
291
|
+
* A connection rather than a list because that is how Fly models it. Two
|
|
292
|
+
* nodes is the normal count — one RSA and one ECDSA — sharing an expiry,
|
|
293
|
+
* which is why a caller usually wants the expiry rather than the rows.
|
|
294
|
+
*/
|
|
295
|
+
issued: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
296
|
+
nodes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
297
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
298
|
+
/** Key type, e.g. `RSA` or `ECDSA` */
|
|
299
|
+
type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
300
|
+
hostname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
301
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
302
|
+
}, "strip", z.ZodTypeAny, {
|
|
303
|
+
hostname?: string | null | undefined;
|
|
304
|
+
id?: string | null | undefined;
|
|
305
|
+
type?: string | null | undefined;
|
|
306
|
+
expiresAt?: string | null | undefined;
|
|
307
|
+
}, {
|
|
308
|
+
hostname?: string | null | undefined;
|
|
309
|
+
id?: string | null | undefined;
|
|
310
|
+
type?: string | null | undefined;
|
|
311
|
+
expiresAt?: string | null | undefined;
|
|
312
|
+
}>, "many">>>;
|
|
313
|
+
}, "strip", z.ZodTypeAny, {
|
|
314
|
+
nodes?: {
|
|
315
|
+
hostname?: string | null | undefined;
|
|
316
|
+
id?: string | null | undefined;
|
|
317
|
+
type?: string | null | undefined;
|
|
318
|
+
expiresAt?: string | null | undefined;
|
|
319
|
+
}[] | null | undefined;
|
|
320
|
+
}, {
|
|
321
|
+
nodes?: {
|
|
322
|
+
hostname?: string | null | undefined;
|
|
323
|
+
id?: string | null | undefined;
|
|
324
|
+
type?: string | null | undefined;
|
|
325
|
+
expiresAt?: string | null | undefined;
|
|
326
|
+
}[] | null | undefined;
|
|
327
|
+
}>>>;
|
|
328
|
+
}, "strip", z.ZodTypeAny, {
|
|
329
|
+
hostname: string;
|
|
330
|
+
isConfigured: boolean;
|
|
331
|
+
id?: string | undefined;
|
|
332
|
+
isApex?: boolean | undefined;
|
|
333
|
+
isWildcard?: boolean | undefined;
|
|
334
|
+
isAcmeDnsConfigured?: boolean | undefined;
|
|
335
|
+
isAcmeAlpnConfigured?: boolean | undefined;
|
|
336
|
+
isAcmeHttpConfigured?: boolean | undefined;
|
|
337
|
+
certificateAuthority?: string | null | undefined;
|
|
338
|
+
certificateRequestedAt?: string | null | undefined;
|
|
339
|
+
createdAt?: string | null | undefined;
|
|
340
|
+
domain?: string | null | undefined;
|
|
341
|
+
dnsProvider?: string | null | undefined;
|
|
342
|
+
dnsValidationHostname?: string | null | undefined;
|
|
343
|
+
dnsValidationTarget?: string | null | undefined;
|
|
344
|
+
dnsValidationInstructions?: string | null | undefined;
|
|
345
|
+
clientStatus?: string | null | undefined;
|
|
346
|
+
rateLimitedUntil?: string | null | undefined;
|
|
347
|
+
source?: string | null | undefined;
|
|
348
|
+
validationErrors?: {
|
|
349
|
+
message: string;
|
|
350
|
+
timestamp: string;
|
|
351
|
+
}[] | null | undefined;
|
|
352
|
+
issued?: {
|
|
353
|
+
nodes?: {
|
|
354
|
+
hostname?: string | null | undefined;
|
|
355
|
+
id?: string | null | undefined;
|
|
356
|
+
type?: string | null | undefined;
|
|
357
|
+
expiresAt?: string | null | undefined;
|
|
358
|
+
}[] | null | undefined;
|
|
359
|
+
} | null | undefined;
|
|
360
|
+
}, {
|
|
361
|
+
hostname: string;
|
|
362
|
+
isConfigured: boolean;
|
|
363
|
+
id?: string | undefined;
|
|
364
|
+
isApex?: boolean | undefined;
|
|
365
|
+
isWildcard?: boolean | undefined;
|
|
366
|
+
isAcmeDnsConfigured?: boolean | undefined;
|
|
367
|
+
isAcmeAlpnConfigured?: boolean | undefined;
|
|
368
|
+
isAcmeHttpConfigured?: boolean | undefined;
|
|
369
|
+
certificateAuthority?: string | null | undefined;
|
|
370
|
+
certificateRequestedAt?: string | null | undefined;
|
|
371
|
+
createdAt?: string | null | undefined;
|
|
372
|
+
domain?: string | null | undefined;
|
|
373
|
+
dnsProvider?: string | null | undefined;
|
|
374
|
+
dnsValidationHostname?: string | null | undefined;
|
|
375
|
+
dnsValidationTarget?: string | null | undefined;
|
|
376
|
+
dnsValidationInstructions?: string | null | undefined;
|
|
377
|
+
clientStatus?: string | null | undefined;
|
|
378
|
+
rateLimitedUntil?: string | null | undefined;
|
|
379
|
+
source?: string | null | undefined;
|
|
380
|
+
validationErrors?: {
|
|
381
|
+
message: string;
|
|
382
|
+
timestamp: string;
|
|
383
|
+
}[] | null | undefined;
|
|
384
|
+
issued?: {
|
|
385
|
+
nodes?: {
|
|
386
|
+
hostname?: string | null | undefined;
|
|
387
|
+
id?: string | null | undefined;
|
|
388
|
+
type?: string | null | undefined;
|
|
389
|
+
expiresAt?: string | null | undefined;
|
|
390
|
+
}[] | null | undefined;
|
|
391
|
+
} | null | undefined;
|
|
392
|
+
}>, "many">;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The kinds of public address an app can hold.
|
|
4
|
+
*
|
|
5
|
+
* `shared_v4` is the free one every app with an `http_service` needs; a
|
|
6
|
+
* dedicated `v4` is billed. `v6` is dedicated and free.
|
|
7
|
+
*
|
|
8
|
+
* Kept open with a string union so an address type added upstream reads as
|
|
9
|
+
* itself rather than failing the whole list.
|
|
10
|
+
*/
|
|
11
|
+
export declare const IpTypeSchema: z.ZodUnion<[z.ZodEnum<["v4", "v6", "shared_v4", "private_v6"]>, z.ZodString]>;
|
|
12
|
+
/**
|
|
13
|
+
* Fly ips list response element schema
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* fly ips list --app [name] --json
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* Fly answers in PascalCase (`ID`, `Address`, …), which `withCamelCase`
|
|
20
|
+
* rewrites before validation — so the keys here are the transformed ones.
|
|
21
|
+
*
|
|
22
|
+
* A shared v4 carries an empty `region` and a zero `createdAt`, so neither can
|
|
23
|
+
* be treated as a datetime.
|
|
24
|
+
*/
|
|
25
|
+
export declare const IpsListFlyResponseElementSchema: z.ZodObject<{
|
|
26
|
+
id: z.ZodString;
|
|
27
|
+
address: z.ZodString;
|
|
28
|
+
type: z.ZodUnion<[z.ZodEnum<["v4", "v6", "shared_v4", "private_v6"]>, z.ZodString]>;
|
|
29
|
+
region: z.ZodString;
|
|
30
|
+
createdAt: z.ZodString;
|
|
31
|
+
}, "strip", z.ZodTypeAny, {
|
|
32
|
+
id: string;
|
|
33
|
+
createdAt: string;
|
|
34
|
+
type: string;
|
|
35
|
+
region: string;
|
|
36
|
+
address: string;
|
|
37
|
+
}, {
|
|
38
|
+
id: string;
|
|
39
|
+
createdAt: string;
|
|
40
|
+
type: string;
|
|
41
|
+
region: string;
|
|
42
|
+
address: string;
|
|
43
|
+
}>;
|
|
44
|
+
/**
|
|
45
|
+
* Transformed ips list response schema
|
|
46
|
+
*
|
|
47
|
+
* ```ts
|
|
48
|
+
* fly ips list --app [name] --json
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export declare const IpsListTransformedResponseSchema: z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
52
|
+
id: z.ZodString;
|
|
53
|
+
address: z.ZodString;
|
|
54
|
+
type: z.ZodUnion<[z.ZodEnum<["v4", "v6", "shared_v4", "private_v6"]>, z.ZodString]>;
|
|
55
|
+
region: z.ZodString;
|
|
56
|
+
createdAt: z.ZodString;
|
|
57
|
+
}, "strip", z.ZodTypeAny, {
|
|
58
|
+
id: string;
|
|
59
|
+
createdAt: string;
|
|
60
|
+
type: string;
|
|
61
|
+
region: string;
|
|
62
|
+
address: string;
|
|
63
|
+
}, {
|
|
64
|
+
id: string;
|
|
65
|
+
createdAt: string;
|
|
66
|
+
type: string;
|
|
67
|
+
region: string;
|
|
68
|
+
address: string;
|
|
69
|
+
}>, {
|
|
70
|
+
id: string;
|
|
71
|
+
createdAt: string;
|
|
72
|
+
type: string;
|
|
73
|
+
region: string;
|
|
74
|
+
address: string;
|
|
75
|
+
}, unknown>, "many">;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* A machine as the Fly Machines API returns it.
|
|
4
|
+
*
|
|
5
|
+
* Field names are Fly's own, and only `id` is required — it is the one thing a
|
|
6
|
+
* caller acts on. Everything else is context for a log line or a panel, and a
|
|
7
|
+
* restart should not fail because Fly added a state nobody has seen yet.
|
|
8
|
+
*/
|
|
9
|
+
export declare const MachineApiResponseSchema: z.ZodObject<{
|
|
10
|
+
id: z.ZodString;
|
|
11
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
12
|
+
/** `started`, `stopped`, `suspended`, … — Fly owns this vocabulary */
|
|
13
|
+
state: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
14
|
+
region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
id: string;
|
|
17
|
+
name?: string | null | undefined;
|
|
18
|
+
state?: string | null | undefined;
|
|
19
|
+
region?: string | null | undefined;
|
|
20
|
+
}, {
|
|
21
|
+
id: string;
|
|
22
|
+
name?: string | null | undefined;
|
|
23
|
+
state?: string | null | undefined;
|
|
24
|
+
region?: string | null | undefined;
|
|
25
|
+
}>;
|
|
26
|
+
export type Machine = z.infer<typeof MachineApiResponseSchema>;
|
|
27
|
+
/** Machines listed for an app */
|
|
28
|
+
export declare const MachineListApiResponseSchema: z.ZodArray<z.ZodObject<{
|
|
29
|
+
id: z.ZodString;
|
|
30
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
31
|
+
/** `started`, `stopped`, `suspended`, … — Fly owns this vocabulary */
|
|
32
|
+
state: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
33
|
+
region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
id: string;
|
|
36
|
+
name?: string | null | undefined;
|
|
37
|
+
state?: string | null | undefined;
|
|
38
|
+
region?: string | null | undefined;
|
|
39
|
+
}, {
|
|
40
|
+
id: string;
|
|
41
|
+
name?: string | null | undefined;
|
|
42
|
+
state?: string | null | undefined;
|
|
43
|
+
region?: string | null | undefined;
|
|
44
|
+
}>, "many">;
|
|
@@ -27,33 +27,33 @@ export declare const PostgresListTransformedResponseSchema: z.ZodUnion<[z.ZodArr
|
|
|
27
27
|
status: z.ZodString;
|
|
28
28
|
version: z.ZodNumber;
|
|
29
29
|
}, "strip", z.ZodTypeAny, {
|
|
30
|
-
|
|
31
|
-
status: string;
|
|
30
|
+
hostname: string;
|
|
32
31
|
id: string;
|
|
32
|
+
status: string;
|
|
33
|
+
name: string;
|
|
33
34
|
deployed: boolean;
|
|
34
|
-
hostname: string;
|
|
35
35
|
organization: {
|
|
36
36
|
id: string;
|
|
37
37
|
slug: string;
|
|
38
38
|
};
|
|
39
39
|
version: number;
|
|
40
40
|
}, {
|
|
41
|
-
|
|
42
|
-
status: string;
|
|
41
|
+
hostname: string;
|
|
43
42
|
id: string;
|
|
43
|
+
status: string;
|
|
44
|
+
name: string;
|
|
44
45
|
deployed: boolean;
|
|
45
|
-
hostname: string;
|
|
46
46
|
organization: {
|
|
47
47
|
id: string;
|
|
48
48
|
slug: string;
|
|
49
49
|
};
|
|
50
50
|
version: number;
|
|
51
51
|
}>, {
|
|
52
|
-
|
|
53
|
-
status: string;
|
|
52
|
+
hostname: string;
|
|
54
53
|
id: string;
|
|
54
|
+
status: string;
|
|
55
|
+
name: string;
|
|
55
56
|
deployed: boolean;
|
|
56
|
-
hostname: string;
|
|
57
57
|
organization: {
|
|
58
58
|
id: string;
|
|
59
59
|
slug: string;
|