@orval/zod 8.19.0 → 8.21.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.
- package/dist/index.d.mts +22 -4
- package/dist/index.mjs +436 -69
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ClientBuilder, ClientGeneratorsBuilder, ContextSpec,
|
|
1
|
+
import { ClientBuilder, ClientDependenciesBuilder, ClientGeneratorsBuilder, ContextSpec, GeneratorMutator, OpenApiParameterObject, OpenApiReferenceObject, OpenApiSchemaObject, PackageJson, ZodCoerceType, ZodVariantOption, ZodVersionOption } from "@orval/core";
|
|
2
2
|
|
|
3
3
|
//#region src/compatible-v4.d.ts
|
|
4
4
|
declare const isZodVersionV4: (packageJson: PackageJson) => boolean;
|
|
@@ -13,9 +13,18 @@ declare const isZodVersionV4: (packageJson: PackageJson) => boolean;
|
|
|
13
13
|
* target is pinned while preserving package-detection for `'auto'`.
|
|
14
14
|
*/
|
|
15
15
|
declare const resolveIsZodV4: (version: ZodVersionOption | undefined, packageJson: PackageJson | undefined) => boolean;
|
|
16
|
+
declare const assertZodTarget: ({
|
|
17
|
+
variant,
|
|
18
|
+
isZodV4
|
|
19
|
+
}: {
|
|
20
|
+
variant: ZodVariantOption | undefined;
|
|
21
|
+
isZodV4: boolean;
|
|
22
|
+
}) => void;
|
|
23
|
+
declare const getZodImportSource: (variant: ZodVariantOption | undefined) => "zod/mini" | "zod";
|
|
24
|
+
declare const getZodTypeName: (variant: ZodVariantOption | undefined) => "ZodMiniType" | "ZodType";
|
|
16
25
|
//#endregion
|
|
17
26
|
//#region src/index.d.ts
|
|
18
|
-
declare const getZodDependencies:
|
|
27
|
+
declare const getZodDependencies: ClientDependenciesBuilder;
|
|
19
28
|
declare const predefinedZodFormats: Set<string>;
|
|
20
29
|
interface ZodValidationSchemaDefinition {
|
|
21
30
|
functions: [string, unknown][];
|
|
@@ -58,6 +67,15 @@ declare const generateZodValidationSchemaDefinition: (schema: OpenApiSchemaObjec
|
|
|
58
67
|
* placeholder instead of being inlined.
|
|
59
68
|
*/
|
|
60
69
|
useReusableSchemas?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* When true, suppress File/Blob coercion for binary string fields anywhere
|
|
72
|
+
* in the tree (`format: binary` / `contentMediaType: application/octet-stream`),
|
|
73
|
+
* keeping them as `string`. Set for `application/x-www-form-urlencoded` bodies,
|
|
74
|
+
* which serialize via URLSearchParams (string-only) — mirrors core's
|
|
75
|
+
* `formDataContext.urlEncoded` handling in getScalar (#1624). Threaded into
|
|
76
|
+
* every recursive call so nested/array/composed fields are covered too.
|
|
77
|
+
*/
|
|
78
|
+
urlEncoded?: boolean;
|
|
61
79
|
/**
|
|
62
80
|
* When true (and `isZodV4`), the top-level (named component) schema emits a
|
|
63
81
|
* `.meta({ id, description?, deprecated? })` instead of `.describe(...)`.
|
|
@@ -86,7 +104,7 @@ interface ZodParamsContext {
|
|
|
86
104
|
interface ZodParamsInjection extends Pick<ZodParamsContext, 'operationId' | 'location' | 'schemaName'> {
|
|
87
105
|
mutator: GeneratorMutator;
|
|
88
106
|
}
|
|
89
|
-
declare const parseZodValidationSchemaDefinition: (input: ZodValidationSchemaDefinition, context: ContextSpec, coerceTypes: boolean | ZodCoerceType[] | undefined, strict: boolean, isZodV4: boolean, preprocess?: GeneratorMutator, paramsInjection?: ZodParamsInjection) => {
|
|
107
|
+
declare const parseZodValidationSchemaDefinition: (input: ZodValidationSchemaDefinition, context: ContextSpec, coerceTypes: boolean | ZodCoerceType[] | undefined, strict: boolean, isZodV4: boolean, preprocess?: GeneratorMutator, paramsInjection?: ZodParamsInjection, variant?: ZodVariantOption) => {
|
|
90
108
|
zod: string;
|
|
91
109
|
consts: string;
|
|
92
110
|
usedRefs: Set<string>;
|
|
@@ -150,5 +168,5 @@ declare const parseParameters: ({
|
|
|
150
168
|
declare const generateZod: ClientBuilder;
|
|
151
169
|
declare const builder: () => () => ClientGeneratorsBuilder;
|
|
152
170
|
//#endregion
|
|
153
|
-
export { ZodParamsContext, ZodParamsInjection, ZodValidationSchemaDefinition, builder, builder as default, dereference, generateFormDataZodSchema, generateZod, generateZodValidationSchemaDefinition, getZodDependencies, isZodVersionV4, parseParameters, parseZodValidationSchemaDefinition, predefinedZodFormats, resolveIsZodV4 };
|
|
171
|
+
export { ZodParamsContext, ZodParamsInjection, ZodValidationSchemaDefinition, assertZodTarget, builder, builder as default, dereference, generateFormDataZodSchema, generateZod, generateZodValidationSchemaDefinition, getZodDependencies, getZodImportSource, getZodTypeName, isZodVersionV4, parseParameters, parseZodValidationSchemaDefinition, predefinedZodFormats, resolveIsZodV4 };
|
|
154
172
|
//# sourceMappingURL=index.d.mts.map
|