@figulus/schema 0.4.0-alpha-dev → 0.5.0-alpha-dev-1

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 (192) hide show
  1. package/.openapi-meta/index.ts +12 -0
  2. package/dist/core/entities/figspec.d.ts +659 -0
  3. package/dist/core/entities/figspec.d.ts.map +1 -0
  4. package/dist/core/entities/figspec.js +73 -0
  5. package/dist/core/entities/figspec.js.map +1 -0
  6. package/dist/core/entities/figstack.d.ts +139 -0
  7. package/dist/core/entities/figstack.d.ts.map +1 -0
  8. package/dist/core/entities/figstack.js +79 -0
  9. package/dist/core/entities/figstack.js.map +1 -0
  10. package/dist/core/entities/index.d.ts +3 -0
  11. package/dist/core/entities/index.d.ts.map +1 -0
  12. package/dist/core/entities/index.js +3 -0
  13. package/dist/core/entities/index.js.map +1 -0
  14. package/dist/core/execute.d.ts +64 -0
  15. package/dist/core/execute.d.ts.map +1 -0
  16. package/dist/core/execute.js +45 -0
  17. package/dist/core/execute.js.map +1 -0
  18. package/dist/core/generic.d.ts +35 -0
  19. package/dist/core/generic.d.ts.map +1 -0
  20. package/dist/core/generic.js +28 -0
  21. package/dist/core/generic.js.map +1 -0
  22. package/dist/core/index.d.ts +6 -0
  23. package/dist/core/index.d.ts.map +1 -0
  24. package/dist/core/index.js +6 -0
  25. package/dist/core/index.js.map +1 -0
  26. package/dist/core/primitives.d.ts +3 -0
  27. package/dist/core/primitives.d.ts.map +1 -0
  28. package/dist/core/primitives.js +11 -0
  29. package/dist/core/primitives.js.map +1 -0
  30. package/dist/core/volumes.d.ts +160 -0
  31. package/dist/core/volumes.d.ts.map +1 -0
  32. package/dist/core/volumes.js +100 -0
  33. package/dist/core/volumes.js.map +1 -0
  34. package/dist/engine/deprecated/index.d.ts +2 -0
  35. package/dist/engine/deprecated/index.d.ts.map +1 -0
  36. package/dist/engine/deprecated/index.js +2 -0
  37. package/dist/engine/deprecated/index.js.map +1 -0
  38. package/dist/engine/deprecated/run-request.d.ts +73 -0
  39. package/dist/engine/deprecated/run-request.d.ts.map +1 -0
  40. package/dist/engine/deprecated/run-request.js +47 -0
  41. package/dist/engine/deprecated/run-request.js.map +1 -0
  42. package/dist/engine/dry-run.d.ts +15 -0
  43. package/dist/engine/dry-run.d.ts.map +1 -0
  44. package/dist/engine/dry-run.js +12 -0
  45. package/dist/engine/dry-run.js.map +1 -0
  46. package/dist/engine/health.d.ts +11 -0
  47. package/dist/engine/health.d.ts.map +1 -0
  48. package/dist/engine/health.js +9 -0
  49. package/dist/engine/health.js.map +1 -0
  50. package/dist/engine/images.d.ts +49 -0
  51. package/dist/engine/images.d.ts.map +1 -0
  52. package/dist/engine/images.js +44 -0
  53. package/dist/engine/images.js.map +1 -0
  54. package/dist/engine/index.d.ts +9 -0
  55. package/dist/engine/index.d.ts.map +1 -0
  56. package/dist/engine/index.js +9 -0
  57. package/dist/engine/index.js.map +1 -0
  58. package/dist/engine/paths/containers.d.ts +8 -0
  59. package/dist/engine/paths/containers.d.ts.map +1 -0
  60. package/dist/engine/paths/containers.js +297 -0
  61. package/dist/engine/paths/containers.js.map +1 -0
  62. package/dist/engine/paths/dry-run.d.ts +3 -0
  63. package/dist/engine/paths/dry-run.d.ts.map +1 -0
  64. package/dist/engine/paths/dry-run.js +43 -0
  65. package/dist/engine/paths/dry-run.js.map +1 -0
  66. package/dist/engine/paths/health.d.ts +3 -0
  67. package/dist/engine/paths/health.d.ts.map +1 -0
  68. package/dist/engine/paths/health.js +36 -0
  69. package/dist/engine/paths/health.js.map +1 -0
  70. package/dist/engine/paths/images.d.ts +5 -0
  71. package/dist/engine/paths/images.d.ts.map +1 -0
  72. package/dist/engine/paths/images.js +144 -0
  73. package/dist/engine/paths/images.js.map +1 -0
  74. package/dist/engine/paths/index.d.ts +8 -0
  75. package/dist/engine/paths/index.d.ts.map +1 -0
  76. package/dist/engine/paths/index.js +8 -0
  77. package/dist/engine/paths/index.js.map +1 -0
  78. package/dist/engine/paths/sessions.d.ts +10 -0
  79. package/dist/engine/paths/sessions.d.ts.map +1 -0
  80. package/dist/engine/paths/sessions.js +484 -0
  81. package/dist/engine/paths/sessions.js.map +1 -0
  82. package/dist/engine/paths/stacks.d.ts +6 -0
  83. package/dist/engine/paths/stacks.d.ts.map +1 -0
  84. package/dist/engine/paths/stacks.js +175 -0
  85. package/dist/engine/paths/stacks.js.map +1 -0
  86. package/dist/engine/paths/volumes.d.ts +6 -0
  87. package/dist/engine/paths/volumes.d.ts.map +1 -0
  88. package/dist/engine/paths/volumes.js +164 -0
  89. package/dist/engine/paths/volumes.js.map +1 -0
  90. package/dist/engine/response.d.ts +8 -0
  91. package/dist/engine/response.d.ts.map +1 -0
  92. package/dist/engine/response.js +9 -0
  93. package/dist/engine/response.js.map +1 -0
  94. package/dist/engine/sessions.d.ts +343 -0
  95. package/dist/engine/sessions.d.ts.map +1 -0
  96. package/dist/engine/sessions.js +118 -0
  97. package/dist/engine/sessions.js.map +1 -0
  98. package/dist/engine/volumes.d.ts +52 -0
  99. package/dist/engine/volumes.d.ts.map +1 -0
  100. package/dist/engine/volumes.js +39 -0
  101. package/dist/engine/volumes.js.map +1 -0
  102. package/dist/index.d.ts +2 -8
  103. package/dist/index.d.ts.map +1 -1
  104. package/dist/index.js +2 -8
  105. package/dist/index.js.map +1 -1
  106. package/dist/registry/index.d.ts +3 -0
  107. package/dist/registry/index.d.ts.map +1 -0
  108. package/dist/registry/index.js +3 -0
  109. package/dist/registry/index.js.map +1 -0
  110. package/dist/registry/json-schema.d.ts +82 -0
  111. package/dist/registry/json-schema.d.ts.map +1 -0
  112. package/dist/registry/json-schema.js +149 -0
  113. package/dist/registry/json-schema.js.map +1 -0
  114. package/dist/registry/metadata.d.ts +216 -0
  115. package/dist/registry/metadata.d.ts.map +1 -0
  116. package/dist/registry/metadata.js +143 -0
  117. package/dist/registry/metadata.js.map +1 -0
  118. package/package.json +10 -3
  119. package/scripts/fix-openapi-3.1.ts +183 -0
  120. package/scripts/generate-openapi-data.ts +51 -0
  121. package/scripts/generate-openapi-meta.ts +540 -0
  122. package/src/core/entities/figspec.ts +94 -0
  123. package/src/core/entities/figstack.ts +101 -0
  124. package/src/core/entities/index.ts +2 -0
  125. package/src/core/execute.ts +66 -0
  126. package/src/core/generic.ts +38 -0
  127. package/src/core/index.ts +5 -0
  128. package/src/core/primitives.ts +12 -0
  129. package/src/core/volumes.ts +124 -0
  130. package/src/engine/deprecated/index.ts +1 -0
  131. package/src/engine/deprecated/run-request.ts +53 -0
  132. package/src/engine/dry-run.ts +14 -0
  133. package/src/engine/health.ts +11 -0
  134. package/src/engine/images.ts +58 -0
  135. package/src/engine/index.ts +8 -0
  136. package/src/engine/paths/containers.ts +304 -0
  137. package/src/engine/paths/dry-run.ts +44 -0
  138. package/src/engine/paths/health.ts +37 -0
  139. package/src/engine/paths/images.ts +148 -0
  140. package/src/engine/paths/index.ts +7 -0
  141. package/src/engine/paths/sessions.ts +493 -0
  142. package/src/engine/paths/stacks.ts +179 -0
  143. package/src/engine/paths/volumes.ts +168 -0
  144. package/src/engine/response.ts +11 -0
  145. package/src/engine/sessions.ts +146 -0
  146. package/src/engine/volumes.ts +53 -0
  147. package/src/index.ts +2 -8
  148. package/src/registry/index.ts +2 -0
  149. package/src/registry/json-schema.ts +178 -0
  150. package/src/registry/metadata.ts +181 -0
  151. package/tests/figspec.test.ts +1 -1
  152. package/tests/schemas.test.ts +31 -31
  153. package/dist/figspec.d.ts +0 -4394
  154. package/dist/figspec.d.ts.map +0 -1
  155. package/dist/figspec.js +0 -214
  156. package/dist/figspec.js.map +0 -1
  157. package/dist/figstack.d.ts +0 -419
  158. package/dist/figstack.d.ts.map +0 -1
  159. package/dist/figstack.js +0 -72
  160. package/dist/figstack.js.map +0 -1
  161. package/dist/health.d.ts +0 -16
  162. package/dist/health.d.ts.map +0 -1
  163. package/dist/health.js +0 -7
  164. package/dist/health.js.map +0 -1
  165. package/dist/image.d.ts +0 -115
  166. package/dist/image.d.ts.map +0 -1
  167. package/dist/image.js +0 -42
  168. package/dist/image.js.map +0 -1
  169. package/dist/run-request.d.ts +0 -244
  170. package/dist/run-request.d.ts.map +0 -1
  171. package/dist/run-request.js +0 -43
  172. package/dist/run-request.js.map +0 -1
  173. package/dist/session.d.ts +0 -447
  174. package/dist/session.d.ts.map +0 -1
  175. package/dist/session.js +0 -78
  176. package/dist/session.js.map +0 -1
  177. package/dist/shared.d.ts +0 -90
  178. package/dist/shared.d.ts.map +0 -1
  179. package/dist/shared.js +0 -41
  180. package/dist/shared.js.map +0 -1
  181. package/dist/volume.d.ts +0 -140
  182. package/dist/volume.d.ts.map +0 -1
  183. package/dist/volume.js +0 -37
  184. package/dist/volume.js.map +0 -1
  185. package/src/figspec.ts +0 -279
  186. package/src/figstack.ts +0 -92
  187. package/src/health.ts +0 -8
  188. package/src/image.ts +0 -55
  189. package/src/run-request.ts +0 -55
  190. package/src/session.ts +0 -101
  191. package/src/shared.ts +0 -56
  192. package/src/volume.ts +0 -50
package/dist/volume.d.ts DELETED
@@ -1,140 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const EnsureVolumeRequestSchema: z.ZodObject<{
3
- volume_name: z.ZodString;
4
- driver: z.ZodOptional<z.ZodString>;
5
- labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
6
- }, "strip", z.ZodTypeAny, {
7
- volume_name: string;
8
- driver?: string | undefined;
9
- labels?: Record<string, string> | undefined;
10
- }, {
11
- volume_name: string;
12
- driver?: string | undefined;
13
- labels?: Record<string, string> | undefined;
14
- }>;
15
- export type EnsureVolumeRequest = z.infer<typeof EnsureVolumeRequestSchema>;
16
- export declare const EnsureVolumeResponseSchema: z.ZodObject<{
17
- volume_name: z.ZodString;
18
- created: z.ZodBoolean;
19
- message: z.ZodOptional<z.ZodString>;
20
- }, "strip", z.ZodTypeAny, {
21
- volume_name: string;
22
- created: boolean;
23
- message?: string | undefined;
24
- }, {
25
- volume_name: string;
26
- created: boolean;
27
- message?: string | undefined;
28
- }>;
29
- export type EnsureVolumeResponse = z.infer<typeof EnsureVolumeResponseSchema>;
30
- export declare const VolumeInfoSchema: z.ZodObject<{
31
- name: z.ZodString;
32
- driver: z.ZodString;
33
- mountpoint: z.ZodString;
34
- created_at: z.ZodString;
35
- labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
36
- scope: z.ZodString;
37
- size_bytes: z.ZodOptional<z.ZodNumber>;
38
- }, "strip", z.ZodTypeAny, {
39
- name: string;
40
- driver: string;
41
- mountpoint: string;
42
- created_at: string;
43
- scope: string;
44
- labels?: Record<string, string> | undefined;
45
- size_bytes?: number | undefined;
46
- }, {
47
- name: string;
48
- driver: string;
49
- mountpoint: string;
50
- created_at: string;
51
- scope: string;
52
- labels?: Record<string, string> | undefined;
53
- size_bytes?: number | undefined;
54
- }>;
55
- export type VolumeInfo = z.infer<typeof VolumeInfoSchema>;
56
- export declare const ListVolumesResponseSchema: z.ZodObject<{
57
- volumes: z.ZodArray<z.ZodObject<{
58
- name: z.ZodString;
59
- driver: z.ZodString;
60
- mountpoint: z.ZodString;
61
- created_at: z.ZodString;
62
- labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
63
- scope: z.ZodString;
64
- size_bytes: z.ZodOptional<z.ZodNumber>;
65
- }, "strip", z.ZodTypeAny, {
66
- name: string;
67
- driver: string;
68
- mountpoint: string;
69
- created_at: string;
70
- scope: string;
71
- labels?: Record<string, string> | undefined;
72
- size_bytes?: number | undefined;
73
- }, {
74
- name: string;
75
- driver: string;
76
- mountpoint: string;
77
- created_at: string;
78
- scope: string;
79
- labels?: Record<string, string> | undefined;
80
- size_bytes?: number | undefined;
81
- }>, "many">;
82
- count: z.ZodNumber;
83
- }, "strip", z.ZodTypeAny, {
84
- volumes: {
85
- name: string;
86
- driver: string;
87
- mountpoint: string;
88
- created_at: string;
89
- scope: string;
90
- labels?: Record<string, string> | undefined;
91
- size_bytes?: number | undefined;
92
- }[];
93
- count: number;
94
- }, {
95
- volumes: {
96
- name: string;
97
- driver: string;
98
- mountpoint: string;
99
- created_at: string;
100
- scope: string;
101
- labels?: Record<string, string> | undefined;
102
- size_bytes?: number | undefined;
103
- }[];
104
- count: number;
105
- }>;
106
- export type ListVolumesResponse = z.infer<typeof ListVolumesResponseSchema>;
107
- export declare const DeleteVolumeResponseSchema: z.ZodObject<{
108
- volume_name: z.ZodString;
109
- message: z.ZodString;
110
- }, "strip", z.ZodTypeAny, {
111
- message: string;
112
- volume_name: string;
113
- }, {
114
- message: string;
115
- volume_name: string;
116
- }>;
117
- export type DeleteVolumeResponse = z.infer<typeof DeleteVolumeResponseSchema>;
118
- export declare const PruneVolumesRequestSchema: z.ZodObject<{
119
- filters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
120
- }, "strip", z.ZodTypeAny, {
121
- filters?: Record<string, string[]> | undefined;
122
- }, {
123
- filters?: Record<string, string[]> | undefined;
124
- }>;
125
- export type PruneVolumesRequest = z.infer<typeof PruneVolumesRequestSchema>;
126
- export declare const PruneVolumesResponseSchema: z.ZodObject<{
127
- volumes_deleted: z.ZodArray<z.ZodString, "many">;
128
- space_reclaimed: z.ZodNumber;
129
- message: z.ZodString;
130
- }, "strip", z.ZodTypeAny, {
131
- message: string;
132
- volumes_deleted: string[];
133
- space_reclaimed: number;
134
- }, {
135
- message: string;
136
- volumes_deleted: string[];
137
- space_reclaimed: number;
138
- }>;
139
- export type PruneVolumesResponse = z.infer<typeof PruneVolumesResponseSchema>;
140
- //# sourceMappingURL=volume.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"volume.d.ts","sourceRoot":"","sources":["../src/volume.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,yBAAyB;;;;;;;;;;;;EAIpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,0BAA0B;;;;;;;;;;;;EAIrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;EAQ3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,0BAA0B;;;;;;;;;EAGrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,yBAAyB;;;;;;EAEpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,0BAA0B;;;;;;;;;;;;EAIrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
package/dist/volume.js DELETED
@@ -1,37 +0,0 @@
1
- import { z } from 'zod';
2
- export const EnsureVolumeRequestSchema = z.object({
3
- volume_name: z.string().min(1),
4
- driver: z.string().optional(),
5
- labels: z.record(z.string()).optional(),
6
- });
7
- export const EnsureVolumeResponseSchema = z.object({
8
- volume_name: z.string(),
9
- created: z.boolean(),
10
- message: z.string().optional(),
11
- });
12
- export const VolumeInfoSchema = z.object({
13
- name: z.string(),
14
- driver: z.string(),
15
- mountpoint: z.string(),
16
- created_at: z.string(),
17
- labels: z.record(z.string()).optional(),
18
- scope: z.string(),
19
- size_bytes: z.number().int().optional(),
20
- });
21
- export const ListVolumesResponseSchema = z.object({
22
- volumes: z.array(VolumeInfoSchema),
23
- count: z.number().int(),
24
- });
25
- export const DeleteVolumeResponseSchema = z.object({
26
- volume_name: z.string(),
27
- message: z.string(),
28
- });
29
- export const PruneVolumesRequestSchema = z.object({
30
- filters: z.record(z.array(z.string())).optional(),
31
- });
32
- export const PruneVolumesResponseSchema = z.object({
33
- volumes_deleted: z.array(z.string()),
34
- space_reclaimed: z.number().int(),
35
- message: z.string(),
36
- });
37
- //# sourceMappingURL=volume.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"volume.js","sourceRoot":"","sources":["../src/volume.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CACxC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACvC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;CACxC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC;IAClC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;CACxB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE;CAClD,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,eAAe,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACpC,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IACjC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC,CAAC"}
package/src/figspec.ts DELETED
@@ -1,279 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- // ---------------------------------------------------------------------------
4
- // Shared helpers
5
- // ---------------------------------------------------------------------------
6
-
7
- export const fileContentSchema = z.object({
8
- data: z.string(),
9
- encoding: z.string().optional(),
10
- });
11
- export type FileContent = z.infer<typeof fileContentSchema>;
12
-
13
- export const filePermissionsSchema = z.object({
14
- read: z.number().int(),
15
- write: z.number().int(),
16
- execute: z.number().int(),
17
- });
18
- export type FilePermissions = z.infer<typeof filePermissionsSchema>;
19
-
20
- // portMappingSchema is local to figspec; the canonical PortMapping export is in shared.ts.
21
- const portMappingSchema = z.object({
22
- container: z.number().int(),
23
- host: z.number().int().optional(),
24
- });
25
-
26
- // ---------------------------------------------------------------------------
27
- // Package installation
28
- // ---------------------------------------------------------------------------
29
-
30
- export const packageSpecSchema = z.object({
31
- name: z.string(),
32
- version: z.string().optional(),
33
- args: z.array(z.string()).optional(),
34
- });
35
- export type PackageSpec = z.infer<typeof packageSpecSchema>;
36
-
37
- export const installGroupSchema = z.object({
38
- packageManager: z.string().min(1),
39
- packages: z.array(z.union([z.string(), packageSpecSchema])),
40
- globalArgs: z.array(z.string()).optional(),
41
- });
42
- export type InstallGroup = z.infer<typeof installGroupSchema>;
43
-
44
- // ---------------------------------------------------------------------------
45
- // Build-time volume mounts
46
- // ---------------------------------------------------------------------------
47
-
48
- export const buildVolumeMountRegularSchema = z.object({
49
- type: z.literal('regular'),
50
- host_path: z.string().optional(),
51
- container_path: z.string().optional(),
52
- read_only: z.boolean().optional(),
53
- });
54
-
55
- export const buildVolumeMountNewFileSchema = z.object({
56
- type: z.literal('new-file'),
57
- container_path: z.string(),
58
- content: fileContentSchema,
59
- owner: z.string().optional(),
60
- permissions: filePermissionsSchema.optional(),
61
- });
62
-
63
- export const buildVolumeMountSchema = z.discriminatedUnion('type', [
64
- buildVolumeMountRegularSchema,
65
- buildVolumeMountNewFileSchema,
66
- ]);
67
- export type BuildVolumeMount = z.infer<typeof buildVolumeMountSchema>;
68
-
69
- // ---------------------------------------------------------------------------
70
- // Run-time volume mounts
71
- // ---------------------------------------------------------------------------
72
-
73
- export const runVolumeMountRegularSchema = z.object({
74
- type: z.literal('regular'),
75
- host_path: z.string().optional(),
76
- container_path: z.string().optional(),
77
- read_only: z.boolean().optional(),
78
- });
79
-
80
- export const runVolumeMountDockerSocketSchema = z.object({
81
- type: z.literal('docker-socket'),
82
- container_path: z.string().optional(),
83
- });
84
-
85
- export const runVolumeMountNewFileSchema = z.object({
86
- type: z.literal('new-file'),
87
- container_path: z.string(),
88
- content: fileContentSchema,
89
- owner: z.string().optional(),
90
- permissions: filePermissionsSchema.optional(),
91
- });
92
-
93
- export const runVolumeMountNamedSchema = z.object({
94
- type: z.literal('named'),
95
- name: z.string(),
96
- container_path: z.string(),
97
- read_only: z.boolean().optional(),
98
- });
99
-
100
- export const runVolumeMountAnonymousSchema = z.object({
101
- type: z.literal('anonymous'),
102
- container_path: z.string(),
103
- });
104
-
105
- export const runVolumeMountTmpfsSchema = z.object({
106
- type: z.literal('tmpfs'),
107
- container_path: z.string(),
108
- size_mb: z.number().int().optional(),
109
- });
110
-
111
- export const runVolumeMountCopyInSchema = z.object({
112
- type: z.literal('copy-in'),
113
- host_path: z.string(),
114
- container_path: z.string(),
115
- });
116
-
117
- export const runVolumeMountCopyOutSchema = z.object({
118
- type: z.literal('copy-out'),
119
- container_path: z.string(),
120
- host_path: z.string(),
121
- changed_only: z.boolean().optional(),
122
- });
123
-
124
- export const runVolumeMountSchema = z.discriminatedUnion('type', [
125
- runVolumeMountRegularSchema,
126
- runVolumeMountDockerSocketSchema,
127
- runVolumeMountNewFileSchema,
128
- runVolumeMountNamedSchema,
129
- runVolumeMountAnonymousSchema,
130
- runVolumeMountTmpfsSchema,
131
- runVolumeMountCopyInSchema,
132
- runVolumeMountCopyOutSchema,
133
- ]);
134
- export type RunVolumeMount = z.infer<typeof runVolumeMountSchema>;
135
-
136
- // ---------------------------------------------------------------------------
137
- // Execute model
138
- // ---------------------------------------------------------------------------
139
-
140
- export const mainCmdOnExitWithCodeSchema = z.object({
141
- cmd: z.union([z.string(), z.null()]).optional(),
142
- exitCode: z.number().int(),
143
- });
144
- export type MainCmdOnExitWithCode = z.infer<typeof mainCmdOnExitWithCodeSchema>;
145
-
146
- // onExit accepts: null | "persist" | "shutdown" | command-string | dispatch-table
147
- export const onExitBehaviorSchema = z.union([
148
- z.string(),
149
- z.null(),
150
- z.array(mainCmdOnExitWithCodeSchema),
151
- ]);
152
- export type OnExitBehavior = z.infer<typeof onExitBehaviorSchema>;
153
-
154
- export const executeStartupCmdSchema = z.object({
155
- cmd: z.string(),
156
- async: z.boolean().optional(),
157
- });
158
- export type ExecuteStartupCmd = z.infer<typeof executeStartupCmdSchema>;
159
-
160
- export const executeMainCmdSchema = z.object({
161
- cmd: z.string(),
162
- onExit: onExitBehaviorSchema.optional(),
163
- parser: z.string().optional(),
164
- });
165
- export type ExecuteMainCmd = z.infer<typeof executeMainCmdSchema>;
166
-
167
- export const executeShutdownCmdSchema = z.object({
168
- cmd: z.string(),
169
- });
170
- export type ExecuteShutdownCmd = z.infer<typeof executeShutdownCmdSchema>;
171
-
172
- export const scheduleExpressionStructSchema = z.object({
173
- interval: z.number().int().optional(),
174
- time: z.string().optional(),
175
- cron: z.string().optional(),
176
- });
177
- export type ScheduleExpressionStruct = z.infer<typeof scheduleExpressionStructSchema>;
178
-
179
- export const scheduleExpressionSchema = z.union([
180
- z.string(),
181
- scheduleExpressionStructSchema,
182
- ]);
183
- export type ScheduleExpression = z.infer<typeof scheduleExpressionSchema>;
184
-
185
- export const scheduledCmdSchema = z.object({
186
- cmd: z.string(),
187
- runAt: scheduleExpressionSchema,
188
- onExit: onExitBehaviorSchema.optional(),
189
- parser: z.string().optional(),
190
- });
191
- export type ScheduledCmd = z.infer<typeof scheduledCmdSchema>;
192
-
193
- export const figSpecExecuteSchema = z.object({
194
- startup: z.array(executeStartupCmdSchema).optional(),
195
- main: executeMainCmdSchema,
196
- shutdown: z.array(executeShutdownCmdSchema).optional(),
197
- scheduled: z.array(scheduledCmdSchema).optional(),
198
- });
199
- export type FigSpecExecute = z.infer<typeof figSpecExecuteSchema>;
200
-
201
- // ---------------------------------------------------------------------------
202
- // Build spec
203
- // ---------------------------------------------------------------------------
204
-
205
- export const buildExecuteStepSchema = z.object({
206
- cmd: z.string().min(1),
207
- });
208
- export type BuildExecuteStep = z.infer<typeof buildExecuteStepSchema>;
209
-
210
- export const figSpecBuildBaseSchema = z.object({
211
- schemaVersion: z.string().optional(),
212
- specName: z.string().optional(),
213
- packagesToInstall: z.array(installGroupSchema).optional(),
214
- platform: z.string().optional(),
215
- env: z.record(z.string()).optional(),
216
- volumes: z.array(buildVolumeMountSchema).optional(),
217
- execute: z.array(buildExecuteStepSchema).optional(),
218
- workDir: z.string().optional(),
219
- user: z.string().optional(),
220
- });
221
-
222
- export const figSpecBuildStandaloneSchema = figSpecBuildBaseSchema.extend({
223
- baseImage: z.string(),
224
- });
225
- export type FigSpecBuildStandalone = z.infer<typeof figSpecBuildStandaloneSchema>;
226
-
227
- export const figSpecBuildWithBaseSpecSchema = figSpecBuildBaseSchema.extend({
228
- baseSpec: z.string(),
229
- baseImage: z.string().optional(),
230
- });
231
- export type FigSpecBuildWithBaseSpec = z.infer<typeof figSpecBuildWithBaseSpecSchema>;
232
-
233
- export const figSpecBuildSchema = z.union([
234
- figSpecBuildStandaloneSchema,
235
- figSpecBuildWithBaseSpecSchema,
236
- ]);
237
- export type FigSpecBuild = z.infer<typeof figSpecBuildSchema>;
238
-
239
- // ---------------------------------------------------------------------------
240
- // Run spec
241
- // ---------------------------------------------------------------------------
242
-
243
- export const figSpecRunSchema = z.object({
244
- schemaVersion: z.string().optional(),
245
- specName: z.string().optional(),
246
- execute: figSpecExecuteSchema,
247
- env: z.record(z.string()).optional(),
248
- secrets: z.record(z.string()).optional(),
249
- volumes: z.array(runVolumeMountSchema).optional(),
250
- workDir: z.string().optional(),
251
- user: z.string().optional(),
252
- ports: z.array(portMappingSchema).optional(),
253
- });
254
- export type FigSpecRun = z.infer<typeof figSpecRunSchema>;
255
-
256
- // ---------------------------------------------------------------------------
257
- // Top-level Figspec document
258
- // ---------------------------------------------------------------------------
259
-
260
- export const figSpecBuildInputSchema = z.union([
261
- figSpecBuildSchema,
262
- z.string(),
263
- z.array(z.string()),
264
- ]);
265
- export type FigSpecBuildInput = z.infer<typeof figSpecBuildInputSchema>;
266
-
267
- export const figSpecRunInputSchema = z.union([
268
- figSpecRunSchema,
269
- z.string(),
270
- ]);
271
- export type FigSpecRunInput = z.infer<typeof figSpecRunInputSchema>;
272
-
273
- export const figSpecSchema = z.object({
274
- schemaVersion: z.string(),
275
- specName: z.string().optional(),
276
- build: figSpecBuildInputSchema,
277
- run: figSpecRunInputSchema.optional(),
278
- });
279
- export type FigSpec = z.infer<typeof figSpecSchema>;
package/src/figstack.ts DELETED
@@ -1,92 +0,0 @@
1
- import { z } from 'zod';
2
- import { PortMappingSchema } from './shared.js';
3
-
4
- // ---------------------------------------------------------------------------
5
- // FigStackDependency
6
- // ---------------------------------------------------------------------------
7
-
8
- export const figStackDependencySchema = z.object({
9
- name: z.string().min(1),
10
- condition: z.enum(['started', 'healthy', 'completed']).default('started').optional(),
11
- });
12
- export type FigStackDependency = z.infer<typeof figStackDependencySchema>;
13
-
14
- // ---------------------------------------------------------------------------
15
- // FigStackHealthCheck (discriminated union flattened into one object)
16
- // ---------------------------------------------------------------------------
17
-
18
- export const figStackHealthCheckSchema = z.object({
19
- type: z.enum(['exec', 'http', 'tcp']),
20
- // exec
21
- cmd: z.string().optional(),
22
- // http
23
- path: z.string().optional(),
24
- port: z.number().int().optional(),
25
- method: z.enum(['GET', 'HEAD']).optional(),
26
- expectedStatus: z.number().int().optional(),
27
- // shared timing
28
- intervalSeconds: z.number().int().optional(),
29
- timeoutSeconds: z.number().int().optional(),
30
- retries: z.number().int().optional(),
31
- startPeriodSeconds: z.number().int().optional(),
32
- });
33
- export type FigStackHealthCheck = z.infer<typeof figStackHealthCheckSchema>;
34
-
35
- // ---------------------------------------------------------------------------
36
- // FigStackEntry
37
- // ---------------------------------------------------------------------------
38
-
39
- export const figStackEntrySchema = z.object({
40
- name: z.string().min(1),
41
- spec: z.union([z.record(z.unknown()), z.string()]),
42
- ports: z.array(PortMappingSchema).optional(),
43
- dependsOn: z.array(figStackDependencySchema).optional(),
44
- healthCheck: figStackHealthCheckSchema.optional(),
45
- env: z.record(z.string()).optional(),
46
- });
47
- export type FigStackEntry = z.infer<typeof figStackEntrySchema>;
48
-
49
- // ---------------------------------------------------------------------------
50
- // FigStackNetworkConfig
51
- // ---------------------------------------------------------------------------
52
-
53
- export const figStackNetworkConfigSchema = z.object({
54
- name: z.string().optional(),
55
- subnet: z.string().optional(),
56
- external: z.string().optional(),
57
- });
58
- export type FigStackNetworkConfig = z.infer<typeof figStackNetworkConfigSchema>;
59
-
60
- // ---------------------------------------------------------------------------
61
- // FigStackVolumeDeclaration
62
- // ---------------------------------------------------------------------------
63
-
64
- export const figStackVolumeDeclarationSchema = z.object({
65
- name: z.string().min(1),
66
- external: z.boolean().optional(),
67
- });
68
- export type FigStackVolumeDeclaration = z.infer<typeof figStackVolumeDeclarationSchema>;
69
-
70
- // ---------------------------------------------------------------------------
71
- // FigStackEnvGroup
72
- // ---------------------------------------------------------------------------
73
-
74
- export const figStackEnvGroupSchema = z.object({
75
- vars: z.record(z.string()),
76
- inject: z.array(z.string()).optional(),
77
- });
78
- export type FigStackEnvGroup = z.infer<typeof figStackEnvGroupSchema>;
79
-
80
- // ---------------------------------------------------------------------------
81
- // FigStack (top-level)
82
- // ---------------------------------------------------------------------------
83
-
84
- export const figStackSchema = z.object({
85
- schemaVersion: z.literal('1.0'),
86
- stackName: z.string().min(1),
87
- containers: z.array(figStackEntrySchema).min(1),
88
- env: z.array(figStackEnvGroupSchema).optional(),
89
- network: figStackNetworkConfigSchema.optional(),
90
- volumes: z.array(figStackVolumeDeclarationSchema).optional(),
91
- });
92
- export type FigStack = z.infer<typeof figStackSchema>;
package/src/health.ts DELETED
@@ -1,8 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- export const HealthResponseSchema = z.object({
4
- status: z.enum(['healthy', 'unhealthy']),
5
- docker_api: z.string().optional(),
6
- message: z.string().optional(),
7
- });
8
- export type HealthResponse = z.infer<typeof HealthResponseSchema>;
package/src/image.ts DELETED
@@ -1,55 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- export const BuildImageRequestSchema = z.object({
4
- spec: z.record(z.unknown()),
5
- platform: z.string().optional(),
6
- parser_script: z.string().optional(),
7
- root_dir: z.string().optional(),
8
- });
9
- export type BuildImageRequest = z.infer<typeof BuildImageRequestSchema>;
10
-
11
- export const BuildImageResponseSchema = z.object({
12
- image_tag: z.string().min(1),
13
- hash: z.string().min(1),
14
- cached: z.boolean(),
15
- message: z.string().optional(),
16
- });
17
- export type BuildImageResponse = z.infer<typeof BuildImageResponseSchema>;
18
-
19
- export const PruneImagesRequestSchema = z.object({
20
- retention_days: z.number().int().min(1).optional(),
21
- all: z.boolean().optional(),
22
- });
23
- export type PruneImagesRequest = z.infer<typeof PruneImagesRequestSchema>;
24
-
25
- export const PruneImagesResponseSchema = z.object({
26
- removed: z.number().int(),
27
- bytes_freed: z.number().int(),
28
- mb_freed: z.number(),
29
- message: z.string(),
30
- docker_images_pruned: z.number().int().optional(),
31
- docker_bytes_freed: z.number().int().optional(),
32
- });
33
- export type PruneImagesResponse = z.infer<typeof PruneImagesResponseSchema>;
34
-
35
- export const PruneCacheResponseSchema = z.object({
36
- freed_bytes: z.number().int(),
37
- });
38
- export type PruneCacheResponse = z.infer<typeof PruneCacheResponseSchema>;
39
-
40
- export const ExtractArtifactsRequestSchema = z.object({
41
- container_id: z.string().min(1),
42
- container_path: z.string().min(1),
43
- host_path: z.string().min(1),
44
- });
45
- export type ExtractArtifactsRequest = z.infer<typeof ExtractArtifactsRequestSchema>;
46
-
47
- export const ExtractArtifactsResponseSchema = z.object({
48
- container_id: z.string(),
49
- container_path: z.string(),
50
- host_path: z.string(),
51
- files_count: z.number().int().optional(),
52
- total_bytes: z.number().int().optional(),
53
- message: z.string(),
54
- });
55
- export type ExtractArtifactsResponse = z.infer<typeof ExtractArtifactsResponseSchema>;
@@ -1,55 +0,0 @@
1
- import { z } from 'zod';
2
- import {
3
- JobStatusSchema,
4
- ParsedOutputSchema,
5
- ResourceLimitsSchema,
6
- VolumeMountSchema,
7
- NamedVolumeMountSchema,
8
- PortMappingSchema,
9
- } from './shared.js';
10
-
11
- export const RunRequestSchema = z.object({
12
- job_id: z.string().min(1),
13
- image: z.string().min(1),
14
- command: z.array(z.string()).optional(),
15
- environment: z.record(z.string()).optional(),
16
- volumes: z.array(VolumeMountSchema).optional(),
17
- named_volumes: z.array(NamedVolumeMountSchema).optional(),
18
- resources: ResourceLimitsSchema.optional(),
19
- timeout: z.number().int().positive().max(86400).optional(),
20
- parser_script: z.string().optional(),
21
- root_dir: z.string().optional(),
22
- env_files: z.array(z.string()).optional(),
23
- secrets: z.record(z.string()).optional(),
24
- extra_hosts: z.array(z.string()).optional(),
25
- network_mode: z.string().optional(),
26
- working_dir: z.string().optional(),
27
- ports: z.array(PortMappingSchema).optional(),
28
- });
29
- export type RunRequest = z.infer<typeof RunRequestSchema>;
30
-
31
- export const RunResponseSchema = z.object({
32
- job_id: z.string(),
33
- status: JobStatusSchema,
34
- message: z.string().optional(),
35
- container_id: z.string().optional(),
36
- exit_code: z.number().int().nullable().optional(),
37
- stdout: z.string().optional(),
38
- stderr: z.string().optional(),
39
- parsed_output: ParsedOutputSchema.optional(),
40
- started_at: z.string().datetime().optional(),
41
- completed_at: z.string().datetime().optional(),
42
- duration: z.number().optional(),
43
- command: z.array(z.string()).optional(),
44
- final_command: z.array(z.string()).optional(),
45
- });
46
- export type RunResponse = z.infer<typeof RunResponseSchema>;
47
-
48
- export const DryRunResponseSchema = z.object({
49
- command: z.array(z.string()),
50
- final_command: z.array(z.string()),
51
- image: z.string(),
52
- working_dir: z.string(),
53
- volumes: z.array(VolumeMountSchema).optional(),
54
- });
55
- export type DryRunResponse = z.infer<typeof DryRunResponseSchema>;