Skip to content

Commit

Permalink
Enable zod-prisma-types createInputTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
markspolakovs committed Sep 5, 2023
1 parent 49fdbda commit 30deaa7
Show file tree
Hide file tree
Showing 781 changed files with 22,594 additions and 28 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@
"lint-staged": {
"{desktop,server,jobrunner,utility}/*.{js,jsx,ts,tsx}": "eslint --fix",
"*": "prettier --ignore-unknown --write"
},
"resolutions": {
"zod": "<=3.21.1"
}
}
2 changes: 1 addition & 1 deletion utility/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ generator zod {
output = "./types"
useMultipleFiles = true
writeBarrelFiles = true
createInputTypes = false
createInputTypes = true
addIncludeType = false
addSelectType = false
}
Expand Down
5 changes: 3 additions & 2 deletions utility/prisma/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './modelSchema';
export * from './inputTypeSchemas';
export * from "./modelSchema";
export * from "./inputTypeSchemas";
export * from "./outputTypeSchemas";
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { Prisma } from "../../client";
import { z } from "zod";
import { SortOrderSchema } from "./SortOrderSchema";

export const AssetAvgOrderByAggregateInputSchema: z.ZodType<Prisma.AssetAvgOrderByAggregateInput> =
z
.object({
id: z.lazy(() => SortOrderSchema).optional(),
rundownId: z.lazy(() => SortOrderSchema).optional(),
mediaId: z.lazy(() => SortOrderSchema).optional(),
})
.strict();

export default AssetAvgOrderByAggregateInputSchema;
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import type { Prisma } from "../../client";
import { z } from "zod";
import { SortOrderSchema } from "./SortOrderSchema";

export const AssetCountOrderByAggregateInputSchema: z.ZodType<Prisma.AssetCountOrderByAggregateInput> =
z
.object({
id: z.lazy(() => SortOrderSchema).optional(),
name: z.lazy(() => SortOrderSchema).optional(),
type: z.lazy(() => SortOrderSchema).optional(),
rundownId: z.lazy(() => SortOrderSchema).optional(),
mediaId: z.lazy(() => SortOrderSchema).optional(),
})
.strict();

export default AssetCountOrderByAggregateInputSchema;
20 changes: 20 additions & 0 deletions utility/prisma/types/inputTypeSchemas/AssetCreateInputSchema.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import type { Prisma } from "../../client";
import { z } from "zod";
import { AssetTypeSchema } from "./AssetTypeSchema";
import { MediaCreateNestedOneWithoutAssetInputSchema } from "./MediaCreateNestedOneWithoutAssetInputSchema";
import { RundownCreateNestedOneWithoutAssetsInputSchema } from "./RundownCreateNestedOneWithoutAssetsInputSchema";
import { LoadAssetJobCreateNestedManyWithoutAssetInputSchema } from "./LoadAssetJobCreateNestedManyWithoutAssetInputSchema";

export const AssetCreateInputSchema: z.ZodType<Prisma.AssetCreateInput> = z
.object({
name: z.string(),
type: z.lazy(() => AssetTypeSchema),
media: z.lazy(() => MediaCreateNestedOneWithoutAssetInputSchema),
rundown: z.lazy(() => RundownCreateNestedOneWithoutAssetsInputSchema),
loadJobs: z
.lazy(() => LoadAssetJobCreateNestedManyWithoutAssetInputSchema)
.optional(),
})
.strict();

export default AssetCreateInputSchema;
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import type { Prisma } from "../../client";
import { z } from "zod";
import { AssetTypeSchema } from "./AssetTypeSchema";

export const AssetCreateManyInputSchema: z.ZodType<Prisma.AssetCreateManyInput> =
z
.object({
id: z.number().int().optional(),
name: z.string(),
type: z.lazy(() => AssetTypeSchema),
rundownId: z.number().int(),
mediaId: z.number().int(),
})
.strict();

export default AssetCreateManyInputSchema;
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import type { Prisma } from "../../client";
import { z } from "zod";
import { AssetCreateManyRundownInputSchema } from "./AssetCreateManyRundownInputSchema";

export const AssetCreateManyRundownInputEnvelopeSchema: z.ZodType<Prisma.AssetCreateManyRundownInputEnvelope> =
z
.object({
data: z.union([
z.lazy(() => AssetCreateManyRundownInputSchema),
z.lazy(() => AssetCreateManyRundownInputSchema).array(),
]),
skipDuplicates: z.boolean().optional(),
})
.strict();

export default AssetCreateManyRundownInputEnvelopeSchema;
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { Prisma } from "../../client";
import { z } from "zod";
import { AssetTypeSchema } from "./AssetTypeSchema";

export const AssetCreateManyRundownInputSchema: z.ZodType<Prisma.AssetCreateManyRundownInput> =
z
.object({
id: z.number().int().optional(),
name: z.string(),
type: z.lazy(() => AssetTypeSchema),
mediaId: z.number().int(),
})
.strict();

export default AssetCreateManyRundownInputSchema;
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import type { Prisma } from "../../client";
import { z } from "zod";
import { AssetCreateWithoutRundownInputSchema } from "./AssetCreateWithoutRundownInputSchema";
import { AssetUncheckedCreateWithoutRundownInputSchema } from "./AssetUncheckedCreateWithoutRundownInputSchema";
import { AssetCreateOrConnectWithoutRundownInputSchema } from "./AssetCreateOrConnectWithoutRundownInputSchema";
import { AssetCreateManyRundownInputEnvelopeSchema } from "./AssetCreateManyRundownInputEnvelopeSchema";
import { AssetWhereUniqueInputSchema } from "./AssetWhereUniqueInputSchema";

export const AssetCreateNestedManyWithoutRundownInputSchema: z.ZodType<Prisma.AssetCreateNestedManyWithoutRundownInput> =
z
.object({
create: z
.union([
z.lazy(() => AssetCreateWithoutRundownInputSchema),
z.lazy(() => AssetCreateWithoutRundownInputSchema).array(),
z.lazy(() => AssetUncheckedCreateWithoutRundownInputSchema),
z.lazy(() => AssetUncheckedCreateWithoutRundownInputSchema).array(),
])
.optional(),
connectOrCreate: z
.union([
z.lazy(() => AssetCreateOrConnectWithoutRundownInputSchema),
z.lazy(() => AssetCreateOrConnectWithoutRundownInputSchema).array(),
])
.optional(),
createMany: z
.lazy(() => AssetCreateManyRundownInputEnvelopeSchema)
.optional(),
connect: z
.union([
z.lazy(() => AssetWhereUniqueInputSchema),
z.lazy(() => AssetWhereUniqueInputSchema).array(),
])
.optional(),
})
.strict();

export default AssetCreateNestedManyWithoutRundownInputSchema;
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import type { Prisma } from "../../client";
import { z } from "zod";
import { AssetCreateWithoutLoadJobsInputSchema } from "./AssetCreateWithoutLoadJobsInputSchema";
import { AssetUncheckedCreateWithoutLoadJobsInputSchema } from "./AssetUncheckedCreateWithoutLoadJobsInputSchema";
import { AssetCreateOrConnectWithoutLoadJobsInputSchema } from "./AssetCreateOrConnectWithoutLoadJobsInputSchema";
import { AssetWhereUniqueInputSchema } from "./AssetWhereUniqueInputSchema";

export const AssetCreateNestedOneWithoutLoadJobsInputSchema: z.ZodType<Prisma.AssetCreateNestedOneWithoutLoadJobsInput> =
z
.object({
create: z
.union([
z.lazy(() => AssetCreateWithoutLoadJobsInputSchema),
z.lazy(() => AssetUncheckedCreateWithoutLoadJobsInputSchema),
])
.optional(),
connectOrCreate: z
.lazy(() => AssetCreateOrConnectWithoutLoadJobsInputSchema)
.optional(),
connect: z.lazy(() => AssetWhereUniqueInputSchema).optional(),
})
.strict();

export default AssetCreateNestedOneWithoutLoadJobsInputSchema;
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import type { Prisma } from "../../client";
import { z } from "zod";
import { AssetCreateWithoutMediaInputSchema } from "./AssetCreateWithoutMediaInputSchema";
import { AssetUncheckedCreateWithoutMediaInputSchema } from "./AssetUncheckedCreateWithoutMediaInputSchema";
import { AssetCreateOrConnectWithoutMediaInputSchema } from "./AssetCreateOrConnectWithoutMediaInputSchema";
import { AssetWhereUniqueInputSchema } from "./AssetWhereUniqueInputSchema";

export const AssetCreateNestedOneWithoutMediaInputSchema: z.ZodType<Prisma.AssetCreateNestedOneWithoutMediaInput> =
z
.object({
create: z
.union([
z.lazy(() => AssetCreateWithoutMediaInputSchema),
z.lazy(() => AssetUncheckedCreateWithoutMediaInputSchema),
])
.optional(),
connectOrCreate: z
.lazy(() => AssetCreateOrConnectWithoutMediaInputSchema)
.optional(),
connect: z.lazy(() => AssetWhereUniqueInputSchema).optional(),
})
.strict();

export default AssetCreateNestedOneWithoutMediaInputSchema;
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { Prisma } from "../../client";
import { z } from "zod";
import { AssetWhereUniqueInputSchema } from "./AssetWhereUniqueInputSchema";
import { AssetCreateWithoutLoadJobsInputSchema } from "./AssetCreateWithoutLoadJobsInputSchema";
import { AssetUncheckedCreateWithoutLoadJobsInputSchema } from "./AssetUncheckedCreateWithoutLoadJobsInputSchema";

export const AssetCreateOrConnectWithoutLoadJobsInputSchema: z.ZodType<Prisma.AssetCreateOrConnectWithoutLoadJobsInput> =
z
.object({
where: z.lazy(() => AssetWhereUniqueInputSchema),
create: z.union([
z.lazy(() => AssetCreateWithoutLoadJobsInputSchema),
z.lazy(() => AssetUncheckedCreateWithoutLoadJobsInputSchema),
]),
})
.strict();

export default AssetCreateOrConnectWithoutLoadJobsInputSchema;
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { Prisma } from "../../client";
import { z } from "zod";
import { AssetWhereUniqueInputSchema } from "./AssetWhereUniqueInputSchema";
import { AssetCreateWithoutMediaInputSchema } from "./AssetCreateWithoutMediaInputSchema";
import { AssetUncheckedCreateWithoutMediaInputSchema } from "./AssetUncheckedCreateWithoutMediaInputSchema";

export const AssetCreateOrConnectWithoutMediaInputSchema: z.ZodType<Prisma.AssetCreateOrConnectWithoutMediaInput> =
z
.object({
where: z.lazy(() => AssetWhereUniqueInputSchema),
create: z.union([
z.lazy(() => AssetCreateWithoutMediaInputSchema),
z.lazy(() => AssetUncheckedCreateWithoutMediaInputSchema),
]),
})
.strict();

export default AssetCreateOrConnectWithoutMediaInputSchema;
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { Prisma } from "../../client";
import { z } from "zod";
import { AssetWhereUniqueInputSchema } from "./AssetWhereUniqueInputSchema";
import { AssetCreateWithoutRundownInputSchema } from "./AssetCreateWithoutRundownInputSchema";
import { AssetUncheckedCreateWithoutRundownInputSchema } from "./AssetUncheckedCreateWithoutRundownInputSchema";

export const AssetCreateOrConnectWithoutRundownInputSchema: z.ZodType<Prisma.AssetCreateOrConnectWithoutRundownInput> =
z
.object({
where: z.lazy(() => AssetWhereUniqueInputSchema),
create: z.union([
z.lazy(() => AssetCreateWithoutRundownInputSchema),
z.lazy(() => AssetUncheckedCreateWithoutRundownInputSchema),
]),
})
.strict();

export default AssetCreateOrConnectWithoutRundownInputSchema;
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { Prisma } from "../../client";
import { z } from "zod";
import { AssetTypeSchema } from "./AssetTypeSchema";
import { MediaCreateNestedOneWithoutAssetInputSchema } from "./MediaCreateNestedOneWithoutAssetInputSchema";
import { RundownCreateNestedOneWithoutAssetsInputSchema } from "./RundownCreateNestedOneWithoutAssetsInputSchema";

export const AssetCreateWithoutLoadJobsInputSchema: z.ZodType<Prisma.AssetCreateWithoutLoadJobsInput> =
z
.object({
name: z.string(),
type: z.lazy(() => AssetTypeSchema),
media: z.lazy(() => MediaCreateNestedOneWithoutAssetInputSchema),
rundown: z.lazy(() => RundownCreateNestedOneWithoutAssetsInputSchema),
})
.strict();

export default AssetCreateWithoutLoadJobsInputSchema;
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import type { Prisma } from "../../client";
import { z } from "zod";
import { AssetTypeSchema } from "./AssetTypeSchema";
import { RundownCreateNestedOneWithoutAssetsInputSchema } from "./RundownCreateNestedOneWithoutAssetsInputSchema";
import { LoadAssetJobCreateNestedManyWithoutAssetInputSchema } from "./LoadAssetJobCreateNestedManyWithoutAssetInputSchema";

export const AssetCreateWithoutMediaInputSchema: z.ZodType<Prisma.AssetCreateWithoutMediaInput> =
z
.object({
name: z.string(),
type: z.lazy(() => AssetTypeSchema),
rundown: z.lazy(() => RundownCreateNestedOneWithoutAssetsInputSchema),
loadJobs: z
.lazy(() => LoadAssetJobCreateNestedManyWithoutAssetInputSchema)
.optional(),
})
.strict();

export default AssetCreateWithoutMediaInputSchema;
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import type { Prisma } from "../../client";
import { z } from "zod";
import { AssetTypeSchema } from "./AssetTypeSchema";
import { MediaCreateNestedOneWithoutAssetInputSchema } from "./MediaCreateNestedOneWithoutAssetInputSchema";
import { LoadAssetJobCreateNestedManyWithoutAssetInputSchema } from "./LoadAssetJobCreateNestedManyWithoutAssetInputSchema";

export const AssetCreateWithoutRundownInputSchema: z.ZodType<Prisma.AssetCreateWithoutRundownInput> =
z
.object({
name: z.string(),
type: z.lazy(() => AssetTypeSchema),
media: z.lazy(() => MediaCreateNestedOneWithoutAssetInputSchema),
loadJobs: z
.lazy(() => LoadAssetJobCreateNestedManyWithoutAssetInputSchema)
.optional(),
})
.strict();

export default AssetCreateWithoutRundownInputSchema;
21 changes: 21 additions & 0 deletions utility/prisma/types/inputTypeSchemas/AssetIncludeSchema.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { z } from "zod";
import type { Prisma } from "../../client";
import { MediaArgsSchema } from "../outputTypeSchemas/MediaArgsSchema";
import { RundownArgsSchema } from "../outputTypeSchemas/RundownArgsSchema";
import { LoadAssetJobFindManyArgsSchema } from "../outputTypeSchemas/LoadAssetJobFindManyArgsSchema";
import { AssetCountOutputTypeArgsSchema } from "../outputTypeSchemas/AssetCountOutputTypeArgsSchema";

export const AssetIncludeSchema: z.ZodType<Prisma.AssetInclude> = z
.object({
media: z.union([z.boolean(), z.lazy(() => MediaArgsSchema)]).optional(),
rundown: z.union([z.boolean(), z.lazy(() => RundownArgsSchema)]).optional(),
loadJobs: z
.union([z.boolean(), z.lazy(() => LoadAssetJobFindManyArgsSchema)])
.optional(),
_count: z
.union([z.boolean(), z.lazy(() => AssetCountOutputTypeArgsSchema)])
.optional(),
})
.strict();

export default AssetIncludeSchema;
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { Prisma } from "../../client";
import { z } from "zod";
import { AssetWhereInputSchema } from "./AssetWhereInputSchema";

export const AssetListRelationFilterSchema: z.ZodType<Prisma.AssetListRelationFilter> =
z
.object({
every: z.lazy(() => AssetWhereInputSchema).optional(),
some: z.lazy(() => AssetWhereInputSchema).optional(),
none: z.lazy(() => AssetWhereInputSchema).optional(),
})
.strict();

export default AssetListRelationFilterSchema;
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import type { Prisma } from "../../client";
import { z } from "zod";
import { SortOrderSchema } from "./SortOrderSchema";

export const AssetMaxOrderByAggregateInputSchema: z.ZodType<Prisma.AssetMaxOrderByAggregateInput> =
z
.object({
id: z.lazy(() => SortOrderSchema).optional(),
name: z.lazy(() => SortOrderSchema).optional(),
type: z.lazy(() => SortOrderSchema).optional(),
rundownId: z.lazy(() => SortOrderSchema).optional(),
mediaId: z.lazy(() => SortOrderSchema).optional(),
})
.strict();

export default AssetMaxOrderByAggregateInputSchema;
Loading

0 comments on commit 30deaa7

Please sign in to comment.