json-api-nestjs
Version:
JsonApi Plugin for NestJs
32 lines (31 loc) • 5.89 kB
TypeScript
import { z } from 'zod';
import { ObjectLiteral } from '../../../../types';
import { ResultGetField, ZodInfer } from '../../types';
export declare function zodFieldsInputQuery<E extends ObjectLiteral>(relationList: ResultGetField<E>['relations']): z.ZodEffects<z.ZodOptional<z.ZodEffects<z.ZodObject<z.objectUtil.extendShape<{
target: z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>;
}, { [K in import("../../types").TupleOfEntityRelation<E, import("../../types").UnionToTuple<import("../../types").EntityRelation<E>>>[number]]: z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>; }>, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<z.objectUtil.extendShape<{
target: z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>;
}, { [K in import("../../types").TupleOfEntityRelation<E, import("../../types").UnionToTuple<import("../../types").EntityRelation<E>>>[number]]: z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>; }>>, any> extends infer T ? { [k in keyof T]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<z.objectUtil.extendShape<{
target: z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>;
}, { [K in import("../../types").TupleOfEntityRelation<E, import("../../types").UnionToTuple<import("../../types").EntityRelation<E>>>[number]]: z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>; }>>, any>[k]; } : never, z.baseObjectInputType<z.objectUtil.extendShape<{
target: z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>;
}, { [K in import("../../types").TupleOfEntityRelation<E, import("../../types").UnionToTuple<import("../../types").EntityRelation<E>>>[number]]: z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>; }>> extends infer T_1 ? { [k_1 in keyof T_1]: z.baseObjectInputType<z.objectUtil.extendShape<{
target: z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>;
}, { [K in import("../../types").TupleOfEntityRelation<E, import("../../types").UnionToTuple<import("../../types").EntityRelation<E>>>[number]]: z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>; }>>[k_1]; } : never>, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<z.objectUtil.extendShape<{
target: z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>;
}, { [K in import("../../types").TupleOfEntityRelation<E, import("../../types").UnionToTuple<import("../../types").EntityRelation<E>>>[number]]: z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>; }>>, any> extends infer T ? { [k in keyof T]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<z.objectUtil.extendShape<{
target: z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>;
}, { [K in import("../../types").TupleOfEntityRelation<E, import("../../types").UnionToTuple<import("../../types").EntityRelation<E>>>[number]]: z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>; }>>, any>[k]; } : never, z.baseObjectInputType<z.objectUtil.extendShape<{
target: z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>;
}, { [K in import("../../types").TupleOfEntityRelation<E, import("../../types").UnionToTuple<import("../../types").EntityRelation<E>>>[number]]: z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>; }>> extends infer T_1 ? { [k_1 in keyof T_1]: z.baseObjectInputType<z.objectUtil.extendShape<{
target: z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>;
}, { [K in import("../../types").TupleOfEntityRelation<E, import("../../types").UnionToTuple<import("../../types").EntityRelation<E>>>[number]]: z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>; }>>[k_1]; } : never>>, (z.objectUtil.addQuestionMarks<z.baseObjectOutputType<z.objectUtil.extendShape<{
target: z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>;
}, { [K in import("../../types").TupleOfEntityRelation<E, import("../../types").UnionToTuple<import("../../types").EntityRelation<E>>>[number]]: z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>; }>>, any> extends infer T ? { [k in keyof T]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<z.objectUtil.extendShape<{
target: z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>;
}, { [K in import("../../types").TupleOfEntityRelation<E, import("../../types").UnionToTuple<import("../../types").EntityRelation<E>>>[number]]: z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>; }>>, any>[k]; } : never) | null, (z.baseObjectInputType<z.objectUtil.extendShape<{
target: z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>;
}, { [K in import("../../types").TupleOfEntityRelation<E, import("../../types").UnionToTuple<import("../../types").EntityRelation<E>>>[number]]: z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>; }>> extends infer T_1 ? { [k_1 in keyof T_1]: z.baseObjectInputType<z.objectUtil.extendShape<{
target: z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>;
}, { [K in import("../../types").TupleOfEntityRelation<E, import("../../types").UnionToTuple<import("../../types").EntityRelation<E>>>[number]]: z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>; }>>[k_1]; } : never) | undefined>;
export type ZodFieldsInputQuery<E extends ObjectLiteral> = ZodInfer<typeof zodFieldsInputQuery<E>>;