@miroir-framework/jzod-ts 0.5.3 → 0.6.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.
- package/dist/bundle.d.ts +177 -334
- package/dist/bundle.js +43 -257
- package/dist/out-tsc/dts/src/JzodToTs.d.ts +17 -0
- package/dist/out-tsc/dts/src/generated_jzodBootstrapElementSchema.d.ts +246 -0
- package/dist/out-tsc/dts/src/index.d.ts +3 -0
- package/dist/out-tsc/dts/src/preBuild.d.ts +1 -0
- package/dist/out-tsc/dts/src/tools.d.ts +4 -0
- package/dist/src/JzodToTs.d.ts +2 -2
- package/dist/src/generated_jzodBootstrapElementSchema.d.ts +249 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/preBuild.d.ts +1 -0
- package/package.json +40 -38
- package/src/JzodToTs.ts +118 -109
- package/src/generated_jzodBootstrapElementSchema.ts +252 -0
- package/src/index.ts +60 -60
- package/src/preBuild.ts +54 -0
- package/tests/jzod-ts.test.ts +107 -108
- package/tests/resources/tsTypeGeneration-testJzodSchema1 - reference.ts +5 -5
- package/tests/resources/tsTypeGeneration-testJzodSchema2 - reference.ts +11 -11
- package/tests/resources/tsTypeGeneration-testJzodSchema3 - reference.ts +19 -19
- package/tests/resources/tsTypeGeneration-testJzodSchema4 - reference.ts +253 -250
- package/tsconfig.json +25 -25
- package/dist/src/JzodTsInterface.d.ts +0 -397
- package/src/JzodTsInterface.ts +0 -450
package/dist/bundle.d.ts
CHANGED
|
@@ -1,400 +1,243 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
|
-
import { z
|
|
2
|
+
import { z } from 'zod';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
optional: z.ZodOptional<z.ZodBoolean>;
|
|
6
|
-
}, "strict", z.ZodTypeAny, {
|
|
4
|
+
type JzodArray = {
|
|
7
5
|
optional?: boolean | undefined;
|
|
8
|
-
|
|
9
|
-
optional?: boolean | undefined;
|
|
10
|
-
}>;
|
|
11
|
-
type JzodRoot = z.infer<typeof jzodRootSchema>;
|
|
12
|
-
declare const jzodEnumAttributeTypes: z.ZodEnum<["any", "bigint", "boolean", "date", "never", "null", "number", "string", "uuid", "undefined", "unknown", "void"]>;
|
|
13
|
-
type JzodEnumTypes = z.infer<typeof jzodEnumAttributeTypes>;
|
|
14
|
-
declare const jzodEnumElementTypes: z.ZodEnum<["array", "enum", "function", "lazy", "literal", "intersection", "map", "object", "promise", "record", "schemaReference", "set", "simpleType", "tuple", "union"]>;
|
|
15
|
-
type JzodEnumElementTypes = z.infer<typeof jzodEnumElementTypes>;
|
|
16
|
-
interface JzodArray extends JzodRoot {
|
|
17
|
-
optional?: boolean;
|
|
18
|
-
nullable?: boolean;
|
|
6
|
+
nullable?: boolean | undefined;
|
|
19
7
|
extra?: {
|
|
20
|
-
[
|
|
21
|
-
};
|
|
22
|
-
type:
|
|
8
|
+
[x: string]: any;
|
|
9
|
+
} | undefined;
|
|
10
|
+
type: "array";
|
|
23
11
|
definition: JzodElement;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
type: "
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
12
|
+
};
|
|
13
|
+
type JzodAttribute = {
|
|
14
|
+
optional?: boolean | undefined;
|
|
15
|
+
nullable?: boolean | undefined;
|
|
16
|
+
extra?: {
|
|
17
|
+
[x: string]: any;
|
|
18
|
+
} | undefined;
|
|
19
|
+
type: "simpleType";
|
|
20
|
+
coerce?: boolean | undefined;
|
|
21
|
+
definition: JzodEnumAttributeTypes;
|
|
22
|
+
};
|
|
23
|
+
type JzodAttributeDateValidations = {
|
|
24
|
+
extra?: {
|
|
25
|
+
[x: string]: any;
|
|
26
|
+
} | undefined;
|
|
35
27
|
type: "min" | "max";
|
|
36
|
-
extra?: Record<string, any> | undefined;
|
|
37
|
-
parameter?: any;
|
|
38
|
-
}>;
|
|
39
|
-
type JzodAttributeDateValidations = z.infer<typeof jzodAttributeDateValidations>;
|
|
40
|
-
declare const jzodAttributeNumberValidations: z.ZodObject<{
|
|
41
|
-
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
42
|
-
type: z.ZodEnum<["gt", "gte", "lt", "lte", "int", "positive", "nonpositive", "negative", "nonnegative", "multipleOf", "finite", "safe"]>;
|
|
43
|
-
parameter: z.ZodAny;
|
|
44
|
-
}, "strict", z.ZodTypeAny, {
|
|
45
|
-
type: "multipleOf" | "gt" | "gte" | "lt" | "lte" | "int" | "positive" | "nonpositive" | "negative" | "nonnegative" | "finite" | "safe";
|
|
46
|
-
extra?: Record<string, any> | undefined;
|
|
47
|
-
parameter?: any;
|
|
48
|
-
}, {
|
|
49
|
-
type: "multipleOf" | "gt" | "gte" | "lt" | "lte" | "int" | "positive" | "nonpositive" | "negative" | "nonnegative" | "finite" | "safe";
|
|
50
|
-
extra?: Record<string, any> | undefined;
|
|
51
28
|
parameter?: any;
|
|
52
|
-
}
|
|
53
|
-
type
|
|
54
|
-
declare const jzodAttributeStringValidations: z.ZodObject<{
|
|
55
|
-
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
56
|
-
type: z.ZodEnum<["max", "min", "length", "email", "url", "emoji", "uuid", "cuid", "cuid2", "ulid", "regex", "includes", "startsWith", "endsWith", "datetime", "ip"]>;
|
|
57
|
-
parameter: z.ZodAny;
|
|
58
|
-
}, "strict", z.ZodTypeAny, {
|
|
59
|
-
type: "length" | "includes" | "uuid" | "min" | "max" | "email" | "url" | "emoji" | "cuid" | "cuid2" | "ulid" | "regex" | "startsWith" | "endsWith" | "datetime" | "ip";
|
|
60
|
-
extra?: Record<string, any> | undefined;
|
|
61
|
-
parameter?: any;
|
|
62
|
-
}, {
|
|
63
|
-
type: "length" | "includes" | "uuid" | "min" | "max" | "email" | "url" | "emoji" | "cuid" | "cuid2" | "ulid" | "regex" | "startsWith" | "endsWith" | "datetime" | "ip";
|
|
64
|
-
extra?: Record<string, any> | undefined;
|
|
65
|
-
parameter?: any;
|
|
66
|
-
}>;
|
|
67
|
-
type JzodAttributeStringValidations = z.infer<typeof jzodAttributeStringValidations>;
|
|
68
|
-
declare const jzodAttributeDateWithValidations: z.ZodObject<{
|
|
69
|
-
optional: z.ZodOptional<z.ZodBoolean>;
|
|
70
|
-
nullable: z.ZodOptional<z.ZodBoolean>;
|
|
71
|
-
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
72
|
-
coerce: z.ZodOptional<z.ZodBoolean>;
|
|
73
|
-
type: z.ZodLiteral<"simpleType">;
|
|
74
|
-
definition: z.ZodLiteral<"date">;
|
|
75
|
-
validations: z.ZodArray<z.ZodObject<{
|
|
76
|
-
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
77
|
-
type: z.ZodEnum<["min", "max"]>;
|
|
78
|
-
parameter: z.ZodAny;
|
|
79
|
-
}, "strict", z.ZodTypeAny, {
|
|
80
|
-
type: "min" | "max";
|
|
81
|
-
extra?: Record<string, any> | undefined;
|
|
82
|
-
parameter?: any;
|
|
83
|
-
}, {
|
|
84
|
-
type: "min" | "max";
|
|
85
|
-
extra?: Record<string, any> | undefined;
|
|
86
|
-
parameter?: any;
|
|
87
|
-
}>, "many">;
|
|
88
|
-
}, "strict", z.ZodTypeAny, {
|
|
89
|
-
type: "simpleType";
|
|
90
|
-
definition: "date";
|
|
91
|
-
validations: {
|
|
92
|
-
type: "min" | "max";
|
|
93
|
-
extra?: Record<string, any> | undefined;
|
|
94
|
-
parameter?: any;
|
|
95
|
-
}[];
|
|
29
|
+
};
|
|
30
|
+
type JzodAttributeDateWithValidations = {
|
|
96
31
|
optional?: boolean | undefined;
|
|
97
32
|
nullable?: boolean | undefined;
|
|
98
|
-
extra?:
|
|
99
|
-
|
|
100
|
-
}
|
|
33
|
+
extra?: {
|
|
34
|
+
[x: string]: any;
|
|
35
|
+
} | undefined;
|
|
101
36
|
type: "simpleType";
|
|
102
37
|
definition: "date";
|
|
103
|
-
validations: {
|
|
104
|
-
type: "min" | "max";
|
|
105
|
-
extra?: Record<string, any> | undefined;
|
|
106
|
-
parameter?: any;
|
|
107
|
-
}[];
|
|
108
|
-
optional?: boolean | undefined;
|
|
109
|
-
nullable?: boolean | undefined;
|
|
110
|
-
extra?: Record<string, any> | undefined;
|
|
111
38
|
coerce?: boolean | undefined;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
123
|
-
type: z.ZodEnum<["gt", "gte", "lt", "lte", "int", "positive", "nonpositive", "negative", "nonnegative", "multipleOf", "finite", "safe"]>;
|
|
124
|
-
parameter: z.ZodAny;
|
|
125
|
-
}, "strict", z.ZodTypeAny, {
|
|
126
|
-
type: "multipleOf" | "gt" | "gte" | "lt" | "lte" | "int" | "positive" | "nonpositive" | "negative" | "nonnegative" | "finite" | "safe";
|
|
127
|
-
extra?: Record<string, any> | undefined;
|
|
128
|
-
parameter?: any;
|
|
129
|
-
}, {
|
|
130
|
-
type: "multipleOf" | "gt" | "gte" | "lt" | "lte" | "int" | "positive" | "nonpositive" | "negative" | "nonnegative" | "finite" | "safe";
|
|
131
|
-
extra?: Record<string, any> | undefined;
|
|
132
|
-
parameter?: any;
|
|
133
|
-
}>, "many">;
|
|
134
|
-
}, "strict", z.ZodTypeAny, {
|
|
135
|
-
type: "simpleType";
|
|
136
|
-
definition: "number";
|
|
137
|
-
validations: {
|
|
138
|
-
type: "multipleOf" | "gt" | "gte" | "lt" | "lte" | "int" | "positive" | "nonpositive" | "negative" | "nonnegative" | "finite" | "safe";
|
|
139
|
-
extra?: Record<string, any> | undefined;
|
|
140
|
-
parameter?: any;
|
|
141
|
-
}[];
|
|
39
|
+
validations: JzodAttributeDateValidations[];
|
|
40
|
+
};
|
|
41
|
+
type JzodAttributeNumberValidations = {
|
|
42
|
+
extra?: {
|
|
43
|
+
[x: string]: any;
|
|
44
|
+
} | undefined;
|
|
45
|
+
type: "gt" | "gte" | "lt" | "lte" | "int" | "positive" | "nonpositive" | "negative" | "nonnegative" | "multipleOf" | "finite" | "safe";
|
|
46
|
+
parameter?: any;
|
|
47
|
+
};
|
|
48
|
+
type JzodAttributeNumberWithValidations = {
|
|
142
49
|
optional?: boolean | undefined;
|
|
143
50
|
nullable?: boolean | undefined;
|
|
144
|
-
extra?:
|
|
145
|
-
|
|
146
|
-
}
|
|
51
|
+
extra?: {
|
|
52
|
+
[x: string]: any;
|
|
53
|
+
} | undefined;
|
|
147
54
|
type: "simpleType";
|
|
148
55
|
definition: "number";
|
|
149
|
-
validations: {
|
|
150
|
-
type: "multipleOf" | "gt" | "gte" | "lt" | "lte" | "int" | "positive" | "nonpositive" | "negative" | "nonnegative" | "finite" | "safe";
|
|
151
|
-
extra?: Record<string, any> | undefined;
|
|
152
|
-
parameter?: any;
|
|
153
|
-
}[];
|
|
154
|
-
optional?: boolean | undefined;
|
|
155
|
-
nullable?: boolean | undefined;
|
|
156
|
-
extra?: Record<string, any> | undefined;
|
|
157
56
|
coerce?: boolean | undefined;
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
169
|
-
type: z.ZodEnum<["max", "min", "length", "email", "url", "emoji", "uuid", "cuid", "cuid2", "ulid", "regex", "includes", "startsWith", "endsWith", "datetime", "ip"]>;
|
|
170
|
-
parameter: z.ZodAny;
|
|
171
|
-
}, "strict", z.ZodTypeAny, {
|
|
172
|
-
type: "length" | "includes" | "uuid" | "min" | "max" | "email" | "url" | "emoji" | "cuid" | "cuid2" | "ulid" | "regex" | "startsWith" | "endsWith" | "datetime" | "ip";
|
|
173
|
-
extra?: Record<string, any> | undefined;
|
|
174
|
-
parameter?: any;
|
|
175
|
-
}, {
|
|
176
|
-
type: "length" | "includes" | "uuid" | "min" | "max" | "email" | "url" | "emoji" | "cuid" | "cuid2" | "ulid" | "regex" | "startsWith" | "endsWith" | "datetime" | "ip";
|
|
177
|
-
extra?: Record<string, any> | undefined;
|
|
178
|
-
parameter?: any;
|
|
179
|
-
}>, "many">;
|
|
180
|
-
}, "strict", z.ZodTypeAny, {
|
|
181
|
-
type: "simpleType";
|
|
182
|
-
definition: "string";
|
|
183
|
-
validations: {
|
|
184
|
-
type: "length" | "includes" | "uuid" | "min" | "max" | "email" | "url" | "emoji" | "cuid" | "cuid2" | "ulid" | "regex" | "startsWith" | "endsWith" | "datetime" | "ip";
|
|
185
|
-
extra?: Record<string, any> | undefined;
|
|
186
|
-
parameter?: any;
|
|
187
|
-
}[];
|
|
57
|
+
validations: JzodAttributeNumberValidations[];
|
|
58
|
+
};
|
|
59
|
+
type JzodAttributeStringValidations = {
|
|
60
|
+
extra?: {
|
|
61
|
+
[x: string]: any;
|
|
62
|
+
} | undefined;
|
|
63
|
+
type: "max" | "min" | "length" | "email" | "url" | "emoji" | "uuid" | "cuid" | "cuid2" | "ulid" | "regex" | "includes" | "startsWith" | "endsWith" | "datetime" | "ip";
|
|
64
|
+
parameter?: any;
|
|
65
|
+
};
|
|
66
|
+
type JzodAttributeStringWithValidations = {
|
|
188
67
|
optional?: boolean | undefined;
|
|
189
68
|
nullable?: boolean | undefined;
|
|
190
|
-
extra?:
|
|
191
|
-
|
|
192
|
-
}
|
|
69
|
+
extra?: {
|
|
70
|
+
[x: string]: any;
|
|
71
|
+
} | undefined;
|
|
193
72
|
type: "simpleType";
|
|
194
73
|
definition: "string";
|
|
195
|
-
validations: {
|
|
196
|
-
type: "length" | "includes" | "uuid" | "min" | "max" | "email" | "url" | "emoji" | "cuid" | "cuid2" | "ulid" | "regex" | "startsWith" | "endsWith" | "datetime" | "ip";
|
|
197
|
-
extra?: Record<string, any> | undefined;
|
|
198
|
-
parameter?: any;
|
|
199
|
-
}[];
|
|
200
|
-
optional?: boolean | undefined;
|
|
201
|
-
nullable?: boolean | undefined;
|
|
202
|
-
extra?: Record<string, any> | undefined;
|
|
203
|
-
coerce?: boolean | undefined;
|
|
204
|
-
}>;
|
|
205
|
-
type JzodAttributeStringWithValidations = z.infer<typeof jzodAttributeStringWithValidations>;
|
|
206
|
-
declare const jzodAttribute: z.ZodObject<{
|
|
207
|
-
optional: z.ZodOptional<z.ZodBoolean>;
|
|
208
|
-
nullable: z.ZodOptional<z.ZodBoolean>;
|
|
209
|
-
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
210
|
-
coerce: z.ZodOptional<z.ZodBoolean>;
|
|
211
|
-
type: z.ZodLiteral<"simpleType">;
|
|
212
|
-
definition: z.ZodLazy<z.ZodEnum<["any", "bigint", "boolean", "date", "never", "null", "number", "string", "uuid", "undefined", "unknown", "void"]>>;
|
|
213
|
-
}, "strict", z.ZodTypeAny, {
|
|
214
|
-
type: "simpleType";
|
|
215
|
-
definition: "string" | "number" | "bigint" | "boolean" | "undefined" | "any" | "date" | "never" | "null" | "uuid" | "unknown" | "void";
|
|
216
|
-
optional?: boolean | undefined;
|
|
217
|
-
nullable?: boolean | undefined;
|
|
218
|
-
extra?: Record<string, any> | undefined;
|
|
219
74
|
coerce?: boolean | undefined;
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
nullable?: boolean | undefined;
|
|
225
|
-
extra?: Record<string, any> | undefined;
|
|
226
|
-
coerce?: boolean | undefined;
|
|
227
|
-
}>;
|
|
228
|
-
type JzodAttribute = z.infer<typeof jzodAttribute>;
|
|
229
|
-
type JzodElement = JzodArray | JzodAttribute | JzodAttributeDateWithValidations | JzodAttributeNumberWithValidations | JzodAttributeStringWithValidations | JzodEnum | JzodFunction | JzodLazy | JzodLiteral | JzodIntersection | JzodMap | JzodRecord | JzodObject | JzodPromise | JzodReference | JzodSet | JzodTuple | JzodUnion;
|
|
230
|
-
declare const jzodElement: z.ZodType<JzodElement>;
|
|
231
|
-
declare const jzodEnum: z.ZodObject<{
|
|
232
|
-
optional: z.ZodOptional<z.ZodBoolean>;
|
|
233
|
-
nullable: z.ZodOptional<z.ZodBoolean>;
|
|
234
|
-
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
235
|
-
type: z.ZodLiteral<"enum">;
|
|
236
|
-
definition: z.ZodArray<z.ZodString, "many">;
|
|
237
|
-
}, "strict", z.ZodTypeAny, {
|
|
238
|
-
type: "enum";
|
|
239
|
-
definition: string[];
|
|
75
|
+
validations: JzodAttributeStringValidations[];
|
|
76
|
+
};
|
|
77
|
+
type JzodElement = JzodArray | JzodAttribute | JzodAttributeDateWithValidations | JzodAttributeNumberWithValidations | JzodAttributeStringWithValidations | JzodEnum | JzodFunction | JzodLazy | JzodLiteral | JzodIntersection | JzodMap | JzodObject | JzodPromise | JzodRecord | JzodReference | JzodSet | JzodTuple | JzodUnion;
|
|
78
|
+
type JzodEnum = {
|
|
240
79
|
optional?: boolean | undefined;
|
|
241
80
|
nullable?: boolean | undefined;
|
|
242
|
-
extra?:
|
|
243
|
-
|
|
81
|
+
extra?: {
|
|
82
|
+
[x: string]: any;
|
|
83
|
+
} | undefined;
|
|
244
84
|
type: "enum";
|
|
245
85
|
definition: string[];
|
|
86
|
+
};
|
|
87
|
+
type JzodEnumAttributeTypes = "any" | "bigint" | "boolean" | "date" | "never" | "null" | "number" | "string" | "uuid" | "undefined" | "unknown" | "void";
|
|
88
|
+
type JzodEnumElementTypes = "array" | "enum" | "function" | "lazy" | "literal" | "intersection" | "map" | "object" | "promise" | "record" | "schemaReference" | "set" | "simpleType" | "tuple" | "union";
|
|
89
|
+
type JzodFunction = {
|
|
246
90
|
optional?: boolean | undefined;
|
|
247
91
|
nullable?: boolean | undefined;
|
|
248
|
-
extra?: Record<string, any> | undefined;
|
|
249
|
-
}>;
|
|
250
|
-
type JzodEnum = z.infer<typeof jzodEnum>;
|
|
251
|
-
interface JzodFunction {
|
|
252
92
|
extra?: {
|
|
253
|
-
[
|
|
254
|
-
};
|
|
255
|
-
type:
|
|
93
|
+
[x: string]: any;
|
|
94
|
+
} | undefined;
|
|
95
|
+
type: "function";
|
|
256
96
|
definition: {
|
|
257
97
|
args: JzodElement[];
|
|
258
|
-
returns?: JzodElement;
|
|
98
|
+
returns?: JzodElement | undefined;
|
|
259
99
|
};
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
extra
|
|
265
|
-
|
|
266
|
-
}
|
|
267
|
-
type: "lazy";
|
|
268
|
-
definition: JzodFunction;
|
|
269
|
-
extra?: Record<string, any> | undefined;
|
|
270
|
-
}, {
|
|
100
|
+
};
|
|
101
|
+
type JzodLazy = {
|
|
102
|
+
optional?: boolean | undefined;
|
|
103
|
+
nullable?: boolean | undefined;
|
|
104
|
+
extra?: {
|
|
105
|
+
[x: string]: any;
|
|
106
|
+
} | undefined;
|
|
271
107
|
type: "lazy";
|
|
272
108
|
definition: JzodFunction;
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
type JzodLazy = z.infer<typeof jzodLazy>;
|
|
276
|
-
declare const jzodLiteral: z.ZodObject<{
|
|
277
|
-
optional: z.ZodOptional<z.ZodBoolean>;
|
|
278
|
-
nullable: z.ZodOptional<z.ZodBoolean>;
|
|
279
|
-
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
280
|
-
type: z.ZodLiteral<"literal">;
|
|
281
|
-
definition: z.ZodString;
|
|
282
|
-
}, "strict", z.ZodTypeAny, {
|
|
283
|
-
type: "literal";
|
|
284
|
-
definition: string;
|
|
109
|
+
};
|
|
110
|
+
type JzodLiteral = {
|
|
285
111
|
optional?: boolean | undefined;
|
|
286
112
|
nullable?: boolean | undefined;
|
|
287
|
-
extra?:
|
|
288
|
-
|
|
113
|
+
extra?: {
|
|
114
|
+
[x: string]: any;
|
|
115
|
+
} | undefined;
|
|
289
116
|
type: "literal";
|
|
290
117
|
definition: string;
|
|
118
|
+
};
|
|
119
|
+
type JzodIntersection = {
|
|
291
120
|
optional?: boolean | undefined;
|
|
292
121
|
nullable?: boolean | undefined;
|
|
293
|
-
extra?: Record<string, any> | undefined;
|
|
294
|
-
}>;
|
|
295
|
-
type JzodLiteral = z.infer<typeof jzodLiteral>;
|
|
296
|
-
interface JzodIntersection {
|
|
297
|
-
optional?: boolean;
|
|
298
|
-
nullable?: boolean;
|
|
299
122
|
extra?: {
|
|
300
|
-
[
|
|
301
|
-
};
|
|
302
|
-
type:
|
|
123
|
+
[x: string]: any;
|
|
124
|
+
} | undefined;
|
|
125
|
+
type: "intersection";
|
|
303
126
|
definition: {
|
|
304
127
|
left: JzodElement;
|
|
305
128
|
right: JzodElement;
|
|
306
129
|
};
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
nullable?: boolean;
|
|
130
|
+
};
|
|
131
|
+
type JzodMap = {
|
|
132
|
+
optional?: boolean | undefined;
|
|
133
|
+
nullable?: boolean | undefined;
|
|
312
134
|
extra?: {
|
|
313
|
-
[
|
|
314
|
-
};
|
|
315
|
-
type:
|
|
316
|
-
definition: [
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
135
|
+
[x: string]: any;
|
|
136
|
+
} | undefined;
|
|
137
|
+
type: "map";
|
|
138
|
+
definition: [
|
|
139
|
+
JzodElement,
|
|
140
|
+
JzodElement
|
|
141
|
+
];
|
|
142
|
+
};
|
|
143
|
+
type JzodObject = {
|
|
144
|
+
optional?: boolean | undefined;
|
|
145
|
+
nullable?: boolean | undefined;
|
|
323
146
|
extra?: {
|
|
324
|
-
[
|
|
325
|
-
};
|
|
147
|
+
[x: string]: any;
|
|
148
|
+
} | undefined;
|
|
149
|
+
extend?: (JzodReference | JzodObject) | undefined;
|
|
326
150
|
type: "object";
|
|
327
|
-
nonStrict?: boolean;
|
|
151
|
+
nonStrict?: boolean | undefined;
|
|
328
152
|
definition: {
|
|
329
|
-
[
|
|
153
|
+
[x: string]: JzodElement;
|
|
330
154
|
};
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
|
|
155
|
+
};
|
|
156
|
+
type JzodPromise = {
|
|
157
|
+
optional?: boolean | undefined;
|
|
158
|
+
nullable?: boolean | undefined;
|
|
334
159
|
extra?: {
|
|
335
|
-
[
|
|
336
|
-
};
|
|
337
|
-
type:
|
|
160
|
+
[x: string]: any;
|
|
161
|
+
} | undefined;
|
|
162
|
+
type: "promise";
|
|
338
163
|
definition: JzodElement;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
nullable?: boolean;
|
|
164
|
+
};
|
|
165
|
+
type JzodRecord = {
|
|
166
|
+
optional?: boolean | undefined;
|
|
167
|
+
nullable?: boolean | undefined;
|
|
344
168
|
extra?: {
|
|
345
|
-
[
|
|
346
|
-
};
|
|
347
|
-
type:
|
|
169
|
+
[x: string]: any;
|
|
170
|
+
} | undefined;
|
|
171
|
+
type: "record";
|
|
348
172
|
definition: JzodElement;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
nullable?: boolean;
|
|
173
|
+
};
|
|
174
|
+
type JzodReference = {
|
|
175
|
+
optional?: boolean | undefined;
|
|
176
|
+
nullable?: boolean | undefined;
|
|
354
177
|
extra?: {
|
|
355
|
-
[
|
|
356
|
-
};
|
|
178
|
+
[x: string]: any;
|
|
179
|
+
} | undefined;
|
|
180
|
+
type: "schemaReference";
|
|
357
181
|
context?: {
|
|
358
|
-
[
|
|
359
|
-
};
|
|
360
|
-
type: 'schemaReference';
|
|
182
|
+
[x: string]: JzodElement;
|
|
183
|
+
} | undefined;
|
|
361
184
|
definition: {
|
|
362
|
-
eager?: boolean;
|
|
363
|
-
relativePath?: string;
|
|
364
|
-
absolutePath?: string;
|
|
185
|
+
eager?: boolean | undefined;
|
|
186
|
+
relativePath?: string | undefined;
|
|
187
|
+
absolutePath?: string | undefined;
|
|
365
188
|
};
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
nullable?: boolean;
|
|
189
|
+
};
|
|
190
|
+
type JzodSet = {
|
|
191
|
+
optional?: boolean | undefined;
|
|
192
|
+
nullable?: boolean | undefined;
|
|
371
193
|
extra?: {
|
|
372
|
-
[
|
|
373
|
-
};
|
|
374
|
-
type:
|
|
194
|
+
[x: string]: any;
|
|
195
|
+
} | undefined;
|
|
196
|
+
type: "set";
|
|
375
197
|
definition: JzodElement;
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
nullable?: boolean;
|
|
198
|
+
};
|
|
199
|
+
type JzodTuple = {
|
|
200
|
+
optional?: boolean | undefined;
|
|
201
|
+
nullable?: boolean | undefined;
|
|
381
202
|
extra?: {
|
|
382
|
-
[
|
|
383
|
-
};
|
|
384
|
-
type:
|
|
203
|
+
[x: string]: any;
|
|
204
|
+
} | undefined;
|
|
205
|
+
type: "tuple";
|
|
385
206
|
definition: JzodElement[];
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
nullable?: boolean;
|
|
207
|
+
};
|
|
208
|
+
type JzodUnion = {
|
|
209
|
+
optional?: boolean | undefined;
|
|
210
|
+
nullable?: boolean | undefined;
|
|
391
211
|
extra?: {
|
|
392
|
-
[
|
|
393
|
-
};
|
|
212
|
+
[x: string]: any;
|
|
213
|
+
} | undefined;
|
|
394
214
|
type: "union";
|
|
395
|
-
discriminator?: string;
|
|
215
|
+
discriminator?: string | undefined;
|
|
396
216
|
definition: JzodElement[];
|
|
397
|
-
}
|
|
217
|
+
};
|
|
218
|
+
declare const jzodArray: z.ZodType<JzodArray>;
|
|
219
|
+
declare const jzodAttribute: z.ZodType<JzodAttribute>;
|
|
220
|
+
declare const jzodAttributeDateValidations: z.ZodType<JzodAttributeDateValidations>;
|
|
221
|
+
declare const jzodAttributeDateWithValidations: z.ZodType<JzodAttributeDateWithValidations>;
|
|
222
|
+
declare const jzodAttributeNumberValidations: z.ZodType<JzodAttributeNumberValidations>;
|
|
223
|
+
declare const jzodAttributeNumberWithValidations: z.ZodType<JzodAttributeNumberWithValidations>;
|
|
224
|
+
declare const jzodAttributeStringValidations: z.ZodType<JzodAttributeStringValidations>;
|
|
225
|
+
declare const jzodAttributeStringWithValidations: z.ZodType<JzodAttributeStringWithValidations>;
|
|
226
|
+
declare const jzodElement: z.ZodType<JzodElement>;
|
|
227
|
+
declare const jzodEnum: z.ZodType<JzodEnum>;
|
|
228
|
+
declare const jzodEnumAttributeTypes: z.ZodType<JzodEnumAttributeTypes>;
|
|
229
|
+
declare const jzodEnumElementTypes: z.ZodType<JzodEnumElementTypes>;
|
|
230
|
+
declare const jzodFunction: z.ZodType<JzodFunction>;
|
|
231
|
+
declare const jzodLazy: z.ZodType<JzodLazy>;
|
|
232
|
+
declare const jzodLiteral: z.ZodType<JzodLiteral>;
|
|
233
|
+
declare const jzodIntersection: z.ZodType<JzodIntersection>;
|
|
234
|
+
declare const jzodMap: z.ZodType<JzodMap>;
|
|
235
|
+
declare const jzodObject: z.ZodType<JzodObject>;
|
|
236
|
+
declare const jzodPromise: z.ZodType<JzodPromise>;
|
|
237
|
+
declare const jzodRecord: z.ZodType<JzodRecord>;
|
|
238
|
+
declare const jzodReference: z.ZodType<JzodReference>;
|
|
239
|
+
declare const jzodSet: z.ZodType<JzodSet>;
|
|
240
|
+
declare const jzodTuple: z.ZodType<JzodTuple>;
|
|
398
241
|
declare const jzodUnion: z.ZodType<JzodUnion>;
|
|
399
242
|
|
|
400
243
|
type TsTypeAliases = {
|
|
@@ -411,9 +254,9 @@ interface TsTypeAliasesAndZodText {
|
|
|
411
254
|
mainZodText: string;
|
|
412
255
|
}
|
|
413
256
|
declare function jzodToTsTypeAliasesAndZodText(element: JzodElement, typeName?: string): TsTypeAliasesAndZodText;
|
|
414
|
-
declare function jzodToTsCode(jzodElement: JzodElement, exportPrefix?: boolean, typeName?: string): string;
|
|
257
|
+
declare function jzodToTsCode(jzodElement: JzodElement, exportPrefix?: boolean, typeName?: string, typeAnotationForSchema?: string[]): string;
|
|
415
258
|
|
|
416
259
|
declare function printTsTypeAlias(typeAlias: ts.TypeAliasDeclaration, exportPrefix?: boolean): string;
|
|
417
260
|
declare function printTsTypeAliases(typeAliases: TsTypeAliases, exportPrefix?: boolean): string;
|
|
418
261
|
|
|
419
|
-
export { JzodArray, JzodAttribute, JzodAttributeDateValidations, JzodAttributeDateWithValidations, JzodAttributeNumberValidations, JzodAttributeNumberWithValidations, JzodAttributeStringValidations, JzodAttributeStringWithValidations, JzodElement, JzodEnum,
|
|
262
|
+
export { JzodArray, JzodAttribute, JzodAttributeDateValidations, JzodAttributeDateWithValidations, JzodAttributeNumberValidations, JzodAttributeNumberWithValidations, JzodAttributeStringValidations, JzodAttributeStringWithValidations, JzodElement, JzodEnum, JzodEnumAttributeTypes, JzodEnumElementTypes, JzodFunction, JzodIntersection, JzodLazy, JzodLiteral, JzodMap, JzodObject, JzodPromise, JzodRecord, JzodReference, JzodSet, JzodTuple, TsTypeAliasesAndZodText as JzodTypeAliasesAndZodText, JzodUnion, TsTypeAliases, jzodArray, jzodAttribute, jzodAttributeDateValidations, jzodAttributeDateWithValidations, jzodAttributeNumberValidations, jzodAttributeNumberWithValidations, jzodAttributeStringValidations, jzodAttributeStringWithValidations, jzodElement, jzodEnum, jzodEnumAttributeTypes, jzodEnumElementTypes, jzodFunction, jzodIntersection, jzodLazy, jzodLiteral, jzodMap, jzodObject, jzodPromise, jzodRecord, jzodReference, jzodSet, jzodToTsCode, jzodToTsTypeAliasesAndZodText, jzodTuple, jzodUnion, printTsTypeAlias, printTsTypeAliases };
|