@figulus/schema 0.4.0-alpha-dev → 0.5.0-alpha-dev-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.
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 +12 -4
  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 +3 -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
@@ -0,0 +1,181 @@
1
+ import z, { ZodObject, ZodRawShape } from "zod";
2
+ import { extendZodWithOpenApi } from "@asteasolutions/zod-to-openapi";
3
+ import { parseLicenseId } from "zod-spdx";
4
+ import { JsonSchemaSchema } from "./json-schema.js";
5
+
6
+ extendZodWithOpenApi(z);
7
+
8
+ const ipfsSchema = z.string().startsWith("ipfs:");
9
+ const urlLike = z.union([z.url(), ipfsSchema]);
10
+
11
+ export const namespaceMetadataEditorEntrySchema = z.object({
12
+ username: z.string(),
13
+ // Cannot exceed namespace push limit -- use this for more granular control, otherwise first-in-first-served
14
+ pushLimit: z
15
+ .discriminatedUnion("unit", [
16
+ z.object({
17
+ unit: z.literal("daily"),
18
+ value: z.int(),
19
+ }),
20
+ z.object({
21
+ unit: z.literal("weekly"),
22
+ value: z.int(),
23
+ }),
24
+ ])
25
+ .optional(),
26
+ });
27
+ export type NamespaceMetadataEditorEntry = z.infer<
28
+ typeof namespaceMetadataEditorEntrySchema
29
+ >;
30
+
31
+ export const namespaceMetadataSchema = z
32
+ .object({
33
+ owner: z.object({
34
+ username: z.string(),
35
+ }),
36
+ editors: namespaceMetadataEditorEntrySchema.array().min(1).max(5),
37
+ })
38
+ .refine(
39
+ (data) => data.editors.some((e) => e.username === data.owner.username),
40
+ { message: "editors must include the owner", path: ["editors"] },
41
+ )
42
+ .openapi("NamespaceMetadata");
43
+ export type NamespaceMetadata = z.infer<typeof namespaceMetadataSchema>;
44
+
45
+ export const namespaceVerificationsSchema = z
46
+ .object({
47
+ namespace: z.string(),
48
+ verification: z.enum(["figulus-official", "software-official"]),
49
+ })
50
+ .array().openapi("NamespaceVerifications");
51
+ export type NamespaceVerifications = z.infer<
52
+ typeof namespaceVerificationsSchema
53
+ >;
54
+
55
+ // If not included in this list, namespace is limited to default push limit from settings
56
+ // Automated systems shouldn't modify this file -- it must be manually edited by repo owner under special circumstances
57
+ export const pushLimitOverridesSchema = z
58
+ .object({
59
+ namespace: z.string(),
60
+ // Allows for soft-banning/suspension/archival, or increased limits for special accounts
61
+ pushLimit: z.discriminatedUnion("unit", [
62
+ z.object({
63
+ unit: z.literal("daily"),
64
+ value: z.int(),
65
+ }),
66
+ z.object({
67
+ unit: z.literal("weekly"),
68
+ value: z.int(),
69
+ }),
70
+ ]),
71
+ })
72
+ .array().openapi("PushLimitOverrides");
73
+ export type PushLimitOverrides = z.infer<typeof pushLimitOverridesSchema>;
74
+
75
+ export const figEntityMetadataBaseSchema = z.object({
76
+ title: z.string(),
77
+ description: z.string(),
78
+ icon: z
79
+ .object({
80
+ svg: urlLike,
81
+ emojiFallback: z.emoji().optional(),
82
+ aspectRatio: z
83
+ .object({
84
+ w: z.number(),
85
+ h: z.number(),
86
+ })
87
+ .optional(),
88
+ })
89
+ .optional(),
90
+ tags: z.array(z.string()).optional(),
91
+ author: z.union([
92
+ z.string(),
93
+ z.string().array(),
94
+ z
95
+ .object({
96
+ type: z.enum([
97
+ "software-author",
98
+ "software-maintainer",
99
+ "fig-author",
100
+ "fig-maintainer",
101
+ ]),
102
+ name: z.string(),
103
+ url: z.url().optional(),
104
+ })
105
+ .array(),
106
+ ]),
107
+ license: z.union([
108
+ z.string().transform((s, ctx) => {
109
+ const result = parseLicenseId(s, { caseSensitive: false });
110
+ if (!result.success) {
111
+ ctx.addIssue({
112
+ code: "custom",
113
+ message: `Invalid SPDX license ID: ${s}`,
114
+ });
115
+ return z.NEVER;
116
+ }
117
+ return result.data;
118
+ }),
119
+ z.object({
120
+ name: z.string(),
121
+ url: z.url().optional(),
122
+ }),
123
+ ]),
124
+ softwareSource: z
125
+ .union([z.url(), z.url().array()])
126
+ .optional(),
127
+ }).openapi("FigEntityMetadataBase");
128
+
129
+ const hexSchema = z.string().regex(/[0-9A-Fa-f]+/);
130
+
131
+ export const blobSchema = z.object({
132
+ contentHash: hexSchema,
133
+ ipfsCid: z.string().optional(),
134
+ }).openapi("Blob");
135
+
136
+ export const variantSchema = z.object({
137
+ blob: blobSchema,
138
+ tag: z.string().optional(),
139
+ createdAt: z.iso.datetime().default(new Date().toISOString()),
140
+ updatedAt: z.iso.datetime().default(new Date().toISOString()),
141
+ }).openapi("Variant");
142
+
143
+ export const parserVariantSchema = variantSchema.extend({
144
+ // Represents the parsed JSON schema — allows any object structure since JsonSchemaSchema is
145
+ // recursively self-referential and cannot be fully represented in OpenAPI
146
+ parsedShape: z.union([z.record(z.string(), z.any()), z.boolean()]).optional(),
147
+ }).openapi("ParserVariant");
148
+
149
+ // Ensure all tags are unique
150
+ function uniqueArray<T extends ZodObject<ZodRawShape>>(schema: T) {
151
+ return schema.array().refine((items) => {
152
+ const tags = items
153
+ .map((item) => (item as { tag?: string }).tag)
154
+ .filter((item) => item !== undefined);
155
+ return new Set(tags).size === tags.length;
156
+ });
157
+ }
158
+
159
+ export const figParserMetadataSchema = figEntityMetadataBaseSchema.extend({
160
+ variants: uniqueArray(parserVariantSchema),
161
+ }).openapi("FigParserMetadata");
162
+ export type FigParserMetadata = z.infer<typeof figParserMetadataSchema>;
163
+
164
+ export const figSpecMetadataSchema = figEntityMetadataBaseSchema.extend({
165
+ variants: uniqueArray(variantSchema),
166
+ }).openapi("FigSpecMetadata");
167
+ export type FigSpecMetadata = z.infer<typeof figSpecMetadataSchema>;
168
+
169
+ export const figStackMetadataSchema = figEntityMetadataBaseSchema.extend({
170
+ variants: uniqueArray(variantSchema),
171
+ }).openapi("FigStackMetadata");
172
+ export type FigStackMetadata = z.infer<typeof figStackMetadataSchema>;
173
+
174
+ export type EntityType = "spec" | "stack" | "parser";
175
+ export type FigEntityMetadata<Type extends EntityType> = Type extends "spec"
176
+ ? FigSpecMetadata
177
+ : Type extends "stack"
178
+ ? FigStackMetadata
179
+ : Type extends "parser"
180
+ ? FigParserMetadata
181
+ : null;
@@ -9,7 +9,7 @@ import {
9
9
  installGroupSchema,
10
10
  onExitBehaviorSchema,
11
11
  executeMainCmdSchema,
12
- } from '../src/figspec.js';
12
+ } from '../src/index.js';
13
13
 
14
14
  // ---------------------------------------------------------------------------
15
15
  // Helpers
@@ -8,17 +8,17 @@
8
8
 
9
9
  import { describe, it, expect } from 'vitest';
10
10
  import {
11
- RunRequestSchema,
12
- JobStatusSchema,
13
- CreateSessionRequestSchema,
14
- SyncFileRequestSchema,
11
+ runRequestSchema,
12
+ jobStatusSchema,
13
+ createSessionRequestSchema,
14
+ syncFileRequestSchema,
15
15
  } from '../src/index.js';
16
16
 
17
17
  describe('Zod Schema Validation', () => {
18
18
  describe('RunRequest Schema', () => {
19
19
  it('should validate a minimal valid request', () => {
20
20
  const valid = { job_id: 'job-001', image: 'node:20-alpine' };
21
- expect(() => RunRequestSchema.parse(valid)).not.toThrow();
21
+ expect(() => runRequestSchema.parse(valid)).not.toThrow();
22
22
  });
23
23
 
24
24
  it('should validate a fully populated request', () => {
@@ -35,37 +35,37 @@ describe('Zod Schema Validation', () => {
35
35
  network_mode: 'bridge',
36
36
  ports: [{ container: 3000, host: 8080 }],
37
37
  };
38
- expect(() => RunRequestSchema.parse(valid)).not.toThrow();
38
+ expect(() => runRequestSchema.parse(valid)).not.toThrow();
39
39
  });
40
40
 
41
41
  it('should reject missing job_id', () => {
42
42
  const invalid = { image: 'node:20-alpine' };
43
- expect(() => RunRequestSchema.parse(invalid)).toThrow();
43
+ expect(() => runRequestSchema.parse(invalid)).toThrow();
44
44
  });
45
45
 
46
46
  it('should reject missing image', () => {
47
47
  const invalid = { job_id: 'job-001' };
48
- expect(() => RunRequestSchema.parse(invalid)).toThrow();
48
+ expect(() => runRequestSchema.parse(invalid)).toThrow();
49
49
  });
50
50
 
51
51
  it('should reject empty job_id', () => {
52
52
  const invalid = { job_id: '', image: 'node:20-alpine' };
53
- expect(() => RunRequestSchema.parse(invalid)).toThrow();
53
+ expect(() => runRequestSchema.parse(invalid)).toThrow();
54
54
  });
55
55
 
56
56
  it('should reject negative timeout', () => {
57
57
  const invalid = { job_id: 'job-001', image: 'node:20', timeout: -1 };
58
- expect(() => RunRequestSchema.parse(invalid)).toThrow();
58
+ expect(() => runRequestSchema.parse(invalid)).toThrow();
59
59
  });
60
60
 
61
61
  it('should reject timeout exceeding max', () => {
62
62
  const invalid = { job_id: 'job-001', image: 'node:20', timeout: 99999 };
63
- expect(() => RunRequestSchema.parse(invalid)).toThrow();
63
+ expect(() => runRequestSchema.parse(invalid)).toThrow();
64
64
  });
65
65
 
66
66
  it('should reject non-integer timeout', () => {
67
67
  const invalid = { job_id: 'job-001', image: 'node:20', timeout: 30.5 };
68
- expect(() => RunRequestSchema.parse(invalid)).toThrow();
68
+ expect(() => runRequestSchema.parse(invalid)).toThrow();
69
69
  });
70
70
 
71
71
  it('should reject invalid port number', () => {
@@ -74,7 +74,7 @@ describe('Zod Schema Validation', () => {
74
74
  image: 'node:20',
75
75
  ports: [{ container: 99999 }],
76
76
  };
77
- expect(() => RunRequestSchema.parse(invalid)).toThrow();
77
+ expect(() => runRequestSchema.parse(invalid)).toThrow();
78
78
  });
79
79
  });
80
80
 
@@ -82,21 +82,21 @@ describe('Zod Schema Validation', () => {
82
82
  it('should accept all valid status values', () => {
83
83
  const validValues = ['pending', 'running', 'completed', 'failed', 'timeout', 'awaiting_cleanup'];
84
84
  for (const val of validValues) {
85
- expect(() => JobStatusSchema.parse(val)).not.toThrow();
85
+ expect(() => jobStatusSchema.parse(val)).not.toThrow();
86
86
  }
87
87
  });
88
88
 
89
89
  it('should reject invalid status values', () => {
90
- expect(() => JobStatusSchema.parse('cancelled')).toThrow();
91
- expect(() => JobStatusSchema.parse('done')).toThrow();
92
- expect(() => JobStatusSchema.parse('')).toThrow();
90
+ expect(() => jobStatusSchema.parse('cancelled')).toThrow();
91
+ expect(() => jobStatusSchema.parse('done')).toThrow();
92
+ expect(() => jobStatusSchema.parse('')).toThrow();
93
93
  });
94
94
  });
95
95
 
96
96
  describe('CreateSessionRequest Schema', () => {
97
97
  it('should validate a minimal valid request', () => {
98
98
  const valid = { image_tag: 'localhost:5000/figulus:sha256-abc123' };
99
- expect(() => CreateSessionRequestSchema.parse(valid)).not.toThrow();
99
+ expect(() => createSessionRequestSchema.parse(valid)).not.toThrow();
100
100
  });
101
101
 
102
102
  it('should validate a request with config', () => {
@@ -110,27 +110,27 @@ describe('Zod Schema Validation', () => {
110
110
  ports: [{ container: 3000 }],
111
111
  },
112
112
  };
113
- expect(() => CreateSessionRequestSchema.parse(valid)).not.toThrow();
113
+ expect(() => createSessionRequestSchema.parse(valid)).not.toThrow();
114
114
  });
115
115
 
116
116
  it('should reject missing image_tag', () => {
117
117
  const invalid = { ttl: 600 };
118
- expect(() => CreateSessionRequestSchema.parse(invalid)).toThrow();
118
+ expect(() => createSessionRequestSchema.parse(invalid)).toThrow();
119
119
  });
120
120
 
121
121
  it('should reject empty image_tag', () => {
122
122
  const invalid = { image_tag: '' };
123
- expect(() => CreateSessionRequestSchema.parse(invalid)).toThrow();
123
+ expect(() => createSessionRequestSchema.parse(invalid)).toThrow();
124
124
  });
125
125
 
126
126
  it('should reject negative ttl', () => {
127
127
  const invalid = { image_tag: 'some-image:latest', ttl: -1 };
128
- expect(() => CreateSessionRequestSchema.parse(invalid)).toThrow();
128
+ expect(() => createSessionRequestSchema.parse(invalid)).toThrow();
129
129
  });
130
130
 
131
131
  it('should reject non-integer ttl', () => {
132
132
  const invalid = { image_tag: 'some-image:latest', ttl: 60.5 };
133
- expect(() => CreateSessionRequestSchema.parse(invalid)).toThrow();
133
+ expect(() => createSessionRequestSchema.parse(invalid)).toThrow();
134
134
  });
135
135
  });
136
136
 
@@ -141,7 +141,7 @@ describe('Zod Schema Validation', () => {
141
141
  content: 'Y29uc29sZS5sb2coImhlbGxvIik=',
142
142
  encoding: 'base64',
143
143
  };
144
- expect(() => SyncFileRequestSchema.parse(valid)).not.toThrow();
144
+ expect(() => syncFileRequestSchema.parse(valid)).not.toThrow();
145
145
  });
146
146
 
147
147
  it('should validate a valid utf8 request', () => {
@@ -150,38 +150,38 @@ describe('Zod Schema Validation', () => {
150
150
  content: 'console.log("hello")',
151
151
  encoding: 'utf8',
152
152
  };
153
- expect(() => SyncFileRequestSchema.parse(valid)).not.toThrow();
153
+ expect(() => syncFileRequestSchema.parse(valid)).not.toThrow();
154
154
  });
155
155
 
156
156
  it('should default encoding to base64 when omitted', () => {
157
157
  const input = { targetPath: '/app/src/index.ts', content: 'abc' };
158
- const result = SyncFileRequestSchema.parse(input);
158
+ const result = syncFileRequestSchema.parse(input);
159
159
  expect(result.encoding).toBe('base64');
160
160
  });
161
161
 
162
162
  it('should reject missing targetPath', () => {
163
163
  const invalid = { content: 'abc', encoding: 'base64' };
164
- expect(() => SyncFileRequestSchema.parse(invalid)).toThrow();
164
+ expect(() => syncFileRequestSchema.parse(invalid)).toThrow();
165
165
  });
166
166
 
167
167
  it('should reject empty targetPath', () => {
168
168
  const invalid = { targetPath: '', content: 'abc', encoding: 'base64' };
169
- expect(() => SyncFileRequestSchema.parse(invalid)).toThrow();
169
+ expect(() => syncFileRequestSchema.parse(invalid)).toThrow();
170
170
  });
171
171
 
172
172
  it('should reject missing content', () => {
173
173
  const invalid = { targetPath: '/app/file.ts', encoding: 'base64' };
174
- expect(() => SyncFileRequestSchema.parse(invalid)).toThrow();
174
+ expect(() => syncFileRequestSchema.parse(invalid)).toThrow();
175
175
  });
176
176
 
177
177
  it('should reject empty content', () => {
178
178
  const invalid = { targetPath: '/app/file.ts', content: '', encoding: 'base64' };
179
- expect(() => SyncFileRequestSchema.parse(invalid)).toThrow();
179
+ expect(() => syncFileRequestSchema.parse(invalid)).toThrow();
180
180
  });
181
181
 
182
182
  it('should reject invalid encoding value', () => {
183
183
  const invalid = { targetPath: '/app/file.ts', content: 'abc', encoding: 'hex' };
184
- expect(() => SyncFileRequestSchema.parse(invalid)).toThrow();
184
+ expect(() => syncFileRequestSchema.parse(invalid)).toThrow();
185
185
  });
186
186
  });
187
187
  });