Skip to content

Types

RecordIdRef

RecordIdRef represents a reference to a record in a collection by its id and its collection name.

type RecordIdRef<C extends string> = { collection: C; id: string };

RecordSlugRef

RecordSlugRef represents a reference to a record in a collection by its slug and its collection name.

type RecordSlugRef<C extends string> = { collection: C; slug: string };

RecordRef

RecordRef represents either a RecordIdRef or a RecordSlugRef.

type RecordRef<C extends string> = RecordIdRef<C> | RecordSlugRef<C>;

RecordFullListOpts

type RecordFullListOpts<S extends AnyZodRecord> = RecordListOpts<S> & { batch?: number };

RecordListOpts

type RecordListOpts<S extends AnyZodRecord> = {
filter?: string;
page?: number;
perPage?: number;
skipTotal?: boolean;
sort?: ZodRecordSort<S>;
};

AnyZodRecord

AnyZodRecord represents the type for a record schema.

type AnyZodRecord = AnyZodObject | ZodEffects<AnyZodObject>;

ZodRecordSort

ZodRecordSort represents the type for a record sort options.

export type ZodRecordSort<S extends AnyZodRecord> = `${"+" | "-"}${ZodRecordMainKeys<S>}` | "@random";