@cdwr/fly-node 0.3.1 → 0.3.3
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 +43 -0
- package/README.md +7 -1
- package/api.cjs +115 -58
- package/api.js +113 -58
- package/index.cjs +641 -285
- package/index.js +634 -280
- package/package.json +1 -1
- package/src/api.d.ts +1 -0
- package/src/index.d.ts +1 -1
- package/src/lib/fly-api.class.d.ts +21 -1
- package/src/lib/fly.class.d.ts +102 -4
- package/src/lib/mocks.d.ts +70 -1
- package/src/lib/schemas/app-ip-addresses.schema.d.ts +66 -0
- package/src/lib/schemas/apps-list.schema.d.ts +8 -8
- package/src/lib/schemas/certificate.schema.d.ts +12 -12
- package/src/lib/schemas/ip-type.schema.d.ts +14 -0
- package/src/lib/schemas/ips-list.schema.d.ts +65 -0
- package/src/lib/schemas/postgres-list.d.ts +3 -3
- package/src/lib/schemas/status-extended.schema.d.ts +3 -3
- package/src/lib/schemas/status.schema.d.ts +68 -5
- package/src/lib/types.d.ts +15 -0
|
@@ -195,9 +195,9 @@ export declare const StatusExtendedTransformedResponseSchema: z.ZodEffects<z.Zod
|
|
|
195
195
|
name: string;
|
|
196
196
|
}>, "many">;
|
|
197
197
|
}, "strip", z.ZodTypeAny, {
|
|
198
|
+
status: string;
|
|
198
199
|
hostname: string;
|
|
199
200
|
id: string;
|
|
200
|
-
status: string;
|
|
201
201
|
name: string;
|
|
202
202
|
deployed: boolean;
|
|
203
203
|
organization: {
|
|
@@ -248,9 +248,9 @@ export declare const StatusExtendedTransformedResponseSchema: z.ZodEffects<z.Zod
|
|
|
248
248
|
name: string;
|
|
249
249
|
}[];
|
|
250
250
|
}, {
|
|
251
|
+
status: string;
|
|
251
252
|
hostname: string;
|
|
252
253
|
id: string;
|
|
253
|
-
status: string;
|
|
254
254
|
name: string;
|
|
255
255
|
deployed: boolean;
|
|
256
256
|
organization: {
|
|
@@ -301,9 +301,9 @@ export declare const StatusExtendedTransformedResponseSchema: z.ZodEffects<z.Zod
|
|
|
301
301
|
name: string;
|
|
302
302
|
}[];
|
|
303
303
|
}>, {
|
|
304
|
+
status: string;
|
|
304
305
|
hostname: string;
|
|
305
306
|
id: string;
|
|
306
|
-
status: string;
|
|
307
307
|
name: string;
|
|
308
308
|
deployed: boolean;
|
|
309
309
|
organization: {
|
|
@@ -184,9 +184,9 @@ export declare const statusFlyResponseSchema: z.ZodObject<{
|
|
|
184
184
|
status: z.ZodString;
|
|
185
185
|
version: z.ZodNumber;
|
|
186
186
|
}, "strip", z.ZodTypeAny, {
|
|
187
|
+
status: string;
|
|
187
188
|
hostname: string;
|
|
188
189
|
id: string;
|
|
189
|
-
status: string;
|
|
190
190
|
name: string;
|
|
191
191
|
deployed: boolean;
|
|
192
192
|
organization: {
|
|
@@ -231,9 +231,9 @@ export declare const statusFlyResponseSchema: z.ZodObject<{
|
|
|
231
231
|
}[] | undefined;
|
|
232
232
|
}[];
|
|
233
233
|
}, {
|
|
234
|
+
status: string;
|
|
234
235
|
hostname: string;
|
|
235
236
|
id: string;
|
|
236
|
-
status: string;
|
|
237
237
|
name: string;
|
|
238
238
|
deployed: boolean;
|
|
239
239
|
organization: {
|
|
@@ -463,9 +463,9 @@ export declare const StatusTransformedResponseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
463
463
|
status: z.ZodString;
|
|
464
464
|
version: z.ZodNumber;
|
|
465
465
|
}, "strip", z.ZodTypeAny, {
|
|
466
|
+
status: string;
|
|
466
467
|
hostname: string;
|
|
467
468
|
id: string;
|
|
468
|
-
status: string;
|
|
469
469
|
name: string;
|
|
470
470
|
deployed: boolean;
|
|
471
471
|
organization: {
|
|
@@ -510,9 +510,9 @@ export declare const StatusTransformedResponseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
510
510
|
}[] | undefined;
|
|
511
511
|
}[];
|
|
512
512
|
}, {
|
|
513
|
+
status: string;
|
|
513
514
|
hostname: string;
|
|
514
515
|
id: string;
|
|
515
|
-
status: string;
|
|
516
516
|
name: string;
|
|
517
517
|
deployed: boolean;
|
|
518
518
|
organization: {
|
|
@@ -557,9 +557,9 @@ export declare const StatusTransformedResponseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
557
557
|
}[] | undefined;
|
|
558
558
|
}[];
|
|
559
559
|
}>, {
|
|
560
|
+
status: string;
|
|
560
561
|
hostname: string;
|
|
561
562
|
id: string;
|
|
562
|
-
status: string;
|
|
563
563
|
name: string;
|
|
564
564
|
deployed: boolean;
|
|
565
565
|
organization: {
|
|
@@ -604,3 +604,66 @@ export declare const StatusTransformedResponseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
604
604
|
}[] | undefined;
|
|
605
605
|
}[];
|
|
606
606
|
}, unknown>;
|
|
607
|
+
/**
|
|
608
|
+
* Lenient status response schema for internal lookups
|
|
609
|
+
*
|
|
610
|
+
* Fly briefly reports a machine mid-update without `imageRef`, `config` and
|
|
611
|
+
* `events`. A lookup only needs the app name, hostname and each machine's
|
|
612
|
+
* id and state, so everything else is let through unchecked.
|
|
613
|
+
*
|
|
614
|
+
* Internal, not part of the public API.
|
|
615
|
+
*/
|
|
616
|
+
export declare const statusLookupSchema: z.ZodEffects<z.ZodObject<{
|
|
617
|
+
name: z.ZodString;
|
|
618
|
+
hostname: z.ZodString;
|
|
619
|
+
machines: z.ZodArray<z.ZodObject<{
|
|
620
|
+
id: z.ZodString;
|
|
621
|
+
state: z.ZodString;
|
|
622
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
623
|
+
id: z.ZodString;
|
|
624
|
+
state: z.ZodString;
|
|
625
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
626
|
+
id: z.ZodString;
|
|
627
|
+
state: z.ZodString;
|
|
628
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
629
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
630
|
+
name: z.ZodString;
|
|
631
|
+
hostname: z.ZodString;
|
|
632
|
+
machines: z.ZodArray<z.ZodObject<{
|
|
633
|
+
id: z.ZodString;
|
|
634
|
+
state: z.ZodString;
|
|
635
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
636
|
+
id: z.ZodString;
|
|
637
|
+
state: z.ZodString;
|
|
638
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
639
|
+
id: z.ZodString;
|
|
640
|
+
state: z.ZodString;
|
|
641
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
642
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
643
|
+
name: z.ZodString;
|
|
644
|
+
hostname: z.ZodString;
|
|
645
|
+
machines: z.ZodArray<z.ZodObject<{
|
|
646
|
+
id: z.ZodString;
|
|
647
|
+
state: z.ZodString;
|
|
648
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
649
|
+
id: z.ZodString;
|
|
650
|
+
state: z.ZodString;
|
|
651
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
652
|
+
id: z.ZodString;
|
|
653
|
+
state: z.ZodString;
|
|
654
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
655
|
+
}, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
|
|
656
|
+
name: z.ZodString;
|
|
657
|
+
hostname: z.ZodString;
|
|
658
|
+
machines: z.ZodArray<z.ZodObject<{
|
|
659
|
+
id: z.ZodString;
|
|
660
|
+
state: z.ZodString;
|
|
661
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
662
|
+
id: z.ZodString;
|
|
663
|
+
state: z.ZodString;
|
|
664
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
665
|
+
id: z.ZodString;
|
|
666
|
+
state: z.ZodString;
|
|
667
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
668
|
+
}, z.ZodTypeAny, "passthrough">, unknown>;
|
|
669
|
+
export type StatusLookup = z.infer<typeof statusLookupSchema>;
|
package/src/lib/types.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { CertsListWithAppTransformedResponseSchema } from './schemas/certs-list-
|
|
|
6
6
|
import { CertsListTransformedResponseSchema } from './schemas/certs-list.schema';
|
|
7
7
|
import { ConfigShowResponseSchema } from './schemas/config-show.schema';
|
|
8
8
|
import { DeployResponseSchema } from './schemas/deploy.schema';
|
|
9
|
+
import { IpsListTransformedResponseSchema } from './schemas/ips-list.schema';
|
|
9
10
|
import { PostgresListTransformedResponseSchema } from './schemas/postgres-list';
|
|
10
11
|
import { PostgresUsersListTransformedResponseSchema } from './schemas/postgres-users-list';
|
|
11
12
|
import { SecretsListWithAppTransformedResponseSchema } from './schemas/secrets-list-with-app.schema';
|
|
@@ -22,6 +23,20 @@ export type BuildResponse = z.infer<typeof BuildResponseSchema>;
|
|
|
22
23
|
export type DeployResponse = z.infer<typeof DeployResponseSchema>;
|
|
23
24
|
/** List certificates for an application */
|
|
24
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
|
+
};
|
|
25
40
|
/** List certificates for all applications */
|
|
26
41
|
export type ListCertForAllResponse = z.infer<typeof CertsListWithAppTransformedResponseSchema>;
|
|
27
42
|
/** List secrets for an application */
|