1032 lines
27 KiB
TypeScript
1032 lines
27 KiB
TypeScript
/**
|
|
* Generated by orval v8.2.0 🍺
|
|
* Do not edit manually.
|
|
* OpenClaw Agency API
|
|
* OpenAPI spec version: 0.3.0
|
|
*/
|
|
import { useMutation, useQuery } from "@tanstack/react-query";
|
|
import type {
|
|
DataTag,
|
|
DefinedInitialDataOptions,
|
|
DefinedUseQueryResult,
|
|
MutationFunction,
|
|
QueryClient,
|
|
QueryFunction,
|
|
QueryKey,
|
|
UndefinedInitialDataOptions,
|
|
UseMutationOptions,
|
|
UseMutationResult,
|
|
UseQueryOptions,
|
|
UseQueryResult,
|
|
} from "@tanstack/react-query";
|
|
|
|
import type {
|
|
HTTPValidationError,
|
|
ListTaskCommentsTaskCommentsGetParams,
|
|
ListTasksTasksGetParams,
|
|
Task,
|
|
TaskComment,
|
|
TaskCommentCreate,
|
|
TaskCreate,
|
|
TaskUpdate,
|
|
} from ".././model";
|
|
|
|
import { customFetch } from "../../mutator";
|
|
|
|
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
|
|
/**
|
|
* @summary List Tasks
|
|
*/
|
|
export type listTasksTasksGetResponse200 = {
|
|
data: Task[];
|
|
status: 200;
|
|
};
|
|
|
|
export type listTasksTasksGetResponse422 = {
|
|
data: HTTPValidationError;
|
|
status: 422;
|
|
};
|
|
|
|
export type listTasksTasksGetResponseSuccess = listTasksTasksGetResponse200 & {
|
|
headers: Headers;
|
|
};
|
|
export type listTasksTasksGetResponseError = listTasksTasksGetResponse422 & {
|
|
headers: Headers;
|
|
};
|
|
|
|
export type listTasksTasksGetResponse =
|
|
| listTasksTasksGetResponseSuccess
|
|
| listTasksTasksGetResponseError;
|
|
|
|
export const getListTasksTasksGetUrl = (params?: ListTasksTasksGetParams) => {
|
|
const normalizedParams = new URLSearchParams();
|
|
|
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
if (value !== undefined) {
|
|
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
}
|
|
});
|
|
|
|
const stringifiedParams = normalizedParams.toString();
|
|
|
|
return stringifiedParams.length > 0
|
|
? `/tasks?${stringifiedParams}`
|
|
: `/tasks`;
|
|
};
|
|
|
|
export const listTasksTasksGet = async (
|
|
params?: ListTasksTasksGetParams,
|
|
options?: RequestInit,
|
|
): Promise<listTasksTasksGetResponse> => {
|
|
return customFetch<listTasksTasksGetResponse>(
|
|
getListTasksTasksGetUrl(params),
|
|
{
|
|
...options,
|
|
method: "GET",
|
|
},
|
|
);
|
|
};
|
|
|
|
export const getListTasksTasksGetQueryKey = (
|
|
params?: ListTasksTasksGetParams,
|
|
) => {
|
|
return [`/tasks`, ...(params ? [params] : [])] as const;
|
|
};
|
|
|
|
export const getListTasksTasksGetQueryOptions = <
|
|
TData = Awaited<ReturnType<typeof listTasksTasksGet>>,
|
|
TError = HTTPValidationError,
|
|
>(
|
|
params?: ListTasksTasksGetParams,
|
|
options?: {
|
|
query?: Partial<
|
|
UseQueryOptions<
|
|
Awaited<ReturnType<typeof listTasksTasksGet>>,
|
|
TError,
|
|
TData
|
|
>
|
|
>;
|
|
request?: SecondParameter<typeof customFetch>;
|
|
},
|
|
) => {
|
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
|
|
const queryKey =
|
|
queryOptions?.queryKey ?? getListTasksTasksGetQueryKey(params);
|
|
|
|
const queryFn: QueryFunction<
|
|
Awaited<ReturnType<typeof listTasksTasksGet>>
|
|
> = ({ signal }) => listTasksTasksGet(params, { signal, ...requestOptions });
|
|
|
|
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
|
|
Awaited<ReturnType<typeof listTasksTasksGet>>,
|
|
TError,
|
|
TData
|
|
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
};
|
|
|
|
export type ListTasksTasksGetQueryResult = NonNullable<
|
|
Awaited<ReturnType<typeof listTasksTasksGet>>
|
|
>;
|
|
export type ListTasksTasksGetQueryError = HTTPValidationError;
|
|
|
|
export function useListTasksTasksGet<
|
|
TData = Awaited<ReturnType<typeof listTasksTasksGet>>,
|
|
TError = HTTPValidationError,
|
|
>(
|
|
params: undefined | ListTasksTasksGetParams,
|
|
options: {
|
|
query: Partial<
|
|
UseQueryOptions<
|
|
Awaited<ReturnType<typeof listTasksTasksGet>>,
|
|
TError,
|
|
TData
|
|
>
|
|
> &
|
|
Pick<
|
|
DefinedInitialDataOptions<
|
|
Awaited<ReturnType<typeof listTasksTasksGet>>,
|
|
TError,
|
|
Awaited<ReturnType<typeof listTasksTasksGet>>
|
|
>,
|
|
"initialData"
|
|
>;
|
|
request?: SecondParameter<typeof customFetch>;
|
|
},
|
|
queryClient?: QueryClient,
|
|
): DefinedUseQueryResult<TData, TError> & {
|
|
queryKey: DataTag<QueryKey, TData, TError>;
|
|
};
|
|
export function useListTasksTasksGet<
|
|
TData = Awaited<ReturnType<typeof listTasksTasksGet>>,
|
|
TError = HTTPValidationError,
|
|
>(
|
|
params?: ListTasksTasksGetParams,
|
|
options?: {
|
|
query?: Partial<
|
|
UseQueryOptions<
|
|
Awaited<ReturnType<typeof listTasksTasksGet>>,
|
|
TError,
|
|
TData
|
|
>
|
|
> &
|
|
Pick<
|
|
UndefinedInitialDataOptions<
|
|
Awaited<ReturnType<typeof listTasksTasksGet>>,
|
|
TError,
|
|
Awaited<ReturnType<typeof listTasksTasksGet>>
|
|
>,
|
|
"initialData"
|
|
>;
|
|
request?: SecondParameter<typeof customFetch>;
|
|
},
|
|
queryClient?: QueryClient,
|
|
): UseQueryResult<TData, TError> & {
|
|
queryKey: DataTag<QueryKey, TData, TError>;
|
|
};
|
|
export function useListTasksTasksGet<
|
|
TData = Awaited<ReturnType<typeof listTasksTasksGet>>,
|
|
TError = HTTPValidationError,
|
|
>(
|
|
params?: ListTasksTasksGetParams,
|
|
options?: {
|
|
query?: Partial<
|
|
UseQueryOptions<
|
|
Awaited<ReturnType<typeof listTasksTasksGet>>,
|
|
TError,
|
|
TData
|
|
>
|
|
>;
|
|
request?: SecondParameter<typeof customFetch>;
|
|
},
|
|
queryClient?: QueryClient,
|
|
): UseQueryResult<TData, TError> & {
|
|
queryKey: DataTag<QueryKey, TData, TError>;
|
|
};
|
|
/**
|
|
* @summary List Tasks
|
|
*/
|
|
|
|
export function useListTasksTasksGet<
|
|
TData = Awaited<ReturnType<typeof listTasksTasksGet>>,
|
|
TError = HTTPValidationError,
|
|
>(
|
|
params?: ListTasksTasksGetParams,
|
|
options?: {
|
|
query?: Partial<
|
|
UseQueryOptions<
|
|
Awaited<ReturnType<typeof listTasksTasksGet>>,
|
|
TError,
|
|
TData
|
|
>
|
|
>;
|
|
request?: SecondParameter<typeof customFetch>;
|
|
},
|
|
queryClient?: QueryClient,
|
|
): UseQueryResult<TData, TError> & {
|
|
queryKey: DataTag<QueryKey, TData, TError>;
|
|
} {
|
|
const queryOptions = getListTasksTasksGetQueryOptions(params, options);
|
|
|
|
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
|
|
TData,
|
|
TError
|
|
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
|
|
return { ...query, queryKey: queryOptions.queryKey };
|
|
}
|
|
|
|
/**
|
|
* @summary Create Task
|
|
*/
|
|
export type createTaskTasksPostResponse200 = {
|
|
data: Task;
|
|
status: 200;
|
|
};
|
|
|
|
export type createTaskTasksPostResponse422 = {
|
|
data: HTTPValidationError;
|
|
status: 422;
|
|
};
|
|
|
|
export type createTaskTasksPostResponseSuccess =
|
|
createTaskTasksPostResponse200 & {
|
|
headers: Headers;
|
|
};
|
|
export type createTaskTasksPostResponseError =
|
|
createTaskTasksPostResponse422 & {
|
|
headers: Headers;
|
|
};
|
|
|
|
export type createTaskTasksPostResponse =
|
|
| createTaskTasksPostResponseSuccess
|
|
| createTaskTasksPostResponseError;
|
|
|
|
export const getCreateTaskTasksPostUrl = () => {
|
|
return `/tasks`;
|
|
};
|
|
|
|
export const createTaskTasksPost = async (
|
|
taskCreate: TaskCreate,
|
|
options?: RequestInit,
|
|
): Promise<createTaskTasksPostResponse> => {
|
|
return customFetch<createTaskTasksPostResponse>(getCreateTaskTasksPostUrl(), {
|
|
...options,
|
|
method: "POST",
|
|
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
body: JSON.stringify(taskCreate),
|
|
});
|
|
};
|
|
|
|
export const getCreateTaskTasksPostMutationOptions = <
|
|
TError = HTTPValidationError,
|
|
TContext = unknown,
|
|
>(options?: {
|
|
mutation?: UseMutationOptions<
|
|
Awaited<ReturnType<typeof createTaskTasksPost>>,
|
|
TError,
|
|
{ data: TaskCreate },
|
|
TContext
|
|
>;
|
|
request?: SecondParameter<typeof customFetch>;
|
|
}): UseMutationOptions<
|
|
Awaited<ReturnType<typeof createTaskTasksPost>>,
|
|
TError,
|
|
{ data: TaskCreate },
|
|
TContext
|
|
> => {
|
|
const mutationKey = ["createTaskTasksPost"];
|
|
const { mutation: mutationOptions, request: requestOptions } = options
|
|
? options.mutation &&
|
|
"mutationKey" in options.mutation &&
|
|
options.mutation.mutationKey
|
|
? options
|
|
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
: { mutation: { mutationKey }, request: undefined };
|
|
|
|
const mutationFn: MutationFunction<
|
|
Awaited<ReturnType<typeof createTaskTasksPost>>,
|
|
{ data: TaskCreate }
|
|
> = (props) => {
|
|
const { data } = props ?? {};
|
|
|
|
return createTaskTasksPost(data, requestOptions);
|
|
};
|
|
|
|
return { mutationFn, ...mutationOptions };
|
|
};
|
|
|
|
export type CreateTaskTasksPostMutationResult = NonNullable<
|
|
Awaited<ReturnType<typeof createTaskTasksPost>>
|
|
>;
|
|
export type CreateTaskTasksPostMutationBody = TaskCreate;
|
|
export type CreateTaskTasksPostMutationError = HTTPValidationError;
|
|
|
|
/**
|
|
* @summary Create Task
|
|
*/
|
|
export const useCreateTaskTasksPost = <
|
|
TError = HTTPValidationError,
|
|
TContext = unknown,
|
|
>(
|
|
options?: {
|
|
mutation?: UseMutationOptions<
|
|
Awaited<ReturnType<typeof createTaskTasksPost>>,
|
|
TError,
|
|
{ data: TaskCreate },
|
|
TContext
|
|
>;
|
|
request?: SecondParameter<typeof customFetch>;
|
|
},
|
|
queryClient?: QueryClient,
|
|
): UseMutationResult<
|
|
Awaited<ReturnType<typeof createTaskTasksPost>>,
|
|
TError,
|
|
{ data: TaskCreate },
|
|
TContext
|
|
> => {
|
|
return useMutation(
|
|
getCreateTaskTasksPostMutationOptions(options),
|
|
queryClient,
|
|
);
|
|
};
|
|
/**
|
|
* @summary Dispatch Task
|
|
*/
|
|
export type dispatchTaskTasksTaskIdDispatchPostResponse200 = {
|
|
data: unknown;
|
|
status: 200;
|
|
};
|
|
|
|
export type dispatchTaskTasksTaskIdDispatchPostResponse422 = {
|
|
data: HTTPValidationError;
|
|
status: 422;
|
|
};
|
|
|
|
export type dispatchTaskTasksTaskIdDispatchPostResponseSuccess =
|
|
dispatchTaskTasksTaskIdDispatchPostResponse200 & {
|
|
headers: Headers;
|
|
};
|
|
export type dispatchTaskTasksTaskIdDispatchPostResponseError =
|
|
dispatchTaskTasksTaskIdDispatchPostResponse422 & {
|
|
headers: Headers;
|
|
};
|
|
|
|
export type dispatchTaskTasksTaskIdDispatchPostResponse =
|
|
| dispatchTaskTasksTaskIdDispatchPostResponseSuccess
|
|
| dispatchTaskTasksTaskIdDispatchPostResponseError;
|
|
|
|
export const getDispatchTaskTasksTaskIdDispatchPostUrl = (taskId: number) => {
|
|
return `/tasks/${taskId}/dispatch`;
|
|
};
|
|
|
|
export const dispatchTaskTasksTaskIdDispatchPost = async (
|
|
taskId: number,
|
|
options?: RequestInit,
|
|
): Promise<dispatchTaskTasksTaskIdDispatchPostResponse> => {
|
|
return customFetch<dispatchTaskTasksTaskIdDispatchPostResponse>(
|
|
getDispatchTaskTasksTaskIdDispatchPostUrl(taskId),
|
|
{
|
|
...options,
|
|
method: "POST",
|
|
},
|
|
);
|
|
};
|
|
|
|
export const getDispatchTaskTasksTaskIdDispatchPostMutationOptions = <
|
|
TError = HTTPValidationError,
|
|
TContext = unknown,
|
|
>(options?: {
|
|
mutation?: UseMutationOptions<
|
|
Awaited<ReturnType<typeof dispatchTaskTasksTaskIdDispatchPost>>,
|
|
TError,
|
|
{ taskId: number },
|
|
TContext
|
|
>;
|
|
request?: SecondParameter<typeof customFetch>;
|
|
}): UseMutationOptions<
|
|
Awaited<ReturnType<typeof dispatchTaskTasksTaskIdDispatchPost>>,
|
|
TError,
|
|
{ taskId: number },
|
|
TContext
|
|
> => {
|
|
const mutationKey = ["dispatchTaskTasksTaskIdDispatchPost"];
|
|
const { mutation: mutationOptions, request: requestOptions } = options
|
|
? options.mutation &&
|
|
"mutationKey" in options.mutation &&
|
|
options.mutation.mutationKey
|
|
? options
|
|
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
: { mutation: { mutationKey }, request: undefined };
|
|
|
|
const mutationFn: MutationFunction<
|
|
Awaited<ReturnType<typeof dispatchTaskTasksTaskIdDispatchPost>>,
|
|
{ taskId: number }
|
|
> = (props) => {
|
|
const { taskId } = props ?? {};
|
|
|
|
return dispatchTaskTasksTaskIdDispatchPost(taskId, requestOptions);
|
|
};
|
|
|
|
return { mutationFn, ...mutationOptions };
|
|
};
|
|
|
|
export type DispatchTaskTasksTaskIdDispatchPostMutationResult = NonNullable<
|
|
Awaited<ReturnType<typeof dispatchTaskTasksTaskIdDispatchPost>>
|
|
>;
|
|
|
|
export type DispatchTaskTasksTaskIdDispatchPostMutationError =
|
|
HTTPValidationError;
|
|
|
|
/**
|
|
* @summary Dispatch Task
|
|
*/
|
|
export const useDispatchTaskTasksTaskIdDispatchPost = <
|
|
TError = HTTPValidationError,
|
|
TContext = unknown,
|
|
>(
|
|
options?: {
|
|
mutation?: UseMutationOptions<
|
|
Awaited<ReturnType<typeof dispatchTaskTasksTaskIdDispatchPost>>,
|
|
TError,
|
|
{ taskId: number },
|
|
TContext
|
|
>;
|
|
request?: SecondParameter<typeof customFetch>;
|
|
},
|
|
queryClient?: QueryClient,
|
|
): UseMutationResult<
|
|
Awaited<ReturnType<typeof dispatchTaskTasksTaskIdDispatchPost>>,
|
|
TError,
|
|
{ taskId: number },
|
|
TContext
|
|
> => {
|
|
return useMutation(
|
|
getDispatchTaskTasksTaskIdDispatchPostMutationOptions(options),
|
|
queryClient,
|
|
);
|
|
};
|
|
/**
|
|
* @summary Update Task
|
|
*/
|
|
export type updateTaskTasksTaskIdPatchResponse200 = {
|
|
data: Task;
|
|
status: 200;
|
|
};
|
|
|
|
export type updateTaskTasksTaskIdPatchResponse422 = {
|
|
data: HTTPValidationError;
|
|
status: 422;
|
|
};
|
|
|
|
export type updateTaskTasksTaskIdPatchResponseSuccess =
|
|
updateTaskTasksTaskIdPatchResponse200 & {
|
|
headers: Headers;
|
|
};
|
|
export type updateTaskTasksTaskIdPatchResponseError =
|
|
updateTaskTasksTaskIdPatchResponse422 & {
|
|
headers: Headers;
|
|
};
|
|
|
|
export type updateTaskTasksTaskIdPatchResponse =
|
|
| updateTaskTasksTaskIdPatchResponseSuccess
|
|
| updateTaskTasksTaskIdPatchResponseError;
|
|
|
|
export const getUpdateTaskTasksTaskIdPatchUrl = (taskId: number) => {
|
|
return `/tasks/${taskId}`;
|
|
};
|
|
|
|
export const updateTaskTasksTaskIdPatch = async (
|
|
taskId: number,
|
|
taskUpdate: TaskUpdate,
|
|
options?: RequestInit,
|
|
): Promise<updateTaskTasksTaskIdPatchResponse> => {
|
|
return customFetch<updateTaskTasksTaskIdPatchResponse>(
|
|
getUpdateTaskTasksTaskIdPatchUrl(taskId),
|
|
{
|
|
...options,
|
|
method: "PATCH",
|
|
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
body: JSON.stringify(taskUpdate),
|
|
},
|
|
);
|
|
};
|
|
|
|
export const getUpdateTaskTasksTaskIdPatchMutationOptions = <
|
|
TError = HTTPValidationError,
|
|
TContext = unknown,
|
|
>(options?: {
|
|
mutation?: UseMutationOptions<
|
|
Awaited<ReturnType<typeof updateTaskTasksTaskIdPatch>>,
|
|
TError,
|
|
{ taskId: number; data: TaskUpdate },
|
|
TContext
|
|
>;
|
|
request?: SecondParameter<typeof customFetch>;
|
|
}): UseMutationOptions<
|
|
Awaited<ReturnType<typeof updateTaskTasksTaskIdPatch>>,
|
|
TError,
|
|
{ taskId: number; data: TaskUpdate },
|
|
TContext
|
|
> => {
|
|
const mutationKey = ["updateTaskTasksTaskIdPatch"];
|
|
const { mutation: mutationOptions, request: requestOptions } = options
|
|
? options.mutation &&
|
|
"mutationKey" in options.mutation &&
|
|
options.mutation.mutationKey
|
|
? options
|
|
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
: { mutation: { mutationKey }, request: undefined };
|
|
|
|
const mutationFn: MutationFunction<
|
|
Awaited<ReturnType<typeof updateTaskTasksTaskIdPatch>>,
|
|
{ taskId: number; data: TaskUpdate }
|
|
> = (props) => {
|
|
const { taskId, data } = props ?? {};
|
|
|
|
return updateTaskTasksTaskIdPatch(taskId, data, requestOptions);
|
|
};
|
|
|
|
return { mutationFn, ...mutationOptions };
|
|
};
|
|
|
|
export type UpdateTaskTasksTaskIdPatchMutationResult = NonNullable<
|
|
Awaited<ReturnType<typeof updateTaskTasksTaskIdPatch>>
|
|
>;
|
|
export type UpdateTaskTasksTaskIdPatchMutationBody = TaskUpdate;
|
|
export type UpdateTaskTasksTaskIdPatchMutationError = HTTPValidationError;
|
|
|
|
/**
|
|
* @summary Update Task
|
|
*/
|
|
export const useUpdateTaskTasksTaskIdPatch = <
|
|
TError = HTTPValidationError,
|
|
TContext = unknown,
|
|
>(
|
|
options?: {
|
|
mutation?: UseMutationOptions<
|
|
Awaited<ReturnType<typeof updateTaskTasksTaskIdPatch>>,
|
|
TError,
|
|
{ taskId: number; data: TaskUpdate },
|
|
TContext
|
|
>;
|
|
request?: SecondParameter<typeof customFetch>;
|
|
},
|
|
queryClient?: QueryClient,
|
|
): UseMutationResult<
|
|
Awaited<ReturnType<typeof updateTaskTasksTaskIdPatch>>,
|
|
TError,
|
|
{ taskId: number; data: TaskUpdate },
|
|
TContext
|
|
> => {
|
|
return useMutation(
|
|
getUpdateTaskTasksTaskIdPatchMutationOptions(options),
|
|
queryClient,
|
|
);
|
|
};
|
|
/**
|
|
* @summary Delete Task
|
|
*/
|
|
export type deleteTaskTasksTaskIdDeleteResponse200 = {
|
|
data: unknown;
|
|
status: 200;
|
|
};
|
|
|
|
export type deleteTaskTasksTaskIdDeleteResponse422 = {
|
|
data: HTTPValidationError;
|
|
status: 422;
|
|
};
|
|
|
|
export type deleteTaskTasksTaskIdDeleteResponseSuccess =
|
|
deleteTaskTasksTaskIdDeleteResponse200 & {
|
|
headers: Headers;
|
|
};
|
|
export type deleteTaskTasksTaskIdDeleteResponseError =
|
|
deleteTaskTasksTaskIdDeleteResponse422 & {
|
|
headers: Headers;
|
|
};
|
|
|
|
export type deleteTaskTasksTaskIdDeleteResponse =
|
|
| deleteTaskTasksTaskIdDeleteResponseSuccess
|
|
| deleteTaskTasksTaskIdDeleteResponseError;
|
|
|
|
export const getDeleteTaskTasksTaskIdDeleteUrl = (taskId: number) => {
|
|
return `/tasks/${taskId}`;
|
|
};
|
|
|
|
export const deleteTaskTasksTaskIdDelete = async (
|
|
taskId: number,
|
|
options?: RequestInit,
|
|
): Promise<deleteTaskTasksTaskIdDeleteResponse> => {
|
|
return customFetch<deleteTaskTasksTaskIdDeleteResponse>(
|
|
getDeleteTaskTasksTaskIdDeleteUrl(taskId),
|
|
{
|
|
...options,
|
|
method: "DELETE",
|
|
},
|
|
);
|
|
};
|
|
|
|
export const getDeleteTaskTasksTaskIdDeleteMutationOptions = <
|
|
TError = HTTPValidationError,
|
|
TContext = unknown,
|
|
>(options?: {
|
|
mutation?: UseMutationOptions<
|
|
Awaited<ReturnType<typeof deleteTaskTasksTaskIdDelete>>,
|
|
TError,
|
|
{ taskId: number },
|
|
TContext
|
|
>;
|
|
request?: SecondParameter<typeof customFetch>;
|
|
}): UseMutationOptions<
|
|
Awaited<ReturnType<typeof deleteTaskTasksTaskIdDelete>>,
|
|
TError,
|
|
{ taskId: number },
|
|
TContext
|
|
> => {
|
|
const mutationKey = ["deleteTaskTasksTaskIdDelete"];
|
|
const { mutation: mutationOptions, request: requestOptions } = options
|
|
? options.mutation &&
|
|
"mutationKey" in options.mutation &&
|
|
options.mutation.mutationKey
|
|
? options
|
|
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
: { mutation: { mutationKey }, request: undefined };
|
|
|
|
const mutationFn: MutationFunction<
|
|
Awaited<ReturnType<typeof deleteTaskTasksTaskIdDelete>>,
|
|
{ taskId: number }
|
|
> = (props) => {
|
|
const { taskId } = props ?? {};
|
|
|
|
return deleteTaskTasksTaskIdDelete(taskId, requestOptions);
|
|
};
|
|
|
|
return { mutationFn, ...mutationOptions };
|
|
};
|
|
|
|
export type DeleteTaskTasksTaskIdDeleteMutationResult = NonNullable<
|
|
Awaited<ReturnType<typeof deleteTaskTasksTaskIdDelete>>
|
|
>;
|
|
|
|
export type DeleteTaskTasksTaskIdDeleteMutationError = HTTPValidationError;
|
|
|
|
/**
|
|
* @summary Delete Task
|
|
*/
|
|
export const useDeleteTaskTasksTaskIdDelete = <
|
|
TError = HTTPValidationError,
|
|
TContext = unknown,
|
|
>(
|
|
options?: {
|
|
mutation?: UseMutationOptions<
|
|
Awaited<ReturnType<typeof deleteTaskTasksTaskIdDelete>>,
|
|
TError,
|
|
{ taskId: number },
|
|
TContext
|
|
>;
|
|
request?: SecondParameter<typeof customFetch>;
|
|
},
|
|
queryClient?: QueryClient,
|
|
): UseMutationResult<
|
|
Awaited<ReturnType<typeof deleteTaskTasksTaskIdDelete>>,
|
|
TError,
|
|
{ taskId: number },
|
|
TContext
|
|
> => {
|
|
return useMutation(
|
|
getDeleteTaskTasksTaskIdDeleteMutationOptions(options),
|
|
queryClient,
|
|
);
|
|
};
|
|
/**
|
|
* @summary List Task Comments
|
|
*/
|
|
export type listTaskCommentsTaskCommentsGetResponse200 = {
|
|
data: TaskComment[];
|
|
status: 200;
|
|
};
|
|
|
|
export type listTaskCommentsTaskCommentsGetResponse422 = {
|
|
data: HTTPValidationError;
|
|
status: 422;
|
|
};
|
|
|
|
export type listTaskCommentsTaskCommentsGetResponseSuccess =
|
|
listTaskCommentsTaskCommentsGetResponse200 & {
|
|
headers: Headers;
|
|
};
|
|
export type listTaskCommentsTaskCommentsGetResponseError =
|
|
listTaskCommentsTaskCommentsGetResponse422 & {
|
|
headers: Headers;
|
|
};
|
|
|
|
export type listTaskCommentsTaskCommentsGetResponse =
|
|
| listTaskCommentsTaskCommentsGetResponseSuccess
|
|
| listTaskCommentsTaskCommentsGetResponseError;
|
|
|
|
export const getListTaskCommentsTaskCommentsGetUrl = (
|
|
params: ListTaskCommentsTaskCommentsGetParams,
|
|
) => {
|
|
const normalizedParams = new URLSearchParams();
|
|
|
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
if (value !== undefined) {
|
|
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
}
|
|
});
|
|
|
|
const stringifiedParams = normalizedParams.toString();
|
|
|
|
return stringifiedParams.length > 0
|
|
? `/task-comments?${stringifiedParams}`
|
|
: `/task-comments`;
|
|
};
|
|
|
|
export const listTaskCommentsTaskCommentsGet = async (
|
|
params: ListTaskCommentsTaskCommentsGetParams,
|
|
options?: RequestInit,
|
|
): Promise<listTaskCommentsTaskCommentsGetResponse> => {
|
|
return customFetch<listTaskCommentsTaskCommentsGetResponse>(
|
|
getListTaskCommentsTaskCommentsGetUrl(params),
|
|
{
|
|
...options,
|
|
method: "GET",
|
|
},
|
|
);
|
|
};
|
|
|
|
export const getListTaskCommentsTaskCommentsGetQueryKey = (
|
|
params?: ListTaskCommentsTaskCommentsGetParams,
|
|
) => {
|
|
return [`/task-comments`, ...(params ? [params] : [])] as const;
|
|
};
|
|
|
|
export const getListTaskCommentsTaskCommentsGetQueryOptions = <
|
|
TData = Awaited<ReturnType<typeof listTaskCommentsTaskCommentsGet>>,
|
|
TError = HTTPValidationError,
|
|
>(
|
|
params: ListTaskCommentsTaskCommentsGetParams,
|
|
options?: {
|
|
query?: Partial<
|
|
UseQueryOptions<
|
|
Awaited<ReturnType<typeof listTaskCommentsTaskCommentsGet>>,
|
|
TError,
|
|
TData
|
|
>
|
|
>;
|
|
request?: SecondParameter<typeof customFetch>;
|
|
},
|
|
) => {
|
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
|
|
const queryKey =
|
|
queryOptions?.queryKey ??
|
|
getListTaskCommentsTaskCommentsGetQueryKey(params);
|
|
|
|
const queryFn: QueryFunction<
|
|
Awaited<ReturnType<typeof listTaskCommentsTaskCommentsGet>>
|
|
> = ({ signal }) =>
|
|
listTaskCommentsTaskCommentsGet(params, { signal, ...requestOptions });
|
|
|
|
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
|
|
Awaited<ReturnType<typeof listTaskCommentsTaskCommentsGet>>,
|
|
TError,
|
|
TData
|
|
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
};
|
|
|
|
export type ListTaskCommentsTaskCommentsGetQueryResult = NonNullable<
|
|
Awaited<ReturnType<typeof listTaskCommentsTaskCommentsGet>>
|
|
>;
|
|
export type ListTaskCommentsTaskCommentsGetQueryError = HTTPValidationError;
|
|
|
|
export function useListTaskCommentsTaskCommentsGet<
|
|
TData = Awaited<ReturnType<typeof listTaskCommentsTaskCommentsGet>>,
|
|
TError = HTTPValidationError,
|
|
>(
|
|
params: ListTaskCommentsTaskCommentsGetParams,
|
|
options: {
|
|
query: Partial<
|
|
UseQueryOptions<
|
|
Awaited<ReturnType<typeof listTaskCommentsTaskCommentsGet>>,
|
|
TError,
|
|
TData
|
|
>
|
|
> &
|
|
Pick<
|
|
DefinedInitialDataOptions<
|
|
Awaited<ReturnType<typeof listTaskCommentsTaskCommentsGet>>,
|
|
TError,
|
|
Awaited<ReturnType<typeof listTaskCommentsTaskCommentsGet>>
|
|
>,
|
|
"initialData"
|
|
>;
|
|
request?: SecondParameter<typeof customFetch>;
|
|
},
|
|
queryClient?: QueryClient,
|
|
): DefinedUseQueryResult<TData, TError> & {
|
|
queryKey: DataTag<QueryKey, TData, TError>;
|
|
};
|
|
export function useListTaskCommentsTaskCommentsGet<
|
|
TData = Awaited<ReturnType<typeof listTaskCommentsTaskCommentsGet>>,
|
|
TError = HTTPValidationError,
|
|
>(
|
|
params: ListTaskCommentsTaskCommentsGetParams,
|
|
options?: {
|
|
query?: Partial<
|
|
UseQueryOptions<
|
|
Awaited<ReturnType<typeof listTaskCommentsTaskCommentsGet>>,
|
|
TError,
|
|
TData
|
|
>
|
|
> &
|
|
Pick<
|
|
UndefinedInitialDataOptions<
|
|
Awaited<ReturnType<typeof listTaskCommentsTaskCommentsGet>>,
|
|
TError,
|
|
Awaited<ReturnType<typeof listTaskCommentsTaskCommentsGet>>
|
|
>,
|
|
"initialData"
|
|
>;
|
|
request?: SecondParameter<typeof customFetch>;
|
|
},
|
|
queryClient?: QueryClient,
|
|
): UseQueryResult<TData, TError> & {
|
|
queryKey: DataTag<QueryKey, TData, TError>;
|
|
};
|
|
export function useListTaskCommentsTaskCommentsGet<
|
|
TData = Awaited<ReturnType<typeof listTaskCommentsTaskCommentsGet>>,
|
|
TError = HTTPValidationError,
|
|
>(
|
|
params: ListTaskCommentsTaskCommentsGetParams,
|
|
options?: {
|
|
query?: Partial<
|
|
UseQueryOptions<
|
|
Awaited<ReturnType<typeof listTaskCommentsTaskCommentsGet>>,
|
|
TError,
|
|
TData
|
|
>
|
|
>;
|
|
request?: SecondParameter<typeof customFetch>;
|
|
},
|
|
queryClient?: QueryClient,
|
|
): UseQueryResult<TData, TError> & {
|
|
queryKey: DataTag<QueryKey, TData, TError>;
|
|
};
|
|
/**
|
|
* @summary List Task Comments
|
|
*/
|
|
|
|
export function useListTaskCommentsTaskCommentsGet<
|
|
TData = Awaited<ReturnType<typeof listTaskCommentsTaskCommentsGet>>,
|
|
TError = HTTPValidationError,
|
|
>(
|
|
params: ListTaskCommentsTaskCommentsGetParams,
|
|
options?: {
|
|
query?: Partial<
|
|
UseQueryOptions<
|
|
Awaited<ReturnType<typeof listTaskCommentsTaskCommentsGet>>,
|
|
TError,
|
|
TData
|
|
>
|
|
>;
|
|
request?: SecondParameter<typeof customFetch>;
|
|
},
|
|
queryClient?: QueryClient,
|
|
): UseQueryResult<TData, TError> & {
|
|
queryKey: DataTag<QueryKey, TData, TError>;
|
|
} {
|
|
const queryOptions = getListTaskCommentsTaskCommentsGetQueryOptions(
|
|
params,
|
|
options,
|
|
);
|
|
|
|
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
|
|
TData,
|
|
TError
|
|
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
|
|
return { ...query, queryKey: queryOptions.queryKey };
|
|
}
|
|
|
|
/**
|
|
* @summary Create Task Comment
|
|
*/
|
|
export type createTaskCommentTaskCommentsPostResponse200 = {
|
|
data: TaskComment;
|
|
status: 200;
|
|
};
|
|
|
|
export type createTaskCommentTaskCommentsPostResponse422 = {
|
|
data: HTTPValidationError;
|
|
status: 422;
|
|
};
|
|
|
|
export type createTaskCommentTaskCommentsPostResponseSuccess =
|
|
createTaskCommentTaskCommentsPostResponse200 & {
|
|
headers: Headers;
|
|
};
|
|
export type createTaskCommentTaskCommentsPostResponseError =
|
|
createTaskCommentTaskCommentsPostResponse422 & {
|
|
headers: Headers;
|
|
};
|
|
|
|
export type createTaskCommentTaskCommentsPostResponse =
|
|
| createTaskCommentTaskCommentsPostResponseSuccess
|
|
| createTaskCommentTaskCommentsPostResponseError;
|
|
|
|
export const getCreateTaskCommentTaskCommentsPostUrl = () => {
|
|
return `/task-comments`;
|
|
};
|
|
|
|
export const createTaskCommentTaskCommentsPost = async (
|
|
taskCommentCreate: TaskCommentCreate,
|
|
options?: RequestInit,
|
|
): Promise<createTaskCommentTaskCommentsPostResponse> => {
|
|
return customFetch<createTaskCommentTaskCommentsPostResponse>(
|
|
getCreateTaskCommentTaskCommentsPostUrl(),
|
|
{
|
|
...options,
|
|
method: "POST",
|
|
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
body: JSON.stringify(taskCommentCreate),
|
|
},
|
|
);
|
|
};
|
|
|
|
export const getCreateTaskCommentTaskCommentsPostMutationOptions = <
|
|
TError = HTTPValidationError,
|
|
TContext = unknown,
|
|
>(options?: {
|
|
mutation?: UseMutationOptions<
|
|
Awaited<ReturnType<typeof createTaskCommentTaskCommentsPost>>,
|
|
TError,
|
|
{ data: TaskCommentCreate },
|
|
TContext
|
|
>;
|
|
request?: SecondParameter<typeof customFetch>;
|
|
}): UseMutationOptions<
|
|
Awaited<ReturnType<typeof createTaskCommentTaskCommentsPost>>,
|
|
TError,
|
|
{ data: TaskCommentCreate },
|
|
TContext
|
|
> => {
|
|
const mutationKey = ["createTaskCommentTaskCommentsPost"];
|
|
const { mutation: mutationOptions, request: requestOptions } = options
|
|
? options.mutation &&
|
|
"mutationKey" in options.mutation &&
|
|
options.mutation.mutationKey
|
|
? options
|
|
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
: { mutation: { mutationKey }, request: undefined };
|
|
|
|
const mutationFn: MutationFunction<
|
|
Awaited<ReturnType<typeof createTaskCommentTaskCommentsPost>>,
|
|
{ data: TaskCommentCreate }
|
|
> = (props) => {
|
|
const { data } = props ?? {};
|
|
|
|
return createTaskCommentTaskCommentsPost(data, requestOptions);
|
|
};
|
|
|
|
return { mutationFn, ...mutationOptions };
|
|
};
|
|
|
|
export type CreateTaskCommentTaskCommentsPostMutationResult = NonNullable<
|
|
Awaited<ReturnType<typeof createTaskCommentTaskCommentsPost>>
|
|
>;
|
|
export type CreateTaskCommentTaskCommentsPostMutationBody = TaskCommentCreate;
|
|
export type CreateTaskCommentTaskCommentsPostMutationError =
|
|
HTTPValidationError;
|
|
|
|
/**
|
|
* @summary Create Task Comment
|
|
*/
|
|
export const useCreateTaskCommentTaskCommentsPost = <
|
|
TError = HTTPValidationError,
|
|
TContext = unknown,
|
|
>(
|
|
options?: {
|
|
mutation?: UseMutationOptions<
|
|
Awaited<ReturnType<typeof createTaskCommentTaskCommentsPost>>,
|
|
TError,
|
|
{ data: TaskCommentCreate },
|
|
TContext
|
|
>;
|
|
request?: SecondParameter<typeof customFetch>;
|
|
},
|
|
queryClient?: QueryClient,
|
|
): UseMutationResult<
|
|
Awaited<ReturnType<typeof createTaskCommentTaskCommentsPost>>,
|
|
TError,
|
|
{ data: TaskCommentCreate },
|
|
TContext
|
|
> => {
|
|
return useMutation(
|
|
getCreateTaskCommentTaskCommentsPostMutationOptions(options),
|
|
queryClient,
|
|
);
|
|
};
|