feat: add validation for minimum length on various fields and update type definitions
This commit is contained in:
2960
frontend/src/api/generated/agent/agent.ts
Normal file
2960
frontend/src/api/generated/agent/agent.ts
Normal file
File diff suppressed because it is too large
Load Diff
@@ -22,16 +22,14 @@ import type {
|
||||
|
||||
import type {
|
||||
AgentCreate,
|
||||
AgentDeleteConfirm,
|
||||
AgentHeartbeat,
|
||||
AgentHeartbeatCreate,
|
||||
AgentProvisionConfirm,
|
||||
AgentRead,
|
||||
AgentUpdate,
|
||||
ConfirmDeleteAgentApiV1AgentsAgentIdDeleteConfirmPost200,
|
||||
ConfirmProvisionAgentApiV1AgentsAgentIdProvisionConfirmPost200,
|
||||
DeleteAgentApiV1AgentsAgentIdDelete200,
|
||||
HTTPValidationError,
|
||||
OkResponse,
|
||||
StreamAgentsApiV1AgentsStreamGetParams,
|
||||
UpdateAgentApiV1AgentsAgentIdPatchParams,
|
||||
} from ".././model";
|
||||
|
||||
import { customFetch } from "../../mutator";
|
||||
@@ -326,6 +324,217 @@ export const useCreateAgentApiV1AgentsPost = <
|
||||
queryClient,
|
||||
);
|
||||
};
|
||||
/**
|
||||
* @summary Stream Agents
|
||||
*/
|
||||
export type streamAgentsApiV1AgentsStreamGetResponse200 = {
|
||||
data: unknown;
|
||||
status: 200;
|
||||
};
|
||||
|
||||
export type streamAgentsApiV1AgentsStreamGetResponse422 = {
|
||||
data: HTTPValidationError;
|
||||
status: 422;
|
||||
};
|
||||
|
||||
export type streamAgentsApiV1AgentsStreamGetResponseSuccess =
|
||||
streamAgentsApiV1AgentsStreamGetResponse200 & {
|
||||
headers: Headers;
|
||||
};
|
||||
export type streamAgentsApiV1AgentsStreamGetResponseError =
|
||||
streamAgentsApiV1AgentsStreamGetResponse422 & {
|
||||
headers: Headers;
|
||||
};
|
||||
|
||||
export type streamAgentsApiV1AgentsStreamGetResponse =
|
||||
| streamAgentsApiV1AgentsStreamGetResponseSuccess
|
||||
| streamAgentsApiV1AgentsStreamGetResponseError;
|
||||
|
||||
export const getStreamAgentsApiV1AgentsStreamGetUrl = (
|
||||
params?: StreamAgentsApiV1AgentsStreamGetParams,
|
||||
) => {
|
||||
const normalizedParams = new URLSearchParams();
|
||||
|
||||
Object.entries(params || {}).forEach(([key, value]) => {
|
||||
if (value !== undefined) {
|
||||
normalizedParams.append(key, value === null ? "null" : value.toString());
|
||||
}
|
||||
});
|
||||
|
||||
const stringifiedParams = normalizedParams.toString();
|
||||
|
||||
return stringifiedParams.length > 0
|
||||
? `/api/v1/agents/stream?${stringifiedParams}`
|
||||
: `/api/v1/agents/stream`;
|
||||
};
|
||||
|
||||
export const streamAgentsApiV1AgentsStreamGet = async (
|
||||
params?: StreamAgentsApiV1AgentsStreamGetParams,
|
||||
options?: RequestInit,
|
||||
): Promise<streamAgentsApiV1AgentsStreamGetResponse> => {
|
||||
return customFetch<streamAgentsApiV1AgentsStreamGetResponse>(
|
||||
getStreamAgentsApiV1AgentsStreamGetUrl(params),
|
||||
{
|
||||
...options,
|
||||
method: "GET",
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
export const getStreamAgentsApiV1AgentsStreamGetQueryKey = (
|
||||
params?: StreamAgentsApiV1AgentsStreamGetParams,
|
||||
) => {
|
||||
return [`/api/v1/agents/stream`, ...(params ? [params] : [])] as const;
|
||||
};
|
||||
|
||||
export const getStreamAgentsApiV1AgentsStreamGetQueryOptions = <
|
||||
TData = Awaited<ReturnType<typeof streamAgentsApiV1AgentsStreamGet>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
params?: StreamAgentsApiV1AgentsStreamGetParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof streamAgentsApiV1AgentsStreamGet>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
) => {
|
||||
const { query: queryOptions, request: requestOptions } = options ?? {};
|
||||
|
||||
const queryKey =
|
||||
queryOptions?.queryKey ??
|
||||
getStreamAgentsApiV1AgentsStreamGetQueryKey(params);
|
||||
|
||||
const queryFn: QueryFunction<
|
||||
Awaited<ReturnType<typeof streamAgentsApiV1AgentsStreamGet>>
|
||||
> = ({ signal }) =>
|
||||
streamAgentsApiV1AgentsStreamGet(params, { signal, ...requestOptions });
|
||||
|
||||
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
|
||||
Awaited<ReturnType<typeof streamAgentsApiV1AgentsStreamGet>>,
|
||||
TError,
|
||||
TData
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
};
|
||||
|
||||
export type StreamAgentsApiV1AgentsStreamGetQueryResult = NonNullable<
|
||||
Awaited<ReturnType<typeof streamAgentsApiV1AgentsStreamGet>>
|
||||
>;
|
||||
export type StreamAgentsApiV1AgentsStreamGetQueryError = HTTPValidationError;
|
||||
|
||||
export function useStreamAgentsApiV1AgentsStreamGet<
|
||||
TData = Awaited<ReturnType<typeof streamAgentsApiV1AgentsStreamGet>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
params: undefined | StreamAgentsApiV1AgentsStreamGetParams,
|
||||
options: {
|
||||
query: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof streamAgentsApiV1AgentsStreamGet>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
> &
|
||||
Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof streamAgentsApiV1AgentsStreamGet>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof streamAgentsApiV1AgentsStreamGet>>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): DefinedUseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useStreamAgentsApiV1AgentsStreamGet<
|
||||
TData = Awaited<ReturnType<typeof streamAgentsApiV1AgentsStreamGet>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
params?: StreamAgentsApiV1AgentsStreamGetParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof streamAgentsApiV1AgentsStreamGet>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
> &
|
||||
Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof streamAgentsApiV1AgentsStreamGet>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof streamAgentsApiV1AgentsStreamGet>>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useStreamAgentsApiV1AgentsStreamGet<
|
||||
TData = Awaited<ReturnType<typeof streamAgentsApiV1AgentsStreamGet>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
params?: StreamAgentsApiV1AgentsStreamGetParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof streamAgentsApiV1AgentsStreamGet>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
/**
|
||||
* @summary Stream Agents
|
||||
*/
|
||||
|
||||
export function useStreamAgentsApiV1AgentsStreamGet<
|
||||
TData = Awaited<ReturnType<typeof streamAgentsApiV1AgentsStreamGet>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
params?: StreamAgentsApiV1AgentsStreamGetParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof streamAgentsApiV1AgentsStreamGet>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
} {
|
||||
const queryOptions = getStreamAgentsApiV1AgentsStreamGetQueryOptions(
|
||||
params,
|
||||
options,
|
||||
);
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
|
||||
TData,
|
||||
TError
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
return { ...query, queryKey: queryOptions.queryKey };
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Get Agent
|
||||
*/
|
||||
@@ -551,17 +760,33 @@ export type updateAgentApiV1AgentsAgentIdPatchResponse =
|
||||
| updateAgentApiV1AgentsAgentIdPatchResponseSuccess
|
||||
| updateAgentApiV1AgentsAgentIdPatchResponseError;
|
||||
|
||||
export const getUpdateAgentApiV1AgentsAgentIdPatchUrl = (agentId: string) => {
|
||||
return `/api/v1/agents/${agentId}`;
|
||||
export const getUpdateAgentApiV1AgentsAgentIdPatchUrl = (
|
||||
agentId: string,
|
||||
params?: UpdateAgentApiV1AgentsAgentIdPatchParams,
|
||||
) => {
|
||||
const normalizedParams = new URLSearchParams();
|
||||
|
||||
Object.entries(params || {}).forEach(([key, value]) => {
|
||||
if (value !== undefined) {
|
||||
normalizedParams.append(key, value === null ? "null" : value.toString());
|
||||
}
|
||||
});
|
||||
|
||||
const stringifiedParams = normalizedParams.toString();
|
||||
|
||||
return stringifiedParams.length > 0
|
||||
? `/api/v1/agents/${agentId}?${stringifiedParams}`
|
||||
: `/api/v1/agents/${agentId}`;
|
||||
};
|
||||
|
||||
export const updateAgentApiV1AgentsAgentIdPatch = async (
|
||||
agentId: string,
|
||||
agentUpdate: AgentUpdate,
|
||||
params?: UpdateAgentApiV1AgentsAgentIdPatchParams,
|
||||
options?: RequestInit,
|
||||
): Promise<updateAgentApiV1AgentsAgentIdPatchResponse> => {
|
||||
return customFetch<updateAgentApiV1AgentsAgentIdPatchResponse>(
|
||||
getUpdateAgentApiV1AgentsAgentIdPatchUrl(agentId),
|
||||
getUpdateAgentApiV1AgentsAgentIdPatchUrl(agentId, params),
|
||||
{
|
||||
...options,
|
||||
method: "PATCH",
|
||||
@@ -578,14 +803,22 @@ export const getUpdateAgentApiV1AgentsAgentIdPatchMutationOptions = <
|
||||
mutation?: UseMutationOptions<
|
||||
Awaited<ReturnType<typeof updateAgentApiV1AgentsAgentIdPatch>>,
|
||||
TError,
|
||||
{ agentId: string; data: AgentUpdate },
|
||||
{
|
||||
agentId: string;
|
||||
data: AgentUpdate;
|
||||
params?: UpdateAgentApiV1AgentsAgentIdPatchParams;
|
||||
},
|
||||
TContext
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
}): UseMutationOptions<
|
||||
Awaited<ReturnType<typeof updateAgentApiV1AgentsAgentIdPatch>>,
|
||||
TError,
|
||||
{ agentId: string; data: AgentUpdate },
|
||||
{
|
||||
agentId: string;
|
||||
data: AgentUpdate;
|
||||
params?: UpdateAgentApiV1AgentsAgentIdPatchParams;
|
||||
},
|
||||
TContext
|
||||
> => {
|
||||
const mutationKey = ["updateAgentApiV1AgentsAgentIdPatch"];
|
||||
@@ -599,11 +832,20 @@ export const getUpdateAgentApiV1AgentsAgentIdPatchMutationOptions = <
|
||||
|
||||
const mutationFn: MutationFunction<
|
||||
Awaited<ReturnType<typeof updateAgentApiV1AgentsAgentIdPatch>>,
|
||||
{ agentId: string; data: AgentUpdate }
|
||||
{
|
||||
agentId: string;
|
||||
data: AgentUpdate;
|
||||
params?: UpdateAgentApiV1AgentsAgentIdPatchParams;
|
||||
}
|
||||
> = (props) => {
|
||||
const { agentId, data } = props ?? {};
|
||||
const { agentId, data, params } = props ?? {};
|
||||
|
||||
return updateAgentApiV1AgentsAgentIdPatch(agentId, data, requestOptions);
|
||||
return updateAgentApiV1AgentsAgentIdPatch(
|
||||
agentId,
|
||||
data,
|
||||
params,
|
||||
requestOptions,
|
||||
);
|
||||
};
|
||||
|
||||
return { mutationFn, ...mutationOptions };
|
||||
@@ -627,7 +869,11 @@ export const useUpdateAgentApiV1AgentsAgentIdPatch = <
|
||||
mutation?: UseMutationOptions<
|
||||
Awaited<ReturnType<typeof updateAgentApiV1AgentsAgentIdPatch>>,
|
||||
TError,
|
||||
{ agentId: string; data: AgentUpdate },
|
||||
{
|
||||
agentId: string;
|
||||
data: AgentUpdate;
|
||||
params?: UpdateAgentApiV1AgentsAgentIdPatchParams;
|
||||
},
|
||||
TContext
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
@@ -636,7 +882,11 @@ export const useUpdateAgentApiV1AgentsAgentIdPatch = <
|
||||
): UseMutationResult<
|
||||
Awaited<ReturnType<typeof updateAgentApiV1AgentsAgentIdPatch>>,
|
||||
TError,
|
||||
{ agentId: string; data: AgentUpdate },
|
||||
{
|
||||
agentId: string;
|
||||
data: AgentUpdate;
|
||||
params?: UpdateAgentApiV1AgentsAgentIdPatchParams;
|
||||
},
|
||||
TContext
|
||||
> => {
|
||||
return useMutation(
|
||||
@@ -648,7 +898,7 @@ export const useUpdateAgentApiV1AgentsAgentIdPatch = <
|
||||
* @summary Delete Agent
|
||||
*/
|
||||
export type deleteAgentApiV1AgentsAgentIdDeleteResponse200 = {
|
||||
data: DeleteAgentApiV1AgentsAgentIdDelete200;
|
||||
data: OkResponse;
|
||||
status: 200;
|
||||
};
|
||||
|
||||
@@ -1014,302 +1264,3 @@ export const useHeartbeatOrCreateAgentApiV1AgentsHeartbeatPost = <
|
||||
queryClient,
|
||||
);
|
||||
};
|
||||
/**
|
||||
* @summary Confirm Provision Agent
|
||||
*/
|
||||
export type confirmProvisionAgentApiV1AgentsAgentIdProvisionConfirmPostResponse200 =
|
||||
{
|
||||
data: ConfirmProvisionAgentApiV1AgentsAgentIdProvisionConfirmPost200;
|
||||
status: 200;
|
||||
};
|
||||
|
||||
export type confirmProvisionAgentApiV1AgentsAgentIdProvisionConfirmPostResponse422 =
|
||||
{
|
||||
data: HTTPValidationError;
|
||||
status: 422;
|
||||
};
|
||||
|
||||
export type confirmProvisionAgentApiV1AgentsAgentIdProvisionConfirmPostResponseSuccess =
|
||||
confirmProvisionAgentApiV1AgentsAgentIdProvisionConfirmPostResponse200 & {
|
||||
headers: Headers;
|
||||
};
|
||||
export type confirmProvisionAgentApiV1AgentsAgentIdProvisionConfirmPostResponseError =
|
||||
confirmProvisionAgentApiV1AgentsAgentIdProvisionConfirmPostResponse422 & {
|
||||
headers: Headers;
|
||||
};
|
||||
|
||||
export type confirmProvisionAgentApiV1AgentsAgentIdProvisionConfirmPostResponse =
|
||||
|
||||
| confirmProvisionAgentApiV1AgentsAgentIdProvisionConfirmPostResponseSuccess
|
||||
| confirmProvisionAgentApiV1AgentsAgentIdProvisionConfirmPostResponseError;
|
||||
|
||||
export const getConfirmProvisionAgentApiV1AgentsAgentIdProvisionConfirmPostUrl =
|
||||
(agentId: string) => {
|
||||
return `/api/v1/agents/${agentId}/provision/confirm`;
|
||||
};
|
||||
|
||||
export const confirmProvisionAgentApiV1AgentsAgentIdProvisionConfirmPost =
|
||||
async (
|
||||
agentId: string,
|
||||
agentProvisionConfirm: AgentProvisionConfirm,
|
||||
options?: RequestInit,
|
||||
): Promise<confirmProvisionAgentApiV1AgentsAgentIdProvisionConfirmPostResponse> => {
|
||||
return customFetch<confirmProvisionAgentApiV1AgentsAgentIdProvisionConfirmPostResponse>(
|
||||
getConfirmProvisionAgentApiV1AgentsAgentIdProvisionConfirmPostUrl(
|
||||
agentId,
|
||||
),
|
||||
{
|
||||
...options,
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json", ...options?.headers },
|
||||
body: JSON.stringify(agentProvisionConfirm),
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
export const getConfirmProvisionAgentApiV1AgentsAgentIdProvisionConfirmPostMutationOptions =
|
||||
<TError = HTTPValidationError, TContext = unknown>(options?: {
|
||||
mutation?: UseMutationOptions<
|
||||
Awaited<
|
||||
ReturnType<
|
||||
typeof confirmProvisionAgentApiV1AgentsAgentIdProvisionConfirmPost
|
||||
>
|
||||
>,
|
||||
TError,
|
||||
{ agentId: string; data: AgentProvisionConfirm },
|
||||
TContext
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
}): UseMutationOptions<
|
||||
Awaited<
|
||||
ReturnType<
|
||||
typeof confirmProvisionAgentApiV1AgentsAgentIdProvisionConfirmPost
|
||||
>
|
||||
>,
|
||||
TError,
|
||||
{ agentId: string; data: AgentProvisionConfirm },
|
||||
TContext
|
||||
> => {
|
||||
const mutationKey = [
|
||||
"confirmProvisionAgentApiV1AgentsAgentIdProvisionConfirmPost",
|
||||
];
|
||||
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 confirmProvisionAgentApiV1AgentsAgentIdProvisionConfirmPost
|
||||
>
|
||||
>,
|
||||
{ agentId: string; data: AgentProvisionConfirm }
|
||||
> = (props) => {
|
||||
const { agentId, data } = props ?? {};
|
||||
|
||||
return confirmProvisionAgentApiV1AgentsAgentIdProvisionConfirmPost(
|
||||
agentId,
|
||||
data,
|
||||
requestOptions,
|
||||
);
|
||||
};
|
||||
|
||||
return { mutationFn, ...mutationOptions };
|
||||
};
|
||||
|
||||
export type ConfirmProvisionAgentApiV1AgentsAgentIdProvisionConfirmPostMutationResult =
|
||||
NonNullable<
|
||||
Awaited<
|
||||
ReturnType<
|
||||
typeof confirmProvisionAgentApiV1AgentsAgentIdProvisionConfirmPost
|
||||
>
|
||||
>
|
||||
>;
|
||||
export type ConfirmProvisionAgentApiV1AgentsAgentIdProvisionConfirmPostMutationBody =
|
||||
AgentProvisionConfirm;
|
||||
export type ConfirmProvisionAgentApiV1AgentsAgentIdProvisionConfirmPostMutationError =
|
||||
HTTPValidationError;
|
||||
|
||||
/**
|
||||
* @summary Confirm Provision Agent
|
||||
*/
|
||||
export const useConfirmProvisionAgentApiV1AgentsAgentIdProvisionConfirmPost = <
|
||||
TError = HTTPValidationError,
|
||||
TContext = unknown,
|
||||
>(
|
||||
options?: {
|
||||
mutation?: UseMutationOptions<
|
||||
Awaited<
|
||||
ReturnType<
|
||||
typeof confirmProvisionAgentApiV1AgentsAgentIdProvisionConfirmPost
|
||||
>
|
||||
>,
|
||||
TError,
|
||||
{ agentId: string; data: AgentProvisionConfirm },
|
||||
TContext
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseMutationResult<
|
||||
Awaited<
|
||||
ReturnType<
|
||||
typeof confirmProvisionAgentApiV1AgentsAgentIdProvisionConfirmPost
|
||||
>
|
||||
>,
|
||||
TError,
|
||||
{ agentId: string; data: AgentProvisionConfirm },
|
||||
TContext
|
||||
> => {
|
||||
return useMutation(
|
||||
getConfirmProvisionAgentApiV1AgentsAgentIdProvisionConfirmPostMutationOptions(
|
||||
options,
|
||||
),
|
||||
queryClient,
|
||||
);
|
||||
};
|
||||
/**
|
||||
* @summary Confirm Delete Agent
|
||||
*/
|
||||
export type confirmDeleteAgentApiV1AgentsAgentIdDeleteConfirmPostResponse200 = {
|
||||
data: ConfirmDeleteAgentApiV1AgentsAgentIdDeleteConfirmPost200;
|
||||
status: 200;
|
||||
};
|
||||
|
||||
export type confirmDeleteAgentApiV1AgentsAgentIdDeleteConfirmPostResponse422 = {
|
||||
data: HTTPValidationError;
|
||||
status: 422;
|
||||
};
|
||||
|
||||
export type confirmDeleteAgentApiV1AgentsAgentIdDeleteConfirmPostResponseSuccess =
|
||||
confirmDeleteAgentApiV1AgentsAgentIdDeleteConfirmPostResponse200 & {
|
||||
headers: Headers;
|
||||
};
|
||||
export type confirmDeleteAgentApiV1AgentsAgentIdDeleteConfirmPostResponseError =
|
||||
confirmDeleteAgentApiV1AgentsAgentIdDeleteConfirmPostResponse422 & {
|
||||
headers: Headers;
|
||||
};
|
||||
|
||||
export type confirmDeleteAgentApiV1AgentsAgentIdDeleteConfirmPostResponse =
|
||||
| confirmDeleteAgentApiV1AgentsAgentIdDeleteConfirmPostResponseSuccess
|
||||
| confirmDeleteAgentApiV1AgentsAgentIdDeleteConfirmPostResponseError;
|
||||
|
||||
export const getConfirmDeleteAgentApiV1AgentsAgentIdDeleteConfirmPostUrl = (
|
||||
agentId: string,
|
||||
) => {
|
||||
return `/api/v1/agents/${agentId}/delete/confirm`;
|
||||
};
|
||||
|
||||
export const confirmDeleteAgentApiV1AgentsAgentIdDeleteConfirmPost = async (
|
||||
agentId: string,
|
||||
agentDeleteConfirm: AgentDeleteConfirm,
|
||||
options?: RequestInit,
|
||||
): Promise<confirmDeleteAgentApiV1AgentsAgentIdDeleteConfirmPostResponse> => {
|
||||
return customFetch<confirmDeleteAgentApiV1AgentsAgentIdDeleteConfirmPostResponse>(
|
||||
getConfirmDeleteAgentApiV1AgentsAgentIdDeleteConfirmPostUrl(agentId),
|
||||
{
|
||||
...options,
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json", ...options?.headers },
|
||||
body: JSON.stringify(agentDeleteConfirm),
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
export const getConfirmDeleteAgentApiV1AgentsAgentIdDeleteConfirmPostMutationOptions =
|
||||
<TError = HTTPValidationError, TContext = unknown>(options?: {
|
||||
mutation?: UseMutationOptions<
|
||||
Awaited<
|
||||
ReturnType<typeof confirmDeleteAgentApiV1AgentsAgentIdDeleteConfirmPost>
|
||||
>,
|
||||
TError,
|
||||
{ agentId: string; data: AgentDeleteConfirm },
|
||||
TContext
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
}): UseMutationOptions<
|
||||
Awaited<
|
||||
ReturnType<typeof confirmDeleteAgentApiV1AgentsAgentIdDeleteConfirmPost>
|
||||
>,
|
||||
TError,
|
||||
{ agentId: string; data: AgentDeleteConfirm },
|
||||
TContext
|
||||
> => {
|
||||
const mutationKey = [
|
||||
"confirmDeleteAgentApiV1AgentsAgentIdDeleteConfirmPost",
|
||||
];
|
||||
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 confirmDeleteAgentApiV1AgentsAgentIdDeleteConfirmPost>
|
||||
>,
|
||||
{ agentId: string; data: AgentDeleteConfirm }
|
||||
> = (props) => {
|
||||
const { agentId, data } = props ?? {};
|
||||
|
||||
return confirmDeleteAgentApiV1AgentsAgentIdDeleteConfirmPost(
|
||||
agentId,
|
||||
data,
|
||||
requestOptions,
|
||||
);
|
||||
};
|
||||
|
||||
return { mutationFn, ...mutationOptions };
|
||||
};
|
||||
|
||||
export type ConfirmDeleteAgentApiV1AgentsAgentIdDeleteConfirmPostMutationResult =
|
||||
NonNullable<
|
||||
Awaited<
|
||||
ReturnType<typeof confirmDeleteAgentApiV1AgentsAgentIdDeleteConfirmPost>
|
||||
>
|
||||
>;
|
||||
export type ConfirmDeleteAgentApiV1AgentsAgentIdDeleteConfirmPostMutationBody =
|
||||
AgentDeleteConfirm;
|
||||
export type ConfirmDeleteAgentApiV1AgentsAgentIdDeleteConfirmPostMutationError =
|
||||
HTTPValidationError;
|
||||
|
||||
/**
|
||||
* @summary Confirm Delete Agent
|
||||
*/
|
||||
export const useConfirmDeleteAgentApiV1AgentsAgentIdDeleteConfirmPost = <
|
||||
TError = HTTPValidationError,
|
||||
TContext = unknown,
|
||||
>(
|
||||
options?: {
|
||||
mutation?: UseMutationOptions<
|
||||
Awaited<
|
||||
ReturnType<typeof confirmDeleteAgentApiV1AgentsAgentIdDeleteConfirmPost>
|
||||
>,
|
||||
TError,
|
||||
{ agentId: string; data: AgentDeleteConfirm },
|
||||
TContext
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseMutationResult<
|
||||
Awaited<
|
||||
ReturnType<typeof confirmDeleteAgentApiV1AgentsAgentIdDeleteConfirmPost>
|
||||
>,
|
||||
TError,
|
||||
{ agentId: string; data: AgentDeleteConfirm },
|
||||
TContext
|
||||
> => {
|
||||
return useMutation(
|
||||
getConfirmDeleteAgentApiV1AgentsAgentIdDeleteConfirmPostMutationOptions(
|
||||
options,
|
||||
),
|
||||
queryClient,
|
||||
);
|
||||
};
|
||||
|
||||
855
frontend/src/api/generated/approvals/approvals.ts
Normal file
855
frontend/src/api/generated/approvals/approvals.ts
Normal file
@@ -0,0 +1,855 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.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 {
|
||||
ApprovalCreate,
|
||||
ApprovalRead,
|
||||
ApprovalUpdate,
|
||||
HTTPValidationError,
|
||||
ListApprovalsApiV1BoardsBoardIdApprovalsGetParams,
|
||||
StreamApprovalsApiV1BoardsBoardIdApprovalsStreamGetParams,
|
||||
} from ".././model";
|
||||
|
||||
import { customFetch } from "../../mutator";
|
||||
|
||||
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
||||
|
||||
/**
|
||||
* @summary List Approvals
|
||||
*/
|
||||
export type listApprovalsApiV1BoardsBoardIdApprovalsGetResponse200 = {
|
||||
data: ApprovalRead[];
|
||||
status: 200;
|
||||
};
|
||||
|
||||
export type listApprovalsApiV1BoardsBoardIdApprovalsGetResponse422 = {
|
||||
data: HTTPValidationError;
|
||||
status: 422;
|
||||
};
|
||||
|
||||
export type listApprovalsApiV1BoardsBoardIdApprovalsGetResponseSuccess =
|
||||
listApprovalsApiV1BoardsBoardIdApprovalsGetResponse200 & {
|
||||
headers: Headers;
|
||||
};
|
||||
export type listApprovalsApiV1BoardsBoardIdApprovalsGetResponseError =
|
||||
listApprovalsApiV1BoardsBoardIdApprovalsGetResponse422 & {
|
||||
headers: Headers;
|
||||
};
|
||||
|
||||
export type listApprovalsApiV1BoardsBoardIdApprovalsGetResponse =
|
||||
| listApprovalsApiV1BoardsBoardIdApprovalsGetResponseSuccess
|
||||
| listApprovalsApiV1BoardsBoardIdApprovalsGetResponseError;
|
||||
|
||||
export const getListApprovalsApiV1BoardsBoardIdApprovalsGetUrl = (
|
||||
boardId: string,
|
||||
params?: ListApprovalsApiV1BoardsBoardIdApprovalsGetParams,
|
||||
) => {
|
||||
const normalizedParams = new URLSearchParams();
|
||||
|
||||
Object.entries(params || {}).forEach(([key, value]) => {
|
||||
if (value !== undefined) {
|
||||
normalizedParams.append(key, value === null ? "null" : value.toString());
|
||||
}
|
||||
});
|
||||
|
||||
const stringifiedParams = normalizedParams.toString();
|
||||
|
||||
return stringifiedParams.length > 0
|
||||
? `/api/v1/boards/${boardId}/approvals?${stringifiedParams}`
|
||||
: `/api/v1/boards/${boardId}/approvals`;
|
||||
};
|
||||
|
||||
export const listApprovalsApiV1BoardsBoardIdApprovalsGet = async (
|
||||
boardId: string,
|
||||
params?: ListApprovalsApiV1BoardsBoardIdApprovalsGetParams,
|
||||
options?: RequestInit,
|
||||
): Promise<listApprovalsApiV1BoardsBoardIdApprovalsGetResponse> => {
|
||||
return customFetch<listApprovalsApiV1BoardsBoardIdApprovalsGetResponse>(
|
||||
getListApprovalsApiV1BoardsBoardIdApprovalsGetUrl(boardId, params),
|
||||
{
|
||||
...options,
|
||||
method: "GET",
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
export const getListApprovalsApiV1BoardsBoardIdApprovalsGetQueryKey = (
|
||||
boardId: string,
|
||||
params?: ListApprovalsApiV1BoardsBoardIdApprovalsGetParams,
|
||||
) => {
|
||||
return [
|
||||
`/api/v1/boards/${boardId}/approvals`,
|
||||
...(params ? [params] : []),
|
||||
] as const;
|
||||
};
|
||||
|
||||
export const getListApprovalsApiV1BoardsBoardIdApprovalsGetQueryOptions = <
|
||||
TData = Awaited<
|
||||
ReturnType<typeof listApprovalsApiV1BoardsBoardIdApprovalsGet>
|
||||
>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
boardId: string,
|
||||
params?: ListApprovalsApiV1BoardsBoardIdApprovalsGetParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof listApprovalsApiV1BoardsBoardIdApprovalsGet>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
) => {
|
||||
const { query: queryOptions, request: requestOptions } = options ?? {};
|
||||
|
||||
const queryKey =
|
||||
queryOptions?.queryKey ??
|
||||
getListApprovalsApiV1BoardsBoardIdApprovalsGetQueryKey(boardId, params);
|
||||
|
||||
const queryFn: QueryFunction<
|
||||
Awaited<ReturnType<typeof listApprovalsApiV1BoardsBoardIdApprovalsGet>>
|
||||
> = ({ signal }) =>
|
||||
listApprovalsApiV1BoardsBoardIdApprovalsGet(boardId, params, {
|
||||
signal,
|
||||
...requestOptions,
|
||||
});
|
||||
|
||||
return {
|
||||
queryKey,
|
||||
queryFn,
|
||||
enabled: !!boardId,
|
||||
...queryOptions,
|
||||
} as UseQueryOptions<
|
||||
Awaited<ReturnType<typeof listApprovalsApiV1BoardsBoardIdApprovalsGet>>,
|
||||
TError,
|
||||
TData
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
};
|
||||
|
||||
export type ListApprovalsApiV1BoardsBoardIdApprovalsGetQueryResult =
|
||||
NonNullable<
|
||||
Awaited<ReturnType<typeof listApprovalsApiV1BoardsBoardIdApprovalsGet>>
|
||||
>;
|
||||
export type ListApprovalsApiV1BoardsBoardIdApprovalsGetQueryError =
|
||||
HTTPValidationError;
|
||||
|
||||
export function useListApprovalsApiV1BoardsBoardIdApprovalsGet<
|
||||
TData = Awaited<
|
||||
ReturnType<typeof listApprovalsApiV1BoardsBoardIdApprovalsGet>
|
||||
>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
boardId: string,
|
||||
params: undefined | ListApprovalsApiV1BoardsBoardIdApprovalsGetParams,
|
||||
options: {
|
||||
query: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof listApprovalsApiV1BoardsBoardIdApprovalsGet>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
> &
|
||||
Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<
|
||||
ReturnType<typeof listApprovalsApiV1BoardsBoardIdApprovalsGet>
|
||||
>,
|
||||
TError,
|
||||
Awaited<
|
||||
ReturnType<typeof listApprovalsApiV1BoardsBoardIdApprovalsGet>
|
||||
>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): DefinedUseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useListApprovalsApiV1BoardsBoardIdApprovalsGet<
|
||||
TData = Awaited<
|
||||
ReturnType<typeof listApprovalsApiV1BoardsBoardIdApprovalsGet>
|
||||
>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
boardId: string,
|
||||
params?: ListApprovalsApiV1BoardsBoardIdApprovalsGetParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof listApprovalsApiV1BoardsBoardIdApprovalsGet>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
> &
|
||||
Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<
|
||||
ReturnType<typeof listApprovalsApiV1BoardsBoardIdApprovalsGet>
|
||||
>,
|
||||
TError,
|
||||
Awaited<
|
||||
ReturnType<typeof listApprovalsApiV1BoardsBoardIdApprovalsGet>
|
||||
>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useListApprovalsApiV1BoardsBoardIdApprovalsGet<
|
||||
TData = Awaited<
|
||||
ReturnType<typeof listApprovalsApiV1BoardsBoardIdApprovalsGet>
|
||||
>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
boardId: string,
|
||||
params?: ListApprovalsApiV1BoardsBoardIdApprovalsGetParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof listApprovalsApiV1BoardsBoardIdApprovalsGet>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
/**
|
||||
* @summary List Approvals
|
||||
*/
|
||||
|
||||
export function useListApprovalsApiV1BoardsBoardIdApprovalsGet<
|
||||
TData = Awaited<
|
||||
ReturnType<typeof listApprovalsApiV1BoardsBoardIdApprovalsGet>
|
||||
>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
boardId: string,
|
||||
params?: ListApprovalsApiV1BoardsBoardIdApprovalsGetParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof listApprovalsApiV1BoardsBoardIdApprovalsGet>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
} {
|
||||
const queryOptions =
|
||||
getListApprovalsApiV1BoardsBoardIdApprovalsGetQueryOptions(
|
||||
boardId,
|
||||
params,
|
||||
options,
|
||||
);
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
|
||||
TData,
|
||||
TError
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
return { ...query, queryKey: queryOptions.queryKey };
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Create Approval
|
||||
*/
|
||||
export type createApprovalApiV1BoardsBoardIdApprovalsPostResponse200 = {
|
||||
data: ApprovalRead;
|
||||
status: 200;
|
||||
};
|
||||
|
||||
export type createApprovalApiV1BoardsBoardIdApprovalsPostResponse422 = {
|
||||
data: HTTPValidationError;
|
||||
status: 422;
|
||||
};
|
||||
|
||||
export type createApprovalApiV1BoardsBoardIdApprovalsPostResponseSuccess =
|
||||
createApprovalApiV1BoardsBoardIdApprovalsPostResponse200 & {
|
||||
headers: Headers;
|
||||
};
|
||||
export type createApprovalApiV1BoardsBoardIdApprovalsPostResponseError =
|
||||
createApprovalApiV1BoardsBoardIdApprovalsPostResponse422 & {
|
||||
headers: Headers;
|
||||
};
|
||||
|
||||
export type createApprovalApiV1BoardsBoardIdApprovalsPostResponse =
|
||||
| createApprovalApiV1BoardsBoardIdApprovalsPostResponseSuccess
|
||||
| createApprovalApiV1BoardsBoardIdApprovalsPostResponseError;
|
||||
|
||||
export const getCreateApprovalApiV1BoardsBoardIdApprovalsPostUrl = (
|
||||
boardId: string,
|
||||
) => {
|
||||
return `/api/v1/boards/${boardId}/approvals`;
|
||||
};
|
||||
|
||||
export const createApprovalApiV1BoardsBoardIdApprovalsPost = async (
|
||||
boardId: string,
|
||||
approvalCreate: ApprovalCreate,
|
||||
options?: RequestInit,
|
||||
): Promise<createApprovalApiV1BoardsBoardIdApprovalsPostResponse> => {
|
||||
return customFetch<createApprovalApiV1BoardsBoardIdApprovalsPostResponse>(
|
||||
getCreateApprovalApiV1BoardsBoardIdApprovalsPostUrl(boardId),
|
||||
{
|
||||
...options,
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json", ...options?.headers },
|
||||
body: JSON.stringify(approvalCreate),
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
export const getCreateApprovalApiV1BoardsBoardIdApprovalsPostMutationOptions = <
|
||||
TError = HTTPValidationError,
|
||||
TContext = unknown,
|
||||
>(options?: {
|
||||
mutation?: UseMutationOptions<
|
||||
Awaited<ReturnType<typeof createApprovalApiV1BoardsBoardIdApprovalsPost>>,
|
||||
TError,
|
||||
{ boardId: string; data: ApprovalCreate },
|
||||
TContext
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
}): UseMutationOptions<
|
||||
Awaited<ReturnType<typeof createApprovalApiV1BoardsBoardIdApprovalsPost>>,
|
||||
TError,
|
||||
{ boardId: string; data: ApprovalCreate },
|
||||
TContext
|
||||
> => {
|
||||
const mutationKey = ["createApprovalApiV1BoardsBoardIdApprovalsPost"];
|
||||
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 createApprovalApiV1BoardsBoardIdApprovalsPost>>,
|
||||
{ boardId: string; data: ApprovalCreate }
|
||||
> = (props) => {
|
||||
const { boardId, data } = props ?? {};
|
||||
|
||||
return createApprovalApiV1BoardsBoardIdApprovalsPost(
|
||||
boardId,
|
||||
data,
|
||||
requestOptions,
|
||||
);
|
||||
};
|
||||
|
||||
return { mutationFn, ...mutationOptions };
|
||||
};
|
||||
|
||||
export type CreateApprovalApiV1BoardsBoardIdApprovalsPostMutationResult =
|
||||
NonNullable<
|
||||
Awaited<ReturnType<typeof createApprovalApiV1BoardsBoardIdApprovalsPost>>
|
||||
>;
|
||||
export type CreateApprovalApiV1BoardsBoardIdApprovalsPostMutationBody =
|
||||
ApprovalCreate;
|
||||
export type CreateApprovalApiV1BoardsBoardIdApprovalsPostMutationError =
|
||||
HTTPValidationError;
|
||||
|
||||
/**
|
||||
* @summary Create Approval
|
||||
*/
|
||||
export const useCreateApprovalApiV1BoardsBoardIdApprovalsPost = <
|
||||
TError = HTTPValidationError,
|
||||
TContext = unknown,
|
||||
>(
|
||||
options?: {
|
||||
mutation?: UseMutationOptions<
|
||||
Awaited<ReturnType<typeof createApprovalApiV1BoardsBoardIdApprovalsPost>>,
|
||||
TError,
|
||||
{ boardId: string; data: ApprovalCreate },
|
||||
TContext
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseMutationResult<
|
||||
Awaited<ReturnType<typeof createApprovalApiV1BoardsBoardIdApprovalsPost>>,
|
||||
TError,
|
||||
{ boardId: string; data: ApprovalCreate },
|
||||
TContext
|
||||
> => {
|
||||
return useMutation(
|
||||
getCreateApprovalApiV1BoardsBoardIdApprovalsPostMutationOptions(options),
|
||||
queryClient,
|
||||
);
|
||||
};
|
||||
/**
|
||||
* @summary Stream Approvals
|
||||
*/
|
||||
export type streamApprovalsApiV1BoardsBoardIdApprovalsStreamGetResponse200 = {
|
||||
data: unknown;
|
||||
status: 200;
|
||||
};
|
||||
|
||||
export type streamApprovalsApiV1BoardsBoardIdApprovalsStreamGetResponse422 = {
|
||||
data: HTTPValidationError;
|
||||
status: 422;
|
||||
};
|
||||
|
||||
export type streamApprovalsApiV1BoardsBoardIdApprovalsStreamGetResponseSuccess =
|
||||
streamApprovalsApiV1BoardsBoardIdApprovalsStreamGetResponse200 & {
|
||||
headers: Headers;
|
||||
};
|
||||
export type streamApprovalsApiV1BoardsBoardIdApprovalsStreamGetResponseError =
|
||||
streamApprovalsApiV1BoardsBoardIdApprovalsStreamGetResponse422 & {
|
||||
headers: Headers;
|
||||
};
|
||||
|
||||
export type streamApprovalsApiV1BoardsBoardIdApprovalsStreamGetResponse =
|
||||
| streamApprovalsApiV1BoardsBoardIdApprovalsStreamGetResponseSuccess
|
||||
| streamApprovalsApiV1BoardsBoardIdApprovalsStreamGetResponseError;
|
||||
|
||||
export const getStreamApprovalsApiV1BoardsBoardIdApprovalsStreamGetUrl = (
|
||||
boardId: string,
|
||||
params?: StreamApprovalsApiV1BoardsBoardIdApprovalsStreamGetParams,
|
||||
) => {
|
||||
const normalizedParams = new URLSearchParams();
|
||||
|
||||
Object.entries(params || {}).forEach(([key, value]) => {
|
||||
if (value !== undefined) {
|
||||
normalizedParams.append(key, value === null ? "null" : value.toString());
|
||||
}
|
||||
});
|
||||
|
||||
const stringifiedParams = normalizedParams.toString();
|
||||
|
||||
return stringifiedParams.length > 0
|
||||
? `/api/v1/boards/${boardId}/approvals/stream?${stringifiedParams}`
|
||||
: `/api/v1/boards/${boardId}/approvals/stream`;
|
||||
};
|
||||
|
||||
export const streamApprovalsApiV1BoardsBoardIdApprovalsStreamGet = async (
|
||||
boardId: string,
|
||||
params?: StreamApprovalsApiV1BoardsBoardIdApprovalsStreamGetParams,
|
||||
options?: RequestInit,
|
||||
): Promise<streamApprovalsApiV1BoardsBoardIdApprovalsStreamGetResponse> => {
|
||||
return customFetch<streamApprovalsApiV1BoardsBoardIdApprovalsStreamGetResponse>(
|
||||
getStreamApprovalsApiV1BoardsBoardIdApprovalsStreamGetUrl(boardId, params),
|
||||
{
|
||||
...options,
|
||||
method: "GET",
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
export const getStreamApprovalsApiV1BoardsBoardIdApprovalsStreamGetQueryKey = (
|
||||
boardId: string,
|
||||
params?: StreamApprovalsApiV1BoardsBoardIdApprovalsStreamGetParams,
|
||||
) => {
|
||||
return [
|
||||
`/api/v1/boards/${boardId}/approvals/stream`,
|
||||
...(params ? [params] : []),
|
||||
] as const;
|
||||
};
|
||||
|
||||
export const getStreamApprovalsApiV1BoardsBoardIdApprovalsStreamGetQueryOptions =
|
||||
<
|
||||
TData = Awaited<
|
||||
ReturnType<typeof streamApprovalsApiV1BoardsBoardIdApprovalsStreamGet>
|
||||
>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
boardId: string,
|
||||
params?: StreamApprovalsApiV1BoardsBoardIdApprovalsStreamGetParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<
|
||||
ReturnType<
|
||||
typeof streamApprovalsApiV1BoardsBoardIdApprovalsStreamGet
|
||||
>
|
||||
>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
) => {
|
||||
const { query: queryOptions, request: requestOptions } = options ?? {};
|
||||
|
||||
const queryKey =
|
||||
queryOptions?.queryKey ??
|
||||
getStreamApprovalsApiV1BoardsBoardIdApprovalsStreamGetQueryKey(
|
||||
boardId,
|
||||
params,
|
||||
);
|
||||
|
||||
const queryFn: QueryFunction<
|
||||
Awaited<
|
||||
ReturnType<typeof streamApprovalsApiV1BoardsBoardIdApprovalsStreamGet>
|
||||
>
|
||||
> = ({ signal }) =>
|
||||
streamApprovalsApiV1BoardsBoardIdApprovalsStreamGet(boardId, params, {
|
||||
signal,
|
||||
...requestOptions,
|
||||
});
|
||||
|
||||
return {
|
||||
queryKey,
|
||||
queryFn,
|
||||
enabled: !!boardId,
|
||||
...queryOptions,
|
||||
} as UseQueryOptions<
|
||||
Awaited<
|
||||
ReturnType<typeof streamApprovalsApiV1BoardsBoardIdApprovalsStreamGet>
|
||||
>,
|
||||
TError,
|
||||
TData
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
};
|
||||
|
||||
export type StreamApprovalsApiV1BoardsBoardIdApprovalsStreamGetQueryResult =
|
||||
NonNullable<
|
||||
Awaited<
|
||||
ReturnType<typeof streamApprovalsApiV1BoardsBoardIdApprovalsStreamGet>
|
||||
>
|
||||
>;
|
||||
export type StreamApprovalsApiV1BoardsBoardIdApprovalsStreamGetQueryError =
|
||||
HTTPValidationError;
|
||||
|
||||
export function useStreamApprovalsApiV1BoardsBoardIdApprovalsStreamGet<
|
||||
TData = Awaited<
|
||||
ReturnType<typeof streamApprovalsApiV1BoardsBoardIdApprovalsStreamGet>
|
||||
>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
boardId: string,
|
||||
params: undefined | StreamApprovalsApiV1BoardsBoardIdApprovalsStreamGetParams,
|
||||
options: {
|
||||
query: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<
|
||||
ReturnType<typeof streamApprovalsApiV1BoardsBoardIdApprovalsStreamGet>
|
||||
>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
> &
|
||||
Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<
|
||||
ReturnType<
|
||||
typeof streamApprovalsApiV1BoardsBoardIdApprovalsStreamGet
|
||||
>
|
||||
>,
|
||||
TError,
|
||||
Awaited<
|
||||
ReturnType<
|
||||
typeof streamApprovalsApiV1BoardsBoardIdApprovalsStreamGet
|
||||
>
|
||||
>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): DefinedUseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useStreamApprovalsApiV1BoardsBoardIdApprovalsStreamGet<
|
||||
TData = Awaited<
|
||||
ReturnType<typeof streamApprovalsApiV1BoardsBoardIdApprovalsStreamGet>
|
||||
>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
boardId: string,
|
||||
params?: StreamApprovalsApiV1BoardsBoardIdApprovalsStreamGetParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<
|
||||
ReturnType<typeof streamApprovalsApiV1BoardsBoardIdApprovalsStreamGet>
|
||||
>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
> &
|
||||
Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<
|
||||
ReturnType<
|
||||
typeof streamApprovalsApiV1BoardsBoardIdApprovalsStreamGet
|
||||
>
|
||||
>,
|
||||
TError,
|
||||
Awaited<
|
||||
ReturnType<
|
||||
typeof streamApprovalsApiV1BoardsBoardIdApprovalsStreamGet
|
||||
>
|
||||
>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useStreamApprovalsApiV1BoardsBoardIdApprovalsStreamGet<
|
||||
TData = Awaited<
|
||||
ReturnType<typeof streamApprovalsApiV1BoardsBoardIdApprovalsStreamGet>
|
||||
>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
boardId: string,
|
||||
params?: StreamApprovalsApiV1BoardsBoardIdApprovalsStreamGetParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<
|
||||
ReturnType<typeof streamApprovalsApiV1BoardsBoardIdApprovalsStreamGet>
|
||||
>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
/**
|
||||
* @summary Stream Approvals
|
||||
*/
|
||||
|
||||
export function useStreamApprovalsApiV1BoardsBoardIdApprovalsStreamGet<
|
||||
TData = Awaited<
|
||||
ReturnType<typeof streamApprovalsApiV1BoardsBoardIdApprovalsStreamGet>
|
||||
>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
boardId: string,
|
||||
params?: StreamApprovalsApiV1BoardsBoardIdApprovalsStreamGetParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<
|
||||
ReturnType<typeof streamApprovalsApiV1BoardsBoardIdApprovalsStreamGet>
|
||||
>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
} {
|
||||
const queryOptions =
|
||||
getStreamApprovalsApiV1BoardsBoardIdApprovalsStreamGetQueryOptions(
|
||||
boardId,
|
||||
params,
|
||||
options,
|
||||
);
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
|
||||
TData,
|
||||
TError
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
return { ...query, queryKey: queryOptions.queryKey };
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Update Approval
|
||||
*/
|
||||
export type updateApprovalApiV1BoardsBoardIdApprovalsApprovalIdPatchResponse200 =
|
||||
{
|
||||
data: ApprovalRead;
|
||||
status: 200;
|
||||
};
|
||||
|
||||
export type updateApprovalApiV1BoardsBoardIdApprovalsApprovalIdPatchResponse422 =
|
||||
{
|
||||
data: HTTPValidationError;
|
||||
status: 422;
|
||||
};
|
||||
|
||||
export type updateApprovalApiV1BoardsBoardIdApprovalsApprovalIdPatchResponseSuccess =
|
||||
updateApprovalApiV1BoardsBoardIdApprovalsApprovalIdPatchResponse200 & {
|
||||
headers: Headers;
|
||||
};
|
||||
export type updateApprovalApiV1BoardsBoardIdApprovalsApprovalIdPatchResponseError =
|
||||
updateApprovalApiV1BoardsBoardIdApprovalsApprovalIdPatchResponse422 & {
|
||||
headers: Headers;
|
||||
};
|
||||
|
||||
export type updateApprovalApiV1BoardsBoardIdApprovalsApprovalIdPatchResponse =
|
||||
| updateApprovalApiV1BoardsBoardIdApprovalsApprovalIdPatchResponseSuccess
|
||||
| updateApprovalApiV1BoardsBoardIdApprovalsApprovalIdPatchResponseError;
|
||||
|
||||
export const getUpdateApprovalApiV1BoardsBoardIdApprovalsApprovalIdPatchUrl = (
|
||||
boardId: string,
|
||||
approvalId: string,
|
||||
) => {
|
||||
return `/api/v1/boards/${boardId}/approvals/${approvalId}`;
|
||||
};
|
||||
|
||||
export const updateApprovalApiV1BoardsBoardIdApprovalsApprovalIdPatch = async (
|
||||
boardId: string,
|
||||
approvalId: string,
|
||||
approvalUpdate: ApprovalUpdate,
|
||||
options?: RequestInit,
|
||||
): Promise<updateApprovalApiV1BoardsBoardIdApprovalsApprovalIdPatchResponse> => {
|
||||
return customFetch<updateApprovalApiV1BoardsBoardIdApprovalsApprovalIdPatchResponse>(
|
||||
getUpdateApprovalApiV1BoardsBoardIdApprovalsApprovalIdPatchUrl(
|
||||
boardId,
|
||||
approvalId,
|
||||
),
|
||||
{
|
||||
...options,
|
||||
method: "PATCH",
|
||||
headers: { "Content-Type": "application/json", ...options?.headers },
|
||||
body: JSON.stringify(approvalUpdate),
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
export const getUpdateApprovalApiV1BoardsBoardIdApprovalsApprovalIdPatchMutationOptions =
|
||||
<TError = HTTPValidationError, TContext = unknown>(options?: {
|
||||
mutation?: UseMutationOptions<
|
||||
Awaited<
|
||||
ReturnType<
|
||||
typeof updateApprovalApiV1BoardsBoardIdApprovalsApprovalIdPatch
|
||||
>
|
||||
>,
|
||||
TError,
|
||||
{ boardId: string; approvalId: string; data: ApprovalUpdate },
|
||||
TContext
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
}): UseMutationOptions<
|
||||
Awaited<
|
||||
ReturnType<
|
||||
typeof updateApprovalApiV1BoardsBoardIdApprovalsApprovalIdPatch
|
||||
>
|
||||
>,
|
||||
TError,
|
||||
{ boardId: string; approvalId: string; data: ApprovalUpdate },
|
||||
TContext
|
||||
> => {
|
||||
const mutationKey = [
|
||||
"updateApprovalApiV1BoardsBoardIdApprovalsApprovalIdPatch",
|
||||
];
|
||||
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 updateApprovalApiV1BoardsBoardIdApprovalsApprovalIdPatch
|
||||
>
|
||||
>,
|
||||
{ boardId: string; approvalId: string; data: ApprovalUpdate }
|
||||
> = (props) => {
|
||||
const { boardId, approvalId, data } = props ?? {};
|
||||
|
||||
return updateApprovalApiV1BoardsBoardIdApprovalsApprovalIdPatch(
|
||||
boardId,
|
||||
approvalId,
|
||||
data,
|
||||
requestOptions,
|
||||
);
|
||||
};
|
||||
|
||||
return { mutationFn, ...mutationOptions };
|
||||
};
|
||||
|
||||
export type UpdateApprovalApiV1BoardsBoardIdApprovalsApprovalIdPatchMutationResult =
|
||||
NonNullable<
|
||||
Awaited<
|
||||
ReturnType<
|
||||
typeof updateApprovalApiV1BoardsBoardIdApprovalsApprovalIdPatch
|
||||
>
|
||||
>
|
||||
>;
|
||||
export type UpdateApprovalApiV1BoardsBoardIdApprovalsApprovalIdPatchMutationBody =
|
||||
ApprovalUpdate;
|
||||
export type UpdateApprovalApiV1BoardsBoardIdApprovalsApprovalIdPatchMutationError =
|
||||
HTTPValidationError;
|
||||
|
||||
/**
|
||||
* @summary Update Approval
|
||||
*/
|
||||
export const useUpdateApprovalApiV1BoardsBoardIdApprovalsApprovalIdPatch = <
|
||||
TError = HTTPValidationError,
|
||||
TContext = unknown,
|
||||
>(
|
||||
options?: {
|
||||
mutation?: UseMutationOptions<
|
||||
Awaited<
|
||||
ReturnType<
|
||||
typeof updateApprovalApiV1BoardsBoardIdApprovalsApprovalIdPatch
|
||||
>
|
||||
>,
|
||||
TError,
|
||||
{ boardId: string; approvalId: string; data: ApprovalUpdate },
|
||||
TContext
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseMutationResult<
|
||||
Awaited<
|
||||
ReturnType<typeof updateApprovalApiV1BoardsBoardIdApprovalsApprovalIdPatch>
|
||||
>,
|
||||
TError,
|
||||
{ boardId: string; approvalId: string; data: ApprovalUpdate },
|
||||
TContext
|
||||
> => {
|
||||
return useMutation(
|
||||
getUpdateApprovalApiV1BoardsBoardIdApprovalsApprovalIdPatchMutationOptions(
|
||||
options,
|
||||
),
|
||||
queryClient,
|
||||
);
|
||||
};
|
||||
689
frontend/src/api/generated/board-memory/board-memory.ts
Normal file
689
frontend/src/api/generated/board-memory/board-memory.ts
Normal file
@@ -0,0 +1,689 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.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 {
|
||||
BoardMemoryCreate,
|
||||
BoardMemoryRead,
|
||||
HTTPValidationError,
|
||||
ListBoardMemoryApiV1BoardsBoardIdMemoryGetParams,
|
||||
StreamBoardMemoryApiV1BoardsBoardIdMemoryStreamGetParams,
|
||||
} from ".././model";
|
||||
|
||||
import { customFetch } from "../../mutator";
|
||||
|
||||
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
||||
|
||||
/**
|
||||
* @summary List Board Memory
|
||||
*/
|
||||
export type listBoardMemoryApiV1BoardsBoardIdMemoryGetResponse200 = {
|
||||
data: BoardMemoryRead[];
|
||||
status: 200;
|
||||
};
|
||||
|
||||
export type listBoardMemoryApiV1BoardsBoardIdMemoryGetResponse422 = {
|
||||
data: HTTPValidationError;
|
||||
status: 422;
|
||||
};
|
||||
|
||||
export type listBoardMemoryApiV1BoardsBoardIdMemoryGetResponseSuccess =
|
||||
listBoardMemoryApiV1BoardsBoardIdMemoryGetResponse200 & {
|
||||
headers: Headers;
|
||||
};
|
||||
export type listBoardMemoryApiV1BoardsBoardIdMemoryGetResponseError =
|
||||
listBoardMemoryApiV1BoardsBoardIdMemoryGetResponse422 & {
|
||||
headers: Headers;
|
||||
};
|
||||
|
||||
export type listBoardMemoryApiV1BoardsBoardIdMemoryGetResponse =
|
||||
| listBoardMemoryApiV1BoardsBoardIdMemoryGetResponseSuccess
|
||||
| listBoardMemoryApiV1BoardsBoardIdMemoryGetResponseError;
|
||||
|
||||
export const getListBoardMemoryApiV1BoardsBoardIdMemoryGetUrl = (
|
||||
boardId: string,
|
||||
params?: ListBoardMemoryApiV1BoardsBoardIdMemoryGetParams,
|
||||
) => {
|
||||
const normalizedParams = new URLSearchParams();
|
||||
|
||||
Object.entries(params || {}).forEach(([key, value]) => {
|
||||
if (value !== undefined) {
|
||||
normalizedParams.append(key, value === null ? "null" : value.toString());
|
||||
}
|
||||
});
|
||||
|
||||
const stringifiedParams = normalizedParams.toString();
|
||||
|
||||
return stringifiedParams.length > 0
|
||||
? `/api/v1/boards/${boardId}/memory?${stringifiedParams}`
|
||||
: `/api/v1/boards/${boardId}/memory`;
|
||||
};
|
||||
|
||||
export const listBoardMemoryApiV1BoardsBoardIdMemoryGet = async (
|
||||
boardId: string,
|
||||
params?: ListBoardMemoryApiV1BoardsBoardIdMemoryGetParams,
|
||||
options?: RequestInit,
|
||||
): Promise<listBoardMemoryApiV1BoardsBoardIdMemoryGetResponse> => {
|
||||
return customFetch<listBoardMemoryApiV1BoardsBoardIdMemoryGetResponse>(
|
||||
getListBoardMemoryApiV1BoardsBoardIdMemoryGetUrl(boardId, params),
|
||||
{
|
||||
...options,
|
||||
method: "GET",
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
export const getListBoardMemoryApiV1BoardsBoardIdMemoryGetQueryKey = (
|
||||
boardId: string,
|
||||
params?: ListBoardMemoryApiV1BoardsBoardIdMemoryGetParams,
|
||||
) => {
|
||||
return [
|
||||
`/api/v1/boards/${boardId}/memory`,
|
||||
...(params ? [params] : []),
|
||||
] as const;
|
||||
};
|
||||
|
||||
export const getListBoardMemoryApiV1BoardsBoardIdMemoryGetQueryOptions = <
|
||||
TData = Awaited<
|
||||
ReturnType<typeof listBoardMemoryApiV1BoardsBoardIdMemoryGet>
|
||||
>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
boardId: string,
|
||||
params?: ListBoardMemoryApiV1BoardsBoardIdMemoryGetParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof listBoardMemoryApiV1BoardsBoardIdMemoryGet>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
) => {
|
||||
const { query: queryOptions, request: requestOptions } = options ?? {};
|
||||
|
||||
const queryKey =
|
||||
queryOptions?.queryKey ??
|
||||
getListBoardMemoryApiV1BoardsBoardIdMemoryGetQueryKey(boardId, params);
|
||||
|
||||
const queryFn: QueryFunction<
|
||||
Awaited<ReturnType<typeof listBoardMemoryApiV1BoardsBoardIdMemoryGet>>
|
||||
> = ({ signal }) =>
|
||||
listBoardMemoryApiV1BoardsBoardIdMemoryGet(boardId, params, {
|
||||
signal,
|
||||
...requestOptions,
|
||||
});
|
||||
|
||||
return {
|
||||
queryKey,
|
||||
queryFn,
|
||||
enabled: !!boardId,
|
||||
...queryOptions,
|
||||
} as UseQueryOptions<
|
||||
Awaited<ReturnType<typeof listBoardMemoryApiV1BoardsBoardIdMemoryGet>>,
|
||||
TError,
|
||||
TData
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
};
|
||||
|
||||
export type ListBoardMemoryApiV1BoardsBoardIdMemoryGetQueryResult = NonNullable<
|
||||
Awaited<ReturnType<typeof listBoardMemoryApiV1BoardsBoardIdMemoryGet>>
|
||||
>;
|
||||
export type ListBoardMemoryApiV1BoardsBoardIdMemoryGetQueryError =
|
||||
HTTPValidationError;
|
||||
|
||||
export function useListBoardMemoryApiV1BoardsBoardIdMemoryGet<
|
||||
TData = Awaited<
|
||||
ReturnType<typeof listBoardMemoryApiV1BoardsBoardIdMemoryGet>
|
||||
>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
boardId: string,
|
||||
params: undefined | ListBoardMemoryApiV1BoardsBoardIdMemoryGetParams,
|
||||
options: {
|
||||
query: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof listBoardMemoryApiV1BoardsBoardIdMemoryGet>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
> &
|
||||
Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<
|
||||
ReturnType<typeof listBoardMemoryApiV1BoardsBoardIdMemoryGet>
|
||||
>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof listBoardMemoryApiV1BoardsBoardIdMemoryGet>>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): DefinedUseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useListBoardMemoryApiV1BoardsBoardIdMemoryGet<
|
||||
TData = Awaited<
|
||||
ReturnType<typeof listBoardMemoryApiV1BoardsBoardIdMemoryGet>
|
||||
>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
boardId: string,
|
||||
params?: ListBoardMemoryApiV1BoardsBoardIdMemoryGetParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof listBoardMemoryApiV1BoardsBoardIdMemoryGet>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
> &
|
||||
Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<
|
||||
ReturnType<typeof listBoardMemoryApiV1BoardsBoardIdMemoryGet>
|
||||
>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof listBoardMemoryApiV1BoardsBoardIdMemoryGet>>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useListBoardMemoryApiV1BoardsBoardIdMemoryGet<
|
||||
TData = Awaited<
|
||||
ReturnType<typeof listBoardMemoryApiV1BoardsBoardIdMemoryGet>
|
||||
>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
boardId: string,
|
||||
params?: ListBoardMemoryApiV1BoardsBoardIdMemoryGetParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof listBoardMemoryApiV1BoardsBoardIdMemoryGet>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
/**
|
||||
* @summary List Board Memory
|
||||
*/
|
||||
|
||||
export function useListBoardMemoryApiV1BoardsBoardIdMemoryGet<
|
||||
TData = Awaited<
|
||||
ReturnType<typeof listBoardMemoryApiV1BoardsBoardIdMemoryGet>
|
||||
>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
boardId: string,
|
||||
params?: ListBoardMemoryApiV1BoardsBoardIdMemoryGetParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof listBoardMemoryApiV1BoardsBoardIdMemoryGet>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
} {
|
||||
const queryOptions =
|
||||
getListBoardMemoryApiV1BoardsBoardIdMemoryGetQueryOptions(
|
||||
boardId,
|
||||
params,
|
||||
options,
|
||||
);
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
|
||||
TData,
|
||||
TError
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
return { ...query, queryKey: queryOptions.queryKey };
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Create Board Memory
|
||||
*/
|
||||
export type createBoardMemoryApiV1BoardsBoardIdMemoryPostResponse200 = {
|
||||
data: BoardMemoryRead;
|
||||
status: 200;
|
||||
};
|
||||
|
||||
export type createBoardMemoryApiV1BoardsBoardIdMemoryPostResponse422 = {
|
||||
data: HTTPValidationError;
|
||||
status: 422;
|
||||
};
|
||||
|
||||
export type createBoardMemoryApiV1BoardsBoardIdMemoryPostResponseSuccess =
|
||||
createBoardMemoryApiV1BoardsBoardIdMemoryPostResponse200 & {
|
||||
headers: Headers;
|
||||
};
|
||||
export type createBoardMemoryApiV1BoardsBoardIdMemoryPostResponseError =
|
||||
createBoardMemoryApiV1BoardsBoardIdMemoryPostResponse422 & {
|
||||
headers: Headers;
|
||||
};
|
||||
|
||||
export type createBoardMemoryApiV1BoardsBoardIdMemoryPostResponse =
|
||||
| createBoardMemoryApiV1BoardsBoardIdMemoryPostResponseSuccess
|
||||
| createBoardMemoryApiV1BoardsBoardIdMemoryPostResponseError;
|
||||
|
||||
export const getCreateBoardMemoryApiV1BoardsBoardIdMemoryPostUrl = (
|
||||
boardId: string,
|
||||
) => {
|
||||
return `/api/v1/boards/${boardId}/memory`;
|
||||
};
|
||||
|
||||
export const createBoardMemoryApiV1BoardsBoardIdMemoryPost = async (
|
||||
boardId: string,
|
||||
boardMemoryCreate: BoardMemoryCreate,
|
||||
options?: RequestInit,
|
||||
): Promise<createBoardMemoryApiV1BoardsBoardIdMemoryPostResponse> => {
|
||||
return customFetch<createBoardMemoryApiV1BoardsBoardIdMemoryPostResponse>(
|
||||
getCreateBoardMemoryApiV1BoardsBoardIdMemoryPostUrl(boardId),
|
||||
{
|
||||
...options,
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json", ...options?.headers },
|
||||
body: JSON.stringify(boardMemoryCreate),
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
export const getCreateBoardMemoryApiV1BoardsBoardIdMemoryPostMutationOptions = <
|
||||
TError = HTTPValidationError,
|
||||
TContext = unknown,
|
||||
>(options?: {
|
||||
mutation?: UseMutationOptions<
|
||||
Awaited<ReturnType<typeof createBoardMemoryApiV1BoardsBoardIdMemoryPost>>,
|
||||
TError,
|
||||
{ boardId: string; data: BoardMemoryCreate },
|
||||
TContext
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
}): UseMutationOptions<
|
||||
Awaited<ReturnType<typeof createBoardMemoryApiV1BoardsBoardIdMemoryPost>>,
|
||||
TError,
|
||||
{ boardId: string; data: BoardMemoryCreate },
|
||||
TContext
|
||||
> => {
|
||||
const mutationKey = ["createBoardMemoryApiV1BoardsBoardIdMemoryPost"];
|
||||
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 createBoardMemoryApiV1BoardsBoardIdMemoryPost>>,
|
||||
{ boardId: string; data: BoardMemoryCreate }
|
||||
> = (props) => {
|
||||
const { boardId, data } = props ?? {};
|
||||
|
||||
return createBoardMemoryApiV1BoardsBoardIdMemoryPost(
|
||||
boardId,
|
||||
data,
|
||||
requestOptions,
|
||||
);
|
||||
};
|
||||
|
||||
return { mutationFn, ...mutationOptions };
|
||||
};
|
||||
|
||||
export type CreateBoardMemoryApiV1BoardsBoardIdMemoryPostMutationResult =
|
||||
NonNullable<
|
||||
Awaited<ReturnType<typeof createBoardMemoryApiV1BoardsBoardIdMemoryPost>>
|
||||
>;
|
||||
export type CreateBoardMemoryApiV1BoardsBoardIdMemoryPostMutationBody =
|
||||
BoardMemoryCreate;
|
||||
export type CreateBoardMemoryApiV1BoardsBoardIdMemoryPostMutationError =
|
||||
HTTPValidationError;
|
||||
|
||||
/**
|
||||
* @summary Create Board Memory
|
||||
*/
|
||||
export const useCreateBoardMemoryApiV1BoardsBoardIdMemoryPost = <
|
||||
TError = HTTPValidationError,
|
||||
TContext = unknown,
|
||||
>(
|
||||
options?: {
|
||||
mutation?: UseMutationOptions<
|
||||
Awaited<ReturnType<typeof createBoardMemoryApiV1BoardsBoardIdMemoryPost>>,
|
||||
TError,
|
||||
{ boardId: string; data: BoardMemoryCreate },
|
||||
TContext
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseMutationResult<
|
||||
Awaited<ReturnType<typeof createBoardMemoryApiV1BoardsBoardIdMemoryPost>>,
|
||||
TError,
|
||||
{ boardId: string; data: BoardMemoryCreate },
|
||||
TContext
|
||||
> => {
|
||||
return useMutation(
|
||||
getCreateBoardMemoryApiV1BoardsBoardIdMemoryPostMutationOptions(options),
|
||||
queryClient,
|
||||
);
|
||||
};
|
||||
/**
|
||||
* @summary Stream Board Memory
|
||||
*/
|
||||
export type streamBoardMemoryApiV1BoardsBoardIdMemoryStreamGetResponse200 = {
|
||||
data: unknown;
|
||||
status: 200;
|
||||
};
|
||||
|
||||
export type streamBoardMemoryApiV1BoardsBoardIdMemoryStreamGetResponse422 = {
|
||||
data: HTTPValidationError;
|
||||
status: 422;
|
||||
};
|
||||
|
||||
export type streamBoardMemoryApiV1BoardsBoardIdMemoryStreamGetResponseSuccess =
|
||||
streamBoardMemoryApiV1BoardsBoardIdMemoryStreamGetResponse200 & {
|
||||
headers: Headers;
|
||||
};
|
||||
export type streamBoardMemoryApiV1BoardsBoardIdMemoryStreamGetResponseError =
|
||||
streamBoardMemoryApiV1BoardsBoardIdMemoryStreamGetResponse422 & {
|
||||
headers: Headers;
|
||||
};
|
||||
|
||||
export type streamBoardMemoryApiV1BoardsBoardIdMemoryStreamGetResponse =
|
||||
| streamBoardMemoryApiV1BoardsBoardIdMemoryStreamGetResponseSuccess
|
||||
| streamBoardMemoryApiV1BoardsBoardIdMemoryStreamGetResponseError;
|
||||
|
||||
export const getStreamBoardMemoryApiV1BoardsBoardIdMemoryStreamGetUrl = (
|
||||
boardId: string,
|
||||
params?: StreamBoardMemoryApiV1BoardsBoardIdMemoryStreamGetParams,
|
||||
) => {
|
||||
const normalizedParams = new URLSearchParams();
|
||||
|
||||
Object.entries(params || {}).forEach(([key, value]) => {
|
||||
if (value !== undefined) {
|
||||
normalizedParams.append(key, value === null ? "null" : value.toString());
|
||||
}
|
||||
});
|
||||
|
||||
const stringifiedParams = normalizedParams.toString();
|
||||
|
||||
return stringifiedParams.length > 0
|
||||
? `/api/v1/boards/${boardId}/memory/stream?${stringifiedParams}`
|
||||
: `/api/v1/boards/${boardId}/memory/stream`;
|
||||
};
|
||||
|
||||
export const streamBoardMemoryApiV1BoardsBoardIdMemoryStreamGet = async (
|
||||
boardId: string,
|
||||
params?: StreamBoardMemoryApiV1BoardsBoardIdMemoryStreamGetParams,
|
||||
options?: RequestInit,
|
||||
): Promise<streamBoardMemoryApiV1BoardsBoardIdMemoryStreamGetResponse> => {
|
||||
return customFetch<streamBoardMemoryApiV1BoardsBoardIdMemoryStreamGetResponse>(
|
||||
getStreamBoardMemoryApiV1BoardsBoardIdMemoryStreamGetUrl(boardId, params),
|
||||
{
|
||||
...options,
|
||||
method: "GET",
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
export const getStreamBoardMemoryApiV1BoardsBoardIdMemoryStreamGetQueryKey = (
|
||||
boardId: string,
|
||||
params?: StreamBoardMemoryApiV1BoardsBoardIdMemoryStreamGetParams,
|
||||
) => {
|
||||
return [
|
||||
`/api/v1/boards/${boardId}/memory/stream`,
|
||||
...(params ? [params] : []),
|
||||
] as const;
|
||||
};
|
||||
|
||||
export const getStreamBoardMemoryApiV1BoardsBoardIdMemoryStreamGetQueryOptions =
|
||||
<
|
||||
TData = Awaited<
|
||||
ReturnType<typeof streamBoardMemoryApiV1BoardsBoardIdMemoryStreamGet>
|
||||
>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
boardId: string,
|
||||
params?: StreamBoardMemoryApiV1BoardsBoardIdMemoryStreamGetParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<
|
||||
ReturnType<
|
||||
typeof streamBoardMemoryApiV1BoardsBoardIdMemoryStreamGet
|
||||
>
|
||||
>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
) => {
|
||||
const { query: queryOptions, request: requestOptions } = options ?? {};
|
||||
|
||||
const queryKey =
|
||||
queryOptions?.queryKey ??
|
||||
getStreamBoardMemoryApiV1BoardsBoardIdMemoryStreamGetQueryKey(
|
||||
boardId,
|
||||
params,
|
||||
);
|
||||
|
||||
const queryFn: QueryFunction<
|
||||
Awaited<
|
||||
ReturnType<typeof streamBoardMemoryApiV1BoardsBoardIdMemoryStreamGet>
|
||||
>
|
||||
> = ({ signal }) =>
|
||||
streamBoardMemoryApiV1BoardsBoardIdMemoryStreamGet(boardId, params, {
|
||||
signal,
|
||||
...requestOptions,
|
||||
});
|
||||
|
||||
return {
|
||||
queryKey,
|
||||
queryFn,
|
||||
enabled: !!boardId,
|
||||
...queryOptions,
|
||||
} as UseQueryOptions<
|
||||
Awaited<
|
||||
ReturnType<typeof streamBoardMemoryApiV1BoardsBoardIdMemoryStreamGet>
|
||||
>,
|
||||
TError,
|
||||
TData
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
};
|
||||
|
||||
export type StreamBoardMemoryApiV1BoardsBoardIdMemoryStreamGetQueryResult =
|
||||
NonNullable<
|
||||
Awaited<
|
||||
ReturnType<typeof streamBoardMemoryApiV1BoardsBoardIdMemoryStreamGet>
|
||||
>
|
||||
>;
|
||||
export type StreamBoardMemoryApiV1BoardsBoardIdMemoryStreamGetQueryError =
|
||||
HTTPValidationError;
|
||||
|
||||
export function useStreamBoardMemoryApiV1BoardsBoardIdMemoryStreamGet<
|
||||
TData = Awaited<
|
||||
ReturnType<typeof streamBoardMemoryApiV1BoardsBoardIdMemoryStreamGet>
|
||||
>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
boardId: string,
|
||||
params: undefined | StreamBoardMemoryApiV1BoardsBoardIdMemoryStreamGetParams,
|
||||
options: {
|
||||
query: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<
|
||||
ReturnType<typeof streamBoardMemoryApiV1BoardsBoardIdMemoryStreamGet>
|
||||
>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
> &
|
||||
Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<
|
||||
ReturnType<
|
||||
typeof streamBoardMemoryApiV1BoardsBoardIdMemoryStreamGet
|
||||
>
|
||||
>,
|
||||
TError,
|
||||
Awaited<
|
||||
ReturnType<
|
||||
typeof streamBoardMemoryApiV1BoardsBoardIdMemoryStreamGet
|
||||
>
|
||||
>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): DefinedUseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useStreamBoardMemoryApiV1BoardsBoardIdMemoryStreamGet<
|
||||
TData = Awaited<
|
||||
ReturnType<typeof streamBoardMemoryApiV1BoardsBoardIdMemoryStreamGet>
|
||||
>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
boardId: string,
|
||||
params?: StreamBoardMemoryApiV1BoardsBoardIdMemoryStreamGetParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<
|
||||
ReturnType<typeof streamBoardMemoryApiV1BoardsBoardIdMemoryStreamGet>
|
||||
>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
> &
|
||||
Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<
|
||||
ReturnType<
|
||||
typeof streamBoardMemoryApiV1BoardsBoardIdMemoryStreamGet
|
||||
>
|
||||
>,
|
||||
TError,
|
||||
Awaited<
|
||||
ReturnType<
|
||||
typeof streamBoardMemoryApiV1BoardsBoardIdMemoryStreamGet
|
||||
>
|
||||
>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useStreamBoardMemoryApiV1BoardsBoardIdMemoryStreamGet<
|
||||
TData = Awaited<
|
||||
ReturnType<typeof streamBoardMemoryApiV1BoardsBoardIdMemoryStreamGet>
|
||||
>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
boardId: string,
|
||||
params?: StreamBoardMemoryApiV1BoardsBoardIdMemoryStreamGetParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<
|
||||
ReturnType<typeof streamBoardMemoryApiV1BoardsBoardIdMemoryStreamGet>
|
||||
>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
/**
|
||||
* @summary Stream Board Memory
|
||||
*/
|
||||
|
||||
export function useStreamBoardMemoryApiV1BoardsBoardIdMemoryStreamGet<
|
||||
TData = Awaited<
|
||||
ReturnType<typeof streamBoardMemoryApiV1BoardsBoardIdMemoryStreamGet>
|
||||
>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
boardId: string,
|
||||
params?: StreamBoardMemoryApiV1BoardsBoardIdMemoryStreamGetParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<
|
||||
ReturnType<typeof streamBoardMemoryApiV1BoardsBoardIdMemoryStreamGet>
|
||||
>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
} {
|
||||
const queryOptions =
|
||||
getStreamBoardMemoryApiV1BoardsBoardIdMemoryStreamGetQueryOptions(
|
||||
boardId,
|
||||
params,
|
||||
options,
|
||||
);
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
|
||||
TData,
|
||||
TError
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
return { ...query, queryKey: queryOptions.queryKey };
|
||||
}
|
||||
892
frontend/src/api/generated/board-onboarding/board-onboarding.ts
Normal file
892
frontend/src/api/generated/board-onboarding/board-onboarding.ts
Normal file
@@ -0,0 +1,892 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.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 {
|
||||
BoardOnboardingAgentComplete,
|
||||
BoardOnboardingAgentQuestion,
|
||||
BoardOnboardingAnswer,
|
||||
BoardOnboardingConfirm,
|
||||
BoardOnboardingRead,
|
||||
BoardOnboardingStart,
|
||||
BoardRead,
|
||||
HTTPValidationError,
|
||||
} from ".././model";
|
||||
|
||||
import { customFetch } from "../../mutator";
|
||||
|
||||
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
||||
|
||||
/**
|
||||
* @summary Get Onboarding
|
||||
*/
|
||||
export type getOnboardingApiV1BoardsBoardIdOnboardingGetResponse200 = {
|
||||
data: BoardOnboardingRead;
|
||||
status: 200;
|
||||
};
|
||||
|
||||
export type getOnboardingApiV1BoardsBoardIdOnboardingGetResponse422 = {
|
||||
data: HTTPValidationError;
|
||||
status: 422;
|
||||
};
|
||||
|
||||
export type getOnboardingApiV1BoardsBoardIdOnboardingGetResponseSuccess =
|
||||
getOnboardingApiV1BoardsBoardIdOnboardingGetResponse200 & {
|
||||
headers: Headers;
|
||||
};
|
||||
export type getOnboardingApiV1BoardsBoardIdOnboardingGetResponseError =
|
||||
getOnboardingApiV1BoardsBoardIdOnboardingGetResponse422 & {
|
||||
headers: Headers;
|
||||
};
|
||||
|
||||
export type getOnboardingApiV1BoardsBoardIdOnboardingGetResponse =
|
||||
| getOnboardingApiV1BoardsBoardIdOnboardingGetResponseSuccess
|
||||
| getOnboardingApiV1BoardsBoardIdOnboardingGetResponseError;
|
||||
|
||||
export const getGetOnboardingApiV1BoardsBoardIdOnboardingGetUrl = (
|
||||
boardId: string,
|
||||
) => {
|
||||
return `/api/v1/boards/${boardId}/onboarding`;
|
||||
};
|
||||
|
||||
export const getOnboardingApiV1BoardsBoardIdOnboardingGet = async (
|
||||
boardId: string,
|
||||
options?: RequestInit,
|
||||
): Promise<getOnboardingApiV1BoardsBoardIdOnboardingGetResponse> => {
|
||||
return customFetch<getOnboardingApiV1BoardsBoardIdOnboardingGetResponse>(
|
||||
getGetOnboardingApiV1BoardsBoardIdOnboardingGetUrl(boardId),
|
||||
{
|
||||
...options,
|
||||
method: "GET",
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
export const getGetOnboardingApiV1BoardsBoardIdOnboardingGetQueryKey = (
|
||||
boardId: string,
|
||||
) => {
|
||||
return [`/api/v1/boards/${boardId}/onboarding`] as const;
|
||||
};
|
||||
|
||||
export const getGetOnboardingApiV1BoardsBoardIdOnboardingGetQueryOptions = <
|
||||
TData = Awaited<
|
||||
ReturnType<typeof getOnboardingApiV1BoardsBoardIdOnboardingGet>
|
||||
>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
boardId: string,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<
|
||||
ReturnType<typeof getOnboardingApiV1BoardsBoardIdOnboardingGet>
|
||||
>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
) => {
|
||||
const { query: queryOptions, request: requestOptions } = options ?? {};
|
||||
|
||||
const queryKey =
|
||||
queryOptions?.queryKey ??
|
||||
getGetOnboardingApiV1BoardsBoardIdOnboardingGetQueryKey(boardId);
|
||||
|
||||
const queryFn: QueryFunction<
|
||||
Awaited<ReturnType<typeof getOnboardingApiV1BoardsBoardIdOnboardingGet>>
|
||||
> = ({ signal }) =>
|
||||
getOnboardingApiV1BoardsBoardIdOnboardingGet(boardId, {
|
||||
signal,
|
||||
...requestOptions,
|
||||
});
|
||||
|
||||
return {
|
||||
queryKey,
|
||||
queryFn,
|
||||
enabled: !!boardId,
|
||||
...queryOptions,
|
||||
} as UseQueryOptions<
|
||||
Awaited<ReturnType<typeof getOnboardingApiV1BoardsBoardIdOnboardingGet>>,
|
||||
TError,
|
||||
TData
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
};
|
||||
|
||||
export type GetOnboardingApiV1BoardsBoardIdOnboardingGetQueryResult =
|
||||
NonNullable<
|
||||
Awaited<ReturnType<typeof getOnboardingApiV1BoardsBoardIdOnboardingGet>>
|
||||
>;
|
||||
export type GetOnboardingApiV1BoardsBoardIdOnboardingGetQueryError =
|
||||
HTTPValidationError;
|
||||
|
||||
export function useGetOnboardingApiV1BoardsBoardIdOnboardingGet<
|
||||
TData = Awaited<
|
||||
ReturnType<typeof getOnboardingApiV1BoardsBoardIdOnboardingGet>
|
||||
>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
boardId: string,
|
||||
options: {
|
||||
query: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<
|
||||
ReturnType<typeof getOnboardingApiV1BoardsBoardIdOnboardingGet>
|
||||
>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
> &
|
||||
Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<
|
||||
ReturnType<typeof getOnboardingApiV1BoardsBoardIdOnboardingGet>
|
||||
>,
|
||||
TError,
|
||||
Awaited<
|
||||
ReturnType<typeof getOnboardingApiV1BoardsBoardIdOnboardingGet>
|
||||
>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): DefinedUseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useGetOnboardingApiV1BoardsBoardIdOnboardingGet<
|
||||
TData = Awaited<
|
||||
ReturnType<typeof getOnboardingApiV1BoardsBoardIdOnboardingGet>
|
||||
>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
boardId: string,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<
|
||||
ReturnType<typeof getOnboardingApiV1BoardsBoardIdOnboardingGet>
|
||||
>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
> &
|
||||
Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<
|
||||
ReturnType<typeof getOnboardingApiV1BoardsBoardIdOnboardingGet>
|
||||
>,
|
||||
TError,
|
||||
Awaited<
|
||||
ReturnType<typeof getOnboardingApiV1BoardsBoardIdOnboardingGet>
|
||||
>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useGetOnboardingApiV1BoardsBoardIdOnboardingGet<
|
||||
TData = Awaited<
|
||||
ReturnType<typeof getOnboardingApiV1BoardsBoardIdOnboardingGet>
|
||||
>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
boardId: string,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<
|
||||
ReturnType<typeof getOnboardingApiV1BoardsBoardIdOnboardingGet>
|
||||
>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
/**
|
||||
* @summary Get Onboarding
|
||||
*/
|
||||
|
||||
export function useGetOnboardingApiV1BoardsBoardIdOnboardingGet<
|
||||
TData = Awaited<
|
||||
ReturnType<typeof getOnboardingApiV1BoardsBoardIdOnboardingGet>
|
||||
>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
boardId: string,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<
|
||||
ReturnType<typeof getOnboardingApiV1BoardsBoardIdOnboardingGet>
|
||||
>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
} {
|
||||
const queryOptions =
|
||||
getGetOnboardingApiV1BoardsBoardIdOnboardingGetQueryOptions(
|
||||
boardId,
|
||||
options,
|
||||
);
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
|
||||
TData,
|
||||
TError
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
return { ...query, queryKey: queryOptions.queryKey };
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Start Onboarding
|
||||
*/
|
||||
export type startOnboardingApiV1BoardsBoardIdOnboardingStartPostResponse200 = {
|
||||
data: BoardOnboardingRead;
|
||||
status: 200;
|
||||
};
|
||||
|
||||
export type startOnboardingApiV1BoardsBoardIdOnboardingStartPostResponse422 = {
|
||||
data: HTTPValidationError;
|
||||
status: 422;
|
||||
};
|
||||
|
||||
export type startOnboardingApiV1BoardsBoardIdOnboardingStartPostResponseSuccess =
|
||||
startOnboardingApiV1BoardsBoardIdOnboardingStartPostResponse200 & {
|
||||
headers: Headers;
|
||||
};
|
||||
export type startOnboardingApiV1BoardsBoardIdOnboardingStartPostResponseError =
|
||||
startOnboardingApiV1BoardsBoardIdOnboardingStartPostResponse422 & {
|
||||
headers: Headers;
|
||||
};
|
||||
|
||||
export type startOnboardingApiV1BoardsBoardIdOnboardingStartPostResponse =
|
||||
| startOnboardingApiV1BoardsBoardIdOnboardingStartPostResponseSuccess
|
||||
| startOnboardingApiV1BoardsBoardIdOnboardingStartPostResponseError;
|
||||
|
||||
export const getStartOnboardingApiV1BoardsBoardIdOnboardingStartPostUrl = (
|
||||
boardId: string,
|
||||
) => {
|
||||
return `/api/v1/boards/${boardId}/onboarding/start`;
|
||||
};
|
||||
|
||||
export const startOnboardingApiV1BoardsBoardIdOnboardingStartPost = async (
|
||||
boardId: string,
|
||||
boardOnboardingStart: BoardOnboardingStart,
|
||||
options?: RequestInit,
|
||||
): Promise<startOnboardingApiV1BoardsBoardIdOnboardingStartPostResponse> => {
|
||||
return customFetch<startOnboardingApiV1BoardsBoardIdOnboardingStartPostResponse>(
|
||||
getStartOnboardingApiV1BoardsBoardIdOnboardingStartPostUrl(boardId),
|
||||
{
|
||||
...options,
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json", ...options?.headers },
|
||||
body: JSON.stringify(boardOnboardingStart),
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
export const getStartOnboardingApiV1BoardsBoardIdOnboardingStartPostMutationOptions =
|
||||
<TError = HTTPValidationError, TContext = unknown>(options?: {
|
||||
mutation?: UseMutationOptions<
|
||||
Awaited<
|
||||
ReturnType<typeof startOnboardingApiV1BoardsBoardIdOnboardingStartPost>
|
||||
>,
|
||||
TError,
|
||||
{ boardId: string; data: BoardOnboardingStart },
|
||||
TContext
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
}): UseMutationOptions<
|
||||
Awaited<
|
||||
ReturnType<typeof startOnboardingApiV1BoardsBoardIdOnboardingStartPost>
|
||||
>,
|
||||
TError,
|
||||
{ boardId: string; data: BoardOnboardingStart },
|
||||
TContext
|
||||
> => {
|
||||
const mutationKey = [
|
||||
"startOnboardingApiV1BoardsBoardIdOnboardingStartPost",
|
||||
];
|
||||
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 startOnboardingApiV1BoardsBoardIdOnboardingStartPost>
|
||||
>,
|
||||
{ boardId: string; data: BoardOnboardingStart }
|
||||
> = (props) => {
|
||||
const { boardId, data } = props ?? {};
|
||||
|
||||
return startOnboardingApiV1BoardsBoardIdOnboardingStartPost(
|
||||
boardId,
|
||||
data,
|
||||
requestOptions,
|
||||
);
|
||||
};
|
||||
|
||||
return { mutationFn, ...mutationOptions };
|
||||
};
|
||||
|
||||
export type StartOnboardingApiV1BoardsBoardIdOnboardingStartPostMutationResult =
|
||||
NonNullable<
|
||||
Awaited<
|
||||
ReturnType<typeof startOnboardingApiV1BoardsBoardIdOnboardingStartPost>
|
||||
>
|
||||
>;
|
||||
export type StartOnboardingApiV1BoardsBoardIdOnboardingStartPostMutationBody =
|
||||
BoardOnboardingStart;
|
||||
export type StartOnboardingApiV1BoardsBoardIdOnboardingStartPostMutationError =
|
||||
HTTPValidationError;
|
||||
|
||||
/**
|
||||
* @summary Start Onboarding
|
||||
*/
|
||||
export const useStartOnboardingApiV1BoardsBoardIdOnboardingStartPost = <
|
||||
TError = HTTPValidationError,
|
||||
TContext = unknown,
|
||||
>(
|
||||
options?: {
|
||||
mutation?: UseMutationOptions<
|
||||
Awaited<
|
||||
ReturnType<typeof startOnboardingApiV1BoardsBoardIdOnboardingStartPost>
|
||||
>,
|
||||
TError,
|
||||
{ boardId: string; data: BoardOnboardingStart },
|
||||
TContext
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseMutationResult<
|
||||
Awaited<
|
||||
ReturnType<typeof startOnboardingApiV1BoardsBoardIdOnboardingStartPost>
|
||||
>,
|
||||
TError,
|
||||
{ boardId: string; data: BoardOnboardingStart },
|
||||
TContext
|
||||
> => {
|
||||
return useMutation(
|
||||
getStartOnboardingApiV1BoardsBoardIdOnboardingStartPostMutationOptions(
|
||||
options,
|
||||
),
|
||||
queryClient,
|
||||
);
|
||||
};
|
||||
/**
|
||||
* @summary Answer Onboarding
|
||||
*/
|
||||
export type answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostResponse200 =
|
||||
{
|
||||
data: BoardOnboardingRead;
|
||||
status: 200;
|
||||
};
|
||||
|
||||
export type answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostResponse422 =
|
||||
{
|
||||
data: HTTPValidationError;
|
||||
status: 422;
|
||||
};
|
||||
|
||||
export type answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostResponseSuccess =
|
||||
answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostResponse200 & {
|
||||
headers: Headers;
|
||||
};
|
||||
export type answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostResponseError =
|
||||
answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostResponse422 & {
|
||||
headers: Headers;
|
||||
};
|
||||
|
||||
export type answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostResponse =
|
||||
| answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostResponseSuccess
|
||||
| answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostResponseError;
|
||||
|
||||
export const getAnswerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostUrl = (
|
||||
boardId: string,
|
||||
) => {
|
||||
return `/api/v1/boards/${boardId}/onboarding/answer`;
|
||||
};
|
||||
|
||||
export const answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPost = async (
|
||||
boardId: string,
|
||||
boardOnboardingAnswer: BoardOnboardingAnswer,
|
||||
options?: RequestInit,
|
||||
): Promise<answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostResponse> => {
|
||||
return customFetch<answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostResponse>(
|
||||
getAnswerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostUrl(boardId),
|
||||
{
|
||||
...options,
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json", ...options?.headers },
|
||||
body: JSON.stringify(boardOnboardingAnswer),
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
export const getAnswerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostMutationOptions =
|
||||
<TError = HTTPValidationError, TContext = unknown>(options?: {
|
||||
mutation?: UseMutationOptions<
|
||||
Awaited<
|
||||
ReturnType<
|
||||
typeof answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPost
|
||||
>
|
||||
>,
|
||||
TError,
|
||||
{ boardId: string; data: BoardOnboardingAnswer },
|
||||
TContext
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
}): UseMutationOptions<
|
||||
Awaited<
|
||||
ReturnType<typeof answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPost>
|
||||
>,
|
||||
TError,
|
||||
{ boardId: string; data: BoardOnboardingAnswer },
|
||||
TContext
|
||||
> => {
|
||||
const mutationKey = [
|
||||
"answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPost",
|
||||
];
|
||||
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 answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPost
|
||||
>
|
||||
>,
|
||||
{ boardId: string; data: BoardOnboardingAnswer }
|
||||
> = (props) => {
|
||||
const { boardId, data } = props ?? {};
|
||||
|
||||
return answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPost(
|
||||
boardId,
|
||||
data,
|
||||
requestOptions,
|
||||
);
|
||||
};
|
||||
|
||||
return { mutationFn, ...mutationOptions };
|
||||
};
|
||||
|
||||
export type AnswerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostMutationResult =
|
||||
NonNullable<
|
||||
Awaited<
|
||||
ReturnType<typeof answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPost>
|
||||
>
|
||||
>;
|
||||
export type AnswerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostMutationBody =
|
||||
BoardOnboardingAnswer;
|
||||
export type AnswerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostMutationError =
|
||||
HTTPValidationError;
|
||||
|
||||
/**
|
||||
* @summary Answer Onboarding
|
||||
*/
|
||||
export const useAnswerOnboardingApiV1BoardsBoardIdOnboardingAnswerPost = <
|
||||
TError = HTTPValidationError,
|
||||
TContext = unknown,
|
||||
>(
|
||||
options?: {
|
||||
mutation?: UseMutationOptions<
|
||||
Awaited<
|
||||
ReturnType<
|
||||
typeof answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPost
|
||||
>
|
||||
>,
|
||||
TError,
|
||||
{ boardId: string; data: BoardOnboardingAnswer },
|
||||
TContext
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseMutationResult<
|
||||
Awaited<
|
||||
ReturnType<typeof answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPost>
|
||||
>,
|
||||
TError,
|
||||
{ boardId: string; data: BoardOnboardingAnswer },
|
||||
TContext
|
||||
> => {
|
||||
return useMutation(
|
||||
getAnswerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostMutationOptions(
|
||||
options,
|
||||
),
|
||||
queryClient,
|
||||
);
|
||||
};
|
||||
/**
|
||||
* @summary Agent Onboarding Update
|
||||
*/
|
||||
export type agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostResponse200 =
|
||||
{
|
||||
data: BoardOnboardingRead;
|
||||
status: 200;
|
||||
};
|
||||
|
||||
export type agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostResponse422 =
|
||||
{
|
||||
data: HTTPValidationError;
|
||||
status: 422;
|
||||
};
|
||||
|
||||
export type agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostResponseSuccess =
|
||||
agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostResponse200 & {
|
||||
headers: Headers;
|
||||
};
|
||||
export type agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostResponseError =
|
||||
agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostResponse422 & {
|
||||
headers: Headers;
|
||||
};
|
||||
|
||||
export type agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostResponse =
|
||||
| agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostResponseSuccess
|
||||
| agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostResponseError;
|
||||
|
||||
export const getAgentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostUrl =
|
||||
(boardId: string) => {
|
||||
return `/api/v1/boards/${boardId}/onboarding/agent`;
|
||||
};
|
||||
|
||||
export const agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPost =
|
||||
async (
|
||||
boardId: string,
|
||||
boardOnboardingAgentCompleteBoardOnboardingAgentQuestion:
|
||||
| BoardOnboardingAgentComplete
|
||||
| BoardOnboardingAgentQuestion,
|
||||
options?: RequestInit,
|
||||
): Promise<agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostResponse> => {
|
||||
return customFetch<agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostResponse>(
|
||||
getAgentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostUrl(boardId),
|
||||
{
|
||||
...options,
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json", ...options?.headers },
|
||||
body: JSON.stringify(
|
||||
boardOnboardingAgentCompleteBoardOnboardingAgentQuestion,
|
||||
),
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
export const getAgentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostMutationOptions =
|
||||
<TError = HTTPValidationError, TContext = unknown>(options?: {
|
||||
mutation?: UseMutationOptions<
|
||||
Awaited<
|
||||
ReturnType<
|
||||
typeof agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPost
|
||||
>
|
||||
>,
|
||||
TError,
|
||||
{
|
||||
boardId: string;
|
||||
data: BoardOnboardingAgentComplete | BoardOnboardingAgentQuestion;
|
||||
},
|
||||
TContext
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
}): UseMutationOptions<
|
||||
Awaited<
|
||||
ReturnType<
|
||||
typeof agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPost
|
||||
>
|
||||
>,
|
||||
TError,
|
||||
{
|
||||
boardId: string;
|
||||
data: BoardOnboardingAgentComplete | BoardOnboardingAgentQuestion;
|
||||
},
|
||||
TContext
|
||||
> => {
|
||||
const mutationKey = [
|
||||
"agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPost",
|
||||
];
|
||||
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 agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPost
|
||||
>
|
||||
>,
|
||||
{
|
||||
boardId: string;
|
||||
data: BoardOnboardingAgentComplete | BoardOnboardingAgentQuestion;
|
||||
}
|
||||
> = (props) => {
|
||||
const { boardId, data } = props ?? {};
|
||||
|
||||
return agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPost(
|
||||
boardId,
|
||||
data,
|
||||
requestOptions,
|
||||
);
|
||||
};
|
||||
|
||||
return { mutationFn, ...mutationOptions };
|
||||
};
|
||||
|
||||
export type AgentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostMutationResult =
|
||||
NonNullable<
|
||||
Awaited<
|
||||
ReturnType<
|
||||
typeof agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPost
|
||||
>
|
||||
>
|
||||
>;
|
||||
export type AgentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostMutationBody =
|
||||
BoardOnboardingAgentComplete | BoardOnboardingAgentQuestion;
|
||||
export type AgentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostMutationError =
|
||||
HTTPValidationError;
|
||||
|
||||
/**
|
||||
* @summary Agent Onboarding Update
|
||||
*/
|
||||
export const useAgentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPost = <
|
||||
TError = HTTPValidationError,
|
||||
TContext = unknown,
|
||||
>(
|
||||
options?: {
|
||||
mutation?: UseMutationOptions<
|
||||
Awaited<
|
||||
ReturnType<
|
||||
typeof agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPost
|
||||
>
|
||||
>,
|
||||
TError,
|
||||
{
|
||||
boardId: string;
|
||||
data: BoardOnboardingAgentComplete | BoardOnboardingAgentQuestion;
|
||||
},
|
||||
TContext
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseMutationResult<
|
||||
Awaited<
|
||||
ReturnType<
|
||||
typeof agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPost
|
||||
>
|
||||
>,
|
||||
TError,
|
||||
{
|
||||
boardId: string;
|
||||
data: BoardOnboardingAgentComplete | BoardOnboardingAgentQuestion;
|
||||
},
|
||||
TContext
|
||||
> => {
|
||||
return useMutation(
|
||||
getAgentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostMutationOptions(
|
||||
options,
|
||||
),
|
||||
queryClient,
|
||||
);
|
||||
};
|
||||
/**
|
||||
* @summary Confirm Onboarding
|
||||
*/
|
||||
export type confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostResponse200 =
|
||||
{
|
||||
data: BoardRead;
|
||||
status: 200;
|
||||
};
|
||||
|
||||
export type confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostResponse422 =
|
||||
{
|
||||
data: HTTPValidationError;
|
||||
status: 422;
|
||||
};
|
||||
|
||||
export type confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostResponseSuccess =
|
||||
confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostResponse200 & {
|
||||
headers: Headers;
|
||||
};
|
||||
export type confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostResponseError =
|
||||
confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostResponse422 & {
|
||||
headers: Headers;
|
||||
};
|
||||
|
||||
export type confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostResponse =
|
||||
| confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostResponseSuccess
|
||||
| confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostResponseError;
|
||||
|
||||
export const getConfirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostUrl = (
|
||||
boardId: string,
|
||||
) => {
|
||||
return `/api/v1/boards/${boardId}/onboarding/confirm`;
|
||||
};
|
||||
|
||||
export const confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPost = async (
|
||||
boardId: string,
|
||||
boardOnboardingConfirm: BoardOnboardingConfirm,
|
||||
options?: RequestInit,
|
||||
): Promise<confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostResponse> => {
|
||||
return customFetch<confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostResponse>(
|
||||
getConfirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostUrl(boardId),
|
||||
{
|
||||
...options,
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json", ...options?.headers },
|
||||
body: JSON.stringify(boardOnboardingConfirm),
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
export const getConfirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostMutationOptions =
|
||||
<TError = HTTPValidationError, TContext = unknown>(options?: {
|
||||
mutation?: UseMutationOptions<
|
||||
Awaited<
|
||||
ReturnType<
|
||||
typeof confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPost
|
||||
>
|
||||
>,
|
||||
TError,
|
||||
{ boardId: string; data: BoardOnboardingConfirm },
|
||||
TContext
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
}): UseMutationOptions<
|
||||
Awaited<
|
||||
ReturnType<
|
||||
typeof confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPost
|
||||
>
|
||||
>,
|
||||
TError,
|
||||
{ boardId: string; data: BoardOnboardingConfirm },
|
||||
TContext
|
||||
> => {
|
||||
const mutationKey = [
|
||||
"confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPost",
|
||||
];
|
||||
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 confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPost
|
||||
>
|
||||
>,
|
||||
{ boardId: string; data: BoardOnboardingConfirm }
|
||||
> = (props) => {
|
||||
const { boardId, data } = props ?? {};
|
||||
|
||||
return confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPost(
|
||||
boardId,
|
||||
data,
|
||||
requestOptions,
|
||||
);
|
||||
};
|
||||
|
||||
return { mutationFn, ...mutationOptions };
|
||||
};
|
||||
|
||||
export type ConfirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostMutationResult =
|
||||
NonNullable<
|
||||
Awaited<
|
||||
ReturnType<
|
||||
typeof confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPost
|
||||
>
|
||||
>
|
||||
>;
|
||||
export type ConfirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostMutationBody =
|
||||
BoardOnboardingConfirm;
|
||||
export type ConfirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostMutationError =
|
||||
HTTPValidationError;
|
||||
|
||||
/**
|
||||
* @summary Confirm Onboarding
|
||||
*/
|
||||
export const useConfirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPost = <
|
||||
TError = HTTPValidationError,
|
||||
TContext = unknown,
|
||||
>(
|
||||
options?: {
|
||||
mutation?: UseMutationOptions<
|
||||
Awaited<
|
||||
ReturnType<
|
||||
typeof confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPost
|
||||
>
|
||||
>,
|
||||
TError,
|
||||
{ boardId: string; data: BoardOnboardingConfirm },
|
||||
TContext
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseMutationResult<
|
||||
Awaited<
|
||||
ReturnType<typeof confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPost>
|
||||
>,
|
||||
TError,
|
||||
{ boardId: string; data: BoardOnboardingConfirm },
|
||||
TContext
|
||||
> => {
|
||||
return useMutation(
|
||||
getConfirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostMutationOptions(
|
||||
options,
|
||||
),
|
||||
queryClient,
|
||||
);
|
||||
};
|
||||
@@ -24,8 +24,8 @@ import type {
|
||||
BoardCreate,
|
||||
BoardRead,
|
||||
BoardUpdate,
|
||||
DeleteBoardApiV1BoardsBoardIdDelete200,
|
||||
HTTPValidationError,
|
||||
OkResponse,
|
||||
} from ".././model";
|
||||
|
||||
import { customFetch } from "../../mutator";
|
||||
@@ -653,7 +653,7 @@ export const useUpdateBoardApiV1BoardsBoardIdPatch = <
|
||||
* @summary Delete Board
|
||||
*/
|
||||
export type deleteBoardApiV1BoardsBoardIdDeleteResponse200 = {
|
||||
data: DeleteBoardApiV1BoardsBoardIdDelete200;
|
||||
data: OkResponse;
|
||||
status: 200;
|
||||
};
|
||||
|
||||
|
||||
2191
frontend/src/api/generated/gateways/gateways.ts
Normal file
2191
frontend/src/api/generated/gateways/gateways.ts
Normal file
File diff suppressed because it is too large
Load Diff
243
frontend/src/api/generated/metrics/metrics.ts
Normal file
243
frontend/src/api/generated/metrics/metrics.ts
Normal file
@@ -0,0 +1,243 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import type {
|
||||
DataTag,
|
||||
DefinedInitialDataOptions,
|
||||
DefinedUseQueryResult,
|
||||
QueryClient,
|
||||
QueryFunction,
|
||||
QueryKey,
|
||||
UndefinedInitialDataOptions,
|
||||
UseQueryOptions,
|
||||
UseQueryResult,
|
||||
} from "@tanstack/react-query";
|
||||
|
||||
import type {
|
||||
DashboardMetrics,
|
||||
DashboardMetricsApiV1MetricsDashboardGetParams,
|
||||
HTTPValidationError,
|
||||
} from ".././model";
|
||||
|
||||
import { customFetch } from "../../mutator";
|
||||
|
||||
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
||||
|
||||
/**
|
||||
* @summary Dashboard Metrics
|
||||
*/
|
||||
export type dashboardMetricsApiV1MetricsDashboardGetResponse200 = {
|
||||
data: DashboardMetrics;
|
||||
status: 200;
|
||||
};
|
||||
|
||||
export type dashboardMetricsApiV1MetricsDashboardGetResponse422 = {
|
||||
data: HTTPValidationError;
|
||||
status: 422;
|
||||
};
|
||||
|
||||
export type dashboardMetricsApiV1MetricsDashboardGetResponseSuccess =
|
||||
dashboardMetricsApiV1MetricsDashboardGetResponse200 & {
|
||||
headers: Headers;
|
||||
};
|
||||
export type dashboardMetricsApiV1MetricsDashboardGetResponseError =
|
||||
dashboardMetricsApiV1MetricsDashboardGetResponse422 & {
|
||||
headers: Headers;
|
||||
};
|
||||
|
||||
export type dashboardMetricsApiV1MetricsDashboardGetResponse =
|
||||
| dashboardMetricsApiV1MetricsDashboardGetResponseSuccess
|
||||
| dashboardMetricsApiV1MetricsDashboardGetResponseError;
|
||||
|
||||
export const getDashboardMetricsApiV1MetricsDashboardGetUrl = (
|
||||
params?: DashboardMetricsApiV1MetricsDashboardGetParams,
|
||||
) => {
|
||||
const normalizedParams = new URLSearchParams();
|
||||
|
||||
Object.entries(params || {}).forEach(([key, value]) => {
|
||||
if (value !== undefined) {
|
||||
normalizedParams.append(key, value === null ? "null" : value.toString());
|
||||
}
|
||||
});
|
||||
|
||||
const stringifiedParams = normalizedParams.toString();
|
||||
|
||||
return stringifiedParams.length > 0
|
||||
? `/api/v1/metrics/dashboard?${stringifiedParams}`
|
||||
: `/api/v1/metrics/dashboard`;
|
||||
};
|
||||
|
||||
export const dashboardMetricsApiV1MetricsDashboardGet = async (
|
||||
params?: DashboardMetricsApiV1MetricsDashboardGetParams,
|
||||
options?: RequestInit,
|
||||
): Promise<dashboardMetricsApiV1MetricsDashboardGetResponse> => {
|
||||
return customFetch<dashboardMetricsApiV1MetricsDashboardGetResponse>(
|
||||
getDashboardMetricsApiV1MetricsDashboardGetUrl(params),
|
||||
{
|
||||
...options,
|
||||
method: "GET",
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
export const getDashboardMetricsApiV1MetricsDashboardGetQueryKey = (
|
||||
params?: DashboardMetricsApiV1MetricsDashboardGetParams,
|
||||
) => {
|
||||
return [`/api/v1/metrics/dashboard`, ...(params ? [params] : [])] as const;
|
||||
};
|
||||
|
||||
export const getDashboardMetricsApiV1MetricsDashboardGetQueryOptions = <
|
||||
TData = Awaited<ReturnType<typeof dashboardMetricsApiV1MetricsDashboardGet>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
params?: DashboardMetricsApiV1MetricsDashboardGetParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof dashboardMetricsApiV1MetricsDashboardGet>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
) => {
|
||||
const { query: queryOptions, request: requestOptions } = options ?? {};
|
||||
|
||||
const queryKey =
|
||||
queryOptions?.queryKey ??
|
||||
getDashboardMetricsApiV1MetricsDashboardGetQueryKey(params);
|
||||
|
||||
const queryFn: QueryFunction<
|
||||
Awaited<ReturnType<typeof dashboardMetricsApiV1MetricsDashboardGet>>
|
||||
> = ({ signal }) =>
|
||||
dashboardMetricsApiV1MetricsDashboardGet(params, {
|
||||
signal,
|
||||
...requestOptions,
|
||||
});
|
||||
|
||||
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
|
||||
Awaited<ReturnType<typeof dashboardMetricsApiV1MetricsDashboardGet>>,
|
||||
TError,
|
||||
TData
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
};
|
||||
|
||||
export type DashboardMetricsApiV1MetricsDashboardGetQueryResult = NonNullable<
|
||||
Awaited<ReturnType<typeof dashboardMetricsApiV1MetricsDashboardGet>>
|
||||
>;
|
||||
export type DashboardMetricsApiV1MetricsDashboardGetQueryError =
|
||||
HTTPValidationError;
|
||||
|
||||
export function useDashboardMetricsApiV1MetricsDashboardGet<
|
||||
TData = Awaited<ReturnType<typeof dashboardMetricsApiV1MetricsDashboardGet>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
params: undefined | DashboardMetricsApiV1MetricsDashboardGetParams,
|
||||
options: {
|
||||
query: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof dashboardMetricsApiV1MetricsDashboardGet>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
> &
|
||||
Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof dashboardMetricsApiV1MetricsDashboardGet>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof dashboardMetricsApiV1MetricsDashboardGet>>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): DefinedUseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useDashboardMetricsApiV1MetricsDashboardGet<
|
||||
TData = Awaited<ReturnType<typeof dashboardMetricsApiV1MetricsDashboardGet>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
params?: DashboardMetricsApiV1MetricsDashboardGetParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof dashboardMetricsApiV1MetricsDashboardGet>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
> &
|
||||
Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof dashboardMetricsApiV1MetricsDashboardGet>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof dashboardMetricsApiV1MetricsDashboardGet>>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useDashboardMetricsApiV1MetricsDashboardGet<
|
||||
TData = Awaited<ReturnType<typeof dashboardMetricsApiV1MetricsDashboardGet>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
params?: DashboardMetricsApiV1MetricsDashboardGetParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof dashboardMetricsApiV1MetricsDashboardGet>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
/**
|
||||
* @summary Dashboard Metrics
|
||||
*/
|
||||
|
||||
export function useDashboardMetricsApiV1MetricsDashboardGet<
|
||||
TData = Awaited<ReturnType<typeof dashboardMetricsApiV1MetricsDashboardGet>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
params?: DashboardMetricsApiV1MetricsDashboardGetParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof dashboardMetricsApiV1MetricsDashboardGet>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
} {
|
||||
const queryOptions = getDashboardMetricsApiV1MetricsDashboardGetQueryOptions(
|
||||
params,
|
||||
options,
|
||||
);
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
|
||||
TData,
|
||||
TError
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
return { ...query, queryKey: queryOptions.queryKey };
|
||||
}
|
||||
@@ -5,10 +5,15 @@
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { AgentCreateHeartbeatConfig } from "./agentCreateHeartbeatConfig";
|
||||
import type { AgentCreateIdentityProfile } from "./agentCreateIdentityProfile";
|
||||
|
||||
export interface AgentCreate {
|
||||
board_id?: string | null;
|
||||
/** @minLength 1 */
|
||||
name: string;
|
||||
status?: string;
|
||||
heartbeat_config?: AgentCreateHeartbeatConfig;
|
||||
identity_profile?: AgentCreateIdentityProfile;
|
||||
identity_template?: string | null;
|
||||
soul_template?: string | null;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type AgentCreateIdentityProfile = { [key: string]: unknown } | null;
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
export interface AgentHeartbeatCreate {
|
||||
status?: string | null;
|
||||
/** @minLength 1 */
|
||||
name: string;
|
||||
board_id?: string | null;
|
||||
}
|
||||
|
||||
11
frontend/src/api/generated/model/agentNudge.ts
Normal file
11
frontend/src/api/generated/model/agentNudge.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface AgentNudge {
|
||||
/** @minLength 1 */
|
||||
message: string;
|
||||
}
|
||||
@@ -5,13 +5,20 @@
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { AgentReadHeartbeatConfig } from "./agentReadHeartbeatConfig";
|
||||
import type { AgentReadIdentityProfile } from "./agentReadIdentityProfile";
|
||||
|
||||
export interface AgentRead {
|
||||
board_id?: string | null;
|
||||
/** @minLength 1 */
|
||||
name: string;
|
||||
status?: string;
|
||||
heartbeat_config?: AgentReadHeartbeatConfig;
|
||||
identity_profile?: AgentReadIdentityProfile;
|
||||
identity_template?: string | null;
|
||||
soul_template?: string | null;
|
||||
id: string;
|
||||
is_board_lead?: boolean;
|
||||
is_gateway_main?: boolean;
|
||||
openclaw_session_id?: string | null;
|
||||
last_seen_at: string | null;
|
||||
created_at: string;
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type AgentReadIdentityProfile = { [key: string]: unknown } | null;
|
||||
@@ -5,10 +5,15 @@
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { AgentUpdateHeartbeatConfig } from "./agentUpdateHeartbeatConfig";
|
||||
import type { AgentUpdateIdentityProfile } from "./agentUpdateIdentityProfile";
|
||||
|
||||
export interface AgentUpdate {
|
||||
board_id?: string | null;
|
||||
is_gateway_main?: boolean | null;
|
||||
name?: string | null;
|
||||
status?: string | null;
|
||||
heartbeat_config?: AgentUpdateHeartbeatConfig;
|
||||
identity_profile?: AgentUpdateIdentityProfile;
|
||||
identity_template?: string | null;
|
||||
soul_template?: string | null;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type AgentUpdateIdentityProfile = { [key: string]: unknown } | null;
|
||||
18
frontend/src/api/generated/model/approvalCreate.ts
Normal file
18
frontend/src/api/generated/model/approvalCreate.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { ApprovalCreatePayload } from "./approvalCreatePayload";
|
||||
import type { ApprovalCreateRubricScores } from "./approvalCreateRubricScores";
|
||||
import type { ApprovalCreateStatus } from "./approvalCreateStatus";
|
||||
|
||||
export interface ApprovalCreate {
|
||||
action_type: string;
|
||||
payload?: ApprovalCreatePayload;
|
||||
confidence: number;
|
||||
rubric_scores?: ApprovalCreateRubricScores;
|
||||
status?: ApprovalCreateStatus;
|
||||
agent_id?: string | null;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type ApprovalCreatePayload = { [key: string]: unknown } | null;
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type ApprovalCreateRubricScores = { [key: string]: number } | null;
|
||||
15
frontend/src/api/generated/model/approvalCreateStatus.ts
Normal file
15
frontend/src/api/generated/model/approvalCreateStatus.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type ApprovalCreateStatus =
|
||||
(typeof ApprovalCreateStatus)[keyof typeof ApprovalCreateStatus];
|
||||
|
||||
export const ApprovalCreateStatus = {
|
||||
pending: "pending",
|
||||
approved: "approved",
|
||||
rejected: "rejected",
|
||||
} as const;
|
||||
22
frontend/src/api/generated/model/approvalRead.ts
Normal file
22
frontend/src/api/generated/model/approvalRead.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { ApprovalReadPayload } from "./approvalReadPayload";
|
||||
import type { ApprovalReadRubricScores } from "./approvalReadRubricScores";
|
||||
import type { ApprovalReadStatus } from "./approvalReadStatus";
|
||||
|
||||
export interface ApprovalRead {
|
||||
action_type: string;
|
||||
payload?: ApprovalReadPayload;
|
||||
confidence: number;
|
||||
rubric_scores?: ApprovalReadRubricScores;
|
||||
status?: ApprovalReadStatus;
|
||||
id: string;
|
||||
board_id: string;
|
||||
agent_id?: string | null;
|
||||
created_at: string;
|
||||
resolved_at?: string | null;
|
||||
}
|
||||
8
frontend/src/api/generated/model/approvalReadPayload.ts
Normal file
8
frontend/src/api/generated/model/approvalReadPayload.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type ApprovalReadPayload = { [key: string]: unknown } | null;
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type ApprovalReadRubricScores = { [key: string]: number } | null;
|
||||
15
frontend/src/api/generated/model/approvalReadStatus.ts
Normal file
15
frontend/src/api/generated/model/approvalReadStatus.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type ApprovalReadStatus =
|
||||
(typeof ApprovalReadStatus)[keyof typeof ApprovalReadStatus];
|
||||
|
||||
export const ApprovalReadStatus = {
|
||||
pending: "pending",
|
||||
approved: "approved",
|
||||
rejected: "rejected",
|
||||
} as const;
|
||||
10
frontend/src/api/generated/model/approvalUpdate.ts
Normal file
10
frontend/src/api/generated/model/approvalUpdate.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface ApprovalUpdate {
|
||||
status?: "pending" | "approved" | "rejected" | null;
|
||||
}
|
||||
@@ -4,9 +4,16 @@
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { BoardCreateSuccessMetrics } from "./boardCreateSuccessMetrics";
|
||||
|
||||
export interface BoardCreate {
|
||||
name: string;
|
||||
slug: string;
|
||||
gateway_id?: string | null;
|
||||
gateway_id: string;
|
||||
board_type?: string;
|
||||
objective?: string | null;
|
||||
success_metrics?: BoardCreateSuccessMetrics;
|
||||
target_date?: string | null;
|
||||
goal_confirmed?: boolean;
|
||||
goal_source?: string | null;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type BoardCreateSuccessMetrics = { [key: string]: unknown } | null;
|
||||
13
frontend/src/api/generated/model/boardMemoryCreate.ts
Normal file
13
frontend/src/api/generated/model/boardMemoryCreate.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface BoardMemoryCreate {
|
||||
/** @minLength 1 */
|
||||
content: string;
|
||||
tags?: string[] | null;
|
||||
source?: string | null;
|
||||
}
|
||||
16
frontend/src/api/generated/model/boardMemoryRead.ts
Normal file
16
frontend/src/api/generated/model/boardMemoryRead.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface BoardMemoryRead {
|
||||
/** @minLength 1 */
|
||||
content: string;
|
||||
tags?: string[] | null;
|
||||
source?: string | null;
|
||||
id: string;
|
||||
board_id: string;
|
||||
created_at: string;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { BoardOnboardingAgentCompleteSuccessMetrics } from "./boardOnboardingAgentCompleteSuccessMetrics";
|
||||
|
||||
export interface BoardOnboardingAgentComplete {
|
||||
board_type: string;
|
||||
objective?: string | null;
|
||||
success_metrics?: BoardOnboardingAgentCompleteSuccessMetrics;
|
||||
target_date?: string | null;
|
||||
status: "complete";
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type BoardOnboardingAgentCompleteSuccessMetrics = {
|
||||
[key: string]: unknown;
|
||||
} | null;
|
||||
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { BoardOnboardingQuestionOption } from "./boardOnboardingQuestionOption";
|
||||
|
||||
export interface BoardOnboardingAgentQuestion {
|
||||
/** @minLength 1 */
|
||||
question: string;
|
||||
/** @minItems 1 */
|
||||
options: BoardOnboardingQuestionOption[];
|
||||
}
|
||||
12
frontend/src/api/generated/model/boardOnboardingAnswer.ts
Normal file
12
frontend/src/api/generated/model/boardOnboardingAnswer.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface BoardOnboardingAnswer {
|
||||
/** @minLength 1 */
|
||||
answer: string;
|
||||
other_text?: string | null;
|
||||
}
|
||||
14
frontend/src/api/generated/model/boardOnboardingConfirm.ts
Normal file
14
frontend/src/api/generated/model/boardOnboardingConfirm.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { BoardOnboardingConfirmSuccessMetrics } from "./boardOnboardingConfirmSuccessMetrics";
|
||||
|
||||
export interface BoardOnboardingConfirm {
|
||||
board_type: string;
|
||||
objective?: string | null;
|
||||
success_metrics?: BoardOnboardingConfirmSuccessMetrics;
|
||||
target_date?: string | null;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type BoardOnboardingConfirmSuccessMetrics = {
|
||||
[key: string]: unknown;
|
||||
} | null;
|
||||
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface BoardOnboardingQuestionOption {
|
||||
/** @minLength 1 */
|
||||
id: string;
|
||||
/** @minLength 1 */
|
||||
label: string;
|
||||
}
|
||||
19
frontend/src/api/generated/model/boardOnboardingRead.ts
Normal file
19
frontend/src/api/generated/model/boardOnboardingRead.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { BoardOnboardingReadDraftGoal } from "./boardOnboardingReadDraftGoal";
|
||||
import type { BoardOnboardingReadMessages } from "./boardOnboardingReadMessages";
|
||||
|
||||
export interface BoardOnboardingRead {
|
||||
id: string;
|
||||
board_id: string;
|
||||
session_key: string;
|
||||
status: string;
|
||||
messages?: BoardOnboardingReadMessages;
|
||||
draft_goal?: BoardOnboardingReadDraftGoal;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type BoardOnboardingReadDraftGoal = { [key: string]: unknown } | null;
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type BoardOnboardingReadMessages = { [key: string]: unknown }[] | null;
|
||||
10
frontend/src/api/generated/model/boardOnboardingStart.ts
Normal file
10
frontend/src/api/generated/model/boardOnboardingStart.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface BoardOnboardingStart {
|
||||
[key: string]: unknown;
|
||||
}
|
||||
@@ -4,11 +4,18 @@
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { BoardReadSuccessMetrics } from "./boardReadSuccessMetrics";
|
||||
|
||||
export interface BoardRead {
|
||||
name: string;
|
||||
slug: string;
|
||||
gateway_id?: string | null;
|
||||
board_type?: string;
|
||||
objective?: string | null;
|
||||
success_metrics?: BoardReadSuccessMetrics;
|
||||
target_date?: string | null;
|
||||
goal_confirmed?: boolean;
|
||||
goal_source?: string | null;
|
||||
id: string;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type BoardReadSuccessMetrics = { [key: string]: unknown } | null;
|
||||
@@ -4,9 +4,16 @@
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { BoardUpdateSuccessMetrics } from "./boardUpdateSuccessMetrics";
|
||||
|
||||
export interface BoardUpdate {
|
||||
name?: string | null;
|
||||
slug?: string | null;
|
||||
gateway_id?: string | null;
|
||||
board_type?: string | null;
|
||||
objective?: string | null;
|
||||
success_metrics?: BoardUpdateSuccessMetrics;
|
||||
target_date?: string | null;
|
||||
goal_confirmed?: boolean | null;
|
||||
goal_source?: string | null;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type BoardUpdateSuccessMetrics = { [key: string]: unknown } | null;
|
||||
13
frontend/src/api/generated/model/dashboardKpis.ts
Normal file
13
frontend/src/api/generated/model/dashboardKpis.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface DashboardKpis {
|
||||
active_agents: number;
|
||||
tasks_in_progress: number;
|
||||
error_rate_pct: number;
|
||||
median_cycle_time_hours_7d: number | null;
|
||||
}
|
||||
20
frontend/src/api/generated/model/dashboardMetrics.ts
Normal file
20
frontend/src/api/generated/model/dashboardMetrics.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { DashboardKpis } from "./dashboardKpis";
|
||||
import type { DashboardMetricsRange } from "./dashboardMetricsRange";
|
||||
import type { DashboardSeriesSet } from "./dashboardSeriesSet";
|
||||
import type { DashboardWipSeriesSet } from "./dashboardWipSeriesSet";
|
||||
|
||||
export interface DashboardMetrics {
|
||||
range: DashboardMetricsRange;
|
||||
generated_at: string;
|
||||
kpis: DashboardKpis;
|
||||
throughput: DashboardSeriesSet;
|
||||
cycle_time: DashboardSeriesSet;
|
||||
error_rate: DashboardSeriesSet;
|
||||
wip: DashboardWipSeriesSet;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { DashboardMetricsApiV1MetricsDashboardGetRange } from "./dashboardMetricsApiV1MetricsDashboardGetRange";
|
||||
|
||||
export type DashboardMetricsApiV1MetricsDashboardGetParams = {
|
||||
range?: DashboardMetricsApiV1MetricsDashboardGetRange;
|
||||
};
|
||||
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type DashboardMetricsApiV1MetricsDashboardGetRange =
|
||||
(typeof DashboardMetricsApiV1MetricsDashboardGetRange)[keyof typeof DashboardMetricsApiV1MetricsDashboardGetRange];
|
||||
|
||||
export const DashboardMetricsApiV1MetricsDashboardGetRange = {
|
||||
"24h": "24h",
|
||||
"7d": "7d",
|
||||
} as const;
|
||||
14
frontend/src/api/generated/model/dashboardMetricsRange.ts
Normal file
14
frontend/src/api/generated/model/dashboardMetricsRange.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type DashboardMetricsRange =
|
||||
(typeof DashboardMetricsRange)[keyof typeof DashboardMetricsRange];
|
||||
|
||||
export const DashboardMetricsRange = {
|
||||
"24h": "24h",
|
||||
"7d": "7d",
|
||||
} as const;
|
||||
15
frontend/src/api/generated/model/dashboardRangeSeries.ts
Normal file
15
frontend/src/api/generated/model/dashboardRangeSeries.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { DashboardRangeSeriesBucket } from "./dashboardRangeSeriesBucket";
|
||||
import type { DashboardRangeSeriesRange } from "./dashboardRangeSeriesRange";
|
||||
import type { DashboardSeriesPoint } from "./dashboardSeriesPoint";
|
||||
|
||||
export interface DashboardRangeSeries {
|
||||
range: DashboardRangeSeriesRange;
|
||||
bucket: DashboardRangeSeriesBucket;
|
||||
points: DashboardSeriesPoint[];
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type DashboardRangeSeriesBucket =
|
||||
(typeof DashboardRangeSeriesBucket)[keyof typeof DashboardRangeSeriesBucket];
|
||||
|
||||
export const DashboardRangeSeriesBucket = {
|
||||
hour: "hour",
|
||||
day: "day",
|
||||
} as const;
|
||||
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type DashboardRangeSeriesRange =
|
||||
(typeof DashboardRangeSeriesRange)[keyof typeof DashboardRangeSeriesRange];
|
||||
|
||||
export const DashboardRangeSeriesRange = {
|
||||
"24h": "24h",
|
||||
"7d": "7d",
|
||||
} as const;
|
||||
11
frontend/src/api/generated/model/dashboardSeriesPoint.ts
Normal file
11
frontend/src/api/generated/model/dashboardSeriesPoint.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface DashboardSeriesPoint {
|
||||
period: string;
|
||||
value: number;
|
||||
}
|
||||
12
frontend/src/api/generated/model/dashboardSeriesSet.ts
Normal file
12
frontend/src/api/generated/model/dashboardSeriesSet.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { DashboardRangeSeries } from "./dashboardRangeSeries";
|
||||
|
||||
export interface DashboardSeriesSet {
|
||||
primary: DashboardRangeSeries;
|
||||
comparison: DashboardRangeSeries;
|
||||
}
|
||||
13
frontend/src/api/generated/model/dashboardWipPoint.ts
Normal file
13
frontend/src/api/generated/model/dashboardWipPoint.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface DashboardWipPoint {
|
||||
period: string;
|
||||
inbox: number;
|
||||
in_progress: number;
|
||||
review: number;
|
||||
}
|
||||
15
frontend/src/api/generated/model/dashboardWipRangeSeries.ts
Normal file
15
frontend/src/api/generated/model/dashboardWipRangeSeries.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { DashboardWipPoint } from "./dashboardWipPoint";
|
||||
import type { DashboardWipRangeSeriesBucket } from "./dashboardWipRangeSeriesBucket";
|
||||
import type { DashboardWipRangeSeriesRange } from "./dashboardWipRangeSeriesRange";
|
||||
|
||||
export interface DashboardWipRangeSeries {
|
||||
range: DashboardWipRangeSeriesRange;
|
||||
bucket: DashboardWipRangeSeriesBucket;
|
||||
points: DashboardWipPoint[];
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type DashboardWipRangeSeriesBucket =
|
||||
(typeof DashboardWipRangeSeriesBucket)[keyof typeof DashboardWipRangeSeriesBucket];
|
||||
|
||||
export const DashboardWipRangeSeriesBucket = {
|
||||
hour: "hour",
|
||||
day: "day",
|
||||
} as const;
|
||||
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type DashboardWipRangeSeriesRange =
|
||||
(typeof DashboardWipRangeSeriesRange)[keyof typeof DashboardWipRangeSeriesRange];
|
||||
|
||||
export const DashboardWipRangeSeriesRange = {
|
||||
"24h": "24h",
|
||||
"7d": "7d",
|
||||
} as const;
|
||||
12
frontend/src/api/generated/model/dashboardWipSeriesSet.ts
Normal file
12
frontend/src/api/generated/model/dashboardWipSeriesSet.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { DashboardWipRangeSeries } from "./dashboardWipRangeSeries";
|
||||
|
||||
export interface DashboardWipSeriesSet {
|
||||
primary: DashboardWipRangeSeries;
|
||||
comparison: DashboardWipRangeSeries;
|
||||
}
|
||||
12
frontend/src/api/generated/model/gatewayCommandsResponse.ts
Normal file
12
frontend/src/api/generated/model/gatewayCommandsResponse.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface GatewayCommandsResponse {
|
||||
protocol_version: number;
|
||||
methods: string[];
|
||||
events: string[];
|
||||
}
|
||||
15
frontend/src/api/generated/model/gatewayCreate.ts
Normal file
15
frontend/src/api/generated/model/gatewayCreate.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface GatewayCreate {
|
||||
name: string;
|
||||
url: string;
|
||||
main_session_key: string;
|
||||
workspace_root: string;
|
||||
skyll_enabled?: boolean;
|
||||
token?: string | null;
|
||||
}
|
||||
18
frontend/src/api/generated/model/gatewayRead.ts
Normal file
18
frontend/src/api/generated/model/gatewayRead.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface GatewayRead {
|
||||
name: string;
|
||||
url: string;
|
||||
main_session_key: string;
|
||||
workspace_root: string;
|
||||
skyll_enabled?: boolean;
|
||||
id: string;
|
||||
token?: string | null;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface GatewaySessionHistoryResponse {
|
||||
history: unknown[];
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface GatewaySessionMessageRequest {
|
||||
/** @minLength 1 */
|
||||
content: string;
|
||||
}
|
||||
10
frontend/src/api/generated/model/gatewaySessionResponse.ts
Normal file
10
frontend/src/api/generated/model/gatewaySessionResponse.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface GatewaySessionResponse {
|
||||
session: unknown;
|
||||
}
|
||||
12
frontend/src/api/generated/model/gatewaySessionsResponse.ts
Normal file
12
frontend/src/api/generated/model/gatewaySessionsResponse.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface GatewaySessionsResponse {
|
||||
sessions: unknown[];
|
||||
main_session_key?: string | null;
|
||||
main_session?: unknown | null;
|
||||
}
|
||||
15
frontend/src/api/generated/model/gatewayUpdate.ts
Normal file
15
frontend/src/api/generated/model/gatewayUpdate.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface GatewayUpdate {
|
||||
name?: string | null;
|
||||
url?: string | null;
|
||||
token?: string | null;
|
||||
main_session_key?: string | null;
|
||||
workspace_root?: string | null;
|
||||
skyll_enabled?: boolean | null;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type GatewaysStatusApiV1GatewaysStatusGetParams = {
|
||||
board_id?: string | null;
|
||||
gateway_url?: string | null;
|
||||
gateway_token?: string | null;
|
||||
gateway_main_session_key?: string | null;
|
||||
};
|
||||
17
frontend/src/api/generated/model/gatewaysStatusResponse.ts
Normal file
17
frontend/src/api/generated/model/gatewaysStatusResponse.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface GatewaysStatusResponse {
|
||||
connected: boolean;
|
||||
gateway_url: string;
|
||||
sessions_count?: number | null;
|
||||
sessions?: unknown[] | null;
|
||||
main_session_key?: string | null;
|
||||
main_session?: unknown | null;
|
||||
main_session_error?: string | null;
|
||||
error?: string | null;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type GetGatewaySessionApiV1GatewaysSessionsSessionIdGetParams = {
|
||||
board_id?: string | null;
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type GetSessionHistoryApiV1GatewaysSessionsSessionIdHistoryGetParams = {
|
||||
board_id?: string | null;
|
||||
};
|
||||
@@ -8,45 +8,117 @@
|
||||
export * from "./activityEventRead";
|
||||
export * from "./agentCreate";
|
||||
export * from "./agentCreateHeartbeatConfig";
|
||||
export * from "./agentCreateIdentityProfile";
|
||||
export * from "./agentDeleteConfirm";
|
||||
export * from "./agentHeartbeat";
|
||||
export * from "./agentHeartbeatCreate";
|
||||
export * from "./agentNudge";
|
||||
export * from "./agentProvisionConfirm";
|
||||
export * from "./agentRead";
|
||||
export * from "./agentReadHeartbeatConfig";
|
||||
export * from "./agentReadIdentityProfile";
|
||||
export * from "./agentUpdate";
|
||||
export * from "./agentUpdateHeartbeatConfig";
|
||||
export * from "./agentUpdateIdentityProfile";
|
||||
export * from "./approvalCreate";
|
||||
export * from "./approvalCreatePayload";
|
||||
export * from "./approvalCreateRubricScores";
|
||||
export * from "./approvalCreateStatus";
|
||||
export * from "./approvalRead";
|
||||
export * from "./approvalReadPayload";
|
||||
export * from "./approvalReadRubricScores";
|
||||
export * from "./approvalReadStatus";
|
||||
export * from "./approvalUpdate";
|
||||
export * from "./boardCreate";
|
||||
export * from "./boardCreateSuccessMetrics";
|
||||
export * from "./boardMemoryCreate";
|
||||
export * from "./boardMemoryRead";
|
||||
export * from "./boardOnboardingAgentComplete";
|
||||
export * from "./boardOnboardingAgentCompleteSuccessMetrics";
|
||||
export * from "./boardOnboardingAgentQuestion";
|
||||
export * from "./boardOnboardingAnswer";
|
||||
export * from "./boardOnboardingConfirm";
|
||||
export * from "./boardOnboardingConfirmSuccessMetrics";
|
||||
export * from "./boardOnboardingQuestionOption";
|
||||
export * from "./boardOnboardingRead";
|
||||
export * from "./boardOnboardingReadDraftGoal";
|
||||
export * from "./boardOnboardingReadMessages";
|
||||
export * from "./boardOnboardingStart";
|
||||
export * from "./boardRead";
|
||||
export * from "./boardReadSuccessMetrics";
|
||||
export * from "./boardUpdate";
|
||||
export * from "./boardUpdateSuccessMetrics";
|
||||
export * from "./confirmDeleteAgentApiV1AgentsAgentIdDeleteConfirmPost200";
|
||||
export * from "./confirmProvisionAgentApiV1AgentsAgentIdProvisionConfirmPost200";
|
||||
export * from "./dashboardKpis";
|
||||
export * from "./dashboardMetrics";
|
||||
export * from "./dashboardMetricsApiV1MetricsDashboardGetParams";
|
||||
export * from "./dashboardMetricsApiV1MetricsDashboardGetRange";
|
||||
export * from "./dashboardMetricsRange";
|
||||
export * from "./dashboardRangeSeries";
|
||||
export * from "./dashboardRangeSeriesBucket";
|
||||
export * from "./dashboardRangeSeriesRange";
|
||||
export * from "./dashboardSeriesPoint";
|
||||
export * from "./dashboardSeriesSet";
|
||||
export * from "./dashboardWipPoint";
|
||||
export * from "./dashboardWipRangeSeries";
|
||||
export * from "./dashboardWipRangeSeriesBucket";
|
||||
export * from "./dashboardWipRangeSeriesRange";
|
||||
export * from "./dashboardWipSeriesSet";
|
||||
export * from "./deleteAgentApiV1AgentsAgentIdDelete200";
|
||||
export * from "./deleteBoardApiV1BoardsBoardIdDelete200";
|
||||
export * from "./deleteTaskApiV1BoardsBoardIdTasksTaskIdDelete200";
|
||||
export * from "./gatewayCommandsApiV1GatewayCommandsGet200";
|
||||
export * from "./gatewayCommandsResponse";
|
||||
export * from "./gatewayCreate";
|
||||
export * from "./gatewayRead";
|
||||
export * from "./gatewaySessionHistoryResponse";
|
||||
export * from "./gatewaySessionMessageRequest";
|
||||
export * from "./gatewaySessionResponse";
|
||||
export * from "./gatewaySessionsResponse";
|
||||
export * from "./gatewaysStatusApiV1GatewaysStatusGetParams";
|
||||
export * from "./gatewaysStatusResponse";
|
||||
export * from "./gatewayStatusApiV1GatewayStatusGet200";
|
||||
export * from "./gatewayStatusApiV1GatewayStatusGetParams";
|
||||
export * from "./gatewayUpdate";
|
||||
export * from "./getGatewaySessionApiV1GatewaySessionsSessionIdGet200";
|
||||
export * from "./getGatewaySessionApiV1GatewaySessionsSessionIdGetParams";
|
||||
export * from "./getGatewaySessionApiV1GatewaysSessionsSessionIdGetParams";
|
||||
export * from "./getSessionHistoryApiV1GatewaySessionsSessionIdHistoryGet200";
|
||||
export * from "./getSessionHistoryApiV1GatewaySessionsSessionIdHistoryGetParams";
|
||||
export * from "./getSessionHistoryApiV1GatewaysSessionsSessionIdHistoryGetParams";
|
||||
export * from "./healthHealthGet200";
|
||||
export * from "./healthzHealthzGet200";
|
||||
export * from "./hTTPValidationError";
|
||||
export * from "./listActivityApiV1ActivityGetParams";
|
||||
export * from "./listAgentsApiV1AgentAgentsGetParams";
|
||||
export * from "./listApprovalsApiV1AgentBoardsBoardIdApprovalsGetParams";
|
||||
export * from "./listApprovalsApiV1BoardsBoardIdApprovalsGetParams";
|
||||
export * from "./listBoardMemoryApiV1AgentBoardsBoardIdMemoryGetParams";
|
||||
export * from "./listBoardMemoryApiV1BoardsBoardIdMemoryGetParams";
|
||||
export * from "./listGatewaySessionsApiV1GatewaysSessionsGetParams";
|
||||
export * from "./listSessionsApiV1GatewaySessionsGet200";
|
||||
export * from "./listSessionsApiV1GatewaySessionsGetParams";
|
||||
export * from "./listTasksApiV1AgentBoardsBoardIdTasksGetParams";
|
||||
export * from "./listTasksApiV1BoardsBoardIdTasksGetParams";
|
||||
export * from "./okResponse";
|
||||
export * from "./readyzReadyzGet200";
|
||||
export * from "./sendGatewaySessionMessageApiV1GatewaysSessionsSessionIdMessagePostParams";
|
||||
export * from "./sendSessionMessageApiV1GatewaySessionsSessionIdMessagePost200";
|
||||
export * from "./sendSessionMessageApiV1GatewaySessionsSessionIdMessagePostBody";
|
||||
export * from "./sendSessionMessageApiV1GatewaySessionsSessionIdMessagePostParams";
|
||||
export * from "./streamAgentsApiV1AgentsStreamGetParams";
|
||||
export * from "./streamApprovalsApiV1BoardsBoardIdApprovalsStreamGetParams";
|
||||
export * from "./streamBoardMemoryApiV1BoardsBoardIdMemoryStreamGetParams";
|
||||
export * from "./streamTasksApiV1BoardsBoardIdTasksStreamGetParams";
|
||||
export * from "./taskCommentCreate";
|
||||
export * from "./taskCommentRead";
|
||||
export * from "./taskCreate";
|
||||
export * from "./taskCreateStatus";
|
||||
export * from "./taskRead";
|
||||
export * from "./taskReadStatus";
|
||||
export * from "./taskUpdate";
|
||||
export * from "./updateAgentApiV1AgentsAgentIdPatchParams";
|
||||
export * from "./userRead";
|
||||
export * from "./userUpdate";
|
||||
export * from "./validationError";
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type ListAgentsApiV1AgentAgentsGetParams = {
|
||||
board_id?: string | null;
|
||||
limit?: number | null;
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type ListApprovalsApiV1AgentBoardsBoardIdApprovalsGetParams = {
|
||||
status?: "pending" | "approved" | "rejected" | null;
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type ListApprovalsApiV1BoardsBoardIdApprovalsGetParams = {
|
||||
status?: "pending" | "approved" | "rejected" | null;
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type ListBoardMemoryApiV1AgentBoardsBoardIdMemoryGetParams = {
|
||||
/**
|
||||
* @minimum 1
|
||||
* @maximum 200
|
||||
*/
|
||||
limit?: number;
|
||||
/**
|
||||
* @minimum 0
|
||||
*/
|
||||
offset?: number;
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type ListBoardMemoryApiV1BoardsBoardIdMemoryGetParams = {
|
||||
/**
|
||||
* @minimum 1
|
||||
* @maximum 200
|
||||
*/
|
||||
limit?: number;
|
||||
/**
|
||||
* @minimum 0
|
||||
*/
|
||||
offset?: number;
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type ListGatewaySessionsApiV1GatewaysSessionsGetParams = {
|
||||
board_id?: string | null;
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type ListTasksApiV1AgentBoardsBoardIdTasksGetParams = {
|
||||
status?: string | null;
|
||||
assigned_agent_id?: string | null;
|
||||
unassigned?: boolean | null;
|
||||
limit?: number | null;
|
||||
};
|
||||
10
frontend/src/api/generated/model/okResponse.ts
Normal file
10
frontend/src/api/generated/model/okResponse.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface OkResponse {
|
||||
ok?: boolean;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type SendGatewaySessionMessageApiV1GatewaysSessionsSessionIdMessagePostParams =
|
||||
{
|
||||
board_id?: string | null;
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type StreamAgentsApiV1AgentsStreamGetParams = {
|
||||
board_id?: string | null;
|
||||
since?: string | null;
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type StreamApprovalsApiV1BoardsBoardIdApprovalsStreamGetParams = {
|
||||
since?: string | null;
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type StreamBoardMemoryApiV1BoardsBoardIdMemoryStreamGetParams = {
|
||||
since?: string | null;
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type StreamTasksApiV1BoardsBoardIdTasksStreamGetParams = {
|
||||
since?: string | null;
|
||||
};
|
||||
@@ -6,5 +6,6 @@
|
||||
*/
|
||||
|
||||
export interface TaskCommentCreate {
|
||||
/** @minLength 1 */
|
||||
message: string;
|
||||
}
|
||||
|
||||
@@ -4,11 +4,12 @@
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { TaskCreateStatus } from "./taskCreateStatus";
|
||||
|
||||
export interface TaskCreate {
|
||||
title: string;
|
||||
description?: string | null;
|
||||
status?: string;
|
||||
status?: TaskCreateStatus;
|
||||
priority?: string;
|
||||
due_at?: string | null;
|
||||
assigned_agent_id?: string | null;
|
||||
|
||||
16
frontend/src/api/generated/model/taskCreateStatus.ts
Normal file
16
frontend/src/api/generated/model/taskCreateStatus.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type TaskCreateStatus =
|
||||
(typeof TaskCreateStatus)[keyof typeof TaskCreateStatus];
|
||||
|
||||
export const TaskCreateStatus = {
|
||||
inbox: "inbox",
|
||||
in_progress: "in_progress",
|
||||
review: "review",
|
||||
done: "done",
|
||||
} as const;
|
||||
@@ -4,11 +4,12 @@
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { TaskReadStatus } from "./taskReadStatus";
|
||||
|
||||
export interface TaskRead {
|
||||
title: string;
|
||||
description?: string | null;
|
||||
status?: string;
|
||||
status?: TaskReadStatus;
|
||||
priority?: string;
|
||||
due_at?: string | null;
|
||||
assigned_agent_id?: string | null;
|
||||
|
||||
16
frontend/src/api/generated/model/taskReadStatus.ts
Normal file
16
frontend/src/api/generated/model/taskReadStatus.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type TaskReadStatus =
|
||||
(typeof TaskReadStatus)[keyof typeof TaskReadStatus];
|
||||
|
||||
export const TaskReadStatus = {
|
||||
inbox: "inbox",
|
||||
in_progress: "in_progress",
|
||||
review: "review",
|
||||
done: "done",
|
||||
} as const;
|
||||
@@ -8,7 +8,7 @@
|
||||
export interface TaskUpdate {
|
||||
title?: string | null;
|
||||
description?: string | null;
|
||||
status?: string | null;
|
||||
status?: "inbox" | "in_progress" | "review" | "done" | null;
|
||||
priority?: string | null;
|
||||
due_at?: string | null;
|
||||
assigned_agent_id?: string | null;
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* Mission Control API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type UpdateAgentApiV1AgentsAgentIdPatchParams = {
|
||||
force?: boolean;
|
||||
};
|
||||
@@ -21,9 +21,10 @@ import type {
|
||||
} from "@tanstack/react-query";
|
||||
|
||||
import type {
|
||||
DeleteTaskApiV1BoardsBoardIdTasksTaskIdDelete200,
|
||||
HTTPValidationError,
|
||||
ListTasksApiV1BoardsBoardIdTasksGetParams,
|
||||
OkResponse,
|
||||
StreamTasksApiV1BoardsBoardIdTasksStreamGetParams,
|
||||
TaskCommentCreate,
|
||||
TaskCommentRead,
|
||||
TaskCreate,
|
||||
@@ -35,6 +36,258 @@ import { customFetch } from "../../mutator";
|
||||
|
||||
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
||||
|
||||
/**
|
||||
* @summary Stream Tasks
|
||||
*/
|
||||
export type streamTasksApiV1BoardsBoardIdTasksStreamGetResponse200 = {
|
||||
data: unknown;
|
||||
status: 200;
|
||||
};
|
||||
|
||||
export type streamTasksApiV1BoardsBoardIdTasksStreamGetResponse422 = {
|
||||
data: HTTPValidationError;
|
||||
status: 422;
|
||||
};
|
||||
|
||||
export type streamTasksApiV1BoardsBoardIdTasksStreamGetResponseSuccess =
|
||||
streamTasksApiV1BoardsBoardIdTasksStreamGetResponse200 & {
|
||||
headers: Headers;
|
||||
};
|
||||
export type streamTasksApiV1BoardsBoardIdTasksStreamGetResponseError =
|
||||
streamTasksApiV1BoardsBoardIdTasksStreamGetResponse422 & {
|
||||
headers: Headers;
|
||||
};
|
||||
|
||||
export type streamTasksApiV1BoardsBoardIdTasksStreamGetResponse =
|
||||
| streamTasksApiV1BoardsBoardIdTasksStreamGetResponseSuccess
|
||||
| streamTasksApiV1BoardsBoardIdTasksStreamGetResponseError;
|
||||
|
||||
export const getStreamTasksApiV1BoardsBoardIdTasksStreamGetUrl = (
|
||||
boardId: string,
|
||||
params?: StreamTasksApiV1BoardsBoardIdTasksStreamGetParams,
|
||||
) => {
|
||||
const normalizedParams = new URLSearchParams();
|
||||
|
||||
Object.entries(params || {}).forEach(([key, value]) => {
|
||||
if (value !== undefined) {
|
||||
normalizedParams.append(key, value === null ? "null" : value.toString());
|
||||
}
|
||||
});
|
||||
|
||||
const stringifiedParams = normalizedParams.toString();
|
||||
|
||||
return stringifiedParams.length > 0
|
||||
? `/api/v1/boards/${boardId}/tasks/stream?${stringifiedParams}`
|
||||
: `/api/v1/boards/${boardId}/tasks/stream`;
|
||||
};
|
||||
|
||||
export const streamTasksApiV1BoardsBoardIdTasksStreamGet = async (
|
||||
boardId: string,
|
||||
params?: StreamTasksApiV1BoardsBoardIdTasksStreamGetParams,
|
||||
options?: RequestInit,
|
||||
): Promise<streamTasksApiV1BoardsBoardIdTasksStreamGetResponse> => {
|
||||
return customFetch<streamTasksApiV1BoardsBoardIdTasksStreamGetResponse>(
|
||||
getStreamTasksApiV1BoardsBoardIdTasksStreamGetUrl(boardId, params),
|
||||
{
|
||||
...options,
|
||||
method: "GET",
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
export const getStreamTasksApiV1BoardsBoardIdTasksStreamGetQueryKey = (
|
||||
boardId: string,
|
||||
params?: StreamTasksApiV1BoardsBoardIdTasksStreamGetParams,
|
||||
) => {
|
||||
return [
|
||||
`/api/v1/boards/${boardId}/tasks/stream`,
|
||||
...(params ? [params] : []),
|
||||
] as const;
|
||||
};
|
||||
|
||||
export const getStreamTasksApiV1BoardsBoardIdTasksStreamGetQueryOptions = <
|
||||
TData = Awaited<
|
||||
ReturnType<typeof streamTasksApiV1BoardsBoardIdTasksStreamGet>
|
||||
>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
boardId: string,
|
||||
params?: StreamTasksApiV1BoardsBoardIdTasksStreamGetParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof streamTasksApiV1BoardsBoardIdTasksStreamGet>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
) => {
|
||||
const { query: queryOptions, request: requestOptions } = options ?? {};
|
||||
|
||||
const queryKey =
|
||||
queryOptions?.queryKey ??
|
||||
getStreamTasksApiV1BoardsBoardIdTasksStreamGetQueryKey(boardId, params);
|
||||
|
||||
const queryFn: QueryFunction<
|
||||
Awaited<ReturnType<typeof streamTasksApiV1BoardsBoardIdTasksStreamGet>>
|
||||
> = ({ signal }) =>
|
||||
streamTasksApiV1BoardsBoardIdTasksStreamGet(boardId, params, {
|
||||
signal,
|
||||
...requestOptions,
|
||||
});
|
||||
|
||||
return {
|
||||
queryKey,
|
||||
queryFn,
|
||||
enabled: !!boardId,
|
||||
...queryOptions,
|
||||
} as UseQueryOptions<
|
||||
Awaited<ReturnType<typeof streamTasksApiV1BoardsBoardIdTasksStreamGet>>,
|
||||
TError,
|
||||
TData
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
};
|
||||
|
||||
export type StreamTasksApiV1BoardsBoardIdTasksStreamGetQueryResult =
|
||||
NonNullable<
|
||||
Awaited<ReturnType<typeof streamTasksApiV1BoardsBoardIdTasksStreamGet>>
|
||||
>;
|
||||
export type StreamTasksApiV1BoardsBoardIdTasksStreamGetQueryError =
|
||||
HTTPValidationError;
|
||||
|
||||
export function useStreamTasksApiV1BoardsBoardIdTasksStreamGet<
|
||||
TData = Awaited<
|
||||
ReturnType<typeof streamTasksApiV1BoardsBoardIdTasksStreamGet>
|
||||
>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
boardId: string,
|
||||
params: undefined | StreamTasksApiV1BoardsBoardIdTasksStreamGetParams,
|
||||
options: {
|
||||
query: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof streamTasksApiV1BoardsBoardIdTasksStreamGet>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
> &
|
||||
Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<
|
||||
ReturnType<typeof streamTasksApiV1BoardsBoardIdTasksStreamGet>
|
||||
>,
|
||||
TError,
|
||||
Awaited<
|
||||
ReturnType<typeof streamTasksApiV1BoardsBoardIdTasksStreamGet>
|
||||
>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): DefinedUseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useStreamTasksApiV1BoardsBoardIdTasksStreamGet<
|
||||
TData = Awaited<
|
||||
ReturnType<typeof streamTasksApiV1BoardsBoardIdTasksStreamGet>
|
||||
>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
boardId: string,
|
||||
params?: StreamTasksApiV1BoardsBoardIdTasksStreamGetParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof streamTasksApiV1BoardsBoardIdTasksStreamGet>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
> &
|
||||
Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<
|
||||
ReturnType<typeof streamTasksApiV1BoardsBoardIdTasksStreamGet>
|
||||
>,
|
||||
TError,
|
||||
Awaited<
|
||||
ReturnType<typeof streamTasksApiV1BoardsBoardIdTasksStreamGet>
|
||||
>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useStreamTasksApiV1BoardsBoardIdTasksStreamGet<
|
||||
TData = Awaited<
|
||||
ReturnType<typeof streamTasksApiV1BoardsBoardIdTasksStreamGet>
|
||||
>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
boardId: string,
|
||||
params?: StreamTasksApiV1BoardsBoardIdTasksStreamGetParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof streamTasksApiV1BoardsBoardIdTasksStreamGet>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
/**
|
||||
* @summary Stream Tasks
|
||||
*/
|
||||
|
||||
export function useStreamTasksApiV1BoardsBoardIdTasksStreamGet<
|
||||
TData = Awaited<
|
||||
ReturnType<typeof streamTasksApiV1BoardsBoardIdTasksStreamGet>
|
||||
>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
boardId: string,
|
||||
params?: StreamTasksApiV1BoardsBoardIdTasksStreamGetParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof streamTasksApiV1BoardsBoardIdTasksStreamGet>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
} {
|
||||
const queryOptions =
|
||||
getStreamTasksApiV1BoardsBoardIdTasksStreamGetQueryOptions(
|
||||
boardId,
|
||||
params,
|
||||
options,
|
||||
);
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
|
||||
TData,
|
||||
TError
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
return { ...query, queryKey: queryOptions.queryKey };
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary List Tasks
|
||||
*/
|
||||
@@ -521,7 +774,7 @@ export const useUpdateTaskApiV1BoardsBoardIdTasksTaskIdPatch = <
|
||||
* @summary Delete Task
|
||||
*/
|
||||
export type deleteTaskApiV1BoardsBoardIdTasksTaskIdDeleteResponse200 = {
|
||||
data: DeleteTaskApiV1BoardsBoardIdTasksTaskIdDelete200;
|
||||
data: OkResponse;
|
||||
status: 200;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,3 +1,38 @@
|
||||
type ClerkSession = {
|
||||
getToken: () => Promise<string>;
|
||||
};
|
||||
|
||||
type ClerkGlobal = {
|
||||
session?: ClerkSession | null;
|
||||
};
|
||||
|
||||
export class ApiError<TData = unknown> extends Error {
|
||||
status: number;
|
||||
data: TData | null;
|
||||
|
||||
constructor(status: number, message: string, data: TData | null) {
|
||||
super(message);
|
||||
this.name = "ApiError";
|
||||
this.status = status;
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
|
||||
const resolveClerkToken = async (): Promise<string | null> => {
|
||||
if (typeof window === "undefined") {
|
||||
return null;
|
||||
}
|
||||
const clerk = (window as unknown as { Clerk?: ClerkGlobal }).Clerk;
|
||||
if (!clerk?.session) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return await clerk.session.getToken();
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
export const customFetch = async <T>(
|
||||
url: string,
|
||||
options: RequestInit
|
||||
@@ -7,21 +42,73 @@ export const customFetch = async <T>(
|
||||
throw new Error("NEXT_PUBLIC_API_URL is not set.");
|
||||
}
|
||||
const baseUrl = rawBaseUrl.replace(/\/+$/, "");
|
||||
|
||||
const headers = new Headers(options.headers);
|
||||
const hasBody = options.body !== undefined && options.body !== null;
|
||||
if (hasBody && !headers.has("Content-Type")) {
|
||||
headers.set("Content-Type", "application/json");
|
||||
}
|
||||
if (!headers.has("Authorization")) {
|
||||
const token = await resolveClerkToken();
|
||||
if (token) {
|
||||
headers.set("Authorization", `Bearer ${token}`);
|
||||
}
|
||||
}
|
||||
|
||||
const response = await fetch(`${baseUrl}${url}`, {
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...(options.headers ?? {}),
|
||||
},
|
||||
headers,
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Request failed");
|
||||
const contentType = response.headers.get("content-type") ?? "";
|
||||
let errorData: unknown = null;
|
||||
const isJson =
|
||||
contentType.includes("application/json") || contentType.includes("+json");
|
||||
if (isJson) {
|
||||
errorData = (await response.json().catch(() => null)) as unknown;
|
||||
} else {
|
||||
errorData = await response.text().catch(() => "");
|
||||
}
|
||||
|
||||
let message =
|
||||
typeof errorData === "string" && errorData ? errorData : "Request failed";
|
||||
if (errorData && typeof errorData === "object") {
|
||||
const detail = (errorData as { detail?: unknown }).detail;
|
||||
if (typeof detail === "string" && detail) {
|
||||
message = detail;
|
||||
} else if (Array.isArray(detail) && detail.length) {
|
||||
const first = detail[0] as { msg?: unknown };
|
||||
if (first && typeof first === "object" && typeof first.msg === "string") {
|
||||
message = first.msg;
|
||||
}
|
||||
}
|
||||
}
|
||||
throw new ApiError(response.status, message, errorData);
|
||||
}
|
||||
|
||||
if (response.status === 204) {
|
||||
return undefined as T;
|
||||
return {
|
||||
data: undefined,
|
||||
status: response.status,
|
||||
headers: response.headers,
|
||||
} as T;
|
||||
}
|
||||
|
||||
return (await response.json()) as T;
|
||||
const contentType = response.headers.get("content-type") ?? "";
|
||||
const isJson =
|
||||
contentType.includes("application/json") || contentType.includes("+json");
|
||||
if (isJson) {
|
||||
const data = (await response.json()) as unknown;
|
||||
return { data, status: response.status, headers: response.headers } as T;
|
||||
}
|
||||
if (contentType.includes("text/event-stream")) {
|
||||
return {
|
||||
data: response,
|
||||
status: response.status,
|
||||
headers: response.headers,
|
||||
} as T;
|
||||
}
|
||||
const text = await response.text().catch(() => "");
|
||||
return { data: text, status: response.status, headers: response.headers } as T;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user