@cdwr/fly-node 0.2.0 → 0.2.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 CHANGED
@@ -1,3 +1,20 @@
1
+ ## 0.2.2 (2025-10-03)
2
+
3
+ ### ⚙️ Miscellaneous Chores
4
+
5
+ - **repo:** fix vite name conflicts ([624d9eb](https://github.com/codeware-sthlm/codeware/commit/624d9eb))
6
+ - **repo:** migrate to eslint esm ([6581a92](https://github.com/codeware-sthlm/codeware/commit/6581a92))
7
+
8
+ ### 🧱 Updated Dependencies
9
+
10
+ - Updated core to 1.4.2
11
+
12
+ ## 0.2.1 (2025-02-07)
13
+
14
+ ### 🐞 Bug Fixes
15
+
16
+ - **web:** remove dependency to payload and related packages ([0a7a63e](https://github.com/codeware-sthlm/codeware/commit/0a7a63e))
17
+
1
18
  ## 0.2.0 (2025-01-30)
2
19
 
3
20
  ### ✨ Features
package/index.cjs CHANGED
@@ -46,10 +46,11 @@ var import_tiny_invariant = __toESM(require("tiny-invariant"), 1);
46
46
  // packages/core/src/lib/utils/log-utils.ts
47
47
  var import_chalk = __toESM(require("chalk"), 1);
48
48
 
49
- // packages/core/src/lib/utils/get-package-version.ts
49
+ // packages/core/src/lib/utils/promisified-exec.ts
50
50
  var import_child_process = require("child_process");
51
51
  var import_util = require("util");
52
- var execAsync = (0, import_util.promisify)(import_child_process.execFile);
52
+ var exec = (0, import_util.promisify)(import_child_process.exec);
53
+ var execFile = (0, import_util.promisify)(import_child_process.execFile);
53
54
 
54
55
  // packages/core/src/lib/utils/kill-port.ts
55
56
  var import_kill_port = __toESM(require("kill-port"), 1);
@@ -60,16 +61,11 @@ var import_util2 = require("util");
60
61
  var import_tree_kill = __toESM(require("tree-kill"), 1);
61
62
  var killProcessTree = (0, import_util2.promisify)(import_tree_kill.default);
62
63
 
63
- // packages/core/src/lib/utils/promisified-exec.ts
64
- var import_child_process2 = require("child_process");
65
- var import_util3 = require("util");
66
- var exec = (0, import_util3.promisify)(import_child_process2.exec);
67
-
68
64
  // packages/core/src/lib/utils/promisified-spawn.ts
69
- var import_child_process3 = require("child_process");
65
+ var import_child_process2 = require("child_process");
70
66
  function spawn(command, args, options) {
71
67
  return new Promise((resolve, reject) => {
72
- const process2 = (0, import_child_process3.spawn)(command, args, {
68
+ const process2 = (0, import_child_process2.spawn)(command, args, {
73
69
  ...options,
74
70
  stdio: "pipe"
75
71
  });
@@ -136,20 +132,17 @@ Output: ${output}`)
136
132
  var import_npm_whoami = __toESM(require("npm-whoami"), 1);
137
133
 
138
134
  // packages/fly-node/src/lib/fly.class.ts
139
- var import_zod30 = require("zod");
140
-
141
- // packages/core/src/lib/zod/create-lowercase-schema.ts
142
- var import_zod = require("zod");
135
+ var import_zod28 = require("zod");
143
136
 
144
137
  // packages/core/src/lib/zod/json.schema.ts
145
- var import_zod2 = require("zod");
146
- var LiteralSchema = import_zod2.z.union([import_zod2.z.string(), import_zod2.z.number(), import_zod2.z.boolean(), import_zod2.z.null()]);
147
- var JsonSchema = import_zod2.z.lazy(
148
- () => import_zod2.z.union([LiteralSchema, import_zod2.z.array(JsonSchema), import_zod2.z.record(JsonSchema)])
138
+ var import_zod = require("zod");
139
+ var LiteralSchema = import_zod.z.union([import_zod.z.string(), import_zod.z.number(), import_zod.z.boolean(), import_zod.z.null()]);
140
+ var JsonSchema = import_zod.z.lazy(
141
+ () => import_zod.z.union([LiteralSchema, import_zod.z.array(JsonSchema), import_zod.z.record(JsonSchema)])
149
142
  );
150
143
 
151
144
  // packages/core/src/lib/zod/with-camel-case.preprocess.ts
152
- var import_zod3 = require("zod");
145
+ var import_zod2 = require("zod");
153
146
  var toCamelCase = (str, specialCases = {}) => {
154
147
  if (specialCases[str]) {
155
148
  return specialCases[str];
@@ -196,7 +189,7 @@ var transformKeys = (options) => {
196
189
  };
197
190
  var withCamelCase = (schema, options = {}) => {
198
191
  const { preserve = [], specialCases = {} } = options;
199
- return import_zod3.z.preprocess(
192
+ return import_zod2.z.preprocess(
200
193
  (data) => transformKeys({
201
194
  currentPath: [],
202
195
  data,
@@ -207,43 +200,40 @@ var withCamelCase = (schema, options = {}) => {
207
200
  );
208
201
  };
209
202
 
210
- // packages/core/src/lib/zod/with-env-vars.preprocess.ts
211
- var import_zod4 = require("zod");
212
-
213
203
  // packages/core/src/lib/zod/with-replace-all.preprocess.ts
214
- var import_zod5 = require("zod");
204
+ var import_zod3 = require("zod");
215
205
 
216
206
  // packages/fly-node/src/lib/schemas/apps-create.schema.ts
217
- var import_zod7 = require("zod");
207
+ var import_zod5 = require("zod");
218
208
  var AppsCreateTransformedResponseSchema = withCamelCase(
219
- import_zod7.z.object({
220
- id: import_zod7.z.string(),
221
- name: import_zod7.z.string(),
222
- organization: import_zod7.z.object({
223
- id: import_zod7.z.string(),
224
- name: import_zod7.z.string()
209
+ import_zod5.z.object({
210
+ id: import_zod5.z.string(),
211
+ name: import_zod5.z.string(),
212
+ organization: import_zod5.z.object({
213
+ id: import_zod5.z.string(),
214
+ name: import_zod5.z.string()
225
215
  })
226
216
  })
227
217
  );
228
218
 
229
219
  // packages/fly-node/src/lib/schemas/apps-list.schema.ts
230
- var import_zod9 = require("zod");
231
- var AppsListTransformedResponseSchema = import_zod9.z.array(
220
+ var import_zod7 = require("zod");
221
+ var AppsListTransformedResponseSchema = import_zod7.z.array(
232
222
  withCamelCase(
233
- import_zod9.z.object({
234
- id: import_zod9.z.string(),
235
- name: import_zod9.z.string(),
236
- status: import_zod9.z.string(),
237
- deployed: import_zod9.z.boolean(),
238
- hostname: import_zod9.z.string(),
239
- organization: import_zod9.z.object({
240
- name: import_zod9.z.string(),
241
- slug: import_zod9.z.string()
223
+ import_zod7.z.object({
224
+ id: import_zod7.z.string(),
225
+ name: import_zod7.z.string(),
226
+ status: import_zod7.z.string(),
227
+ deployed: import_zod7.z.boolean(),
228
+ hostname: import_zod7.z.string(),
229
+ organization: import_zod7.z.object({
230
+ name: import_zod7.z.string(),
231
+ slug: import_zod7.z.string()
242
232
  }),
243
- currentRelease: import_zod9.z.nullable(
244
- import_zod9.z.object({
245
- status: import_zod9.z.string(),
246
- createdAt: import_zod9.z.string().datetime()
233
+ currentRelease: import_zod7.z.nullable(
234
+ import_zod7.z.object({
235
+ status: import_zod7.z.string(),
236
+ createdAt: import_zod7.z.string().datetime()
247
237
  })
248
238
  )
249
239
  })
@@ -251,46 +241,46 @@ var AppsListTransformedResponseSchema = import_zod9.z.array(
251
241
  );
252
242
 
253
243
  // packages/fly-node/src/lib/schemas/certs-list-with-app.schema.ts
254
- var import_zod13 = require("zod");
244
+ var import_zod11 = require("zod");
255
245
 
256
246
  // packages/fly-node/src/lib/schemas/certs-list.schema.ts
257
- var import_zod11 = require("zod");
258
- var CertsListFlyResponseElementSchema = import_zod11.z.object({
259
- createdAt: import_zod11.z.string().datetime(),
260
- hostname: import_zod11.z.string(),
261
- clientStatus: import_zod11.z.string()
247
+ var import_zod9 = require("zod");
248
+ var CertsListFlyResponseElementSchema = import_zod9.z.object({
249
+ createdAt: import_zod9.z.string().datetime(),
250
+ hostname: import_zod9.z.string(),
251
+ clientStatus: import_zod9.z.string()
262
252
  });
263
- var CertsListTransformedResponseSchema = import_zod11.z.array(
253
+ var CertsListTransformedResponseSchema = import_zod9.z.array(
264
254
  withCamelCase(CertsListFlyResponseElementSchema)
265
255
  );
266
256
 
267
257
  // packages/fly-node/src/lib/schemas/certs-list-with-app.schema.ts
268
- var CertsListWithAppTransformedResponseSchema = import_zod13.z.array(
258
+ var CertsListWithAppTransformedResponseSchema = import_zod11.z.array(
269
259
  withCamelCase(
270
260
  CertsListFlyResponseElementSchema.extend({
271
- app: import_zod13.z.string()
261
+ app: import_zod11.z.string()
272
262
  })
273
263
  )
274
264
  );
275
265
 
276
266
  // packages/fly-node/src/lib/schemas/config-show.schema.ts
277
- var import_zod15 = require("zod");
267
+ var import_zod13 = require("zod");
278
268
  var ConfigShowResponseSchema = withCamelCase(
279
- import_zod15.z.object({
280
- app: import_zod15.z.string(),
281
- primaryRegion: import_zod15.z.string().optional(),
282
- build: import_zod15.z.record(import_zod15.z.string(), import_zod15.z.any()).optional().or(
283
- import_zod15.z.object({
284
- args: import_zod15.z.record(import_zod15.z.string(), import_zod15.z.string()).optional(),
285
- dockerfile: import_zod15.z.string().optional(),
286
- image: import_zod15.z.string().optional()
269
+ import_zod13.z.object({
270
+ app: import_zod13.z.string(),
271
+ primaryRegion: import_zod13.z.string().optional(),
272
+ build: import_zod13.z.record(import_zod13.z.string(), import_zod13.z.any()).optional().or(
273
+ import_zod13.z.object({
274
+ args: import_zod13.z.record(import_zod13.z.string(), import_zod13.z.string()).optional(),
275
+ dockerfile: import_zod13.z.string().optional(),
276
+ image: import_zod13.z.string().optional()
287
277
  })
288
278
  ),
289
- deploy: import_zod15.z.record(import_zod15.z.string(), import_zod15.z.any()).optional().or(import_zod15.z.object({ strategy: import_zod15.z.string().optional() })),
290
- env: import_zod15.z.record(import_zod15.z.string(), import_zod15.z.string()).optional(),
291
- httpService: import_zod15.z.record(import_zod15.z.string(), import_zod15.z.any()).optional(),
292
- mounts: import_zod15.z.record(import_zod15.z.string(), import_zod15.z.any()).optional(),
293
- services: import_zod15.z.array(import_zod15.z.record(import_zod15.z.string(), import_zod15.z.any())).optional()
279
+ deploy: import_zod13.z.record(import_zod13.z.string(), import_zod13.z.any()).optional().or(import_zod13.z.object({ strategy: import_zod13.z.string().optional() })),
280
+ env: import_zod13.z.record(import_zod13.z.string(), import_zod13.z.string()).optional(),
281
+ httpService: import_zod13.z.record(import_zod13.z.string(), import_zod13.z.any()).optional(),
282
+ mounts: import_zod13.z.record(import_zod13.z.string(), import_zod13.z.any()).optional(),
283
+ services: import_zod13.z.array(import_zod13.z.record(import_zod13.z.string(), import_zod13.z.any())).optional()
294
284
  }),
295
285
  {
296
286
  preserve: ["build.args", "env"]
@@ -298,115 +288,115 @@ var ConfigShowResponseSchema = withCamelCase(
298
288
  );
299
289
 
300
290
  // packages/fly-node/src/lib/schemas/deploy.schema.ts
301
- var import_zod16 = require("zod");
302
- var DeployResponseSchema = import_zod16.z.object({
303
- app: import_zod16.z.string(),
304
- hostname: import_zod16.z.string(),
305
- url: import_zod16.z.string().url()
291
+ var import_zod14 = require("zod");
292
+ var DeployResponseSchema = import_zod14.z.object({
293
+ app: import_zod14.z.string(),
294
+ hostname: import_zod14.z.string(),
295
+ url: import_zod14.z.string().url()
306
296
  });
307
297
 
308
298
  // packages/fly-node/src/lib/schemas/helper-schemas.ts
309
- var import_zod17 = require("zod");
310
- var AllowEmptyUrlSchema = import_zod17.z.string().url().or(import_zod17.z.literal(""));
311
- var NameSchema = import_zod17.z.string({ message: "App name must be a valid slug" }).regex(/^[a-z0-9-]+$/);
299
+ var import_zod15 = require("zod");
300
+ var AllowEmptyUrlSchema = import_zod15.z.string().url().or(import_zod15.z.literal(""));
301
+ var NameSchema = import_zod15.z.string({ message: "App name must be a valid slug" }).regex(/^[a-z0-9-]+$/);
312
302
 
313
303
  // packages/fly-node/src/lib/schemas/postgres-list.ts
314
- var import_zod19 = require("zod");
315
- var PostgresListTransformedResponseSchema = import_zod19.z.array(
304
+ var import_zod17 = require("zod");
305
+ var PostgresListTransformedResponseSchema = import_zod17.z.array(
316
306
  withCamelCase(
317
- import_zod19.z.object({
318
- deployed: import_zod19.z.boolean(),
319
- hostname: import_zod19.z.string(),
320
- id: import_zod19.z.string(),
321
- name: import_zod19.z.string(),
322
- organization: import_zod19.z.object({ id: import_zod19.z.string(), slug: import_zod19.z.string() }),
323
- status: import_zod19.z.string(),
324
- version: import_zod19.z.number()
307
+ import_zod17.z.object({
308
+ deployed: import_zod17.z.boolean(),
309
+ hostname: import_zod17.z.string(),
310
+ id: import_zod17.z.string(),
311
+ name: import_zod17.z.string(),
312
+ organization: import_zod17.z.object({ id: import_zod17.z.string(), slug: import_zod17.z.string() }),
313
+ status: import_zod17.z.string(),
314
+ version: import_zod17.z.number()
325
315
  })
326
316
  )
327
317
  );
328
318
 
329
319
  // packages/fly-node/src/lib/schemas/postgres-users-list.ts
330
- var import_zod21 = require("zod");
331
- var PostgresUsersListTransformedResponseSchema = import_zod21.z.array(
320
+ var import_zod19 = require("zod");
321
+ var PostgresUsersListTransformedResponseSchema = import_zod19.z.array(
332
322
  withCamelCase(
333
- import_zod21.z.object({
334
- username: import_zod21.z.string(),
335
- superuser: import_zod21.z.boolean(),
336
- databases: import_zod21.z.array(import_zod21.z.string())
323
+ import_zod19.z.object({
324
+ username: import_zod19.z.string(),
325
+ superuser: import_zod19.z.boolean(),
326
+ databases: import_zod19.z.array(import_zod19.z.string())
337
327
  })
338
328
  )
339
329
  );
340
330
 
341
331
  // packages/fly-node/src/lib/schemas/secrets-list-with-app.schema.ts
342
- var import_zod25 = require("zod");
332
+ var import_zod23 = require("zod");
343
333
 
344
334
  // packages/fly-node/src/lib/schemas/secrets-list.schema.ts
345
- var import_zod23 = require("zod");
346
- var SecretsListFlyResponseElementSchema = import_zod23.z.object({
347
- name: import_zod23.z.string(),
348
- digest: import_zod23.z.string(),
349
- createdAt: import_zod23.z.string().datetime()
335
+ var import_zod21 = require("zod");
336
+ var SecretsListFlyResponseElementSchema = import_zod21.z.object({
337
+ name: import_zod21.z.string(),
338
+ digest: import_zod21.z.string(),
339
+ createdAt: import_zod21.z.string().datetime()
350
340
  });
351
- var SecretsListTransformedResponseSchema = import_zod23.z.array(
341
+ var SecretsListTransformedResponseSchema = import_zod21.z.array(
352
342
  withCamelCase(SecretsListFlyResponseElementSchema)
353
343
  );
354
344
 
355
345
  // packages/fly-node/src/lib/schemas/secrets-list-with-app.schema.ts
356
- var SecretsListWithAppTransformedResponseSchema = import_zod25.z.array(
346
+ var SecretsListWithAppTransformedResponseSchema = import_zod23.z.array(
357
347
  withCamelCase(
358
348
  SecretsListFlyResponseElementSchema.extend({
359
- app: import_zod25.z.string()
349
+ app: import_zod23.z.string()
360
350
  })
361
351
  )
362
352
  );
363
353
 
364
354
  // packages/fly-node/src/lib/schemas/status-extended.schema.ts
365
- var import_zod29 = require("zod");
355
+ var import_zod27 = require("zod");
366
356
 
367
357
  // packages/fly-node/src/lib/schemas/status.schema.ts
368
- var import_zod27 = require("zod");
369
- var statusFlyResponseSchema = import_zod27.z.object({
370
- deployed: import_zod27.z.boolean(),
371
- hostname: import_zod27.z.string(),
372
- id: import_zod27.z.string(),
373
- machines: import_zod27.z.array(
374
- import_zod27.z.object({
375
- id: import_zod27.z.string(),
376
- name: import_zod27.z.string(),
377
- state: import_zod27.z.string(),
378
- region: import_zod27.z.string(),
379
- createdAt: import_zod27.z.string().datetime(),
380
- updatedAt: import_zod27.z.string().datetime(),
381
- config: import_zod27.z.object({
382
- env: import_zod27.z.record(import_zod27.z.string()),
383
- metadata: import_zod27.z.record(import_zod27.z.string())
358
+ var import_zod25 = require("zod");
359
+ var statusFlyResponseSchema = import_zod25.z.object({
360
+ deployed: import_zod25.z.boolean(),
361
+ hostname: import_zod25.z.string(),
362
+ id: import_zod25.z.string(),
363
+ machines: import_zod25.z.array(
364
+ import_zod25.z.object({
365
+ id: import_zod25.z.string(),
366
+ name: import_zod25.z.string(),
367
+ state: import_zod25.z.string(),
368
+ region: import_zod25.z.string(),
369
+ createdAt: import_zod25.z.string().datetime(),
370
+ updatedAt: import_zod25.z.string().datetime(),
371
+ config: import_zod25.z.object({
372
+ env: import_zod25.z.record(import_zod25.z.string()),
373
+ metadata: import_zod25.z.record(import_zod25.z.string())
384
374
  }),
385
- events: import_zod27.z.array(
386
- import_zod27.z.object({
387
- type: import_zod27.z.string(),
388
- status: import_zod27.z.string(),
389
- timestamp: import_zod27.z.number()
375
+ events: import_zod25.z.array(
376
+ import_zod25.z.object({
377
+ type: import_zod25.z.string(),
378
+ status: import_zod25.z.string(),
379
+ timestamp: import_zod25.z.number()
390
380
  })
391
381
  ),
392
- checks: import_zod27.z.array(
393
- import_zod27.z.object({
394
- name: import_zod27.z.string(),
395
- status: import_zod27.z.string(),
396
- output: import_zod27.z.string(),
397
- updatedAt: import_zod27.z.string().datetime()
382
+ checks: import_zod25.z.array(
383
+ import_zod25.z.object({
384
+ name: import_zod25.z.string(),
385
+ status: import_zod25.z.string(),
386
+ output: import_zod25.z.string(),
387
+ updatedAt: import_zod25.z.string().datetime()
398
388
  })
399
389
  ).optional(),
400
- hostStatus: import_zod27.z.string()
390
+ hostStatus: import_zod25.z.string()
401
391
  })
402
392
  ),
403
- name: import_zod27.z.string(),
404
- organization: import_zod27.z.object({
405
- id: import_zod27.z.string(),
406
- slug: import_zod27.z.string()
393
+ name: import_zod25.z.string(),
394
+ organization: import_zod25.z.object({
395
+ id: import_zod25.z.string(),
396
+ slug: import_zod25.z.string()
407
397
  }),
408
- status: import_zod27.z.string(),
409
- version: import_zod27.z.number()
398
+ status: import_zod25.z.string(),
399
+ version: import_zod25.z.number()
410
400
  });
411
401
  var StatusTransformedResponseSchema = withCamelCase(
412
402
  statusFlyResponseSchema,
@@ -419,8 +409,8 @@ var StatusTransformedResponseSchema = withCamelCase(
419
409
  // packages/fly-node/src/lib/schemas/status-extended.schema.ts
420
410
  var StatusExtendedTransformedResponseSchema = withCamelCase(
421
411
  statusFlyResponseSchema.extend({
422
- domains: import_zod29.z.array(import_zod29.z.object({ hostname: import_zod29.z.string() })),
423
- secrets: import_zod29.z.array(import_zod29.z.object({ name: import_zod29.z.string() }))
412
+ domains: import_zod27.z.array(import_zod27.z.object({ hostname: import_zod27.z.string() })),
413
+ secrets: import_zod27.z.array(import_zod27.z.object({ name: import_zod27.z.string() }))
424
414
  }),
425
415
  {
426
416
  preserve: ["machines.config.env", "machines.config.metadata"]
@@ -1116,7 +1106,7 @@ ${error}`);
1116
1106
  if (onError === "throwOnError") {
1117
1107
  throw error;
1118
1108
  }
1119
- if (error instanceof import_zod30.ZodError) {
1109
+ if (error instanceof import_zod28.ZodError) {
1120
1110
  this.logger.info(`Failed to parse response:
1121
1111
  ${error.message}`);
1122
1112
  this.logger.info(`Raw response:
package/index.js CHANGED
@@ -10,10 +10,11 @@ import invariant from "tiny-invariant";
10
10
  // packages/core/src/lib/utils/log-utils.ts
11
11
  import chalk from "chalk";
12
12
 
13
- // packages/core/src/lib/utils/get-package-version.ts
14
- import { execFile } from "child_process";
13
+ // packages/core/src/lib/utils/promisified-exec.ts
14
+ import { exec as cpExec, execFile as cpExecFile } from "child_process";
15
15
  import { promisify } from "util";
16
- var execAsync = promisify(execFile);
16
+ var exec = promisify(cpExec);
17
+ var execFile = promisify(cpExecFile);
17
18
 
18
19
  // packages/core/src/lib/utils/kill-port.ts
19
20
  import kill from "kill-port";
@@ -24,11 +25,6 @@ import { promisify as promisify2 } from "util";
24
25
  import treeKill from "tree-kill";
25
26
  var killProcessTree = promisify2(treeKill);
26
27
 
27
- // packages/core/src/lib/utils/promisified-exec.ts
28
- import { exec as cpExec } from "child_process";
29
- import { promisify as promisify3 } from "util";
30
- var exec = promisify3(cpExec);
31
-
32
28
  // packages/core/src/lib/utils/promisified-spawn.ts
33
29
  import {
34
30
  spawn as cpSpawn
@@ -104,18 +100,15 @@ import npmWhoami from "npm-whoami";
104
100
  // packages/fly-node/src/lib/fly.class.ts
105
101
  import { ZodError } from "zod";
106
102
 
107
- // packages/core/src/lib/zod/create-lowercase-schema.ts
108
- import { z } from "zod";
109
-
110
103
  // packages/core/src/lib/zod/json.schema.ts
111
- import { z as z2 } from "zod";
112
- var LiteralSchema = z2.union([z2.string(), z2.number(), z2.boolean(), z2.null()]);
113
- var JsonSchema = z2.lazy(
114
- () => z2.union([LiteralSchema, z2.array(JsonSchema), z2.record(JsonSchema)])
104
+ import { z } from "zod";
105
+ var LiteralSchema = z.union([z.string(), z.number(), z.boolean(), z.null()]);
106
+ var JsonSchema = z.lazy(
107
+ () => z.union([LiteralSchema, z.array(JsonSchema), z.record(JsonSchema)])
115
108
  );
116
109
 
117
110
  // packages/core/src/lib/zod/with-camel-case.preprocess.ts
118
- import { z as z3 } from "zod";
111
+ import { z as z2 } from "zod";
119
112
  var toCamelCase = (str, specialCases = {}) => {
120
113
  if (specialCases[str]) {
121
114
  return specialCases[str];
@@ -162,7 +155,7 @@ var transformKeys = (options) => {
162
155
  };
163
156
  var withCamelCase = (schema, options = {}) => {
164
157
  const { preserve = [], specialCases = {} } = options;
165
- return z3.preprocess(
158
+ return z2.preprocess(
166
159
  (data) => transformKeys({
167
160
  currentPath: [],
168
161
  data,
@@ -173,43 +166,40 @@ var withCamelCase = (schema, options = {}) => {
173
166
  );
174
167
  };
175
168
 
176
- // packages/core/src/lib/zod/with-env-vars.preprocess.ts
177
- import { z as z4 } from "zod";
178
-
179
169
  // packages/core/src/lib/zod/with-replace-all.preprocess.ts
180
- import { z as z5 } from "zod";
170
+ import { z as z3 } from "zod";
181
171
 
182
172
  // packages/fly-node/src/lib/schemas/apps-create.schema.ts
183
- import { z as z6 } from "zod";
173
+ import { z as z4 } from "zod";
184
174
  var AppsCreateTransformedResponseSchema = withCamelCase(
185
- z6.object({
186
- id: z6.string(),
187
- name: z6.string(),
188
- organization: z6.object({
189
- id: z6.string(),
190
- name: z6.string()
175
+ z4.object({
176
+ id: z4.string(),
177
+ name: z4.string(),
178
+ organization: z4.object({
179
+ id: z4.string(),
180
+ name: z4.string()
191
181
  })
192
182
  })
193
183
  );
194
184
 
195
185
  // packages/fly-node/src/lib/schemas/apps-list.schema.ts
196
- import { z as z7 } from "zod";
197
- var AppsListTransformedResponseSchema = z7.array(
186
+ import { z as z5 } from "zod";
187
+ var AppsListTransformedResponseSchema = z5.array(
198
188
  withCamelCase(
199
- z7.object({
200
- id: z7.string(),
201
- name: z7.string(),
202
- status: z7.string(),
203
- deployed: z7.boolean(),
204
- hostname: z7.string(),
205
- organization: z7.object({
206
- name: z7.string(),
207
- slug: z7.string()
189
+ z5.object({
190
+ id: z5.string(),
191
+ name: z5.string(),
192
+ status: z5.string(),
193
+ deployed: z5.boolean(),
194
+ hostname: z5.string(),
195
+ organization: z5.object({
196
+ name: z5.string(),
197
+ slug: z5.string()
208
198
  }),
209
- currentRelease: z7.nullable(
210
- z7.object({
211
- status: z7.string(),
212
- createdAt: z7.string().datetime()
199
+ currentRelease: z5.nullable(
200
+ z5.object({
201
+ status: z5.string(),
202
+ createdAt: z5.string().datetime()
213
203
  })
214
204
  )
215
205
  })
@@ -217,46 +207,46 @@ var AppsListTransformedResponseSchema = z7.array(
217
207
  );
218
208
 
219
209
  // packages/fly-node/src/lib/schemas/certs-list-with-app.schema.ts
220
- import { z as z9 } from "zod";
210
+ import { z as z7 } from "zod";
221
211
 
222
212
  // packages/fly-node/src/lib/schemas/certs-list.schema.ts
223
- import { z as z8 } from "zod";
224
- var CertsListFlyResponseElementSchema = z8.object({
225
- createdAt: z8.string().datetime(),
226
- hostname: z8.string(),
227
- clientStatus: z8.string()
213
+ import { z as z6 } from "zod";
214
+ var CertsListFlyResponseElementSchema = z6.object({
215
+ createdAt: z6.string().datetime(),
216
+ hostname: z6.string(),
217
+ clientStatus: z6.string()
228
218
  });
229
- var CertsListTransformedResponseSchema = z8.array(
219
+ var CertsListTransformedResponseSchema = z6.array(
230
220
  withCamelCase(CertsListFlyResponseElementSchema)
231
221
  );
232
222
 
233
223
  // packages/fly-node/src/lib/schemas/certs-list-with-app.schema.ts
234
- var CertsListWithAppTransformedResponseSchema = z9.array(
224
+ var CertsListWithAppTransformedResponseSchema = z7.array(
235
225
  withCamelCase(
236
226
  CertsListFlyResponseElementSchema.extend({
237
- app: z9.string()
227
+ app: z7.string()
238
228
  })
239
229
  )
240
230
  );
241
231
 
242
232
  // packages/fly-node/src/lib/schemas/config-show.schema.ts
243
- import { z as z10 } from "zod";
233
+ import { z as z8 } from "zod";
244
234
  var ConfigShowResponseSchema = withCamelCase(
245
- z10.object({
246
- app: z10.string(),
247
- primaryRegion: z10.string().optional(),
248
- build: z10.record(z10.string(), z10.any()).optional().or(
249
- z10.object({
250
- args: z10.record(z10.string(), z10.string()).optional(),
251
- dockerfile: z10.string().optional(),
252
- image: z10.string().optional()
235
+ z8.object({
236
+ app: z8.string(),
237
+ primaryRegion: z8.string().optional(),
238
+ build: z8.record(z8.string(), z8.any()).optional().or(
239
+ z8.object({
240
+ args: z8.record(z8.string(), z8.string()).optional(),
241
+ dockerfile: z8.string().optional(),
242
+ image: z8.string().optional()
253
243
  })
254
244
  ),
255
- deploy: z10.record(z10.string(), z10.any()).optional().or(z10.object({ strategy: z10.string().optional() })),
256
- env: z10.record(z10.string(), z10.string()).optional(),
257
- httpService: z10.record(z10.string(), z10.any()).optional(),
258
- mounts: z10.record(z10.string(), z10.any()).optional(),
259
- services: z10.array(z10.record(z10.string(), z10.any())).optional()
245
+ deploy: z8.record(z8.string(), z8.any()).optional().or(z8.object({ strategy: z8.string().optional() })),
246
+ env: z8.record(z8.string(), z8.string()).optional(),
247
+ httpService: z8.record(z8.string(), z8.any()).optional(),
248
+ mounts: z8.record(z8.string(), z8.any()).optional(),
249
+ services: z8.array(z8.record(z8.string(), z8.any())).optional()
260
250
  }),
261
251
  {
262
252
  preserve: ["build.args", "env"]
@@ -264,115 +254,115 @@ var ConfigShowResponseSchema = withCamelCase(
264
254
  );
265
255
 
266
256
  // packages/fly-node/src/lib/schemas/deploy.schema.ts
267
- import { z as z11 } from "zod";
268
- var DeployResponseSchema = z11.object({
269
- app: z11.string(),
270
- hostname: z11.string(),
271
- url: z11.string().url()
257
+ import { z as z9 } from "zod";
258
+ var DeployResponseSchema = z9.object({
259
+ app: z9.string(),
260
+ hostname: z9.string(),
261
+ url: z9.string().url()
272
262
  });
273
263
 
274
264
  // packages/fly-node/src/lib/schemas/helper-schemas.ts
275
- import { z as z12 } from "zod";
276
- var AllowEmptyUrlSchema = z12.string().url().or(z12.literal(""));
277
- var NameSchema = z12.string({ message: "App name must be a valid slug" }).regex(/^[a-z0-9-]+$/);
265
+ import { z as z10 } from "zod";
266
+ var AllowEmptyUrlSchema = z10.string().url().or(z10.literal(""));
267
+ var NameSchema = z10.string({ message: "App name must be a valid slug" }).regex(/^[a-z0-9-]+$/);
278
268
 
279
269
  // packages/fly-node/src/lib/schemas/postgres-list.ts
280
- import { z as z13 } from "zod";
281
- var PostgresListTransformedResponseSchema = z13.array(
270
+ import { z as z11 } from "zod";
271
+ var PostgresListTransformedResponseSchema = z11.array(
282
272
  withCamelCase(
283
- z13.object({
284
- deployed: z13.boolean(),
285
- hostname: z13.string(),
286
- id: z13.string(),
287
- name: z13.string(),
288
- organization: z13.object({ id: z13.string(), slug: z13.string() }),
289
- status: z13.string(),
290
- version: z13.number()
273
+ z11.object({
274
+ deployed: z11.boolean(),
275
+ hostname: z11.string(),
276
+ id: z11.string(),
277
+ name: z11.string(),
278
+ organization: z11.object({ id: z11.string(), slug: z11.string() }),
279
+ status: z11.string(),
280
+ version: z11.number()
291
281
  })
292
282
  )
293
283
  );
294
284
 
295
285
  // packages/fly-node/src/lib/schemas/postgres-users-list.ts
296
- import { z as z14 } from "zod";
297
- var PostgresUsersListTransformedResponseSchema = z14.array(
286
+ import { z as z12 } from "zod";
287
+ var PostgresUsersListTransformedResponseSchema = z12.array(
298
288
  withCamelCase(
299
- z14.object({
300
- username: z14.string(),
301
- superuser: z14.boolean(),
302
- databases: z14.array(z14.string())
289
+ z12.object({
290
+ username: z12.string(),
291
+ superuser: z12.boolean(),
292
+ databases: z12.array(z12.string())
303
293
  })
304
294
  )
305
295
  );
306
296
 
307
297
  // packages/fly-node/src/lib/schemas/secrets-list-with-app.schema.ts
308
- import { z as z16 } from "zod";
298
+ import { z as z14 } from "zod";
309
299
 
310
300
  // packages/fly-node/src/lib/schemas/secrets-list.schema.ts
311
- import { z as z15 } from "zod";
312
- var SecretsListFlyResponseElementSchema = z15.object({
313
- name: z15.string(),
314
- digest: z15.string(),
315
- createdAt: z15.string().datetime()
301
+ import { z as z13 } from "zod";
302
+ var SecretsListFlyResponseElementSchema = z13.object({
303
+ name: z13.string(),
304
+ digest: z13.string(),
305
+ createdAt: z13.string().datetime()
316
306
  });
317
- var SecretsListTransformedResponseSchema = z15.array(
307
+ var SecretsListTransformedResponseSchema = z13.array(
318
308
  withCamelCase(SecretsListFlyResponseElementSchema)
319
309
  );
320
310
 
321
311
  // packages/fly-node/src/lib/schemas/secrets-list-with-app.schema.ts
322
- var SecretsListWithAppTransformedResponseSchema = z16.array(
312
+ var SecretsListWithAppTransformedResponseSchema = z14.array(
323
313
  withCamelCase(
324
314
  SecretsListFlyResponseElementSchema.extend({
325
- app: z16.string()
315
+ app: z14.string()
326
316
  })
327
317
  )
328
318
  );
329
319
 
330
320
  // packages/fly-node/src/lib/schemas/status-extended.schema.ts
331
- import { z as z18 } from "zod";
321
+ import { z as z16 } from "zod";
332
322
 
333
323
  // packages/fly-node/src/lib/schemas/status.schema.ts
334
- import { z as z17 } from "zod";
335
- var statusFlyResponseSchema = z17.object({
336
- deployed: z17.boolean(),
337
- hostname: z17.string(),
338
- id: z17.string(),
339
- machines: z17.array(
340
- z17.object({
341
- id: z17.string(),
342
- name: z17.string(),
343
- state: z17.string(),
344
- region: z17.string(),
345
- createdAt: z17.string().datetime(),
346
- updatedAt: z17.string().datetime(),
347
- config: z17.object({
348
- env: z17.record(z17.string()),
349
- metadata: z17.record(z17.string())
324
+ import { z as z15 } from "zod";
325
+ var statusFlyResponseSchema = z15.object({
326
+ deployed: z15.boolean(),
327
+ hostname: z15.string(),
328
+ id: z15.string(),
329
+ machines: z15.array(
330
+ z15.object({
331
+ id: z15.string(),
332
+ name: z15.string(),
333
+ state: z15.string(),
334
+ region: z15.string(),
335
+ createdAt: z15.string().datetime(),
336
+ updatedAt: z15.string().datetime(),
337
+ config: z15.object({
338
+ env: z15.record(z15.string()),
339
+ metadata: z15.record(z15.string())
350
340
  }),
351
- events: z17.array(
352
- z17.object({
353
- type: z17.string(),
354
- status: z17.string(),
355
- timestamp: z17.number()
341
+ events: z15.array(
342
+ z15.object({
343
+ type: z15.string(),
344
+ status: z15.string(),
345
+ timestamp: z15.number()
356
346
  })
357
347
  ),
358
- checks: z17.array(
359
- z17.object({
360
- name: z17.string(),
361
- status: z17.string(),
362
- output: z17.string(),
363
- updatedAt: z17.string().datetime()
348
+ checks: z15.array(
349
+ z15.object({
350
+ name: z15.string(),
351
+ status: z15.string(),
352
+ output: z15.string(),
353
+ updatedAt: z15.string().datetime()
364
354
  })
365
355
  ).optional(),
366
- hostStatus: z17.string()
356
+ hostStatus: z15.string()
367
357
  })
368
358
  ),
369
- name: z17.string(),
370
- organization: z17.object({
371
- id: z17.string(),
372
- slug: z17.string()
359
+ name: z15.string(),
360
+ organization: z15.object({
361
+ id: z15.string(),
362
+ slug: z15.string()
373
363
  }),
374
- status: z17.string(),
375
- version: z17.number()
364
+ status: z15.string(),
365
+ version: z15.number()
376
366
  });
377
367
  var StatusTransformedResponseSchema = withCamelCase(
378
368
  statusFlyResponseSchema,
@@ -385,8 +375,8 @@ var StatusTransformedResponseSchema = withCamelCase(
385
375
  // packages/fly-node/src/lib/schemas/status-extended.schema.ts
386
376
  var StatusExtendedTransformedResponseSchema = withCamelCase(
387
377
  statusFlyResponseSchema.extend({
388
- domains: z18.array(z18.object({ hostname: z18.string() })),
389
- secrets: z18.array(z18.object({ name: z18.string() }))
378
+ domains: z16.array(z16.object({ hostname: z16.string() })),
379
+ secrets: z16.array(z16.object({ name: z16.string() }))
390
380
  }),
391
381
  {
392
382
  preserve: ["machines.config.env", "machines.config.metadata"]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdwr/fly-node",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "The flyctl node wrapper for programmatic deployments to fly.io.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -2,13 +2,13 @@ import { z } from 'zod';
2
2
  /**
3
3
  * certs list response extended with application name
4
4
  */
5
- export declare const CertsListWithAppTransformedResponseSchema: z.ZodArray<z.ZodEffects<z.ZodObject<z.objectUtil.extendShape<{
5
+ export declare const CertsListWithAppTransformedResponseSchema: z.ZodArray<z.ZodEffects<z.ZodObject<{
6
6
  createdAt: z.ZodString;
7
7
  hostname: z.ZodString;
8
8
  clientStatus: z.ZodString;
9
- }, {
9
+ } & {
10
10
  app: z.ZodString;
11
- }>, "strip", z.ZodTypeAny, {
11
+ }, "strip", z.ZodTypeAny, {
12
12
  hostname: string;
13
13
  createdAt: string;
14
14
  clientStatus: string;
@@ -2,13 +2,13 @@ import { z } from 'zod';
2
2
  /**
3
3
  * secrets list response extended with application name
4
4
  */
5
- export declare const SecretsListWithAppTransformedResponseSchema: z.ZodArray<z.ZodEffects<z.ZodObject<z.objectUtil.extendShape<{
5
+ export declare const SecretsListWithAppTransformedResponseSchema: z.ZodArray<z.ZodEffects<z.ZodObject<{
6
6
  name: z.ZodString;
7
7
  digest: z.ZodString;
8
8
  createdAt: z.ZodString;
9
- }, {
9
+ } & {
10
10
  app: z.ZodString;
11
- }>, "strip", z.ZodTypeAny, {
11
+ }, "strip", z.ZodTypeAny, {
12
12
  name: string;
13
13
  createdAt: string;
14
14
  app: string;
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  /**
3
3
  * status response extended with domains and secrets
4
4
  */
5
- export declare const StatusExtendedTransformedResponseSchema: z.ZodEffects<z.ZodObject<z.objectUtil.extendShape<{
5
+ export declare const StatusExtendedTransformedResponseSchema: z.ZodEffects<z.ZodObject<{
6
6
  deployed: z.ZodBoolean;
7
7
  hostname: z.ZodString;
8
8
  id: z.ZodString;
@@ -113,7 +113,7 @@ export declare const StatusExtendedTransformedResponseSchema: z.ZodEffects<z.Zod
113
113
  }>;
114
114
  status: z.ZodString;
115
115
  version: z.ZodNumber;
116
- }, {
116
+ } & {
117
117
  domains: z.ZodArray<z.ZodObject<{
118
118
  hostname: z.ZodString;
119
119
  }, "strip", z.ZodTypeAny, {
@@ -128,7 +128,7 @@ export declare const StatusExtendedTransformedResponseSchema: z.ZodEffects<z.Zod
128
128
  }, {
129
129
  name: string;
130
130
  }>, "many">;
131
- }>, "strip", z.ZodTypeAny, {
131
+ }, "strip", z.ZodTypeAny, {
132
132
  name: string;
133
133
  status: string;
134
134
  id: string;