Fix Orval config to generate React Query hooks
This commit is contained in:
@@ -9,7 +9,7 @@ export default defineConfig({
|
|||||||
mode: "tags-split",
|
mode: "tags-split",
|
||||||
target: "src/api/generated/index.ts",
|
target: "src/api/generated/index.ts",
|
||||||
schemas: "src/api/generated/model",
|
schemas: "src/api/generated/model",
|
||||||
client: "fetch",
|
client: "react-query",
|
||||||
prettier: true,
|
prettier: true,
|
||||||
override: {
|
override: {
|
||||||
mutator: {
|
mutator: {
|
||||||
|
|||||||
@@ -4,6 +4,19 @@
|
|||||||
* OpenClaw Agency API
|
* OpenClaw Agency API
|
||||||
* OpenAPI spec version: 0.3.0
|
* OpenAPI spec version: 0.3.0
|
||||||
*/
|
*/
|
||||||
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
import type {
|
||||||
|
DataTag,
|
||||||
|
DefinedInitialDataOptions,
|
||||||
|
DefinedUseQueryResult,
|
||||||
|
QueryClient,
|
||||||
|
QueryFunction,
|
||||||
|
QueryKey,
|
||||||
|
UndefinedInitialDataOptions,
|
||||||
|
UseQueryOptions,
|
||||||
|
UseQueryResult,
|
||||||
|
} from "@tanstack/react-query";
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
HTTPValidationError,
|
HTTPValidationError,
|
||||||
ListActivitiesActivitiesGetParams,
|
ListActivitiesActivitiesGetParams,
|
||||||
@@ -11,6 +24,8 @@ import type {
|
|||||||
|
|
||||||
import { customFetch } from "../../mutator";
|
import { customFetch } from "../../mutator";
|
||||||
|
|
||||||
|
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @summary List Activities
|
* @summary List Activities
|
||||||
*/
|
*/
|
||||||
@@ -67,3 +82,156 @@ export const listActivitiesActivitiesGet = async (
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getListActivitiesActivitiesGetQueryKey = (
|
||||||
|
params?: ListActivitiesActivitiesGetParams,
|
||||||
|
) => {
|
||||||
|
return [`/activities`, ...(params ? [params] : [])] as const;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getListActivitiesActivitiesGetQueryOptions = <
|
||||||
|
TData = Awaited<ReturnType<typeof listActivitiesActivitiesGet>>,
|
||||||
|
TError = HTTPValidationError,
|
||||||
|
>(
|
||||||
|
params?: ListActivitiesActivitiesGetParams,
|
||||||
|
options?: {
|
||||||
|
query?: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listActivitiesActivitiesGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
) => {
|
||||||
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
||||||
|
|
||||||
|
const queryKey =
|
||||||
|
queryOptions?.queryKey ?? getListActivitiesActivitiesGetQueryKey(params);
|
||||||
|
|
||||||
|
const queryFn: QueryFunction<
|
||||||
|
Awaited<ReturnType<typeof listActivitiesActivitiesGet>>
|
||||||
|
> = ({ signal }) =>
|
||||||
|
listActivitiesActivitiesGet(params, { signal, ...requestOptions });
|
||||||
|
|
||||||
|
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listActivitiesActivitiesGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||||
|
};
|
||||||
|
|
||||||
|
export type ListActivitiesActivitiesGetQueryResult = NonNullable<
|
||||||
|
Awaited<ReturnType<typeof listActivitiesActivitiesGet>>
|
||||||
|
>;
|
||||||
|
export type ListActivitiesActivitiesGetQueryError = HTTPValidationError;
|
||||||
|
|
||||||
|
export function useListActivitiesActivitiesGet<
|
||||||
|
TData = Awaited<ReturnType<typeof listActivitiesActivitiesGet>>,
|
||||||
|
TError = HTTPValidationError,
|
||||||
|
>(
|
||||||
|
params: undefined | ListActivitiesActivitiesGetParams,
|
||||||
|
options: {
|
||||||
|
query: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listActivitiesActivitiesGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
> &
|
||||||
|
Pick<
|
||||||
|
DefinedInitialDataOptions<
|
||||||
|
Awaited<ReturnType<typeof listActivitiesActivitiesGet>>,
|
||||||
|
TError,
|
||||||
|
Awaited<ReturnType<typeof listActivitiesActivitiesGet>>
|
||||||
|
>,
|
||||||
|
"initialData"
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): DefinedUseQueryResult<TData, TError> & {
|
||||||
|
queryKey: DataTag<QueryKey, TData, TError>;
|
||||||
|
};
|
||||||
|
export function useListActivitiesActivitiesGet<
|
||||||
|
TData = Awaited<ReturnType<typeof listActivitiesActivitiesGet>>,
|
||||||
|
TError = HTTPValidationError,
|
||||||
|
>(
|
||||||
|
params?: ListActivitiesActivitiesGetParams,
|
||||||
|
options?: {
|
||||||
|
query?: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listActivitiesActivitiesGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
> &
|
||||||
|
Pick<
|
||||||
|
UndefinedInitialDataOptions<
|
||||||
|
Awaited<ReturnType<typeof listActivitiesActivitiesGet>>,
|
||||||
|
TError,
|
||||||
|
Awaited<ReturnType<typeof listActivitiesActivitiesGet>>
|
||||||
|
>,
|
||||||
|
"initialData"
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): UseQueryResult<TData, TError> & {
|
||||||
|
queryKey: DataTag<QueryKey, TData, TError>;
|
||||||
|
};
|
||||||
|
export function useListActivitiesActivitiesGet<
|
||||||
|
TData = Awaited<ReturnType<typeof listActivitiesActivitiesGet>>,
|
||||||
|
TError = HTTPValidationError,
|
||||||
|
>(
|
||||||
|
params?: ListActivitiesActivitiesGetParams,
|
||||||
|
options?: {
|
||||||
|
query?: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listActivitiesActivitiesGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): UseQueryResult<TData, TError> & {
|
||||||
|
queryKey: DataTag<QueryKey, TData, TError>;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* @summary List Activities
|
||||||
|
*/
|
||||||
|
|
||||||
|
export function useListActivitiesActivitiesGet<
|
||||||
|
TData = Awaited<ReturnType<typeof listActivitiesActivitiesGet>>,
|
||||||
|
TError = HTTPValidationError,
|
||||||
|
>(
|
||||||
|
params?: ListActivitiesActivitiesGetParams,
|
||||||
|
options?: {
|
||||||
|
query?: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listActivitiesActivitiesGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): UseQueryResult<TData, TError> & {
|
||||||
|
queryKey: DataTag<QueryKey, TData, TError>;
|
||||||
|
} {
|
||||||
|
const queryOptions = getListActivitiesActivitiesGetQueryOptions(
|
||||||
|
params,
|
||||||
|
options,
|
||||||
|
);
|
||||||
|
|
||||||
|
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
|
||||||
|
TData,
|
||||||
|
TError
|
||||||
|
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||||
|
|
||||||
|
return { ...query, queryKey: queryOptions.queryKey };
|
||||||
|
}
|
||||||
|
|||||||
@@ -4,8 +4,23 @@
|
|||||||
* OpenClaw Agency API
|
* OpenClaw Agency API
|
||||||
* OpenAPI spec version: 0.3.0
|
* OpenAPI spec version: 0.3.0
|
||||||
*/
|
*/
|
||||||
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
import type {
|
||||||
|
DataTag,
|
||||||
|
DefinedInitialDataOptions,
|
||||||
|
DefinedUseQueryResult,
|
||||||
|
QueryClient,
|
||||||
|
QueryFunction,
|
||||||
|
QueryKey,
|
||||||
|
UndefinedInitialDataOptions,
|
||||||
|
UseQueryOptions,
|
||||||
|
UseQueryResult,
|
||||||
|
} from "@tanstack/react-query";
|
||||||
|
|
||||||
import { customFetch } from "../../mutator";
|
import { customFetch } from "../../mutator";
|
||||||
|
|
||||||
|
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @summary Health
|
* @summary Health
|
||||||
*/
|
*/
|
||||||
@@ -31,3 +46,138 @@ export const healthHealthGet = async (
|
|||||||
method: "GET",
|
method: "GET",
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getHealthHealthGetQueryKey = () => {
|
||||||
|
return [`/health`] as const;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getHealthHealthGetQueryOptions = <
|
||||||
|
TData = Awaited<ReturnType<typeof healthHealthGet>>,
|
||||||
|
TError = unknown,
|
||||||
|
>(options?: {
|
||||||
|
query?: Partial<
|
||||||
|
UseQueryOptions<Awaited<ReturnType<typeof healthHealthGet>>, TError, TData>
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
}) => {
|
||||||
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
||||||
|
|
||||||
|
const queryKey = queryOptions?.queryKey ?? getHealthHealthGetQueryKey();
|
||||||
|
|
||||||
|
const queryFn: QueryFunction<Awaited<ReturnType<typeof healthHealthGet>>> = ({
|
||||||
|
signal,
|
||||||
|
}) => healthHealthGet({ signal, ...requestOptions });
|
||||||
|
|
||||||
|
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof healthHealthGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||||
|
};
|
||||||
|
|
||||||
|
export type HealthHealthGetQueryResult = NonNullable<
|
||||||
|
Awaited<ReturnType<typeof healthHealthGet>>
|
||||||
|
>;
|
||||||
|
export type HealthHealthGetQueryError = unknown;
|
||||||
|
|
||||||
|
export function useHealthHealthGet<
|
||||||
|
TData = Awaited<ReturnType<typeof healthHealthGet>>,
|
||||||
|
TError = unknown,
|
||||||
|
>(
|
||||||
|
options: {
|
||||||
|
query: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof healthHealthGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
> &
|
||||||
|
Pick<
|
||||||
|
DefinedInitialDataOptions<
|
||||||
|
Awaited<ReturnType<typeof healthHealthGet>>,
|
||||||
|
TError,
|
||||||
|
Awaited<ReturnType<typeof healthHealthGet>>
|
||||||
|
>,
|
||||||
|
"initialData"
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): DefinedUseQueryResult<TData, TError> & {
|
||||||
|
queryKey: DataTag<QueryKey, TData, TError>;
|
||||||
|
};
|
||||||
|
export function useHealthHealthGet<
|
||||||
|
TData = Awaited<ReturnType<typeof healthHealthGet>>,
|
||||||
|
TError = unknown,
|
||||||
|
>(
|
||||||
|
options?: {
|
||||||
|
query?: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof healthHealthGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
> &
|
||||||
|
Pick<
|
||||||
|
UndefinedInitialDataOptions<
|
||||||
|
Awaited<ReturnType<typeof healthHealthGet>>,
|
||||||
|
TError,
|
||||||
|
Awaited<ReturnType<typeof healthHealthGet>>
|
||||||
|
>,
|
||||||
|
"initialData"
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): UseQueryResult<TData, TError> & {
|
||||||
|
queryKey: DataTag<QueryKey, TData, TError>;
|
||||||
|
};
|
||||||
|
export function useHealthHealthGet<
|
||||||
|
TData = Awaited<ReturnType<typeof healthHealthGet>>,
|
||||||
|
TError = unknown,
|
||||||
|
>(
|
||||||
|
options?: {
|
||||||
|
query?: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof healthHealthGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): UseQueryResult<TData, TError> & {
|
||||||
|
queryKey: DataTag<QueryKey, TData, TError>;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* @summary Health
|
||||||
|
*/
|
||||||
|
|
||||||
|
export function useHealthHealthGet<
|
||||||
|
TData = Awaited<ReturnType<typeof healthHealthGet>>,
|
||||||
|
TError = unknown,
|
||||||
|
>(
|
||||||
|
options?: {
|
||||||
|
query?: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof healthHealthGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): UseQueryResult<TData, TError> & {
|
||||||
|
queryKey: DataTag<QueryKey, TData, TError>;
|
||||||
|
} {
|
||||||
|
const queryOptions = getHealthHealthGetQueryOptions(options);
|
||||||
|
|
||||||
|
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
|
||||||
|
TData,
|
||||||
|
TError
|
||||||
|
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||||
|
|
||||||
|
return { ...query, queryKey: queryOptions.queryKey };
|
||||||
|
}
|
||||||
|
|||||||
@@ -4,6 +4,22 @@
|
|||||||
* OpenClaw Agency API
|
* OpenClaw Agency API
|
||||||
* OpenAPI spec version: 0.3.0
|
* 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 {
|
import type {
|
||||||
EmploymentAction,
|
EmploymentAction,
|
||||||
EmploymentActionCreate,
|
EmploymentActionCreate,
|
||||||
@@ -15,6 +31,8 @@ import type {
|
|||||||
|
|
||||||
import { customFetch } from "../../mutator";
|
import { customFetch } from "../../mutator";
|
||||||
|
|
||||||
|
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @summary List Headcount Requests
|
* @summary List Headcount Requests
|
||||||
*/
|
*/
|
||||||
@@ -46,6 +64,148 @@ export const listHeadcountRequestsHrHeadcountGet = async (
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getListHeadcountRequestsHrHeadcountGetQueryKey = () => {
|
||||||
|
return [`/hr/headcount`] as const;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getListHeadcountRequestsHrHeadcountGetQueryOptions = <
|
||||||
|
TData = Awaited<ReturnType<typeof listHeadcountRequestsHrHeadcountGet>>,
|
||||||
|
TError = unknown,
|
||||||
|
>(options?: {
|
||||||
|
query?: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listHeadcountRequestsHrHeadcountGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
}) => {
|
||||||
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
||||||
|
|
||||||
|
const queryKey =
|
||||||
|
queryOptions?.queryKey ?? getListHeadcountRequestsHrHeadcountGetQueryKey();
|
||||||
|
|
||||||
|
const queryFn: QueryFunction<
|
||||||
|
Awaited<ReturnType<typeof listHeadcountRequestsHrHeadcountGet>>
|
||||||
|
> = ({ signal }) =>
|
||||||
|
listHeadcountRequestsHrHeadcountGet({ signal, ...requestOptions });
|
||||||
|
|
||||||
|
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listHeadcountRequestsHrHeadcountGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||||
|
};
|
||||||
|
|
||||||
|
export type ListHeadcountRequestsHrHeadcountGetQueryResult = NonNullable<
|
||||||
|
Awaited<ReturnType<typeof listHeadcountRequestsHrHeadcountGet>>
|
||||||
|
>;
|
||||||
|
export type ListHeadcountRequestsHrHeadcountGetQueryError = unknown;
|
||||||
|
|
||||||
|
export function useListHeadcountRequestsHrHeadcountGet<
|
||||||
|
TData = Awaited<ReturnType<typeof listHeadcountRequestsHrHeadcountGet>>,
|
||||||
|
TError = unknown,
|
||||||
|
>(
|
||||||
|
options: {
|
||||||
|
query: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listHeadcountRequestsHrHeadcountGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
> &
|
||||||
|
Pick<
|
||||||
|
DefinedInitialDataOptions<
|
||||||
|
Awaited<ReturnType<typeof listHeadcountRequestsHrHeadcountGet>>,
|
||||||
|
TError,
|
||||||
|
Awaited<ReturnType<typeof listHeadcountRequestsHrHeadcountGet>>
|
||||||
|
>,
|
||||||
|
"initialData"
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): DefinedUseQueryResult<TData, TError> & {
|
||||||
|
queryKey: DataTag<QueryKey, TData, TError>;
|
||||||
|
};
|
||||||
|
export function useListHeadcountRequestsHrHeadcountGet<
|
||||||
|
TData = Awaited<ReturnType<typeof listHeadcountRequestsHrHeadcountGet>>,
|
||||||
|
TError = unknown,
|
||||||
|
>(
|
||||||
|
options?: {
|
||||||
|
query?: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listHeadcountRequestsHrHeadcountGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
> &
|
||||||
|
Pick<
|
||||||
|
UndefinedInitialDataOptions<
|
||||||
|
Awaited<ReturnType<typeof listHeadcountRequestsHrHeadcountGet>>,
|
||||||
|
TError,
|
||||||
|
Awaited<ReturnType<typeof listHeadcountRequestsHrHeadcountGet>>
|
||||||
|
>,
|
||||||
|
"initialData"
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): UseQueryResult<TData, TError> & {
|
||||||
|
queryKey: DataTag<QueryKey, TData, TError>;
|
||||||
|
};
|
||||||
|
export function useListHeadcountRequestsHrHeadcountGet<
|
||||||
|
TData = Awaited<ReturnType<typeof listHeadcountRequestsHrHeadcountGet>>,
|
||||||
|
TError = unknown,
|
||||||
|
>(
|
||||||
|
options?: {
|
||||||
|
query?: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listHeadcountRequestsHrHeadcountGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): UseQueryResult<TData, TError> & {
|
||||||
|
queryKey: DataTag<QueryKey, TData, TError>;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* @summary List Headcount Requests
|
||||||
|
*/
|
||||||
|
|
||||||
|
export function useListHeadcountRequestsHrHeadcountGet<
|
||||||
|
TData = Awaited<ReturnType<typeof listHeadcountRequestsHrHeadcountGet>>,
|
||||||
|
TError = unknown,
|
||||||
|
>(
|
||||||
|
options?: {
|
||||||
|
query?: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listHeadcountRequestsHrHeadcountGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): UseQueryResult<TData, TError> & {
|
||||||
|
queryKey: DataTag<QueryKey, TData, TError>;
|
||||||
|
} {
|
||||||
|
const queryOptions =
|
||||||
|
getListHeadcountRequestsHrHeadcountGetQueryOptions(options);
|
||||||
|
|
||||||
|
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
|
||||||
|
TData,
|
||||||
|
TError
|
||||||
|
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||||
|
|
||||||
|
return { ...query, queryKey: queryOptions.queryKey };
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @summary Create Headcount Request
|
* @summary Create Headcount Request
|
||||||
*/
|
*/
|
||||||
@@ -91,6 +251,80 @@ export const createHeadcountRequestHrHeadcountPost = async (
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getCreateHeadcountRequestHrHeadcountPostMutationOptions = <
|
||||||
|
TError = HTTPValidationError,
|
||||||
|
TContext = unknown,
|
||||||
|
>(options?: {
|
||||||
|
mutation?: UseMutationOptions<
|
||||||
|
Awaited<ReturnType<typeof createHeadcountRequestHrHeadcountPost>>,
|
||||||
|
TError,
|
||||||
|
{ data: HeadcountRequestCreate },
|
||||||
|
TContext
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
}): UseMutationOptions<
|
||||||
|
Awaited<ReturnType<typeof createHeadcountRequestHrHeadcountPost>>,
|
||||||
|
TError,
|
||||||
|
{ data: HeadcountRequestCreate },
|
||||||
|
TContext
|
||||||
|
> => {
|
||||||
|
const mutationKey = ["createHeadcountRequestHrHeadcountPost"];
|
||||||
|
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 createHeadcountRequestHrHeadcountPost>>,
|
||||||
|
{ data: HeadcountRequestCreate }
|
||||||
|
> = (props) => {
|
||||||
|
const { data } = props ?? {};
|
||||||
|
|
||||||
|
return createHeadcountRequestHrHeadcountPost(data, requestOptions);
|
||||||
|
};
|
||||||
|
|
||||||
|
return { mutationFn, ...mutationOptions };
|
||||||
|
};
|
||||||
|
|
||||||
|
export type CreateHeadcountRequestHrHeadcountPostMutationResult = NonNullable<
|
||||||
|
Awaited<ReturnType<typeof createHeadcountRequestHrHeadcountPost>>
|
||||||
|
>;
|
||||||
|
export type CreateHeadcountRequestHrHeadcountPostMutationBody =
|
||||||
|
HeadcountRequestCreate;
|
||||||
|
export type CreateHeadcountRequestHrHeadcountPostMutationError =
|
||||||
|
HTTPValidationError;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @summary Create Headcount Request
|
||||||
|
*/
|
||||||
|
export const useCreateHeadcountRequestHrHeadcountPost = <
|
||||||
|
TError = HTTPValidationError,
|
||||||
|
TContext = unknown,
|
||||||
|
>(
|
||||||
|
options?: {
|
||||||
|
mutation?: UseMutationOptions<
|
||||||
|
Awaited<ReturnType<typeof createHeadcountRequestHrHeadcountPost>>,
|
||||||
|
TError,
|
||||||
|
{ data: HeadcountRequestCreate },
|
||||||
|
TContext
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): UseMutationResult<
|
||||||
|
Awaited<ReturnType<typeof createHeadcountRequestHrHeadcountPost>>,
|
||||||
|
TError,
|
||||||
|
{ data: HeadcountRequestCreate },
|
||||||
|
TContext
|
||||||
|
> => {
|
||||||
|
return useMutation(
|
||||||
|
getCreateHeadcountRequestHrHeadcountPostMutationOptions(options),
|
||||||
|
queryClient,
|
||||||
|
);
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* @summary Update Headcount Request
|
* @summary Update Headcount Request
|
||||||
*/
|
*/
|
||||||
@@ -139,6 +373,89 @@ export const updateHeadcountRequestHrHeadcountRequestIdPatch = async (
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getUpdateHeadcountRequestHrHeadcountRequestIdPatchMutationOptions =
|
||||||
|
<TError = HTTPValidationError, TContext = unknown>(options?: {
|
||||||
|
mutation?: UseMutationOptions<
|
||||||
|
Awaited<
|
||||||
|
ReturnType<typeof updateHeadcountRequestHrHeadcountRequestIdPatch>
|
||||||
|
>,
|
||||||
|
TError,
|
||||||
|
{ requestId: number; data: HeadcountRequestUpdate },
|
||||||
|
TContext
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
}): UseMutationOptions<
|
||||||
|
Awaited<ReturnType<typeof updateHeadcountRequestHrHeadcountRequestIdPatch>>,
|
||||||
|
TError,
|
||||||
|
{ requestId: number; data: HeadcountRequestUpdate },
|
||||||
|
TContext
|
||||||
|
> => {
|
||||||
|
const mutationKey = ["updateHeadcountRequestHrHeadcountRequestIdPatch"];
|
||||||
|
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 updateHeadcountRequestHrHeadcountRequestIdPatch>
|
||||||
|
>,
|
||||||
|
{ requestId: number; data: HeadcountRequestUpdate }
|
||||||
|
> = (props) => {
|
||||||
|
const { requestId, data } = props ?? {};
|
||||||
|
|
||||||
|
return updateHeadcountRequestHrHeadcountRequestIdPatch(
|
||||||
|
requestId,
|
||||||
|
data,
|
||||||
|
requestOptions,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
return { mutationFn, ...mutationOptions };
|
||||||
|
};
|
||||||
|
|
||||||
|
export type UpdateHeadcountRequestHrHeadcountRequestIdPatchMutationResult =
|
||||||
|
NonNullable<
|
||||||
|
Awaited<ReturnType<typeof updateHeadcountRequestHrHeadcountRequestIdPatch>>
|
||||||
|
>;
|
||||||
|
export type UpdateHeadcountRequestHrHeadcountRequestIdPatchMutationBody =
|
||||||
|
HeadcountRequestUpdate;
|
||||||
|
export type UpdateHeadcountRequestHrHeadcountRequestIdPatchMutationError =
|
||||||
|
HTTPValidationError;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @summary Update Headcount Request
|
||||||
|
*/
|
||||||
|
export const useUpdateHeadcountRequestHrHeadcountRequestIdPatch = <
|
||||||
|
TError = HTTPValidationError,
|
||||||
|
TContext = unknown,
|
||||||
|
>(
|
||||||
|
options?: {
|
||||||
|
mutation?: UseMutationOptions<
|
||||||
|
Awaited<
|
||||||
|
ReturnType<typeof updateHeadcountRequestHrHeadcountRequestIdPatch>
|
||||||
|
>,
|
||||||
|
TError,
|
||||||
|
{ requestId: number; data: HeadcountRequestUpdate },
|
||||||
|
TContext
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): UseMutationResult<
|
||||||
|
Awaited<ReturnType<typeof updateHeadcountRequestHrHeadcountRequestIdPatch>>,
|
||||||
|
TError,
|
||||||
|
{ requestId: number; data: HeadcountRequestUpdate },
|
||||||
|
TContext
|
||||||
|
> => {
|
||||||
|
return useMutation(
|
||||||
|
getUpdateHeadcountRequestHrHeadcountRequestIdPatchMutationOptions(options),
|
||||||
|
queryClient,
|
||||||
|
);
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* @summary List Employment Actions
|
* @summary List Employment Actions
|
||||||
*/
|
*/
|
||||||
@@ -170,6 +487,148 @@ export const listEmploymentActionsHrActionsGet = async (
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getListEmploymentActionsHrActionsGetQueryKey = () => {
|
||||||
|
return [`/hr/actions`] as const;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getListEmploymentActionsHrActionsGetQueryOptions = <
|
||||||
|
TData = Awaited<ReturnType<typeof listEmploymentActionsHrActionsGet>>,
|
||||||
|
TError = unknown,
|
||||||
|
>(options?: {
|
||||||
|
query?: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listEmploymentActionsHrActionsGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
}) => {
|
||||||
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
||||||
|
|
||||||
|
const queryKey =
|
||||||
|
queryOptions?.queryKey ?? getListEmploymentActionsHrActionsGetQueryKey();
|
||||||
|
|
||||||
|
const queryFn: QueryFunction<
|
||||||
|
Awaited<ReturnType<typeof listEmploymentActionsHrActionsGet>>
|
||||||
|
> = ({ signal }) =>
|
||||||
|
listEmploymentActionsHrActionsGet({ signal, ...requestOptions });
|
||||||
|
|
||||||
|
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listEmploymentActionsHrActionsGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||||
|
};
|
||||||
|
|
||||||
|
export type ListEmploymentActionsHrActionsGetQueryResult = NonNullable<
|
||||||
|
Awaited<ReturnType<typeof listEmploymentActionsHrActionsGet>>
|
||||||
|
>;
|
||||||
|
export type ListEmploymentActionsHrActionsGetQueryError = unknown;
|
||||||
|
|
||||||
|
export function useListEmploymentActionsHrActionsGet<
|
||||||
|
TData = Awaited<ReturnType<typeof listEmploymentActionsHrActionsGet>>,
|
||||||
|
TError = unknown,
|
||||||
|
>(
|
||||||
|
options: {
|
||||||
|
query: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listEmploymentActionsHrActionsGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
> &
|
||||||
|
Pick<
|
||||||
|
DefinedInitialDataOptions<
|
||||||
|
Awaited<ReturnType<typeof listEmploymentActionsHrActionsGet>>,
|
||||||
|
TError,
|
||||||
|
Awaited<ReturnType<typeof listEmploymentActionsHrActionsGet>>
|
||||||
|
>,
|
||||||
|
"initialData"
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): DefinedUseQueryResult<TData, TError> & {
|
||||||
|
queryKey: DataTag<QueryKey, TData, TError>;
|
||||||
|
};
|
||||||
|
export function useListEmploymentActionsHrActionsGet<
|
||||||
|
TData = Awaited<ReturnType<typeof listEmploymentActionsHrActionsGet>>,
|
||||||
|
TError = unknown,
|
||||||
|
>(
|
||||||
|
options?: {
|
||||||
|
query?: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listEmploymentActionsHrActionsGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
> &
|
||||||
|
Pick<
|
||||||
|
UndefinedInitialDataOptions<
|
||||||
|
Awaited<ReturnType<typeof listEmploymentActionsHrActionsGet>>,
|
||||||
|
TError,
|
||||||
|
Awaited<ReturnType<typeof listEmploymentActionsHrActionsGet>>
|
||||||
|
>,
|
||||||
|
"initialData"
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): UseQueryResult<TData, TError> & {
|
||||||
|
queryKey: DataTag<QueryKey, TData, TError>;
|
||||||
|
};
|
||||||
|
export function useListEmploymentActionsHrActionsGet<
|
||||||
|
TData = Awaited<ReturnType<typeof listEmploymentActionsHrActionsGet>>,
|
||||||
|
TError = unknown,
|
||||||
|
>(
|
||||||
|
options?: {
|
||||||
|
query?: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listEmploymentActionsHrActionsGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): UseQueryResult<TData, TError> & {
|
||||||
|
queryKey: DataTag<QueryKey, TData, TError>;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* @summary List Employment Actions
|
||||||
|
*/
|
||||||
|
|
||||||
|
export function useListEmploymentActionsHrActionsGet<
|
||||||
|
TData = Awaited<ReturnType<typeof listEmploymentActionsHrActionsGet>>,
|
||||||
|
TError = unknown,
|
||||||
|
>(
|
||||||
|
options?: {
|
||||||
|
query?: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listEmploymentActionsHrActionsGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): UseQueryResult<TData, TError> & {
|
||||||
|
queryKey: DataTag<QueryKey, TData, TError>;
|
||||||
|
} {
|
||||||
|
const queryOptions =
|
||||||
|
getListEmploymentActionsHrActionsGetQueryOptions(options);
|
||||||
|
|
||||||
|
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
|
||||||
|
TData,
|
||||||
|
TError
|
||||||
|
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||||
|
|
||||||
|
return { ...query, queryKey: queryOptions.queryKey };
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @summary Create Employment Action
|
* @summary Create Employment Action
|
||||||
*/
|
*/
|
||||||
@@ -214,3 +673,78 @@ export const createEmploymentActionHrActionsPost = async (
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getCreateEmploymentActionHrActionsPostMutationOptions = <
|
||||||
|
TError = HTTPValidationError,
|
||||||
|
TContext = unknown,
|
||||||
|
>(options?: {
|
||||||
|
mutation?: UseMutationOptions<
|
||||||
|
Awaited<ReturnType<typeof createEmploymentActionHrActionsPost>>,
|
||||||
|
TError,
|
||||||
|
{ data: EmploymentActionCreate },
|
||||||
|
TContext
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
}): UseMutationOptions<
|
||||||
|
Awaited<ReturnType<typeof createEmploymentActionHrActionsPost>>,
|
||||||
|
TError,
|
||||||
|
{ data: EmploymentActionCreate },
|
||||||
|
TContext
|
||||||
|
> => {
|
||||||
|
const mutationKey = ["createEmploymentActionHrActionsPost"];
|
||||||
|
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 createEmploymentActionHrActionsPost>>,
|
||||||
|
{ data: EmploymentActionCreate }
|
||||||
|
> = (props) => {
|
||||||
|
const { data } = props ?? {};
|
||||||
|
|
||||||
|
return createEmploymentActionHrActionsPost(data, requestOptions);
|
||||||
|
};
|
||||||
|
|
||||||
|
return { mutationFn, ...mutationOptions };
|
||||||
|
};
|
||||||
|
|
||||||
|
export type CreateEmploymentActionHrActionsPostMutationResult = NonNullable<
|
||||||
|
Awaited<ReturnType<typeof createEmploymentActionHrActionsPost>>
|
||||||
|
>;
|
||||||
|
export type CreateEmploymentActionHrActionsPostMutationBody =
|
||||||
|
EmploymentActionCreate;
|
||||||
|
export type CreateEmploymentActionHrActionsPostMutationError =
|
||||||
|
HTTPValidationError;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @summary Create Employment Action
|
||||||
|
*/
|
||||||
|
export const useCreateEmploymentActionHrActionsPost = <
|
||||||
|
TError = HTTPValidationError,
|
||||||
|
TContext = unknown,
|
||||||
|
>(
|
||||||
|
options?: {
|
||||||
|
mutation?: UseMutationOptions<
|
||||||
|
Awaited<ReturnType<typeof createEmploymentActionHrActionsPost>>,
|
||||||
|
TError,
|
||||||
|
{ data: EmploymentActionCreate },
|
||||||
|
TContext
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): UseMutationResult<
|
||||||
|
Awaited<ReturnType<typeof createEmploymentActionHrActionsPost>>,
|
||||||
|
TError,
|
||||||
|
{ data: EmploymentActionCreate },
|
||||||
|
TContext
|
||||||
|
> => {
|
||||||
|
return useMutation(
|
||||||
|
getCreateEmploymentActionHrActionsPostMutationOptions(options),
|
||||||
|
queryClient,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|||||||
@@ -4,6 +4,22 @@
|
|||||||
* OpenClaw Agency API
|
* OpenClaw Agency API
|
||||||
* OpenAPI spec version: 0.3.0
|
* 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 {
|
import type {
|
||||||
Department,
|
Department,
|
||||||
DepartmentCreate,
|
DepartmentCreate,
|
||||||
@@ -16,6 +32,8 @@ import type {
|
|||||||
|
|
||||||
import { customFetch } from "../../mutator";
|
import { customFetch } from "../../mutator";
|
||||||
|
|
||||||
|
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @summary List Departments
|
* @summary List Departments
|
||||||
*/
|
*/
|
||||||
@@ -47,6 +65,147 @@ export const listDepartmentsDepartmentsGet = async (
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getListDepartmentsDepartmentsGetQueryKey = () => {
|
||||||
|
return [`/departments`] as const;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getListDepartmentsDepartmentsGetQueryOptions = <
|
||||||
|
TData = Awaited<ReturnType<typeof listDepartmentsDepartmentsGet>>,
|
||||||
|
TError = unknown,
|
||||||
|
>(options?: {
|
||||||
|
query?: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listDepartmentsDepartmentsGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
}) => {
|
||||||
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
||||||
|
|
||||||
|
const queryKey =
|
||||||
|
queryOptions?.queryKey ?? getListDepartmentsDepartmentsGetQueryKey();
|
||||||
|
|
||||||
|
const queryFn: QueryFunction<
|
||||||
|
Awaited<ReturnType<typeof listDepartmentsDepartmentsGet>>
|
||||||
|
> = ({ signal }) =>
|
||||||
|
listDepartmentsDepartmentsGet({ signal, ...requestOptions });
|
||||||
|
|
||||||
|
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listDepartmentsDepartmentsGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||||
|
};
|
||||||
|
|
||||||
|
export type ListDepartmentsDepartmentsGetQueryResult = NonNullable<
|
||||||
|
Awaited<ReturnType<typeof listDepartmentsDepartmentsGet>>
|
||||||
|
>;
|
||||||
|
export type ListDepartmentsDepartmentsGetQueryError = unknown;
|
||||||
|
|
||||||
|
export function useListDepartmentsDepartmentsGet<
|
||||||
|
TData = Awaited<ReturnType<typeof listDepartmentsDepartmentsGet>>,
|
||||||
|
TError = unknown,
|
||||||
|
>(
|
||||||
|
options: {
|
||||||
|
query: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listDepartmentsDepartmentsGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
> &
|
||||||
|
Pick<
|
||||||
|
DefinedInitialDataOptions<
|
||||||
|
Awaited<ReturnType<typeof listDepartmentsDepartmentsGet>>,
|
||||||
|
TError,
|
||||||
|
Awaited<ReturnType<typeof listDepartmentsDepartmentsGet>>
|
||||||
|
>,
|
||||||
|
"initialData"
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): DefinedUseQueryResult<TData, TError> & {
|
||||||
|
queryKey: DataTag<QueryKey, TData, TError>;
|
||||||
|
};
|
||||||
|
export function useListDepartmentsDepartmentsGet<
|
||||||
|
TData = Awaited<ReturnType<typeof listDepartmentsDepartmentsGet>>,
|
||||||
|
TError = unknown,
|
||||||
|
>(
|
||||||
|
options?: {
|
||||||
|
query?: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listDepartmentsDepartmentsGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
> &
|
||||||
|
Pick<
|
||||||
|
UndefinedInitialDataOptions<
|
||||||
|
Awaited<ReturnType<typeof listDepartmentsDepartmentsGet>>,
|
||||||
|
TError,
|
||||||
|
Awaited<ReturnType<typeof listDepartmentsDepartmentsGet>>
|
||||||
|
>,
|
||||||
|
"initialData"
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): UseQueryResult<TData, TError> & {
|
||||||
|
queryKey: DataTag<QueryKey, TData, TError>;
|
||||||
|
};
|
||||||
|
export function useListDepartmentsDepartmentsGet<
|
||||||
|
TData = Awaited<ReturnType<typeof listDepartmentsDepartmentsGet>>,
|
||||||
|
TError = unknown,
|
||||||
|
>(
|
||||||
|
options?: {
|
||||||
|
query?: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listDepartmentsDepartmentsGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): UseQueryResult<TData, TError> & {
|
||||||
|
queryKey: DataTag<QueryKey, TData, TError>;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* @summary List Departments
|
||||||
|
*/
|
||||||
|
|
||||||
|
export function useListDepartmentsDepartmentsGet<
|
||||||
|
TData = Awaited<ReturnType<typeof listDepartmentsDepartmentsGet>>,
|
||||||
|
TError = unknown,
|
||||||
|
>(
|
||||||
|
options?: {
|
||||||
|
query?: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listDepartmentsDepartmentsGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): UseQueryResult<TData, TError> & {
|
||||||
|
queryKey: DataTag<QueryKey, TData, TError>;
|
||||||
|
} {
|
||||||
|
const queryOptions = getListDepartmentsDepartmentsGetQueryOptions(options);
|
||||||
|
|
||||||
|
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
|
||||||
|
TData,
|
||||||
|
TError
|
||||||
|
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||||
|
|
||||||
|
return { ...query, queryKey: queryOptions.queryKey };
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @summary Create Department
|
* @summary Create Department
|
||||||
*/
|
*/
|
||||||
@@ -92,6 +251,78 @@ export const createDepartmentDepartmentsPost = async (
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getCreateDepartmentDepartmentsPostMutationOptions = <
|
||||||
|
TError = HTTPValidationError,
|
||||||
|
TContext = unknown,
|
||||||
|
>(options?: {
|
||||||
|
mutation?: UseMutationOptions<
|
||||||
|
Awaited<ReturnType<typeof createDepartmentDepartmentsPost>>,
|
||||||
|
TError,
|
||||||
|
{ data: DepartmentCreate },
|
||||||
|
TContext
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
}): UseMutationOptions<
|
||||||
|
Awaited<ReturnType<typeof createDepartmentDepartmentsPost>>,
|
||||||
|
TError,
|
||||||
|
{ data: DepartmentCreate },
|
||||||
|
TContext
|
||||||
|
> => {
|
||||||
|
const mutationKey = ["createDepartmentDepartmentsPost"];
|
||||||
|
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 createDepartmentDepartmentsPost>>,
|
||||||
|
{ data: DepartmentCreate }
|
||||||
|
> = (props) => {
|
||||||
|
const { data } = props ?? {};
|
||||||
|
|
||||||
|
return createDepartmentDepartmentsPost(data, requestOptions);
|
||||||
|
};
|
||||||
|
|
||||||
|
return { mutationFn, ...mutationOptions };
|
||||||
|
};
|
||||||
|
|
||||||
|
export type CreateDepartmentDepartmentsPostMutationResult = NonNullable<
|
||||||
|
Awaited<ReturnType<typeof createDepartmentDepartmentsPost>>
|
||||||
|
>;
|
||||||
|
export type CreateDepartmentDepartmentsPostMutationBody = DepartmentCreate;
|
||||||
|
export type CreateDepartmentDepartmentsPostMutationError = HTTPValidationError;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @summary Create Department
|
||||||
|
*/
|
||||||
|
export const useCreateDepartmentDepartmentsPost = <
|
||||||
|
TError = HTTPValidationError,
|
||||||
|
TContext = unknown,
|
||||||
|
>(
|
||||||
|
options?: {
|
||||||
|
mutation?: UseMutationOptions<
|
||||||
|
Awaited<ReturnType<typeof createDepartmentDepartmentsPost>>,
|
||||||
|
TError,
|
||||||
|
{ data: DepartmentCreate },
|
||||||
|
TContext
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): UseMutationResult<
|
||||||
|
Awaited<ReturnType<typeof createDepartmentDepartmentsPost>>,
|
||||||
|
TError,
|
||||||
|
{ data: DepartmentCreate },
|
||||||
|
TContext
|
||||||
|
> => {
|
||||||
|
return useMutation(
|
||||||
|
getCreateDepartmentDepartmentsPostMutationOptions(options),
|
||||||
|
queryClient,
|
||||||
|
);
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* @summary Update Department
|
* @summary Update Department
|
||||||
*/
|
*/
|
||||||
@@ -140,6 +371,85 @@ export const updateDepartmentDepartmentsDepartmentIdPatch = async (
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getUpdateDepartmentDepartmentsDepartmentIdPatchMutationOptions = <
|
||||||
|
TError = HTTPValidationError,
|
||||||
|
TContext = unknown,
|
||||||
|
>(options?: {
|
||||||
|
mutation?: UseMutationOptions<
|
||||||
|
Awaited<ReturnType<typeof updateDepartmentDepartmentsDepartmentIdPatch>>,
|
||||||
|
TError,
|
||||||
|
{ departmentId: number; data: DepartmentUpdate },
|
||||||
|
TContext
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
}): UseMutationOptions<
|
||||||
|
Awaited<ReturnType<typeof updateDepartmentDepartmentsDepartmentIdPatch>>,
|
||||||
|
TError,
|
||||||
|
{ departmentId: number; data: DepartmentUpdate },
|
||||||
|
TContext
|
||||||
|
> => {
|
||||||
|
const mutationKey = ["updateDepartmentDepartmentsDepartmentIdPatch"];
|
||||||
|
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 updateDepartmentDepartmentsDepartmentIdPatch>>,
|
||||||
|
{ departmentId: number; data: DepartmentUpdate }
|
||||||
|
> = (props) => {
|
||||||
|
const { departmentId, data } = props ?? {};
|
||||||
|
|
||||||
|
return updateDepartmentDepartmentsDepartmentIdPatch(
|
||||||
|
departmentId,
|
||||||
|
data,
|
||||||
|
requestOptions,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
return { mutationFn, ...mutationOptions };
|
||||||
|
};
|
||||||
|
|
||||||
|
export type UpdateDepartmentDepartmentsDepartmentIdPatchMutationResult =
|
||||||
|
NonNullable<
|
||||||
|
Awaited<ReturnType<typeof updateDepartmentDepartmentsDepartmentIdPatch>>
|
||||||
|
>;
|
||||||
|
export type UpdateDepartmentDepartmentsDepartmentIdPatchMutationBody =
|
||||||
|
DepartmentUpdate;
|
||||||
|
export type UpdateDepartmentDepartmentsDepartmentIdPatchMutationError =
|
||||||
|
HTTPValidationError;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @summary Update Department
|
||||||
|
*/
|
||||||
|
export const useUpdateDepartmentDepartmentsDepartmentIdPatch = <
|
||||||
|
TError = HTTPValidationError,
|
||||||
|
TContext = unknown,
|
||||||
|
>(
|
||||||
|
options?: {
|
||||||
|
mutation?: UseMutationOptions<
|
||||||
|
Awaited<ReturnType<typeof updateDepartmentDepartmentsDepartmentIdPatch>>,
|
||||||
|
TError,
|
||||||
|
{ departmentId: number; data: DepartmentUpdate },
|
||||||
|
TContext
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): UseMutationResult<
|
||||||
|
Awaited<ReturnType<typeof updateDepartmentDepartmentsDepartmentIdPatch>>,
|
||||||
|
TError,
|
||||||
|
{ departmentId: number; data: DepartmentUpdate },
|
||||||
|
TContext
|
||||||
|
> => {
|
||||||
|
return useMutation(
|
||||||
|
getUpdateDepartmentDepartmentsDepartmentIdPatchMutationOptions(options),
|
||||||
|
queryClient,
|
||||||
|
);
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* @summary List Employees
|
* @summary List Employees
|
||||||
*/
|
*/
|
||||||
@@ -171,6 +481,146 @@ export const listEmployeesEmployeesGet = async (
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getListEmployeesEmployeesGetQueryKey = () => {
|
||||||
|
return [`/employees`] as const;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getListEmployeesEmployeesGetQueryOptions = <
|
||||||
|
TData = Awaited<ReturnType<typeof listEmployeesEmployeesGet>>,
|
||||||
|
TError = unknown,
|
||||||
|
>(options?: {
|
||||||
|
query?: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listEmployeesEmployeesGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
}) => {
|
||||||
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
||||||
|
|
||||||
|
const queryKey =
|
||||||
|
queryOptions?.queryKey ?? getListEmployeesEmployeesGetQueryKey();
|
||||||
|
|
||||||
|
const queryFn: QueryFunction<
|
||||||
|
Awaited<ReturnType<typeof listEmployeesEmployeesGet>>
|
||||||
|
> = ({ signal }) => listEmployeesEmployeesGet({ signal, ...requestOptions });
|
||||||
|
|
||||||
|
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listEmployeesEmployeesGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||||
|
};
|
||||||
|
|
||||||
|
export type ListEmployeesEmployeesGetQueryResult = NonNullable<
|
||||||
|
Awaited<ReturnType<typeof listEmployeesEmployeesGet>>
|
||||||
|
>;
|
||||||
|
export type ListEmployeesEmployeesGetQueryError = unknown;
|
||||||
|
|
||||||
|
export function useListEmployeesEmployeesGet<
|
||||||
|
TData = Awaited<ReturnType<typeof listEmployeesEmployeesGet>>,
|
||||||
|
TError = unknown,
|
||||||
|
>(
|
||||||
|
options: {
|
||||||
|
query: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listEmployeesEmployeesGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
> &
|
||||||
|
Pick<
|
||||||
|
DefinedInitialDataOptions<
|
||||||
|
Awaited<ReturnType<typeof listEmployeesEmployeesGet>>,
|
||||||
|
TError,
|
||||||
|
Awaited<ReturnType<typeof listEmployeesEmployeesGet>>
|
||||||
|
>,
|
||||||
|
"initialData"
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): DefinedUseQueryResult<TData, TError> & {
|
||||||
|
queryKey: DataTag<QueryKey, TData, TError>;
|
||||||
|
};
|
||||||
|
export function useListEmployeesEmployeesGet<
|
||||||
|
TData = Awaited<ReturnType<typeof listEmployeesEmployeesGet>>,
|
||||||
|
TError = unknown,
|
||||||
|
>(
|
||||||
|
options?: {
|
||||||
|
query?: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listEmployeesEmployeesGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
> &
|
||||||
|
Pick<
|
||||||
|
UndefinedInitialDataOptions<
|
||||||
|
Awaited<ReturnType<typeof listEmployeesEmployeesGet>>,
|
||||||
|
TError,
|
||||||
|
Awaited<ReturnType<typeof listEmployeesEmployeesGet>>
|
||||||
|
>,
|
||||||
|
"initialData"
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): UseQueryResult<TData, TError> & {
|
||||||
|
queryKey: DataTag<QueryKey, TData, TError>;
|
||||||
|
};
|
||||||
|
export function useListEmployeesEmployeesGet<
|
||||||
|
TData = Awaited<ReturnType<typeof listEmployeesEmployeesGet>>,
|
||||||
|
TError = unknown,
|
||||||
|
>(
|
||||||
|
options?: {
|
||||||
|
query?: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listEmployeesEmployeesGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): UseQueryResult<TData, TError> & {
|
||||||
|
queryKey: DataTag<QueryKey, TData, TError>;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* @summary List Employees
|
||||||
|
*/
|
||||||
|
|
||||||
|
export function useListEmployeesEmployeesGet<
|
||||||
|
TData = Awaited<ReturnType<typeof listEmployeesEmployeesGet>>,
|
||||||
|
TError = unknown,
|
||||||
|
>(
|
||||||
|
options?: {
|
||||||
|
query?: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listEmployeesEmployeesGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): UseQueryResult<TData, TError> & {
|
||||||
|
queryKey: DataTag<QueryKey, TData, TError>;
|
||||||
|
} {
|
||||||
|
const queryOptions = getListEmployeesEmployeesGetQueryOptions(options);
|
||||||
|
|
||||||
|
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
|
||||||
|
TData,
|
||||||
|
TError
|
||||||
|
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||||
|
|
||||||
|
return { ...query, queryKey: queryOptions.queryKey };
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @summary Create Employee
|
* @summary Create Employee
|
||||||
*/
|
*/
|
||||||
@@ -216,6 +666,78 @@ export const createEmployeeEmployeesPost = async (
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getCreateEmployeeEmployeesPostMutationOptions = <
|
||||||
|
TError = HTTPValidationError,
|
||||||
|
TContext = unknown,
|
||||||
|
>(options?: {
|
||||||
|
mutation?: UseMutationOptions<
|
||||||
|
Awaited<ReturnType<typeof createEmployeeEmployeesPost>>,
|
||||||
|
TError,
|
||||||
|
{ data: EmployeeCreate },
|
||||||
|
TContext
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
}): UseMutationOptions<
|
||||||
|
Awaited<ReturnType<typeof createEmployeeEmployeesPost>>,
|
||||||
|
TError,
|
||||||
|
{ data: EmployeeCreate },
|
||||||
|
TContext
|
||||||
|
> => {
|
||||||
|
const mutationKey = ["createEmployeeEmployeesPost"];
|
||||||
|
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 createEmployeeEmployeesPost>>,
|
||||||
|
{ data: EmployeeCreate }
|
||||||
|
> = (props) => {
|
||||||
|
const { data } = props ?? {};
|
||||||
|
|
||||||
|
return createEmployeeEmployeesPost(data, requestOptions);
|
||||||
|
};
|
||||||
|
|
||||||
|
return { mutationFn, ...mutationOptions };
|
||||||
|
};
|
||||||
|
|
||||||
|
export type CreateEmployeeEmployeesPostMutationResult = NonNullable<
|
||||||
|
Awaited<ReturnType<typeof createEmployeeEmployeesPost>>
|
||||||
|
>;
|
||||||
|
export type CreateEmployeeEmployeesPostMutationBody = EmployeeCreate;
|
||||||
|
export type CreateEmployeeEmployeesPostMutationError = HTTPValidationError;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @summary Create Employee
|
||||||
|
*/
|
||||||
|
export const useCreateEmployeeEmployeesPost = <
|
||||||
|
TError = HTTPValidationError,
|
||||||
|
TContext = unknown,
|
||||||
|
>(
|
||||||
|
options?: {
|
||||||
|
mutation?: UseMutationOptions<
|
||||||
|
Awaited<ReturnType<typeof createEmployeeEmployeesPost>>,
|
||||||
|
TError,
|
||||||
|
{ data: EmployeeCreate },
|
||||||
|
TContext
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): UseMutationResult<
|
||||||
|
Awaited<ReturnType<typeof createEmployeeEmployeesPost>>,
|
||||||
|
TError,
|
||||||
|
{ data: EmployeeCreate },
|
||||||
|
TContext
|
||||||
|
> => {
|
||||||
|
return useMutation(
|
||||||
|
getCreateEmployeeEmployeesPostMutationOptions(options),
|
||||||
|
queryClient,
|
||||||
|
);
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* @summary Update Employee
|
* @summary Update Employee
|
||||||
*/
|
*/
|
||||||
@@ -263,3 +785,81 @@ export const updateEmployeeEmployeesEmployeeIdPatch = async (
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getUpdateEmployeeEmployeesEmployeeIdPatchMutationOptions = <
|
||||||
|
TError = HTTPValidationError,
|
||||||
|
TContext = unknown,
|
||||||
|
>(options?: {
|
||||||
|
mutation?: UseMutationOptions<
|
||||||
|
Awaited<ReturnType<typeof updateEmployeeEmployeesEmployeeIdPatch>>,
|
||||||
|
TError,
|
||||||
|
{ employeeId: number; data: EmployeeUpdate },
|
||||||
|
TContext
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
}): UseMutationOptions<
|
||||||
|
Awaited<ReturnType<typeof updateEmployeeEmployeesEmployeeIdPatch>>,
|
||||||
|
TError,
|
||||||
|
{ employeeId: number; data: EmployeeUpdate },
|
||||||
|
TContext
|
||||||
|
> => {
|
||||||
|
const mutationKey = ["updateEmployeeEmployeesEmployeeIdPatch"];
|
||||||
|
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 updateEmployeeEmployeesEmployeeIdPatch>>,
|
||||||
|
{ employeeId: number; data: EmployeeUpdate }
|
||||||
|
> = (props) => {
|
||||||
|
const { employeeId, data } = props ?? {};
|
||||||
|
|
||||||
|
return updateEmployeeEmployeesEmployeeIdPatch(
|
||||||
|
employeeId,
|
||||||
|
data,
|
||||||
|
requestOptions,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
return { mutationFn, ...mutationOptions };
|
||||||
|
};
|
||||||
|
|
||||||
|
export type UpdateEmployeeEmployeesEmployeeIdPatchMutationResult = NonNullable<
|
||||||
|
Awaited<ReturnType<typeof updateEmployeeEmployeesEmployeeIdPatch>>
|
||||||
|
>;
|
||||||
|
export type UpdateEmployeeEmployeesEmployeeIdPatchMutationBody = EmployeeUpdate;
|
||||||
|
export type UpdateEmployeeEmployeesEmployeeIdPatchMutationError =
|
||||||
|
HTTPValidationError;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @summary Update Employee
|
||||||
|
*/
|
||||||
|
export const useUpdateEmployeeEmployeesEmployeeIdPatch = <
|
||||||
|
TError = HTTPValidationError,
|
||||||
|
TContext = unknown,
|
||||||
|
>(
|
||||||
|
options?: {
|
||||||
|
mutation?: UseMutationOptions<
|
||||||
|
Awaited<ReturnType<typeof updateEmployeeEmployeesEmployeeIdPatch>>,
|
||||||
|
TError,
|
||||||
|
{ employeeId: number; data: EmployeeUpdate },
|
||||||
|
TContext
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): UseMutationResult<
|
||||||
|
Awaited<ReturnType<typeof updateEmployeeEmployeesEmployeeIdPatch>>,
|
||||||
|
TError,
|
||||||
|
{ employeeId: number; data: EmployeeUpdate },
|
||||||
|
TContext
|
||||||
|
> => {
|
||||||
|
return useMutation(
|
||||||
|
getUpdateEmployeeEmployeesEmployeeIdPatchMutationOptions(options),
|
||||||
|
queryClient,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|||||||
@@ -4,6 +4,22 @@
|
|||||||
* OpenClaw Agency API
|
* OpenClaw Agency API
|
||||||
* OpenAPI spec version: 0.3.0
|
* 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 {
|
import type {
|
||||||
HTTPValidationError,
|
HTTPValidationError,
|
||||||
Project,
|
Project,
|
||||||
@@ -13,6 +29,8 @@ import type {
|
|||||||
|
|
||||||
import { customFetch } from "../../mutator";
|
import { customFetch } from "../../mutator";
|
||||||
|
|
||||||
|
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @summary List Projects
|
* @summary List Projects
|
||||||
*/
|
*/
|
||||||
@@ -44,6 +62,146 @@ export const listProjectsProjectsGet = async (
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getListProjectsProjectsGetQueryKey = () => {
|
||||||
|
return [`/projects`] as const;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getListProjectsProjectsGetQueryOptions = <
|
||||||
|
TData = Awaited<ReturnType<typeof listProjectsProjectsGet>>,
|
||||||
|
TError = unknown,
|
||||||
|
>(options?: {
|
||||||
|
query?: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listProjectsProjectsGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
}) => {
|
||||||
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
||||||
|
|
||||||
|
const queryKey =
|
||||||
|
queryOptions?.queryKey ?? getListProjectsProjectsGetQueryKey();
|
||||||
|
|
||||||
|
const queryFn: QueryFunction<
|
||||||
|
Awaited<ReturnType<typeof listProjectsProjectsGet>>
|
||||||
|
> = ({ signal }) => listProjectsProjectsGet({ signal, ...requestOptions });
|
||||||
|
|
||||||
|
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listProjectsProjectsGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||||
|
};
|
||||||
|
|
||||||
|
export type ListProjectsProjectsGetQueryResult = NonNullable<
|
||||||
|
Awaited<ReturnType<typeof listProjectsProjectsGet>>
|
||||||
|
>;
|
||||||
|
export type ListProjectsProjectsGetQueryError = unknown;
|
||||||
|
|
||||||
|
export function useListProjectsProjectsGet<
|
||||||
|
TData = Awaited<ReturnType<typeof listProjectsProjectsGet>>,
|
||||||
|
TError = unknown,
|
||||||
|
>(
|
||||||
|
options: {
|
||||||
|
query: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listProjectsProjectsGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
> &
|
||||||
|
Pick<
|
||||||
|
DefinedInitialDataOptions<
|
||||||
|
Awaited<ReturnType<typeof listProjectsProjectsGet>>,
|
||||||
|
TError,
|
||||||
|
Awaited<ReturnType<typeof listProjectsProjectsGet>>
|
||||||
|
>,
|
||||||
|
"initialData"
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): DefinedUseQueryResult<TData, TError> & {
|
||||||
|
queryKey: DataTag<QueryKey, TData, TError>;
|
||||||
|
};
|
||||||
|
export function useListProjectsProjectsGet<
|
||||||
|
TData = Awaited<ReturnType<typeof listProjectsProjectsGet>>,
|
||||||
|
TError = unknown,
|
||||||
|
>(
|
||||||
|
options?: {
|
||||||
|
query?: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listProjectsProjectsGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
> &
|
||||||
|
Pick<
|
||||||
|
UndefinedInitialDataOptions<
|
||||||
|
Awaited<ReturnType<typeof listProjectsProjectsGet>>,
|
||||||
|
TError,
|
||||||
|
Awaited<ReturnType<typeof listProjectsProjectsGet>>
|
||||||
|
>,
|
||||||
|
"initialData"
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): UseQueryResult<TData, TError> & {
|
||||||
|
queryKey: DataTag<QueryKey, TData, TError>;
|
||||||
|
};
|
||||||
|
export function useListProjectsProjectsGet<
|
||||||
|
TData = Awaited<ReturnType<typeof listProjectsProjectsGet>>,
|
||||||
|
TError = unknown,
|
||||||
|
>(
|
||||||
|
options?: {
|
||||||
|
query?: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listProjectsProjectsGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): UseQueryResult<TData, TError> & {
|
||||||
|
queryKey: DataTag<QueryKey, TData, TError>;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* @summary List Projects
|
||||||
|
*/
|
||||||
|
|
||||||
|
export function useListProjectsProjectsGet<
|
||||||
|
TData = Awaited<ReturnType<typeof listProjectsProjectsGet>>,
|
||||||
|
TError = unknown,
|
||||||
|
>(
|
||||||
|
options?: {
|
||||||
|
query?: Partial<
|
||||||
|
UseQueryOptions<
|
||||||
|
Awaited<ReturnType<typeof listProjectsProjectsGet>>,
|
||||||
|
TError,
|
||||||
|
TData
|
||||||
|
>
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): UseQueryResult<TData, TError> & {
|
||||||
|
queryKey: DataTag<QueryKey, TData, TError>;
|
||||||
|
} {
|
||||||
|
const queryOptions = getListProjectsProjectsGetQueryOptions(options);
|
||||||
|
|
||||||
|
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
|
||||||
|
TData,
|
||||||
|
TError
|
||||||
|
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||||
|
|
||||||
|
return { ...query, queryKey: queryOptions.queryKey };
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @summary Create Project
|
* @summary Create Project
|
||||||
*/
|
*/
|
||||||
@@ -89,6 +247,78 @@ export const createProjectProjectsPost = async (
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getCreateProjectProjectsPostMutationOptions = <
|
||||||
|
TError = HTTPValidationError,
|
||||||
|
TContext = unknown,
|
||||||
|
>(options?: {
|
||||||
|
mutation?: UseMutationOptions<
|
||||||
|
Awaited<ReturnType<typeof createProjectProjectsPost>>,
|
||||||
|
TError,
|
||||||
|
{ data: ProjectCreate },
|
||||||
|
TContext
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
}): UseMutationOptions<
|
||||||
|
Awaited<ReturnType<typeof createProjectProjectsPost>>,
|
||||||
|
TError,
|
||||||
|
{ data: ProjectCreate },
|
||||||
|
TContext
|
||||||
|
> => {
|
||||||
|
const mutationKey = ["createProjectProjectsPost"];
|
||||||
|
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 createProjectProjectsPost>>,
|
||||||
|
{ data: ProjectCreate }
|
||||||
|
> = (props) => {
|
||||||
|
const { data } = props ?? {};
|
||||||
|
|
||||||
|
return createProjectProjectsPost(data, requestOptions);
|
||||||
|
};
|
||||||
|
|
||||||
|
return { mutationFn, ...mutationOptions };
|
||||||
|
};
|
||||||
|
|
||||||
|
export type CreateProjectProjectsPostMutationResult = NonNullable<
|
||||||
|
Awaited<ReturnType<typeof createProjectProjectsPost>>
|
||||||
|
>;
|
||||||
|
export type CreateProjectProjectsPostMutationBody = ProjectCreate;
|
||||||
|
export type CreateProjectProjectsPostMutationError = HTTPValidationError;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @summary Create Project
|
||||||
|
*/
|
||||||
|
export const useCreateProjectProjectsPost = <
|
||||||
|
TError = HTTPValidationError,
|
||||||
|
TContext = unknown,
|
||||||
|
>(
|
||||||
|
options?: {
|
||||||
|
mutation?: UseMutationOptions<
|
||||||
|
Awaited<ReturnType<typeof createProjectProjectsPost>>,
|
||||||
|
TError,
|
||||||
|
{ data: ProjectCreate },
|
||||||
|
TContext
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): UseMutationResult<
|
||||||
|
Awaited<ReturnType<typeof createProjectProjectsPost>>,
|
||||||
|
TError,
|
||||||
|
{ data: ProjectCreate },
|
||||||
|
TContext
|
||||||
|
> => {
|
||||||
|
return useMutation(
|
||||||
|
getCreateProjectProjectsPostMutationOptions(options),
|
||||||
|
queryClient,
|
||||||
|
);
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* @summary Update Project
|
* @summary Update Project
|
||||||
*/
|
*/
|
||||||
@@ -136,3 +366,77 @@ export const updateProjectProjectsProjectIdPatch = async (
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getUpdateProjectProjectsProjectIdPatchMutationOptions = <
|
||||||
|
TError = HTTPValidationError,
|
||||||
|
TContext = unknown,
|
||||||
|
>(options?: {
|
||||||
|
mutation?: UseMutationOptions<
|
||||||
|
Awaited<ReturnType<typeof updateProjectProjectsProjectIdPatch>>,
|
||||||
|
TError,
|
||||||
|
{ projectId: number; data: ProjectUpdate },
|
||||||
|
TContext
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
}): UseMutationOptions<
|
||||||
|
Awaited<ReturnType<typeof updateProjectProjectsProjectIdPatch>>,
|
||||||
|
TError,
|
||||||
|
{ projectId: number; data: ProjectUpdate },
|
||||||
|
TContext
|
||||||
|
> => {
|
||||||
|
const mutationKey = ["updateProjectProjectsProjectIdPatch"];
|
||||||
|
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 updateProjectProjectsProjectIdPatch>>,
|
||||||
|
{ projectId: number; data: ProjectUpdate }
|
||||||
|
> = (props) => {
|
||||||
|
const { projectId, data } = props ?? {};
|
||||||
|
|
||||||
|
return updateProjectProjectsProjectIdPatch(projectId, data, requestOptions);
|
||||||
|
};
|
||||||
|
|
||||||
|
return { mutationFn, ...mutationOptions };
|
||||||
|
};
|
||||||
|
|
||||||
|
export type UpdateProjectProjectsProjectIdPatchMutationResult = NonNullable<
|
||||||
|
Awaited<ReturnType<typeof updateProjectProjectsProjectIdPatch>>
|
||||||
|
>;
|
||||||
|
export type UpdateProjectProjectsProjectIdPatchMutationBody = ProjectUpdate;
|
||||||
|
export type UpdateProjectProjectsProjectIdPatchMutationError =
|
||||||
|
HTTPValidationError;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @summary Update Project
|
||||||
|
*/
|
||||||
|
export const useUpdateProjectProjectsProjectIdPatch = <
|
||||||
|
TError = HTTPValidationError,
|
||||||
|
TContext = unknown,
|
||||||
|
>(
|
||||||
|
options?: {
|
||||||
|
mutation?: UseMutationOptions<
|
||||||
|
Awaited<ReturnType<typeof updateProjectProjectsProjectIdPatch>>,
|
||||||
|
TError,
|
||||||
|
{ projectId: number; data: ProjectUpdate },
|
||||||
|
TContext
|
||||||
|
>;
|
||||||
|
request?: SecondParameter<typeof customFetch>;
|
||||||
|
},
|
||||||
|
queryClient?: QueryClient,
|
||||||
|
): UseMutationResult<
|
||||||
|
Awaited<ReturnType<typeof updateProjectProjectsProjectIdPatch>>,
|
||||||
|
TError,
|
||||||
|
{ projectId: number; data: ProjectUpdate },
|
||||||
|
TContext
|
||||||
|
> => {
|
||||||
|
return useMutation(
|
||||||
|
getUpdateProjectProjectsProjectIdPatchMutationOptions(options),
|
||||||
|
queryClient,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|||||||
@@ -4,6 +4,22 @@
|
|||||||
* OpenClaw Agency API
|
* OpenClaw Agency API
|
||||||
* OpenAPI spec version: 0.3.0
|
* 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 {
|
import type {
|
||||||
HTTPValidationError,
|
HTTPValidationError,
|
||||||
ListTaskCommentsTaskCommentsGetParams,
|
ListTaskCommentsTaskCommentsGetParams,
|
||||||
@@ -17,6 +33,8 @@ import type {
|
|||||||
|
|
||||||
import { customFetch } from "../../mutator";
|
import { customFetch } from "../../mutator";
|
||||||
|
|
||||||
|
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @summary List Tasks
|
* @summary List Tasks
|
||||||
*/
|
*/
|
||||||
@@ -70,6 +88,155 @@ export const listTasksTasksGet = async (
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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
|
* @summary Create Task
|
||||||
*/
|
*/
|
||||||
@@ -112,6 +279,78 @@ export const createTaskTasksPost = async (
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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 Update Task
|
* @summary Update Task
|
||||||
*/
|
*/
|
||||||
@@ -158,6 +397,78 @@ export const updateTaskTasksTaskIdPatch = async (
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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
|
* @summary Delete Task
|
||||||
*/
|
*/
|
||||||
@@ -201,6 +512,78 @@ export const deleteTaskTasksTaskIdDelete = async (
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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
|
* @summary List Task Comments
|
||||||
*/
|
*/
|
||||||
@@ -258,6 +641,160 @@ export const listTaskCommentsTaskCommentsGet = async (
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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
|
* @summary Create Task Comment
|
||||||
*/
|
*/
|
||||||
@@ -302,3 +839,77 @@ export const createTaskCommentTaskCommentsPost = async (
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user