@rosen-bridge/fastify-enhanced 0.1.0 → 1.0.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 (47) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/dataTypes.d.ts +206 -428
  3. package/dist/dataTypes.d.ts.map +1 -1
  4. package/dist/dataTypes.js +3 -4
  5. package/dist/error.d.ts +5 -0
  6. package/dist/error.d.ts.map +1 -0
  7. package/dist/error.js +9 -0
  8. package/dist/fastify.d.ts +8 -38
  9. package/dist/fastify.d.ts.map +1 -1
  10. package/dist/fastify.js +19 -153
  11. package/dist/index.d.ts +3 -3
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +2 -2
  14. package/dist/jsonParser.d.ts +4 -0
  15. package/dist/jsonParser.d.ts.map +1 -0
  16. package/dist/jsonParser.js +18 -0
  17. package/dist/serializerCompiler.d.ts +14 -0
  18. package/dist/serializerCompiler.d.ts.map +1 -0
  19. package/dist/serializerCompiler.js +27 -0
  20. package/dist/swagger.d.ts +6 -0
  21. package/dist/swagger.d.ts.map +1 -0
  22. package/dist/swagger.js +42 -0
  23. package/dist/types.d.ts +8 -15
  24. package/dist/types.d.ts.map +1 -1
  25. package/dist/types.js +1 -1
  26. package/dist/utils.d.ts +2 -0
  27. package/dist/utils.d.ts.map +1 -0
  28. package/dist/utils.js +4 -0
  29. package/lib/error.ts +9 -0
  30. package/lib/fastify.ts +22 -166
  31. package/lib/index.ts +2 -2
  32. package/lib/jsonParser.ts +23 -0
  33. package/lib/serializerCompiler.ts +42 -0
  34. package/lib/swagger.ts +52 -0
  35. package/lib/types.ts +3 -3
  36. package/lib/utils.ts +6 -0
  37. package/package.json +18 -19
  38. package/tests/bin.ts +13 -0
  39. package/tests/e2e.spec.ts +74 -0
  40. package/tests/mockRoute.ts +104 -0
  41. package/tests/testData.ts +101 -0
  42. package/tsconfig.build.json +2 -1
  43. package/tsconfig.build.tsbuildinfo +1 -1
  44. package/tsconfig.json +2 -1
  45. package/vitest.config.ts +9 -1
  46. package/dist/tsconfig.tsbuildinfo +0 -1
  47. package/lib/dataTypes.ts +0 -7
@@ -1,456 +1,234 @@
1
1
  import zod from 'zod';
2
2
  export declare const types: {
3
- bigint: () => zod.ZodPipeline<
4
- zod.ZodUnion<[zod.ZodNumber, zod.ZodBigInt]>,
5
- zod.ZodBigInt
6
- >;
7
- string: (
8
- params?:
9
- | ({
10
- errorMap?: zod.ZodErrorMap | undefined;
11
- invalid_type_error?: string | undefined;
12
- required_error?: string | undefined;
13
- description?: string | undefined;
14
- } & {
15
- coerce?: true | undefined;
16
- })
17
- | undefined
18
- ) => zod.ZodString;
19
- number: (
20
- params?:
21
- | ({
22
- errorMap?: zod.ZodErrorMap | undefined;
23
- invalid_type_error?: string | undefined;
24
- required_error?: string | undefined;
25
- description?: string | undefined;
26
- } & {
27
- coerce?: boolean | undefined;
28
- })
29
- | undefined
30
- ) => zod.ZodNumber;
31
- boolean: (
32
- params?:
33
- | ({
34
- errorMap?: zod.ZodErrorMap | undefined;
35
- invalid_type_error?: string | undefined;
36
- required_error?: string | undefined;
37
- description?: string | undefined;
38
- } & {
39
- coerce?: boolean | undefined;
40
- })
41
- | undefined
42
- ) => zod.ZodBoolean;
43
- symbol: (params?: zod.RawCreateParams) => zod.ZodSymbol;
44
- undefined: (params?: zod.RawCreateParams) => zod.ZodUndefined;
45
- object: <T extends zod.ZodRawShape>(
46
- shape: T,
47
- params?: zod.RawCreateParams
48
- ) => zod.ZodObject<
49
- T,
50
- 'strip',
51
- zod.ZodTypeAny,
52
- {
53
- [k_1 in keyof zod.objectUtil.addQuestionMarks<
54
- zod.baseObjectOutputType<T>,
55
- {
56
- [k in keyof zod.baseObjectOutputType<T>]: undefined extends zod.baseObjectOutputType<T>[k]
57
- ? never
58
- : k;
59
- }[keyof T]
60
- >]: zod.objectUtil.addQuestionMarks<
61
- zod.baseObjectOutputType<T>,
62
- {
63
- [k_2 in keyof zod.baseObjectOutputType<T>]: undefined extends zod.baseObjectOutputType<T>[k_2]
64
- ? never
65
- : k_2;
66
- }[keyof T]
67
- >[k_1];
68
- },
69
- {
70
- [k_2 in keyof zod.baseObjectInputType<T>]: zod.baseObjectInputType<T>[k_2];
71
- }
72
- >;
73
- function: typeof zod.ZodFunction.create;
74
- z: typeof zod.z;
75
- setErrorMap: typeof zod.setErrorMap;
76
- getErrorMap: typeof zod.getErrorMap;
77
- defaultErrorMap: zod.ZodErrorMap;
78
- addIssueToContext: typeof zod.addIssueToContext;
79
- makeIssue: (params: {
80
- data: any;
81
- path: (string | number)[];
82
- errorMaps: zod.ZodErrorMap[];
83
- issueData: zod.IssueData;
84
- }) => zod.ZodIssue;
85
- EMPTY_PATH: zod.ParsePath;
86
- ParseStatus: typeof zod.ParseStatus;
87
- INVALID: zod.INVALID;
88
- DIRTY: <T_1>(value: T_1) => zod.DIRTY<T_1>;
89
- OK: <T_2>(value: T_2) => zod.OK<T_2>;
90
- isAborted: (x: zod.ParseReturnType<any>) => x is zod.INVALID;
91
- isDirty: <T_3>(
92
- x: zod.ParseReturnType<T_3>
93
- ) => x is zod.OK<T_3> | zod.DIRTY<T_3>;
94
- isValid: <T_4>(
95
- x: zod.ParseReturnType<T_4>
96
- ) => x is zod.OK<T_4> | zod.DIRTY<T_4>;
97
- isAsync: <T_5>(
98
- x: zod.ParseReturnType<T_5>
99
- ) => x is zod.AsyncParseReturnType<T_5>;
100
- util: typeof zod.util;
101
- objectUtil: typeof zod.objectUtil;
102
- ZodParsedType: {
103
- function: 'function';
104
- number: 'number';
105
- string: 'string';
106
- nan: 'nan';
107
- integer: 'integer';
108
- float: 'float';
109
- boolean: 'boolean';
110
- date: 'date';
111
- bigint: 'bigint';
112
- symbol: 'symbol';
113
- undefined: 'undefined';
114
- null: 'null';
115
- array: 'array';
116
- object: 'object';
117
- unknown: 'unknown';
118
- promise: 'promise';
119
- void: 'void';
120
- never: 'never';
121
- map: 'map';
122
- set: 'set';
123
- };
124
- getParsedType: (
125
- data: any
126
- ) =>
127
- | 'string'
128
- | 'number'
129
- | 'bigint'
130
- | 'boolean'
131
- | 'symbol'
132
- | 'undefined'
133
- | 'object'
134
- | 'function'
135
- | 'array'
136
- | 'date'
137
- | 'map'
138
- | 'nan'
139
- | 'never'
140
- | 'null'
141
- | 'promise'
142
- | 'set'
143
- | 'unknown'
144
- | 'void'
145
- | 'integer'
146
- | 'float';
147
- ZodType: typeof zod.ZodType;
148
- ZodString: typeof zod.ZodString;
149
- ZodNumber: typeof zod.ZodNumber;
150
- ZodBigInt: typeof zod.ZodBigInt;
151
- ZodBoolean: typeof zod.ZodBoolean;
152
- ZodDate: typeof zod.ZodDate;
153
- ZodSymbol: typeof zod.ZodSymbol;
154
- ZodUndefined: typeof zod.ZodUndefined;
155
- ZodNull: typeof zod.ZodNull;
156
- ZodAny: typeof zod.ZodAny;
157
- ZodUnknown: typeof zod.ZodUnknown;
158
- ZodNever: typeof zod.ZodNever;
159
- ZodVoid: typeof zod.ZodVoid;
160
- ZodArray: typeof zod.ZodArray;
161
- ZodObject: typeof zod.ZodObject;
162
- ZodUnion: typeof zod.ZodUnion;
163
- ZodDiscriminatedUnion: typeof zod.ZodDiscriminatedUnion;
164
- ZodIntersection: typeof zod.ZodIntersection;
165
- ZodTuple: typeof zod.ZodTuple;
166
- ZodRecord: typeof zod.ZodRecord;
167
- ZodMap: typeof zod.ZodMap;
168
- ZodSet: typeof zod.ZodSet;
169
- ZodFunction: typeof zod.ZodFunction;
170
- ZodLazy: typeof zod.ZodLazy;
171
- ZodLiteral: typeof zod.ZodLiteral;
172
- ZodEnum: typeof zod.ZodEnum;
173
- ZodNativeEnum: typeof zod.ZodNativeEnum;
174
- ZodPromise: typeof zod.ZodPromise;
175
- ZodEffects: typeof zod.ZodEffects;
176
- ZodTransformer: typeof zod.ZodEffects;
177
- ZodOptional: typeof zod.ZodOptional;
178
- ZodNullable: typeof zod.ZodNullable;
179
- ZodDefault: typeof zod.ZodDefault;
180
- ZodCatch: typeof zod.ZodCatch;
181
- ZodNaN: typeof zod.ZodNaN;
182
- BRAND: typeof zod.BRAND;
183
- ZodBranded: typeof zod.ZodBranded;
184
- ZodPipeline: typeof zod.ZodPipeline;
185
- ZodReadonly: typeof zod.ZodReadonly;
186
- custom: <T_6>(
187
- check?: ((data: unknown) => any) | undefined,
188
- params?:
189
- | string
190
- | (Partial<zod.util.Omit<zod.ZodCustomIssue, 'code'>> & {
191
- fatal?: boolean | undefined;
192
- })
193
- | ((input: any) => Partial<zod.util.Omit<zod.ZodCustomIssue, 'code'>> & {
194
- fatal?: boolean | undefined;
195
- })
196
- | undefined,
197
- fatal?: boolean | undefined
198
- ) => zod.ZodType<T_6, zod.ZodTypeDef, T_6>;
199
- Schema: typeof zod.ZodType;
200
- ZodSchema: typeof zod.ZodType;
201
- late: {
202
- object: <T_7 extends zod.ZodRawShape>(
203
- shape: () => T_7,
204
- params?: zod.RawCreateParams
205
- ) => zod.ZodObject<
206
- T_7,
207
- 'strip',
208
- zod.ZodTypeAny,
209
- {
210
- [k_1_1 in keyof zod.objectUtil.addQuestionMarks<
211
- zod.baseObjectOutputType<T_7>,
212
- {
213
- [k_3 in keyof zod.baseObjectOutputType<T_7>]: undefined extends zod.baseObjectOutputType<T_7>[k_3]
214
- ? never
215
- : k_3;
216
- }[keyof T_7]
217
- >]: zod.objectUtil.addQuestionMarks<
218
- zod.baseObjectOutputType<T_7>,
219
- {
220
- [k_4 in keyof zod.baseObjectOutputType<T_7>]: undefined extends zod.baseObjectOutputType<T_7>[k_4]
221
- ? never
222
- : k_4;
223
- }[keyof T_7]
224
- >[k_1_1];
225
- },
226
- {
227
- [k_2_1 in keyof zod.baseObjectInputType<T_7>]: zod.baseObjectInputType<T_7>[k_2_1];
228
- }
229
- >;
230
- };
231
- ZodFirstPartyTypeKind: typeof zod.ZodFirstPartyTypeKind;
232
- coerce: {
233
- string: (
234
- params?:
235
- | ({
3
+ bigint: () => zod.ZodPipeline<zod.ZodUnion<[zod.ZodNumber, zod.ZodBigInt]>, zod.ZodBigInt>;
4
+ string: (params?: ({
5
+ errorMap?: zod.ZodErrorMap | undefined;
6
+ invalid_type_error?: string | undefined;
7
+ required_error?: string | undefined;
8
+ description?: string | undefined;
9
+ } & {
10
+ coerce?: true | undefined;
11
+ }) | undefined) => zod.ZodString;
12
+ number: (params?: ({
13
+ errorMap?: zod.ZodErrorMap | undefined;
14
+ invalid_type_error?: string | undefined;
15
+ required_error?: string | undefined;
16
+ description?: string | undefined;
17
+ } & {
18
+ coerce?: boolean | undefined;
19
+ }) | undefined) => zod.ZodNumber;
20
+ boolean: (params?: ({
21
+ errorMap?: zod.ZodErrorMap | undefined;
22
+ invalid_type_error?: string | undefined;
23
+ required_error?: string | undefined;
24
+ description?: string | undefined;
25
+ } & {
26
+ coerce?: boolean | undefined;
27
+ }) | undefined) => zod.ZodBoolean;
28
+ symbol: (params?: zod.RawCreateParams) => zod.ZodSymbol;
29
+ undefined: (params?: zod.RawCreateParams) => zod.ZodUndefined;
30
+ object: <T extends zod.ZodRawShape>(shape: T, params?: zod.RawCreateParams) => zod.ZodObject<T, "strip", zod.ZodTypeAny, { [k_1 in keyof zod.objectUtil.addQuestionMarks<zod.baseObjectOutputType<T>, { [k in keyof zod.baseObjectOutputType<T>]: undefined extends zod.baseObjectOutputType<T>[k] ? never : k; }[keyof T]>]: zod.objectUtil.addQuestionMarks<zod.baseObjectOutputType<T>, { [k in keyof zod.baseObjectOutputType<T>]: undefined extends zod.baseObjectOutputType<T>[k] ? never : k; }[keyof T]>[k_1]; }, { [k_2 in keyof zod.baseObjectInputType<T>]: zod.baseObjectInputType<T>[k_2]; }>;
31
+ function: typeof zod.ZodFunction.create;
32
+ z: typeof zod.z;
33
+ setErrorMap: typeof zod.setErrorMap;
34
+ getErrorMap: typeof zod.getErrorMap;
35
+ defaultErrorMap: zod.ZodErrorMap;
36
+ addIssueToContext: typeof zod.addIssueToContext;
37
+ makeIssue: (params: {
38
+ data: any;
39
+ path: (string | number)[];
40
+ errorMaps: zod.ZodErrorMap[];
41
+ issueData: zod.IssueData;
42
+ }) => zod.ZodIssue;
43
+ EMPTY_PATH: zod.ParsePath;
44
+ ParseStatus: typeof zod.ParseStatus;
45
+ INVALID: zod.INVALID;
46
+ DIRTY: <T>(value: T) => zod.DIRTY<T>;
47
+ OK: <T>(value: T) => zod.OK<T>;
48
+ isAborted: (x: zod.ParseReturnType<any>) => x is zod.INVALID;
49
+ isDirty: <T>(x: zod.ParseReturnType<T>) => x is zod.OK<T> | zod.DIRTY<T>;
50
+ isValid: <T>(x: zod.ParseReturnType<T>) => x is zod.OK<T> | zod.DIRTY<T>;
51
+ isAsync: <T>(x: zod.ParseReturnType<T>) => x is zod.AsyncParseReturnType<T>;
52
+ util: typeof zod.util;
53
+ objectUtil: typeof zod.objectUtil;
54
+ ZodParsedType: {
55
+ function: "function";
56
+ number: "number";
57
+ string: "string";
58
+ nan: "nan";
59
+ integer: "integer";
60
+ float: "float";
61
+ boolean: "boolean";
62
+ date: "date";
63
+ bigint: "bigint";
64
+ symbol: "symbol";
65
+ undefined: "undefined";
66
+ null: "null";
67
+ array: "array";
68
+ object: "object";
69
+ unknown: "unknown";
70
+ promise: "promise";
71
+ void: "void";
72
+ never: "never";
73
+ map: "map";
74
+ set: "set";
75
+ };
76
+ getParsedType: (data: any) => zod.ZodParsedType;
77
+ ZodType: typeof zod.ZodType;
78
+ ZodString: typeof zod.ZodString;
79
+ ZodNumber: typeof zod.ZodNumber;
80
+ ZodBigInt: typeof zod.ZodBigInt;
81
+ ZodBoolean: typeof zod.ZodBoolean;
82
+ ZodDate: typeof zod.ZodDate;
83
+ ZodSymbol: typeof zod.ZodSymbol;
84
+ ZodUndefined: typeof zod.ZodUndefined;
85
+ ZodNull: typeof zod.ZodNull;
86
+ ZodAny: typeof zod.ZodAny;
87
+ ZodUnknown: typeof zod.ZodUnknown;
88
+ ZodNever: typeof zod.ZodNever;
89
+ ZodVoid: typeof zod.ZodVoid;
90
+ ZodArray: typeof zod.ZodArray;
91
+ ZodObject: typeof zod.ZodObject;
92
+ ZodUnion: typeof zod.ZodUnion;
93
+ ZodDiscriminatedUnion: typeof zod.ZodDiscriminatedUnion;
94
+ ZodIntersection: typeof zod.ZodIntersection;
95
+ ZodTuple: typeof zod.ZodTuple;
96
+ ZodRecord: typeof zod.ZodRecord;
97
+ ZodMap: typeof zod.ZodMap;
98
+ ZodSet: typeof zod.ZodSet;
99
+ ZodFunction: typeof zod.ZodFunction;
100
+ ZodLazy: typeof zod.ZodLazy;
101
+ ZodLiteral: typeof zod.ZodLiteral;
102
+ ZodEnum: typeof zod.ZodEnum;
103
+ ZodNativeEnum: typeof zod.ZodNativeEnum;
104
+ ZodPromise: typeof zod.ZodPromise;
105
+ ZodEffects: typeof zod.ZodEffects;
106
+ ZodTransformer: typeof zod.ZodEffects;
107
+ ZodOptional: typeof zod.ZodOptional;
108
+ ZodNullable: typeof zod.ZodNullable;
109
+ ZodDefault: typeof zod.ZodDefault;
110
+ ZodCatch: typeof zod.ZodCatch;
111
+ ZodNaN: typeof zod.ZodNaN;
112
+ BRAND: typeof zod.BRAND;
113
+ ZodBranded: typeof zod.ZodBranded;
114
+ ZodPipeline: typeof zod.ZodPipeline;
115
+ ZodReadonly: typeof zod.ZodReadonly;
116
+ custom: <T>(check?: ((data: unknown) => any) | undefined, params?: string | (Partial<zod.util.Omit<zod.ZodCustomIssue, "code">> & {
117
+ fatal?: boolean;
118
+ }) | ((input: any) => Partial<zod.util.Omit<zod.ZodCustomIssue, "code">> & {
119
+ fatal?: boolean;
120
+ }), fatal?: boolean | undefined) => zod.ZodType<T, zod.ZodTypeDef, T>;
121
+ Schema: typeof zod.ZodType;
122
+ ZodSchema: typeof zod.ZodType;
123
+ late: {
124
+ object: <T extends zod.ZodRawShape>(shape: () => T, params?: zod.RawCreateParams) => zod.ZodObject<T, "strip", zod.ZodTypeAny, { [k_1 in keyof zod.objectUtil.addQuestionMarks<zod.baseObjectOutputType<T>, { [k in keyof zod.baseObjectOutputType<T>]: undefined extends zod.baseObjectOutputType<T>[k] ? never : k; }[keyof T]>]: zod.objectUtil.addQuestionMarks<zod.baseObjectOutputType<T>, { [k in keyof zod.baseObjectOutputType<T>]: undefined extends zod.baseObjectOutputType<T>[k] ? never : k; }[keyof T]>[k_1]; }, { [k_2 in keyof zod.baseObjectInputType<T>]: zod.baseObjectInputType<T>[k_2]; }>;
125
+ };
126
+ ZodFirstPartyTypeKind: typeof zod.ZodFirstPartyTypeKind;
127
+ coerce: {
128
+ string: (params?: ({
236
129
  errorMap?: zod.ZodErrorMap | undefined;
237
130
  invalid_type_error?: string | undefined;
238
131
  required_error?: string | undefined;
239
132
  description?: string | undefined;
240
- } & {
133
+ } & {
241
134
  coerce?: true | undefined;
242
- })
243
- | undefined
244
- ) => zod.ZodString;
245
- number: (
246
- params?:
247
- | ({
135
+ }) | undefined) => zod.ZodString;
136
+ number: (params?: ({
248
137
  errorMap?: zod.ZodErrorMap | undefined;
249
138
  invalid_type_error?: string | undefined;
250
139
  required_error?: string | undefined;
251
140
  description?: string | undefined;
252
- } & {
141
+ } & {
253
142
  coerce?: boolean | undefined;
254
- })
255
- | undefined
256
- ) => zod.ZodNumber;
257
- boolean: (
258
- params?:
259
- | ({
143
+ }) | undefined) => zod.ZodNumber;
144
+ boolean: (params?: ({
260
145
  errorMap?: zod.ZodErrorMap | undefined;
261
146
  invalid_type_error?: string | undefined;
262
147
  required_error?: string | undefined;
263
148
  description?: string | undefined;
264
- } & {
149
+ } & {
265
150
  coerce?: boolean | undefined;
266
- })
267
- | undefined
268
- ) => zod.ZodBoolean;
269
- bigint: (
270
- params?:
271
- | ({
151
+ }) | undefined) => zod.ZodBoolean;
152
+ bigint: (params?: ({
272
153
  errorMap?: zod.ZodErrorMap | undefined;
273
154
  invalid_type_error?: string | undefined;
274
155
  required_error?: string | undefined;
275
156
  description?: string | undefined;
276
- } & {
157
+ } & {
277
158
  coerce?: boolean | undefined;
278
- })
279
- | undefined
280
- ) => zod.ZodBigInt;
281
- date: (
282
- params?:
283
- | ({
159
+ }) | undefined) => zod.ZodBigInt;
160
+ date: (params?: ({
284
161
  errorMap?: zod.ZodErrorMap | undefined;
285
162
  invalid_type_error?: string | undefined;
286
163
  required_error?: string | undefined;
287
164
  description?: string | undefined;
288
- } & {
289
- coerce?: boolean | undefined;
290
- })
291
- | undefined
292
- ) => zod.ZodDate;
293
- };
294
- any: (params?: zod.RawCreateParams) => zod.ZodAny;
295
- array: <T_8 extends zod.ZodTypeAny>(
296
- schema: T_8,
297
- params?: zod.RawCreateParams
298
- ) => zod.ZodArray<T_8, 'many'>;
299
- date: (
300
- params?:
301
- | ({
302
- errorMap?: zod.ZodErrorMap | undefined;
303
- invalid_type_error?: string | undefined;
304
- required_error?: string | undefined;
305
- description?: string | undefined;
306
165
  } & {
307
- coerce?: boolean | undefined;
308
- })
309
- | undefined
310
- ) => zod.ZodDate;
311
- discriminatedUnion: typeof zod.ZodDiscriminatedUnion.create;
312
- effect: <I extends zod.ZodTypeAny>(
313
- schema: I,
314
- effect: zod.Effect<I['_output']>,
315
- params?: zod.RawCreateParams
316
- ) => zod.ZodEffects<I, I['_output'], zod.input<I>>;
317
- enum: {
318
- <U extends string, T_9 extends readonly [U, ...U[]]>(
319
- values: T_9,
320
- params?: zod.RawCreateParams
321
- ): zod.ZodEnum<zod.Writeable<T_9>>;
322
- <U_1 extends string, T_10 extends [U_1, ...U_1[]]>(
323
- values: T_10,
324
- params?: zod.RawCreateParams
325
- ): zod.ZodEnum<T_10>;
326
- };
327
- instanceof: <T_11 extends abstract new (..._: any[]) => {}>(
328
- cls: T_11,
329
- params?:
330
- | (Partial<zod.util.Omit<zod.ZodCustomIssue, 'code'>> & {
331
- fatal?: boolean | undefined;
332
- })
333
- | undefined
334
- ) => zod.ZodType<InstanceType<T_11>, zod.ZodTypeDef, InstanceType<T_11>>;
335
- intersection: <T_12 extends zod.ZodTypeAny, U_2 extends zod.ZodTypeAny>(
336
- left: T_12,
337
- right: U_2,
338
- params?: zod.RawCreateParams
339
- ) => zod.ZodIntersection<T_12, U_2>;
340
- lazy: <T_13 extends zod.ZodTypeAny>(
341
- getter: () => T_13,
342
- params?: zod.RawCreateParams
343
- ) => zod.ZodLazy<T_13>;
344
- literal: <T_14 extends zod.Primitive>(
345
- value: T_14,
346
- params?: zod.RawCreateParams
347
- ) => zod.ZodLiteral<T_14>;
348
- map: <
349
- Key extends zod.ZodTypeAny = zod.ZodTypeAny,
350
- Value extends zod.ZodTypeAny = zod.ZodTypeAny
351
- >(
352
- keyType: Key,
353
- valueType: Value,
354
- params?: zod.RawCreateParams
355
- ) => zod.ZodMap<Key, Value>;
356
- nan: (params?: zod.RawCreateParams) => zod.ZodNaN;
357
- nativeEnum: <T_15 extends zod.EnumLike>(
358
- values: T_15,
359
- params?: zod.RawCreateParams
360
- ) => zod.ZodNativeEnum<T_15>;
361
- never: (params?: zod.RawCreateParams) => zod.ZodNever;
362
- null: (params?: zod.RawCreateParams) => zod.ZodNull;
363
- nullable: <T_16 extends zod.ZodTypeAny>(
364
- type: T_16,
365
- params?: zod.RawCreateParams
366
- ) => zod.ZodNullable<T_16>;
367
- oboolean: () => zod.ZodOptional<zod.ZodBoolean>;
368
- onumber: () => zod.ZodOptional<zod.ZodNumber>;
369
- optional: <T_17 extends zod.ZodTypeAny>(
370
- type: T_17,
371
- params?: zod.RawCreateParams
372
- ) => zod.ZodOptional<T_17>;
373
- ostring: () => zod.ZodOptional<zod.ZodString>;
374
- pipeline: typeof zod.ZodPipeline.create;
375
- preprocess: <I_1 extends zod.ZodTypeAny>(
376
- preprocess: (arg: unknown, ctx: zod.RefinementCtx) => unknown,
377
- schema: I_1,
378
- params?: zod.RawCreateParams
379
- ) => zod.ZodEffects<I_1, I_1['_output'], unknown>;
380
- promise: <T_18 extends zod.ZodTypeAny>(
381
- schema: T_18,
382
- params?: zod.RawCreateParams
383
- ) => zod.ZodPromise<T_18>;
384
- record: typeof zod.ZodRecord.create;
385
- set: <Value_1 extends zod.ZodTypeAny = zod.ZodTypeAny>(
386
- valueType: Value_1,
387
- params?: zod.RawCreateParams
388
- ) => zod.ZodSet<Value_1>;
389
- strictObject: <T_19 extends zod.ZodRawShape>(
390
- shape: T_19,
391
- params?: zod.RawCreateParams
392
- ) => zod.ZodObject<
393
- T_19,
394
- 'strict',
395
- zod.ZodTypeAny,
396
- {
397
- [k_1_2 in keyof zod.objectUtil.addQuestionMarks<
398
- zod.baseObjectOutputType<T_19>,
399
- {
400
- [k_5 in keyof zod.baseObjectOutputType<T_19>]: undefined extends zod.baseObjectOutputType<T_19>[k_5]
401
- ? never
402
- : k_5;
403
- }[keyof T_19]
404
- >]: zod.objectUtil.addQuestionMarks<
405
- zod.baseObjectOutputType<T_19>,
406
- {
407
- [k_6 in keyof zod.baseObjectOutputType<T_19>]: undefined extends zod.baseObjectOutputType<T_19>[k_6]
408
- ? never
409
- : k_6;
410
- }[keyof T_19]
411
- >[k_1_2];
412
- },
413
- {
414
- [k_2_2 in keyof zod.baseObjectInputType<T_19>]: zod.baseObjectInputType<T_19>[k_2_2];
415
- }
416
- >;
417
- transformer: <I extends zod.ZodTypeAny>(
418
- schema: I,
419
- effect: zod.Effect<I['_output']>,
420
- params?: zod.RawCreateParams
421
- ) => zod.ZodEffects<I, I['_output'], zod.input<I>>;
422
- tuple: <T_20 extends [] | [zod.ZodTypeAny, ...zod.ZodTypeAny[]]>(
423
- schemas: T_20,
424
- params?: zod.RawCreateParams
425
- ) => zod.ZodTuple<T_20, null>;
426
- union: <
427
- T_21 extends readonly [zod.ZodTypeAny, zod.ZodTypeAny, ...zod.ZodTypeAny[]]
428
- >(
429
- types: T_21,
430
- params?: zod.RawCreateParams
431
- ) => zod.ZodUnion<T_21>;
432
- unknown: (params?: zod.RawCreateParams) => zod.ZodUnknown;
433
- void: (params?: zod.RawCreateParams) => zod.ZodVoid;
434
- NEVER: never;
435
- ZodIssueCode: {
436
- invalid_type: 'invalid_type';
437
- invalid_literal: 'invalid_literal';
438
- custom: 'custom';
439
- invalid_union: 'invalid_union';
440
- invalid_union_discriminator: 'invalid_union_discriminator';
441
- invalid_enum_value: 'invalid_enum_value';
442
- unrecognized_keys: 'unrecognized_keys';
443
- invalid_arguments: 'invalid_arguments';
444
- invalid_return_type: 'invalid_return_type';
445
- invalid_date: 'invalid_date';
446
- invalid_string: 'invalid_string';
447
- too_small: 'too_small';
448
- too_big: 'too_big';
449
- invalid_intersection_types: 'invalid_intersection_types';
450
- not_multiple_of: 'not_multiple_of';
451
- not_finite: 'not_finite';
452
- };
453
- quotelessJson: (obj: any) => string;
454
- ZodError: typeof zod.ZodError;
166
+ coerce?: boolean | undefined;
167
+ }) | undefined) => zod.ZodDate;
168
+ };
169
+ any: (params?: zod.RawCreateParams) => zod.ZodAny;
170
+ array: <T extends zod.ZodTypeAny>(schema: T, params?: zod.RawCreateParams) => zod.ZodArray<T, "many">;
171
+ date: (params?: ({
172
+ errorMap?: zod.ZodErrorMap | undefined;
173
+ invalid_type_error?: string | undefined;
174
+ required_error?: string | undefined;
175
+ description?: string | undefined;
176
+ } & {
177
+ coerce?: boolean | undefined;
178
+ }) | undefined) => zod.ZodDate;
179
+ discriminatedUnion: typeof zod.ZodDiscriminatedUnion.create;
180
+ effect: <I extends zod.ZodTypeAny>(schema: I, effect: zod.Effect<I["_output"]>, params?: zod.RawCreateParams) => zod.ZodEffects<I, I["_output"], zod.input<I>>;
181
+ enum: {
182
+ <U extends string, T extends Readonly<[U, ...U[]]>>(values: T, params?: zod.RawCreateParams): zod.ZodEnum<zod.Writeable<T>>;
183
+ <U extends string, T extends [U, ...U[]]>(values: T, params?: zod.RawCreateParams): zod.ZodEnum<T>;
184
+ };
185
+ instanceof: <T extends abstract new (..._: any[]) => {}>(cls: T, params?: Partial<zod.util.Omit<zod.ZodCustomIssue, "code">> & {
186
+ fatal?: boolean;
187
+ }) => zod.ZodType<InstanceType<T>, zod.ZodTypeDef, InstanceType<T>>;
188
+ intersection: <T extends zod.ZodTypeAny, U extends zod.ZodTypeAny>(left: T, right: U, params?: zod.RawCreateParams) => zod.ZodIntersection<T, U>;
189
+ lazy: <T extends zod.ZodTypeAny>(getter: () => T, params?: zod.RawCreateParams) => zod.ZodLazy<T>;
190
+ literal: <T extends zod.Primitive>(value: T, params?: zod.RawCreateParams) => zod.ZodLiteral<T>;
191
+ map: <Key extends zod.ZodTypeAny = zod.ZodTypeAny, Value extends zod.ZodTypeAny = zod.ZodTypeAny>(keyType: Key, valueType: Value, params?: zod.RawCreateParams) => zod.ZodMap<Key, Value>;
192
+ nan: (params?: zod.RawCreateParams) => zod.ZodNaN;
193
+ nativeEnum: <T extends zod.EnumLike>(values: T, params?: zod.RawCreateParams) => zod.ZodNativeEnum<T>;
194
+ never: (params?: zod.RawCreateParams) => zod.ZodNever;
195
+ null: (params?: zod.RawCreateParams) => zod.ZodNull;
196
+ nullable: <T extends zod.ZodTypeAny>(type: T, params?: zod.RawCreateParams) => zod.ZodNullable<T>;
197
+ oboolean: () => zod.ZodOptional<zod.ZodBoolean>;
198
+ onumber: () => zod.ZodOptional<zod.ZodNumber>;
199
+ optional: <T extends zod.ZodTypeAny>(type: T, params?: zod.RawCreateParams) => zod.ZodOptional<T>;
200
+ ostring: () => zod.ZodOptional<zod.ZodString>;
201
+ pipeline: typeof zod.ZodPipeline.create;
202
+ preprocess: <I extends zod.ZodTypeAny>(preprocess: (arg: unknown, ctx: zod.RefinementCtx) => unknown, schema: I, params?: zod.RawCreateParams) => zod.ZodEffects<I, I["_output"], unknown>;
203
+ promise: <T extends zod.ZodTypeAny>(schema: T, params?: zod.RawCreateParams) => zod.ZodPromise<T>;
204
+ record: typeof zod.ZodRecord.create;
205
+ set: <Value extends zod.ZodTypeAny = zod.ZodTypeAny>(valueType: Value, params?: zod.RawCreateParams) => zod.ZodSet<Value>;
206
+ strictObject: <T extends zod.ZodRawShape>(shape: T, params?: zod.RawCreateParams) => zod.ZodObject<T, "strict", zod.ZodTypeAny, { [k_1 in keyof zod.objectUtil.addQuestionMarks<zod.baseObjectOutputType<T>, { [k in keyof zod.baseObjectOutputType<T>]: undefined extends zod.baseObjectOutputType<T>[k] ? never : k; }[keyof T]>]: zod.objectUtil.addQuestionMarks<zod.baseObjectOutputType<T>, { [k in keyof zod.baseObjectOutputType<T>]: undefined extends zod.baseObjectOutputType<T>[k] ? never : k; }[keyof T]>[k_1]; }, { [k_2 in keyof zod.baseObjectInputType<T>]: zod.baseObjectInputType<T>[k_2]; }>;
207
+ transformer: <I extends zod.ZodTypeAny>(schema: I, effect: zod.Effect<I["_output"]>, params?: zod.RawCreateParams) => zod.ZodEffects<I, I["_output"], zod.input<I>>;
208
+ tuple: <T extends [] | [zod.ZodTypeAny, ...zod.ZodTypeAny[]]>(schemas: T, params?: zod.RawCreateParams) => zod.ZodTuple<T, null>;
209
+ union: <T extends readonly [zod.ZodTypeAny, zod.ZodTypeAny, ...zod.ZodTypeAny[]]>(types: T, params?: zod.RawCreateParams) => zod.ZodUnion<T>;
210
+ unknown: (params?: zod.RawCreateParams) => zod.ZodUnknown;
211
+ void: (params?: zod.RawCreateParams) => zod.ZodVoid;
212
+ NEVER: never;
213
+ ZodIssueCode: {
214
+ invalid_type: "invalid_type";
215
+ invalid_literal: "invalid_literal";
216
+ custom: "custom";
217
+ invalid_union: "invalid_union";
218
+ invalid_union_discriminator: "invalid_union_discriminator";
219
+ invalid_enum_value: "invalid_enum_value";
220
+ unrecognized_keys: "unrecognized_keys";
221
+ invalid_arguments: "invalid_arguments";
222
+ invalid_return_type: "invalid_return_type";
223
+ invalid_date: "invalid_date";
224
+ invalid_string: "invalid_string";
225
+ too_small: "too_small";
226
+ too_big: "too_big";
227
+ invalid_intersection_types: "invalid_intersection_types";
228
+ not_multiple_of: "not_multiple_of";
229
+ not_finite: "not_finite";
230
+ };
231
+ quotelessJson: (obj: any) => string;
232
+ ZodError: typeof zod.ZodError;
455
233
  };
456
- //# sourceMappingURL=dataTypes.d.ts.map
234
+ //# sourceMappingURL=dataTypes.d.ts.map