/** * Houses utility types commonly used on the api side */ import type { O, A } from 'ts-toolbelt'; /** * ---- Prisma SDL Type Merge ---- * SDL is source of truth for KEYS * Prisma types is source of truth for VALUES (unless SDL-only field) */ type AnyObject = Record; type SdlOnlyFields = Omit; type PrismaTypeWithOptionalKeysFromSdl = Pick>; type PrismaTypeWithOptionalKeysAndNullableValues = { [k in keyof PrismaTypeWithOptionalKeysFromSdl]?: PrismaTypeWithOptionalKeysFromSdl[k] | null; }; type PrismaTypeWithRequiredKeysFromSdl = Pick>; type OptionalsAndSdlOnly = PrismaTypeWithOptionalKeysAndNullableValues & SdlOnlyFields; export type MakeRelationsOptional = { [key in keyof T as T[key] extends TAllMappedModels ? key : never]?: MakeRelationsOptional; } & { [key in keyof T as T[key] extends TAllMappedModels ? never : key]: T[key]; }; export type MergePrismaWithSdlTypes = A.Compute> & PrismaTypeWithRequiredKeysFromSdl>>; export {}; //# sourceMappingURL=types.d.ts.map