mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
adding zenstack.
This commit is contained in:
@@ -0,0 +1,334 @@
|
||||
/******************************************************************************
|
||||
* This file was generated by ZenStack CLI.
|
||||
******************************************************************************/
|
||||
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import type { Prisma, Agent } from "@prisma/client";
|
||||
import type { UseMutationOptions, UseQueryOptions, UseInfiniteQueryOptions, InfiniteData } from '@tanstack/react-query';
|
||||
import { getHooksContext } from '@zenstackhq/tanstack-query/runtime-v5/react';
|
||||
import { useModelQuery, useInfiniteModelQuery, useModelMutation } from '@zenstackhq/tanstack-query/runtime-v5/react';
|
||||
import type { PickEnumerable, CheckSelect, QueryError, ExtraQueryOptions, ExtraMutationOptions } from '@zenstackhq/tanstack-query/runtime-v5';
|
||||
import type { PolicyCrudKind } from '@zenstackhq/runtime'
|
||||
import metadata from './__model_meta';
|
||||
type DefaultError = QueryError;
|
||||
import { useSuspenseModelQuery, useSuspenseInfiniteModelQuery } from '@zenstackhq/tanstack-query/runtime-v5/react';
|
||||
import type { UseSuspenseQueryOptions, UseSuspenseInfiniteQueryOptions } from '@tanstack/react-query';
|
||||
|
||||
export function useCreateAgent(options?: Omit<(UseMutationOptions<(Agent | undefined), DefaultError, Prisma.AgentCreateArgs> & ExtraMutationOptions), 'mutationFn'>) {
|
||||
const { endpoint, fetch } = getHooksContext();
|
||||
const _mutation =
|
||||
useModelMutation<Prisma.AgentCreateArgs, DefaultError, Agent, true>('Agent', 'POST', `${endpoint}/agent/create`, metadata, options, fetch, true)
|
||||
;
|
||||
const mutation = {
|
||||
..._mutation,
|
||||
mutateAsync: async <T extends Prisma.AgentCreateArgs>(
|
||||
args: Prisma.SelectSubset<T, Prisma.AgentCreateArgs>,
|
||||
options?: Omit<(UseMutationOptions<(CheckSelect<T, Agent, Prisma.AgentGetPayload<T>> | undefined), DefaultError, Prisma.SelectSubset<T, Prisma.AgentCreateArgs>> & ExtraMutationOptions), 'mutationFn'>
|
||||
) => {
|
||||
return (await _mutation.mutateAsync(
|
||||
args,
|
||||
options as any
|
||||
)) as (CheckSelect<T, Agent, Prisma.AgentGetPayload<T>> | undefined);
|
||||
},
|
||||
};
|
||||
return mutation;
|
||||
}
|
||||
|
||||
export function useCreateManyAgent(options?: Omit<(UseMutationOptions<Prisma.BatchPayload, DefaultError, Prisma.AgentCreateManyArgs> & ExtraMutationOptions), 'mutationFn'>) {
|
||||
const { endpoint, fetch } = getHooksContext();
|
||||
const _mutation =
|
||||
useModelMutation<Prisma.AgentCreateManyArgs, DefaultError, Prisma.BatchPayload, false>('Agent', 'POST', `${endpoint}/agent/createMany`, metadata, options, fetch, false)
|
||||
;
|
||||
const mutation = {
|
||||
..._mutation,
|
||||
mutateAsync: async <T extends Prisma.AgentCreateManyArgs>(
|
||||
args: Prisma.SelectSubset<T, Prisma.AgentCreateManyArgs>,
|
||||
options?: Omit<(UseMutationOptions<Prisma.BatchPayload, DefaultError, Prisma.SelectSubset<T, Prisma.AgentCreateManyArgs>> & ExtraMutationOptions), 'mutationFn'>
|
||||
) => {
|
||||
return (await _mutation.mutateAsync(
|
||||
args,
|
||||
options as any
|
||||
)) as Prisma.BatchPayload;
|
||||
},
|
||||
};
|
||||
return mutation;
|
||||
}
|
||||
|
||||
export function useFindManyAgent<TArgs extends Prisma.AgentFindManyArgs, TQueryFnData = Array<Prisma.AgentGetPayload<TArgs> & { $optimistic?: boolean }>, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset<TArgs, Prisma.AgentFindManyArgs>, options?: (Omit<UseQueryOptions<TQueryFnData, TError, TData>, 'queryKey'> & ExtraQueryOptions)) {
|
||||
const { endpoint, fetch } = getHooksContext();
|
||||
return useModelQuery<TQueryFnData, TData, TError>('Agent', `${endpoint}/agent/findMany`, args, options, fetch);
|
||||
}
|
||||
|
||||
export function useInfiniteFindManyAgent<TArgs extends Prisma.AgentFindManyArgs, TQueryFnData = Array<Prisma.AgentGetPayload<TArgs>>, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset<TArgs, Prisma.AgentFindManyArgs>, options?: Omit<UseInfiniteQueryOptions<TQueryFnData, TError, InfiniteData<TData>>, 'queryKey' | 'initialPageParam'>) {
|
||||
options = options ?? { getNextPageParam: () => null };
|
||||
const { endpoint, fetch } = getHooksContext();
|
||||
return useInfiniteModelQuery<TQueryFnData, TData, TError>('Agent', `${endpoint}/agent/findMany`, args, options, fetch);
|
||||
}
|
||||
|
||||
export function useSuspenseFindManyAgent<TArgs extends Prisma.AgentFindManyArgs, TQueryFnData = Array<Prisma.AgentGetPayload<TArgs> & { $optimistic?: boolean }>, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset<TArgs, Prisma.AgentFindManyArgs>, options?: (Omit<UseSuspenseQueryOptions<TQueryFnData, TError, TData>, 'queryKey'> & ExtraQueryOptions)) {
|
||||
const { endpoint, fetch } = getHooksContext();
|
||||
return useSuspenseModelQuery<TQueryFnData, TData, TError>('Agent', `${endpoint}/agent/findMany`, args, options, fetch);
|
||||
}
|
||||
|
||||
export function useSuspenseInfiniteFindManyAgent<TArgs extends Prisma.AgentFindManyArgs, TQueryFnData = Array<Prisma.AgentGetPayload<TArgs>>, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset<TArgs, Prisma.AgentFindManyArgs>, options?: Omit<UseSuspenseInfiniteQueryOptions<TQueryFnData, TError, InfiniteData<TData>>, 'queryKey' | 'initialPageParam'>) {
|
||||
options = options ?? { getNextPageParam: () => null };
|
||||
const { endpoint, fetch } = getHooksContext();
|
||||
return useSuspenseInfiniteModelQuery<TQueryFnData, TData, TError>('Agent', `${endpoint}/agent/findMany`, args, options, fetch);
|
||||
}
|
||||
|
||||
export function useFindUniqueAgent<TArgs extends Prisma.AgentFindUniqueArgs, TQueryFnData = Prisma.AgentGetPayload<TArgs> & { $optimistic?: boolean }, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset<TArgs, Prisma.AgentFindUniqueArgs>, options?: (Omit<UseQueryOptions<TQueryFnData, TError, TData>, 'queryKey'> & ExtraQueryOptions)) {
|
||||
const { endpoint, fetch } = getHooksContext();
|
||||
return useModelQuery<TQueryFnData, TData, TError>('Agent', `${endpoint}/agent/findUnique`, args, options, fetch);
|
||||
}
|
||||
|
||||
export function useSuspenseFindUniqueAgent<TArgs extends Prisma.AgentFindUniqueArgs, TQueryFnData = Prisma.AgentGetPayload<TArgs> & { $optimistic?: boolean }, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset<TArgs, Prisma.AgentFindUniqueArgs>, options?: (Omit<UseSuspenseQueryOptions<TQueryFnData, TError, TData>, 'queryKey'> & ExtraQueryOptions)) {
|
||||
const { endpoint, fetch } = getHooksContext();
|
||||
return useSuspenseModelQuery<TQueryFnData, TData, TError>('Agent', `${endpoint}/agent/findUnique`, args, options, fetch);
|
||||
}
|
||||
|
||||
export function useFindFirstAgent<TArgs extends Prisma.AgentFindFirstArgs, TQueryFnData = Prisma.AgentGetPayload<TArgs> & { $optimistic?: boolean }, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset<TArgs, Prisma.AgentFindFirstArgs>, options?: (Omit<UseQueryOptions<TQueryFnData, TError, TData>, 'queryKey'> & ExtraQueryOptions)) {
|
||||
const { endpoint, fetch } = getHooksContext();
|
||||
return useModelQuery<TQueryFnData, TData, TError>('Agent', `${endpoint}/agent/findFirst`, args, options, fetch);
|
||||
}
|
||||
|
||||
export function useSuspenseFindFirstAgent<TArgs extends Prisma.AgentFindFirstArgs, TQueryFnData = Prisma.AgentGetPayload<TArgs> & { $optimistic?: boolean }, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset<TArgs, Prisma.AgentFindFirstArgs>, options?: (Omit<UseSuspenseQueryOptions<TQueryFnData, TError, TData>, 'queryKey'> & ExtraQueryOptions)) {
|
||||
const { endpoint, fetch } = getHooksContext();
|
||||
return useSuspenseModelQuery<TQueryFnData, TData, TError>('Agent', `${endpoint}/agent/findFirst`, args, options, fetch);
|
||||
}
|
||||
|
||||
export function useUpdateAgent(options?: Omit<(UseMutationOptions<(Agent | undefined), DefaultError, Prisma.AgentUpdateArgs> & ExtraMutationOptions), 'mutationFn'>) {
|
||||
const { endpoint, fetch } = getHooksContext();
|
||||
const _mutation =
|
||||
useModelMutation<Prisma.AgentUpdateArgs, DefaultError, Agent, true>('Agent', 'PUT', `${endpoint}/agent/update`, metadata, options, fetch, true)
|
||||
;
|
||||
const mutation = {
|
||||
..._mutation,
|
||||
mutateAsync: async <T extends Prisma.AgentUpdateArgs>(
|
||||
args: Prisma.SelectSubset<T, Prisma.AgentUpdateArgs>,
|
||||
options?: Omit<(UseMutationOptions<(CheckSelect<T, Agent, Prisma.AgentGetPayload<T>> | undefined), DefaultError, Prisma.SelectSubset<T, Prisma.AgentUpdateArgs>> & ExtraMutationOptions), 'mutationFn'>
|
||||
) => {
|
||||
return (await _mutation.mutateAsync(
|
||||
args,
|
||||
options as any
|
||||
)) as (CheckSelect<T, Agent, Prisma.AgentGetPayload<T>> | undefined);
|
||||
},
|
||||
};
|
||||
return mutation;
|
||||
}
|
||||
|
||||
export function useUpdateManyAgent(options?: Omit<(UseMutationOptions<Prisma.BatchPayload, DefaultError, Prisma.AgentUpdateManyArgs> & ExtraMutationOptions), 'mutationFn'>) {
|
||||
const { endpoint, fetch } = getHooksContext();
|
||||
const _mutation =
|
||||
useModelMutation<Prisma.AgentUpdateManyArgs, DefaultError, Prisma.BatchPayload, false>('Agent', 'PUT', `${endpoint}/agent/updateMany`, metadata, options, fetch, false)
|
||||
;
|
||||
const mutation = {
|
||||
..._mutation,
|
||||
mutateAsync: async <T extends Prisma.AgentUpdateManyArgs>(
|
||||
args: Prisma.SelectSubset<T, Prisma.AgentUpdateManyArgs>,
|
||||
options?: Omit<(UseMutationOptions<Prisma.BatchPayload, DefaultError, Prisma.SelectSubset<T, Prisma.AgentUpdateManyArgs>> & ExtraMutationOptions), 'mutationFn'>
|
||||
) => {
|
||||
return (await _mutation.mutateAsync(
|
||||
args,
|
||||
options as any
|
||||
)) as Prisma.BatchPayload;
|
||||
},
|
||||
};
|
||||
return mutation;
|
||||
}
|
||||
|
||||
export function useUpsertAgent(options?: Omit<(UseMutationOptions<(Agent | undefined), DefaultError, Prisma.AgentUpsertArgs> & ExtraMutationOptions), 'mutationFn'>) {
|
||||
const { endpoint, fetch } = getHooksContext();
|
||||
const _mutation =
|
||||
useModelMutation<Prisma.AgentUpsertArgs, DefaultError, Agent, true>('Agent', 'POST', `${endpoint}/agent/upsert`, metadata, options, fetch, true)
|
||||
;
|
||||
const mutation = {
|
||||
..._mutation,
|
||||
mutateAsync: async <T extends Prisma.AgentUpsertArgs>(
|
||||
args: Prisma.SelectSubset<T, Prisma.AgentUpsertArgs>,
|
||||
options?: Omit<(UseMutationOptions<(CheckSelect<T, Agent, Prisma.AgentGetPayload<T>> | undefined), DefaultError, Prisma.SelectSubset<T, Prisma.AgentUpsertArgs>> & ExtraMutationOptions), 'mutationFn'>
|
||||
) => {
|
||||
return (await _mutation.mutateAsync(
|
||||
args,
|
||||
options as any
|
||||
)) as (CheckSelect<T, Agent, Prisma.AgentGetPayload<T>> | undefined);
|
||||
},
|
||||
};
|
||||
return mutation;
|
||||
}
|
||||
|
||||
export function useDeleteAgent(options?: Omit<(UseMutationOptions<(Agent | undefined), DefaultError, Prisma.AgentDeleteArgs> & ExtraMutationOptions), 'mutationFn'>) {
|
||||
const { endpoint, fetch } = getHooksContext();
|
||||
const _mutation =
|
||||
useModelMutation<Prisma.AgentDeleteArgs, DefaultError, Agent, true>('Agent', 'DELETE', `${endpoint}/agent/delete`, metadata, options, fetch, true)
|
||||
;
|
||||
const mutation = {
|
||||
..._mutation,
|
||||
mutateAsync: async <T extends Prisma.AgentDeleteArgs>(
|
||||
args: Prisma.SelectSubset<T, Prisma.AgentDeleteArgs>,
|
||||
options?: Omit<(UseMutationOptions<(CheckSelect<T, Agent, Prisma.AgentGetPayload<T>> | undefined), DefaultError, Prisma.SelectSubset<T, Prisma.AgentDeleteArgs>> & ExtraMutationOptions), 'mutationFn'>
|
||||
) => {
|
||||
return (await _mutation.mutateAsync(
|
||||
args,
|
||||
options as any
|
||||
)) as (CheckSelect<T, Agent, Prisma.AgentGetPayload<T>> | undefined);
|
||||
},
|
||||
};
|
||||
return mutation;
|
||||
}
|
||||
|
||||
export function useDeleteManyAgent(options?: Omit<(UseMutationOptions<Prisma.BatchPayload, DefaultError, Prisma.AgentDeleteManyArgs> & ExtraMutationOptions), 'mutationFn'>) {
|
||||
const { endpoint, fetch } = getHooksContext();
|
||||
const _mutation =
|
||||
useModelMutation<Prisma.AgentDeleteManyArgs, DefaultError, Prisma.BatchPayload, false>('Agent', 'DELETE', `${endpoint}/agent/deleteMany`, metadata, options, fetch, false)
|
||||
;
|
||||
const mutation = {
|
||||
..._mutation,
|
||||
mutateAsync: async <T extends Prisma.AgentDeleteManyArgs>(
|
||||
args: Prisma.SelectSubset<T, Prisma.AgentDeleteManyArgs>,
|
||||
options?: Omit<(UseMutationOptions<Prisma.BatchPayload, DefaultError, Prisma.SelectSubset<T, Prisma.AgentDeleteManyArgs>> & ExtraMutationOptions), 'mutationFn'>
|
||||
) => {
|
||||
return (await _mutation.mutateAsync(
|
||||
args,
|
||||
options as any
|
||||
)) as Prisma.BatchPayload;
|
||||
},
|
||||
};
|
||||
return mutation;
|
||||
}
|
||||
|
||||
export function useAggregateAgent<TArgs extends Prisma.AgentAggregateArgs, TQueryFnData = Prisma.GetAgentAggregateType<TArgs>, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset<TArgs, Prisma.AgentAggregateArgs>, options?: (Omit<UseQueryOptions<TQueryFnData, TError, TData>, 'queryKey'> & ExtraQueryOptions)) {
|
||||
const { endpoint, fetch } = getHooksContext();
|
||||
return useModelQuery<TQueryFnData, TData, TError>('Agent', `${endpoint}/agent/aggregate`, args, options, fetch);
|
||||
}
|
||||
|
||||
export function useSuspenseAggregateAgent<TArgs extends Prisma.AgentAggregateArgs, TQueryFnData = Prisma.GetAgentAggregateType<TArgs>, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset<TArgs, Prisma.AgentAggregateArgs>, options?: (Omit<UseSuspenseQueryOptions<TQueryFnData, TError, TData>, 'queryKey'> & ExtraQueryOptions)) {
|
||||
const { endpoint, fetch } = getHooksContext();
|
||||
return useSuspenseModelQuery<TQueryFnData, TData, TError>('Agent', `${endpoint}/agent/aggregate`, args, options, fetch);
|
||||
}
|
||||
|
||||
export function useGroupByAgent<TArgs extends Prisma.AgentGroupByArgs, HasSelectOrTake extends Prisma.Or<Prisma.Extends<'skip', Prisma.Keys<TArgs>>, Prisma.Extends<'take', Prisma.Keys<TArgs>>>, OrderByArg extends Prisma.True extends HasSelectOrTake ? { orderBy: Prisma.AgentGroupByArgs['orderBy'] } : { orderBy?: Prisma.AgentGroupByArgs['orderBy'] }, OrderFields extends Prisma.ExcludeUnderscoreKeys<Prisma.Keys<Prisma.MaybeTupleToUnion<TArgs['orderBy']>>>, ByFields extends Prisma.MaybeTupleToUnion<TArgs['by']>, ByValid extends Prisma.Has<ByFields, OrderFields>, HavingFields extends Prisma.GetHavingFields<TArgs['having']>, HavingValid extends Prisma.Has<ByFields, HavingFields>, ByEmpty extends TArgs['by'] extends never[] ? Prisma.True : Prisma.False, InputErrors extends ByEmpty extends Prisma.True
|
||||
? `Error: "by" must not be empty.`
|
||||
: HavingValid extends Prisma.False
|
||||
? {
|
||||
[P in HavingFields]: P extends ByFields
|
||||
? never
|
||||
: P extends string
|
||||
? `Error: Field "${P}" used in "having" needs to be provided in "by".`
|
||||
: [
|
||||
Error,
|
||||
'Field ',
|
||||
P,
|
||||
` in "having" needs to be provided in "by"`,
|
||||
]
|
||||
}[HavingFields]
|
||||
: 'take' extends Prisma.Keys<TArgs>
|
||||
? 'orderBy' extends Prisma.Keys<TArgs>
|
||||
? ByValid extends Prisma.True
|
||||
? {}
|
||||
: {
|
||||
[P in OrderFields]: P extends ByFields
|
||||
? never
|
||||
: `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
|
||||
}[OrderFields]
|
||||
: 'Error: If you provide "take", you also need to provide "orderBy"'
|
||||
: 'skip' extends Prisma.Keys<TArgs>
|
||||
? 'orderBy' extends Prisma.Keys<TArgs>
|
||||
? ByValid extends Prisma.True
|
||||
? {}
|
||||
: {
|
||||
[P in OrderFields]: P extends ByFields
|
||||
? never
|
||||
: `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
|
||||
}[OrderFields]
|
||||
: 'Error: If you provide "skip", you also need to provide "orderBy"'
|
||||
: ByValid extends Prisma.True
|
||||
? {}
|
||||
: {
|
||||
[P in OrderFields]: P extends ByFields
|
||||
? never
|
||||
: `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
|
||||
}[OrderFields], TQueryFnData = {} extends InputErrors ?
|
||||
Array<PickEnumerable<Prisma.AgentGroupByOutputType, TArgs['by']> &
|
||||
{
|
||||
[P in ((keyof TArgs) & (keyof Prisma.AgentGroupByOutputType))]: P extends '_count'
|
||||
? TArgs[P] extends boolean
|
||||
? number
|
||||
: Prisma.GetScalarType<TArgs[P], Prisma.AgentGroupByOutputType[P]>
|
||||
: Prisma.GetScalarType<TArgs[P], Prisma.AgentGroupByOutputType[P]>
|
||||
}
|
||||
> : InputErrors, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset<TArgs, Prisma.SubsetIntersection<TArgs, Prisma.AgentGroupByArgs, OrderByArg> & InputErrors>, options?: (Omit<UseQueryOptions<TQueryFnData, TError, TData>, 'queryKey'> & ExtraQueryOptions)) {
|
||||
const { endpoint, fetch } = getHooksContext();
|
||||
return useModelQuery<TQueryFnData, TData, TError>('Agent', `${endpoint}/agent/groupBy`, args, options, fetch);
|
||||
}
|
||||
|
||||
export function useSuspenseGroupByAgent<TArgs extends Prisma.AgentGroupByArgs, HasSelectOrTake extends Prisma.Or<Prisma.Extends<'skip', Prisma.Keys<TArgs>>, Prisma.Extends<'take', Prisma.Keys<TArgs>>>, OrderByArg extends Prisma.True extends HasSelectOrTake ? { orderBy: Prisma.AgentGroupByArgs['orderBy'] } : { orderBy?: Prisma.AgentGroupByArgs['orderBy'] }, OrderFields extends Prisma.ExcludeUnderscoreKeys<Prisma.Keys<Prisma.MaybeTupleToUnion<TArgs['orderBy']>>>, ByFields extends Prisma.MaybeTupleToUnion<TArgs['by']>, ByValid extends Prisma.Has<ByFields, OrderFields>, HavingFields extends Prisma.GetHavingFields<TArgs['having']>, HavingValid extends Prisma.Has<ByFields, HavingFields>, ByEmpty extends TArgs['by'] extends never[] ? Prisma.True : Prisma.False, InputErrors extends ByEmpty extends Prisma.True
|
||||
? `Error: "by" must not be empty.`
|
||||
: HavingValid extends Prisma.False
|
||||
? {
|
||||
[P in HavingFields]: P extends ByFields
|
||||
? never
|
||||
: P extends string
|
||||
? `Error: Field "${P}" used in "having" needs to be provided in "by".`
|
||||
: [
|
||||
Error,
|
||||
'Field ',
|
||||
P,
|
||||
` in "having" needs to be provided in "by"`,
|
||||
]
|
||||
}[HavingFields]
|
||||
: 'take' extends Prisma.Keys<TArgs>
|
||||
? 'orderBy' extends Prisma.Keys<TArgs>
|
||||
? ByValid extends Prisma.True
|
||||
? {}
|
||||
: {
|
||||
[P in OrderFields]: P extends ByFields
|
||||
? never
|
||||
: `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
|
||||
}[OrderFields]
|
||||
: 'Error: If you provide "take", you also need to provide "orderBy"'
|
||||
: 'skip' extends Prisma.Keys<TArgs>
|
||||
? 'orderBy' extends Prisma.Keys<TArgs>
|
||||
? ByValid extends Prisma.True
|
||||
? {}
|
||||
: {
|
||||
[P in OrderFields]: P extends ByFields
|
||||
? never
|
||||
: `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
|
||||
}[OrderFields]
|
||||
: 'Error: If you provide "skip", you also need to provide "orderBy"'
|
||||
: ByValid extends Prisma.True
|
||||
? {}
|
||||
: {
|
||||
[P in OrderFields]: P extends ByFields
|
||||
? never
|
||||
: `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
|
||||
}[OrderFields], TQueryFnData = {} extends InputErrors ?
|
||||
Array<PickEnumerable<Prisma.AgentGroupByOutputType, TArgs['by']> &
|
||||
{
|
||||
[P in ((keyof TArgs) & (keyof Prisma.AgentGroupByOutputType))]: P extends '_count'
|
||||
? TArgs[P] extends boolean
|
||||
? number
|
||||
: Prisma.GetScalarType<TArgs[P], Prisma.AgentGroupByOutputType[P]>
|
||||
: Prisma.GetScalarType<TArgs[P], Prisma.AgentGroupByOutputType[P]>
|
||||
}
|
||||
> : InputErrors, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset<TArgs, Prisma.SubsetIntersection<TArgs, Prisma.AgentGroupByArgs, OrderByArg> & InputErrors>, options?: (Omit<UseSuspenseQueryOptions<TQueryFnData, TError, TData>, 'queryKey'> & ExtraQueryOptions)) {
|
||||
const { endpoint, fetch } = getHooksContext();
|
||||
return useSuspenseModelQuery<TQueryFnData, TData, TError>('Agent', `${endpoint}/agent/groupBy`, args, options, fetch);
|
||||
}
|
||||
|
||||
export function useCountAgent<TArgs extends Prisma.AgentCountArgs, TQueryFnData = TArgs extends { select: any; } ? TArgs['select'] extends true ? number : Prisma.GetScalarType<TArgs['select'], Prisma.AgentCountAggregateOutputType> : number, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset<TArgs, Prisma.AgentCountArgs>, options?: (Omit<UseQueryOptions<TQueryFnData, TError, TData>, 'queryKey'> & ExtraQueryOptions)) {
|
||||
const { endpoint, fetch } = getHooksContext();
|
||||
return useModelQuery<TQueryFnData, TData, TError>('Agent', `${endpoint}/agent/count`, args, options, fetch);
|
||||
}
|
||||
|
||||
export function useSuspenseCountAgent<TArgs extends Prisma.AgentCountArgs, TQueryFnData = TArgs extends { select: any; } ? TArgs['select'] extends true ? number : Prisma.GetScalarType<TArgs['select'], Prisma.AgentCountAggregateOutputType> : number, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset<TArgs, Prisma.AgentCountArgs>, options?: (Omit<UseSuspenseQueryOptions<TQueryFnData, TError, TData>, 'queryKey'> & ExtraQueryOptions)) {
|
||||
const { endpoint, fetch } = getHooksContext();
|
||||
return useSuspenseModelQuery<TQueryFnData, TData, TError>('Agent', `${endpoint}/agent/count`, args, options, fetch);
|
||||
}
|
||||
|
||||
export function useCheckAgent<TError = DefaultError>(args: { operation: PolicyCrudKind; where?: { id?: string; slug?: string; name?: string; description?: string }; }, options?: (Omit<UseQueryOptions<boolean, TError, boolean>, 'queryKey'> & ExtraQueryOptions)) {
|
||||
const { endpoint, fetch } = getHooksContext();
|
||||
return useModelQuery<boolean, boolean, TError>('Agent', `${endpoint}/agent/check`, args, options, fetch);
|
||||
}
|
||||
Reference in New Issue
Block a user