trpc-shield
Version:
tRPC permissions as another layer of abstraction!
36 lines (32 loc) • 1.46 kB
text/typescript
import { z } from 'zod';
import { IntFilterObjectSchema } from './IntFilter.schema';
import { DateTimeFilterObjectSchema } from './DateTimeFilter.schema';
import { StringNullableFilterObjectSchema } from './StringNullableFilter.schema';
import { StringFilterObjectSchema } from './StringFilter.schema';
import type { Prisma } from '@prisma/client';
const Schema: z.ZodType<Prisma.UserWhereInput> = z
.object({
AND: z.union([z.lazy(() => UserWhereInputObjectSchema), z.lazy(() => UserWhereInputObjectSchema).array()]).optional(),
OR: z
.lazy(() => UserWhereInputObjectSchema)
.array()
.optional(),
NOT: z.union([z.lazy(() => UserWhereInputObjectSchema), z.lazy(() => UserWhereInputObjectSchema).array()]).optional(),
id: z.union([z.lazy(() => IntFilterObjectSchema), z.number()]).optional(),
createdAt: z.union([z.lazy(() => DateTimeFilterObjectSchema), z.coerce.date()]).optional(),
username: z
.union([z.lazy(() => StringNullableFilterObjectSchema), z.string()])
.optional()
.nullable(),
password: z
.union([z.lazy(() => StringNullableFilterObjectSchema), z.string()])
.optional()
.nullable(),
email: z.union([z.lazy(() => StringFilterObjectSchema), z.string()]).optional(),
googleId: z
.union([z.lazy(() => StringNullableFilterObjectSchema), z.string()])
.optional()
.nullable(),
})
.strict();
export const UserWhereInputObjectSchema = Schema;