@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.
@@ -1,10 +1,12 @@
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';
7
8
  import { DeployResponseSchema } from './schemas/deploy.schema';
9
+ import { IpsListTransformedResponseSchema } from './schemas/ips-list.schema';
8
10
  import { PostgresListTransformedResponseSchema } from './schemas/postgres-list';
9
11
  import { PostgresUsersListTransformedResponseSchema } from './schemas/postgres-users-list';
10
12
  import { SecretsListWithAppTransformedResponseSchema } from './schemas/secrets-list-with-app.schema';
@@ -15,10 +17,26 @@ import { VersionTransformedResponseSchema } from './schemas/version.schema';
15
17
  export type ListAppResponse = z.infer<typeof AppsListTransformedResponseSchema>;
16
18
  /** Create an application */
17
19
  export type CreateAppResponse = z.infer<typeof AppsCreateTransformedResponseSchema>;
20
+ /** Build application image response */
21
+ export type BuildResponse = z.infer<typeof BuildResponseSchema>;
18
22
  /** Deploy application response */
19
23
  export type DeployResponse = z.infer<typeof DeployResponseSchema>;
20
24
  /** List certificates for an application */
21
25
  export type ListCertForAppResponse = z.infer<typeof CertsListTransformedResponseSchema>;
26
+ /** List public IP addresses for an application */
27
+ export type ListIpResponse = z.infer<typeof IpsListTransformedResponseSchema>;
28
+ /**
29
+ * Which public addresses to allocate.
30
+ *
31
+ * Both defaults are free. A dedicated v4 is billed, which is why it is not
32
+ * offered here — `sharedV4` is what an app with an `http_service` needs.
33
+ */
34
+ export type AllocateIpOptions = AppOrConfig & {
35
+ /** Allocate a free shared IPv4 @default true */
36
+ sharedV4?: boolean;
37
+ /** Allocate a free dedicated IPv6 @default true */
38
+ v6?: boolean;
39
+ };
22
40
  /** List certificates for all applications */
23
41
  export type ListCertForAllResponse = z.infer<typeof CertsListWithAppTransformedResponseSchema>;
24
42
  /** List secrets for an application */
@@ -142,6 +160,13 @@ export type DeployAppOptions = {
142
160
  * Spaces are supported in values.
143
161
  */
144
162
  env?: Record<string, string>;
163
+ /**
164
+ * Build arguments to pass to the Docker build.
165
+ *
166
+ * These are available during the build phase (e.g. NEXT_PUBLIC_ vars, etc.).
167
+ * Use `env` for runtime environment variables instead.
168
+ */
169
+ buildArgs?: Record<string, string>;
145
170
  /**
146
171
  * Target environment for the application.
147
172
  *
@@ -164,6 +189,13 @@ export type DeployAppOptions = {
164
189
  * Connection details will be provided via environment variable `DATABASE_URL`.
165
190
  */
166
191
  postgres?: string;
192
+ /**
193
+ * Database name to use when attaching to Postgres.
194
+ *
195
+ * If not specified, Fly will create a database with a default name.
196
+ * Use this to ensure multiple apps share the same database.
197
+ */
198
+ databaseName?: string;
167
199
  /**
168
200
  * Target region for the application.
169
201
  *
@@ -176,6 +208,28 @@ export type DeployAppOptions = {
176
208
  * Spaces are supported in values.
177
209
  */
178
210
  secrets?: Record<string, string>;
211
+ /**
212
+ * Docker image to use for deployment.
213
+ *
214
+ * This allows deploying with an existing image instead of rebuilding.
215
+ * Useful for config-only updates where you want to reuse the current image.
216
+ *
217
+ * Format: Can be either a full image reference (e.g., `registry.fly.io/app:tag`)
218
+ * or just the image tag from the registry (the shorthand will be expanded to the full reference).
219
+ *
220
+ * When provided, the build phase is skipped and the deployment uses the specified image.
221
+ */
222
+ image?: string;
223
+ /**
224
+ * Build the image and push it to the registry without deploying.
225
+ *
226
+ * Use this to separate the build phase from the deploy phase.
227
+ * The image reference is returned and can be passed to a subsequent
228
+ * deploy call via the `image` option to skip rebuilding.
229
+ *
230
+ * Defaults to `false`.
231
+ */
232
+ buildOnly?: boolean;
179
233
  /**
180
234
  * Whether to opt out of the Depot Builder.
181
235
  *
@@ -221,7 +275,7 @@ export type ShowConfigOptions = {
221
275
  local?: boolean;
222
276
  };
223
277
  /**
224
- * Options for saving an application's configuration as TOML file
278
+ * Options for saving an application's configuration to a local file
225
279
  */
226
280
  export type SaveConfigOptions = {
227
281
  /**
@@ -229,7 +283,11 @@ export type SaveConfigOptions = {
229
283
  */
230
284
  app: string;
231
285
  /**
232
- * Path to save the TOML configuration file to.
286
+ * Path to save the configuration file to.
287
+ *
288
+ * The format is read from this path's extension — `.json` and `.yaml`/
289
+ * `.yml` request that output from flyctl explicitly, anything else saves
290
+ * as TOML.
233
291
  */
234
292
  config: string;
235
293
  };
@@ -246,6 +304,19 @@ export type SetAppSecretsOptions = AppOrConfig & {
246
304
  * Options for unsetting application secrets
247
305
  */
248
306
  export type UnsetAppSecretsOptions = SetAppSecretsOptions;
307
+ /**
308
+ * Options for machine operations (start, stop, restart)
309
+ */
310
+ export type MachineOperationOptions = {
311
+ /**
312
+ * Name of the application
313
+ */
314
+ app: string;
315
+ /**
316
+ * Machine ID to perform the operation on
317
+ */
318
+ machineId: string;
319
+ };
249
320
  /**
250
321
  * Extended application status
251
322
  */
@@ -304,6 +375,34 @@ export type Logger = {
304
375
  * ```
305
376
  */
306
377
  traceCLI: boolean;
378
+ /**
379
+ * Enable verbose output for Fly CLI commands (e.g., Docker build logs)
380
+ *
381
+ * When enabled, adds `--verbose` flag to commands.
382
+ *
383
+ * @default false
384
+ */
385
+ verbose: boolean;
386
+ /**
387
+ * Enable debug output for Fly CLI commands
388
+ *
389
+ * When enabled, adds `--debug` flag to commands for detailed debugging information.
390
+ *
391
+ * @default false
392
+ */
393
+ debug: boolean;
394
+ /**
395
+ * Stream command output to console in real-time
396
+ *
397
+ * When enabled, stdout and stderr are piped to the console in real-time
398
+ * while still being captured for JSON parsing and result processing.
399
+ * Useful for long-running commands like deployments where you want to see progress.
400
+ *
401
+ * Works independently from `traceCLI`, `verbose`, and `debug`.
402
+ *
403
+ * @default false
404
+ */
405
+ streamToConsole: boolean;
307
406
  /**
308
407
  * Redact sensitive call values in CLI trace logs.
309
408
  *