@cdwr/fly-node 0.3.3 → 0.3.5

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,25 @@
1
+ ## 0.3.5 (2026-11-15)
2
+
3
+ ### 🐞 Bug Fixes
4
+
5
+ - **fly-node:** await parse so nullOnError catches schema errors ([23f2ffb3](https://github.com/codeware-sthlm/cdwr/commit/23f2ffb3))
6
+ - **fly-node:** read certificate status from flyctl 0.5 certs list ([8ea5053f](https://github.com/codeware-sthlm/cdwr/commit/8ea5053f))
7
+
8
+ ### ✅ Tests
9
+
10
+ - **fly-node:** list a real certificate in the cli integration test ([522353c6](https://github.com/codeware-sthlm/cdwr/commit/522353c6))
11
+
12
+ ## 0.3.4 (2026-11-15)
13
+
14
+ ### 🐞 Bug Fixes
15
+
16
+ - **fly-node:** give the status schema records a key schema for zod 4 ([6cbff255](https://github.com/codeware-sthlm/cdwr/commit/6cbff255))
17
+ - **deps:** require zod 4.6.7 or later for the array length advisory ([f5d15049](https://github.com/codeware-sthlm/cdwr/commit/f5d15049))
18
+
19
+ ### ⚙️ Miscellaneous Chores
20
+
21
+ - **deps:** update dependency zod to v4 [security] ([1d5324c4](https://github.com/codeware-sthlm/cdwr/commit/1d5324c4))
22
+
1
23
  ## 0.3.3 (2026-11-04)
2
24
 
3
25
  ### ✨ Features
package/index.cjs CHANGED
@@ -698,7 +698,11 @@ var import_zod6 = require("zod");
698
698
  var import_zod7 = require("zod");
699
699
  var LiteralSchema = import_zod7.z.union([import_zod7.z.string(), import_zod7.z.number(), import_zod7.z.boolean(), import_zod7.z.null()]);
700
700
  var JsonSchema = import_zod7.z.lazy(
701
- () => import_zod7.z.union([LiteralSchema, import_zod7.z.array(JsonSchema), import_zod7.z.record(JsonSchema)])
701
+ () => import_zod7.z.union([
702
+ LiteralSchema,
703
+ import_zod7.z.array(JsonSchema),
704
+ import_zod7.z.record(import_zod7.z.string(), JsonSchema)
705
+ ])
702
706
  );
703
707
 
704
708
  // libs/shared/util/zod/src/lib/with-camel-case.preprocess.ts
@@ -819,16 +823,25 @@ var CertsListFlyResponseElementSchema = import_zod17.z.object({
819
823
  hostname: import_zod17.z.string(),
820
824
  clientStatus: import_zod17.z.string()
821
825
  });
826
+ var withClientStatus = (schema) => import_zod17.z.preprocess((data) => {
827
+ if (!data || typeof data !== "object" || Array.isArray(data)) {
828
+ return data;
829
+ }
830
+ const { status, ...rest } = data;
831
+ return status === void 0 ? rest : { ...rest, clientStatus: status };
832
+ }, schema);
822
833
  var CertsListTransformedResponseSchema = import_zod17.z.array(
823
- withCamelCase(CertsListFlyResponseElementSchema)
834
+ withCamelCase(withClientStatus(CertsListFlyResponseElementSchema))
824
835
  );
825
836
 
826
837
  // packages/fly-node/src/lib/schemas/certs-list-with-app.schema.ts
827
838
  var CertsListWithAppTransformedResponseSchema = import_zod19.z.array(
828
839
  withCamelCase(
829
- CertsListFlyResponseElementSchema.extend({
830
- app: import_zod19.z.string()
831
- })
840
+ withClientStatus(
841
+ CertsListFlyResponseElementSchema.extend({
842
+ app: import_zod19.z.string()
843
+ })
844
+ )
832
845
  )
833
846
  );
834
847
 
@@ -952,13 +965,13 @@ var statusFlyResponseSchema = import_zod35.z.object({
952
965
  repository: import_zod35.z.string(),
953
966
  tag: import_zod35.z.string(),
954
967
  digest: import_zod35.z.string(),
955
- labels: import_zod35.z.record(import_zod35.z.string()).optional()
968
+ labels: import_zod35.z.record(import_zod35.z.string(), import_zod35.z.string()).optional()
956
969
  }),
957
970
  createdAt: import_zod35.z.string().datetime(),
958
971
  updatedAt: import_zod35.z.string().datetime(),
959
972
  config: import_zod35.z.object({
960
- env: import_zod35.z.record(import_zod35.z.string()),
961
- metadata: import_zod35.z.record(import_zod35.z.string()),
973
+ env: import_zod35.z.record(import_zod35.z.string(), import_zod35.z.string()),
974
+ metadata: import_zod35.z.record(import_zod35.z.string(), import_zod35.z.string()),
962
975
  guest: import_zod35.z.object({
963
976
  cpu_kind: import_zod35.z.string().optional(),
964
977
  cpus: import_zod35.z.number().optional(),
@@ -1748,7 +1761,7 @@ ${error}`);
1748
1761
  args.push(options?.app || "--generate-name");
1749
1762
  args.push("--org", options?.org || this._config.org || "personal");
1750
1763
  args.push("--json");
1751
- return AppsCreateTransformedResponseSchema.parseAsync(
1764
+ return await AppsCreateTransformedResponseSchema.parseAsync(
1752
1765
  await this.execFly(args)
1753
1766
  );
1754
1767
  }
@@ -2153,7 +2166,7 @@ ${error}`);
2153
2166
  async fetchAllApps(onError) {
2154
2167
  const args = ["apps", "list", "--json"];
2155
2168
  try {
2156
- return AppsListTransformedResponseSchema.parseAsync(
2169
+ return await AppsListTransformedResponseSchema.parseAsync(
2157
2170
  await this.execFly(args)
2158
2171
  );
2159
2172
  } catch (error) {
@@ -2264,7 +2277,7 @@ ${JSON.stringify(response, null, 2)}`);
2264
2277
  args.push(...this.getAppOrConfigArgs(options));
2265
2278
  args.push("--json");
2266
2279
  try {
2267
- return CertsListTransformedResponseSchema.parseAsync(
2280
+ return await CertsListTransformedResponseSchema.parseAsync(
2268
2281
  await this.execFly(args)
2269
2282
  );
2270
2283
  } catch (error) {
@@ -2279,7 +2292,7 @@ ${JSON.stringify(response, null, 2)}`);
2279
2292
  args.push(...this.getAppOrConfigArgs(options));
2280
2293
  args.push("--json");
2281
2294
  try {
2282
- return SecretsListTransformedResponseSchema.parseAsync(
2295
+ return await SecretsListTransformedResponseSchema.parseAsync(
2283
2296
  await this.execFly(args)
2284
2297
  );
2285
2298
  } catch (error) {
package/index.js CHANGED
@@ -654,7 +654,11 @@ import { z as z6 } from "zod";
654
654
  import { z as z7 } from "zod";
655
655
  var LiteralSchema = z7.union([z7.string(), z7.number(), z7.boolean(), z7.null()]);
656
656
  var JsonSchema = z7.lazy(
657
- () => z7.union([LiteralSchema, z7.array(JsonSchema), z7.record(JsonSchema)])
657
+ () => z7.union([
658
+ LiteralSchema,
659
+ z7.array(JsonSchema),
660
+ z7.record(z7.string(), JsonSchema)
661
+ ])
658
662
  );
659
663
 
660
664
  // libs/shared/util/zod/src/lib/with-camel-case.preprocess.ts
@@ -775,16 +779,25 @@ var CertsListFlyResponseElementSchema = z14.object({
775
779
  hostname: z14.string(),
776
780
  clientStatus: z14.string()
777
781
  });
782
+ var withClientStatus = (schema) => z14.preprocess((data) => {
783
+ if (!data || typeof data !== "object" || Array.isArray(data)) {
784
+ return data;
785
+ }
786
+ const { status, ...rest } = data;
787
+ return status === void 0 ? rest : { ...rest, clientStatus: status };
788
+ }, schema);
778
789
  var CertsListTransformedResponseSchema = z14.array(
779
- withCamelCase(CertsListFlyResponseElementSchema)
790
+ withCamelCase(withClientStatus(CertsListFlyResponseElementSchema))
780
791
  );
781
792
 
782
793
  // packages/fly-node/src/lib/schemas/certs-list-with-app.schema.ts
783
794
  var CertsListWithAppTransformedResponseSchema = z15.array(
784
795
  withCamelCase(
785
- CertsListFlyResponseElementSchema.extend({
786
- app: z15.string()
787
- })
796
+ withClientStatus(
797
+ CertsListFlyResponseElementSchema.extend({
798
+ app: z15.string()
799
+ })
800
+ )
788
801
  )
789
802
  );
790
803
 
@@ -908,13 +921,13 @@ var statusFlyResponseSchema = z24.object({
908
921
  repository: z24.string(),
909
922
  tag: z24.string(),
910
923
  digest: z24.string(),
911
- labels: z24.record(z24.string()).optional()
924
+ labels: z24.record(z24.string(), z24.string()).optional()
912
925
  }),
913
926
  createdAt: z24.string().datetime(),
914
927
  updatedAt: z24.string().datetime(),
915
928
  config: z24.object({
916
- env: z24.record(z24.string()),
917
- metadata: z24.record(z24.string()),
929
+ env: z24.record(z24.string(), z24.string()),
930
+ metadata: z24.record(z24.string(), z24.string()),
918
931
  guest: z24.object({
919
932
  cpu_kind: z24.string().optional(),
920
933
  cpus: z24.number().optional(),
@@ -1704,7 +1717,7 @@ ${error}`);
1704
1717
  args.push(options?.app || "--generate-name");
1705
1718
  args.push("--org", options?.org || this._config.org || "personal");
1706
1719
  args.push("--json");
1707
- return AppsCreateTransformedResponseSchema.parseAsync(
1720
+ return await AppsCreateTransformedResponseSchema.parseAsync(
1708
1721
  await this.execFly(args)
1709
1722
  );
1710
1723
  }
@@ -2109,7 +2122,7 @@ ${error}`);
2109
2122
  async fetchAllApps(onError) {
2110
2123
  const args = ["apps", "list", "--json"];
2111
2124
  try {
2112
- return AppsListTransformedResponseSchema.parseAsync(
2125
+ return await AppsListTransformedResponseSchema.parseAsync(
2113
2126
  await this.execFly(args)
2114
2127
  );
2115
2128
  } catch (error) {
@@ -2220,7 +2233,7 @@ ${JSON.stringify(response, null, 2)}`);
2220
2233
  args.push(...this.getAppOrConfigArgs(options));
2221
2234
  args.push("--json");
2222
2235
  try {
2223
- return CertsListTransformedResponseSchema.parseAsync(
2236
+ return await CertsListTransformedResponseSchema.parseAsync(
2224
2237
  await this.execFly(args)
2225
2238
  );
2226
2239
  } catch (error) {
@@ -2235,7 +2248,7 @@ ${JSON.stringify(response, null, 2)}`);
2235
2248
  args.push(...this.getAppOrConfigArgs(options));
2236
2249
  args.push("--json");
2237
2250
  try {
2238
- return SecretsListTransformedResponseSchema.parseAsync(
2251
+ return await SecretsListTransformedResponseSchema.parseAsync(
2239
2252
  await this.execFly(args)
2240
2253
  );
2241
2254
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdwr/fly-node",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "description": "The flyctl node wrapper for programmatic deployments to fly.io.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "type": "module",
27
27
  "dependencies": {
28
- "zod": "^3.23.8"
28
+ "zod": "^4.6.7"
29
29
  },
30
30
  "devDependencies": {
31
31
  "dotenv": "^16.4.7",
@@ -105,17 +105,17 @@ export declare const mockPartialStatusResponse: (app?: string) => {
105
105
  name: string;
106
106
  machines: ({
107
107
  id: string;
108
- createdAt: string;
109
108
  name: string;
110
109
  state: string;
111
110
  region: string;
112
111
  imageRef: {
113
- tag: string;
114
- digest: string;
115
112
  registry: string;
116
113
  repository: string;
114
+ tag: string;
115
+ digest: string;
117
116
  labels?: Record<string, string> | undefined;
118
117
  };
118
+ createdAt: string;
119
119
  updatedAt: string;
120
120
  config: {
121
121
  env: Record<string, string>;
@@ -133,10 +133,10 @@ export declare const mockPartialStatusResponse: (app?: string) => {
133
133
  }[];
134
134
  hostStatus: string;
135
135
  checks?: {
136
- status: string;
137
136
  name: string;
138
- updatedAt: string;
137
+ status: string;
139
138
  output: string;
139
+ updatedAt: string;
140
140
  }[] | undefined;
141
141
  } | {
142
142
  id: string;
@@ -147,12 +147,12 @@ export declare const mockPartialStatusResponse: (app?: string) => {
147
147
  updatedAt: string;
148
148
  hostStatus: string;
149
149
  })[];
150
- status: string;
151
150
  deployed: boolean;
152
151
  organization: {
153
152
  id: string;
154
153
  slug: string;
155
154
  };
155
+ status: string;
156
156
  version: number;
157
157
  };
158
158
  /**
@@ -7,14 +7,13 @@ import { z } from 'zod';
7
7
  */
8
8
  export declare const AppIpAddressSchema: z.ZodObject<{
9
9
  address: z.ZodString;
10
- type: z.ZodUnion<[z.ZodEnum<["v4", "v6", "shared_v4", "private_v6"]>, z.ZodString]>;
11
- }, "strip", z.ZodTypeAny, {
12
- type: string;
13
- address: string;
14
- }, {
15
- type: string;
16
- address: string;
17
- }>;
10
+ type: z.ZodUnion<[z.ZodEnum<{
11
+ v4: "v4";
12
+ v6: "v6";
13
+ shared_v4: "shared_v4";
14
+ private_v6: "private_v6";
15
+ }>, z.ZodString]>;
16
+ }, z.core.$strip>;
18
17
  export type AppIpAddress = z.infer<typeof AppIpAddressSchema>;
19
18
  /**
20
19
  * An app's addresses as the Fly GraphQL API returns them.
@@ -28,39 +27,12 @@ export declare const AppIpAddressesApiResponseSchema: z.ZodObject<{
28
27
  ipAddresses: z.ZodObject<{
29
28
  nodes: z.ZodArray<z.ZodObject<{
30
29
  address: z.ZodString;
31
- type: z.ZodUnion<[z.ZodEnum<["v4", "v6", "shared_v4", "private_v6"]>, z.ZodString]>;
32
- }, "strip", z.ZodTypeAny, {
33
- type: string;
34
- address: string;
35
- }, {
36
- type: string;
37
- address: string;
38
- }>, "many">;
39
- }, "strip", z.ZodTypeAny, {
40
- nodes: {
41
- type: string;
42
- address: string;
43
- }[];
44
- }, {
45
- nodes: {
46
- type: string;
47
- address: string;
48
- }[];
49
- }>;
50
- }, "strip", z.ZodTypeAny, {
51
- ipAddresses: {
52
- nodes: {
53
- type: string;
54
- address: string;
55
- }[];
56
- };
57
- sharedIpAddress?: string | null | undefined;
58
- }, {
59
- ipAddresses: {
60
- nodes: {
61
- type: string;
62
- address: string;
63
- }[];
64
- };
65
- sharedIpAddress?: string | null | undefined;
66
- }>;
30
+ type: z.ZodUnion<[z.ZodEnum<{
31
+ v4: "v4";
32
+ v6: "v6";
33
+ shared_v4: "shared_v4";
34
+ private_v6: "private_v6";
35
+ }>, z.ZodString]>;
36
+ }, z.core.$strip>>;
37
+ }, z.core.$strip>;
38
+ }, z.core.$strip>;
@@ -6,16 +6,7 @@ import { z } from 'zod';
6
6
  * fly apps create --app [name] --json
7
7
  * ```
8
8
  */
9
- export declare const AppsCreateTransformedResponseSchema: z.ZodEffects<z.ZodObject<{
9
+ export declare const AppsCreateTransformedResponseSchema: z.ZodPreprocess<z.ZodObject<{
10
10
  id: z.ZodString;
11
11
  name: z.ZodString;
12
- }, "strip", z.ZodTypeAny, {
13
- id: string;
14
- name: string;
15
- }, {
16
- id: string;
17
- name: string;
18
- }>, {
19
- id: string;
20
- name: string;
21
- }, unknown>;
12
+ }, z.core.$strip>, unknown>;
@@ -6,7 +6,7 @@ import { z } from 'zod';
6
6
  * fly apps list --json
7
7
  * ```
8
8
  */
9
- export declare const AppsListTransformedResponseSchema: z.ZodArray<z.ZodEffects<z.ZodObject<{
9
+ export declare const AppsListTransformedResponseSchema: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
10
10
  id: z.ZodString;
11
11
  name: z.ZodString;
12
12
  status: z.ZodString;
@@ -15,63 +15,9 @@ export declare const AppsListTransformedResponseSchema: z.ZodArray<z.ZodEffects<
15
15
  organization: z.ZodObject<{
16
16
  name: z.ZodString;
17
17
  slug: z.ZodString;
18
- }, "strip", z.ZodTypeAny, {
19
- name: string;
20
- slug: string;
21
- }, {
22
- name: string;
23
- slug: string;
24
- }>;
18
+ }, z.core.$strip>;
25
19
  currentRelease: z.ZodNullable<z.ZodObject<{
26
20
  status: z.ZodString;
27
21
  createdAt: z.ZodString;
28
- }, "strip", z.ZodTypeAny, {
29
- status: string;
30
- createdAt: string;
31
- }, {
32
- status: string;
33
- createdAt: string;
34
- }>>;
35
- }, "strip", z.ZodTypeAny, {
36
- status: string;
37
- hostname: string;
38
- id: string;
39
- name: string;
40
- deployed: boolean;
41
- organization: {
42
- name: string;
43
- slug: string;
44
- };
45
- currentRelease: {
46
- status: string;
47
- createdAt: string;
48
- } | null;
49
- }, {
50
- status: string;
51
- hostname: string;
52
- id: string;
53
- name: string;
54
- deployed: boolean;
55
- organization: {
56
- name: string;
57
- slug: string;
58
- };
59
- currentRelease: {
60
- status: string;
61
- createdAt: string;
62
- } | null;
63
- }>, {
64
- status: string;
65
- hostname: string;
66
- id: string;
67
- name: string;
68
- deployed: boolean;
69
- organization: {
70
- name: string;
71
- slug: string;
72
- };
73
- currentRelease: {
74
- status: string;
75
- createdAt: string;
76
- } | null;
77
- }, unknown>, "many">;
22
+ }, z.core.$strip>>;
23
+ }, z.core.$strip>, unknown>>;
@@ -2,10 +2,4 @@ import { z } from 'zod';
2
2
  export declare const BuildResponseSchema: z.ZodObject<{
3
3
  appName: z.ZodString;
4
4
  imageRef: z.ZodString;
5
- }, "strip", z.ZodTypeAny, {
6
- appName: string;
7
- imageRef: string;
8
- }, {
9
- appName: string;
10
- imageRef: string;
11
- }>;
5
+ }, z.core.$strip>;