cogsbox-shape 0.5.56 → 0.5.57

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/schema.d.ts CHANGED
@@ -54,4599 +54,22 @@ type SQLToZodType<T extends SQLType, TDefault extends boolean> = T["pk"] extends
54
54
  } ? TDefault extends true ? never : z.ZodNullable<z.ZodDate> : z.ZodNullable<z.ZodDate> : never : T["type"] extends "varchar" | "char" | "text" | "longtext" ? z.ZodString : T["type"] extends "int" ? z.ZodNumber : T["type"] extends "boolean" ? z.ZodBoolean : T["type"] extends "date" | "datetime" ? T extends {
55
55
  default: "CURRENT_TIMESTAMP";
56
56
  } ? TDefault extends true ? never : z.ZodDate : z.ZodDate : never;
57
- export declare const shape: {
58
- int: (config?: IntConfig) => {
59
- config: {
60
- sql: {
61
- nullable?: boolean;
62
- pk?: true;
63
- field?: string;
64
- default?: number;
65
- type: "int";
66
- };
67
- zodSqlSchema: z.ZodNumber;
68
- zodNewSchema: z.ZodNumber;
69
- initialValue: number;
70
- zodClientSchema: z.ZodNumber;
71
- zodValidationSchema: z.ZodNumber;
72
- };
73
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
74
- sql: z.ZodNumber;
75
- initialState: z.ZodNumber;
76
- client: z.ZodNumber;
77
- }) => TValidationNext)) => {
78
- config: {
79
- sql: {
80
- nullable?: boolean;
81
- pk?: true;
82
- field?: string;
83
- default?: number;
84
- type: "int";
85
- };
86
- zodSqlSchema: z.ZodNumber;
87
- zodNewSchema: z.ZodNumber;
88
- initialValue: number;
89
- zodClientSchema: z.ZodNumber;
90
- zodValidationSchema: TValidationNext;
91
- };
92
- transform: (transforms: {
93
- toClient: (dbValue: number) => number;
94
- toDb: (clientValue: number) => number;
95
- }) => {
96
- config: {
97
- sql: {
98
- nullable?: boolean;
99
- pk?: true;
100
- field?: string;
101
- default?: number;
102
- type: "int";
103
- };
104
- zodSqlSchema: z.ZodNumber;
105
- zodNewSchema: z.ZodNumber;
106
- initialValue: number;
107
- zodClientSchema: z.ZodNumber;
108
- zodValidationSchema: TValidationNext;
109
- } & {
110
- transforms: {
111
- toClient: (dbValue: number) => number;
112
- toDb: (clientValue: number) => number;
113
- };
114
- };
115
- };
116
- };
117
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
118
- sql: z.ZodNumber;
119
- initialState: z.ZodNumber;
120
- }) => TClientNext)) => {
121
- config: {
122
- sql: {
123
- nullable?: boolean;
124
- pk?: true;
125
- field?: string;
126
- default?: number;
127
- type: "int";
128
- };
129
- zodSqlSchema: z.ZodNumber;
130
- zodNewSchema: z.ZodNumber;
131
- initialValue: number;
132
- zodClientSchema: TClientNext;
133
- zodValidationSchema: TClientNext;
134
- };
135
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
136
- sql: z.ZodNumber;
137
- initialState: z.ZodNumber;
138
- client: TClientNext;
139
- }) => TValidationNext)) => {
140
- config: {
141
- sql: {
142
- nullable?: boolean;
143
- pk?: true;
144
- field?: string;
145
- default?: number;
146
- type: "int";
147
- };
148
- zodSqlSchema: z.ZodNumber;
149
- zodNewSchema: z.ZodNumber;
150
- initialValue: number;
151
- zodClientSchema: TClientNext;
152
- zodValidationSchema: TValidationNext;
153
- };
154
- transform: (transforms: {
155
- toClient: (dbValue: number) => z.TypeOf<TClientNext>;
156
- toDb: (clientValue: z.TypeOf<TClientNext>) => number;
157
- }) => {
158
- config: {
159
- sql: {
160
- nullable?: boolean;
161
- pk?: true;
162
- field?: string;
163
- default?: number;
164
- type: "int";
165
- };
166
- zodSqlSchema: z.ZodNumber;
167
- zodNewSchema: z.ZodNumber;
168
- initialValue: number;
169
- zodClientSchema: TClientNext;
170
- zodValidationSchema: TValidationNext;
171
- } & {
172
- transforms: {
173
- toClient: (dbValue: number) => z.TypeOf<TClientNext>;
174
- toDb: (clientValue: z.TypeOf<TClientNext>) => number;
175
- };
176
- };
177
- };
178
- };
179
- transform: (transforms: {
180
- toClient: (dbValue: number) => z.TypeOf<TClientNext>;
181
- toDb: (clientValue: z.TypeOf<TClientNext>) => number;
182
- }) => {
183
- config: {
184
- sql: {
185
- nullable?: boolean;
186
- pk?: true;
187
- field?: string;
188
- default?: number;
189
- type: "int";
190
- };
191
- zodSqlSchema: z.ZodNumber;
192
- zodNewSchema: z.ZodNumber;
193
- initialValue: number;
194
- zodClientSchema: TClientNext;
195
- zodValidationSchema: TClientNext;
196
- } & {
197
- transforms: {
198
- toClient: (dbValue: number) => z.TypeOf<TClientNext>;
199
- toDb: (clientValue: z.TypeOf<TClientNext>) => number;
200
- };
201
- };
202
- };
203
- };
204
- transform: (transforms: {
205
- toClient: (dbValue: number) => number;
206
- toDb: (clientValue: number) => number;
207
- }) => {
208
- config: {
209
- sql: {
210
- nullable?: boolean;
211
- pk?: true;
212
- field?: string;
213
- default?: number;
214
- type: "int";
215
- };
216
- zodSqlSchema: z.ZodNumber;
217
- zodNewSchema: z.ZodNumber;
218
- initialValue: number;
219
- zodClientSchema: z.ZodNumber;
220
- zodValidationSchema: z.ZodNumber;
221
- } & {
222
- transforms: {
223
- toClient: (dbValue: number) => number;
224
- toDb: (clientValue: number) => number;
225
- };
226
- };
227
- };
228
- initialState: {
229
- <TDefaultNext>(defaultValue: () => TDefaultNext): {
230
- config: {
231
- sql: {
232
- nullable?: boolean;
233
- pk?: true;
234
- field?: string;
235
- default?: number;
236
- type: "int";
237
- };
238
- zodSqlSchema: z.ZodNumber;
239
- zodNewSchema: z.ZodNumber;
240
- initialValue: TDefaultNext;
241
- zodClientSchema: z.ZodNumber;
242
- zodValidationSchema: z.ZodNumber;
243
- };
244
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
245
- sql: z.ZodNumber;
246
- initialState: z.ZodNumber;
247
- client: z.ZodNumber;
248
- }) => TValidationNext)) => {
249
- config: {
250
- sql: {
251
- nullable?: boolean;
252
- pk?: true;
253
- field?: string;
254
- default?: number;
255
- type: "int";
256
- };
257
- zodSqlSchema: z.ZodNumber;
258
- zodNewSchema: z.ZodNumber;
259
- initialValue: TDefaultNext;
260
- zodClientSchema: z.ZodNumber;
261
- zodValidationSchema: TValidationNext;
262
- };
263
- transform: (transforms: {
264
- toClient: (dbValue: number) => number;
265
- toDb: (clientValue: number) => number;
266
- }) => {
267
- config: {
268
- sql: {
269
- nullable?: boolean;
270
- pk?: true;
271
- field?: string;
272
- default?: number;
273
- type: "int";
274
- };
275
- zodSqlSchema: z.ZodNumber;
276
- zodNewSchema: z.ZodNumber;
277
- initialValue: TDefaultNext;
278
- zodClientSchema: z.ZodNumber;
279
- zodValidationSchema: TValidationNext;
280
- } & {
281
- transforms: {
282
- toClient: (dbValue: number) => number;
283
- toDb: (clientValue: number) => number;
284
- };
285
- };
286
- };
287
- };
288
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
289
- sql: z.ZodNumber;
290
- initialState: z.ZodNumber;
291
- }) => TClientNext)) => {
292
- config: {
293
- sql: {
294
- nullable?: boolean;
295
- pk?: true;
296
- field?: string;
297
- default?: number;
298
- type: "int";
299
- };
300
- zodSqlSchema: z.ZodNumber;
301
- zodNewSchema: z.ZodNumber;
302
- initialValue: TDefaultNext;
303
- zodClientSchema: TClientNext;
304
- zodValidationSchema: TClientNext;
305
- };
306
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
307
- sql: z.ZodNumber;
308
- initialState: z.ZodNumber;
309
- client: TClientNext;
310
- }) => TValidationNext)) => {
311
- config: {
312
- sql: {
313
- nullable?: boolean;
314
- pk?: true;
315
- field?: string;
316
- default?: number;
317
- type: "int";
318
- };
319
- zodSqlSchema: z.ZodNumber;
320
- zodNewSchema: z.ZodNumber;
321
- initialValue: TDefaultNext;
322
- zodClientSchema: TClientNext;
323
- zodValidationSchema: TValidationNext;
324
- };
325
- transform: (transforms: {
326
- toClient: (dbValue: number) => z.TypeOf<TClientNext>;
327
- toDb: (clientValue: z.TypeOf<TClientNext>) => number;
328
- }) => {
329
- config: {
330
- sql: {
331
- nullable?: boolean;
332
- pk?: true;
333
- field?: string;
334
- default?: number;
335
- type: "int";
336
- };
337
- zodSqlSchema: z.ZodNumber;
338
- zodNewSchema: z.ZodNumber;
339
- initialValue: TDefaultNext;
340
- zodClientSchema: TClientNext;
341
- zodValidationSchema: TValidationNext;
342
- } & {
343
- transforms: {
344
- toClient: (dbValue: number) => z.TypeOf<TClientNext>;
345
- toDb: (clientValue: z.TypeOf<TClientNext>) => number;
346
- };
347
- };
348
- };
349
- };
350
- transform: (transforms: {
351
- toClient: (dbValue: number) => z.TypeOf<TClientNext>;
352
- toDb: (clientValue: z.TypeOf<TClientNext>) => number;
353
- }) => {
354
- config: {
355
- sql: {
356
- nullable?: boolean;
357
- pk?: true;
358
- field?: string;
359
- default?: number;
360
- type: "int";
361
- };
362
- zodSqlSchema: z.ZodNumber;
363
- zodNewSchema: z.ZodNumber;
364
- initialValue: TDefaultNext;
365
- zodClientSchema: TClientNext;
366
- zodValidationSchema: TClientNext;
367
- } & {
368
- transforms: {
369
- toClient: (dbValue: number) => z.TypeOf<TClientNext>;
370
- toDb: (clientValue: z.TypeOf<TClientNext>) => number;
371
- };
372
- };
373
- };
374
- };
375
- transform: (transforms: {
376
- toClient: (dbValue: number) => number;
377
- toDb: (clientValue: number) => number;
378
- }) => {
379
- config: {
380
- sql: {
381
- nullable?: boolean;
382
- pk?: true;
383
- field?: string;
384
- default?: number;
385
- type: "int";
386
- };
387
- zodSqlSchema: z.ZodNumber;
388
- zodNewSchema: z.ZodNumber;
389
- initialValue: TDefaultNext;
390
- zodClientSchema: z.ZodNumber;
391
- zodValidationSchema: z.ZodNumber;
392
- } & {
393
- transforms: {
394
- toClient: (dbValue: number) => number;
395
- toDb: (clientValue: number) => number;
396
- };
397
- };
398
- };
399
- };
400
- <TNewNext extends z.ZodTypeAny, TDefaultNext>(schema: TNewNext | ((tools: {
401
- sql: z.ZodNumber;
402
- }) => TNewNext), defaultValue: () => TDefaultNext): {
403
- config: {
404
- sql: {
405
- nullable?: boolean;
406
- pk?: true;
407
- field?: string;
408
- default?: number;
409
- type: "int";
410
- };
411
- zodSqlSchema: z.ZodNumber;
412
- zodNewSchema: TNewNext;
413
- initialValue: z.TypeOf<TNewNext>;
414
- zodClientSchema: InferSmartClientType<z.ZodNumber, TNewNext>;
415
- zodValidationSchema: InferSmartClientType<z.ZodNumber, TNewNext>;
416
- };
417
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
418
- sql: z.ZodNumber;
419
- initialState: TNewNext;
420
- client: InferSmartClientType<z.ZodNumber, TNewNext>;
421
- }) => TValidationNext)) => {
422
- config: {
423
- sql: {
424
- nullable?: boolean;
425
- pk?: true;
426
- field?: string;
427
- default?: number;
428
- type: "int";
429
- };
430
- zodSqlSchema: z.ZodNumber;
431
- zodNewSchema: TNewNext;
432
- initialValue: z.TypeOf<TNewNext>;
433
- zodClientSchema: InferSmartClientType<z.ZodNumber, TNewNext>;
434
- zodValidationSchema: TValidationNext;
435
- };
436
- transform: (transforms: {
437
- toClient: (dbValue: number) => z.TypeOf<InferSmartClientType<z.ZodNumber, TNewNext>>;
438
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodNumber, TNewNext>>) => number;
439
- }) => {
440
- config: {
441
- sql: {
442
- nullable?: boolean;
443
- pk?: true;
444
- field?: string;
445
- default?: number;
446
- type: "int";
447
- };
448
- zodSqlSchema: z.ZodNumber;
449
- zodNewSchema: TNewNext;
450
- initialValue: z.TypeOf<TNewNext>;
451
- zodClientSchema: InferSmartClientType<z.ZodNumber, TNewNext>;
452
- zodValidationSchema: TValidationNext;
453
- } & {
454
- transforms: {
455
- toClient: (dbValue: number) => z.TypeOf<InferSmartClientType<z.ZodNumber, TNewNext>>;
456
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodNumber, TNewNext>>) => number;
457
- };
458
- };
459
- };
460
- };
461
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
462
- sql: z.ZodNumber;
463
- initialState: TNewNext;
464
- }) => TClientNext)) => {
465
- config: {
466
- sql: {
467
- nullable?: boolean;
468
- pk?: true;
469
- field?: string;
470
- default?: number;
471
- type: "int";
472
- };
473
- zodSqlSchema: z.ZodNumber;
474
- zodNewSchema: TNewNext;
475
- initialValue: z.TypeOf<TNewNext>;
476
- zodClientSchema: TClientNext;
477
- zodValidationSchema: TClientNext;
478
- };
479
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
480
- sql: z.ZodNumber;
481
- initialState: TNewNext;
482
- client: TClientNext;
483
- }) => TValidationNext)) => {
484
- config: {
485
- sql: {
486
- nullable?: boolean;
487
- pk?: true;
488
- field?: string;
489
- default?: number;
490
- type: "int";
491
- };
492
- zodSqlSchema: z.ZodNumber;
493
- zodNewSchema: TNewNext;
494
- initialValue: z.TypeOf<TNewNext>;
495
- zodClientSchema: TClientNext;
496
- zodValidationSchema: TValidationNext;
497
- };
498
- transform: (transforms: {
499
- toClient: (dbValue: number) => z.TypeOf<TClientNext>;
500
- toDb: (clientValue: z.TypeOf<TClientNext>) => number;
501
- }) => {
502
- config: {
503
- sql: {
504
- nullable?: boolean;
505
- pk?: true;
506
- field?: string;
507
- default?: number;
508
- type: "int";
509
- };
510
- zodSqlSchema: z.ZodNumber;
511
- zodNewSchema: TNewNext;
512
- initialValue: z.TypeOf<TNewNext>;
513
- zodClientSchema: TClientNext;
514
- zodValidationSchema: TValidationNext;
515
- } & {
516
- transforms: {
517
- toClient: (dbValue: number) => z.TypeOf<TClientNext>;
518
- toDb: (clientValue: z.TypeOf<TClientNext>) => number;
519
- };
520
- };
521
- };
522
- };
523
- transform: (transforms: {
524
- toClient: (dbValue: number) => z.TypeOf<TClientNext>;
525
- toDb: (clientValue: z.TypeOf<TClientNext>) => number;
526
- }) => {
527
- config: {
528
- sql: {
529
- nullable?: boolean;
530
- pk?: true;
531
- field?: string;
532
- default?: number;
533
- type: "int";
534
- };
535
- zodSqlSchema: z.ZodNumber;
536
- zodNewSchema: TNewNext;
537
- initialValue: z.TypeOf<TNewNext>;
538
- zodClientSchema: TClientNext;
539
- zodValidationSchema: TClientNext;
540
- } & {
541
- transforms: {
542
- toClient: (dbValue: number) => z.TypeOf<TClientNext>;
543
- toDb: (clientValue: z.TypeOf<TClientNext>) => number;
544
- };
545
- };
546
- };
547
- };
548
- transform: (transforms: {
549
- toClient: (dbValue: number) => z.TypeOf<InferSmartClientType<z.ZodNumber, TNewNext>>;
550
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodNumber, TNewNext>>) => number;
551
- }) => {
552
- config: {
553
- sql: {
554
- nullable?: boolean;
555
- pk?: true;
556
- field?: string;
557
- default?: number;
558
- type: "int";
559
- };
560
- zodSqlSchema: z.ZodNumber;
561
- zodNewSchema: TNewNext;
562
- initialValue: z.TypeOf<TNewNext>;
563
- zodClientSchema: InferSmartClientType<z.ZodNumber, TNewNext>;
564
- zodValidationSchema: InferSmartClientType<z.ZodNumber, TNewNext>;
565
- } & {
566
- transforms: {
567
- toClient: (dbValue: number) => z.TypeOf<InferSmartClientType<z.ZodNumber, TNewNext>>;
568
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodNumber, TNewNext>>) => number;
569
- };
570
- };
571
- };
572
- };
573
- };
574
- };
575
- varchar: (config?: Omit<StringConfig, "type">) => {
576
- config: {
577
- sql: {
578
- pk?: true;
579
- nullable?: boolean;
580
- default?: string;
581
- length?: number;
582
- field?: string;
583
- type: "varchar";
584
- };
585
- zodSqlSchema: z.ZodString;
586
- zodNewSchema: z.ZodString;
587
- initialValue: string;
588
- zodClientSchema: z.ZodString;
589
- zodValidationSchema: z.ZodString;
590
- };
591
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
592
- sql: z.ZodString;
593
- initialState: z.ZodString;
594
- client: z.ZodString;
595
- }) => TValidationNext)) => {
596
- config: {
597
- sql: {
598
- pk?: true;
599
- nullable?: boolean;
600
- default?: string;
601
- length?: number;
602
- field?: string;
603
- type: "varchar";
604
- };
605
- zodSqlSchema: z.ZodString;
606
- zodNewSchema: z.ZodString;
607
- initialValue: string;
608
- zodClientSchema: z.ZodString;
609
- zodValidationSchema: TValidationNext;
610
- };
611
- transform: (transforms: {
612
- toClient: (dbValue: string) => string;
613
- toDb: (clientValue: string) => string;
614
- }) => {
615
- config: {
616
- sql: {
617
- pk?: true;
618
- nullable?: boolean;
619
- default?: string;
620
- length?: number;
621
- field?: string;
622
- type: "varchar";
623
- };
624
- zodSqlSchema: z.ZodString;
625
- zodNewSchema: z.ZodString;
626
- initialValue: string;
627
- zodClientSchema: z.ZodString;
628
- zodValidationSchema: TValidationNext;
629
- } & {
630
- transforms: {
631
- toClient: (dbValue: string) => string;
632
- toDb: (clientValue: string) => string;
633
- };
634
- };
635
- };
636
- };
637
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
638
- sql: z.ZodString;
639
- initialState: z.ZodString;
640
- }) => TClientNext)) => {
641
- config: {
642
- sql: {
643
- pk?: true;
644
- nullable?: boolean;
645
- default?: string;
646
- length?: number;
647
- field?: string;
648
- type: "varchar";
649
- };
650
- zodSqlSchema: z.ZodString;
651
- zodNewSchema: z.ZodString;
652
- initialValue: string;
653
- zodClientSchema: TClientNext;
654
- zodValidationSchema: TClientNext;
655
- };
656
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
657
- sql: z.ZodString;
658
- initialState: z.ZodString;
659
- client: TClientNext;
660
- }) => TValidationNext)) => {
661
- config: {
662
- sql: {
663
- pk?: true;
664
- nullable?: boolean;
665
- default?: string;
666
- length?: number;
667
- field?: string;
668
- type: "varchar";
669
- };
670
- zodSqlSchema: z.ZodString;
671
- zodNewSchema: z.ZodString;
672
- initialValue: string;
673
- zodClientSchema: TClientNext;
674
- zodValidationSchema: TValidationNext;
675
- };
676
- transform: (transforms: {
677
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
678
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
679
- }) => {
680
- config: {
681
- sql: {
682
- pk?: true;
683
- nullable?: boolean;
684
- default?: string;
685
- length?: number;
686
- field?: string;
687
- type: "varchar";
688
- };
689
- zodSqlSchema: z.ZodString;
690
- zodNewSchema: z.ZodString;
691
- initialValue: string;
692
- zodClientSchema: TClientNext;
693
- zodValidationSchema: TValidationNext;
694
- } & {
695
- transforms: {
696
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
697
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
698
- };
699
- };
700
- };
701
- };
702
- transform: (transforms: {
703
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
704
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
705
- }) => {
706
- config: {
707
- sql: {
708
- pk?: true;
709
- nullable?: boolean;
710
- default?: string;
711
- length?: number;
712
- field?: string;
713
- type: "varchar";
714
- };
715
- zodSqlSchema: z.ZodString;
716
- zodNewSchema: z.ZodString;
717
- initialValue: string;
718
- zodClientSchema: TClientNext;
719
- zodValidationSchema: TClientNext;
720
- } & {
721
- transforms: {
722
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
723
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
724
- };
725
- };
726
- };
727
- };
728
- transform: (transforms: {
729
- toClient: (dbValue: string) => string;
730
- toDb: (clientValue: string) => string;
731
- }) => {
732
- config: {
733
- sql: {
734
- pk?: true;
735
- nullable?: boolean;
736
- default?: string;
737
- length?: number;
738
- field?: string;
739
- type: "varchar";
740
- };
741
- zodSqlSchema: z.ZodString;
742
- zodNewSchema: z.ZodString;
743
- initialValue: string;
744
- zodClientSchema: z.ZodString;
745
- zodValidationSchema: z.ZodString;
746
- } & {
747
- transforms: {
748
- toClient: (dbValue: string) => string;
749
- toDb: (clientValue: string) => string;
750
- };
751
- };
752
- };
753
- initialState: {
754
- <TDefaultNext>(defaultValue: () => TDefaultNext): {
755
- config: {
756
- sql: {
757
- pk?: true;
758
- nullable?: boolean;
759
- default?: string;
760
- length?: number;
761
- field?: string;
762
- type: "varchar";
763
- };
764
- zodSqlSchema: z.ZodString;
765
- zodNewSchema: z.ZodString;
766
- initialValue: TDefaultNext;
767
- zodClientSchema: z.ZodString;
768
- zodValidationSchema: z.ZodString;
769
- };
770
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
771
- sql: z.ZodString;
772
- initialState: z.ZodString;
773
- client: z.ZodString;
774
- }) => TValidationNext)) => {
775
- config: {
776
- sql: {
777
- pk?: true;
778
- nullable?: boolean;
779
- default?: string;
780
- length?: number;
781
- field?: string;
782
- type: "varchar";
783
- };
784
- zodSqlSchema: z.ZodString;
785
- zodNewSchema: z.ZodString;
786
- initialValue: TDefaultNext;
787
- zodClientSchema: z.ZodString;
788
- zodValidationSchema: TValidationNext;
789
- };
790
- transform: (transforms: {
791
- toClient: (dbValue: string) => string;
792
- toDb: (clientValue: string) => string;
793
- }) => {
794
- config: {
795
- sql: {
796
- pk?: true;
797
- nullable?: boolean;
798
- default?: string;
799
- length?: number;
800
- field?: string;
801
- type: "varchar";
802
- };
803
- zodSqlSchema: z.ZodString;
804
- zodNewSchema: z.ZodString;
805
- initialValue: TDefaultNext;
806
- zodClientSchema: z.ZodString;
807
- zodValidationSchema: TValidationNext;
808
- } & {
809
- transforms: {
810
- toClient: (dbValue: string) => string;
811
- toDb: (clientValue: string) => string;
812
- };
813
- };
814
- };
815
- };
816
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
817
- sql: z.ZodString;
818
- initialState: z.ZodString;
819
- }) => TClientNext)) => {
820
- config: {
821
- sql: {
822
- pk?: true;
823
- nullable?: boolean;
824
- default?: string;
825
- length?: number;
826
- field?: string;
827
- type: "varchar";
828
- };
829
- zodSqlSchema: z.ZodString;
830
- zodNewSchema: z.ZodString;
831
- initialValue: TDefaultNext;
832
- zodClientSchema: TClientNext;
833
- zodValidationSchema: TClientNext;
834
- };
835
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
836
- sql: z.ZodString;
837
- initialState: z.ZodString;
838
- client: TClientNext;
839
- }) => TValidationNext)) => {
840
- config: {
841
- sql: {
842
- pk?: true;
843
- nullable?: boolean;
844
- default?: string;
845
- length?: number;
846
- field?: string;
847
- type: "varchar";
848
- };
849
- zodSqlSchema: z.ZodString;
850
- zodNewSchema: z.ZodString;
851
- initialValue: TDefaultNext;
852
- zodClientSchema: TClientNext;
853
- zodValidationSchema: TValidationNext;
854
- };
855
- transform: (transforms: {
856
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
857
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
858
- }) => {
859
- config: {
860
- sql: {
861
- pk?: true;
862
- nullable?: boolean;
863
- default?: string;
864
- length?: number;
865
- field?: string;
866
- type: "varchar";
867
- };
868
- zodSqlSchema: z.ZodString;
869
- zodNewSchema: z.ZodString;
870
- initialValue: TDefaultNext;
871
- zodClientSchema: TClientNext;
872
- zodValidationSchema: TValidationNext;
873
- } & {
874
- transforms: {
875
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
876
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
877
- };
878
- };
879
- };
880
- };
881
- transform: (transforms: {
882
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
883
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
884
- }) => {
885
- config: {
886
- sql: {
887
- pk?: true;
888
- nullable?: boolean;
889
- default?: string;
890
- length?: number;
891
- field?: string;
892
- type: "varchar";
893
- };
894
- zodSqlSchema: z.ZodString;
895
- zodNewSchema: z.ZodString;
896
- initialValue: TDefaultNext;
897
- zodClientSchema: TClientNext;
898
- zodValidationSchema: TClientNext;
899
- } & {
900
- transforms: {
901
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
902
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
903
- };
904
- };
905
- };
906
- };
907
- transform: (transforms: {
908
- toClient: (dbValue: string) => string;
909
- toDb: (clientValue: string) => string;
910
- }) => {
911
- config: {
912
- sql: {
913
- pk?: true;
914
- nullable?: boolean;
915
- default?: string;
916
- length?: number;
917
- field?: string;
918
- type: "varchar";
919
- };
920
- zodSqlSchema: z.ZodString;
921
- zodNewSchema: z.ZodString;
922
- initialValue: TDefaultNext;
923
- zodClientSchema: z.ZodString;
924
- zodValidationSchema: z.ZodString;
925
- } & {
926
- transforms: {
927
- toClient: (dbValue: string) => string;
928
- toDb: (clientValue: string) => string;
929
- };
930
- };
931
- };
932
- };
933
- <TNewNext extends z.ZodTypeAny, TDefaultNext>(schema: TNewNext | ((tools: {
934
- sql: z.ZodString;
935
- }) => TNewNext), defaultValue: () => TDefaultNext): {
936
- config: {
937
- sql: {
938
- pk?: true;
939
- nullable?: boolean;
940
- default?: string;
941
- length?: number;
942
- field?: string;
943
- type: "varchar";
944
- };
945
- zodSqlSchema: z.ZodString;
946
- zodNewSchema: TNewNext;
947
- initialValue: z.TypeOf<TNewNext>;
948
- zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
949
- zodValidationSchema: InferSmartClientType<z.ZodString, TNewNext>;
950
- };
951
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
952
- sql: z.ZodString;
953
- initialState: TNewNext;
954
- client: InferSmartClientType<z.ZodString, TNewNext>;
955
- }) => TValidationNext)) => {
956
- config: {
957
- sql: {
958
- pk?: true;
959
- nullable?: boolean;
960
- default?: string;
961
- length?: number;
962
- field?: string;
963
- type: "varchar";
964
- };
965
- zodSqlSchema: z.ZodString;
966
- zodNewSchema: TNewNext;
967
- initialValue: z.TypeOf<TNewNext>;
968
- zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
969
- zodValidationSchema: TValidationNext;
970
- };
971
- transform: (transforms: {
972
- toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
973
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
974
- }) => {
975
- config: {
976
- sql: {
977
- pk?: true;
978
- nullable?: boolean;
979
- default?: string;
980
- length?: number;
981
- field?: string;
982
- type: "varchar";
983
- };
984
- zodSqlSchema: z.ZodString;
985
- zodNewSchema: TNewNext;
986
- initialValue: z.TypeOf<TNewNext>;
987
- zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
988
- zodValidationSchema: TValidationNext;
989
- } & {
990
- transforms: {
991
- toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
992
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
993
- };
994
- };
995
- };
996
- };
997
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
998
- sql: z.ZodString;
999
- initialState: TNewNext;
1000
- }) => TClientNext)) => {
1001
- config: {
1002
- sql: {
1003
- pk?: true;
1004
- nullable?: boolean;
1005
- default?: string;
1006
- length?: number;
1007
- field?: string;
1008
- type: "varchar";
1009
- };
1010
- zodSqlSchema: z.ZodString;
1011
- zodNewSchema: TNewNext;
1012
- initialValue: z.TypeOf<TNewNext>;
1013
- zodClientSchema: TClientNext;
1014
- zodValidationSchema: TClientNext;
1015
- };
1016
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
1017
- sql: z.ZodString;
1018
- initialState: TNewNext;
1019
- client: TClientNext;
1020
- }) => TValidationNext)) => {
1021
- config: {
1022
- sql: {
1023
- pk?: true;
1024
- nullable?: boolean;
1025
- default?: string;
1026
- length?: number;
1027
- field?: string;
1028
- type: "varchar";
1029
- };
1030
- zodSqlSchema: z.ZodString;
1031
- zodNewSchema: TNewNext;
1032
- initialValue: z.TypeOf<TNewNext>;
1033
- zodClientSchema: TClientNext;
1034
- zodValidationSchema: TValidationNext;
1035
- };
1036
- transform: (transforms: {
1037
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1038
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1039
- }) => {
1040
- config: {
1041
- sql: {
1042
- pk?: true;
1043
- nullable?: boolean;
1044
- default?: string;
1045
- length?: number;
1046
- field?: string;
1047
- type: "varchar";
1048
- };
1049
- zodSqlSchema: z.ZodString;
1050
- zodNewSchema: TNewNext;
1051
- initialValue: z.TypeOf<TNewNext>;
1052
- zodClientSchema: TClientNext;
1053
- zodValidationSchema: TValidationNext;
1054
- } & {
1055
- transforms: {
1056
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1057
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1058
- };
1059
- };
1060
- };
1061
- };
1062
- transform: (transforms: {
1063
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1064
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1065
- }) => {
1066
- config: {
1067
- sql: {
1068
- pk?: true;
1069
- nullable?: boolean;
1070
- default?: string;
1071
- length?: number;
1072
- field?: string;
1073
- type: "varchar";
1074
- };
1075
- zodSqlSchema: z.ZodString;
1076
- zodNewSchema: TNewNext;
1077
- initialValue: z.TypeOf<TNewNext>;
1078
- zodClientSchema: TClientNext;
1079
- zodValidationSchema: TClientNext;
1080
- } & {
1081
- transforms: {
1082
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1083
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1084
- };
1085
- };
1086
- };
1087
- };
1088
- transform: (transforms: {
1089
- toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
1090
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
1091
- }) => {
1092
- config: {
1093
- sql: {
1094
- pk?: true;
1095
- nullable?: boolean;
1096
- default?: string;
1097
- length?: number;
1098
- field?: string;
1099
- type: "varchar";
1100
- };
1101
- zodSqlSchema: z.ZodString;
1102
- zodNewSchema: TNewNext;
1103
- initialValue: z.TypeOf<TNewNext>;
1104
- zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
1105
- zodValidationSchema: InferSmartClientType<z.ZodString, TNewNext>;
1106
- } & {
1107
- transforms: {
1108
- toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
1109
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
1110
- };
1111
- };
1112
- };
1113
- };
1114
- };
1115
- };
1116
- char: (config?: Omit<StringConfig, "type">) => {
1117
- config: {
1118
- sql: {
1119
- pk?: true;
1120
- nullable?: boolean;
1121
- default?: string;
1122
- length?: number;
1123
- field?: string;
1124
- type: "char";
1125
- };
1126
- zodSqlSchema: z.ZodString;
1127
- zodNewSchema: z.ZodString;
1128
- initialValue: string;
1129
- zodClientSchema: z.ZodString;
1130
- zodValidationSchema: z.ZodString;
1131
- };
1132
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
1133
- sql: z.ZodString;
1134
- initialState: z.ZodString;
1135
- client: z.ZodString;
1136
- }) => TValidationNext)) => {
1137
- config: {
1138
- sql: {
1139
- pk?: true;
1140
- nullable?: boolean;
1141
- default?: string;
1142
- length?: number;
1143
- field?: string;
1144
- type: "char";
1145
- };
1146
- zodSqlSchema: z.ZodString;
1147
- zodNewSchema: z.ZodString;
1148
- initialValue: string;
1149
- zodClientSchema: z.ZodString;
1150
- zodValidationSchema: TValidationNext;
1151
- };
1152
- transform: (transforms: {
1153
- toClient: (dbValue: string) => string;
1154
- toDb: (clientValue: string) => string;
1155
- }) => {
1156
- config: {
1157
- sql: {
1158
- pk?: true;
1159
- nullable?: boolean;
1160
- default?: string;
1161
- length?: number;
1162
- field?: string;
1163
- type: "char";
1164
- };
1165
- zodSqlSchema: z.ZodString;
1166
- zodNewSchema: z.ZodString;
1167
- initialValue: string;
1168
- zodClientSchema: z.ZodString;
1169
- zodValidationSchema: TValidationNext;
1170
- } & {
1171
- transforms: {
1172
- toClient: (dbValue: string) => string;
1173
- toDb: (clientValue: string) => string;
1174
- };
1175
- };
1176
- };
1177
- };
1178
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
1179
- sql: z.ZodString;
1180
- initialState: z.ZodString;
1181
- }) => TClientNext)) => {
1182
- config: {
1183
- sql: {
1184
- pk?: true;
1185
- nullable?: boolean;
1186
- default?: string;
1187
- length?: number;
1188
- field?: string;
1189
- type: "char";
1190
- };
1191
- zodSqlSchema: z.ZodString;
1192
- zodNewSchema: z.ZodString;
1193
- initialValue: string;
1194
- zodClientSchema: TClientNext;
1195
- zodValidationSchema: TClientNext;
1196
- };
1197
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
1198
- sql: z.ZodString;
1199
- initialState: z.ZodString;
1200
- client: TClientNext;
1201
- }) => TValidationNext)) => {
1202
- config: {
1203
- sql: {
1204
- pk?: true;
1205
- nullable?: boolean;
1206
- default?: string;
1207
- length?: number;
1208
- field?: string;
1209
- type: "char";
1210
- };
1211
- zodSqlSchema: z.ZodString;
1212
- zodNewSchema: z.ZodString;
1213
- initialValue: string;
1214
- zodClientSchema: TClientNext;
1215
- zodValidationSchema: TValidationNext;
1216
- };
1217
- transform: (transforms: {
1218
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1219
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1220
- }) => {
1221
- config: {
1222
- sql: {
1223
- pk?: true;
1224
- nullable?: boolean;
1225
- default?: string;
1226
- length?: number;
1227
- field?: string;
1228
- type: "char";
1229
- };
1230
- zodSqlSchema: z.ZodString;
1231
- zodNewSchema: z.ZodString;
1232
- initialValue: string;
1233
- zodClientSchema: TClientNext;
1234
- zodValidationSchema: TValidationNext;
1235
- } & {
1236
- transforms: {
1237
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1238
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1239
- };
1240
- };
1241
- };
1242
- };
1243
- transform: (transforms: {
1244
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1245
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1246
- }) => {
1247
- config: {
1248
- sql: {
1249
- pk?: true;
1250
- nullable?: boolean;
1251
- default?: string;
1252
- length?: number;
1253
- field?: string;
1254
- type: "char";
1255
- };
1256
- zodSqlSchema: z.ZodString;
1257
- zodNewSchema: z.ZodString;
1258
- initialValue: string;
1259
- zodClientSchema: TClientNext;
1260
- zodValidationSchema: TClientNext;
1261
- } & {
1262
- transforms: {
1263
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1264
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1265
- };
1266
- };
1267
- };
1268
- };
1269
- transform: (transforms: {
1270
- toClient: (dbValue: string) => string;
1271
- toDb: (clientValue: string) => string;
1272
- }) => {
1273
- config: {
1274
- sql: {
1275
- pk?: true;
1276
- nullable?: boolean;
1277
- default?: string;
1278
- length?: number;
1279
- field?: string;
1280
- type: "char";
1281
- };
1282
- zodSqlSchema: z.ZodString;
1283
- zodNewSchema: z.ZodString;
1284
- initialValue: string;
1285
- zodClientSchema: z.ZodString;
1286
- zodValidationSchema: z.ZodString;
1287
- } & {
1288
- transforms: {
1289
- toClient: (dbValue: string) => string;
1290
- toDb: (clientValue: string) => string;
1291
- };
1292
- };
1293
- };
1294
- initialState: {
1295
- <TDefaultNext>(defaultValue: () => TDefaultNext): {
1296
- config: {
1297
- sql: {
1298
- pk?: true;
1299
- nullable?: boolean;
1300
- default?: string;
1301
- length?: number;
1302
- field?: string;
1303
- type: "char";
1304
- };
1305
- zodSqlSchema: z.ZodString;
1306
- zodNewSchema: z.ZodString;
1307
- initialValue: TDefaultNext;
1308
- zodClientSchema: z.ZodString;
1309
- zodValidationSchema: z.ZodString;
1310
- };
1311
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
1312
- sql: z.ZodString;
1313
- initialState: z.ZodString;
1314
- client: z.ZodString;
1315
- }) => TValidationNext)) => {
1316
- config: {
1317
- sql: {
1318
- pk?: true;
1319
- nullable?: boolean;
1320
- default?: string;
1321
- length?: number;
1322
- field?: string;
1323
- type: "char";
1324
- };
1325
- zodSqlSchema: z.ZodString;
1326
- zodNewSchema: z.ZodString;
1327
- initialValue: TDefaultNext;
1328
- zodClientSchema: z.ZodString;
1329
- zodValidationSchema: TValidationNext;
1330
- };
1331
- transform: (transforms: {
1332
- toClient: (dbValue: string) => string;
1333
- toDb: (clientValue: string) => string;
1334
- }) => {
1335
- config: {
1336
- sql: {
1337
- pk?: true;
1338
- nullable?: boolean;
1339
- default?: string;
1340
- length?: number;
1341
- field?: string;
1342
- type: "char";
1343
- };
1344
- zodSqlSchema: z.ZodString;
1345
- zodNewSchema: z.ZodString;
1346
- initialValue: TDefaultNext;
1347
- zodClientSchema: z.ZodString;
1348
- zodValidationSchema: TValidationNext;
1349
- } & {
1350
- transforms: {
1351
- toClient: (dbValue: string) => string;
1352
- toDb: (clientValue: string) => string;
1353
- };
1354
- };
1355
- };
1356
- };
1357
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
1358
- sql: z.ZodString;
1359
- initialState: z.ZodString;
1360
- }) => TClientNext)) => {
1361
- config: {
1362
- sql: {
1363
- pk?: true;
1364
- nullable?: boolean;
1365
- default?: string;
1366
- length?: number;
1367
- field?: string;
1368
- type: "char";
1369
- };
1370
- zodSqlSchema: z.ZodString;
1371
- zodNewSchema: z.ZodString;
1372
- initialValue: TDefaultNext;
1373
- zodClientSchema: TClientNext;
1374
- zodValidationSchema: TClientNext;
1375
- };
1376
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
1377
- sql: z.ZodString;
1378
- initialState: z.ZodString;
1379
- client: TClientNext;
1380
- }) => TValidationNext)) => {
1381
- config: {
1382
- sql: {
1383
- pk?: true;
1384
- nullable?: boolean;
1385
- default?: string;
1386
- length?: number;
1387
- field?: string;
1388
- type: "char";
1389
- };
1390
- zodSqlSchema: z.ZodString;
1391
- zodNewSchema: z.ZodString;
1392
- initialValue: TDefaultNext;
1393
- zodClientSchema: TClientNext;
1394
- zodValidationSchema: TValidationNext;
1395
- };
1396
- transform: (transforms: {
1397
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1398
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1399
- }) => {
1400
- config: {
1401
- sql: {
1402
- pk?: true;
1403
- nullable?: boolean;
1404
- default?: string;
1405
- length?: number;
1406
- field?: string;
1407
- type: "char";
1408
- };
1409
- zodSqlSchema: z.ZodString;
1410
- zodNewSchema: z.ZodString;
1411
- initialValue: TDefaultNext;
1412
- zodClientSchema: TClientNext;
1413
- zodValidationSchema: TValidationNext;
1414
- } & {
1415
- transforms: {
1416
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1417
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1418
- };
1419
- };
1420
- };
1421
- };
1422
- transform: (transforms: {
1423
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1424
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1425
- }) => {
1426
- config: {
1427
- sql: {
1428
- pk?: true;
1429
- nullable?: boolean;
1430
- default?: string;
1431
- length?: number;
1432
- field?: string;
1433
- type: "char";
1434
- };
1435
- zodSqlSchema: z.ZodString;
1436
- zodNewSchema: z.ZodString;
1437
- initialValue: TDefaultNext;
1438
- zodClientSchema: TClientNext;
1439
- zodValidationSchema: TClientNext;
1440
- } & {
1441
- transforms: {
1442
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1443
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1444
- };
1445
- };
1446
- };
1447
- };
1448
- transform: (transforms: {
1449
- toClient: (dbValue: string) => string;
1450
- toDb: (clientValue: string) => string;
1451
- }) => {
1452
- config: {
1453
- sql: {
1454
- pk?: true;
1455
- nullable?: boolean;
1456
- default?: string;
1457
- length?: number;
1458
- field?: string;
1459
- type: "char";
1460
- };
1461
- zodSqlSchema: z.ZodString;
1462
- zodNewSchema: z.ZodString;
1463
- initialValue: TDefaultNext;
1464
- zodClientSchema: z.ZodString;
1465
- zodValidationSchema: z.ZodString;
1466
- } & {
1467
- transforms: {
1468
- toClient: (dbValue: string) => string;
1469
- toDb: (clientValue: string) => string;
1470
- };
1471
- };
1472
- };
1473
- };
1474
- <TNewNext extends z.ZodTypeAny, TDefaultNext>(schema: TNewNext | ((tools: {
1475
- sql: z.ZodString;
1476
- }) => TNewNext), defaultValue: () => TDefaultNext): {
1477
- config: {
1478
- sql: {
1479
- pk?: true;
1480
- nullable?: boolean;
1481
- default?: string;
1482
- length?: number;
1483
- field?: string;
1484
- type: "char";
1485
- };
1486
- zodSqlSchema: z.ZodString;
1487
- zodNewSchema: TNewNext;
1488
- initialValue: z.TypeOf<TNewNext>;
1489
- zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
1490
- zodValidationSchema: InferSmartClientType<z.ZodString, TNewNext>;
1491
- };
1492
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
1493
- sql: z.ZodString;
1494
- initialState: TNewNext;
1495
- client: InferSmartClientType<z.ZodString, TNewNext>;
1496
- }) => TValidationNext)) => {
1497
- config: {
1498
- sql: {
1499
- pk?: true;
1500
- nullable?: boolean;
1501
- default?: string;
1502
- length?: number;
1503
- field?: string;
1504
- type: "char";
1505
- };
1506
- zodSqlSchema: z.ZodString;
1507
- zodNewSchema: TNewNext;
1508
- initialValue: z.TypeOf<TNewNext>;
1509
- zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
1510
- zodValidationSchema: TValidationNext;
1511
- };
1512
- transform: (transforms: {
1513
- toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
1514
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
1515
- }) => {
1516
- config: {
1517
- sql: {
1518
- pk?: true;
1519
- nullable?: boolean;
1520
- default?: string;
1521
- length?: number;
1522
- field?: string;
1523
- type: "char";
1524
- };
1525
- zodSqlSchema: z.ZodString;
1526
- zodNewSchema: TNewNext;
1527
- initialValue: z.TypeOf<TNewNext>;
1528
- zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
1529
- zodValidationSchema: TValidationNext;
1530
- } & {
1531
- transforms: {
1532
- toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
1533
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
1534
- };
1535
- };
1536
- };
1537
- };
1538
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
1539
- sql: z.ZodString;
1540
- initialState: TNewNext;
1541
- }) => TClientNext)) => {
1542
- config: {
1543
- sql: {
1544
- pk?: true;
1545
- nullable?: boolean;
1546
- default?: string;
1547
- length?: number;
1548
- field?: string;
1549
- type: "char";
1550
- };
1551
- zodSqlSchema: z.ZodString;
1552
- zodNewSchema: TNewNext;
1553
- initialValue: z.TypeOf<TNewNext>;
1554
- zodClientSchema: TClientNext;
1555
- zodValidationSchema: TClientNext;
1556
- };
1557
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
1558
- sql: z.ZodString;
1559
- initialState: TNewNext;
1560
- client: TClientNext;
1561
- }) => TValidationNext)) => {
1562
- config: {
1563
- sql: {
1564
- pk?: true;
1565
- nullable?: boolean;
1566
- default?: string;
1567
- length?: number;
1568
- field?: string;
1569
- type: "char";
1570
- };
1571
- zodSqlSchema: z.ZodString;
1572
- zodNewSchema: TNewNext;
1573
- initialValue: z.TypeOf<TNewNext>;
1574
- zodClientSchema: TClientNext;
1575
- zodValidationSchema: TValidationNext;
1576
- };
1577
- transform: (transforms: {
1578
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1579
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1580
- }) => {
1581
- config: {
1582
- sql: {
1583
- pk?: true;
1584
- nullable?: boolean;
1585
- default?: string;
1586
- length?: number;
1587
- field?: string;
1588
- type: "char";
1589
- };
1590
- zodSqlSchema: z.ZodString;
1591
- zodNewSchema: TNewNext;
1592
- initialValue: z.TypeOf<TNewNext>;
1593
- zodClientSchema: TClientNext;
1594
- zodValidationSchema: TValidationNext;
1595
- } & {
1596
- transforms: {
1597
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1598
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1599
- };
1600
- };
1601
- };
1602
- };
1603
- transform: (transforms: {
1604
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1605
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1606
- }) => {
1607
- config: {
1608
- sql: {
1609
- pk?: true;
1610
- nullable?: boolean;
1611
- default?: string;
1612
- length?: number;
1613
- field?: string;
1614
- type: "char";
1615
- };
1616
- zodSqlSchema: z.ZodString;
1617
- zodNewSchema: TNewNext;
1618
- initialValue: z.TypeOf<TNewNext>;
1619
- zodClientSchema: TClientNext;
1620
- zodValidationSchema: TClientNext;
1621
- } & {
1622
- transforms: {
1623
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1624
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1625
- };
1626
- };
1627
- };
1628
- };
1629
- transform: (transforms: {
1630
- toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
1631
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
1632
- }) => {
1633
- config: {
1634
- sql: {
1635
- pk?: true;
1636
- nullable?: boolean;
1637
- default?: string;
1638
- length?: number;
1639
- field?: string;
1640
- type: "char";
1641
- };
1642
- zodSqlSchema: z.ZodString;
1643
- zodNewSchema: TNewNext;
1644
- initialValue: z.TypeOf<TNewNext>;
1645
- zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
1646
- zodValidationSchema: InferSmartClientType<z.ZodString, TNewNext>;
1647
- } & {
1648
- transforms: {
1649
- toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
1650
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
1651
- };
1652
- };
1653
- };
1654
- };
1655
- };
1656
- };
1657
- text: (config?: Omit<StringConfig, "type" | "length">) => {
1658
- config: {
1659
- sql: {
1660
- pk?: true;
1661
- nullable?: boolean;
1662
- default?: string;
1663
- field?: string;
1664
- type: "text";
1665
- };
1666
- zodSqlSchema: z.ZodString;
1667
- zodNewSchema: z.ZodString;
1668
- initialValue: string;
1669
- zodClientSchema: z.ZodString;
1670
- zodValidationSchema: z.ZodString;
1671
- };
1672
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
1673
- sql: z.ZodString;
1674
- initialState: z.ZodString;
1675
- client: z.ZodString;
1676
- }) => TValidationNext)) => {
1677
- config: {
1678
- sql: {
1679
- pk?: true;
1680
- nullable?: boolean;
1681
- default?: string;
1682
- field?: string;
1683
- type: "text";
1684
- };
1685
- zodSqlSchema: z.ZodString;
1686
- zodNewSchema: z.ZodString;
1687
- initialValue: string;
1688
- zodClientSchema: z.ZodString;
1689
- zodValidationSchema: TValidationNext;
1690
- };
1691
- transform: (transforms: {
1692
- toClient: (dbValue: string) => string;
1693
- toDb: (clientValue: string) => string;
1694
- }) => {
1695
- config: {
1696
- sql: {
1697
- pk?: true;
1698
- nullable?: boolean;
1699
- default?: string;
1700
- field?: string;
1701
- type: "text";
1702
- };
1703
- zodSqlSchema: z.ZodString;
1704
- zodNewSchema: z.ZodString;
1705
- initialValue: string;
1706
- zodClientSchema: z.ZodString;
1707
- zodValidationSchema: TValidationNext;
1708
- } & {
1709
- transforms: {
1710
- toClient: (dbValue: string) => string;
1711
- toDb: (clientValue: string) => string;
1712
- };
1713
- };
1714
- };
1715
- };
1716
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
1717
- sql: z.ZodString;
1718
- initialState: z.ZodString;
1719
- }) => TClientNext)) => {
1720
- config: {
1721
- sql: {
1722
- pk?: true;
1723
- nullable?: boolean;
1724
- default?: string;
1725
- field?: string;
1726
- type: "text";
1727
- };
1728
- zodSqlSchema: z.ZodString;
1729
- zodNewSchema: z.ZodString;
1730
- initialValue: string;
1731
- zodClientSchema: TClientNext;
1732
- zodValidationSchema: TClientNext;
1733
- };
1734
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
1735
- sql: z.ZodString;
1736
- initialState: z.ZodString;
1737
- client: TClientNext;
1738
- }) => TValidationNext)) => {
1739
- config: {
1740
- sql: {
1741
- pk?: true;
1742
- nullable?: boolean;
1743
- default?: string;
1744
- field?: string;
1745
- type: "text";
1746
- };
1747
- zodSqlSchema: z.ZodString;
1748
- zodNewSchema: z.ZodString;
1749
- initialValue: string;
1750
- zodClientSchema: TClientNext;
1751
- zodValidationSchema: TValidationNext;
1752
- };
1753
- transform: (transforms: {
1754
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1755
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1756
- }) => {
1757
- config: {
1758
- sql: {
1759
- pk?: true;
1760
- nullable?: boolean;
1761
- default?: string;
1762
- field?: string;
1763
- type: "text";
1764
- };
1765
- zodSqlSchema: z.ZodString;
1766
- zodNewSchema: z.ZodString;
1767
- initialValue: string;
1768
- zodClientSchema: TClientNext;
1769
- zodValidationSchema: TValidationNext;
1770
- } & {
1771
- transforms: {
1772
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1773
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1774
- };
1775
- };
1776
- };
1777
- };
1778
- transform: (transforms: {
1779
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1780
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1781
- }) => {
1782
- config: {
1783
- sql: {
1784
- pk?: true;
1785
- nullable?: boolean;
1786
- default?: string;
1787
- field?: string;
1788
- type: "text";
1789
- };
1790
- zodSqlSchema: z.ZodString;
1791
- zodNewSchema: z.ZodString;
1792
- initialValue: string;
1793
- zodClientSchema: TClientNext;
1794
- zodValidationSchema: TClientNext;
1795
- } & {
1796
- transforms: {
1797
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1798
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1799
- };
1800
- };
1801
- };
1802
- };
1803
- transform: (transforms: {
1804
- toClient: (dbValue: string) => string;
1805
- toDb: (clientValue: string) => string;
1806
- }) => {
1807
- config: {
1808
- sql: {
1809
- pk?: true;
1810
- nullable?: boolean;
1811
- default?: string;
1812
- field?: string;
1813
- type: "text";
1814
- };
1815
- zodSqlSchema: z.ZodString;
1816
- zodNewSchema: z.ZodString;
1817
- initialValue: string;
1818
- zodClientSchema: z.ZodString;
1819
- zodValidationSchema: z.ZodString;
1820
- } & {
1821
- transforms: {
1822
- toClient: (dbValue: string) => string;
1823
- toDb: (clientValue: string) => string;
1824
- };
1825
- };
1826
- };
1827
- initialState: {
1828
- <TDefaultNext>(defaultValue: () => TDefaultNext): {
1829
- config: {
1830
- sql: {
1831
- pk?: true;
1832
- nullable?: boolean;
1833
- default?: string;
1834
- field?: string;
1835
- type: "text";
1836
- };
1837
- zodSqlSchema: z.ZodString;
1838
- zodNewSchema: z.ZodString;
1839
- initialValue: TDefaultNext;
1840
- zodClientSchema: z.ZodString;
1841
- zodValidationSchema: z.ZodString;
1842
- };
1843
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
1844
- sql: z.ZodString;
1845
- initialState: z.ZodString;
1846
- client: z.ZodString;
1847
- }) => TValidationNext)) => {
1848
- config: {
1849
- sql: {
1850
- pk?: true;
1851
- nullable?: boolean;
1852
- default?: string;
1853
- field?: string;
1854
- type: "text";
1855
- };
1856
- zodSqlSchema: z.ZodString;
1857
- zodNewSchema: z.ZodString;
1858
- initialValue: TDefaultNext;
1859
- zodClientSchema: z.ZodString;
1860
- zodValidationSchema: TValidationNext;
1861
- };
1862
- transform: (transforms: {
1863
- toClient: (dbValue: string) => string;
1864
- toDb: (clientValue: string) => string;
1865
- }) => {
1866
- config: {
1867
- sql: {
1868
- pk?: true;
1869
- nullable?: boolean;
1870
- default?: string;
1871
- field?: string;
1872
- type: "text";
1873
- };
1874
- zodSqlSchema: z.ZodString;
1875
- zodNewSchema: z.ZodString;
1876
- initialValue: TDefaultNext;
1877
- zodClientSchema: z.ZodString;
1878
- zodValidationSchema: TValidationNext;
1879
- } & {
1880
- transforms: {
1881
- toClient: (dbValue: string) => string;
1882
- toDb: (clientValue: string) => string;
1883
- };
1884
- };
1885
- };
1886
- };
1887
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
1888
- sql: z.ZodString;
1889
- initialState: z.ZodString;
1890
- }) => TClientNext)) => {
1891
- config: {
1892
- sql: {
1893
- pk?: true;
1894
- nullable?: boolean;
1895
- default?: string;
1896
- field?: string;
1897
- type: "text";
1898
- };
1899
- zodSqlSchema: z.ZodString;
1900
- zodNewSchema: z.ZodString;
1901
- initialValue: TDefaultNext;
1902
- zodClientSchema: TClientNext;
1903
- zodValidationSchema: TClientNext;
1904
- };
1905
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
1906
- sql: z.ZodString;
1907
- initialState: z.ZodString;
1908
- client: TClientNext;
1909
- }) => TValidationNext)) => {
1910
- config: {
1911
- sql: {
1912
- pk?: true;
1913
- nullable?: boolean;
1914
- default?: string;
1915
- field?: string;
1916
- type: "text";
1917
- };
1918
- zodSqlSchema: z.ZodString;
1919
- zodNewSchema: z.ZodString;
1920
- initialValue: TDefaultNext;
1921
- zodClientSchema: TClientNext;
1922
- zodValidationSchema: TValidationNext;
1923
- };
1924
- transform: (transforms: {
1925
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1926
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1927
- }) => {
1928
- config: {
1929
- sql: {
1930
- pk?: true;
1931
- nullable?: boolean;
1932
- default?: string;
1933
- field?: string;
1934
- type: "text";
1935
- };
1936
- zodSqlSchema: z.ZodString;
1937
- zodNewSchema: z.ZodString;
1938
- initialValue: TDefaultNext;
1939
- zodClientSchema: TClientNext;
1940
- zodValidationSchema: TValidationNext;
1941
- } & {
1942
- transforms: {
1943
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1944
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1945
- };
1946
- };
1947
- };
1948
- };
1949
- transform: (transforms: {
1950
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1951
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1952
- }) => {
1953
- config: {
1954
- sql: {
1955
- pk?: true;
1956
- nullable?: boolean;
1957
- default?: string;
1958
- field?: string;
1959
- type: "text";
1960
- };
1961
- zodSqlSchema: z.ZodString;
1962
- zodNewSchema: z.ZodString;
1963
- initialValue: TDefaultNext;
1964
- zodClientSchema: TClientNext;
1965
- zodValidationSchema: TClientNext;
1966
- } & {
1967
- transforms: {
1968
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1969
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1970
- };
1971
- };
1972
- };
1973
- };
1974
- transform: (transforms: {
1975
- toClient: (dbValue: string) => string;
1976
- toDb: (clientValue: string) => string;
1977
- }) => {
1978
- config: {
1979
- sql: {
1980
- pk?: true;
1981
- nullable?: boolean;
1982
- default?: string;
1983
- field?: string;
1984
- type: "text";
1985
- };
1986
- zodSqlSchema: z.ZodString;
1987
- zodNewSchema: z.ZodString;
1988
- initialValue: TDefaultNext;
1989
- zodClientSchema: z.ZodString;
1990
- zodValidationSchema: z.ZodString;
1991
- } & {
1992
- transforms: {
1993
- toClient: (dbValue: string) => string;
1994
- toDb: (clientValue: string) => string;
1995
- };
1996
- };
1997
- };
1998
- };
1999
- <TNewNext extends z.ZodTypeAny, TDefaultNext>(schema: TNewNext | ((tools: {
2000
- sql: z.ZodString;
2001
- }) => TNewNext), defaultValue: () => TDefaultNext): {
2002
- config: {
2003
- sql: {
2004
- pk?: true;
2005
- nullable?: boolean;
2006
- default?: string;
2007
- field?: string;
2008
- type: "text";
2009
- };
2010
- zodSqlSchema: z.ZodString;
2011
- zodNewSchema: TNewNext;
2012
- initialValue: z.TypeOf<TNewNext>;
2013
- zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
2014
- zodValidationSchema: InferSmartClientType<z.ZodString, TNewNext>;
2015
- };
2016
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
2017
- sql: z.ZodString;
2018
- initialState: TNewNext;
2019
- client: InferSmartClientType<z.ZodString, TNewNext>;
2020
- }) => TValidationNext)) => {
2021
- config: {
2022
- sql: {
2023
- pk?: true;
2024
- nullable?: boolean;
2025
- default?: string;
2026
- field?: string;
2027
- type: "text";
2028
- };
2029
- zodSqlSchema: z.ZodString;
2030
- zodNewSchema: TNewNext;
2031
- initialValue: z.TypeOf<TNewNext>;
2032
- zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
2033
- zodValidationSchema: TValidationNext;
2034
- };
2035
- transform: (transforms: {
2036
- toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
2037
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
2038
- }) => {
2039
- config: {
2040
- sql: {
2041
- pk?: true;
2042
- nullable?: boolean;
2043
- default?: string;
2044
- field?: string;
2045
- type: "text";
2046
- };
2047
- zodSqlSchema: z.ZodString;
2048
- zodNewSchema: TNewNext;
2049
- initialValue: z.TypeOf<TNewNext>;
2050
- zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
2051
- zodValidationSchema: TValidationNext;
2052
- } & {
2053
- transforms: {
2054
- toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
2055
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
2056
- };
2057
- };
2058
- };
2059
- };
2060
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
2061
- sql: z.ZodString;
2062
- initialState: TNewNext;
2063
- }) => TClientNext)) => {
2064
- config: {
2065
- sql: {
2066
- pk?: true;
2067
- nullable?: boolean;
2068
- default?: string;
2069
- field?: string;
2070
- type: "text";
2071
- };
2072
- zodSqlSchema: z.ZodString;
2073
- zodNewSchema: TNewNext;
2074
- initialValue: z.TypeOf<TNewNext>;
2075
- zodClientSchema: TClientNext;
2076
- zodValidationSchema: TClientNext;
2077
- };
2078
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
2079
- sql: z.ZodString;
2080
- initialState: TNewNext;
2081
- client: TClientNext;
2082
- }) => TValidationNext)) => {
2083
- config: {
2084
- sql: {
2085
- pk?: true;
2086
- nullable?: boolean;
2087
- default?: string;
2088
- field?: string;
2089
- type: "text";
2090
- };
2091
- zodSqlSchema: z.ZodString;
2092
- zodNewSchema: TNewNext;
2093
- initialValue: z.TypeOf<TNewNext>;
2094
- zodClientSchema: TClientNext;
2095
- zodValidationSchema: TValidationNext;
2096
- };
2097
- transform: (transforms: {
2098
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
2099
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
2100
- }) => {
2101
- config: {
2102
- sql: {
2103
- pk?: true;
2104
- nullable?: boolean;
2105
- default?: string;
2106
- field?: string;
2107
- type: "text";
2108
- };
2109
- zodSqlSchema: z.ZodString;
2110
- zodNewSchema: TNewNext;
2111
- initialValue: z.TypeOf<TNewNext>;
2112
- zodClientSchema: TClientNext;
2113
- zodValidationSchema: TValidationNext;
2114
- } & {
2115
- transforms: {
2116
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
2117
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
2118
- };
2119
- };
2120
- };
2121
- };
2122
- transform: (transforms: {
2123
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
2124
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
2125
- }) => {
2126
- config: {
2127
- sql: {
2128
- pk?: true;
2129
- nullable?: boolean;
2130
- default?: string;
2131
- field?: string;
2132
- type: "text";
2133
- };
2134
- zodSqlSchema: z.ZodString;
2135
- zodNewSchema: TNewNext;
2136
- initialValue: z.TypeOf<TNewNext>;
2137
- zodClientSchema: TClientNext;
2138
- zodValidationSchema: TClientNext;
2139
- } & {
2140
- transforms: {
2141
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
2142
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
2143
- };
2144
- };
2145
- };
2146
- };
2147
- transform: (transforms: {
2148
- toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
2149
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
2150
- }) => {
2151
- config: {
2152
- sql: {
2153
- pk?: true;
2154
- nullable?: boolean;
2155
- default?: string;
2156
- field?: string;
2157
- type: "text";
2158
- };
2159
- zodSqlSchema: z.ZodString;
2160
- zodNewSchema: TNewNext;
2161
- initialValue: z.TypeOf<TNewNext>;
2162
- zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
2163
- zodValidationSchema: InferSmartClientType<z.ZodString, TNewNext>;
2164
- } & {
2165
- transforms: {
2166
- toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
2167
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
2168
- };
2169
- };
2170
- };
2171
- };
2172
- };
2173
- };
2174
- longtext: (config?: Omit<StringConfig, "type" | "length">) => {
2175
- config: {
2176
- sql: {
2177
- pk?: true;
2178
- nullable?: boolean;
2179
- default?: string;
2180
- field?: string;
2181
- type: "longtext";
2182
- };
2183
- zodSqlSchema: z.ZodString;
2184
- zodNewSchema: z.ZodString;
2185
- initialValue: string;
2186
- zodClientSchema: z.ZodString;
2187
- zodValidationSchema: z.ZodString;
2188
- };
2189
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
2190
- sql: z.ZodString;
2191
- initialState: z.ZodString;
2192
- client: z.ZodString;
2193
- }) => TValidationNext)) => {
2194
- config: {
2195
- sql: {
2196
- pk?: true;
2197
- nullable?: boolean;
2198
- default?: string;
2199
- field?: string;
2200
- type: "longtext";
2201
- };
2202
- zodSqlSchema: z.ZodString;
2203
- zodNewSchema: z.ZodString;
2204
- initialValue: string;
2205
- zodClientSchema: z.ZodString;
2206
- zodValidationSchema: TValidationNext;
2207
- };
2208
- transform: (transforms: {
2209
- toClient: (dbValue: string) => string;
2210
- toDb: (clientValue: string) => string;
2211
- }) => {
2212
- config: {
2213
- sql: {
2214
- pk?: true;
2215
- nullable?: boolean;
2216
- default?: string;
2217
- field?: string;
2218
- type: "longtext";
2219
- };
2220
- zodSqlSchema: z.ZodString;
2221
- zodNewSchema: z.ZodString;
2222
- initialValue: string;
2223
- zodClientSchema: z.ZodString;
2224
- zodValidationSchema: TValidationNext;
2225
- } & {
2226
- transforms: {
2227
- toClient: (dbValue: string) => string;
2228
- toDb: (clientValue: string) => string;
2229
- };
2230
- };
2231
- };
2232
- };
2233
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
2234
- sql: z.ZodString;
2235
- initialState: z.ZodString;
2236
- }) => TClientNext)) => {
2237
- config: {
2238
- sql: {
2239
- pk?: true;
2240
- nullable?: boolean;
2241
- default?: string;
2242
- field?: string;
2243
- type: "longtext";
2244
- };
2245
- zodSqlSchema: z.ZodString;
2246
- zodNewSchema: z.ZodString;
2247
- initialValue: string;
2248
- zodClientSchema: TClientNext;
2249
- zodValidationSchema: TClientNext;
2250
- };
2251
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
2252
- sql: z.ZodString;
2253
- initialState: z.ZodString;
2254
- client: TClientNext;
2255
- }) => TValidationNext)) => {
2256
- config: {
2257
- sql: {
2258
- pk?: true;
2259
- nullable?: boolean;
2260
- default?: string;
2261
- field?: string;
2262
- type: "longtext";
2263
- };
2264
- zodSqlSchema: z.ZodString;
2265
- zodNewSchema: z.ZodString;
2266
- initialValue: string;
2267
- zodClientSchema: TClientNext;
2268
- zodValidationSchema: TValidationNext;
2269
- };
2270
- transform: (transforms: {
2271
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
2272
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
2273
- }) => {
2274
- config: {
2275
- sql: {
2276
- pk?: true;
2277
- nullable?: boolean;
2278
- default?: string;
2279
- field?: string;
2280
- type: "longtext";
2281
- };
2282
- zodSqlSchema: z.ZodString;
2283
- zodNewSchema: z.ZodString;
2284
- initialValue: string;
2285
- zodClientSchema: TClientNext;
2286
- zodValidationSchema: TValidationNext;
2287
- } & {
2288
- transforms: {
2289
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
2290
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
2291
- };
2292
- };
2293
- };
2294
- };
2295
- transform: (transforms: {
2296
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
2297
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
2298
- }) => {
2299
- config: {
2300
- sql: {
2301
- pk?: true;
2302
- nullable?: boolean;
2303
- default?: string;
2304
- field?: string;
2305
- type: "longtext";
2306
- };
2307
- zodSqlSchema: z.ZodString;
2308
- zodNewSchema: z.ZodString;
2309
- initialValue: string;
2310
- zodClientSchema: TClientNext;
2311
- zodValidationSchema: TClientNext;
2312
- } & {
2313
- transforms: {
2314
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
2315
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
2316
- };
2317
- };
2318
- };
2319
- };
2320
- transform: (transforms: {
2321
- toClient: (dbValue: string) => string;
2322
- toDb: (clientValue: string) => string;
2323
- }) => {
2324
- config: {
2325
- sql: {
2326
- pk?: true;
2327
- nullable?: boolean;
2328
- default?: string;
2329
- field?: string;
2330
- type: "longtext";
2331
- };
2332
- zodSqlSchema: z.ZodString;
2333
- zodNewSchema: z.ZodString;
2334
- initialValue: string;
2335
- zodClientSchema: z.ZodString;
2336
- zodValidationSchema: z.ZodString;
2337
- } & {
2338
- transforms: {
2339
- toClient: (dbValue: string) => string;
2340
- toDb: (clientValue: string) => string;
2341
- };
2342
- };
2343
- };
2344
- initialState: {
2345
- <TDefaultNext>(defaultValue: () => TDefaultNext): {
2346
- config: {
2347
- sql: {
2348
- pk?: true;
2349
- nullable?: boolean;
2350
- default?: string;
2351
- field?: string;
2352
- type: "longtext";
2353
- };
2354
- zodSqlSchema: z.ZodString;
2355
- zodNewSchema: z.ZodString;
2356
- initialValue: TDefaultNext;
2357
- zodClientSchema: z.ZodString;
2358
- zodValidationSchema: z.ZodString;
2359
- };
2360
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
2361
- sql: z.ZodString;
2362
- initialState: z.ZodString;
2363
- client: z.ZodString;
2364
- }) => TValidationNext)) => {
2365
- config: {
2366
- sql: {
2367
- pk?: true;
2368
- nullable?: boolean;
2369
- default?: string;
2370
- field?: string;
2371
- type: "longtext";
2372
- };
2373
- zodSqlSchema: z.ZodString;
2374
- zodNewSchema: z.ZodString;
2375
- initialValue: TDefaultNext;
2376
- zodClientSchema: z.ZodString;
2377
- zodValidationSchema: TValidationNext;
2378
- };
2379
- transform: (transforms: {
2380
- toClient: (dbValue: string) => string;
2381
- toDb: (clientValue: string) => string;
2382
- }) => {
2383
- config: {
2384
- sql: {
2385
- pk?: true;
2386
- nullable?: boolean;
2387
- default?: string;
2388
- field?: string;
2389
- type: "longtext";
2390
- };
2391
- zodSqlSchema: z.ZodString;
2392
- zodNewSchema: z.ZodString;
2393
- initialValue: TDefaultNext;
2394
- zodClientSchema: z.ZodString;
2395
- zodValidationSchema: TValidationNext;
2396
- } & {
2397
- transforms: {
2398
- toClient: (dbValue: string) => string;
2399
- toDb: (clientValue: string) => string;
2400
- };
2401
- };
2402
- };
2403
- };
2404
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
2405
- sql: z.ZodString;
2406
- initialState: z.ZodString;
2407
- }) => TClientNext)) => {
2408
- config: {
2409
- sql: {
2410
- pk?: true;
2411
- nullable?: boolean;
2412
- default?: string;
2413
- field?: string;
2414
- type: "longtext";
2415
- };
2416
- zodSqlSchema: z.ZodString;
2417
- zodNewSchema: z.ZodString;
2418
- initialValue: TDefaultNext;
2419
- zodClientSchema: TClientNext;
2420
- zodValidationSchema: TClientNext;
2421
- };
2422
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
2423
- sql: z.ZodString;
2424
- initialState: z.ZodString;
2425
- client: TClientNext;
2426
- }) => TValidationNext)) => {
2427
- config: {
2428
- sql: {
2429
- pk?: true;
2430
- nullable?: boolean;
2431
- default?: string;
2432
- field?: string;
2433
- type: "longtext";
2434
- };
2435
- zodSqlSchema: z.ZodString;
2436
- zodNewSchema: z.ZodString;
2437
- initialValue: TDefaultNext;
2438
- zodClientSchema: TClientNext;
2439
- zodValidationSchema: TValidationNext;
2440
- };
2441
- transform: (transforms: {
2442
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
2443
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
2444
- }) => {
2445
- config: {
2446
- sql: {
2447
- pk?: true;
2448
- nullable?: boolean;
2449
- default?: string;
2450
- field?: string;
2451
- type: "longtext";
2452
- };
2453
- zodSqlSchema: z.ZodString;
2454
- zodNewSchema: z.ZodString;
2455
- initialValue: TDefaultNext;
2456
- zodClientSchema: TClientNext;
2457
- zodValidationSchema: TValidationNext;
2458
- } & {
2459
- transforms: {
2460
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
2461
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
2462
- };
2463
- };
2464
- };
2465
- };
2466
- transform: (transforms: {
2467
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
2468
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
2469
- }) => {
2470
- config: {
2471
- sql: {
2472
- pk?: true;
2473
- nullable?: boolean;
2474
- default?: string;
2475
- field?: string;
2476
- type: "longtext";
2477
- };
2478
- zodSqlSchema: z.ZodString;
2479
- zodNewSchema: z.ZodString;
2480
- initialValue: TDefaultNext;
2481
- zodClientSchema: TClientNext;
2482
- zodValidationSchema: TClientNext;
2483
- } & {
2484
- transforms: {
2485
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
2486
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
2487
- };
2488
- };
2489
- };
2490
- };
2491
- transform: (transforms: {
2492
- toClient: (dbValue: string) => string;
2493
- toDb: (clientValue: string) => string;
2494
- }) => {
2495
- config: {
2496
- sql: {
2497
- pk?: true;
2498
- nullable?: boolean;
2499
- default?: string;
2500
- field?: string;
2501
- type: "longtext";
2502
- };
2503
- zodSqlSchema: z.ZodString;
2504
- zodNewSchema: z.ZodString;
2505
- initialValue: TDefaultNext;
2506
- zodClientSchema: z.ZodString;
2507
- zodValidationSchema: z.ZodString;
2508
- } & {
2509
- transforms: {
2510
- toClient: (dbValue: string) => string;
2511
- toDb: (clientValue: string) => string;
2512
- };
2513
- };
2514
- };
2515
- };
2516
- <TNewNext extends z.ZodTypeAny, TDefaultNext>(schema: TNewNext | ((tools: {
2517
- sql: z.ZodString;
2518
- }) => TNewNext), defaultValue: () => TDefaultNext): {
2519
- config: {
2520
- sql: {
2521
- pk?: true;
2522
- nullable?: boolean;
2523
- default?: string;
2524
- field?: string;
2525
- type: "longtext";
2526
- };
2527
- zodSqlSchema: z.ZodString;
2528
- zodNewSchema: TNewNext;
2529
- initialValue: z.TypeOf<TNewNext>;
2530
- zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
2531
- zodValidationSchema: InferSmartClientType<z.ZodString, TNewNext>;
2532
- };
2533
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
2534
- sql: z.ZodString;
2535
- initialState: TNewNext;
2536
- client: InferSmartClientType<z.ZodString, TNewNext>;
2537
- }) => TValidationNext)) => {
2538
- config: {
2539
- sql: {
2540
- pk?: true;
2541
- nullable?: boolean;
2542
- default?: string;
2543
- field?: string;
2544
- type: "longtext";
2545
- };
2546
- zodSqlSchema: z.ZodString;
2547
- zodNewSchema: TNewNext;
2548
- initialValue: z.TypeOf<TNewNext>;
2549
- zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
2550
- zodValidationSchema: TValidationNext;
2551
- };
2552
- transform: (transforms: {
2553
- toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
2554
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
2555
- }) => {
2556
- config: {
2557
- sql: {
2558
- pk?: true;
2559
- nullable?: boolean;
2560
- default?: string;
2561
- field?: string;
2562
- type: "longtext";
2563
- };
2564
- zodSqlSchema: z.ZodString;
2565
- zodNewSchema: TNewNext;
2566
- initialValue: z.TypeOf<TNewNext>;
2567
- zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
2568
- zodValidationSchema: TValidationNext;
2569
- } & {
2570
- transforms: {
2571
- toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
2572
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
2573
- };
2574
- };
2575
- };
2576
- };
2577
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
2578
- sql: z.ZodString;
2579
- initialState: TNewNext;
2580
- }) => TClientNext)) => {
2581
- config: {
2582
- sql: {
2583
- pk?: true;
2584
- nullable?: boolean;
2585
- default?: string;
2586
- field?: string;
2587
- type: "longtext";
2588
- };
2589
- zodSqlSchema: z.ZodString;
2590
- zodNewSchema: TNewNext;
2591
- initialValue: z.TypeOf<TNewNext>;
2592
- zodClientSchema: TClientNext;
2593
- zodValidationSchema: TClientNext;
2594
- };
2595
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
2596
- sql: z.ZodString;
2597
- initialState: TNewNext;
2598
- client: TClientNext;
2599
- }) => TValidationNext)) => {
2600
- config: {
2601
- sql: {
2602
- pk?: true;
2603
- nullable?: boolean;
2604
- default?: string;
2605
- field?: string;
2606
- type: "longtext";
2607
- };
2608
- zodSqlSchema: z.ZodString;
2609
- zodNewSchema: TNewNext;
2610
- initialValue: z.TypeOf<TNewNext>;
2611
- zodClientSchema: TClientNext;
2612
- zodValidationSchema: TValidationNext;
2613
- };
2614
- transform: (transforms: {
2615
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
2616
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
2617
- }) => {
2618
- config: {
2619
- sql: {
2620
- pk?: true;
2621
- nullable?: boolean;
2622
- default?: string;
2623
- field?: string;
2624
- type: "longtext";
2625
- };
2626
- zodSqlSchema: z.ZodString;
2627
- zodNewSchema: TNewNext;
2628
- initialValue: z.TypeOf<TNewNext>;
2629
- zodClientSchema: TClientNext;
2630
- zodValidationSchema: TValidationNext;
2631
- } & {
2632
- transforms: {
2633
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
2634
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
2635
- };
2636
- };
2637
- };
2638
- };
2639
- transform: (transforms: {
2640
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
2641
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
2642
- }) => {
2643
- config: {
2644
- sql: {
2645
- pk?: true;
2646
- nullable?: boolean;
2647
- default?: string;
2648
- field?: string;
2649
- type: "longtext";
2650
- };
2651
- zodSqlSchema: z.ZodString;
2652
- zodNewSchema: TNewNext;
2653
- initialValue: z.TypeOf<TNewNext>;
2654
- zodClientSchema: TClientNext;
2655
- zodValidationSchema: TClientNext;
2656
- } & {
2657
- transforms: {
2658
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
2659
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
2660
- };
2661
- };
2662
- };
2663
- };
2664
- transform: (transforms: {
2665
- toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
2666
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
2667
- }) => {
2668
- config: {
2669
- sql: {
2670
- pk?: true;
2671
- nullable?: boolean;
2672
- default?: string;
2673
- field?: string;
2674
- type: "longtext";
2675
- };
2676
- zodSqlSchema: z.ZodString;
2677
- zodNewSchema: TNewNext;
2678
- initialValue: z.TypeOf<TNewNext>;
2679
- zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
2680
- zodValidationSchema: InferSmartClientType<z.ZodString, TNewNext>;
2681
- } & {
2682
- transforms: {
2683
- toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
2684
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
2685
- };
2686
- };
2687
- };
2688
- };
2689
- };
2690
- };
2691
- boolean: (config?: BooleanConfig) => {
2692
- config: {
2693
- sql: {
2694
- nullable?: boolean;
2695
- pk?: true;
2696
- field?: string;
2697
- default?: boolean;
2698
- type: "boolean";
2699
- };
2700
- zodSqlSchema: z.ZodBoolean;
2701
- zodNewSchema: z.ZodBoolean;
2702
- initialValue: boolean;
2703
- zodClientSchema: z.ZodBoolean;
2704
- zodValidationSchema: z.ZodBoolean;
2705
- };
2706
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
2707
- sql: z.ZodBoolean;
2708
- initialState: z.ZodBoolean;
2709
- client: z.ZodBoolean;
2710
- }) => TValidationNext)) => {
2711
- config: {
2712
- sql: {
2713
- nullable?: boolean;
2714
- pk?: true;
2715
- field?: string;
2716
- default?: boolean;
2717
- type: "boolean";
2718
- };
2719
- zodSqlSchema: z.ZodBoolean;
2720
- zodNewSchema: z.ZodBoolean;
2721
- initialValue: boolean;
2722
- zodClientSchema: z.ZodBoolean;
2723
- zodValidationSchema: TValidationNext;
2724
- };
2725
- transform: (transforms: {
2726
- toClient: (dbValue: boolean) => boolean;
2727
- toDb: (clientValue: boolean) => boolean;
2728
- }) => {
2729
- config: {
2730
- sql: {
2731
- nullable?: boolean;
2732
- pk?: true;
2733
- field?: string;
2734
- default?: boolean;
2735
- type: "boolean";
2736
- };
2737
- zodSqlSchema: z.ZodBoolean;
2738
- zodNewSchema: z.ZodBoolean;
2739
- initialValue: boolean;
2740
- zodClientSchema: z.ZodBoolean;
2741
- zodValidationSchema: TValidationNext;
2742
- } & {
2743
- transforms: {
2744
- toClient: (dbValue: boolean) => boolean;
2745
- toDb: (clientValue: boolean) => boolean;
2746
- };
2747
- };
2748
- };
2749
- };
2750
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
2751
- sql: z.ZodBoolean;
2752
- initialState: z.ZodBoolean;
2753
- }) => TClientNext)) => {
2754
- config: {
2755
- sql: {
2756
- nullable?: boolean;
2757
- pk?: true;
2758
- field?: string;
2759
- default?: boolean;
2760
- type: "boolean";
2761
- };
2762
- zodSqlSchema: z.ZodBoolean;
2763
- zodNewSchema: z.ZodBoolean;
2764
- initialValue: boolean;
2765
- zodClientSchema: TClientNext;
2766
- zodValidationSchema: TClientNext;
2767
- };
2768
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
2769
- sql: z.ZodBoolean;
2770
- initialState: z.ZodBoolean;
2771
- client: TClientNext;
2772
- }) => TValidationNext)) => {
2773
- config: {
2774
- sql: {
2775
- nullable?: boolean;
2776
- pk?: true;
2777
- field?: string;
2778
- default?: boolean;
2779
- type: "boolean";
2780
- };
2781
- zodSqlSchema: z.ZodBoolean;
2782
- zodNewSchema: z.ZodBoolean;
2783
- initialValue: boolean;
2784
- zodClientSchema: TClientNext;
2785
- zodValidationSchema: TValidationNext;
2786
- };
2787
- transform: (transforms: {
2788
- toClient: (dbValue: boolean) => z.TypeOf<TClientNext>;
2789
- toDb: (clientValue: z.TypeOf<TClientNext>) => boolean;
2790
- }) => {
2791
- config: {
2792
- sql: {
2793
- nullable?: boolean;
2794
- pk?: true;
2795
- field?: string;
2796
- default?: boolean;
2797
- type: "boolean";
2798
- };
2799
- zodSqlSchema: z.ZodBoolean;
2800
- zodNewSchema: z.ZodBoolean;
2801
- initialValue: boolean;
2802
- zodClientSchema: TClientNext;
2803
- zodValidationSchema: TValidationNext;
2804
- } & {
2805
- transforms: {
2806
- toClient: (dbValue: boolean) => z.TypeOf<TClientNext>;
2807
- toDb: (clientValue: z.TypeOf<TClientNext>) => boolean;
2808
- };
2809
- };
2810
- };
2811
- };
2812
- transform: (transforms: {
2813
- toClient: (dbValue: boolean) => z.TypeOf<TClientNext>;
2814
- toDb: (clientValue: z.TypeOf<TClientNext>) => boolean;
2815
- }) => {
2816
- config: {
2817
- sql: {
2818
- nullable?: boolean;
2819
- pk?: true;
2820
- field?: string;
2821
- default?: boolean;
2822
- type: "boolean";
2823
- };
2824
- zodSqlSchema: z.ZodBoolean;
2825
- zodNewSchema: z.ZodBoolean;
2826
- initialValue: boolean;
2827
- zodClientSchema: TClientNext;
2828
- zodValidationSchema: TClientNext;
2829
- } & {
2830
- transforms: {
2831
- toClient: (dbValue: boolean) => z.TypeOf<TClientNext>;
2832
- toDb: (clientValue: z.TypeOf<TClientNext>) => boolean;
2833
- };
2834
- };
2835
- };
2836
- };
2837
- transform: (transforms: {
2838
- toClient: (dbValue: boolean) => boolean;
2839
- toDb: (clientValue: boolean) => boolean;
2840
- }) => {
2841
- config: {
2842
- sql: {
2843
- nullable?: boolean;
2844
- pk?: true;
2845
- field?: string;
2846
- default?: boolean;
2847
- type: "boolean";
2848
- };
2849
- zodSqlSchema: z.ZodBoolean;
2850
- zodNewSchema: z.ZodBoolean;
2851
- initialValue: boolean;
2852
- zodClientSchema: z.ZodBoolean;
2853
- zodValidationSchema: z.ZodBoolean;
2854
- } & {
2855
- transforms: {
2856
- toClient: (dbValue: boolean) => boolean;
2857
- toDb: (clientValue: boolean) => boolean;
2858
- };
2859
- };
2860
- };
2861
- initialState: {
2862
- <TDefaultNext>(defaultValue: () => TDefaultNext): {
2863
- config: {
2864
- sql: {
2865
- nullable?: boolean;
2866
- pk?: true;
2867
- field?: string;
2868
- default?: boolean;
2869
- type: "boolean";
2870
- };
2871
- zodSqlSchema: z.ZodBoolean;
2872
- zodNewSchema: z.ZodBoolean;
2873
- initialValue: TDefaultNext;
2874
- zodClientSchema: z.ZodBoolean;
2875
- zodValidationSchema: z.ZodBoolean;
2876
- };
2877
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
2878
- sql: z.ZodBoolean;
2879
- initialState: z.ZodBoolean;
2880
- client: z.ZodBoolean;
2881
- }) => TValidationNext)) => {
2882
- config: {
2883
- sql: {
2884
- nullable?: boolean;
2885
- pk?: true;
2886
- field?: string;
2887
- default?: boolean;
2888
- type: "boolean";
2889
- };
2890
- zodSqlSchema: z.ZodBoolean;
2891
- zodNewSchema: z.ZodBoolean;
2892
- initialValue: TDefaultNext;
2893
- zodClientSchema: z.ZodBoolean;
2894
- zodValidationSchema: TValidationNext;
2895
- };
2896
- transform: (transforms: {
2897
- toClient: (dbValue: boolean) => boolean;
2898
- toDb: (clientValue: boolean) => boolean;
2899
- }) => {
2900
- config: {
2901
- sql: {
2902
- nullable?: boolean;
2903
- pk?: true;
2904
- field?: string;
2905
- default?: boolean;
2906
- type: "boolean";
2907
- };
2908
- zodSqlSchema: z.ZodBoolean;
2909
- zodNewSchema: z.ZodBoolean;
2910
- initialValue: TDefaultNext;
2911
- zodClientSchema: z.ZodBoolean;
2912
- zodValidationSchema: TValidationNext;
2913
- } & {
2914
- transforms: {
2915
- toClient: (dbValue: boolean) => boolean;
2916
- toDb: (clientValue: boolean) => boolean;
2917
- };
2918
- };
2919
- };
2920
- };
2921
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
2922
- sql: z.ZodBoolean;
2923
- initialState: z.ZodBoolean;
2924
- }) => TClientNext)) => {
2925
- config: {
2926
- sql: {
2927
- nullable?: boolean;
2928
- pk?: true;
2929
- field?: string;
2930
- default?: boolean;
2931
- type: "boolean";
2932
- };
2933
- zodSqlSchema: z.ZodBoolean;
2934
- zodNewSchema: z.ZodBoolean;
2935
- initialValue: TDefaultNext;
2936
- zodClientSchema: TClientNext;
2937
- zodValidationSchema: TClientNext;
2938
- };
2939
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
2940
- sql: z.ZodBoolean;
2941
- initialState: z.ZodBoolean;
2942
- client: TClientNext;
2943
- }) => TValidationNext)) => {
2944
- config: {
2945
- sql: {
2946
- nullable?: boolean;
2947
- pk?: true;
2948
- field?: string;
2949
- default?: boolean;
2950
- type: "boolean";
2951
- };
2952
- zodSqlSchema: z.ZodBoolean;
2953
- zodNewSchema: z.ZodBoolean;
2954
- initialValue: TDefaultNext;
2955
- zodClientSchema: TClientNext;
2956
- zodValidationSchema: TValidationNext;
2957
- };
2958
- transform: (transforms: {
2959
- toClient: (dbValue: boolean) => z.TypeOf<TClientNext>;
2960
- toDb: (clientValue: z.TypeOf<TClientNext>) => boolean;
2961
- }) => {
2962
- config: {
2963
- sql: {
2964
- nullable?: boolean;
2965
- pk?: true;
2966
- field?: string;
2967
- default?: boolean;
2968
- type: "boolean";
2969
- };
2970
- zodSqlSchema: z.ZodBoolean;
2971
- zodNewSchema: z.ZodBoolean;
2972
- initialValue: TDefaultNext;
2973
- zodClientSchema: TClientNext;
2974
- zodValidationSchema: TValidationNext;
2975
- } & {
2976
- transforms: {
2977
- toClient: (dbValue: boolean) => z.TypeOf<TClientNext>;
2978
- toDb: (clientValue: z.TypeOf<TClientNext>) => boolean;
2979
- };
2980
- };
2981
- };
2982
- };
2983
- transform: (transforms: {
2984
- toClient: (dbValue: boolean) => z.TypeOf<TClientNext>;
2985
- toDb: (clientValue: z.TypeOf<TClientNext>) => boolean;
2986
- }) => {
2987
- config: {
2988
- sql: {
2989
- nullable?: boolean;
2990
- pk?: true;
2991
- field?: string;
2992
- default?: boolean;
2993
- type: "boolean";
2994
- };
2995
- zodSqlSchema: z.ZodBoolean;
2996
- zodNewSchema: z.ZodBoolean;
2997
- initialValue: TDefaultNext;
2998
- zodClientSchema: TClientNext;
2999
- zodValidationSchema: TClientNext;
3000
- } & {
3001
- transforms: {
3002
- toClient: (dbValue: boolean) => z.TypeOf<TClientNext>;
3003
- toDb: (clientValue: z.TypeOf<TClientNext>) => boolean;
3004
- };
3005
- };
3006
- };
3007
- };
3008
- transform: (transforms: {
3009
- toClient: (dbValue: boolean) => boolean;
3010
- toDb: (clientValue: boolean) => boolean;
3011
- }) => {
3012
- config: {
3013
- sql: {
3014
- nullable?: boolean;
3015
- pk?: true;
3016
- field?: string;
3017
- default?: boolean;
3018
- type: "boolean";
3019
- };
3020
- zodSqlSchema: z.ZodBoolean;
3021
- zodNewSchema: z.ZodBoolean;
3022
- initialValue: TDefaultNext;
3023
- zodClientSchema: z.ZodBoolean;
3024
- zodValidationSchema: z.ZodBoolean;
3025
- } & {
3026
- transforms: {
3027
- toClient: (dbValue: boolean) => boolean;
3028
- toDb: (clientValue: boolean) => boolean;
3029
- };
3030
- };
3031
- };
3032
- };
3033
- <TNewNext extends z.ZodTypeAny, TDefaultNext>(schema: TNewNext | ((tools: {
3034
- sql: z.ZodBoolean;
3035
- }) => TNewNext), defaultValue: () => TDefaultNext): {
3036
- config: {
3037
- sql: {
3038
- nullable?: boolean;
3039
- pk?: true;
3040
- field?: string;
3041
- default?: boolean;
3042
- type: "boolean";
3043
- };
3044
- zodSqlSchema: z.ZodBoolean;
3045
- zodNewSchema: TNewNext;
3046
- initialValue: z.TypeOf<TNewNext>;
3047
- zodClientSchema: InferSmartClientType<z.ZodBoolean, TNewNext>;
3048
- zodValidationSchema: InferSmartClientType<z.ZodBoolean, TNewNext>;
3049
- };
3050
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
3051
- sql: z.ZodBoolean;
3052
- initialState: TNewNext;
3053
- client: InferSmartClientType<z.ZodBoolean, TNewNext>;
3054
- }) => TValidationNext)) => {
3055
- config: {
3056
- sql: {
3057
- nullable?: boolean;
3058
- pk?: true;
3059
- field?: string;
3060
- default?: boolean;
3061
- type: "boolean";
3062
- };
3063
- zodSqlSchema: z.ZodBoolean;
3064
- zodNewSchema: TNewNext;
3065
- initialValue: z.TypeOf<TNewNext>;
3066
- zodClientSchema: InferSmartClientType<z.ZodBoolean, TNewNext>;
3067
- zodValidationSchema: TValidationNext;
3068
- };
3069
- transform: (transforms: {
3070
- toClient: (dbValue: boolean) => z.TypeOf<InferSmartClientType<z.ZodBoolean, TNewNext>>;
3071
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodBoolean, TNewNext>>) => boolean;
3072
- }) => {
3073
- config: {
3074
- sql: {
3075
- nullable?: boolean;
3076
- pk?: true;
3077
- field?: string;
3078
- default?: boolean;
3079
- type: "boolean";
3080
- };
3081
- zodSqlSchema: z.ZodBoolean;
3082
- zodNewSchema: TNewNext;
3083
- initialValue: z.TypeOf<TNewNext>;
3084
- zodClientSchema: InferSmartClientType<z.ZodBoolean, TNewNext>;
3085
- zodValidationSchema: TValidationNext;
3086
- } & {
3087
- transforms: {
3088
- toClient: (dbValue: boolean) => z.TypeOf<InferSmartClientType<z.ZodBoolean, TNewNext>>;
3089
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodBoolean, TNewNext>>) => boolean;
3090
- };
3091
- };
3092
- };
3093
- };
3094
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
3095
- sql: z.ZodBoolean;
3096
- initialState: TNewNext;
3097
- }) => TClientNext)) => {
3098
- config: {
3099
- sql: {
3100
- nullable?: boolean;
3101
- pk?: true;
3102
- field?: string;
3103
- default?: boolean;
3104
- type: "boolean";
3105
- };
3106
- zodSqlSchema: z.ZodBoolean;
3107
- zodNewSchema: TNewNext;
3108
- initialValue: z.TypeOf<TNewNext>;
3109
- zodClientSchema: TClientNext;
3110
- zodValidationSchema: TClientNext;
3111
- };
3112
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
3113
- sql: z.ZodBoolean;
3114
- initialState: TNewNext;
3115
- client: TClientNext;
3116
- }) => TValidationNext)) => {
3117
- config: {
3118
- sql: {
3119
- nullable?: boolean;
3120
- pk?: true;
3121
- field?: string;
3122
- default?: boolean;
3123
- type: "boolean";
3124
- };
3125
- zodSqlSchema: z.ZodBoolean;
3126
- zodNewSchema: TNewNext;
3127
- initialValue: z.TypeOf<TNewNext>;
3128
- zodClientSchema: TClientNext;
3129
- zodValidationSchema: TValidationNext;
3130
- };
3131
- transform: (transforms: {
3132
- toClient: (dbValue: boolean) => z.TypeOf<TClientNext>;
3133
- toDb: (clientValue: z.TypeOf<TClientNext>) => boolean;
3134
- }) => {
3135
- config: {
3136
- sql: {
3137
- nullable?: boolean;
3138
- pk?: true;
3139
- field?: string;
3140
- default?: boolean;
3141
- type: "boolean";
3142
- };
3143
- zodSqlSchema: z.ZodBoolean;
3144
- zodNewSchema: TNewNext;
3145
- initialValue: z.TypeOf<TNewNext>;
3146
- zodClientSchema: TClientNext;
3147
- zodValidationSchema: TValidationNext;
3148
- } & {
3149
- transforms: {
3150
- toClient: (dbValue: boolean) => z.TypeOf<TClientNext>;
3151
- toDb: (clientValue: z.TypeOf<TClientNext>) => boolean;
3152
- };
3153
- };
3154
- };
3155
- };
3156
- transform: (transforms: {
3157
- toClient: (dbValue: boolean) => z.TypeOf<TClientNext>;
3158
- toDb: (clientValue: z.TypeOf<TClientNext>) => boolean;
3159
- }) => {
3160
- config: {
3161
- sql: {
3162
- nullable?: boolean;
3163
- pk?: true;
3164
- field?: string;
3165
- default?: boolean;
3166
- type: "boolean";
3167
- };
3168
- zodSqlSchema: z.ZodBoolean;
3169
- zodNewSchema: TNewNext;
3170
- initialValue: z.TypeOf<TNewNext>;
3171
- zodClientSchema: TClientNext;
3172
- zodValidationSchema: TClientNext;
3173
- } & {
3174
- transforms: {
3175
- toClient: (dbValue: boolean) => z.TypeOf<TClientNext>;
3176
- toDb: (clientValue: z.TypeOf<TClientNext>) => boolean;
3177
- };
3178
- };
3179
- };
3180
- };
3181
- transform: (transforms: {
3182
- toClient: (dbValue: boolean) => z.TypeOf<InferSmartClientType<z.ZodBoolean, TNewNext>>;
3183
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodBoolean, TNewNext>>) => boolean;
3184
- }) => {
3185
- config: {
3186
- sql: {
3187
- nullable?: boolean;
3188
- pk?: true;
3189
- field?: string;
3190
- default?: boolean;
3191
- type: "boolean";
3192
- };
3193
- zodSqlSchema: z.ZodBoolean;
3194
- zodNewSchema: TNewNext;
3195
- initialValue: z.TypeOf<TNewNext>;
3196
- zodClientSchema: InferSmartClientType<z.ZodBoolean, TNewNext>;
3197
- zodValidationSchema: InferSmartClientType<z.ZodBoolean, TNewNext>;
3198
- } & {
3199
- transforms: {
3200
- toClient: (dbValue: boolean) => z.TypeOf<InferSmartClientType<z.ZodBoolean, TNewNext>>;
3201
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodBoolean, TNewNext>>) => boolean;
3202
- };
3203
- };
3204
- };
3205
- };
3206
- };
3207
- };
3208
- date: (config?: Omit<DateConfig, "type">) => {
3209
- config: {
3210
- sql: {
3211
- pk?: true;
3212
- nullable?: boolean;
3213
- default?: Date;
3214
- field?: string;
3215
- type: "date";
3216
- };
3217
- zodSqlSchema: z.ZodDate;
3218
- zodNewSchema: z.ZodDate;
3219
- initialValue: Date;
3220
- zodClientSchema: z.ZodDate;
3221
- zodValidationSchema: z.ZodDate;
3222
- };
3223
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
3224
- sql: z.ZodDate;
3225
- initialState: z.ZodDate;
3226
- client: z.ZodDate;
3227
- }) => TValidationNext)) => {
3228
- config: {
3229
- sql: {
3230
- pk?: true;
3231
- nullable?: boolean;
3232
- default?: Date;
3233
- field?: string;
3234
- type: "date";
3235
- };
3236
- zodSqlSchema: z.ZodDate;
3237
- zodNewSchema: z.ZodDate;
3238
- initialValue: Date;
3239
- zodClientSchema: z.ZodDate;
3240
- zodValidationSchema: TValidationNext;
3241
- };
3242
- transform: (transforms: {
3243
- toClient: (dbValue: Date) => Date;
3244
- toDb: (clientValue: Date) => Date;
3245
- }) => {
3246
- config: {
3247
- sql: {
3248
- pk?: true;
3249
- nullable?: boolean;
3250
- default?: Date;
3251
- field?: string;
3252
- type: "date";
3253
- };
3254
- zodSqlSchema: z.ZodDate;
3255
- zodNewSchema: z.ZodDate;
3256
- initialValue: Date;
3257
- zodClientSchema: z.ZodDate;
3258
- zodValidationSchema: TValidationNext;
3259
- } & {
3260
- transforms: {
3261
- toClient: (dbValue: Date) => Date;
3262
- toDb: (clientValue: Date) => Date;
3263
- };
3264
- };
3265
- };
3266
- };
3267
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
3268
- sql: z.ZodDate;
3269
- initialState: z.ZodDate;
3270
- }) => TClientNext)) => {
3271
- config: {
3272
- sql: {
3273
- pk?: true;
3274
- nullable?: boolean;
3275
- default?: Date;
3276
- field?: string;
3277
- type: "date";
3278
- };
3279
- zodSqlSchema: z.ZodDate;
3280
- zodNewSchema: z.ZodDate;
3281
- initialValue: Date;
3282
- zodClientSchema: TClientNext;
3283
- zodValidationSchema: TClientNext;
3284
- };
3285
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
3286
- sql: z.ZodDate;
3287
- initialState: z.ZodDate;
3288
- client: TClientNext;
3289
- }) => TValidationNext)) => {
3290
- config: {
3291
- sql: {
3292
- pk?: true;
3293
- nullable?: boolean;
3294
- default?: Date;
3295
- field?: string;
3296
- type: "date";
3297
- };
3298
- zodSqlSchema: z.ZodDate;
3299
- zodNewSchema: z.ZodDate;
3300
- initialValue: Date;
3301
- zodClientSchema: TClientNext;
3302
- zodValidationSchema: TValidationNext;
3303
- };
3304
- transform: (transforms: {
3305
- toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
3306
- toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
3307
- }) => {
3308
- config: {
3309
- sql: {
3310
- pk?: true;
3311
- nullable?: boolean;
3312
- default?: Date;
3313
- field?: string;
3314
- type: "date";
3315
- };
3316
- zodSqlSchema: z.ZodDate;
3317
- zodNewSchema: z.ZodDate;
3318
- initialValue: Date;
3319
- zodClientSchema: TClientNext;
3320
- zodValidationSchema: TValidationNext;
3321
- } & {
3322
- transforms: {
3323
- toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
3324
- toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
3325
- };
3326
- };
3327
- };
3328
- };
3329
- transform: (transforms: {
3330
- toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
3331
- toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
3332
- }) => {
3333
- config: {
3334
- sql: {
3335
- pk?: true;
3336
- nullable?: boolean;
3337
- default?: Date;
3338
- field?: string;
3339
- type: "date";
3340
- };
3341
- zodSqlSchema: z.ZodDate;
3342
- zodNewSchema: z.ZodDate;
3343
- initialValue: Date;
3344
- zodClientSchema: TClientNext;
3345
- zodValidationSchema: TClientNext;
3346
- } & {
3347
- transforms: {
3348
- toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
3349
- toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
3350
- };
3351
- };
3352
- };
3353
- };
3354
- transform: (transforms: {
3355
- toClient: (dbValue: Date) => Date;
3356
- toDb: (clientValue: Date) => Date;
3357
- }) => {
3358
- config: {
3359
- sql: {
3360
- pk?: true;
3361
- nullable?: boolean;
3362
- default?: Date;
3363
- field?: string;
3364
- type: "date";
3365
- };
3366
- zodSqlSchema: z.ZodDate;
3367
- zodNewSchema: z.ZodDate;
3368
- initialValue: Date;
3369
- zodClientSchema: z.ZodDate;
3370
- zodValidationSchema: z.ZodDate;
3371
- } & {
3372
- transforms: {
3373
- toClient: (dbValue: Date) => Date;
3374
- toDb: (clientValue: Date) => Date;
3375
- };
3376
- };
3377
- };
3378
- initialState: {
3379
- <TDefaultNext>(defaultValue: () => TDefaultNext): {
3380
- config: {
3381
- sql: {
3382
- pk?: true;
3383
- nullable?: boolean;
3384
- default?: Date;
3385
- field?: string;
3386
- type: "date";
3387
- };
3388
- zodSqlSchema: z.ZodDate;
3389
- zodNewSchema: z.ZodDate;
3390
- initialValue: TDefaultNext;
3391
- zodClientSchema: z.ZodDate;
3392
- zodValidationSchema: z.ZodDate;
3393
- };
3394
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
3395
- sql: z.ZodDate;
3396
- initialState: z.ZodDate;
3397
- client: z.ZodDate;
3398
- }) => TValidationNext)) => {
3399
- config: {
3400
- sql: {
3401
- pk?: true;
3402
- nullable?: boolean;
3403
- default?: Date;
3404
- field?: string;
3405
- type: "date";
3406
- };
3407
- zodSqlSchema: z.ZodDate;
3408
- zodNewSchema: z.ZodDate;
3409
- initialValue: TDefaultNext;
3410
- zodClientSchema: z.ZodDate;
3411
- zodValidationSchema: TValidationNext;
3412
- };
3413
- transform: (transforms: {
3414
- toClient: (dbValue: Date) => Date;
3415
- toDb: (clientValue: Date) => Date;
3416
- }) => {
3417
- config: {
3418
- sql: {
3419
- pk?: true;
3420
- nullable?: boolean;
3421
- default?: Date;
3422
- field?: string;
3423
- type: "date";
3424
- };
3425
- zodSqlSchema: z.ZodDate;
3426
- zodNewSchema: z.ZodDate;
3427
- initialValue: TDefaultNext;
3428
- zodClientSchema: z.ZodDate;
3429
- zodValidationSchema: TValidationNext;
3430
- } & {
3431
- transforms: {
3432
- toClient: (dbValue: Date) => Date;
3433
- toDb: (clientValue: Date) => Date;
3434
- };
3435
- };
3436
- };
3437
- };
3438
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
3439
- sql: z.ZodDate;
3440
- initialState: z.ZodDate;
3441
- }) => TClientNext)) => {
3442
- config: {
3443
- sql: {
3444
- pk?: true;
3445
- nullable?: boolean;
3446
- default?: Date;
3447
- field?: string;
3448
- type: "date";
3449
- };
3450
- zodSqlSchema: z.ZodDate;
3451
- zodNewSchema: z.ZodDate;
3452
- initialValue: TDefaultNext;
3453
- zodClientSchema: TClientNext;
3454
- zodValidationSchema: TClientNext;
3455
- };
3456
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
3457
- sql: z.ZodDate;
3458
- initialState: z.ZodDate;
3459
- client: TClientNext;
3460
- }) => TValidationNext)) => {
3461
- config: {
3462
- sql: {
3463
- pk?: true;
3464
- nullable?: boolean;
3465
- default?: Date;
3466
- field?: string;
3467
- type: "date";
3468
- };
3469
- zodSqlSchema: z.ZodDate;
3470
- zodNewSchema: z.ZodDate;
3471
- initialValue: TDefaultNext;
3472
- zodClientSchema: TClientNext;
3473
- zodValidationSchema: TValidationNext;
3474
- };
3475
- transform: (transforms: {
3476
- toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
3477
- toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
3478
- }) => {
3479
- config: {
3480
- sql: {
3481
- pk?: true;
3482
- nullable?: boolean;
3483
- default?: Date;
3484
- field?: string;
3485
- type: "date";
3486
- };
3487
- zodSqlSchema: z.ZodDate;
3488
- zodNewSchema: z.ZodDate;
3489
- initialValue: TDefaultNext;
3490
- zodClientSchema: TClientNext;
3491
- zodValidationSchema: TValidationNext;
3492
- } & {
3493
- transforms: {
3494
- toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
3495
- toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
3496
- };
3497
- };
3498
- };
3499
- };
3500
- transform: (transforms: {
3501
- toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
3502
- toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
3503
- }) => {
3504
- config: {
3505
- sql: {
3506
- pk?: true;
3507
- nullable?: boolean;
3508
- default?: Date;
3509
- field?: string;
3510
- type: "date";
3511
- };
3512
- zodSqlSchema: z.ZodDate;
3513
- zodNewSchema: z.ZodDate;
3514
- initialValue: TDefaultNext;
3515
- zodClientSchema: TClientNext;
3516
- zodValidationSchema: TClientNext;
3517
- } & {
3518
- transforms: {
3519
- toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
3520
- toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
3521
- };
3522
- };
3523
- };
3524
- };
3525
- transform: (transforms: {
3526
- toClient: (dbValue: Date) => Date;
3527
- toDb: (clientValue: Date) => Date;
3528
- }) => {
3529
- config: {
3530
- sql: {
3531
- pk?: true;
3532
- nullable?: boolean;
3533
- default?: Date;
3534
- field?: string;
3535
- type: "date";
3536
- };
3537
- zodSqlSchema: z.ZodDate;
3538
- zodNewSchema: z.ZodDate;
3539
- initialValue: TDefaultNext;
3540
- zodClientSchema: z.ZodDate;
3541
- zodValidationSchema: z.ZodDate;
3542
- } & {
3543
- transforms: {
3544
- toClient: (dbValue: Date) => Date;
3545
- toDb: (clientValue: Date) => Date;
3546
- };
3547
- };
3548
- };
3549
- };
3550
- <TNewNext extends z.ZodTypeAny, TDefaultNext>(schema: TNewNext | ((tools: {
3551
- sql: z.ZodDate;
3552
- }) => TNewNext), defaultValue: () => TDefaultNext): {
3553
- config: {
3554
- sql: {
3555
- pk?: true;
3556
- nullable?: boolean;
3557
- default?: Date;
3558
- field?: string;
3559
- type: "date";
3560
- };
3561
- zodSqlSchema: z.ZodDate;
3562
- zodNewSchema: TNewNext;
3563
- initialValue: z.TypeOf<TNewNext>;
3564
- zodClientSchema: InferSmartClientType<z.ZodDate, TNewNext>;
3565
- zodValidationSchema: InferSmartClientType<z.ZodDate, TNewNext>;
3566
- };
3567
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
3568
- sql: z.ZodDate;
3569
- initialState: TNewNext;
3570
- client: InferSmartClientType<z.ZodDate, TNewNext>;
3571
- }) => TValidationNext)) => {
3572
- config: {
3573
- sql: {
3574
- pk?: true;
3575
- nullable?: boolean;
3576
- default?: Date;
3577
- field?: string;
3578
- type: "date";
3579
- };
3580
- zodSqlSchema: z.ZodDate;
3581
- zodNewSchema: TNewNext;
3582
- initialValue: z.TypeOf<TNewNext>;
3583
- zodClientSchema: InferSmartClientType<z.ZodDate, TNewNext>;
3584
- zodValidationSchema: TValidationNext;
3585
- };
3586
- transform: (transforms: {
3587
- toClient: (dbValue: Date) => z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>;
3588
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>) => Date;
3589
- }) => {
3590
- config: {
3591
- sql: {
3592
- pk?: true;
3593
- nullable?: boolean;
3594
- default?: Date;
3595
- field?: string;
3596
- type: "date";
3597
- };
3598
- zodSqlSchema: z.ZodDate;
3599
- zodNewSchema: TNewNext;
3600
- initialValue: z.TypeOf<TNewNext>;
3601
- zodClientSchema: InferSmartClientType<z.ZodDate, TNewNext>;
3602
- zodValidationSchema: TValidationNext;
3603
- } & {
3604
- transforms: {
3605
- toClient: (dbValue: Date) => z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>;
3606
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>) => Date;
3607
- };
3608
- };
3609
- };
3610
- };
3611
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
3612
- sql: z.ZodDate;
3613
- initialState: TNewNext;
3614
- }) => TClientNext)) => {
3615
- config: {
3616
- sql: {
3617
- pk?: true;
3618
- nullable?: boolean;
3619
- default?: Date;
3620
- field?: string;
3621
- type: "date";
3622
- };
3623
- zodSqlSchema: z.ZodDate;
3624
- zodNewSchema: TNewNext;
3625
- initialValue: z.TypeOf<TNewNext>;
3626
- zodClientSchema: TClientNext;
3627
- zodValidationSchema: TClientNext;
3628
- };
3629
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
3630
- sql: z.ZodDate;
3631
- initialState: TNewNext;
3632
- client: TClientNext;
3633
- }) => TValidationNext)) => {
3634
- config: {
3635
- sql: {
3636
- pk?: true;
3637
- nullable?: boolean;
3638
- default?: Date;
3639
- field?: string;
3640
- type: "date";
3641
- };
3642
- zodSqlSchema: z.ZodDate;
3643
- zodNewSchema: TNewNext;
3644
- initialValue: z.TypeOf<TNewNext>;
3645
- zodClientSchema: TClientNext;
3646
- zodValidationSchema: TValidationNext;
3647
- };
3648
- transform: (transforms: {
3649
- toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
3650
- toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
3651
- }) => {
3652
- config: {
3653
- sql: {
3654
- pk?: true;
3655
- nullable?: boolean;
3656
- default?: Date;
3657
- field?: string;
3658
- type: "date";
3659
- };
3660
- zodSqlSchema: z.ZodDate;
3661
- zodNewSchema: TNewNext;
3662
- initialValue: z.TypeOf<TNewNext>;
3663
- zodClientSchema: TClientNext;
3664
- zodValidationSchema: TValidationNext;
3665
- } & {
3666
- transforms: {
3667
- toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
3668
- toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
3669
- };
3670
- };
3671
- };
3672
- };
3673
- transform: (transforms: {
3674
- toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
3675
- toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
3676
- }) => {
3677
- config: {
3678
- sql: {
3679
- pk?: true;
3680
- nullable?: boolean;
3681
- default?: Date;
3682
- field?: string;
3683
- type: "date";
3684
- };
3685
- zodSqlSchema: z.ZodDate;
3686
- zodNewSchema: TNewNext;
3687
- initialValue: z.TypeOf<TNewNext>;
3688
- zodClientSchema: TClientNext;
3689
- zodValidationSchema: TClientNext;
3690
- } & {
3691
- transforms: {
3692
- toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
3693
- toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
3694
- };
3695
- };
3696
- };
3697
- };
3698
- transform: (transforms: {
3699
- toClient: (dbValue: Date) => z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>;
3700
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>) => Date;
3701
- }) => {
3702
- config: {
3703
- sql: {
3704
- pk?: true;
3705
- nullable?: boolean;
3706
- default?: Date;
3707
- field?: string;
3708
- type: "date";
3709
- };
3710
- zodSqlSchema: z.ZodDate;
3711
- zodNewSchema: TNewNext;
3712
- initialValue: z.TypeOf<TNewNext>;
3713
- zodClientSchema: InferSmartClientType<z.ZodDate, TNewNext>;
3714
- zodValidationSchema: InferSmartClientType<z.ZodDate, TNewNext>;
3715
- } & {
3716
- transforms: {
3717
- toClient: (dbValue: Date) => z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>;
3718
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>) => Date;
3719
- };
3720
- };
3721
- };
3722
- };
3723
- };
3724
- };
3725
- datetime: (config?: Omit<DateConfig, "type">) => {
3726
- config: {
3727
- sql: {
3728
- pk?: true;
3729
- nullable?: boolean;
3730
- default?: Date;
3731
- field?: string;
3732
- type: "datetime";
3733
- };
3734
- zodSqlSchema: z.ZodDate;
3735
- zodNewSchema: z.ZodDate;
3736
- initialValue: Date;
3737
- zodClientSchema: z.ZodDate;
3738
- zodValidationSchema: z.ZodDate;
3739
- };
3740
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
3741
- sql: z.ZodDate;
3742
- initialState: z.ZodDate;
3743
- client: z.ZodDate;
3744
- }) => TValidationNext)) => {
3745
- config: {
3746
- sql: {
3747
- pk?: true;
3748
- nullable?: boolean;
3749
- default?: Date;
3750
- field?: string;
3751
- type: "datetime";
3752
- };
3753
- zodSqlSchema: z.ZodDate;
3754
- zodNewSchema: z.ZodDate;
3755
- initialValue: Date;
3756
- zodClientSchema: z.ZodDate;
3757
- zodValidationSchema: TValidationNext;
3758
- };
3759
- transform: (transforms: {
3760
- toClient: (dbValue: Date) => Date;
3761
- toDb: (clientValue: Date) => Date;
3762
- }) => {
3763
- config: {
3764
- sql: {
3765
- pk?: true;
3766
- nullable?: boolean;
3767
- default?: Date;
3768
- field?: string;
3769
- type: "datetime";
3770
- };
3771
- zodSqlSchema: z.ZodDate;
3772
- zodNewSchema: z.ZodDate;
3773
- initialValue: Date;
3774
- zodClientSchema: z.ZodDate;
3775
- zodValidationSchema: TValidationNext;
3776
- } & {
3777
- transforms: {
3778
- toClient: (dbValue: Date) => Date;
3779
- toDb: (clientValue: Date) => Date;
3780
- };
3781
- };
3782
- };
3783
- };
3784
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
3785
- sql: z.ZodDate;
3786
- initialState: z.ZodDate;
3787
- }) => TClientNext)) => {
3788
- config: {
3789
- sql: {
3790
- pk?: true;
3791
- nullable?: boolean;
3792
- default?: Date;
3793
- field?: string;
3794
- type: "datetime";
3795
- };
3796
- zodSqlSchema: z.ZodDate;
3797
- zodNewSchema: z.ZodDate;
3798
- initialValue: Date;
3799
- zodClientSchema: TClientNext;
3800
- zodValidationSchema: TClientNext;
3801
- };
3802
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
3803
- sql: z.ZodDate;
3804
- initialState: z.ZodDate;
3805
- client: TClientNext;
3806
- }) => TValidationNext)) => {
3807
- config: {
3808
- sql: {
3809
- pk?: true;
3810
- nullable?: boolean;
3811
- default?: Date;
3812
- field?: string;
3813
- type: "datetime";
3814
- };
3815
- zodSqlSchema: z.ZodDate;
3816
- zodNewSchema: z.ZodDate;
3817
- initialValue: Date;
3818
- zodClientSchema: TClientNext;
3819
- zodValidationSchema: TValidationNext;
3820
- };
3821
- transform: (transforms: {
3822
- toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
3823
- toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
3824
- }) => {
3825
- config: {
3826
- sql: {
3827
- pk?: true;
3828
- nullable?: boolean;
3829
- default?: Date;
3830
- field?: string;
3831
- type: "datetime";
3832
- };
3833
- zodSqlSchema: z.ZodDate;
3834
- zodNewSchema: z.ZodDate;
3835
- initialValue: Date;
3836
- zodClientSchema: TClientNext;
3837
- zodValidationSchema: TValidationNext;
3838
- } & {
3839
- transforms: {
3840
- toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
3841
- toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
3842
- };
3843
- };
3844
- };
3845
- };
3846
- transform: (transforms: {
3847
- toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
3848
- toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
3849
- }) => {
3850
- config: {
3851
- sql: {
3852
- pk?: true;
3853
- nullable?: boolean;
3854
- default?: Date;
3855
- field?: string;
3856
- type: "datetime";
3857
- };
3858
- zodSqlSchema: z.ZodDate;
3859
- zodNewSchema: z.ZodDate;
3860
- initialValue: Date;
3861
- zodClientSchema: TClientNext;
3862
- zodValidationSchema: TClientNext;
3863
- } & {
3864
- transforms: {
3865
- toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
3866
- toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
3867
- };
3868
- };
3869
- };
3870
- };
3871
- transform: (transforms: {
3872
- toClient: (dbValue: Date) => Date;
3873
- toDb: (clientValue: Date) => Date;
3874
- }) => {
3875
- config: {
3876
- sql: {
3877
- pk?: true;
3878
- nullable?: boolean;
3879
- default?: Date;
3880
- field?: string;
3881
- type: "datetime";
3882
- };
3883
- zodSqlSchema: z.ZodDate;
3884
- zodNewSchema: z.ZodDate;
3885
- initialValue: Date;
3886
- zodClientSchema: z.ZodDate;
3887
- zodValidationSchema: z.ZodDate;
3888
- } & {
3889
- transforms: {
3890
- toClient: (dbValue: Date) => Date;
3891
- toDb: (clientValue: Date) => Date;
3892
- };
3893
- };
3894
- };
3895
- initialState: {
3896
- <TDefaultNext>(defaultValue: () => TDefaultNext): {
3897
- config: {
3898
- sql: {
3899
- pk?: true;
3900
- nullable?: boolean;
3901
- default?: Date;
3902
- field?: string;
3903
- type: "datetime";
3904
- };
3905
- zodSqlSchema: z.ZodDate;
3906
- zodNewSchema: z.ZodDate;
3907
- initialValue: TDefaultNext;
3908
- zodClientSchema: z.ZodDate;
3909
- zodValidationSchema: z.ZodDate;
3910
- };
3911
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
3912
- sql: z.ZodDate;
3913
- initialState: z.ZodDate;
3914
- client: z.ZodDate;
3915
- }) => TValidationNext)) => {
3916
- config: {
3917
- sql: {
3918
- pk?: true;
3919
- nullable?: boolean;
3920
- default?: Date;
3921
- field?: string;
3922
- type: "datetime";
3923
- };
3924
- zodSqlSchema: z.ZodDate;
3925
- zodNewSchema: z.ZodDate;
3926
- initialValue: TDefaultNext;
3927
- zodClientSchema: z.ZodDate;
3928
- zodValidationSchema: TValidationNext;
3929
- };
3930
- transform: (transforms: {
3931
- toClient: (dbValue: Date) => Date;
3932
- toDb: (clientValue: Date) => Date;
3933
- }) => {
3934
- config: {
3935
- sql: {
3936
- pk?: true;
3937
- nullable?: boolean;
3938
- default?: Date;
3939
- field?: string;
3940
- type: "datetime";
3941
- };
3942
- zodSqlSchema: z.ZodDate;
3943
- zodNewSchema: z.ZodDate;
3944
- initialValue: TDefaultNext;
3945
- zodClientSchema: z.ZodDate;
3946
- zodValidationSchema: TValidationNext;
3947
- } & {
3948
- transforms: {
3949
- toClient: (dbValue: Date) => Date;
3950
- toDb: (clientValue: Date) => Date;
3951
- };
3952
- };
3953
- };
3954
- };
3955
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
3956
- sql: z.ZodDate;
3957
- initialState: z.ZodDate;
3958
- }) => TClientNext)) => {
3959
- config: {
3960
- sql: {
3961
- pk?: true;
3962
- nullable?: boolean;
3963
- default?: Date;
3964
- field?: string;
3965
- type: "datetime";
3966
- };
3967
- zodSqlSchema: z.ZodDate;
3968
- zodNewSchema: z.ZodDate;
3969
- initialValue: TDefaultNext;
3970
- zodClientSchema: TClientNext;
3971
- zodValidationSchema: TClientNext;
3972
- };
3973
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
3974
- sql: z.ZodDate;
3975
- initialState: z.ZodDate;
3976
- client: TClientNext;
3977
- }) => TValidationNext)) => {
3978
- config: {
3979
- sql: {
3980
- pk?: true;
3981
- nullable?: boolean;
3982
- default?: Date;
3983
- field?: string;
3984
- type: "datetime";
3985
- };
3986
- zodSqlSchema: z.ZodDate;
3987
- zodNewSchema: z.ZodDate;
3988
- initialValue: TDefaultNext;
3989
- zodClientSchema: TClientNext;
3990
- zodValidationSchema: TValidationNext;
3991
- };
3992
- transform: (transforms: {
3993
- toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
3994
- toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
3995
- }) => {
3996
- config: {
3997
- sql: {
3998
- pk?: true;
3999
- nullable?: boolean;
4000
- default?: Date;
4001
- field?: string;
4002
- type: "datetime";
4003
- };
4004
- zodSqlSchema: z.ZodDate;
4005
- zodNewSchema: z.ZodDate;
4006
- initialValue: TDefaultNext;
4007
- zodClientSchema: TClientNext;
4008
- zodValidationSchema: TValidationNext;
4009
- } & {
4010
- transforms: {
4011
- toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
4012
- toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
4013
- };
4014
- };
4015
- };
4016
- };
4017
- transform: (transforms: {
4018
- toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
4019
- toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
4020
- }) => {
4021
- config: {
4022
- sql: {
4023
- pk?: true;
4024
- nullable?: boolean;
4025
- default?: Date;
4026
- field?: string;
4027
- type: "datetime";
4028
- };
4029
- zodSqlSchema: z.ZodDate;
4030
- zodNewSchema: z.ZodDate;
4031
- initialValue: TDefaultNext;
4032
- zodClientSchema: TClientNext;
4033
- zodValidationSchema: TClientNext;
4034
- } & {
4035
- transforms: {
4036
- toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
4037
- toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
4038
- };
4039
- };
4040
- };
4041
- };
4042
- transform: (transforms: {
4043
- toClient: (dbValue: Date) => Date;
4044
- toDb: (clientValue: Date) => Date;
4045
- }) => {
4046
- config: {
4047
- sql: {
4048
- pk?: true;
4049
- nullable?: boolean;
4050
- default?: Date;
4051
- field?: string;
4052
- type: "datetime";
4053
- };
4054
- zodSqlSchema: z.ZodDate;
4055
- zodNewSchema: z.ZodDate;
4056
- initialValue: TDefaultNext;
4057
- zodClientSchema: z.ZodDate;
4058
- zodValidationSchema: z.ZodDate;
4059
- } & {
4060
- transforms: {
4061
- toClient: (dbValue: Date) => Date;
4062
- toDb: (clientValue: Date) => Date;
4063
- };
4064
- };
4065
- };
4066
- };
4067
- <TNewNext extends z.ZodTypeAny, TDefaultNext>(schema: TNewNext | ((tools: {
4068
- sql: z.ZodDate;
4069
- }) => TNewNext), defaultValue: () => TDefaultNext): {
4070
- config: {
4071
- sql: {
4072
- pk?: true;
4073
- nullable?: boolean;
4074
- default?: Date;
4075
- field?: string;
4076
- type: "datetime";
4077
- };
4078
- zodSqlSchema: z.ZodDate;
4079
- zodNewSchema: TNewNext;
4080
- initialValue: z.TypeOf<TNewNext>;
4081
- zodClientSchema: InferSmartClientType<z.ZodDate, TNewNext>;
4082
- zodValidationSchema: InferSmartClientType<z.ZodDate, TNewNext>;
4083
- };
4084
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
4085
- sql: z.ZodDate;
4086
- initialState: TNewNext;
4087
- client: InferSmartClientType<z.ZodDate, TNewNext>;
4088
- }) => TValidationNext)) => {
4089
- config: {
4090
- sql: {
4091
- pk?: true;
4092
- nullable?: boolean;
4093
- default?: Date;
4094
- field?: string;
4095
- type: "datetime";
4096
- };
4097
- zodSqlSchema: z.ZodDate;
4098
- zodNewSchema: TNewNext;
4099
- initialValue: z.TypeOf<TNewNext>;
4100
- zodClientSchema: InferSmartClientType<z.ZodDate, TNewNext>;
4101
- zodValidationSchema: TValidationNext;
4102
- };
4103
- transform: (transforms: {
4104
- toClient: (dbValue: Date) => z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>;
4105
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>) => Date;
4106
- }) => {
4107
- config: {
4108
- sql: {
4109
- pk?: true;
4110
- nullable?: boolean;
4111
- default?: Date;
4112
- field?: string;
4113
- type: "datetime";
4114
- };
4115
- zodSqlSchema: z.ZodDate;
4116
- zodNewSchema: TNewNext;
4117
- initialValue: z.TypeOf<TNewNext>;
4118
- zodClientSchema: InferSmartClientType<z.ZodDate, TNewNext>;
4119
- zodValidationSchema: TValidationNext;
4120
- } & {
4121
- transforms: {
4122
- toClient: (dbValue: Date) => z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>;
4123
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>) => Date;
4124
- };
4125
- };
4126
- };
4127
- };
4128
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
4129
- sql: z.ZodDate;
4130
- initialState: TNewNext;
4131
- }) => TClientNext)) => {
4132
- config: {
4133
- sql: {
4134
- pk?: true;
4135
- nullable?: boolean;
4136
- default?: Date;
4137
- field?: string;
4138
- type: "datetime";
4139
- };
4140
- zodSqlSchema: z.ZodDate;
4141
- zodNewSchema: TNewNext;
4142
- initialValue: z.TypeOf<TNewNext>;
4143
- zodClientSchema: TClientNext;
4144
- zodValidationSchema: TClientNext;
4145
- };
4146
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
4147
- sql: z.ZodDate;
4148
- initialState: TNewNext;
4149
- client: TClientNext;
4150
- }) => TValidationNext)) => {
4151
- config: {
4152
- sql: {
4153
- pk?: true;
4154
- nullable?: boolean;
4155
- default?: Date;
4156
- field?: string;
4157
- type: "datetime";
4158
- };
4159
- zodSqlSchema: z.ZodDate;
4160
- zodNewSchema: TNewNext;
4161
- initialValue: z.TypeOf<TNewNext>;
4162
- zodClientSchema: TClientNext;
4163
- zodValidationSchema: TValidationNext;
4164
- };
4165
- transform: (transforms: {
4166
- toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
4167
- toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
4168
- }) => {
4169
- config: {
4170
- sql: {
4171
- pk?: true;
4172
- nullable?: boolean;
4173
- default?: Date;
4174
- field?: string;
4175
- type: "datetime";
4176
- };
4177
- zodSqlSchema: z.ZodDate;
4178
- zodNewSchema: TNewNext;
4179
- initialValue: z.TypeOf<TNewNext>;
4180
- zodClientSchema: TClientNext;
4181
- zodValidationSchema: TValidationNext;
4182
- } & {
4183
- transforms: {
4184
- toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
4185
- toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
4186
- };
4187
- };
4188
- };
4189
- };
4190
- transform: (transforms: {
4191
- toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
4192
- toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
4193
- }) => {
4194
- config: {
4195
- sql: {
4196
- pk?: true;
4197
- nullable?: boolean;
4198
- default?: Date;
4199
- field?: string;
4200
- type: "datetime";
4201
- };
4202
- zodSqlSchema: z.ZodDate;
4203
- zodNewSchema: TNewNext;
4204
- initialValue: z.TypeOf<TNewNext>;
4205
- zodClientSchema: TClientNext;
4206
- zodValidationSchema: TClientNext;
4207
- } & {
4208
- transforms: {
4209
- toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
4210
- toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
4211
- };
4212
- };
4213
- };
4214
- };
4215
- transform: (transforms: {
4216
- toClient: (dbValue: Date) => z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>;
4217
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>) => Date;
4218
- }) => {
4219
- config: {
4220
- sql: {
4221
- pk?: true;
4222
- nullable?: boolean;
4223
- default?: Date;
4224
- field?: string;
4225
- type: "datetime";
4226
- };
4227
- zodSqlSchema: z.ZodDate;
4228
- zodNewSchema: TNewNext;
4229
- initialValue: z.TypeOf<TNewNext>;
4230
- zodClientSchema: InferSmartClientType<z.ZodDate, TNewNext>;
4231
- zodValidationSchema: InferSmartClientType<z.ZodDate, TNewNext>;
4232
- } & {
4233
- transforms: {
4234
- toClient: (dbValue: Date) => z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>;
4235
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>) => Date;
4236
- };
4237
- };
4238
- };
4239
- };
4240
- };
4241
- };
4242
- sql: <T extends SQLType>(sqlConfig: T) => {
4243
- config: {
4244
- sql: T;
4245
- zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4246
- zodNewSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4247
- initialValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4248
- zodClientSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4249
- zodValidationSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4250
- };
4251
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
4252
- sql: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4253
- initialState: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4254
- client: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4255
- }) => TValidationNext)) => {
4256
- config: {
4257
- sql: T;
4258
- zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4259
- zodNewSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4260
- initialValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4261
- zodClientSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4262
- zodValidationSchema: TValidationNext;
4263
- };
4264
- transform: (transforms: {
4265
- toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4266
- toDb: (clientValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4267
- }) => {
4268
- config: {
4269
- sql: T;
4270
- zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4271
- zodNewSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4272
- initialValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4273
- zodClientSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4274
- zodValidationSchema: TValidationNext;
4275
- } & {
4276
- transforms: {
4277
- toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4278
- toDb: (clientValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4279
- };
4280
- };
4281
- };
4282
- };
4283
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
4284
- sql: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4285
- initialState: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4286
- }) => TClientNext)) => {
4287
- config: {
4288
- sql: T;
4289
- zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4290
- zodNewSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4291
- initialValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4292
- zodClientSchema: TClientNext;
4293
- zodValidationSchema: TClientNext;
4294
- };
4295
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
4296
- sql: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4297
- initialState: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4298
- client: TClientNext;
4299
- }) => TValidationNext)) => {
4300
- config: {
4301
- sql: T;
4302
- zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4303
- zodNewSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4304
- initialValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4305
- zodClientSchema: TClientNext;
4306
- zodValidationSchema: TValidationNext;
4307
- };
4308
- transform: (transforms: {
4309
- toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<TClientNext>;
4310
- toDb: (clientValue: z.TypeOf<TClientNext>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4311
- }) => {
4312
- config: {
4313
- sql: T;
4314
- zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4315
- zodNewSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4316
- initialValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4317
- zodClientSchema: TClientNext;
4318
- zodValidationSchema: TValidationNext;
4319
- } & {
4320
- transforms: {
4321
- toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<TClientNext>;
4322
- toDb: (clientValue: z.TypeOf<TClientNext>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4323
- };
4324
- };
4325
- };
4326
- };
4327
- transform: (transforms: {
4328
- toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<TClientNext>;
4329
- toDb: (clientValue: z.TypeOf<TClientNext>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4330
- }) => {
4331
- config: {
4332
- sql: T;
4333
- zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4334
- zodNewSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4335
- initialValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4336
- zodClientSchema: TClientNext;
4337
- zodValidationSchema: TClientNext;
4338
- } & {
4339
- transforms: {
4340
- toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<TClientNext>;
4341
- toDb: (clientValue: z.TypeOf<TClientNext>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4342
- };
4343
- };
4344
- };
4345
- };
4346
- transform: (transforms: {
4347
- toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4348
- toDb: (clientValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4349
- }) => {
4350
- config: {
4351
- sql: T;
4352
- zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4353
- zodNewSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4354
- initialValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4355
- zodClientSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4356
- zodValidationSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4357
- } & {
4358
- transforms: {
4359
- toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4360
- toDb: (clientValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4361
- };
4362
- };
4363
- };
4364
- initialState: {
4365
- <TDefaultNext>(defaultValue: () => TDefaultNext): {
4366
- config: {
4367
- sql: T;
4368
- zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4369
- zodNewSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4370
- initialValue: TDefaultNext;
4371
- zodClientSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4372
- zodValidationSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4373
- };
4374
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
4375
- sql: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4376
- initialState: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4377
- client: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4378
- }) => TValidationNext)) => {
4379
- config: {
4380
- sql: T;
4381
- zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4382
- zodNewSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4383
- initialValue: TDefaultNext;
4384
- zodClientSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4385
- zodValidationSchema: TValidationNext;
4386
- };
4387
- transform: (transforms: {
4388
- toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4389
- toDb: (clientValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4390
- }) => {
4391
- config: {
4392
- sql: T;
4393
- zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4394
- zodNewSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4395
- initialValue: TDefaultNext;
4396
- zodClientSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4397
- zodValidationSchema: TValidationNext;
4398
- } & {
4399
- transforms: {
4400
- toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4401
- toDb: (clientValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4402
- };
4403
- };
4404
- };
4405
- };
4406
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
4407
- sql: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4408
- initialState: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4409
- }) => TClientNext)) => {
4410
- config: {
4411
- sql: T;
4412
- zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4413
- zodNewSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4414
- initialValue: TDefaultNext;
4415
- zodClientSchema: TClientNext;
4416
- zodValidationSchema: TClientNext;
4417
- };
4418
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
4419
- sql: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4420
- initialState: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4421
- client: TClientNext;
4422
- }) => TValidationNext)) => {
4423
- config: {
4424
- sql: T;
4425
- zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4426
- zodNewSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4427
- initialValue: TDefaultNext;
4428
- zodClientSchema: TClientNext;
4429
- zodValidationSchema: TValidationNext;
4430
- };
4431
- transform: (transforms: {
4432
- toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<TClientNext>;
4433
- toDb: (clientValue: z.TypeOf<TClientNext>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4434
- }) => {
4435
- config: {
4436
- sql: T;
4437
- zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4438
- zodNewSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4439
- initialValue: TDefaultNext;
4440
- zodClientSchema: TClientNext;
4441
- zodValidationSchema: TValidationNext;
4442
- } & {
4443
- transforms: {
4444
- toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<TClientNext>;
4445
- toDb: (clientValue: z.TypeOf<TClientNext>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4446
- };
4447
- };
4448
- };
4449
- };
4450
- transform: (transforms: {
4451
- toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<TClientNext>;
4452
- toDb: (clientValue: z.TypeOf<TClientNext>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4453
- }) => {
4454
- config: {
4455
- sql: T;
4456
- zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4457
- zodNewSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4458
- initialValue: TDefaultNext;
4459
- zodClientSchema: TClientNext;
4460
- zodValidationSchema: TClientNext;
4461
- } & {
4462
- transforms: {
4463
- toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<TClientNext>;
4464
- toDb: (clientValue: z.TypeOf<TClientNext>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4465
- };
4466
- };
4467
- };
4468
- };
4469
- transform: (transforms: {
4470
- toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4471
- toDb: (clientValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4472
- }) => {
4473
- config: {
4474
- sql: T;
4475
- zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4476
- zodNewSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4477
- initialValue: TDefaultNext;
4478
- zodClientSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4479
- zodValidationSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4480
- } & {
4481
- transforms: {
4482
- toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4483
- toDb: (clientValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4484
- };
4485
- };
4486
- };
4487
- };
4488
- <TNewNext extends z.ZodTypeAny, TDefaultNext>(schema: TNewNext | ((tools: {
4489
- sql: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4490
- }) => TNewNext), defaultValue: () => TDefaultNext): {
4491
- config: {
4492
- sql: T;
4493
- zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4494
- zodNewSchema: TNewNext;
4495
- initialValue: z.TypeOf<TNewNext>;
4496
- zodClientSchema: InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>;
4497
- zodValidationSchema: InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>;
4498
- };
4499
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
4500
- sql: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4501
- initialState: TNewNext;
4502
- client: InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>;
4503
- }) => TValidationNext)) => {
4504
- config: {
4505
- sql: T;
4506
- zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4507
- zodNewSchema: TNewNext;
4508
- initialValue: z.TypeOf<TNewNext>;
4509
- zodClientSchema: InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>;
4510
- zodValidationSchema: TValidationNext;
4511
- };
4512
- transform: (transforms: {
4513
- toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>>;
4514
- toDb: (clientValue: z.TypeOf<InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4515
- }) => {
4516
- config: {
4517
- sql: T;
4518
- zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4519
- zodNewSchema: TNewNext;
4520
- initialValue: z.TypeOf<TNewNext>;
4521
- zodClientSchema: InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>;
4522
- zodValidationSchema: TValidationNext;
4523
- } & {
4524
- transforms: {
4525
- toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>>;
4526
- toDb: (clientValue: z.TypeOf<InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4527
- };
4528
- };
4529
- };
4530
- };
4531
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
4532
- sql: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4533
- initialState: TNewNext;
4534
- }) => TClientNext)) => {
4535
- config: {
4536
- sql: T;
4537
- zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4538
- zodNewSchema: TNewNext;
4539
- initialValue: z.TypeOf<TNewNext>;
4540
- zodClientSchema: TClientNext;
4541
- zodValidationSchema: TClientNext;
4542
- };
4543
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
4544
- sql: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4545
- initialState: TNewNext;
4546
- client: TClientNext;
4547
- }) => TValidationNext)) => {
4548
- config: {
4549
- sql: T;
4550
- zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4551
- zodNewSchema: TNewNext;
4552
- initialValue: z.TypeOf<TNewNext>;
4553
- zodClientSchema: TClientNext;
4554
- zodValidationSchema: TValidationNext;
4555
- };
4556
- transform: (transforms: {
4557
- toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<TClientNext>;
4558
- toDb: (clientValue: z.TypeOf<TClientNext>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4559
- }) => {
4560
- config: {
4561
- sql: T;
4562
- zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4563
- zodNewSchema: TNewNext;
4564
- initialValue: z.TypeOf<TNewNext>;
4565
- zodClientSchema: TClientNext;
4566
- zodValidationSchema: TValidationNext;
4567
- } & {
4568
- transforms: {
4569
- toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<TClientNext>;
4570
- toDb: (clientValue: z.TypeOf<TClientNext>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4571
- };
4572
- };
4573
- };
4574
- };
4575
- transform: (transforms: {
4576
- toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<TClientNext>;
4577
- toDb: (clientValue: z.TypeOf<TClientNext>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4578
- }) => {
4579
- config: {
4580
- sql: T;
4581
- zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4582
- zodNewSchema: TNewNext;
4583
- initialValue: z.TypeOf<TNewNext>;
4584
- zodClientSchema: TClientNext;
4585
- zodValidationSchema: TClientNext;
4586
- } & {
4587
- transforms: {
4588
- toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<TClientNext>;
4589
- toDb: (clientValue: z.TypeOf<TClientNext>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4590
- };
4591
- };
4592
- };
4593
- };
4594
- transform: (transforms: {
4595
- toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>>;
4596
- toDb: (clientValue: z.TypeOf<InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4597
- }) => {
4598
- config: {
4599
- sql: T;
4600
- zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4601
- zodNewSchema: TNewNext;
4602
- initialValue: z.TypeOf<TNewNext>;
4603
- zodClientSchema: InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>;
4604
- zodValidationSchema: InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>;
4605
- } & {
4606
- transforms: {
4607
- toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>>;
4608
- toDb: (clientValue: z.TypeOf<InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4609
- };
4610
- };
4611
- };
4612
- };
4613
- };
4614
- };
4615
- };
4616
- interface IBuilderMethods<T extends SQLType, TSql extends z.ZodTypeAny, TNew extends z.ZodTypeAny, TInitialValue, TClient extends z.ZodTypeAny, TValidation extends z.ZodTypeAny> {
4617
- /**
4618
- * Defines the schema and default value for creating a new item.
4619
- * Moves the builder to the 'new' stage.
4620
- */
57
+ interface IBuilderMethods<T extends SQLType | RelationConfig<any>, TSql extends z.ZodTypeAny, TNew extends z.ZodTypeAny, TInitialValue, TClient extends z.ZodTypeAny, TValidation extends z.ZodTypeAny> {
4621
58
  initialState: {
4622
- <TDefaultNext>(defaultValue: () => TDefaultNext): Prettify<Builder<"new", T, TSql, TSql, // Keep SQL schema
4623
- TDefaultNext, TSql, // Client stays as SQL
4624
- TSql>>;
59
+ <TDefaultNext>(defaultValue: () => TDefaultNext): Prettify<Builder<"new", T, TSql, TSql, TDefaultNext, TSql, TSql>>;
4625
60
  <TNewNext extends z.ZodTypeAny, TDefaultNext>(schema: ((tools: {
4626
61
  sql: TSql;
4627
62
  }) => TNewNext) | TNewNext, defaultValue: () => TDefaultNext): Prettify<Builder<"new", T, TSql, TNewNext, z.infer<TNewNext>, InferSmartClientType<TSql, TNewNext>, InferSmartClientType<TSql, TNewNext>>>;
4628
63
  };
4629
- /**
4630
- * Defines the schema for data sent to the client.
4631
- * Moves the builder to the 'client' stage.
4632
- */
4633
64
  client: <TClientNext extends z.ZodTypeAny>(schema: ((tools: {
4634
65
  sql: TSql;
4635
66
  initialState: TNew;
4636
67
  }) => TClientNext) | TClientNext) => Prettify<Builder<"client", T, TSql, TNew, TInitialValue, TClientNext, TClientNext>>;
4637
- /**
4638
- * Defines a validation schema for updates or inputs.
4639
- * Moves the builder to the 'validation' stage.
4640
- */
4641
68
  validation: <TValidationNext extends z.ZodTypeAny>(schema: ((tools: {
4642
69
  sql: TSql;
4643
70
  initialState: TNew;
4644
71
  client: TClient;
4645
72
  }) => TValidationNext) | TValidationNext) => Prettify<Builder<"validation", T, TSql, TNew, TInitialValue, TClient, TValidationNext>>;
4646
- /**
4647
- * Finalizes the builder by providing data transformation functions.
4648
- * This is the terminal step.
4649
- */
4650
73
  transform: (transforms: {
4651
74
  toClient: (dbValue: z.infer<TSql>) => z.infer<TClient>;
4652
75
  toDb: (clientValue: z.infer<TClient>) => z.infer<TSql>;
@@ -4656,16 +79,32 @@ interface IBuilderMethods<T extends SQLType, TSql extends z.ZodTypeAny, TNew ext
4656
79
  };
4657
80
  };
4658
81
  }
4659
- type Stage = "sql" | "new" | "client" | "validation" | "done";
82
+ type BaseRelationConfig<T extends Schema<any>> = {
83
+ fromKey: string;
84
+ toKey: () => any;
85
+ schema: () => T;
86
+ defaultCount?: number;
87
+ };
88
+ type RelationConfig<T extends Schema<any>> = (BaseRelationConfig<T> & {
89
+ type: "hasMany";
90
+ }) | (BaseRelationConfig<T> & {
91
+ type: "hasOne";
92
+ }) | (BaseRelationConfig<T> & {
93
+ type: "belongsTo";
94
+ }) | (BaseRelationConfig<T> & {
95
+ type: "manyToMany";
96
+ });
97
+ type Stage = "sql" | "relation" | "new" | "client" | "validation" | "done";
4660
98
  type StageMethods = {
4661
99
  sql: "initialState" | "client" | "validation" | "transform";
100
+ relation: "initialState" | "client" | "validation" | "transform";
4662
101
  new: "client" | "validation" | "transform";
4663
102
  client: "validation" | "transform";
4664
103
  validation: "transform";
4665
104
  done: never;
4666
105
  };
4667
106
  type InferSmartClientType<TSql extends z.ZodTypeAny, TNew extends z.ZodTypeAny> = z.infer<TNew> extends z.infer<TSql> ? TNew : z.ZodUnion<[TSql, TNew]>;
4668
- type BuilderConfig<T extends SQLType, TSql extends z.ZodTypeAny, TNew extends z.ZodTypeAny, TInitialValue, TClient extends z.ZodTypeAny, TValidation extends z.ZodTypeAny> = {
107
+ type BuilderConfig<T extends SQLType | RelationConfig<any>, TSql extends z.ZodTypeAny, TNew extends z.ZodTypeAny, TInitialValue, TClient extends z.ZodTypeAny, TValidation extends z.ZodTypeAny> = {
4669
108
  sql: T;
4670
109
  zodSqlSchema: TSql;
4671
110
  zodNewSchema: TNew;
@@ -4673,10 +112,53 @@ type BuilderConfig<T extends SQLType, TSql extends z.ZodTypeAny, TNew extends z.
4673
112
  zodClientSchema: TClient;
4674
113
  zodValidationSchema: TValidation;
4675
114
  };
4676
- export type Builder<TStage extends Stage, T extends SQLType, TSql extends z.ZodTypeAny, TNew extends z.ZodTypeAny, TInitialValue, TClient extends z.ZodTypeAny, TValidation extends z.ZodTypeAny> = Prettify<{
4677
- /** The configuration object, available at every stage. */
115
+ export type Builder<TStage extends Stage, T extends SQLType | RelationConfig<any>, TSql extends z.ZodTypeAny, TNew extends z.ZodTypeAny, TInitialValue, TClient extends z.ZodTypeAny, TValidation extends z.ZodTypeAny> = Prettify<{
4678
116
  config: Prettify<BuilderConfig<T, TSql, TNew, TInitialValue, TClient, TValidation>>;
4679
117
  } & Pick<IBuilderMethods<T, TSql, TNew, TInitialValue, TClient, TValidation>, StageMethods[TStage]>>;
118
+ interface ShapeAPI {
119
+ int: (config?: IntConfig) => ReturnType<typeof createBuilder>;
120
+ varchar: (config?: Omit<StringConfig, "type">) => ReturnType<typeof createBuilder>;
121
+ char: (config?: Omit<StringConfig, "type">) => ReturnType<typeof createBuilder>;
122
+ text: (config?: Omit<StringConfig, "type" | "length">) => ReturnType<typeof createBuilder>;
123
+ longtext: (config?: Omit<StringConfig, "type" | "length">) => ReturnType<typeof createBuilder>;
124
+ boolean: (config?: BooleanConfig) => ReturnType<typeof createBuilder>;
125
+ date: (config?: Omit<DateConfig, "type">) => ReturnType<typeof createBuilder>;
126
+ datetime: (config?: Omit<DateConfig, "type">) => ReturnType<typeof createBuilder>;
127
+ sql: <T extends SQLType>(sqlConfig: T) => Builder<"sql", T, SQLToZodType<T, false>, SQLToZodType<T, false>, z.infer<SQLToZodType<T, false>>, SQLToZodType<T, false>, SQLToZodType<T, false>>;
128
+ hasMany: <T extends Schema<any>>(config: {
129
+ fromKey: string;
130
+ toKey: () => any;
131
+ schema: () => T;
132
+ defaultCount?: number;
133
+ }) => Builder<"relation", RelationConfig<T>, z.ZodOptional<z.ZodArray<z.ZodAny>>, z.ZodOptional<z.ZodArray<z.ZodAny>>, any[], z.ZodOptional<z.ZodArray<z.ZodAny>>, z.ZodOptional<z.ZodArray<z.ZodAny>>>;
134
+ hasOne: <T extends Schema<any>>(config: {
135
+ fromKey: string;
136
+ toKey: () => any;
137
+ schema: () => T;
138
+ }) => Builder<"relation", RelationConfig<T>, z.ZodOptional<z.ZodAny>, z.ZodOptional<z.ZodAny>, any, z.ZodOptional<z.ZodAny>, z.ZodOptional<z.ZodAny>>;
139
+ belongsTo: <T extends Schema<any>>(config: {
140
+ fromKey: string;
141
+ toKey: () => any;
142
+ schema: () => T;
143
+ }) => Builder<"relation", RelationConfig<T>, z.ZodOptional<z.ZodAny>, z.ZodOptional<z.ZodAny>, any, z.ZodOptional<z.ZodAny>, z.ZodOptional<z.ZodAny>>;
144
+ manyToMany: <T extends Schema<any>>(config: {
145
+ fromKey: string;
146
+ toKey: () => any;
147
+ schema: () => T;
148
+ defaultCount?: number;
149
+ }) => Builder<"relation", RelationConfig<T>, z.ZodOptional<z.ZodArray<z.ZodAny>>, z.ZodOptional<z.ZodArray<z.ZodAny>>, any[], z.ZodOptional<z.ZodArray<z.ZodAny>>, z.ZodOptional<z.ZodArray<z.ZodAny>>>;
150
+ }
151
+ export declare const shape: ShapeAPI;
152
+ declare function createBuilder<TStage extends "sql" | "relation" | "new" | "client" | "validation", T extends SQLType | RelationConfig<any>, TSql extends z.ZodTypeAny, TNew extends z.ZodTypeAny, TInitialValue, TClient extends z.ZodTypeAny, TValidation extends z.ZodTypeAny>(config: {
153
+ stage: TStage;
154
+ sqlConfig: T;
155
+ sqlZod: TSql;
156
+ newZod: TNew;
157
+ initialValue: TInitialValue;
158
+ clientZod: TClient;
159
+ validationZod: TValidation;
160
+ completedStages?: Set<string>;
161
+ }): Builder<TStage, T, TSql, TNew, TInitialValue, TClient, TValidation>;
4680
162
  export declare function hasMany<T extends Schema<any>>(config: {
4681
163
  fromKey: string;
4682
164
  toKey: () => T[keyof T];