cogsbox-shape 0.5.9 → 0.5.11
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/example/schema.d.ts +128 -128
- package/dist/example/user.d.ts +148 -148
- package/dist/schema.d.ts +138 -138
- package/dist/schema.js +3 -1
- package/package.json +1 -1
package/dist/schema.d.ts
CHANGED
|
@@ -75,21 +75,21 @@ export declare function createTransforms<TTransforms extends Record<string, Cust
|
|
|
75
75
|
serverType?: never;
|
|
76
76
|
}) => ClientType) | undefined, defaultValue?: DefaultValue | (DefaultValue extends Date ? CurrentTimestampConfig : never) | undefined) => {
|
|
77
77
|
sql: T;
|
|
78
|
-
zodDbSchema:
|
|
78
|
+
zodDbSchema: SQLToZodType<T, false>;
|
|
79
79
|
zodClientSchema: ClientType;
|
|
80
80
|
jsonSchema: any;
|
|
81
81
|
defaultValue: DefaultValue | (DefaultValue extends Date ? CurrentTimestampConfig : never);
|
|
82
82
|
transform: (transforms: {
|
|
83
|
-
toClient: (dbValue: z.
|
|
84
|
-
toDb: (clientValue: z.TypeOf<ClientType>) => z.
|
|
83
|
+
toClient: (dbValue: SQLToZodType<T, false> extends infer T_1 ? T_1 extends SQLToZodType<T, false> ? T_1 extends z.ZodTypeAny ? z.TypeOf<SQLToZodType<T, false>> : never : never : never) => z.TypeOf<ClientType>;
|
|
84
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => SQLToZodType<T, false> extends infer T_1 ? T_1 extends SQLToZodType<T, false> ? T_1 extends z.ZodTypeAny ? z.TypeOf<SQLToZodType<T, false>> : never : never : never;
|
|
85
85
|
}) => {
|
|
86
86
|
sql: T;
|
|
87
|
-
zodDbSchema:
|
|
87
|
+
zodDbSchema: SQLToZodType<T, false>;
|
|
88
88
|
zodClientSchema: ClientType;
|
|
89
89
|
jsonSchema: any;
|
|
90
90
|
defaultValue: DefaultValue;
|
|
91
|
-
toClient: (dbValue: z.
|
|
92
|
-
toDb: (clientValue: z.TypeOf<ClientType>) => z.
|
|
91
|
+
toClient: (dbValue: SQLToZodType<T, false> extends infer T_1 ? T_1 extends SQLToZodType<T, false> ? T_1 extends z.ZodTypeAny ? z.TypeOf<SQLToZodType<T, false>> : never : never : never) => z.TypeOf<ClientType>;
|
|
92
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => SQLToZodType<T, false> extends infer T_1 ? T_1 extends SQLToZodType<T, false> ? T_1 extends z.ZodTypeAny ? z.TypeOf<SQLToZodType<T, false>> : never : never : never;
|
|
93
93
|
transforms: {
|
|
94
94
|
toClient: string;
|
|
95
95
|
toDb: string;
|
|
@@ -104,21 +104,21 @@ export declare function createTransforms<TTransforms extends Record<string, Cust
|
|
|
104
104
|
serverType?: ServerType;
|
|
105
105
|
}) => ClientType) | undefined, defaultValue?: DefaultValue | (DefaultValue extends Date ? CurrentTimestampConfig : never) | undefined) => {
|
|
106
106
|
sql: T;
|
|
107
|
-
zodDbSchema:
|
|
107
|
+
zodDbSchema: SQLToZodType<T, false> | ServerType;
|
|
108
108
|
zodClientSchema: ClientType;
|
|
109
109
|
jsonSchema: any;
|
|
110
110
|
defaultValue: DefaultValue | (DefaultValue extends Date ? CurrentTimestampConfig : never);
|
|
111
111
|
transform: (transforms: {
|
|
112
|
-
toClient: (dbValue: z.
|
|
113
|
-
toDb: (clientValue: z.TypeOf<ClientType>) => z.
|
|
112
|
+
toClient: (dbValue: SQLToZodType<T, false> extends infer T_1 ? T_1 extends SQLToZodType<T, false> ? T_1 extends z.ZodTypeAny ? z.TypeOf<SQLToZodType<T, false>> : ServerType extends z.ZodTypeAny ? z.TypeOf<ServerType> : any : never : never) => z.TypeOf<ClientType>;
|
|
113
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => SQLToZodType<T, false> extends infer T_1 ? T_1 extends SQLToZodType<T, false> ? T_1 extends z.ZodTypeAny ? z.TypeOf<SQLToZodType<T, false>> : ServerType extends z.ZodTypeAny ? z.TypeOf<ServerType> : any : never : never;
|
|
114
114
|
}) => {
|
|
115
115
|
sql: T;
|
|
116
|
-
zodDbSchema:
|
|
116
|
+
zodDbSchema: SQLToZodType<T, false> | ServerType;
|
|
117
117
|
zodClientSchema: ClientType;
|
|
118
118
|
jsonSchema: any;
|
|
119
119
|
defaultValue: DefaultValue;
|
|
120
|
-
toClient: (dbValue: z.
|
|
121
|
-
toDb: (clientValue: z.TypeOf<ClientType>) => z.
|
|
120
|
+
toClient: (dbValue: SQLToZodType<T, false> extends infer T_1 ? T_1 extends SQLToZodType<T, false> ? T_1 extends z.ZodTypeAny ? z.TypeOf<SQLToZodType<T, false>> : ServerType extends z.ZodTypeAny ? z.TypeOf<ServerType> : any : never : never) => z.TypeOf<ClientType>;
|
|
121
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => SQLToZodType<T, false> extends infer T_1 ? T_1 extends SQLToZodType<T, false> ? T_1 extends z.ZodTypeAny ? z.TypeOf<SQLToZodType<T, false>> : ServerType extends z.ZodTypeAny ? z.TypeOf<ServerType> : any : never : never;
|
|
122
122
|
transforms: {
|
|
123
123
|
toClient: string;
|
|
124
124
|
toDb: string;
|
|
@@ -169,13 +169,13 @@ export declare const shape: {
|
|
|
169
169
|
default?: number;
|
|
170
170
|
type: "int";
|
|
171
171
|
};
|
|
172
|
-
zodDbSchema:
|
|
172
|
+
zodDbSchema: z.ZodNumber;
|
|
173
173
|
zodClientSchema: ClientType;
|
|
174
174
|
jsonSchema: any;
|
|
175
175
|
defaultValue: DefaultValue | (DefaultValue extends Date ? CurrentTimestampConfig : never);
|
|
176
176
|
transform: (transforms: {
|
|
177
|
-
toClient: (dbValue:
|
|
178
|
-
toDb: (clientValue: z.TypeOf<ClientType>) =>
|
|
177
|
+
toClient: (dbValue: number) => z.TypeOf<ClientType>;
|
|
178
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => number;
|
|
179
179
|
}) => {
|
|
180
180
|
sql: {
|
|
181
181
|
nullable?: boolean;
|
|
@@ -184,21 +184,21 @@ export declare const shape: {
|
|
|
184
184
|
default?: number;
|
|
185
185
|
type: "int";
|
|
186
186
|
};
|
|
187
|
-
zodDbSchema:
|
|
187
|
+
zodDbSchema: z.ZodNumber;
|
|
188
188
|
zodClientSchema: ClientType;
|
|
189
189
|
jsonSchema: any;
|
|
190
190
|
defaultValue: DefaultValue;
|
|
191
|
-
toClient: (dbValue:
|
|
192
|
-
toDb: (clientValue: z.TypeOf<ClientType>) =>
|
|
191
|
+
toClient: (dbValue: number) => z.TypeOf<ClientType>;
|
|
192
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => number;
|
|
193
193
|
transforms: {
|
|
194
194
|
toClient: string;
|
|
195
195
|
toDb: string;
|
|
196
196
|
};
|
|
197
197
|
};
|
|
198
198
|
};
|
|
199
|
-
db: <ServerType extends z.ZodTypeAny>(assert: (tools: {
|
|
199
|
+
db: <ServerType extends z.ZodTypeAny>(assert: ServerType | ((tools: {
|
|
200
200
|
zod: z.ZodNumber;
|
|
201
|
-
}) => ServerType) => {
|
|
201
|
+
}) => ServerType)) => {
|
|
202
202
|
sql: {
|
|
203
203
|
nullable?: boolean;
|
|
204
204
|
pk?: true;
|
|
@@ -227,13 +227,13 @@ export declare const shape: {
|
|
|
227
227
|
default?: number;
|
|
228
228
|
type: "int";
|
|
229
229
|
};
|
|
230
|
-
zodDbSchema:
|
|
230
|
+
zodDbSchema: z.ZodNumber | ServerType;
|
|
231
231
|
zodClientSchema: ClientType;
|
|
232
232
|
jsonSchema: any;
|
|
233
233
|
defaultValue: DefaultValue | (DefaultValue extends Date ? CurrentTimestampConfig : never);
|
|
234
234
|
transform: (transforms: {
|
|
235
|
-
toClient: (dbValue:
|
|
236
|
-
toDb: (clientValue: z.TypeOf<ClientType>) =>
|
|
235
|
+
toClient: (dbValue: number) => z.TypeOf<ClientType>;
|
|
236
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => number;
|
|
237
237
|
}) => {
|
|
238
238
|
sql: {
|
|
239
239
|
nullable?: boolean;
|
|
@@ -242,12 +242,12 @@ export declare const shape: {
|
|
|
242
242
|
default?: number;
|
|
243
243
|
type: "int";
|
|
244
244
|
};
|
|
245
|
-
zodDbSchema:
|
|
245
|
+
zodDbSchema: z.ZodNumber | ServerType;
|
|
246
246
|
zodClientSchema: ClientType;
|
|
247
247
|
jsonSchema: any;
|
|
248
248
|
defaultValue: DefaultValue;
|
|
249
|
-
toClient: (dbValue:
|
|
250
|
-
toDb: (clientValue: z.TypeOf<ClientType>) =>
|
|
249
|
+
toClient: (dbValue: number) => z.TypeOf<ClientType>;
|
|
250
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => number;
|
|
251
251
|
transforms: {
|
|
252
252
|
toClient: string;
|
|
253
253
|
toDb: string;
|
|
@@ -287,13 +287,13 @@ export declare const shape: {
|
|
|
287
287
|
field?: string;
|
|
288
288
|
type: "varchar";
|
|
289
289
|
};
|
|
290
|
-
zodDbSchema:
|
|
290
|
+
zodDbSchema: z.ZodString;
|
|
291
291
|
zodClientSchema: ClientType;
|
|
292
292
|
jsonSchema: any;
|
|
293
293
|
defaultValue: DefaultValue | (DefaultValue extends Date ? CurrentTimestampConfig : never);
|
|
294
294
|
transform: (transforms: {
|
|
295
|
-
toClient: (dbValue:
|
|
296
|
-
toDb: (clientValue: z.TypeOf<ClientType>) =>
|
|
295
|
+
toClient: (dbValue: string) => z.TypeOf<ClientType>;
|
|
296
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => string;
|
|
297
297
|
}) => {
|
|
298
298
|
sql: {
|
|
299
299
|
nullable?: boolean;
|
|
@@ -303,21 +303,21 @@ export declare const shape: {
|
|
|
303
303
|
field?: string;
|
|
304
304
|
type: "varchar";
|
|
305
305
|
};
|
|
306
|
-
zodDbSchema:
|
|
306
|
+
zodDbSchema: z.ZodString;
|
|
307
307
|
zodClientSchema: ClientType;
|
|
308
308
|
jsonSchema: any;
|
|
309
309
|
defaultValue: DefaultValue;
|
|
310
|
-
toClient: (dbValue:
|
|
311
|
-
toDb: (clientValue: z.TypeOf<ClientType>) =>
|
|
310
|
+
toClient: (dbValue: string) => z.TypeOf<ClientType>;
|
|
311
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => string;
|
|
312
312
|
transforms: {
|
|
313
313
|
toClient: string;
|
|
314
314
|
toDb: string;
|
|
315
315
|
};
|
|
316
316
|
};
|
|
317
317
|
};
|
|
318
|
-
db: <ServerType extends z.ZodTypeAny>(assert: (tools: {
|
|
318
|
+
db: <ServerType extends z.ZodTypeAny>(assert: ServerType | ((tools: {
|
|
319
319
|
zod: z.ZodString;
|
|
320
|
-
}) => ServerType) => {
|
|
320
|
+
}) => ServerType)) => {
|
|
321
321
|
sql: {
|
|
322
322
|
nullable?: boolean;
|
|
323
323
|
default?: string;
|
|
@@ -348,13 +348,13 @@ export declare const shape: {
|
|
|
348
348
|
field?: string;
|
|
349
349
|
type: "varchar";
|
|
350
350
|
};
|
|
351
|
-
zodDbSchema:
|
|
351
|
+
zodDbSchema: z.ZodString | ServerType;
|
|
352
352
|
zodClientSchema: ClientType;
|
|
353
353
|
jsonSchema: any;
|
|
354
354
|
defaultValue: DefaultValue | (DefaultValue extends Date ? CurrentTimestampConfig : never);
|
|
355
355
|
transform: (transforms: {
|
|
356
|
-
toClient: (dbValue:
|
|
357
|
-
toDb: (clientValue: z.TypeOf<ClientType>) =>
|
|
356
|
+
toClient: (dbValue: string) => z.TypeOf<ClientType>;
|
|
357
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => string;
|
|
358
358
|
}) => {
|
|
359
359
|
sql: {
|
|
360
360
|
nullable?: boolean;
|
|
@@ -364,12 +364,12 @@ export declare const shape: {
|
|
|
364
364
|
field?: string;
|
|
365
365
|
type: "varchar";
|
|
366
366
|
};
|
|
367
|
-
zodDbSchema:
|
|
367
|
+
zodDbSchema: z.ZodString | ServerType;
|
|
368
368
|
zodClientSchema: ClientType;
|
|
369
369
|
jsonSchema: any;
|
|
370
370
|
defaultValue: DefaultValue;
|
|
371
|
-
toClient: (dbValue:
|
|
372
|
-
toDb: (clientValue: z.TypeOf<ClientType>) =>
|
|
371
|
+
toClient: (dbValue: string) => z.TypeOf<ClientType>;
|
|
372
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => string;
|
|
373
373
|
transforms: {
|
|
374
374
|
toClient: string;
|
|
375
375
|
toDb: string;
|
|
@@ -409,13 +409,13 @@ export declare const shape: {
|
|
|
409
409
|
field?: string;
|
|
410
410
|
type: "char";
|
|
411
411
|
};
|
|
412
|
-
zodDbSchema:
|
|
412
|
+
zodDbSchema: z.ZodString;
|
|
413
413
|
zodClientSchema: ClientType;
|
|
414
414
|
jsonSchema: any;
|
|
415
415
|
defaultValue: DefaultValue | (DefaultValue extends Date ? CurrentTimestampConfig : never);
|
|
416
416
|
transform: (transforms: {
|
|
417
|
-
toClient: (dbValue:
|
|
418
|
-
toDb: (clientValue: z.TypeOf<ClientType>) =>
|
|
417
|
+
toClient: (dbValue: string) => z.TypeOf<ClientType>;
|
|
418
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => string;
|
|
419
419
|
}) => {
|
|
420
420
|
sql: {
|
|
421
421
|
nullable?: boolean;
|
|
@@ -425,21 +425,21 @@ export declare const shape: {
|
|
|
425
425
|
field?: string;
|
|
426
426
|
type: "char";
|
|
427
427
|
};
|
|
428
|
-
zodDbSchema:
|
|
428
|
+
zodDbSchema: z.ZodString;
|
|
429
429
|
zodClientSchema: ClientType;
|
|
430
430
|
jsonSchema: any;
|
|
431
431
|
defaultValue: DefaultValue;
|
|
432
|
-
toClient: (dbValue:
|
|
433
|
-
toDb: (clientValue: z.TypeOf<ClientType>) =>
|
|
432
|
+
toClient: (dbValue: string) => z.TypeOf<ClientType>;
|
|
433
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => string;
|
|
434
434
|
transforms: {
|
|
435
435
|
toClient: string;
|
|
436
436
|
toDb: string;
|
|
437
437
|
};
|
|
438
438
|
};
|
|
439
439
|
};
|
|
440
|
-
db: <ServerType extends z.ZodTypeAny>(assert: (tools: {
|
|
440
|
+
db: <ServerType extends z.ZodTypeAny>(assert: ServerType | ((tools: {
|
|
441
441
|
zod: z.ZodString;
|
|
442
|
-
}) => ServerType) => {
|
|
442
|
+
}) => ServerType)) => {
|
|
443
443
|
sql: {
|
|
444
444
|
nullable?: boolean;
|
|
445
445
|
default?: string;
|
|
@@ -470,13 +470,13 @@ export declare const shape: {
|
|
|
470
470
|
field?: string;
|
|
471
471
|
type: "char";
|
|
472
472
|
};
|
|
473
|
-
zodDbSchema:
|
|
473
|
+
zodDbSchema: z.ZodString | ServerType;
|
|
474
474
|
zodClientSchema: ClientType;
|
|
475
475
|
jsonSchema: any;
|
|
476
476
|
defaultValue: DefaultValue | (DefaultValue extends Date ? CurrentTimestampConfig : never);
|
|
477
477
|
transform: (transforms: {
|
|
478
|
-
toClient: (dbValue:
|
|
479
|
-
toDb: (clientValue: z.TypeOf<ClientType>) =>
|
|
478
|
+
toClient: (dbValue: string) => z.TypeOf<ClientType>;
|
|
479
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => string;
|
|
480
480
|
}) => {
|
|
481
481
|
sql: {
|
|
482
482
|
nullable?: boolean;
|
|
@@ -486,12 +486,12 @@ export declare const shape: {
|
|
|
486
486
|
field?: string;
|
|
487
487
|
type: "char";
|
|
488
488
|
};
|
|
489
|
-
zodDbSchema:
|
|
489
|
+
zodDbSchema: z.ZodString | ServerType;
|
|
490
490
|
zodClientSchema: ClientType;
|
|
491
491
|
jsonSchema: any;
|
|
492
492
|
defaultValue: DefaultValue;
|
|
493
|
-
toClient: (dbValue:
|
|
494
|
-
toDb: (clientValue: z.TypeOf<ClientType>) =>
|
|
493
|
+
toClient: (dbValue: string) => z.TypeOf<ClientType>;
|
|
494
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => string;
|
|
495
495
|
transforms: {
|
|
496
496
|
toClient: string;
|
|
497
497
|
toDb: string;
|
|
@@ -529,13 +529,13 @@ export declare const shape: {
|
|
|
529
529
|
field?: string;
|
|
530
530
|
type: "text";
|
|
531
531
|
};
|
|
532
|
-
zodDbSchema:
|
|
532
|
+
zodDbSchema: z.ZodString;
|
|
533
533
|
zodClientSchema: ClientType;
|
|
534
534
|
jsonSchema: any;
|
|
535
535
|
defaultValue: DefaultValue | (DefaultValue extends Date ? CurrentTimestampConfig : never);
|
|
536
536
|
transform: (transforms: {
|
|
537
|
-
toClient: (dbValue:
|
|
538
|
-
toDb: (clientValue: z.TypeOf<ClientType>) =>
|
|
537
|
+
toClient: (dbValue: string) => z.TypeOf<ClientType>;
|
|
538
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => string;
|
|
539
539
|
}) => {
|
|
540
540
|
sql: {
|
|
541
541
|
nullable?: boolean;
|
|
@@ -544,21 +544,21 @@ export declare const shape: {
|
|
|
544
544
|
field?: string;
|
|
545
545
|
type: "text";
|
|
546
546
|
};
|
|
547
|
-
zodDbSchema:
|
|
547
|
+
zodDbSchema: z.ZodString;
|
|
548
548
|
zodClientSchema: ClientType;
|
|
549
549
|
jsonSchema: any;
|
|
550
550
|
defaultValue: DefaultValue;
|
|
551
|
-
toClient: (dbValue:
|
|
552
|
-
toDb: (clientValue: z.TypeOf<ClientType>) =>
|
|
551
|
+
toClient: (dbValue: string) => z.TypeOf<ClientType>;
|
|
552
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => string;
|
|
553
553
|
transforms: {
|
|
554
554
|
toClient: string;
|
|
555
555
|
toDb: string;
|
|
556
556
|
};
|
|
557
557
|
};
|
|
558
558
|
};
|
|
559
|
-
db: <ServerType extends z.ZodTypeAny>(assert: (tools: {
|
|
559
|
+
db: <ServerType extends z.ZodTypeAny>(assert: ServerType | ((tools: {
|
|
560
560
|
zod: z.ZodString;
|
|
561
|
-
}) => ServerType) => {
|
|
561
|
+
}) => ServerType)) => {
|
|
562
562
|
sql: {
|
|
563
563
|
nullable?: boolean;
|
|
564
564
|
default?: string;
|
|
@@ -587,13 +587,13 @@ export declare const shape: {
|
|
|
587
587
|
field?: string;
|
|
588
588
|
type: "text";
|
|
589
589
|
};
|
|
590
|
-
zodDbSchema:
|
|
590
|
+
zodDbSchema: z.ZodString | ServerType;
|
|
591
591
|
zodClientSchema: ClientType;
|
|
592
592
|
jsonSchema: any;
|
|
593
593
|
defaultValue: DefaultValue | (DefaultValue extends Date ? CurrentTimestampConfig : never);
|
|
594
594
|
transform: (transforms: {
|
|
595
|
-
toClient: (dbValue:
|
|
596
|
-
toDb: (clientValue: z.TypeOf<ClientType>) =>
|
|
595
|
+
toClient: (dbValue: string) => z.TypeOf<ClientType>;
|
|
596
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => string;
|
|
597
597
|
}) => {
|
|
598
598
|
sql: {
|
|
599
599
|
nullable?: boolean;
|
|
@@ -602,12 +602,12 @@ export declare const shape: {
|
|
|
602
602
|
field?: string;
|
|
603
603
|
type: "text";
|
|
604
604
|
};
|
|
605
|
-
zodDbSchema:
|
|
605
|
+
zodDbSchema: z.ZodString | ServerType;
|
|
606
606
|
zodClientSchema: ClientType;
|
|
607
607
|
jsonSchema: any;
|
|
608
608
|
defaultValue: DefaultValue;
|
|
609
|
-
toClient: (dbValue:
|
|
610
|
-
toDb: (clientValue: z.TypeOf<ClientType>) =>
|
|
609
|
+
toClient: (dbValue: string) => z.TypeOf<ClientType>;
|
|
610
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => string;
|
|
611
611
|
transforms: {
|
|
612
612
|
toClient: string;
|
|
613
613
|
toDb: string;
|
|
@@ -645,13 +645,13 @@ export declare const shape: {
|
|
|
645
645
|
field?: string;
|
|
646
646
|
type: "longtext";
|
|
647
647
|
};
|
|
648
|
-
zodDbSchema:
|
|
648
|
+
zodDbSchema: z.ZodString;
|
|
649
649
|
zodClientSchema: ClientType;
|
|
650
650
|
jsonSchema: any;
|
|
651
651
|
defaultValue: DefaultValue | (DefaultValue extends Date ? CurrentTimestampConfig : never);
|
|
652
652
|
transform: (transforms: {
|
|
653
|
-
toClient: (dbValue:
|
|
654
|
-
toDb: (clientValue: z.TypeOf<ClientType>) =>
|
|
653
|
+
toClient: (dbValue: string) => z.TypeOf<ClientType>;
|
|
654
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => string;
|
|
655
655
|
}) => {
|
|
656
656
|
sql: {
|
|
657
657
|
nullable?: boolean;
|
|
@@ -660,21 +660,21 @@ export declare const shape: {
|
|
|
660
660
|
field?: string;
|
|
661
661
|
type: "longtext";
|
|
662
662
|
};
|
|
663
|
-
zodDbSchema:
|
|
663
|
+
zodDbSchema: z.ZodString;
|
|
664
664
|
zodClientSchema: ClientType;
|
|
665
665
|
jsonSchema: any;
|
|
666
666
|
defaultValue: DefaultValue;
|
|
667
|
-
toClient: (dbValue:
|
|
668
|
-
toDb: (clientValue: z.TypeOf<ClientType>) =>
|
|
667
|
+
toClient: (dbValue: string) => z.TypeOf<ClientType>;
|
|
668
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => string;
|
|
669
669
|
transforms: {
|
|
670
670
|
toClient: string;
|
|
671
671
|
toDb: string;
|
|
672
672
|
};
|
|
673
673
|
};
|
|
674
674
|
};
|
|
675
|
-
db: <ServerType extends z.ZodTypeAny>(assert: (tools: {
|
|
675
|
+
db: <ServerType extends z.ZodTypeAny>(assert: ServerType | ((tools: {
|
|
676
676
|
zod: z.ZodString;
|
|
677
|
-
}) => ServerType) => {
|
|
677
|
+
}) => ServerType)) => {
|
|
678
678
|
sql: {
|
|
679
679
|
nullable?: boolean;
|
|
680
680
|
default?: string;
|
|
@@ -703,13 +703,13 @@ export declare const shape: {
|
|
|
703
703
|
field?: string;
|
|
704
704
|
type: "longtext";
|
|
705
705
|
};
|
|
706
|
-
zodDbSchema:
|
|
706
|
+
zodDbSchema: z.ZodString | ServerType;
|
|
707
707
|
zodClientSchema: ClientType;
|
|
708
708
|
jsonSchema: any;
|
|
709
709
|
defaultValue: DefaultValue | (DefaultValue extends Date ? CurrentTimestampConfig : never);
|
|
710
710
|
transform: (transforms: {
|
|
711
|
-
toClient: (dbValue:
|
|
712
|
-
toDb: (clientValue: z.TypeOf<ClientType>) =>
|
|
711
|
+
toClient: (dbValue: string) => z.TypeOf<ClientType>;
|
|
712
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => string;
|
|
713
713
|
}) => {
|
|
714
714
|
sql: {
|
|
715
715
|
nullable?: boolean;
|
|
@@ -718,12 +718,12 @@ export declare const shape: {
|
|
|
718
718
|
field?: string;
|
|
719
719
|
type: "longtext";
|
|
720
720
|
};
|
|
721
|
-
zodDbSchema:
|
|
721
|
+
zodDbSchema: z.ZodString | ServerType;
|
|
722
722
|
zodClientSchema: ClientType;
|
|
723
723
|
jsonSchema: any;
|
|
724
724
|
defaultValue: DefaultValue;
|
|
725
|
-
toClient: (dbValue:
|
|
726
|
-
toDb: (clientValue: z.TypeOf<ClientType>) =>
|
|
725
|
+
toClient: (dbValue: string) => z.TypeOf<ClientType>;
|
|
726
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => string;
|
|
727
727
|
transforms: {
|
|
728
728
|
toClient: string;
|
|
729
729
|
toDb: string;
|
|
@@ -761,13 +761,13 @@ export declare const shape: {
|
|
|
761
761
|
default?: boolean;
|
|
762
762
|
type: "boolean";
|
|
763
763
|
};
|
|
764
|
-
zodDbSchema:
|
|
764
|
+
zodDbSchema: z.ZodBoolean;
|
|
765
765
|
zodClientSchema: ClientType;
|
|
766
766
|
jsonSchema: any;
|
|
767
767
|
defaultValue: DefaultValue | (DefaultValue extends Date ? CurrentTimestampConfig : never);
|
|
768
768
|
transform: (transforms: {
|
|
769
|
-
toClient: (dbValue:
|
|
770
|
-
toDb: (clientValue: z.TypeOf<ClientType>) =>
|
|
769
|
+
toClient: (dbValue: boolean) => z.TypeOf<ClientType>;
|
|
770
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => boolean;
|
|
771
771
|
}) => {
|
|
772
772
|
sql: {
|
|
773
773
|
nullable?: boolean;
|
|
@@ -776,21 +776,21 @@ export declare const shape: {
|
|
|
776
776
|
default?: boolean;
|
|
777
777
|
type: "boolean";
|
|
778
778
|
};
|
|
779
|
-
zodDbSchema:
|
|
779
|
+
zodDbSchema: z.ZodBoolean;
|
|
780
780
|
zodClientSchema: ClientType;
|
|
781
781
|
jsonSchema: any;
|
|
782
782
|
defaultValue: DefaultValue;
|
|
783
|
-
toClient: (dbValue:
|
|
784
|
-
toDb: (clientValue: z.TypeOf<ClientType>) =>
|
|
783
|
+
toClient: (dbValue: boolean) => z.TypeOf<ClientType>;
|
|
784
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => boolean;
|
|
785
785
|
transforms: {
|
|
786
786
|
toClient: string;
|
|
787
787
|
toDb: string;
|
|
788
788
|
};
|
|
789
789
|
};
|
|
790
790
|
};
|
|
791
|
-
db: <ServerType extends z.ZodTypeAny>(assert: (tools: {
|
|
791
|
+
db: <ServerType extends z.ZodTypeAny>(assert: ServerType | ((tools: {
|
|
792
792
|
zod: z.ZodBoolean;
|
|
793
|
-
}) => ServerType) => {
|
|
793
|
+
}) => ServerType)) => {
|
|
794
794
|
sql: {
|
|
795
795
|
nullable?: boolean;
|
|
796
796
|
pk?: true;
|
|
@@ -819,13 +819,13 @@ export declare const shape: {
|
|
|
819
819
|
default?: boolean;
|
|
820
820
|
type: "boolean";
|
|
821
821
|
};
|
|
822
|
-
zodDbSchema:
|
|
822
|
+
zodDbSchema: z.ZodBoolean | ServerType;
|
|
823
823
|
zodClientSchema: ClientType;
|
|
824
824
|
jsonSchema: any;
|
|
825
825
|
defaultValue: DefaultValue | (DefaultValue extends Date ? CurrentTimestampConfig : never);
|
|
826
826
|
transform: (transforms: {
|
|
827
|
-
toClient: (dbValue:
|
|
828
|
-
toDb: (clientValue: z.TypeOf<ClientType>) =>
|
|
827
|
+
toClient: (dbValue: boolean) => z.TypeOf<ClientType>;
|
|
828
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => boolean;
|
|
829
829
|
}) => {
|
|
830
830
|
sql: {
|
|
831
831
|
nullable?: boolean;
|
|
@@ -834,12 +834,12 @@ export declare const shape: {
|
|
|
834
834
|
default?: boolean;
|
|
835
835
|
type: "boolean";
|
|
836
836
|
};
|
|
837
|
-
zodDbSchema:
|
|
837
|
+
zodDbSchema: z.ZodBoolean | ServerType;
|
|
838
838
|
zodClientSchema: ClientType;
|
|
839
839
|
jsonSchema: any;
|
|
840
840
|
defaultValue: DefaultValue;
|
|
841
|
-
toClient: (dbValue:
|
|
842
|
-
toDb: (clientValue: z.TypeOf<ClientType>) =>
|
|
841
|
+
toClient: (dbValue: boolean) => z.TypeOf<ClientType>;
|
|
842
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => boolean;
|
|
843
843
|
transforms: {
|
|
844
844
|
toClient: string;
|
|
845
845
|
toDb: string;
|
|
@@ -877,13 +877,13 @@ export declare const shape: {
|
|
|
877
877
|
field?: string;
|
|
878
878
|
type: "date";
|
|
879
879
|
};
|
|
880
|
-
zodDbSchema:
|
|
880
|
+
zodDbSchema: z.ZodDate;
|
|
881
881
|
zodClientSchema: ClientType;
|
|
882
882
|
jsonSchema: any;
|
|
883
883
|
defaultValue: DefaultValue | (DefaultValue extends Date ? CurrentTimestampConfig : never);
|
|
884
884
|
transform: (transforms: {
|
|
885
|
-
toClient: (dbValue:
|
|
886
|
-
toDb: (clientValue: z.TypeOf<ClientType>) =>
|
|
885
|
+
toClient: (dbValue: Date) => z.TypeOf<ClientType>;
|
|
886
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => Date;
|
|
887
887
|
}) => {
|
|
888
888
|
sql: {
|
|
889
889
|
nullable?: boolean;
|
|
@@ -892,21 +892,21 @@ export declare const shape: {
|
|
|
892
892
|
field?: string;
|
|
893
893
|
type: "date";
|
|
894
894
|
};
|
|
895
|
-
zodDbSchema:
|
|
895
|
+
zodDbSchema: z.ZodDate;
|
|
896
896
|
zodClientSchema: ClientType;
|
|
897
897
|
jsonSchema: any;
|
|
898
898
|
defaultValue: DefaultValue;
|
|
899
|
-
toClient: (dbValue:
|
|
900
|
-
toDb: (clientValue: z.TypeOf<ClientType>) =>
|
|
899
|
+
toClient: (dbValue: Date) => z.TypeOf<ClientType>;
|
|
900
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => Date;
|
|
901
901
|
transforms: {
|
|
902
902
|
toClient: string;
|
|
903
903
|
toDb: string;
|
|
904
904
|
};
|
|
905
905
|
};
|
|
906
906
|
};
|
|
907
|
-
db: <ServerType extends z.ZodTypeAny>(assert: (tools: {
|
|
907
|
+
db: <ServerType extends z.ZodTypeAny>(assert: ServerType | ((tools: {
|
|
908
908
|
zod: z.ZodDate;
|
|
909
|
-
}) => ServerType) => {
|
|
909
|
+
}) => ServerType)) => {
|
|
910
910
|
sql: {
|
|
911
911
|
nullable?: boolean;
|
|
912
912
|
default?: Date;
|
|
@@ -935,13 +935,13 @@ export declare const shape: {
|
|
|
935
935
|
field?: string;
|
|
936
936
|
type: "date";
|
|
937
937
|
};
|
|
938
|
-
zodDbSchema:
|
|
938
|
+
zodDbSchema: z.ZodDate | ServerType;
|
|
939
939
|
zodClientSchema: ClientType;
|
|
940
940
|
jsonSchema: any;
|
|
941
941
|
defaultValue: DefaultValue | (DefaultValue extends Date ? CurrentTimestampConfig : never);
|
|
942
942
|
transform: (transforms: {
|
|
943
|
-
toClient: (dbValue:
|
|
944
|
-
toDb: (clientValue: z.TypeOf<ClientType>) =>
|
|
943
|
+
toClient: (dbValue: Date) => z.TypeOf<ClientType>;
|
|
944
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => Date;
|
|
945
945
|
}) => {
|
|
946
946
|
sql: {
|
|
947
947
|
nullable?: boolean;
|
|
@@ -950,12 +950,12 @@ export declare const shape: {
|
|
|
950
950
|
field?: string;
|
|
951
951
|
type: "date";
|
|
952
952
|
};
|
|
953
|
-
zodDbSchema:
|
|
953
|
+
zodDbSchema: z.ZodDate | ServerType;
|
|
954
954
|
zodClientSchema: ClientType;
|
|
955
955
|
jsonSchema: any;
|
|
956
956
|
defaultValue: DefaultValue;
|
|
957
|
-
toClient: (dbValue:
|
|
958
|
-
toDb: (clientValue: z.TypeOf<ClientType>) =>
|
|
957
|
+
toClient: (dbValue: Date) => z.TypeOf<ClientType>;
|
|
958
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => Date;
|
|
959
959
|
transforms: {
|
|
960
960
|
toClient: string;
|
|
961
961
|
toDb: string;
|
|
@@ -993,13 +993,13 @@ export declare const shape: {
|
|
|
993
993
|
field?: string;
|
|
994
994
|
type: "datetime";
|
|
995
995
|
};
|
|
996
|
-
zodDbSchema:
|
|
996
|
+
zodDbSchema: z.ZodDate;
|
|
997
997
|
zodClientSchema: ClientType;
|
|
998
998
|
jsonSchema: any;
|
|
999
999
|
defaultValue: DefaultValue | (DefaultValue extends Date ? CurrentTimestampConfig : never);
|
|
1000
1000
|
transform: (transforms: {
|
|
1001
|
-
toClient: (dbValue:
|
|
1002
|
-
toDb: (clientValue: z.TypeOf<ClientType>) =>
|
|
1001
|
+
toClient: (dbValue: Date) => z.TypeOf<ClientType>;
|
|
1002
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => Date;
|
|
1003
1003
|
}) => {
|
|
1004
1004
|
sql: {
|
|
1005
1005
|
nullable?: boolean;
|
|
@@ -1008,21 +1008,21 @@ export declare const shape: {
|
|
|
1008
1008
|
field?: string;
|
|
1009
1009
|
type: "datetime";
|
|
1010
1010
|
};
|
|
1011
|
-
zodDbSchema:
|
|
1011
|
+
zodDbSchema: z.ZodDate;
|
|
1012
1012
|
zodClientSchema: ClientType;
|
|
1013
1013
|
jsonSchema: any;
|
|
1014
1014
|
defaultValue: DefaultValue;
|
|
1015
|
-
toClient: (dbValue:
|
|
1016
|
-
toDb: (clientValue: z.TypeOf<ClientType>) =>
|
|
1015
|
+
toClient: (dbValue: Date) => z.TypeOf<ClientType>;
|
|
1016
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => Date;
|
|
1017
1017
|
transforms: {
|
|
1018
1018
|
toClient: string;
|
|
1019
1019
|
toDb: string;
|
|
1020
1020
|
};
|
|
1021
1021
|
};
|
|
1022
1022
|
};
|
|
1023
|
-
db: <ServerType extends z.ZodTypeAny>(assert: (tools: {
|
|
1023
|
+
db: <ServerType extends z.ZodTypeAny>(assert: ServerType | ((tools: {
|
|
1024
1024
|
zod: z.ZodDate;
|
|
1025
|
-
}) => ServerType) => {
|
|
1025
|
+
}) => ServerType)) => {
|
|
1026
1026
|
sql: {
|
|
1027
1027
|
nullable?: boolean;
|
|
1028
1028
|
default?: Date;
|
|
@@ -1051,13 +1051,13 @@ export declare const shape: {
|
|
|
1051
1051
|
field?: string;
|
|
1052
1052
|
type: "datetime";
|
|
1053
1053
|
};
|
|
1054
|
-
zodDbSchema:
|
|
1054
|
+
zodDbSchema: z.ZodDate | ServerType;
|
|
1055
1055
|
zodClientSchema: ClientType;
|
|
1056
1056
|
jsonSchema: any;
|
|
1057
1057
|
defaultValue: DefaultValue | (DefaultValue extends Date ? CurrentTimestampConfig : never);
|
|
1058
1058
|
transform: (transforms: {
|
|
1059
|
-
toClient: (dbValue:
|
|
1060
|
-
toDb: (clientValue: z.TypeOf<ClientType>) =>
|
|
1059
|
+
toClient: (dbValue: Date) => z.TypeOf<ClientType>;
|
|
1060
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => Date;
|
|
1061
1061
|
}) => {
|
|
1062
1062
|
sql: {
|
|
1063
1063
|
nullable?: boolean;
|
|
@@ -1066,12 +1066,12 @@ export declare const shape: {
|
|
|
1066
1066
|
field?: string;
|
|
1067
1067
|
type: "datetime";
|
|
1068
1068
|
};
|
|
1069
|
-
zodDbSchema:
|
|
1069
|
+
zodDbSchema: z.ZodDate | ServerType;
|
|
1070
1070
|
zodClientSchema: ClientType;
|
|
1071
1071
|
jsonSchema: any;
|
|
1072
1072
|
defaultValue: DefaultValue;
|
|
1073
|
-
toClient: (dbValue:
|
|
1074
|
-
toDb: (clientValue: z.TypeOf<ClientType>) =>
|
|
1073
|
+
toClient: (dbValue: Date) => z.TypeOf<ClientType>;
|
|
1074
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => Date;
|
|
1075
1075
|
transforms: {
|
|
1076
1076
|
toClient: string;
|
|
1077
1077
|
toDb: string;
|
|
@@ -1097,30 +1097,30 @@ export declare const shape: {
|
|
|
1097
1097
|
serverType?: never;
|
|
1098
1098
|
}) => ClientType) | undefined, defaultValue?: DefaultValue | (DefaultValue extends Date ? CurrentTimestampConfig : never) | undefined) => {
|
|
1099
1099
|
sql: T;
|
|
1100
|
-
zodDbSchema:
|
|
1100
|
+
zodDbSchema: SQLToZodType<T, false>;
|
|
1101
1101
|
zodClientSchema: ClientType;
|
|
1102
1102
|
jsonSchema: any;
|
|
1103
1103
|
defaultValue: DefaultValue | (DefaultValue extends Date ? CurrentTimestampConfig : never);
|
|
1104
1104
|
transform: (transforms: {
|
|
1105
|
-
toClient: (dbValue: z.
|
|
1106
|
-
toDb: (clientValue: z.TypeOf<ClientType>) => z.
|
|
1105
|
+
toClient: (dbValue: SQLToZodType<T, false> extends infer T_1 ? T_1 extends SQLToZodType<T, false> ? T_1 extends z.ZodTypeAny ? z.TypeOf<SQLToZodType<T, false>> : never : never : never) => z.TypeOf<ClientType>;
|
|
1106
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => SQLToZodType<T, false> extends infer T_1 ? T_1 extends SQLToZodType<T, false> ? T_1 extends z.ZodTypeAny ? z.TypeOf<SQLToZodType<T, false>> : never : never : never;
|
|
1107
1107
|
}) => {
|
|
1108
1108
|
sql: T;
|
|
1109
|
-
zodDbSchema:
|
|
1109
|
+
zodDbSchema: SQLToZodType<T, false>;
|
|
1110
1110
|
zodClientSchema: ClientType;
|
|
1111
1111
|
jsonSchema: any;
|
|
1112
1112
|
defaultValue: DefaultValue;
|
|
1113
|
-
toClient: (dbValue: z.
|
|
1114
|
-
toDb: (clientValue: z.TypeOf<ClientType>) => z.
|
|
1113
|
+
toClient: (dbValue: SQLToZodType<T, false> extends infer T_1 ? T_1 extends SQLToZodType<T, false> ? T_1 extends z.ZodTypeAny ? z.TypeOf<SQLToZodType<T, false>> : never : never : never) => z.TypeOf<ClientType>;
|
|
1114
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => SQLToZodType<T, false> extends infer T_1 ? T_1 extends SQLToZodType<T, false> ? T_1 extends z.ZodTypeAny ? z.TypeOf<SQLToZodType<T, false>> : never : never : never;
|
|
1115
1115
|
transforms: {
|
|
1116
1116
|
toClient: string;
|
|
1117
1117
|
toDb: string;
|
|
1118
1118
|
};
|
|
1119
1119
|
};
|
|
1120
1120
|
};
|
|
1121
|
-
db: <ServerType extends z.ZodTypeAny>(assert: (tools: {
|
|
1121
|
+
db: <ServerType extends z.ZodTypeAny>(assert: ((tools: {
|
|
1122
1122
|
zod: SQLToZodType<T, false>;
|
|
1123
|
-
}) => ServerType) => {
|
|
1123
|
+
}) => ServerType) | ServerType) => {
|
|
1124
1124
|
sql: T;
|
|
1125
1125
|
dbType: ServerType;
|
|
1126
1126
|
zodDbSchema: ServerType;
|
|
@@ -1137,21 +1137,21 @@ export declare const shape: {
|
|
|
1137
1137
|
serverType?: ServerType;
|
|
1138
1138
|
}) => ClientType) | undefined, defaultValue?: DefaultValue | (DefaultValue extends Date ? CurrentTimestampConfig : never) | undefined) => {
|
|
1139
1139
|
sql: T;
|
|
1140
|
-
zodDbSchema:
|
|
1140
|
+
zodDbSchema: SQLToZodType<T, false> | ServerType;
|
|
1141
1141
|
zodClientSchema: ClientType;
|
|
1142
1142
|
jsonSchema: any;
|
|
1143
1143
|
defaultValue: DefaultValue | (DefaultValue extends Date ? CurrentTimestampConfig : never);
|
|
1144
1144
|
transform: (transforms: {
|
|
1145
|
-
toClient: (dbValue: z.
|
|
1146
|
-
toDb: (clientValue: z.TypeOf<ClientType>) => z.
|
|
1145
|
+
toClient: (dbValue: SQLToZodType<T, false> extends infer T_1 ? T_1 extends SQLToZodType<T, false> ? T_1 extends z.ZodTypeAny ? z.TypeOf<SQLToZodType<T, false>> : ServerType extends z.ZodTypeAny ? z.TypeOf<ServerType> : any : never : never) => z.TypeOf<ClientType>;
|
|
1146
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => SQLToZodType<T, false> extends infer T_1 ? T_1 extends SQLToZodType<T, false> ? T_1 extends z.ZodTypeAny ? z.TypeOf<SQLToZodType<T, false>> : ServerType extends z.ZodTypeAny ? z.TypeOf<ServerType> : any : never : never;
|
|
1147
1147
|
}) => {
|
|
1148
1148
|
sql: T;
|
|
1149
|
-
zodDbSchema:
|
|
1149
|
+
zodDbSchema: SQLToZodType<T, false> | ServerType;
|
|
1150
1150
|
zodClientSchema: ClientType;
|
|
1151
1151
|
jsonSchema: any;
|
|
1152
1152
|
defaultValue: DefaultValue;
|
|
1153
|
-
toClient: (dbValue: z.
|
|
1154
|
-
toDb: (clientValue: z.TypeOf<ClientType>) => z.
|
|
1153
|
+
toClient: (dbValue: SQLToZodType<T, false> extends infer T_1 ? T_1 extends SQLToZodType<T, false> ? T_1 extends z.ZodTypeAny ? z.TypeOf<SQLToZodType<T, false>> : ServerType extends z.ZodTypeAny ? z.TypeOf<ServerType> : any : never : never) => z.TypeOf<ClientType>;
|
|
1154
|
+
toDb: (clientValue: z.TypeOf<ClientType>) => SQLToZodType<T, false> extends infer T_1 ? T_1 extends SQLToZodType<T, false> ? T_1 extends z.ZodTypeAny ? z.TypeOf<SQLToZodType<T, false>> : ServerType extends z.ZodTypeAny ? z.TypeOf<ServerType> : any : never : never;
|
|
1155
1155
|
transforms: {
|
|
1156
1156
|
toClient: string;
|
|
1157
1157
|
toDb: string;
|