schemantic 0.2.1 → 0.4.0

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 (144) hide show
  1. package/CHANGELOG.md +196 -159
  2. package/LICENSE +21 -21
  3. package/README.md +88 -830
  4. package/dist/cli/index.d.ts +4 -1
  5. package/dist/cli/index.d.ts.map +1 -1
  6. package/dist/cli/index.js +186 -62
  7. package/dist/cli/index.js.map +1 -1
  8. package/dist/core/configuration.d.ts +6 -0
  9. package/dist/core/configuration.d.ts.map +1 -0
  10. package/dist/core/configuration.js +64 -0
  11. package/dist/core/configuration.js.map +1 -0
  12. package/dist/core/index.d.ts +1 -0
  13. package/dist/core/index.d.ts.map +1 -1
  14. package/dist/core/index.js +1 -0
  15. package/dist/core/index.js.map +1 -1
  16. package/dist/core/output-writer.d.ts +7 -0
  17. package/dist/core/output-writer.d.ts.map +1 -0
  18. package/dist/core/output-writer.js +255 -0
  19. package/dist/core/output-writer.js.map +1 -0
  20. package/dist/core/schemantic.d.ts +8 -6
  21. package/dist/core/schemantic.d.ts.map +1 -1
  22. package/dist/core/schemantic.js +194 -127
  23. package/dist/core/schemantic.js.map +1 -1
  24. package/dist/generators/api-client-generator.d.ts +9 -20
  25. package/dist/generators/api-client-generator.d.ts.map +1 -1
  26. package/dist/generators/api-client-generator.js +364 -424
  27. package/dist/generators/api-client-generator.js.map +1 -1
  28. package/dist/generators/base.d.ts.map +1 -1
  29. package/dist/generators/base.js +7 -25
  30. package/dist/generators/base.js.map +1 -1
  31. package/dist/generators/enum-generator.d.ts.map +1 -1
  32. package/dist/generators/enum-generator.js +30 -3
  33. package/dist/generators/enum-generator.js.map +1 -1
  34. package/dist/generators/hook-generator.d.ts +3 -17
  35. package/dist/generators/hook-generator.d.ts.map +1 -1
  36. package/dist/generators/hook-generator.js +51 -445
  37. package/dist/generators/hook-generator.js.map +1 -1
  38. package/dist/generators/naming.d.ts +10 -0
  39. package/dist/generators/naming.d.ts.map +1 -0
  40. package/dist/generators/naming.js +331 -0
  41. package/dist/generators/naming.js.map +1 -0
  42. package/dist/generators/object-generator.d.ts +0 -4
  43. package/dist/generators/object-generator.d.ts.map +1 -1
  44. package/dist/generators/object-generator.js +13 -101
  45. package/dist/generators/object-generator.js.map +1 -1
  46. package/dist/generators/primitive-generator.d.ts +1 -13
  47. package/dist/generators/primitive-generator.d.ts.map +1 -1
  48. package/dist/generators/primitive-generator.js +11 -76
  49. package/dist/generators/primitive-generator.js.map +1 -1
  50. package/dist/generators/projections.d.ts +10 -0
  51. package/dist/generators/projections.d.ts.map +1 -0
  52. package/dist/generators/projections.js +65 -0
  53. package/dist/generators/projections.js.map +1 -0
  54. package/dist/generators/schema-type.d.ts +23 -0
  55. package/dist/generators/schema-type.d.ts.map +1 -0
  56. package/dist/generators/schema-type.js +233 -0
  57. package/dist/generators/schema-type.js.map +1 -0
  58. package/dist/parsers/base.d.ts +2 -0
  59. package/dist/parsers/base.d.ts.map +1 -1
  60. package/dist/parsers/base.js +12 -2
  61. package/dist/parsers/base.js.map +1 -1
  62. package/dist/parsers/factory.d.ts.map +1 -1
  63. package/dist/parsers/factory.js +2 -1
  64. package/dist/parsers/factory.js.map +1 -1
  65. package/dist/parsers/openapi.d.ts +4 -0
  66. package/dist/parsers/openapi.d.ts.map +1 -1
  67. package/dist/parsers/openapi.js +107 -20
  68. package/dist/parsers/openapi.js.map +1 -1
  69. package/dist/plugins/branded-types.d.ts.map +1 -1
  70. package/dist/plugins/branded-types.js +231 -365
  71. package/dist/plugins/branded-types.js.map +1 -1
  72. package/dist/plugins/builtin.d.ts.map +1 -1
  73. package/dist/plugins/builtin.js +6 -141
  74. package/dist/plugins/builtin.js.map +1 -1
  75. package/dist/plugins/index.d.ts +4 -0
  76. package/dist/plugins/index.d.ts.map +1 -1
  77. package/dist/plugins/index.js +17 -0
  78. package/dist/plugins/index.js.map +1 -1
  79. package/dist/plugins/loader.d.ts +5 -1
  80. package/dist/plugins/loader.d.ts.map +1 -1
  81. package/dist/plugins/loader.js +42 -5
  82. package/dist/plugins/loader.js.map +1 -1
  83. package/dist/plugins/manager.d.ts.map +1 -1
  84. package/dist/plugins/manager.js +7 -7
  85. package/dist/plugins/manager.js.map +1 -1
  86. package/dist/plugins/performance-monitoring.d.ts +31 -1
  87. package/dist/plugins/performance-monitoring.d.ts.map +1 -1
  88. package/dist/plugins/performance-monitoring.js +146 -207
  89. package/dist/plugins/performance-monitoring.js.map +1 -1
  90. package/dist/plugins/request-deduplication.d.ts.map +1 -1
  91. package/dist/plugins/request-deduplication.js +151 -586
  92. package/dist/plugins/request-deduplication.js.map +1 -1
  93. package/dist/plugins/zod-validation.d.ts +23 -15
  94. package/dist/plugins/zod-validation.d.ts.map +1 -1
  95. package/dist/plugins/zod-validation.js +390 -268
  96. package/dist/plugins/zod-validation.js.map +1 -1
  97. package/dist/types/core.d.ts +20 -4
  98. package/dist/types/core.d.ts.map +1 -1
  99. package/dist/types/core.js +2 -1
  100. package/dist/types/core.js.map +1 -1
  101. package/dist/types/openapi.d.ts +14 -1
  102. package/dist/types/openapi.d.ts.map +1 -1
  103. package/docs/ADVANCED_PLUGINS_IMPLEMENTATION.md +24 -355
  104. package/docs/ADVANCED_PLUGIN_DEVELOPMENT.md +33 -309
  105. package/docs/API.md +80 -600
  106. package/docs/AUDIT.md +49 -0
  107. package/docs/CONFIGURATION.md +81 -722
  108. package/docs/FASTAPI_TUTORIAL.md +109 -1497
  109. package/docs/NAMING_MIGRATION.md +59 -0
  110. package/docs/PLUGINS.md +49 -687
  111. package/docs/PLUGIN_DEVELOPMENT.md +53 -720
  112. package/docs/REAUDIT.md +399 -0
  113. package/docs/RELEASING.md +88 -0
  114. package/docs/REMEDIATION.md +58 -0
  115. package/docs/superpowers/plans/2026-10-10-audit-remediation.md +113 -0
  116. package/package.json +114 -95
  117. package/dist/__tests__/setup.d.ts +0 -6
  118. package/dist/__tests__/setup.d.ts.map +0 -1
  119. package/dist/__tests__/setup.js +0 -30
  120. package/dist/__tests__/setup.js.map +0 -1
  121. package/dist/__tests__/test-config.d.ts +0 -36
  122. package/dist/__tests__/test-config.d.ts.map +0 -1
  123. package/dist/__tests__/test-config.js +0 -563
  124. package/dist/__tests__/test-config.js.map +0 -1
  125. package/dist/lib/api/api-client.d.ts +0 -71
  126. package/dist/lib/api/api-client.d.ts.map +0 -1
  127. package/dist/lib/api/api-client.js +0 -238
  128. package/dist/lib/api/api-client.js.map +0 -1
  129. package/dist/lib/api/barrel.d.ts +0 -4
  130. package/dist/lib/api/barrel.d.ts.map +0 -1
  131. package/dist/lib/api/barrel.js +0 -26
  132. package/dist/lib/api/barrel.js.map +0 -1
  133. package/dist/lib/api/hooks.d.ts +0 -36
  134. package/dist/lib/api/hooks.d.ts.map +0 -1
  135. package/dist/lib/api/hooks.js +0 -120
  136. package/dist/lib/api/hooks.js.map +0 -1
  137. package/dist/lib/api/index.d.ts +0 -4
  138. package/dist/lib/api/index.d.ts.map +0 -1
  139. package/dist/lib/api/index.js +0 -8
  140. package/dist/lib/api/index.js.map +0 -1
  141. package/dist/lib/api/types.d.ts +0 -366
  142. package/dist/lib/api/types.d.ts.map +0 -1
  143. package/dist/lib/api/types.js +0 -315
  144. package/dist/lib/api/types.js.map +0 -1
@@ -1,366 +0,0 @@
1
- import { z } from 'zod';
2
- /**
3
- * Supported image formats with their canonical extensions.
4
- */
5
- export declare enum ImageFormat {
6
- PNG = "png",
7
- JPEG = "jpeg",
8
- JPG = "jpg",
9
- WEBP = "webp",
10
- AVIF = "avif",
11
- TIFF = "tiff",
12
- TIF = "tif",
13
- ICO = "ico",
14
- HEIC = "heic",
15
- HEIF = "heif",
16
- BMP = "bmp",
17
- SVG = "svg"
18
- }
19
- export type ImageFormatValues = "png" | "jpeg" | "jpg" | "webp" | "avif" | "tiff" | "tif" | "ico" | "heic" | "heif" | "bmp" | "svg";
20
- /**
21
- * Zod validation schema for ImageFormat
22
- */
23
- export declare const ImageFormatSchema: z.ZodEnum<{
24
- png: "png";
25
- jpeg: "jpeg";
26
- jpg: "jpg";
27
- webp: "webp";
28
- avif: "avif";
29
- tiff: "tiff";
30
- tif: "tif";
31
- ico: "ico";
32
- heic: "heic";
33
- heif: "heif";
34
- bmp: "bmp";
35
- svg: "svg";
36
- }>;
37
- /**
38
- * Validate ImageFormat data with detailed error reporting
39
- */
40
- export declare function validateImageFormat(data: unknown): {
41
- success: true;
42
- data: ImageFormat;
43
- } | {
44
- success: false;
45
- errors: string[];
46
- };
47
- /**
48
- * Parse ImageFormat data with exception on validation failure
49
- */
50
- export declare function parseImageFormat(data: unknown): ImageFormat;
51
- /**
52
- * Branded type for ImageFormat with compile-time guarantees
53
- */
54
- export type BrandedImageFormat = ImageFormat & {
55
- __brand: 'ImageFormat';
56
- };
57
- /**
58
- * Create a branded ImageFormat instance
59
- */
60
- export declare function createBrandedImageFormat(data: ImageFormat): BrandedImageFormat;
61
- /**
62
- * Runtime type guard for ImageFormat
63
- */
64
- export declare function isImageFormat(value: unknown): value is ImageFormat;
65
- /**
66
- * Type definition for Body_batch_convert_images_convert_batch_post
67
- */
68
- export interface BodyBatchConvertImagesConvertBatchPost {
69
- /**
70
- * Image files to convert
71
- */
72
- files: string[];
73
- targetFormat: ImageFormat;
74
- /**
75
- * Quality (1-100) for lossy formats
76
- */
77
- quality?: number | null | undefined;
78
- /**
79
- * Preserve original filenames
80
- */
81
- preserveNames?: boolean | undefined;
82
- }
83
- /**
84
- * Zod validation schema for BodyBatchConvertImagesConvertBatchPost
85
- */
86
- export declare const BodyBatchConvertImagesConvertBatchPostSchema: z.ZodPipe<z.ZodObject<{
87
- files: z.ZodArray<z.ZodString>;
88
- target_format: z.ZodEnum<{
89
- png: "png";
90
- jpeg: "jpeg";
91
- jpg: "jpg";
92
- webp: "webp";
93
- avif: "avif";
94
- tiff: "tiff";
95
- tif: "tif";
96
- ico: "ico";
97
- heic: "heic";
98
- heif: "heif";
99
- bmp: "bmp";
100
- svg: "svg";
101
- }>;
102
- quality: z.ZodOptional<z.ZodUnknown>;
103
- preserve_names: z.ZodOptional<z.ZodBoolean>;
104
- }, z.core.$strict>, z.ZodTransform<{
105
- targetFormat: unknown;
106
- preserveNames: unknown;
107
- }, {
108
- files: string[];
109
- target_format: "png" | "jpeg" | "jpg" | "webp" | "avif" | "tiff" | "tif" | "ico" | "heic" | "heif" | "bmp" | "svg";
110
- quality?: unknown;
111
- preserve_names?: boolean | undefined;
112
- }>>;
113
- /**
114
- * Validate BodyBatchConvertImagesConvertBatchPost data with detailed error reporting
115
- */
116
- export declare function validateBodyBatchConvertImagesConvertBatchPost(data: unknown): {
117
- success: true;
118
- data: BodyBatchConvertImagesConvertBatchPost;
119
- } | {
120
- success: false;
121
- errors: string[];
122
- };
123
- /**
124
- * Parse BodyBatchConvertImagesConvertBatchPost data with exception on validation failure
125
- */
126
- export declare function parseBodyBatchConvertImagesConvertBatchPost(data: unknown): BodyBatchConvertImagesConvertBatchPost;
127
- /**
128
- * Branded type for BodyBatchConvertImagesConvertBatchPost with compile-time guarantees
129
- */
130
- export type BrandedBodyBatchConvertImagesConvertBatchPost = BodyBatchConvertImagesConvertBatchPost & {
131
- __brand: 'BodyBatchConvertImagesConvertBatchPost';
132
- };
133
- /**
134
- * Create a branded BodyBatchConvertImagesConvertBatchPost instance
135
- */
136
- export declare function createBrandedBodyBatchConvertImagesConvertBatchPost(data: BodyBatchConvertImagesConvertBatchPost): BrandedBodyBatchConvertImagesConvertBatchPost;
137
- /**
138
- * Runtime type guard for BodyBatchConvertImagesConvertBatchPost
139
- */
140
- export declare function isBodyBatchConvertImagesConvertBatchPost(value: unknown): value is BodyBatchConvertImagesConvertBatchPost;
141
- /**
142
- * Type definition for Body_convert_image_convert__post
143
- */
144
- export interface BodyConvertImageConvertPost {
145
- /**
146
- * Image file to convert
147
- */
148
- file: string;
149
- targetFormat: ImageFormat;
150
- /**
151
- * Quality (1-100) for lossy formats
152
- */
153
- quality?: number | null | undefined;
154
- /**
155
- * Target width in pixels
156
- */
157
- width?: number | null | undefined;
158
- /**
159
- * Target height in pixels
160
- */
161
- height?: number | null | undefined;
162
- /**
163
- * DPI for SVG-to-raster conversion
164
- */
165
- dpi?: number | null | undefined;
166
- /**
167
- * Scale factor for SVG-to-raster
168
- */
169
- scale?: number | null | undefined;
170
- }
171
- /**
172
- * Zod validation schema for BodyConvertImageConvertPost
173
- */
174
- export declare const BodyConvertImageConvertPostSchema: z.ZodPipe<z.ZodObject<{
175
- file: z.ZodString;
176
- target_format: z.ZodEnum<{
177
- png: "png";
178
- jpeg: "jpeg";
179
- jpg: "jpg";
180
- webp: "webp";
181
- avif: "avif";
182
- tiff: "tiff";
183
- tif: "tif";
184
- ico: "ico";
185
- heic: "heic";
186
- heif: "heif";
187
- bmp: "bmp";
188
- svg: "svg";
189
- }>;
190
- quality: z.ZodOptional<z.ZodUnknown>;
191
- width: z.ZodOptional<z.ZodUnknown>;
192
- height: z.ZodOptional<z.ZodUnknown>;
193
- dpi: z.ZodOptional<z.ZodUnknown>;
194
- scale: z.ZodOptional<z.ZodUnknown>;
195
- }, z.core.$strict>, z.ZodTransform<{
196
- targetFormat: unknown;
197
- }, {
198
- file: string;
199
- target_format: "png" | "jpeg" | "jpg" | "webp" | "avif" | "tiff" | "tif" | "ico" | "heic" | "heif" | "bmp" | "svg";
200
- quality?: unknown;
201
- width?: unknown;
202
- height?: unknown;
203
- dpi?: unknown;
204
- scale?: unknown;
205
- }>>;
206
- /**
207
- * Validate BodyConvertImageConvertPost data with detailed error reporting
208
- */
209
- export declare function validateBodyConvertImageConvertPost(data: unknown): {
210
- success: true;
211
- data: BodyConvertImageConvertPost;
212
- } | {
213
- success: false;
214
- errors: string[];
215
- };
216
- /**
217
- * Parse BodyConvertImageConvertPost data with exception on validation failure
218
- */
219
- export declare function parseBodyConvertImageConvertPost(data: unknown): BodyConvertImageConvertPost;
220
- /**
221
- * Branded type for BodyConvertImageConvertPost with compile-time guarantees
222
- */
223
- export type BrandedBodyConvertImageConvertPost = BodyConvertImageConvertPost & {
224
- __brand: 'BodyConvertImageConvertPost';
225
- };
226
- /**
227
- * Create a branded BodyConvertImageConvertPost instance
228
- */
229
- export declare function createBrandedBodyConvertImageConvertPost(data: BodyConvertImageConvertPost): BrandedBodyConvertImageConvertPost;
230
- /**
231
- * Runtime type guard for BodyConvertImageConvertPost
232
- */
233
- export declare function isBodyConvertImageConvertPost(value: unknown): value is BodyConvertImageConvertPost;
234
- /**
235
- * Type definition for ValidationError
236
- */
237
- export interface ValidationError {
238
- loc: string | number[];
239
- msg: string;
240
- type: string;
241
- }
242
- /**
243
- * Zod validation schema for ValidationError
244
- */
245
- export declare const ValidationErrorSchema: z.ZodObject<{
246
- loc: z.ZodArray<z.ZodUnknown>;
247
- msg: z.ZodString;
248
- type: z.ZodString;
249
- }, z.core.$strict>;
250
- /**
251
- * Validate ValidationError data with detailed error reporting
252
- */
253
- export declare function validateValidationError(data: unknown): {
254
- success: true;
255
- data: ValidationError;
256
- } | {
257
- success: false;
258
- errors: string[];
259
- };
260
- /**
261
- * Parse ValidationError data with exception on validation failure
262
- */
263
- export declare function parseValidationError(data: unknown): ValidationError;
264
- /**
265
- * Branded type for ValidationError with compile-time guarantees
266
- */
267
- export type BrandedValidationError = ValidationError & {
268
- __brand: 'ValidationError';
269
- };
270
- /**
271
- * Create a branded ValidationError instance
272
- */
273
- export declare function createBrandedValidationError(data: ValidationError): BrandedValidationError;
274
- /**
275
- * Runtime type guard for ValidationError
276
- */
277
- export declare function isValidationError(value: unknown): value is ValidationError;
278
- /**
279
- * Type definition for HTTPValidationError
280
- */
281
- export interface HTTPValidationError {
282
- detail?: ValidationError[] | undefined;
283
- }
284
- /**
285
- * Zod validation schema for HTTPValidationError
286
- */
287
- export declare const HTTPValidationErrorSchema: z.ZodObject<{
288
- detail: z.ZodOptional<z.ZodArray<z.ZodObject<{
289
- loc: z.ZodArray<z.ZodUnknown>;
290
- msg: z.ZodString;
291
- type: z.ZodString;
292
- }, z.core.$strict>>>;
293
- }, z.core.$strict>;
294
- /**
295
- * Validate HTTPValidationError data with detailed error reporting
296
- */
297
- export declare function validateHTTPValidationError(data: unknown): {
298
- success: true;
299
- data: HTTPValidationError;
300
- } | {
301
- success: false;
302
- errors: string[];
303
- };
304
- /**
305
- * Parse HTTPValidationError data with exception on validation failure
306
- */
307
- export declare function parseHTTPValidationError(data: unknown): HTTPValidationError;
308
- /**
309
- * Branded type for HTTPValidationError with compile-time guarantees
310
- */
311
- export type BrandedHTTPValidationError = HTTPValidationError & {
312
- __brand: 'HTTPValidationError';
313
- };
314
- /**
315
- * Create a branded HTTPValidationError instance
316
- */
317
- export declare function createBrandedHTTPValidationError(data: HTTPValidationError): BrandedHTTPValidationError;
318
- /**
319
- * Runtime type guard for HTTPValidationError
320
- */
321
- export declare function isHTTPValidationError(value: unknown): value is HTTPValidationError;
322
- /**
323
- * Health check response schema.
324
- */
325
- export interface HealthResponse {
326
- status: string;
327
- version: string;
328
- environment: string;
329
- }
330
- /**
331
- * Zod validation schema for HealthResponse
332
- */
333
- export declare const HealthResponseSchema: z.ZodObject<{
334
- status: z.ZodString;
335
- version: z.ZodString;
336
- environment: z.ZodString;
337
- }, z.core.$strict>;
338
- /**
339
- * Validate HealthResponse data with detailed error reporting
340
- */
341
- export declare function validateHealthResponse(data: unknown): {
342
- success: true;
343
- data: HealthResponse;
344
- } | {
345
- success: false;
346
- errors: string[];
347
- };
348
- /**
349
- * Parse HealthResponse data with exception on validation failure
350
- */
351
- export declare function parseHealthResponse(data: unknown): HealthResponse;
352
- /**
353
- * Branded type for HealthResponse with compile-time guarantees
354
- */
355
- export type BrandedHealthResponse = HealthResponse & {
356
- __brand: 'HealthResponse';
357
- };
358
- /**
359
- * Create a branded HealthResponse instance
360
- */
361
- export declare function createBrandedHealthResponse(data: HealthResponse): BrandedHealthResponse;
362
- /**
363
- * Runtime type guard for HealthResponse
364
- */
365
- export declare function isHealthResponse(value: unknown): value is HealthResponse;
366
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"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BAAsB,CAAC,IAAI,EAAE,OAAO,GAAG;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,cAAc,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAgBpI;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,cAAc,CAEjE;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,cAAc,GAAG;IAAE,OAAO,EAAE,gBAAgB,CAAA;CAAE,CAAC;AAEnF;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,cAAc,GAAG,qBAAqB,CAEvF;AACD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAExE"}
@@ -1,315 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HealthResponseSchema = exports.HTTPValidationErrorSchema = exports.ValidationErrorSchema = exports.BodyConvertImageConvertPostSchema = exports.BodyBatchConvertImagesConvertBatchPostSchema = exports.ImageFormatSchema = exports.ImageFormat = void 0;
4
- exports.validateImageFormat = validateImageFormat;
5
- exports.parseImageFormat = parseImageFormat;
6
- exports.createBrandedImageFormat = createBrandedImageFormat;
7
- exports.isImageFormat = isImageFormat;
8
- exports.validateBodyBatchConvertImagesConvertBatchPost = validateBodyBatchConvertImagesConvertBatchPost;
9
- exports.parseBodyBatchConvertImagesConvertBatchPost = parseBodyBatchConvertImagesConvertBatchPost;
10
- exports.createBrandedBodyBatchConvertImagesConvertBatchPost = createBrandedBodyBatchConvertImagesConvertBatchPost;
11
- exports.isBodyBatchConvertImagesConvertBatchPost = isBodyBatchConvertImagesConvertBatchPost;
12
- exports.validateBodyConvertImageConvertPost = validateBodyConvertImageConvertPost;
13
- exports.parseBodyConvertImageConvertPost = parseBodyConvertImageConvertPost;
14
- exports.createBrandedBodyConvertImageConvertPost = createBrandedBodyConvertImageConvertPost;
15
- exports.isBodyConvertImageConvertPost = isBodyConvertImageConvertPost;
16
- exports.validateValidationError = validateValidationError;
17
- exports.parseValidationError = parseValidationError;
18
- exports.createBrandedValidationError = createBrandedValidationError;
19
- exports.isValidationError = isValidationError;
20
- exports.validateHTTPValidationError = validateHTTPValidationError;
21
- exports.parseHTTPValidationError = parseHTTPValidationError;
22
- exports.createBrandedHTTPValidationError = createBrandedHTTPValidationError;
23
- exports.isHTTPValidationError = isHTTPValidationError;
24
- exports.validateHealthResponse = validateHealthResponse;
25
- exports.parseHealthResponse = parseHealthResponse;
26
- exports.createBrandedHealthResponse = createBrandedHealthResponse;
27
- exports.isHealthResponse = isHealthResponse;
28
- const zod_1 = require("zod");
29
- /**
30
- * Supported image formats with their canonical extensions.
31
- */
32
- var ImageFormat;
33
- (function (ImageFormat) {
34
- ImageFormat["PNG"] = "png";
35
- ImageFormat["JPEG"] = "jpeg";
36
- ImageFormat["JPG"] = "jpg";
37
- ImageFormat["WEBP"] = "webp";
38
- ImageFormat["AVIF"] = "avif";
39
- ImageFormat["TIFF"] = "tiff";
40
- ImageFormat["TIF"] = "tif";
41
- ImageFormat["ICO"] = "ico";
42
- ImageFormat["HEIC"] = "heic";
43
- ImageFormat["HEIF"] = "heif";
44
- ImageFormat["BMP"] = "bmp";
45
- ImageFormat["SVG"] = "svg";
46
- })(ImageFormat || (exports.ImageFormat = ImageFormat = {}));
47
- /**
48
- * Zod validation schema for ImageFormat
49
- */
50
- exports.ImageFormatSchema = zod_1.z.enum(["png", "jpeg", "jpg", "webp", "avif", "tiff", "tif", "ico", "heic", "heif", "bmp", "svg"]);
51
- /**
52
- * Validate ImageFormat data with detailed error reporting
53
- */
54
- function validateImageFormat(data) {
55
- const result = exports.ImageFormatSchema.safeParse(data);
56
- if (!result.success) {
57
- const issues = result.error?.issues ?? [];
58
- console.warn('Response validation failed:', issues);
59
- // Return a structured failure result so consumers can handle errors without requiring a runtime ValidationError class
60
- return {
61
- success: false,
62
- errors: issues.length > 0
63
- ? issues.map((iss) => (iss.path && iss.path.length > 0 ? iss.path.join('.') + ': ' + iss.message : '(root): ' + iss.message))
64
- : []
65
- };
66
- }
67
- return { success: true, data: result.data };
68
- }
69
- /**
70
- * Parse ImageFormat data with exception on validation failure
71
- */
72
- function parseImageFormat(data) {
73
- return exports.ImageFormatSchema.parse(data);
74
- }
75
- /**
76
- * Create a branded ImageFormat instance
77
- */
78
- function createBrandedImageFormat(data) {
79
- return data;
80
- }
81
- /**
82
- * Runtime type guard for ImageFormat
83
- */
84
- function isImageFormat(value) {
85
- return exports.ImageFormatSchema.safeParse(value).success;
86
- }
87
- /**
88
- * Zod validation schema for BodyBatchConvertImagesConvertBatchPost
89
- */
90
- exports.BodyBatchConvertImagesConvertBatchPostSchema = zod_1.z.object({
91
- files: zod_1.z.array(zod_1.z.string()),
92
- target_format: exports.ImageFormatSchema,
93
- quality: zod_1.z.unknown().optional(),
94
- preserve_names: zod_1.z.boolean().optional()
95
- }).strict().transform((val) => ({
96
- targetFormat: val["target_format"],
97
- preserveNames: val["preserve_names"]
98
- }));
99
- /**
100
- * Validate BodyBatchConvertImagesConvertBatchPost data with detailed error reporting
101
- */
102
- function validateBodyBatchConvertImagesConvertBatchPost(data) {
103
- const result = exports.BodyBatchConvertImagesConvertBatchPostSchema.safeParse(data);
104
- if (!result.success) {
105
- const issues = result.error?.issues ?? [];
106
- console.warn('Response validation failed:', issues);
107
- // Return a structured failure result so consumers can handle errors without requiring a runtime ValidationError class
108
- return {
109
- success: false,
110
- errors: issues.length > 0
111
- ? issues.map((iss) => (iss.path && iss.path.length > 0 ? iss.path.join('.') + ': ' + iss.message : '(root): ' + iss.message))
112
- : []
113
- };
114
- }
115
- return { success: true, data: result.data };
116
- }
117
- /**
118
- * Parse BodyBatchConvertImagesConvertBatchPost data with exception on validation failure
119
- */
120
- function parseBodyBatchConvertImagesConvertBatchPost(data) {
121
- return exports.BodyBatchConvertImagesConvertBatchPostSchema.parse(data);
122
- }
123
- /**
124
- * Create a branded BodyBatchConvertImagesConvertBatchPost instance
125
- */
126
- function createBrandedBodyBatchConvertImagesConvertBatchPost(data) {
127
- return data;
128
- }
129
- /**
130
- * Runtime type guard for BodyBatchConvertImagesConvertBatchPost
131
- */
132
- function isBodyBatchConvertImagesConvertBatchPost(value) {
133
- return exports.BodyBatchConvertImagesConvertBatchPostSchema.safeParse(value).success;
134
- }
135
- /**
136
- * Zod validation schema for BodyConvertImageConvertPost
137
- */
138
- exports.BodyConvertImageConvertPostSchema = zod_1.z.object({
139
- file: zod_1.z.string(),
140
- target_format: exports.ImageFormatSchema,
141
- quality: zod_1.z.unknown().optional(),
142
- width: zod_1.z.unknown().optional(),
143
- height: zod_1.z.unknown().optional(),
144
- dpi: zod_1.z.unknown().optional(),
145
- scale: zod_1.z.unknown().optional()
146
- }).strict().transform((val) => ({
147
- targetFormat: val["target_format"]
148
- }));
149
- /**
150
- * Validate BodyConvertImageConvertPost data with detailed error reporting
151
- */
152
- function validateBodyConvertImageConvertPost(data) {
153
- const result = exports.BodyConvertImageConvertPostSchema.safeParse(data);
154
- if (!result.success) {
155
- const issues = result.error?.issues ?? [];
156
- console.warn('Response validation failed:', issues);
157
- // Return a structured failure result so consumers can handle errors without requiring a runtime ValidationError class
158
- return {
159
- success: false,
160
- errors: issues.length > 0
161
- ? issues.map((iss) => (iss.path && iss.path.length > 0 ? iss.path.join('.') + ': ' + iss.message : '(root): ' + iss.message))
162
- : []
163
- };
164
- }
165
- return { success: true, data: result.data };
166
- }
167
- /**
168
- * Parse BodyConvertImageConvertPost data with exception on validation failure
169
- */
170
- function parseBodyConvertImageConvertPost(data) {
171
- return exports.BodyConvertImageConvertPostSchema.parse(data);
172
- }
173
- /**
174
- * Create a branded BodyConvertImageConvertPost instance
175
- */
176
- function createBrandedBodyConvertImageConvertPost(data) {
177
- return data;
178
- }
179
- /**
180
- * Runtime type guard for BodyConvertImageConvertPost
181
- */
182
- function isBodyConvertImageConvertPost(value) {
183
- return exports.BodyConvertImageConvertPostSchema.safeParse(value).success;
184
- }
185
- /**
186
- * Zod validation schema for ValidationError
187
- */
188
- exports.ValidationErrorSchema = zod_1.z.object({
189
- loc: zod_1.z.array(zod_1.z.unknown()),
190
- msg: zod_1.z.string(),
191
- type: zod_1.z.string()
192
- }).strict();
193
- /**
194
- * Validate ValidationError data with detailed error reporting
195
- */
196
- function validateValidationError(data) {
197
- const result = exports.ValidationErrorSchema.safeParse(data);
198
- if (!result.success) {
199
- const issues = result.error?.issues ?? [];
200
- console.warn('Response validation failed:', issues);
201
- // Return a structured failure result so consumers can handle errors without requiring a runtime ValidationError class
202
- return {
203
- success: false,
204
- errors: issues.length > 0
205
- ? issues.map((iss) => (iss.path && iss.path.length > 0 ? iss.path.join('.') + ': ' + iss.message : '(root): ' + iss.message))
206
- : []
207
- };
208
- }
209
- return { success: true, data: result.data };
210
- }
211
- /**
212
- * Parse ValidationError data with exception on validation failure
213
- */
214
- function parseValidationError(data) {
215
- return exports.ValidationErrorSchema.parse(data);
216
- }
217
- /**
218
- * Create a branded ValidationError instance
219
- */
220
- function createBrandedValidationError(data) {
221
- return data;
222
- }
223
- /**
224
- * Runtime type guard for ValidationError
225
- */
226
- function isValidationError(value) {
227
- return exports.ValidationErrorSchema.safeParse(value).success;
228
- }
229
- /**
230
- * Zod validation schema for HTTPValidationError
231
- */
232
- exports.HTTPValidationErrorSchema = zod_1.z.object({
233
- detail: zod_1.z.array(exports.ValidationErrorSchema).optional()
234
- }).strict();
235
- /**
236
- * Validate HTTPValidationError data with detailed error reporting
237
- */
238
- function validateHTTPValidationError(data) {
239
- const result = exports.HTTPValidationErrorSchema.safeParse(data);
240
- if (!result.success) {
241
- const issues = result.error?.issues ?? [];
242
- console.warn('Response validation failed:', issues);
243
- // Return a structured failure result so consumers can handle errors without requiring a runtime ValidationError class
244
- return {
245
- success: false,
246
- errors: issues.length > 0
247
- ? issues.map((iss) => (iss.path && iss.path.length > 0 ? iss.path.join('.') + ': ' + iss.message : '(root): ' + iss.message))
248
- : []
249
- };
250
- }
251
- return { success: true, data: result.data };
252
- }
253
- /**
254
- * Parse HTTPValidationError data with exception on validation failure
255
- */
256
- function parseHTTPValidationError(data) {
257
- return exports.HTTPValidationErrorSchema.parse(data);
258
- }
259
- /**
260
- * Create a branded HTTPValidationError instance
261
- */
262
- function createBrandedHTTPValidationError(data) {
263
- return data;
264
- }
265
- /**
266
- * Runtime type guard for HTTPValidationError
267
- */
268
- function isHTTPValidationError(value) {
269
- return exports.HTTPValidationErrorSchema.safeParse(value).success;
270
- }
271
- /**
272
- * Zod validation schema for HealthResponse
273
- */
274
- exports.HealthResponseSchema = zod_1.z.object({
275
- status: zod_1.z.string(),
276
- version: zod_1.z.string(),
277
- environment: zod_1.z.string()
278
- }).strict();
279
- /**
280
- * Validate HealthResponse data with detailed error reporting
281
- */
282
- function validateHealthResponse(data) {
283
- const result = exports.HealthResponseSchema.safeParse(data);
284
- if (!result.success) {
285
- const issues = result.error?.issues ?? [];
286
- console.warn('Response validation failed:', issues);
287
- // Return a structured failure result so consumers can handle errors without requiring a runtime ValidationError class
288
- return {
289
- success: false,
290
- errors: issues.length > 0
291
- ? issues.map((iss) => (iss.path && iss.path.length > 0 ? iss.path.join('.') + ': ' + iss.message : '(root): ' + iss.message))
292
- : []
293
- };
294
- }
295
- return { success: true, data: result.data };
296
- }
297
- /**
298
- * Parse HealthResponse data with exception on validation failure
299
- */
300
- function parseHealthResponse(data) {
301
- return exports.HealthResponseSchema.parse(data);
302
- }
303
- /**
304
- * Create a branded HealthResponse instance
305
- */
306
- function createBrandedHealthResponse(data) {
307
- return data;
308
- }
309
- /**
310
- * Runtime type guard for HealthResponse
311
- */
312
- function isHealthResponse(value) {
313
- return exports.HealthResponseSchema.safeParse(value).success;
314
- }
315
- //# sourceMappingURL=types.js.map