@cdwr/fly-node 0.3.0 → 0.3.1

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.
@@ -15,17 +15,59 @@ export declare const statusFlyResponseSchema: z.ZodObject<{
15
15
  name: z.ZodString;
16
16
  state: z.ZodString;
17
17
  region: z.ZodString;
18
+ imageRef: z.ZodObject<{
19
+ registry: z.ZodString;
20
+ repository: z.ZodString;
21
+ tag: z.ZodString;
22
+ digest: z.ZodString;
23
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
24
+ }, "strip", z.ZodTypeAny, {
25
+ tag: string;
26
+ digest: string;
27
+ registry: string;
28
+ repository: string;
29
+ labels?: Record<string, string> | undefined;
30
+ }, {
31
+ tag: string;
32
+ digest: string;
33
+ registry: string;
34
+ repository: string;
35
+ labels?: Record<string, string> | undefined;
36
+ }>;
18
37
  createdAt: z.ZodString;
19
38
  updatedAt: z.ZodString;
20
39
  config: z.ZodObject<{
21
40
  env: z.ZodRecord<z.ZodString, z.ZodString>;
22
41
  metadata: z.ZodRecord<z.ZodString, z.ZodString>;
42
+ guest: z.ZodOptional<z.ZodObject<{
43
+ cpu_kind: z.ZodOptional<z.ZodString>;
44
+ cpus: z.ZodOptional<z.ZodNumber>;
45
+ memory_mb: z.ZodOptional<z.ZodNumber>;
46
+ }, "strip", z.ZodTypeAny, {
47
+ cpu_kind?: string | undefined;
48
+ cpus?: number | undefined;
49
+ memory_mb?: number | undefined;
50
+ }, {
51
+ cpu_kind?: string | undefined;
52
+ cpus?: number | undefined;
53
+ memory_mb?: number | undefined;
54
+ }>>;
23
55
  }, "strip", z.ZodTypeAny, {
24
56
  env: Record<string, string>;
25
57
  metadata: Record<string, string>;
58
+ guest?: {
59
+ cpu_kind?: string | undefined;
60
+ cpus?: number | undefined;
61
+ memory_mb?: number | undefined;
62
+ } | undefined;
26
63
  }, {
27
64
  env: Record<string, string>;
28
65
  metadata: Record<string, string>;
66
+ guest?: {
67
+ cpu_kind?: string | undefined;
68
+ cpus?: number | undefined;
69
+ memory_mb?: number | undefined;
70
+ } | undefined;
29
71
  }>;
30
72
  events: z.ZodArray<z.ZodObject<{
31
73
  type: z.ZodString;
@@ -46,27 +88,39 @@ export declare const statusFlyResponseSchema: z.ZodObject<{
46
88
  output: z.ZodString;
47
89
  updatedAt: z.ZodString;
48
90
  }, "strip", z.ZodTypeAny, {
49
- name: string;
50
91
  status: string;
92
+ name: string;
51
93
  updatedAt: string;
52
94
  output: string;
53
95
  }, {
54
- name: string;
55
96
  status: string;
97
+ name: string;
56
98
  updatedAt: string;
57
99
  output: string;
58
100
  }>, "many">>;
59
101
  hostStatus: z.ZodString;
60
102
  }, "strip", z.ZodTypeAny, {
61
- name: string;
62
103
  id: string;
63
104
  createdAt: string;
105
+ name: string;
64
106
  state: string;
65
107
  region: string;
108
+ imageRef: {
109
+ tag: string;
110
+ digest: string;
111
+ registry: string;
112
+ repository: string;
113
+ labels?: Record<string, string> | undefined;
114
+ };
66
115
  updatedAt: string;
67
116
  config: {
68
117
  env: Record<string, string>;
69
118
  metadata: Record<string, string>;
119
+ guest?: {
120
+ cpu_kind?: string | undefined;
121
+ cpus?: number | undefined;
122
+ memory_mb?: number | undefined;
123
+ } | undefined;
70
124
  };
71
125
  events: {
72
126
  type: string;
@@ -75,21 +129,33 @@ export declare const statusFlyResponseSchema: z.ZodObject<{
75
129
  }[];
76
130
  hostStatus: string;
77
131
  checks?: {
78
- name: string;
79
132
  status: string;
133
+ name: string;
80
134
  updatedAt: string;
81
135
  output: string;
82
136
  }[] | undefined;
83
137
  }, {
84
- name: string;
85
138
  id: string;
86
139
  createdAt: string;
140
+ name: string;
87
141
  state: string;
88
142
  region: string;
143
+ imageRef: {
144
+ tag: string;
145
+ digest: string;
146
+ registry: string;
147
+ repository: string;
148
+ labels?: Record<string, string> | undefined;
149
+ };
89
150
  updatedAt: string;
90
151
  config: {
91
152
  env: Record<string, string>;
92
153
  metadata: Record<string, string>;
154
+ guest?: {
155
+ cpu_kind?: string | undefined;
156
+ cpus?: number | undefined;
157
+ memory_mb?: number | undefined;
158
+ } | undefined;
93
159
  };
94
160
  events: {
95
161
  type: string;
@@ -98,8 +164,8 @@ export declare const statusFlyResponseSchema: z.ZodObject<{
98
164
  }[];
99
165
  hostStatus: string;
100
166
  checks?: {
101
- name: string;
102
167
  status: string;
168
+ name: string;
103
169
  updatedAt: string;
104
170
  output: string;
105
171
  }[] | undefined;
@@ -118,26 +184,38 @@ export declare const statusFlyResponseSchema: z.ZodObject<{
118
184
  status: z.ZodString;
119
185
  version: z.ZodNumber;
120
186
  }, "strip", z.ZodTypeAny, {
121
- name: string;
122
- status: string;
187
+ hostname: string;
123
188
  id: string;
189
+ status: string;
190
+ name: string;
124
191
  deployed: boolean;
125
- hostname: string;
126
192
  organization: {
127
193
  id: string;
128
194
  slug: string;
129
195
  };
130
196
  version: number;
131
197
  machines: {
132
- name: string;
133
198
  id: string;
134
199
  createdAt: string;
200
+ name: string;
135
201
  state: string;
136
202
  region: string;
203
+ imageRef: {
204
+ tag: string;
205
+ digest: string;
206
+ registry: string;
207
+ repository: string;
208
+ labels?: Record<string, string> | undefined;
209
+ };
137
210
  updatedAt: string;
138
211
  config: {
139
212
  env: Record<string, string>;
140
213
  metadata: Record<string, string>;
214
+ guest?: {
215
+ cpu_kind?: string | undefined;
216
+ cpus?: number | undefined;
217
+ memory_mb?: number | undefined;
218
+ } | undefined;
141
219
  };
142
220
  events: {
143
221
  type: string;
@@ -146,33 +224,45 @@ export declare const statusFlyResponseSchema: z.ZodObject<{
146
224
  }[];
147
225
  hostStatus: string;
148
226
  checks?: {
149
- name: string;
150
227
  status: string;
228
+ name: string;
151
229
  updatedAt: string;
152
230
  output: string;
153
231
  }[] | undefined;
154
232
  }[];
155
233
  }, {
156
- name: string;
157
- status: string;
234
+ hostname: string;
158
235
  id: string;
236
+ status: string;
237
+ name: string;
159
238
  deployed: boolean;
160
- hostname: string;
161
239
  organization: {
162
240
  id: string;
163
241
  slug: string;
164
242
  };
165
243
  version: number;
166
244
  machines: {
167
- name: string;
168
245
  id: string;
169
246
  createdAt: string;
247
+ name: string;
170
248
  state: string;
171
249
  region: string;
250
+ imageRef: {
251
+ tag: string;
252
+ digest: string;
253
+ registry: string;
254
+ repository: string;
255
+ labels?: Record<string, string> | undefined;
256
+ };
172
257
  updatedAt: string;
173
258
  config: {
174
259
  env: Record<string, string>;
175
260
  metadata: Record<string, string>;
261
+ guest?: {
262
+ cpu_kind?: string | undefined;
263
+ cpus?: number | undefined;
264
+ memory_mb?: number | undefined;
265
+ } | undefined;
176
266
  };
177
267
  events: {
178
268
  type: string;
@@ -181,8 +271,8 @@ export declare const statusFlyResponseSchema: z.ZodObject<{
181
271
  }[];
182
272
  hostStatus: string;
183
273
  checks?: {
184
- name: string;
185
274
  status: string;
275
+ name: string;
186
276
  updatedAt: string;
187
277
  output: string;
188
278
  }[] | undefined;
@@ -204,17 +294,59 @@ export declare const StatusTransformedResponseSchema: z.ZodEffects<z.ZodObject<{
204
294
  name: z.ZodString;
205
295
  state: z.ZodString;
206
296
  region: z.ZodString;
297
+ imageRef: z.ZodObject<{
298
+ registry: z.ZodString;
299
+ repository: z.ZodString;
300
+ tag: z.ZodString;
301
+ digest: z.ZodString;
302
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
303
+ }, "strip", z.ZodTypeAny, {
304
+ tag: string;
305
+ digest: string;
306
+ registry: string;
307
+ repository: string;
308
+ labels?: Record<string, string> | undefined;
309
+ }, {
310
+ tag: string;
311
+ digest: string;
312
+ registry: string;
313
+ repository: string;
314
+ labels?: Record<string, string> | undefined;
315
+ }>;
207
316
  createdAt: z.ZodString;
208
317
  updatedAt: z.ZodString;
209
318
  config: z.ZodObject<{
210
319
  env: z.ZodRecord<z.ZodString, z.ZodString>;
211
320
  metadata: z.ZodRecord<z.ZodString, z.ZodString>;
321
+ guest: z.ZodOptional<z.ZodObject<{
322
+ cpu_kind: z.ZodOptional<z.ZodString>;
323
+ cpus: z.ZodOptional<z.ZodNumber>;
324
+ memory_mb: z.ZodOptional<z.ZodNumber>;
325
+ }, "strip", z.ZodTypeAny, {
326
+ cpu_kind?: string | undefined;
327
+ cpus?: number | undefined;
328
+ memory_mb?: number | undefined;
329
+ }, {
330
+ cpu_kind?: string | undefined;
331
+ cpus?: number | undefined;
332
+ memory_mb?: number | undefined;
333
+ }>>;
212
334
  }, "strip", z.ZodTypeAny, {
213
335
  env: Record<string, string>;
214
336
  metadata: Record<string, string>;
337
+ guest?: {
338
+ cpu_kind?: string | undefined;
339
+ cpus?: number | undefined;
340
+ memory_mb?: number | undefined;
341
+ } | undefined;
215
342
  }, {
216
343
  env: Record<string, string>;
217
344
  metadata: Record<string, string>;
345
+ guest?: {
346
+ cpu_kind?: string | undefined;
347
+ cpus?: number | undefined;
348
+ memory_mb?: number | undefined;
349
+ } | undefined;
218
350
  }>;
219
351
  events: z.ZodArray<z.ZodObject<{
220
352
  type: z.ZodString;
@@ -235,27 +367,39 @@ export declare const StatusTransformedResponseSchema: z.ZodEffects<z.ZodObject<{
235
367
  output: z.ZodString;
236
368
  updatedAt: z.ZodString;
237
369
  }, "strip", z.ZodTypeAny, {
238
- name: string;
239
370
  status: string;
371
+ name: string;
240
372
  updatedAt: string;
241
373
  output: string;
242
374
  }, {
243
- name: string;
244
375
  status: string;
376
+ name: string;
245
377
  updatedAt: string;
246
378
  output: string;
247
379
  }>, "many">>;
248
380
  hostStatus: z.ZodString;
249
381
  }, "strip", z.ZodTypeAny, {
250
- name: string;
251
382
  id: string;
252
383
  createdAt: string;
384
+ name: string;
253
385
  state: string;
254
386
  region: string;
387
+ imageRef: {
388
+ tag: string;
389
+ digest: string;
390
+ registry: string;
391
+ repository: string;
392
+ labels?: Record<string, string> | undefined;
393
+ };
255
394
  updatedAt: string;
256
395
  config: {
257
396
  env: Record<string, string>;
258
397
  metadata: Record<string, string>;
398
+ guest?: {
399
+ cpu_kind?: string | undefined;
400
+ cpus?: number | undefined;
401
+ memory_mb?: number | undefined;
402
+ } | undefined;
259
403
  };
260
404
  events: {
261
405
  type: string;
@@ -264,21 +408,33 @@ export declare const StatusTransformedResponseSchema: z.ZodEffects<z.ZodObject<{
264
408
  }[];
265
409
  hostStatus: string;
266
410
  checks?: {
267
- name: string;
268
411
  status: string;
412
+ name: string;
269
413
  updatedAt: string;
270
414
  output: string;
271
415
  }[] | undefined;
272
416
  }, {
273
- name: string;
274
417
  id: string;
275
418
  createdAt: string;
419
+ name: string;
276
420
  state: string;
277
421
  region: string;
422
+ imageRef: {
423
+ tag: string;
424
+ digest: string;
425
+ registry: string;
426
+ repository: string;
427
+ labels?: Record<string, string> | undefined;
428
+ };
278
429
  updatedAt: string;
279
430
  config: {
280
431
  env: Record<string, string>;
281
432
  metadata: Record<string, string>;
433
+ guest?: {
434
+ cpu_kind?: string | undefined;
435
+ cpus?: number | undefined;
436
+ memory_mb?: number | undefined;
437
+ } | undefined;
282
438
  };
283
439
  events: {
284
440
  type: string;
@@ -287,8 +443,8 @@ export declare const StatusTransformedResponseSchema: z.ZodEffects<z.ZodObject<{
287
443
  }[];
288
444
  hostStatus: string;
289
445
  checks?: {
290
- name: string;
291
446
  status: string;
447
+ name: string;
292
448
  updatedAt: string;
293
449
  output: string;
294
450
  }[] | undefined;
@@ -307,26 +463,38 @@ export declare const StatusTransformedResponseSchema: z.ZodEffects<z.ZodObject<{
307
463
  status: z.ZodString;
308
464
  version: z.ZodNumber;
309
465
  }, "strip", z.ZodTypeAny, {
310
- name: string;
311
- status: string;
466
+ hostname: string;
312
467
  id: string;
468
+ status: string;
469
+ name: string;
313
470
  deployed: boolean;
314
- hostname: string;
315
471
  organization: {
316
472
  id: string;
317
473
  slug: string;
318
474
  };
319
475
  version: number;
320
476
  machines: {
321
- name: string;
322
477
  id: string;
323
478
  createdAt: string;
479
+ name: string;
324
480
  state: string;
325
481
  region: string;
482
+ imageRef: {
483
+ tag: string;
484
+ digest: string;
485
+ registry: string;
486
+ repository: string;
487
+ labels?: Record<string, string> | undefined;
488
+ };
326
489
  updatedAt: string;
327
490
  config: {
328
491
  env: Record<string, string>;
329
492
  metadata: Record<string, string>;
493
+ guest?: {
494
+ cpu_kind?: string | undefined;
495
+ cpus?: number | undefined;
496
+ memory_mb?: number | undefined;
497
+ } | undefined;
330
498
  };
331
499
  events: {
332
500
  type: string;
@@ -335,33 +503,45 @@ export declare const StatusTransformedResponseSchema: z.ZodEffects<z.ZodObject<{
335
503
  }[];
336
504
  hostStatus: string;
337
505
  checks?: {
338
- name: string;
339
506
  status: string;
507
+ name: string;
340
508
  updatedAt: string;
341
509
  output: string;
342
510
  }[] | undefined;
343
511
  }[];
344
512
  }, {
345
- name: string;
346
- status: string;
513
+ hostname: string;
347
514
  id: string;
515
+ status: string;
516
+ name: string;
348
517
  deployed: boolean;
349
- hostname: string;
350
518
  organization: {
351
519
  id: string;
352
520
  slug: string;
353
521
  };
354
522
  version: number;
355
523
  machines: {
356
- name: string;
357
524
  id: string;
358
525
  createdAt: string;
526
+ name: string;
359
527
  state: string;
360
528
  region: string;
529
+ imageRef: {
530
+ tag: string;
531
+ digest: string;
532
+ registry: string;
533
+ repository: string;
534
+ labels?: Record<string, string> | undefined;
535
+ };
361
536
  updatedAt: string;
362
537
  config: {
363
538
  env: Record<string, string>;
364
539
  metadata: Record<string, string>;
540
+ guest?: {
541
+ cpu_kind?: string | undefined;
542
+ cpus?: number | undefined;
543
+ memory_mb?: number | undefined;
544
+ } | undefined;
365
545
  };
366
546
  events: {
367
547
  type: string;
@@ -370,33 +550,45 @@ export declare const StatusTransformedResponseSchema: z.ZodEffects<z.ZodObject<{
370
550
  }[];
371
551
  hostStatus: string;
372
552
  checks?: {
373
- name: string;
374
553
  status: string;
554
+ name: string;
375
555
  updatedAt: string;
376
556
  output: string;
377
557
  }[] | undefined;
378
558
  }[];
379
559
  }>, {
380
- name: string;
381
- status: string;
560
+ hostname: string;
382
561
  id: string;
562
+ status: string;
563
+ name: string;
383
564
  deployed: boolean;
384
- hostname: string;
385
565
  organization: {
386
566
  id: string;
387
567
  slug: string;
388
568
  };
389
569
  version: number;
390
570
  machines: {
391
- name: string;
392
571
  id: string;
393
572
  createdAt: string;
573
+ name: string;
394
574
  state: string;
395
575
  region: string;
576
+ imageRef: {
577
+ tag: string;
578
+ digest: string;
579
+ registry: string;
580
+ repository: string;
581
+ labels?: Record<string, string> | undefined;
582
+ };
396
583
  updatedAt: string;
397
584
  config: {
398
585
  env: Record<string, string>;
399
586
  metadata: Record<string, string>;
587
+ guest?: {
588
+ cpu_kind?: string | undefined;
589
+ cpus?: number | undefined;
590
+ memory_mb?: number | undefined;
591
+ } | undefined;
400
592
  };
401
593
  events: {
402
594
  type: string;
@@ -405,8 +597,8 @@ export declare const StatusTransformedResponseSchema: z.ZodEffects<z.ZodObject<{
405
597
  }[];
406
598
  hostStatus: string;
407
599
  checks?: {
408
- name: string;
409
600
  status: string;
601
+ name: string;
410
602
  updatedAt: string;
411
603
  output: string;
412
604
  }[] | undefined;
@@ -1,6 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { AppsCreateTransformedResponseSchema } from './schemas/apps-create.schema';
3
3
  import { AppsListTransformedResponseSchema } from './schemas/apps-list.schema';
4
+ import { BuildResponseSchema } from './schemas/build-response.schema';
4
5
  import { CertsListWithAppTransformedResponseSchema } from './schemas/certs-list-with-app.schema';
5
6
  import { CertsListTransformedResponseSchema } from './schemas/certs-list.schema';
6
7
  import { ConfigShowResponseSchema } from './schemas/config-show.schema';
@@ -15,6 +16,8 @@ import { VersionTransformedResponseSchema } from './schemas/version.schema';
15
16
  export type ListAppResponse = z.infer<typeof AppsListTransformedResponseSchema>;
16
17
  /** Create an application */
17
18
  export type CreateAppResponse = z.infer<typeof AppsCreateTransformedResponseSchema>;
19
+ /** Build application image response */
20
+ export type BuildResponse = z.infer<typeof BuildResponseSchema>;
18
21
  /** Deploy application response */
19
22
  export type DeployResponse = z.infer<typeof DeployResponseSchema>;
20
23
  /** List certificates for an application */
@@ -142,6 +145,13 @@ export type DeployAppOptions = {
142
145
  * Spaces are supported in values.
143
146
  */
144
147
  env?: Record<string, string>;
148
+ /**
149
+ * Build arguments to pass to the Docker build.
150
+ *
151
+ * These are available during the build phase (e.g. NEXT_PUBLIC_ vars, etc.).
152
+ * Use `env` for runtime environment variables instead.
153
+ */
154
+ buildArgs?: Record<string, string>;
145
155
  /**
146
156
  * Target environment for the application.
147
157
  *
@@ -164,6 +174,13 @@ export type DeployAppOptions = {
164
174
  * Connection details will be provided via environment variable `DATABASE_URL`.
165
175
  */
166
176
  postgres?: string;
177
+ /**
178
+ * Database name to use when attaching to Postgres.
179
+ *
180
+ * If not specified, Fly will create a database with a default name.
181
+ * Use this to ensure multiple apps share the same database.
182
+ */
183
+ databaseName?: string;
167
184
  /**
168
185
  * Target region for the application.
169
186
  *
@@ -176,6 +193,28 @@ export type DeployAppOptions = {
176
193
  * Spaces are supported in values.
177
194
  */
178
195
  secrets?: Record<string, string>;
196
+ /**
197
+ * Docker image to use for deployment.
198
+ *
199
+ * This allows deploying with an existing image instead of rebuilding.
200
+ * Useful for config-only updates where you want to reuse the current image.
201
+ *
202
+ * Format: Can be either a full image reference (e.g., `registry.fly.io/app:tag`)
203
+ * or just the image tag from the registry (the shorthand will be expanded to the full reference).
204
+ *
205
+ * When provided, the build phase is skipped and the deployment uses the specified image.
206
+ */
207
+ image?: string;
208
+ /**
209
+ * Build the image and push it to the registry without deploying.
210
+ *
211
+ * Use this to separate the build phase from the deploy phase.
212
+ * The image reference is returned and can be passed to a subsequent
213
+ * deploy call via the `image` option to skip rebuilding.
214
+ *
215
+ * Defaults to `false`.
216
+ */
217
+ buildOnly?: boolean;
179
218
  /**
180
219
  * Whether to opt out of the Depot Builder.
181
220
  *
@@ -221,7 +260,7 @@ export type ShowConfigOptions = {
221
260
  local?: boolean;
222
261
  };
223
262
  /**
224
- * Options for saving an application's configuration as TOML file
263
+ * Options for saving an application's configuration to a local file
225
264
  */
226
265
  export type SaveConfigOptions = {
227
266
  /**
@@ -229,7 +268,11 @@ export type SaveConfigOptions = {
229
268
  */
230
269
  app: string;
231
270
  /**
232
- * Path to save the TOML configuration file to.
271
+ * Path to save the configuration file to.
272
+ *
273
+ * The format is read from this path's extension — `.json` and `.yaml`/
274
+ * `.yml` request that output from flyctl explicitly, anything else saves
275
+ * as TOML.
233
276
  */
234
277
  config: string;
235
278
  };
@@ -246,6 +289,19 @@ export type SetAppSecretsOptions = AppOrConfig & {
246
289
  * Options for unsetting application secrets
247
290
  */
248
291
  export type UnsetAppSecretsOptions = SetAppSecretsOptions;
292
+ /**
293
+ * Options for machine operations (start, stop, restart)
294
+ */
295
+ export type MachineOperationOptions = {
296
+ /**
297
+ * Name of the application
298
+ */
299
+ app: string;
300
+ /**
301
+ * Machine ID to perform the operation on
302
+ */
303
+ machineId: string;
304
+ };
249
305
  /**
250
306
  * Extended application status
251
307
  */
@@ -304,6 +360,34 @@ export type Logger = {
304
360
  * ```
305
361
  */
306
362
  traceCLI: boolean;
363
+ /**
364
+ * Enable verbose output for Fly CLI commands (e.g., Docker build logs)
365
+ *
366
+ * When enabled, adds `--verbose` flag to commands.
367
+ *
368
+ * @default false
369
+ */
370
+ verbose: boolean;
371
+ /**
372
+ * Enable debug output for Fly CLI commands
373
+ *
374
+ * When enabled, adds `--debug` flag to commands for detailed debugging information.
375
+ *
376
+ * @default false
377
+ */
378
+ debug: boolean;
379
+ /**
380
+ * Stream command output to console in real-time
381
+ *
382
+ * When enabled, stdout and stderr are piped to the console in real-time
383
+ * while still being captured for JSON parsing and result processing.
384
+ * Useful for long-running commands like deployments where you want to see progress.
385
+ *
386
+ * Works independently from `traceCLI`, `verbose`, and `debug`.
387
+ *
388
+ * @default false
389
+ */
390
+ streamToConsole: boolean;
307
391
  /**
308
392
  * Redact sensitive call values in CLI trace logs.
309
393
  *