@figulus/schema 0.4.0-alpha-dev

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.
Files changed (50) hide show
  1. package/dist/figspec.d.ts +4394 -0
  2. package/dist/figspec.d.ts.map +1 -0
  3. package/dist/figspec.js +214 -0
  4. package/dist/figspec.js.map +1 -0
  5. package/dist/figstack.d.ts +419 -0
  6. package/dist/figstack.d.ts.map +1 -0
  7. package/dist/figstack.js +72 -0
  8. package/dist/figstack.js.map +1 -0
  9. package/dist/health.d.ts +16 -0
  10. package/dist/health.d.ts.map +1 -0
  11. package/dist/health.js +7 -0
  12. package/dist/health.js.map +1 -0
  13. package/dist/image.d.ts +115 -0
  14. package/dist/image.d.ts.map +1 -0
  15. package/dist/image.js +42 -0
  16. package/dist/image.js.map +1 -0
  17. package/dist/index.d.ts +9 -0
  18. package/dist/index.d.ts.map +1 -0
  19. package/dist/index.js +9 -0
  20. package/dist/index.js.map +1 -0
  21. package/dist/run-request.d.ts +244 -0
  22. package/dist/run-request.d.ts.map +1 -0
  23. package/dist/run-request.js +43 -0
  24. package/dist/run-request.js.map +1 -0
  25. package/dist/session.d.ts +447 -0
  26. package/dist/session.d.ts.map +1 -0
  27. package/dist/session.js +78 -0
  28. package/dist/session.js.map +1 -0
  29. package/dist/shared.d.ts +90 -0
  30. package/dist/shared.d.ts.map +1 -0
  31. package/dist/shared.js +41 -0
  32. package/dist/shared.js.map +1 -0
  33. package/dist/volume.d.ts +140 -0
  34. package/dist/volume.d.ts.map +1 -0
  35. package/dist/volume.js +37 -0
  36. package/dist/volume.js.map +1 -0
  37. package/package.json +22 -0
  38. package/src/figspec.ts +279 -0
  39. package/src/figstack.ts +92 -0
  40. package/src/health.ts +8 -0
  41. package/src/image.ts +55 -0
  42. package/src/index.ts +8 -0
  43. package/src/run-request.ts +55 -0
  44. package/src/session.ts +101 -0
  45. package/src/shared.ts +56 -0
  46. package/src/volume.ts +50 -0
  47. package/tests/figspec.test.ts +383 -0
  48. package/tests/schemas.test.ts +187 -0
  49. package/tsconfig.build.json +11 -0
  50. package/tsconfig.json +12 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"figspec.d.ts","sourceRoot":"","sources":["../src/figspec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,iBAAiB;;;;;;;;;EAG5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,qBAAqB;;;;;;;;;;;;EAIhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAYpE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;EAI5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAM9D,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;EAKxC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMxC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAGjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAMtE,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;EAKtC,CAAC;AAEH,eAAO,MAAM,gCAAgC;;;;;;;;;EAG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+1,214 @@
1
+ import { z } from 'zod';
2
+ // ---------------------------------------------------------------------------
3
+ // Shared helpers
4
+ // ---------------------------------------------------------------------------
5
+ export const fileContentSchema = z.object({
6
+ data: z.string(),
7
+ encoding: z.string().optional(),
8
+ });
9
+ export const filePermissionsSchema = z.object({
10
+ read: z.number().int(),
11
+ write: z.number().int(),
12
+ execute: z.number().int(),
13
+ });
14
+ // portMappingSchema is local to figspec; the canonical PortMapping export is in shared.ts.
15
+ const portMappingSchema = z.object({
16
+ container: z.number().int(),
17
+ host: z.number().int().optional(),
18
+ });
19
+ // ---------------------------------------------------------------------------
20
+ // Package installation
21
+ // ---------------------------------------------------------------------------
22
+ export const packageSpecSchema = z.object({
23
+ name: z.string(),
24
+ version: z.string().optional(),
25
+ args: z.array(z.string()).optional(),
26
+ });
27
+ export const installGroupSchema = z.object({
28
+ packageManager: z.string().min(1),
29
+ packages: z.array(z.union([z.string(), packageSpecSchema])),
30
+ globalArgs: z.array(z.string()).optional(),
31
+ });
32
+ // ---------------------------------------------------------------------------
33
+ // Build-time volume mounts
34
+ // ---------------------------------------------------------------------------
35
+ export const buildVolumeMountRegularSchema = z.object({
36
+ type: z.literal('regular'),
37
+ host_path: z.string().optional(),
38
+ container_path: z.string().optional(),
39
+ read_only: z.boolean().optional(),
40
+ });
41
+ export const buildVolumeMountNewFileSchema = z.object({
42
+ type: z.literal('new-file'),
43
+ container_path: z.string(),
44
+ content: fileContentSchema,
45
+ owner: z.string().optional(),
46
+ permissions: filePermissionsSchema.optional(),
47
+ });
48
+ export const buildVolumeMountSchema = z.discriminatedUnion('type', [
49
+ buildVolumeMountRegularSchema,
50
+ buildVolumeMountNewFileSchema,
51
+ ]);
52
+ // ---------------------------------------------------------------------------
53
+ // Run-time volume mounts
54
+ // ---------------------------------------------------------------------------
55
+ export const runVolumeMountRegularSchema = z.object({
56
+ type: z.literal('regular'),
57
+ host_path: z.string().optional(),
58
+ container_path: z.string().optional(),
59
+ read_only: z.boolean().optional(),
60
+ });
61
+ export const runVolumeMountDockerSocketSchema = z.object({
62
+ type: z.literal('docker-socket'),
63
+ container_path: z.string().optional(),
64
+ });
65
+ export const runVolumeMountNewFileSchema = z.object({
66
+ type: z.literal('new-file'),
67
+ container_path: z.string(),
68
+ content: fileContentSchema,
69
+ owner: z.string().optional(),
70
+ permissions: filePermissionsSchema.optional(),
71
+ });
72
+ export const runVolumeMountNamedSchema = z.object({
73
+ type: z.literal('named'),
74
+ name: z.string(),
75
+ container_path: z.string(),
76
+ read_only: z.boolean().optional(),
77
+ });
78
+ export const runVolumeMountAnonymousSchema = z.object({
79
+ type: z.literal('anonymous'),
80
+ container_path: z.string(),
81
+ });
82
+ export const runVolumeMountTmpfsSchema = z.object({
83
+ type: z.literal('tmpfs'),
84
+ container_path: z.string(),
85
+ size_mb: z.number().int().optional(),
86
+ });
87
+ export const runVolumeMountCopyInSchema = z.object({
88
+ type: z.literal('copy-in'),
89
+ host_path: z.string(),
90
+ container_path: z.string(),
91
+ });
92
+ export const runVolumeMountCopyOutSchema = z.object({
93
+ type: z.literal('copy-out'),
94
+ container_path: z.string(),
95
+ host_path: z.string(),
96
+ changed_only: z.boolean().optional(),
97
+ });
98
+ export const runVolumeMountSchema = z.discriminatedUnion('type', [
99
+ runVolumeMountRegularSchema,
100
+ runVolumeMountDockerSocketSchema,
101
+ runVolumeMountNewFileSchema,
102
+ runVolumeMountNamedSchema,
103
+ runVolumeMountAnonymousSchema,
104
+ runVolumeMountTmpfsSchema,
105
+ runVolumeMountCopyInSchema,
106
+ runVolumeMountCopyOutSchema,
107
+ ]);
108
+ // ---------------------------------------------------------------------------
109
+ // Execute model
110
+ // ---------------------------------------------------------------------------
111
+ export const mainCmdOnExitWithCodeSchema = z.object({
112
+ cmd: z.union([z.string(), z.null()]).optional(),
113
+ exitCode: z.number().int(),
114
+ });
115
+ // onExit accepts: null | "persist" | "shutdown" | command-string | dispatch-table
116
+ export const onExitBehaviorSchema = z.union([
117
+ z.string(),
118
+ z.null(),
119
+ z.array(mainCmdOnExitWithCodeSchema),
120
+ ]);
121
+ export const executeStartupCmdSchema = z.object({
122
+ cmd: z.string(),
123
+ async: z.boolean().optional(),
124
+ });
125
+ export const executeMainCmdSchema = z.object({
126
+ cmd: z.string(),
127
+ onExit: onExitBehaviorSchema.optional(),
128
+ parser: z.string().optional(),
129
+ });
130
+ export const executeShutdownCmdSchema = z.object({
131
+ cmd: z.string(),
132
+ });
133
+ export const scheduleExpressionStructSchema = z.object({
134
+ interval: z.number().int().optional(),
135
+ time: z.string().optional(),
136
+ cron: z.string().optional(),
137
+ });
138
+ export const scheduleExpressionSchema = z.union([
139
+ z.string(),
140
+ scheduleExpressionStructSchema,
141
+ ]);
142
+ export const scheduledCmdSchema = z.object({
143
+ cmd: z.string(),
144
+ runAt: scheduleExpressionSchema,
145
+ onExit: onExitBehaviorSchema.optional(),
146
+ parser: z.string().optional(),
147
+ });
148
+ export const figSpecExecuteSchema = z.object({
149
+ startup: z.array(executeStartupCmdSchema).optional(),
150
+ main: executeMainCmdSchema,
151
+ shutdown: z.array(executeShutdownCmdSchema).optional(),
152
+ scheduled: z.array(scheduledCmdSchema).optional(),
153
+ });
154
+ // ---------------------------------------------------------------------------
155
+ // Build spec
156
+ // ---------------------------------------------------------------------------
157
+ export const buildExecuteStepSchema = z.object({
158
+ cmd: z.string().min(1),
159
+ });
160
+ export const figSpecBuildBaseSchema = z.object({
161
+ schemaVersion: z.string().optional(),
162
+ specName: z.string().optional(),
163
+ packagesToInstall: z.array(installGroupSchema).optional(),
164
+ platform: z.string().optional(),
165
+ env: z.record(z.string()).optional(),
166
+ volumes: z.array(buildVolumeMountSchema).optional(),
167
+ execute: z.array(buildExecuteStepSchema).optional(),
168
+ workDir: z.string().optional(),
169
+ user: z.string().optional(),
170
+ });
171
+ export const figSpecBuildStandaloneSchema = figSpecBuildBaseSchema.extend({
172
+ baseImage: z.string(),
173
+ });
174
+ export const figSpecBuildWithBaseSpecSchema = figSpecBuildBaseSchema.extend({
175
+ baseSpec: z.string(),
176
+ baseImage: z.string().optional(),
177
+ });
178
+ export const figSpecBuildSchema = z.union([
179
+ figSpecBuildStandaloneSchema,
180
+ figSpecBuildWithBaseSpecSchema,
181
+ ]);
182
+ // ---------------------------------------------------------------------------
183
+ // Run spec
184
+ // ---------------------------------------------------------------------------
185
+ export const figSpecRunSchema = z.object({
186
+ schemaVersion: z.string().optional(),
187
+ specName: z.string().optional(),
188
+ execute: figSpecExecuteSchema,
189
+ env: z.record(z.string()).optional(),
190
+ secrets: z.record(z.string()).optional(),
191
+ volumes: z.array(runVolumeMountSchema).optional(),
192
+ workDir: z.string().optional(),
193
+ user: z.string().optional(),
194
+ ports: z.array(portMappingSchema).optional(),
195
+ });
196
+ // ---------------------------------------------------------------------------
197
+ // Top-level Figspec document
198
+ // ---------------------------------------------------------------------------
199
+ export const figSpecBuildInputSchema = z.union([
200
+ figSpecBuildSchema,
201
+ z.string(),
202
+ z.array(z.string()),
203
+ ]);
204
+ export const figSpecRunInputSchema = z.union([
205
+ figSpecRunSchema,
206
+ z.string(),
207
+ ]);
208
+ export const figSpecSchema = z.object({
209
+ schemaVersion: z.string(),
210
+ specName: z.string().optional(),
211
+ build: figSpecBuildInputSchema,
212
+ run: figSpecRunInputSchema.optional(),
213
+ });
214
+ //# sourceMappingURL=figspec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"figspec.js","sourceRoot":"","sources":["../src/figspec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8EAA8E;AAC9E,iBAAiB;AACjB,8EAA8E;AAE9E,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAChC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CA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AAC,CAAC;AAGH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC;IAC3C,gBAAgB;IAChB,CAAC,CAAC,MAAM,EAAE;CACX,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;IACzB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,KAAK,EAAE,uBAAuB;IAC9B,GAAG,EAAE,qBAAqB,CAAC,QAAQ,EAAE;CACtC,CAAC,CAAC"}
@@ -0,0 +1,419 @@
1
+ import { z } from 'zod';
2
+ export declare const figStackDependencySchema: z.ZodObject<{
3
+ name: z.ZodString;
4
+ condition: z.ZodOptional<z.ZodDefault<z.ZodEnum<["started", "healthy", "completed"]>>>;
5
+ }, "strip", z.ZodTypeAny, {
6
+ name: string;
7
+ condition?: "completed" | "started" | "healthy" | undefined;
8
+ }, {
9
+ name: string;
10
+ condition?: "completed" | "started" | "healthy" | undefined;
11
+ }>;
12
+ export type FigStackDependency = z.infer<typeof figStackDependencySchema>;
13
+ export declare const figStackHealthCheckSchema: z.ZodObject<{
14
+ type: z.ZodEnum<["exec", "http", "tcp"]>;
15
+ cmd: z.ZodOptional<z.ZodString>;
16
+ path: z.ZodOptional<z.ZodString>;
17
+ port: z.ZodOptional<z.ZodNumber>;
18
+ method: z.ZodOptional<z.ZodEnum<["GET", "HEAD"]>>;
19
+ expectedStatus: z.ZodOptional<z.ZodNumber>;
20
+ intervalSeconds: z.ZodOptional<z.ZodNumber>;
21
+ timeoutSeconds: z.ZodOptional<z.ZodNumber>;
22
+ retries: z.ZodOptional<z.ZodNumber>;
23
+ startPeriodSeconds: z.ZodOptional<z.ZodNumber>;
24
+ }, "strip", z.ZodTypeAny, {
25
+ type: "exec" | "http" | "tcp";
26
+ path?: string | undefined;
27
+ cmd?: string | undefined;
28
+ port?: number | undefined;
29
+ method?: "GET" | "HEAD" | undefined;
30
+ expectedStatus?: number | undefined;
31
+ intervalSeconds?: number | undefined;
32
+ timeoutSeconds?: number | undefined;
33
+ retries?: number | undefined;
34
+ startPeriodSeconds?: number | undefined;
35
+ }, {
36
+ type: "exec" | "http" | "tcp";
37
+ path?: string | undefined;
38
+ cmd?: string | undefined;
39
+ port?: number | undefined;
40
+ method?: "GET" | "HEAD" | undefined;
41
+ expectedStatus?: number | undefined;
42
+ intervalSeconds?: number | undefined;
43
+ timeoutSeconds?: number | undefined;
44
+ retries?: number | undefined;
45
+ startPeriodSeconds?: number | undefined;
46
+ }>;
47
+ export type FigStackHealthCheck = z.infer<typeof figStackHealthCheckSchema>;
48
+ export declare const figStackEntrySchema: z.ZodObject<{
49
+ name: z.ZodString;
50
+ spec: z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodString]>;
51
+ ports: z.ZodOptional<z.ZodArray<z.ZodObject<{
52
+ container: z.ZodNumber;
53
+ host: z.ZodOptional<z.ZodNumber>;
54
+ }, "strip", z.ZodTypeAny, {
55
+ container: number;
56
+ host?: number | undefined;
57
+ }, {
58
+ container: number;
59
+ host?: number | undefined;
60
+ }>, "many">>;
61
+ dependsOn: z.ZodOptional<z.ZodArray<z.ZodObject<{
62
+ name: z.ZodString;
63
+ condition: z.ZodOptional<z.ZodDefault<z.ZodEnum<["started", "healthy", "completed"]>>>;
64
+ }, "strip", z.ZodTypeAny, {
65
+ name: string;
66
+ condition?: "completed" | "started" | "healthy" | undefined;
67
+ }, {
68
+ name: string;
69
+ condition?: "completed" | "started" | "healthy" | undefined;
70
+ }>, "many">>;
71
+ healthCheck: z.ZodOptional<z.ZodObject<{
72
+ type: z.ZodEnum<["exec", "http", "tcp"]>;
73
+ cmd: z.ZodOptional<z.ZodString>;
74
+ path: z.ZodOptional<z.ZodString>;
75
+ port: z.ZodOptional<z.ZodNumber>;
76
+ method: z.ZodOptional<z.ZodEnum<["GET", "HEAD"]>>;
77
+ expectedStatus: z.ZodOptional<z.ZodNumber>;
78
+ intervalSeconds: z.ZodOptional<z.ZodNumber>;
79
+ timeoutSeconds: z.ZodOptional<z.ZodNumber>;
80
+ retries: z.ZodOptional<z.ZodNumber>;
81
+ startPeriodSeconds: z.ZodOptional<z.ZodNumber>;
82
+ }, "strip", z.ZodTypeAny, {
83
+ type: "exec" | "http" | "tcp";
84
+ path?: string | undefined;
85
+ cmd?: string | undefined;
86
+ port?: number | undefined;
87
+ method?: "GET" | "HEAD" | undefined;
88
+ expectedStatus?: number | undefined;
89
+ intervalSeconds?: number | undefined;
90
+ timeoutSeconds?: number | undefined;
91
+ retries?: number | undefined;
92
+ startPeriodSeconds?: number | undefined;
93
+ }, {
94
+ type: "exec" | "http" | "tcp";
95
+ path?: string | undefined;
96
+ cmd?: string | undefined;
97
+ port?: number | undefined;
98
+ method?: "GET" | "HEAD" | undefined;
99
+ expectedStatus?: number | undefined;
100
+ intervalSeconds?: number | undefined;
101
+ timeoutSeconds?: number | undefined;
102
+ retries?: number | undefined;
103
+ startPeriodSeconds?: number | undefined;
104
+ }>>;
105
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
106
+ }, "strip", z.ZodTypeAny, {
107
+ name: string;
108
+ spec: string | Record<string, unknown>;
109
+ env?: Record<string, string> | undefined;
110
+ ports?: {
111
+ container: number;
112
+ host?: number | undefined;
113
+ }[] | undefined;
114
+ dependsOn?: {
115
+ name: string;
116
+ condition?: "completed" | "started" | "healthy" | undefined;
117
+ }[] | undefined;
118
+ healthCheck?: {
119
+ type: "exec" | "http" | "tcp";
120
+ path?: string | undefined;
121
+ cmd?: string | undefined;
122
+ port?: number | undefined;
123
+ method?: "GET" | "HEAD" | undefined;
124
+ expectedStatus?: number | undefined;
125
+ intervalSeconds?: number | undefined;
126
+ timeoutSeconds?: number | undefined;
127
+ retries?: number | undefined;
128
+ startPeriodSeconds?: number | undefined;
129
+ } | undefined;
130
+ }, {
131
+ name: string;
132
+ spec: string | Record<string, unknown>;
133
+ env?: Record<string, string> | undefined;
134
+ ports?: {
135
+ container: number;
136
+ host?: number | undefined;
137
+ }[] | undefined;
138
+ dependsOn?: {
139
+ name: string;
140
+ condition?: "completed" | "started" | "healthy" | undefined;
141
+ }[] | undefined;
142
+ healthCheck?: {
143
+ type: "exec" | "http" | "tcp";
144
+ path?: string | undefined;
145
+ cmd?: string | undefined;
146
+ port?: number | undefined;
147
+ method?: "GET" | "HEAD" | undefined;
148
+ expectedStatus?: number | undefined;
149
+ intervalSeconds?: number | undefined;
150
+ timeoutSeconds?: number | undefined;
151
+ retries?: number | undefined;
152
+ startPeriodSeconds?: number | undefined;
153
+ } | undefined;
154
+ }>;
155
+ export type FigStackEntry = z.infer<typeof figStackEntrySchema>;
156
+ export declare const figStackNetworkConfigSchema: z.ZodObject<{
157
+ name: z.ZodOptional<z.ZodString>;
158
+ subnet: z.ZodOptional<z.ZodString>;
159
+ external: z.ZodOptional<z.ZodString>;
160
+ }, "strip", z.ZodTypeAny, {
161
+ name?: string | undefined;
162
+ subnet?: string | undefined;
163
+ external?: string | undefined;
164
+ }, {
165
+ name?: string | undefined;
166
+ subnet?: string | undefined;
167
+ external?: string | undefined;
168
+ }>;
169
+ export type FigStackNetworkConfig = z.infer<typeof figStackNetworkConfigSchema>;
170
+ export declare const figStackVolumeDeclarationSchema: z.ZodObject<{
171
+ name: z.ZodString;
172
+ external: z.ZodOptional<z.ZodBoolean>;
173
+ }, "strip", z.ZodTypeAny, {
174
+ name: string;
175
+ external?: boolean | undefined;
176
+ }, {
177
+ name: string;
178
+ external?: boolean | undefined;
179
+ }>;
180
+ export type FigStackVolumeDeclaration = z.infer<typeof figStackVolumeDeclarationSchema>;
181
+ export declare const figStackEnvGroupSchema: z.ZodObject<{
182
+ vars: z.ZodRecord<z.ZodString, z.ZodString>;
183
+ inject: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
184
+ }, "strip", z.ZodTypeAny, {
185
+ vars: Record<string, string>;
186
+ inject?: string[] | undefined;
187
+ }, {
188
+ vars: Record<string, string>;
189
+ inject?: string[] | undefined;
190
+ }>;
191
+ export type FigStackEnvGroup = z.infer<typeof figStackEnvGroupSchema>;
192
+ export declare const figStackSchema: z.ZodObject<{
193
+ schemaVersion: z.ZodLiteral<"1.0">;
194
+ stackName: z.ZodString;
195
+ containers: z.ZodArray<z.ZodObject<{
196
+ name: z.ZodString;
197
+ spec: z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodString]>;
198
+ ports: z.ZodOptional<z.ZodArray<z.ZodObject<{
199
+ container: z.ZodNumber;
200
+ host: z.ZodOptional<z.ZodNumber>;
201
+ }, "strip", z.ZodTypeAny, {
202
+ container: number;
203
+ host?: number | undefined;
204
+ }, {
205
+ container: number;
206
+ host?: number | undefined;
207
+ }>, "many">>;
208
+ dependsOn: z.ZodOptional<z.ZodArray<z.ZodObject<{
209
+ name: z.ZodString;
210
+ condition: z.ZodOptional<z.ZodDefault<z.ZodEnum<["started", "healthy", "completed"]>>>;
211
+ }, "strip", z.ZodTypeAny, {
212
+ name: string;
213
+ condition?: "completed" | "started" | "healthy" | undefined;
214
+ }, {
215
+ name: string;
216
+ condition?: "completed" | "started" | "healthy" | undefined;
217
+ }>, "many">>;
218
+ healthCheck: z.ZodOptional<z.ZodObject<{
219
+ type: z.ZodEnum<["exec", "http", "tcp"]>;
220
+ cmd: z.ZodOptional<z.ZodString>;
221
+ path: z.ZodOptional<z.ZodString>;
222
+ port: z.ZodOptional<z.ZodNumber>;
223
+ method: z.ZodOptional<z.ZodEnum<["GET", "HEAD"]>>;
224
+ expectedStatus: z.ZodOptional<z.ZodNumber>;
225
+ intervalSeconds: z.ZodOptional<z.ZodNumber>;
226
+ timeoutSeconds: z.ZodOptional<z.ZodNumber>;
227
+ retries: z.ZodOptional<z.ZodNumber>;
228
+ startPeriodSeconds: z.ZodOptional<z.ZodNumber>;
229
+ }, "strip", z.ZodTypeAny, {
230
+ type: "exec" | "http" | "tcp";
231
+ path?: string | undefined;
232
+ cmd?: string | undefined;
233
+ port?: number | undefined;
234
+ method?: "GET" | "HEAD" | undefined;
235
+ expectedStatus?: number | undefined;
236
+ intervalSeconds?: number | undefined;
237
+ timeoutSeconds?: number | undefined;
238
+ retries?: number | undefined;
239
+ startPeriodSeconds?: number | undefined;
240
+ }, {
241
+ type: "exec" | "http" | "tcp";
242
+ path?: string | undefined;
243
+ cmd?: string | undefined;
244
+ port?: number | undefined;
245
+ method?: "GET" | "HEAD" | undefined;
246
+ expectedStatus?: number | undefined;
247
+ intervalSeconds?: number | undefined;
248
+ timeoutSeconds?: number | undefined;
249
+ retries?: number | undefined;
250
+ startPeriodSeconds?: number | undefined;
251
+ }>>;
252
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
253
+ }, "strip", z.ZodTypeAny, {
254
+ name: string;
255
+ spec: string | Record<string, unknown>;
256
+ env?: Record<string, string> | undefined;
257
+ ports?: {
258
+ container: number;
259
+ host?: number | undefined;
260
+ }[] | undefined;
261
+ dependsOn?: {
262
+ name: string;
263
+ condition?: "completed" | "started" | "healthy" | undefined;
264
+ }[] | undefined;
265
+ healthCheck?: {
266
+ type: "exec" | "http" | "tcp";
267
+ path?: string | undefined;
268
+ cmd?: string | undefined;
269
+ port?: number | undefined;
270
+ method?: "GET" | "HEAD" | undefined;
271
+ expectedStatus?: number | undefined;
272
+ intervalSeconds?: number | undefined;
273
+ timeoutSeconds?: number | undefined;
274
+ retries?: number | undefined;
275
+ startPeriodSeconds?: number | undefined;
276
+ } | undefined;
277
+ }, {
278
+ name: string;
279
+ spec: string | Record<string, unknown>;
280
+ env?: Record<string, string> | undefined;
281
+ ports?: {
282
+ container: number;
283
+ host?: number | undefined;
284
+ }[] | undefined;
285
+ dependsOn?: {
286
+ name: string;
287
+ condition?: "completed" | "started" | "healthy" | undefined;
288
+ }[] | undefined;
289
+ healthCheck?: {
290
+ type: "exec" | "http" | "tcp";
291
+ path?: string | undefined;
292
+ cmd?: string | undefined;
293
+ port?: number | undefined;
294
+ method?: "GET" | "HEAD" | undefined;
295
+ expectedStatus?: number | undefined;
296
+ intervalSeconds?: number | undefined;
297
+ timeoutSeconds?: number | undefined;
298
+ retries?: number | undefined;
299
+ startPeriodSeconds?: number | undefined;
300
+ } | undefined;
301
+ }>, "many">;
302
+ env: z.ZodOptional<z.ZodArray<z.ZodObject<{
303
+ vars: z.ZodRecord<z.ZodString, z.ZodString>;
304
+ inject: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
305
+ }, "strip", z.ZodTypeAny, {
306
+ vars: Record<string, string>;
307
+ inject?: string[] | undefined;
308
+ }, {
309
+ vars: Record<string, string>;
310
+ inject?: string[] | undefined;
311
+ }>, "many">>;
312
+ network: z.ZodOptional<z.ZodObject<{
313
+ name: z.ZodOptional<z.ZodString>;
314
+ subnet: z.ZodOptional<z.ZodString>;
315
+ external: z.ZodOptional<z.ZodString>;
316
+ }, "strip", z.ZodTypeAny, {
317
+ name?: string | undefined;
318
+ subnet?: string | undefined;
319
+ external?: string | undefined;
320
+ }, {
321
+ name?: string | undefined;
322
+ subnet?: string | undefined;
323
+ external?: string | undefined;
324
+ }>>;
325
+ volumes: z.ZodOptional<z.ZodArray<z.ZodObject<{
326
+ name: z.ZodString;
327
+ external: z.ZodOptional<z.ZodBoolean>;
328
+ }, "strip", z.ZodTypeAny, {
329
+ name: string;
330
+ external?: boolean | undefined;
331
+ }, {
332
+ name: string;
333
+ external?: boolean | undefined;
334
+ }>, "many">>;
335
+ }, "strip", z.ZodTypeAny, {
336
+ schemaVersion: "1.0";
337
+ stackName: string;
338
+ containers: {
339
+ name: string;
340
+ spec: string | Record<string, unknown>;
341
+ env?: Record<string, string> | undefined;
342
+ ports?: {
343
+ container: number;
344
+ host?: number | undefined;
345
+ }[] | undefined;
346
+ dependsOn?: {
347
+ name: string;
348
+ condition?: "completed" | "started" | "healthy" | undefined;
349
+ }[] | undefined;
350
+ healthCheck?: {
351
+ type: "exec" | "http" | "tcp";
352
+ path?: string | undefined;
353
+ cmd?: string | undefined;
354
+ port?: number | undefined;
355
+ method?: "GET" | "HEAD" | undefined;
356
+ expectedStatus?: number | undefined;
357
+ intervalSeconds?: number | undefined;
358
+ timeoutSeconds?: number | undefined;
359
+ retries?: number | undefined;
360
+ startPeriodSeconds?: number | undefined;
361
+ } | undefined;
362
+ }[];
363
+ env?: {
364
+ vars: Record<string, string>;
365
+ inject?: string[] | undefined;
366
+ }[] | undefined;
367
+ volumes?: {
368
+ name: string;
369
+ external?: boolean | undefined;
370
+ }[] | undefined;
371
+ network?: {
372
+ name?: string | undefined;
373
+ subnet?: string | undefined;
374
+ external?: string | undefined;
375
+ } | undefined;
376
+ }, {
377
+ schemaVersion: "1.0";
378
+ stackName: string;
379
+ containers: {
380
+ name: string;
381
+ spec: string | Record<string, unknown>;
382
+ env?: Record<string, string> | undefined;
383
+ ports?: {
384
+ container: number;
385
+ host?: number | undefined;
386
+ }[] | undefined;
387
+ dependsOn?: {
388
+ name: string;
389
+ condition?: "completed" | "started" | "healthy" | undefined;
390
+ }[] | undefined;
391
+ healthCheck?: {
392
+ type: "exec" | "http" | "tcp";
393
+ path?: string | undefined;
394
+ cmd?: string | undefined;
395
+ port?: number | undefined;
396
+ method?: "GET" | "HEAD" | undefined;
397
+ expectedStatus?: number | undefined;
398
+ intervalSeconds?: number | undefined;
399
+ timeoutSeconds?: number | undefined;
400
+ retries?: number | undefined;
401
+ startPeriodSeconds?: number | undefined;
402
+ } | undefined;
403
+ }[];
404
+ env?: {
405
+ vars: Record<string, string>;
406
+ inject?: string[] | undefined;
407
+ }[] | undefined;
408
+ volumes?: {
409
+ name: string;
410
+ external?: boolean | undefined;
411
+ }[] | undefined;
412
+ network?: {
413
+ name?: string | undefined;
414
+ subnet?: string | undefined;
415
+ external?: string | undefined;
416
+ } | undefined;
417
+ }>;
418
+ export type FigStack = z.infer<typeof figStackSchema>;
419
+ //# sourceMappingURL=figstack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":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