chore(frontend): add generated files/queries to Git (#10281)

## Changes 🏗️

We want to make running the AutoGPT Front-end as easy as possible. For
that, you should be able to run it with the least amount of commands.

We recently added generated queries and types on the Front-end from the
Back-end OpenAPI schema, to make development easier and catch bugs
earlier. However, with the current setup, developers are forced to run
`pnpm generate:api-all` with the Back-end running, which is annoying.

After this PR, the Front-end can be rerun with just `pnpm i & pnpm dev`.

## Checklist 📋

### For code changes

- [x] I have clearly listed my changes in the PR description
- [x] I have made a test plan
- [x] I have tested my changes according to the test plan:
  - [x] Run the Front-end with just `pnpm dev` and it works

---------

Co-authored-by: Abhimanyu Yadav <122007096+Abhi1992002@users.noreply.github.com>
This commit is contained in:
Ubbe
2025-07-01 10:01:05 +04:00
committed by GitHub
parent 254bb6236f
commit a33d58dd33
315 changed files with 19650 additions and 30 deletions

View File

@@ -55,9 +55,6 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Generate API client
run: pnpm generate:api-client
- name: Run tsc check
run: pnpm type-check

3
.gitignore vendored
View File

@@ -177,6 +177,3 @@ autogpt_platform/backend/settings.py
*.ign.*
.test-contents
.claude/settings.local.json
# Auto generated client
autogpt_platform/frontend/src/app/api/__generated__

View File

@@ -71,6 +71,9 @@ This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-opti
## 🔄 Data Fetching Strategy
> [!NOTE]
> You don't need to run the OpenAPI commands below to run the Front-end. You will only need to run them when adding or modifying endpoints on the Backend API and wanting to use those on the Frontend.
This project uses an auto-generated API client powered by [**Orval**](https://orval.dev/), which creates type-safe API clients from OpenAPI specifications.
### How It Works

View File

@@ -16,11 +16,6 @@ export default defineConfig({
client: "react-query",
httpClient: "fetch",
indexFiles: false,
mock: {
type: "msw",
delay: 1000, // artifical latency
generateEachHttpStatus: true, // helps us test error-handling scenarios and generate mocks for all HTTP statuses
},
override: {
mutator: {
path: "./mutators/custom-mutator.ts",
@@ -45,23 +40,23 @@ export default defineConfig({
afterAllFilesWrite: "prettier --write",
},
},
autogpt_zod_schema: {
input: {
target: `./src/app/api/openapi.json`,
override: {
transformer: "./src/app/api/transformers/fix-tags.mjs",
},
},
output: {
workspace: "./src/app/api",
target: `./__generated__/zod-schema`,
schemas: "./__generated__/models",
mode: "tags-split",
client: "zod",
indexFiles: false,
},
hooks: {
afterAllFilesWrite: "prettier --write",
},
},
// autogpt_zod_schema: {
// input: {
// target: `./src/app/api/openapi.json`,
// override: {
// transformer: "./src/app/api/transformers/fix-tags.mjs",
// },
// },
// output: {
// workspace: "./src/app/api",
// target: `./__generated__/zod-schema`,
// schemas: "./__generated__/models",
// mode: "tags-split",
// client: "zod",
// indexFiles: false,
// },
// hooks: {
// afterAllFilesWrite: "prettier --write",
// },
// },
});

View File

@@ -0,0 +1,931 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
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 { AddUserCreditsResponse } from "../../models/addUserCreditsResponse";
import type { BodyPostV2AddCreditsToUser } from "../../models/bodyPostV2AddCreditsToUser";
import type { GetV2GetAdminListingsHistoryParams } from "../../models/getV2GetAdminListingsHistoryParams";
import type { GetV2GetAllUsersHistoryParams } from "../../models/getV2GetAllUsersHistoryParams";
import type { HTTPValidationError } from "../../models/hTTPValidationError";
import type { ReviewSubmissionRequest } from "../../models/reviewSubmissionRequest";
import type { StoreListingsWithVersionsResponse } from "../../models/storeListingsWithVersionsResponse";
import type { StoreSubmission } from "../../models/storeSubmission";
import type { UserHistoryResponse } from "../../models/userHistoryResponse";
import { customMutator } from "../../../mutators/custom-mutator";
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
/**
* Get store listings with their version history for admins.
This provides a consolidated view of listings with their versions,
allowing for an expandable UI in the admin dashboard.
Args:
status: Filter by submission status (PENDING, APPROVED, REJECTED)
search: Search by name, description, or user email
page: Page number for pagination
page_size: Number of items per page
Returns:
StoreListingsWithVersionsResponse with listings and their versions
* @summary Get Admin Listings History
*/
export type getV2GetAdminListingsHistoryResponse200 = {
data: StoreListingsWithVersionsResponse;
status: 200;
};
export type getV2GetAdminListingsHistoryResponse422 = {
data: HTTPValidationError;
status: 422;
};
export type getV2GetAdminListingsHistoryResponseComposite =
| getV2GetAdminListingsHistoryResponse200
| getV2GetAdminListingsHistoryResponse422;
export type getV2GetAdminListingsHistoryResponse =
getV2GetAdminListingsHistoryResponseComposite & {
headers: Headers;
};
export const getGetV2GetAdminListingsHistoryUrl = (
params?: GetV2GetAdminListingsHistoryParams,
) => {
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/store/admin/listings?${stringifiedParams}`
: `/api/store/admin/listings`;
};
export const getV2GetAdminListingsHistory = async (
params?: GetV2GetAdminListingsHistoryParams,
options?: RequestInit,
): Promise<getV2GetAdminListingsHistoryResponse> => {
return customMutator<getV2GetAdminListingsHistoryResponse>(
getGetV2GetAdminListingsHistoryUrl(params),
{
...options,
method: "GET",
},
);
};
export const getGetV2GetAdminListingsHistoryQueryKey = (
params?: GetV2GetAdminListingsHistoryParams,
) => {
return [`/api/store/admin/listings`, ...(params ? [params] : [])] as const;
};
export const getGetV2GetAdminListingsHistoryQueryOptions = <
TData = Awaited<ReturnType<typeof getV2GetAdminListingsHistory>>,
TError = HTTPValidationError,
>(
params?: GetV2GetAdminListingsHistoryParams,
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV2GetAdminListingsHistory>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
) => {
const { query: queryOptions, request: requestOptions } = options ?? {};
const queryKey =
queryOptions?.queryKey ?? getGetV2GetAdminListingsHistoryQueryKey(params);
const queryFn: QueryFunction<
Awaited<ReturnType<typeof getV2GetAdminListingsHistory>>
> = ({ signal }) =>
getV2GetAdminListingsHistory(params, { signal, ...requestOptions });
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
Awaited<ReturnType<typeof getV2GetAdminListingsHistory>>,
TError,
TData
> & { queryKey: DataTag<QueryKey, TData, TError> };
};
export type GetV2GetAdminListingsHistoryQueryResult = NonNullable<
Awaited<ReturnType<typeof getV2GetAdminListingsHistory>>
>;
export type GetV2GetAdminListingsHistoryQueryError = HTTPValidationError;
export function useGetV2GetAdminListingsHistory<
TData = Awaited<ReturnType<typeof getV2GetAdminListingsHistory>>,
TError = HTTPValidationError,
>(
params: undefined | GetV2GetAdminListingsHistoryParams,
options: {
query: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV2GetAdminListingsHistory>>,
TError,
TData
>
> &
Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getV2GetAdminListingsHistory>>,
TError,
Awaited<ReturnType<typeof getV2GetAdminListingsHistory>>
>,
"initialData"
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetV2GetAdminListingsHistory<
TData = Awaited<ReturnType<typeof getV2GetAdminListingsHistory>>,
TError = HTTPValidationError,
>(
params?: GetV2GetAdminListingsHistoryParams,
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV2GetAdminListingsHistory>>,
TError,
TData
>
> &
Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getV2GetAdminListingsHistory>>,
TError,
Awaited<ReturnType<typeof getV2GetAdminListingsHistory>>
>,
"initialData"
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetV2GetAdminListingsHistory<
TData = Awaited<ReturnType<typeof getV2GetAdminListingsHistory>>,
TError = HTTPValidationError,
>(
params?: GetV2GetAdminListingsHistoryParams,
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV2GetAdminListingsHistory>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
/**
* @summary Get Admin Listings History
*/
export function useGetV2GetAdminListingsHistory<
TData = Awaited<ReturnType<typeof getV2GetAdminListingsHistory>>,
TError = HTTPValidationError,
>(
params?: GetV2GetAdminListingsHistoryParams,
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV2GetAdminListingsHistory>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
} {
const queryOptions = getGetV2GetAdminListingsHistoryQueryOptions(
params,
options,
);
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
TData,
TError
> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey;
return query;
}
/**
* Review a store listing submission.
Args:
store_listing_version_id: ID of the submission to review
request: Review details including approval status and comments
user: Authenticated admin user performing the review
Returns:
StoreSubmission with updated review information
* @summary Review Store Submission
*/
export type postV2ReviewStoreSubmissionResponse200 = {
data: StoreSubmission;
status: 200;
};
export type postV2ReviewStoreSubmissionResponse422 = {
data: HTTPValidationError;
status: 422;
};
export type postV2ReviewStoreSubmissionResponseComposite =
| postV2ReviewStoreSubmissionResponse200
| postV2ReviewStoreSubmissionResponse422;
export type postV2ReviewStoreSubmissionResponse =
postV2ReviewStoreSubmissionResponseComposite & {
headers: Headers;
};
export const getPostV2ReviewStoreSubmissionUrl = (
storeListingVersionId: string,
) => {
return `/api/store/admin/submissions/${storeListingVersionId}/review`;
};
export const postV2ReviewStoreSubmission = async (
storeListingVersionId: string,
reviewSubmissionRequest: ReviewSubmissionRequest,
options?: RequestInit,
): Promise<postV2ReviewStoreSubmissionResponse> => {
return customMutator<postV2ReviewStoreSubmissionResponse>(
getPostV2ReviewStoreSubmissionUrl(storeListingVersionId),
{
...options,
method: "POST",
headers: { "Content-Type": "application/json", ...options?.headers },
body: JSON.stringify(reviewSubmissionRequest),
},
);
};
export const getPostV2ReviewStoreSubmissionMutationOptions = <
TError = HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV2ReviewStoreSubmission>>,
TError,
{ storeListingVersionId: string; data: ReviewSubmissionRequest },
TContext
>;
request?: SecondParameter<typeof customMutator>;
}): UseMutationOptions<
Awaited<ReturnType<typeof postV2ReviewStoreSubmission>>,
TError,
{ storeListingVersionId: string; data: ReviewSubmissionRequest },
TContext
> => {
const mutationKey = ["postV2ReviewStoreSubmission"];
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 postV2ReviewStoreSubmission>>,
{ storeListingVersionId: string; data: ReviewSubmissionRequest }
> = (props) => {
const { storeListingVersionId, data } = props ?? {};
return postV2ReviewStoreSubmission(
storeListingVersionId,
data,
requestOptions,
);
};
return { mutationFn, ...mutationOptions };
};
export type PostV2ReviewStoreSubmissionMutationResult = NonNullable<
Awaited<ReturnType<typeof postV2ReviewStoreSubmission>>
>;
export type PostV2ReviewStoreSubmissionMutationBody = ReviewSubmissionRequest;
export type PostV2ReviewStoreSubmissionMutationError = HTTPValidationError;
/**
* @summary Review Store Submission
*/
export const usePostV2ReviewStoreSubmission = <
TError = HTTPValidationError,
TContext = unknown,
>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV2ReviewStoreSubmission>>,
TError,
{ storeListingVersionId: string; data: ReviewSubmissionRequest },
TContext
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof postV2ReviewStoreSubmission>>,
TError,
{ storeListingVersionId: string; data: ReviewSubmissionRequest },
TContext
> => {
const mutationOptions =
getPostV2ReviewStoreSubmissionMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};
/**
* Download the agent file by streaming its content.
Args:
store_listing_version_id (str): The ID of the agent to download
Returns:
StreamingResponse: A streaming response containing the agent's graph data.
Raises:
HTTPException: If the agent is not found or an unexpected error occurs.
* @summary Admin Download Agent File
*/
export type getV2AdminDownloadAgentFileResponse200 = {
data: unknown;
status: 200;
};
export type getV2AdminDownloadAgentFileResponse422 = {
data: HTTPValidationError;
status: 422;
};
export type getV2AdminDownloadAgentFileResponseComposite =
| getV2AdminDownloadAgentFileResponse200
| getV2AdminDownloadAgentFileResponse422;
export type getV2AdminDownloadAgentFileResponse =
getV2AdminDownloadAgentFileResponseComposite & {
headers: Headers;
};
export const getGetV2AdminDownloadAgentFileUrl = (
storeListingVersionId: string,
) => {
return `/api/store/admin/submissions/download/${storeListingVersionId}`;
};
export const getV2AdminDownloadAgentFile = async (
storeListingVersionId: string,
options?: RequestInit,
): Promise<getV2AdminDownloadAgentFileResponse> => {
return customMutator<getV2AdminDownloadAgentFileResponse>(
getGetV2AdminDownloadAgentFileUrl(storeListingVersionId),
{
...options,
method: "GET",
},
);
};
export const getGetV2AdminDownloadAgentFileQueryKey = (
storeListingVersionId: string,
) => {
return [
`/api/store/admin/submissions/download/${storeListingVersionId}`,
] as const;
};
export const getGetV2AdminDownloadAgentFileQueryOptions = <
TData = Awaited<ReturnType<typeof getV2AdminDownloadAgentFile>>,
TError = HTTPValidationError,
>(
storeListingVersionId: string,
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV2AdminDownloadAgentFile>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
) => {
const { query: queryOptions, request: requestOptions } = options ?? {};
const queryKey =
queryOptions?.queryKey ??
getGetV2AdminDownloadAgentFileQueryKey(storeListingVersionId);
const queryFn: QueryFunction<
Awaited<ReturnType<typeof getV2AdminDownloadAgentFile>>
> = ({ signal }) =>
getV2AdminDownloadAgentFile(storeListingVersionId, {
signal,
...requestOptions,
});
return {
queryKey,
queryFn,
enabled: !!storeListingVersionId,
...queryOptions,
} as UseQueryOptions<
Awaited<ReturnType<typeof getV2AdminDownloadAgentFile>>,
TError,
TData
> & { queryKey: DataTag<QueryKey, TData, TError> };
};
export type GetV2AdminDownloadAgentFileQueryResult = NonNullable<
Awaited<ReturnType<typeof getV2AdminDownloadAgentFile>>
>;
export type GetV2AdminDownloadAgentFileQueryError = HTTPValidationError;
export function useGetV2AdminDownloadAgentFile<
TData = Awaited<ReturnType<typeof getV2AdminDownloadAgentFile>>,
TError = HTTPValidationError,
>(
storeListingVersionId: string,
options: {
query: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV2AdminDownloadAgentFile>>,
TError,
TData
>
> &
Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getV2AdminDownloadAgentFile>>,
TError,
Awaited<ReturnType<typeof getV2AdminDownloadAgentFile>>
>,
"initialData"
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetV2AdminDownloadAgentFile<
TData = Awaited<ReturnType<typeof getV2AdminDownloadAgentFile>>,
TError = HTTPValidationError,
>(
storeListingVersionId: string,
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV2AdminDownloadAgentFile>>,
TError,
TData
>
> &
Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getV2AdminDownloadAgentFile>>,
TError,
Awaited<ReturnType<typeof getV2AdminDownloadAgentFile>>
>,
"initialData"
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetV2AdminDownloadAgentFile<
TData = Awaited<ReturnType<typeof getV2AdminDownloadAgentFile>>,
TError = HTTPValidationError,
>(
storeListingVersionId: string,
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV2AdminDownloadAgentFile>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
/**
* @summary Admin Download Agent File
*/
export function useGetV2AdminDownloadAgentFile<
TData = Awaited<ReturnType<typeof getV2AdminDownloadAgentFile>>,
TError = HTTPValidationError,
>(
storeListingVersionId: string,
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV2AdminDownloadAgentFile>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
} {
const queryOptions = getGetV2AdminDownloadAgentFileQueryOptions(
storeListingVersionId,
options,
);
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
TData,
TError
> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey;
return query;
}
/**
* @summary Add Credits to User
*/
export type postV2AddCreditsToUserResponse200 = {
data: AddUserCreditsResponse;
status: 200;
};
export type postV2AddCreditsToUserResponse422 = {
data: HTTPValidationError;
status: 422;
};
export type postV2AddCreditsToUserResponseComposite =
| postV2AddCreditsToUserResponse200
| postV2AddCreditsToUserResponse422;
export type postV2AddCreditsToUserResponse =
postV2AddCreditsToUserResponseComposite & {
headers: Headers;
};
export const getPostV2AddCreditsToUserUrl = () => {
return `/api/credits/admin/add_credits`;
};
export const postV2AddCreditsToUser = async (
bodyPostV2AddCreditsToUser: BodyPostV2AddCreditsToUser,
options?: RequestInit,
): Promise<postV2AddCreditsToUserResponse> => {
return customMutator<postV2AddCreditsToUserResponse>(
getPostV2AddCreditsToUserUrl(),
{
...options,
method: "POST",
headers: { "Content-Type": "application/json", ...options?.headers },
body: JSON.stringify(bodyPostV2AddCreditsToUser),
},
);
};
export const getPostV2AddCreditsToUserMutationOptions = <
TError = HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV2AddCreditsToUser>>,
TError,
{ data: BodyPostV2AddCreditsToUser },
TContext
>;
request?: SecondParameter<typeof customMutator>;
}): UseMutationOptions<
Awaited<ReturnType<typeof postV2AddCreditsToUser>>,
TError,
{ data: BodyPostV2AddCreditsToUser },
TContext
> => {
const mutationKey = ["postV2AddCreditsToUser"];
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 postV2AddCreditsToUser>>,
{ data: BodyPostV2AddCreditsToUser }
> = (props) => {
const { data } = props ?? {};
return postV2AddCreditsToUser(data, requestOptions);
};
return { mutationFn, ...mutationOptions };
};
export type PostV2AddCreditsToUserMutationResult = NonNullable<
Awaited<ReturnType<typeof postV2AddCreditsToUser>>
>;
export type PostV2AddCreditsToUserMutationBody = BodyPostV2AddCreditsToUser;
export type PostV2AddCreditsToUserMutationError = HTTPValidationError;
/**
* @summary Add Credits to User
*/
export const usePostV2AddCreditsToUser = <
TError = HTTPValidationError,
TContext = unknown,
>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV2AddCreditsToUser>>,
TError,
{ data: BodyPostV2AddCreditsToUser },
TContext
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof postV2AddCreditsToUser>>,
TError,
{ data: BodyPostV2AddCreditsToUser },
TContext
> => {
const mutationOptions = getPostV2AddCreditsToUserMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};
/**
* @summary Get All Users History
*/
export type getV2GetAllUsersHistoryResponse200 = {
data: UserHistoryResponse;
status: 200;
};
export type getV2GetAllUsersHistoryResponse422 = {
data: HTTPValidationError;
status: 422;
};
export type getV2GetAllUsersHistoryResponseComposite =
| getV2GetAllUsersHistoryResponse200
| getV2GetAllUsersHistoryResponse422;
export type getV2GetAllUsersHistoryResponse =
getV2GetAllUsersHistoryResponseComposite & {
headers: Headers;
};
export const getGetV2GetAllUsersHistoryUrl = (
params?: GetV2GetAllUsersHistoryParams,
) => {
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/credits/admin/users_history?${stringifiedParams}`
: `/api/credits/admin/users_history`;
};
export const getV2GetAllUsersHistory = async (
params?: GetV2GetAllUsersHistoryParams,
options?: RequestInit,
): Promise<getV2GetAllUsersHistoryResponse> => {
return customMutator<getV2GetAllUsersHistoryResponse>(
getGetV2GetAllUsersHistoryUrl(params),
{
...options,
method: "GET",
},
);
};
export const getGetV2GetAllUsersHistoryQueryKey = (
params?: GetV2GetAllUsersHistoryParams,
) => {
return [
`/api/credits/admin/users_history`,
...(params ? [params] : []),
] as const;
};
export const getGetV2GetAllUsersHistoryQueryOptions = <
TData = Awaited<ReturnType<typeof getV2GetAllUsersHistory>>,
TError = HTTPValidationError,
>(
params?: GetV2GetAllUsersHistoryParams,
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV2GetAllUsersHistory>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
) => {
const { query: queryOptions, request: requestOptions } = options ?? {};
const queryKey =
queryOptions?.queryKey ?? getGetV2GetAllUsersHistoryQueryKey(params);
const queryFn: QueryFunction<
Awaited<ReturnType<typeof getV2GetAllUsersHistory>>
> = ({ signal }) =>
getV2GetAllUsersHistory(params, { signal, ...requestOptions });
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
Awaited<ReturnType<typeof getV2GetAllUsersHistory>>,
TError,
TData
> & { queryKey: DataTag<QueryKey, TData, TError> };
};
export type GetV2GetAllUsersHistoryQueryResult = NonNullable<
Awaited<ReturnType<typeof getV2GetAllUsersHistory>>
>;
export type GetV2GetAllUsersHistoryQueryError = HTTPValidationError;
export function useGetV2GetAllUsersHistory<
TData = Awaited<ReturnType<typeof getV2GetAllUsersHistory>>,
TError = HTTPValidationError,
>(
params: undefined | GetV2GetAllUsersHistoryParams,
options: {
query: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV2GetAllUsersHistory>>,
TError,
TData
>
> &
Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getV2GetAllUsersHistory>>,
TError,
Awaited<ReturnType<typeof getV2GetAllUsersHistory>>
>,
"initialData"
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetV2GetAllUsersHistory<
TData = Awaited<ReturnType<typeof getV2GetAllUsersHistory>>,
TError = HTTPValidationError,
>(
params?: GetV2GetAllUsersHistoryParams,
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV2GetAllUsersHistory>>,
TError,
TData
>
> &
Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getV2GetAllUsersHistory>>,
TError,
Awaited<ReturnType<typeof getV2GetAllUsersHistory>>
>,
"initialData"
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetV2GetAllUsersHistory<
TData = Awaited<ReturnType<typeof getV2GetAllUsersHistory>>,
TError = HTTPValidationError,
>(
params?: GetV2GetAllUsersHistoryParams,
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV2GetAllUsersHistory>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
/**
* @summary Get All Users History
*/
export function useGetV2GetAllUsersHistory<
TData = Awaited<ReturnType<typeof getV2GetAllUsersHistory>>,
TError = HTTPValidationError,
>(
params?: GetV2GetAllUsersHistoryParams,
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV2GetAllUsersHistory>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
} {
const queryOptions = getGetV2GetAllUsersHistoryQueryOptions(params, options);
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
TData,
TError
> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey;
return query;
}

View File

@@ -0,0 +1,245 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import { useMutation } from "@tanstack/react-query";
import type {
MutationFunction,
QueryClient,
UseMutationOptions,
UseMutationResult,
} from "@tanstack/react-query";
import type { BodyPostV1LogRawAnalytics } from "../../models/bodyPostV1LogRawAnalytics";
import type { HTTPValidationError } from "../../models/hTTPValidationError";
import type { LogRawMetricRequest } from "../../models/logRawMetricRequest";
import { customMutator } from "../../../mutators/custom-mutator";
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
/**
* @summary Log Raw Metric
*/
export type postV1LogRawMetricResponse200 = {
data: unknown;
status: 200;
};
export type postV1LogRawMetricResponse422 = {
data: HTTPValidationError;
status: 422;
};
export type postV1LogRawMetricResponseComposite =
| postV1LogRawMetricResponse200
| postV1LogRawMetricResponse422;
export type postV1LogRawMetricResponse = postV1LogRawMetricResponseComposite & {
headers: Headers;
};
export const getPostV1LogRawMetricUrl = () => {
return `/api/analytics/log_raw_metric`;
};
export const postV1LogRawMetric = async (
logRawMetricRequest: LogRawMetricRequest,
options?: RequestInit,
): Promise<postV1LogRawMetricResponse> => {
return customMutator<postV1LogRawMetricResponse>(getPostV1LogRawMetricUrl(), {
...options,
method: "POST",
headers: { "Content-Type": "application/json", ...options?.headers },
body: JSON.stringify(logRawMetricRequest),
});
};
export const getPostV1LogRawMetricMutationOptions = <
TError = HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV1LogRawMetric>>,
TError,
{ data: LogRawMetricRequest },
TContext
>;
request?: SecondParameter<typeof customMutator>;
}): UseMutationOptions<
Awaited<ReturnType<typeof postV1LogRawMetric>>,
TError,
{ data: LogRawMetricRequest },
TContext
> => {
const mutationKey = ["postV1LogRawMetric"];
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 postV1LogRawMetric>>,
{ data: LogRawMetricRequest }
> = (props) => {
const { data } = props ?? {};
return postV1LogRawMetric(data, requestOptions);
};
return { mutationFn, ...mutationOptions };
};
export type PostV1LogRawMetricMutationResult = NonNullable<
Awaited<ReturnType<typeof postV1LogRawMetric>>
>;
export type PostV1LogRawMetricMutationBody = LogRawMetricRequest;
export type PostV1LogRawMetricMutationError = HTTPValidationError;
/**
* @summary Log Raw Metric
*/
export const usePostV1LogRawMetric = <
TError = HTTPValidationError,
TContext = unknown,
>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV1LogRawMetric>>,
TError,
{ data: LogRawMetricRequest },
TContext
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof postV1LogRawMetric>>,
TError,
{ data: LogRawMetricRequest },
TContext
> => {
const mutationOptions = getPostV1LogRawMetricMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};
/**
* @summary Log Raw Analytics
*/
export type postV1LogRawAnalyticsResponse200 = {
data: unknown;
status: 200;
};
export type postV1LogRawAnalyticsResponse422 = {
data: HTTPValidationError;
status: 422;
};
export type postV1LogRawAnalyticsResponseComposite =
| postV1LogRawAnalyticsResponse200
| postV1LogRawAnalyticsResponse422;
export type postV1LogRawAnalyticsResponse =
postV1LogRawAnalyticsResponseComposite & {
headers: Headers;
};
export const getPostV1LogRawAnalyticsUrl = () => {
return `/api/analytics/log_raw_analytics`;
};
export const postV1LogRawAnalytics = async (
bodyPostV1LogRawAnalytics: BodyPostV1LogRawAnalytics,
options?: RequestInit,
): Promise<postV1LogRawAnalyticsResponse> => {
return customMutator<postV1LogRawAnalyticsResponse>(
getPostV1LogRawAnalyticsUrl(),
{
...options,
method: "POST",
headers: { "Content-Type": "application/json", ...options?.headers },
body: JSON.stringify(bodyPostV1LogRawAnalytics),
},
);
};
export const getPostV1LogRawAnalyticsMutationOptions = <
TError = HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV1LogRawAnalytics>>,
TError,
{ data: BodyPostV1LogRawAnalytics },
TContext
>;
request?: SecondParameter<typeof customMutator>;
}): UseMutationOptions<
Awaited<ReturnType<typeof postV1LogRawAnalytics>>,
TError,
{ data: BodyPostV1LogRawAnalytics },
TContext
> => {
const mutationKey = ["postV1LogRawAnalytics"];
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 postV1LogRawAnalytics>>,
{ data: BodyPostV1LogRawAnalytics }
> = (props) => {
const { data } = props ?? {};
return postV1LogRawAnalytics(data, requestOptions);
};
return { mutationFn, ...mutationOptions };
};
export type PostV1LogRawAnalyticsMutationResult = NonNullable<
Awaited<ReturnType<typeof postV1LogRawAnalytics>>
>;
export type PostV1LogRawAnalyticsMutationBody = BodyPostV1LogRawAnalytics;
export type PostV1LogRawAnalyticsMutationError = HTTPValidationError;
/**
* @summary Log Raw Analytics
*/
export const usePostV1LogRawAnalytics = <
TError = HTTPValidationError,
TContext = unknown,
>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV1LogRawAnalytics>>,
TError,
{ data: BodyPostV1LogRawAnalytics },
TContext
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof postV1LogRawAnalytics>>,
TError,
{ data: BodyPostV1LogRawAnalytics },
TContext
> => {
const mutationOptions = getPostV1LogRawAnalyticsMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};

View File

@@ -0,0 +1,857 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
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 { APIKeyWithoutHash } from "../../models/aPIKeyWithoutHash";
import type { CreateAPIKeyRequest } from "../../models/createAPIKeyRequest";
import type { CreateAPIKeyResponse } from "../../models/createAPIKeyResponse";
import type { GetV1ListUserApiKeys200 } from "../../models/getV1ListUserApiKeys200";
import type { HTTPValidationError } from "../../models/hTTPValidationError";
import type { UpdatePermissionsRequest } from "../../models/updatePermissionsRequest";
import { customMutator } from "../../../mutators/custom-mutator";
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
/**
* List all API keys for the user
* @summary List user API keys
*/
export type getV1ListUserApiKeysResponse200 = {
data: GetV1ListUserApiKeys200;
status: 200;
};
export type getV1ListUserApiKeysResponseComposite =
getV1ListUserApiKeysResponse200;
export type getV1ListUserApiKeysResponse =
getV1ListUserApiKeysResponseComposite & {
headers: Headers;
};
export const getGetV1ListUserApiKeysUrl = () => {
return `/api/api-keys`;
};
export const getV1ListUserApiKeys = async (
options?: RequestInit,
): Promise<getV1ListUserApiKeysResponse> => {
return customMutator<getV1ListUserApiKeysResponse>(
getGetV1ListUserApiKeysUrl(),
{
...options,
method: "GET",
},
);
};
export const getGetV1ListUserApiKeysQueryKey = () => {
return [`/api/api-keys`] as const;
};
export const getGetV1ListUserApiKeysQueryOptions = <
TData = Awaited<ReturnType<typeof getV1ListUserApiKeys>>,
TError = unknown,
>(options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1ListUserApiKeys>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
}) => {
const { query: queryOptions, request: requestOptions } = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetV1ListUserApiKeysQueryKey();
const queryFn: QueryFunction<
Awaited<ReturnType<typeof getV1ListUserApiKeys>>
> = ({ signal }) => getV1ListUserApiKeys({ signal, ...requestOptions });
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
Awaited<ReturnType<typeof getV1ListUserApiKeys>>,
TError,
TData
> & { queryKey: DataTag<QueryKey, TData, TError> };
};
export type GetV1ListUserApiKeysQueryResult = NonNullable<
Awaited<ReturnType<typeof getV1ListUserApiKeys>>
>;
export type GetV1ListUserApiKeysQueryError = unknown;
export function useGetV1ListUserApiKeys<
TData = Awaited<ReturnType<typeof getV1ListUserApiKeys>>,
TError = unknown,
>(
options: {
query: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1ListUserApiKeys>>,
TError,
TData
>
> &
Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getV1ListUserApiKeys>>,
TError,
Awaited<ReturnType<typeof getV1ListUserApiKeys>>
>,
"initialData"
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetV1ListUserApiKeys<
TData = Awaited<ReturnType<typeof getV1ListUserApiKeys>>,
TError = unknown,
>(
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1ListUserApiKeys>>,
TError,
TData
>
> &
Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getV1ListUserApiKeys>>,
TError,
Awaited<ReturnType<typeof getV1ListUserApiKeys>>
>,
"initialData"
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetV1ListUserApiKeys<
TData = Awaited<ReturnType<typeof getV1ListUserApiKeys>>,
TError = unknown,
>(
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1ListUserApiKeys>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
/**
* @summary List user API keys
*/
export function useGetV1ListUserApiKeys<
TData = Awaited<ReturnType<typeof getV1ListUserApiKeys>>,
TError = unknown,
>(
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1ListUserApiKeys>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
} {
const queryOptions = getGetV1ListUserApiKeysQueryOptions(options);
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
TData,
TError
> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey;
return query;
}
/**
* Create a new API key
* @summary Create new API key
*/
export type postV1CreateNewApiKeyResponse200 = {
data: CreateAPIKeyResponse;
status: 200;
};
export type postV1CreateNewApiKeyResponse422 = {
data: HTTPValidationError;
status: 422;
};
export type postV1CreateNewApiKeyResponseComposite =
| postV1CreateNewApiKeyResponse200
| postV1CreateNewApiKeyResponse422;
export type postV1CreateNewApiKeyResponse =
postV1CreateNewApiKeyResponseComposite & {
headers: Headers;
};
export const getPostV1CreateNewApiKeyUrl = () => {
return `/api/api-keys`;
};
export const postV1CreateNewApiKey = async (
createAPIKeyRequest: CreateAPIKeyRequest,
options?: RequestInit,
): Promise<postV1CreateNewApiKeyResponse> => {
return customMutator<postV1CreateNewApiKeyResponse>(
getPostV1CreateNewApiKeyUrl(),
{
...options,
method: "POST",
headers: { "Content-Type": "application/json", ...options?.headers },
body: JSON.stringify(createAPIKeyRequest),
},
);
};
export const getPostV1CreateNewApiKeyMutationOptions = <
TError = HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV1CreateNewApiKey>>,
TError,
{ data: CreateAPIKeyRequest },
TContext
>;
request?: SecondParameter<typeof customMutator>;
}): UseMutationOptions<
Awaited<ReturnType<typeof postV1CreateNewApiKey>>,
TError,
{ data: CreateAPIKeyRequest },
TContext
> => {
const mutationKey = ["postV1CreateNewApiKey"];
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 postV1CreateNewApiKey>>,
{ data: CreateAPIKeyRequest }
> = (props) => {
const { data } = props ?? {};
return postV1CreateNewApiKey(data, requestOptions);
};
return { mutationFn, ...mutationOptions };
};
export type PostV1CreateNewApiKeyMutationResult = NonNullable<
Awaited<ReturnType<typeof postV1CreateNewApiKey>>
>;
export type PostV1CreateNewApiKeyMutationBody = CreateAPIKeyRequest;
export type PostV1CreateNewApiKeyMutationError = HTTPValidationError;
/**
* @summary Create new API key
*/
export const usePostV1CreateNewApiKey = <
TError = HTTPValidationError,
TContext = unknown,
>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV1CreateNewApiKey>>,
TError,
{ data: CreateAPIKeyRequest },
TContext
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof postV1CreateNewApiKey>>,
TError,
{ data: CreateAPIKeyRequest },
TContext
> => {
const mutationOptions = getPostV1CreateNewApiKeyMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};
/**
* Get a specific API key
* @summary Get specific API key
*/
export type getV1GetSpecificApiKeyResponse200 = {
data: APIKeyWithoutHash;
status: 200;
};
export type getV1GetSpecificApiKeyResponse422 = {
data: HTTPValidationError;
status: 422;
};
export type getV1GetSpecificApiKeyResponseComposite =
| getV1GetSpecificApiKeyResponse200
| getV1GetSpecificApiKeyResponse422;
export type getV1GetSpecificApiKeyResponse =
getV1GetSpecificApiKeyResponseComposite & {
headers: Headers;
};
export const getGetV1GetSpecificApiKeyUrl = (keyId: string) => {
return `/api/api-keys/${keyId}`;
};
export const getV1GetSpecificApiKey = async (
keyId: string,
options?: RequestInit,
): Promise<getV1GetSpecificApiKeyResponse> => {
return customMutator<getV1GetSpecificApiKeyResponse>(
getGetV1GetSpecificApiKeyUrl(keyId),
{
...options,
method: "GET",
},
);
};
export const getGetV1GetSpecificApiKeyQueryKey = (keyId: string) => {
return [`/api/api-keys/${keyId}`] as const;
};
export const getGetV1GetSpecificApiKeyQueryOptions = <
TData = Awaited<ReturnType<typeof getV1GetSpecificApiKey>>,
TError = HTTPValidationError,
>(
keyId: string,
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1GetSpecificApiKey>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
) => {
const { query: queryOptions, request: requestOptions } = options ?? {};
const queryKey =
queryOptions?.queryKey ?? getGetV1GetSpecificApiKeyQueryKey(keyId);
const queryFn: QueryFunction<
Awaited<ReturnType<typeof getV1GetSpecificApiKey>>
> = ({ signal }) =>
getV1GetSpecificApiKey(keyId, { signal, ...requestOptions });
return {
queryKey,
queryFn,
enabled: !!keyId,
...queryOptions,
} as UseQueryOptions<
Awaited<ReturnType<typeof getV1GetSpecificApiKey>>,
TError,
TData
> & { queryKey: DataTag<QueryKey, TData, TError> };
};
export type GetV1GetSpecificApiKeyQueryResult = NonNullable<
Awaited<ReturnType<typeof getV1GetSpecificApiKey>>
>;
export type GetV1GetSpecificApiKeyQueryError = HTTPValidationError;
export function useGetV1GetSpecificApiKey<
TData = Awaited<ReturnType<typeof getV1GetSpecificApiKey>>,
TError = HTTPValidationError,
>(
keyId: string,
options: {
query: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1GetSpecificApiKey>>,
TError,
TData
>
> &
Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getV1GetSpecificApiKey>>,
TError,
Awaited<ReturnType<typeof getV1GetSpecificApiKey>>
>,
"initialData"
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetV1GetSpecificApiKey<
TData = Awaited<ReturnType<typeof getV1GetSpecificApiKey>>,
TError = HTTPValidationError,
>(
keyId: string,
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1GetSpecificApiKey>>,
TError,
TData
>
> &
Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getV1GetSpecificApiKey>>,
TError,
Awaited<ReturnType<typeof getV1GetSpecificApiKey>>
>,
"initialData"
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetV1GetSpecificApiKey<
TData = Awaited<ReturnType<typeof getV1GetSpecificApiKey>>,
TError = HTTPValidationError,
>(
keyId: string,
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1GetSpecificApiKey>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
/**
* @summary Get specific API key
*/
export function useGetV1GetSpecificApiKey<
TData = Awaited<ReturnType<typeof getV1GetSpecificApiKey>>,
TError = HTTPValidationError,
>(
keyId: string,
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1GetSpecificApiKey>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
} {
const queryOptions = getGetV1GetSpecificApiKeyQueryOptions(keyId, options);
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
TData,
TError
> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey;
return query;
}
/**
* Revoke an API key
* @summary Revoke API key
*/
export type deleteV1RevokeApiKeyResponse200 = {
data: APIKeyWithoutHash;
status: 200;
};
export type deleteV1RevokeApiKeyResponse422 = {
data: HTTPValidationError;
status: 422;
};
export type deleteV1RevokeApiKeyResponseComposite =
| deleteV1RevokeApiKeyResponse200
| deleteV1RevokeApiKeyResponse422;
export type deleteV1RevokeApiKeyResponse =
deleteV1RevokeApiKeyResponseComposite & {
headers: Headers;
};
export const getDeleteV1RevokeApiKeyUrl = (keyId: string) => {
return `/api/api-keys/${keyId}`;
};
export const deleteV1RevokeApiKey = async (
keyId: string,
options?: RequestInit,
): Promise<deleteV1RevokeApiKeyResponse> => {
return customMutator<deleteV1RevokeApiKeyResponse>(
getDeleteV1RevokeApiKeyUrl(keyId),
{
...options,
method: "DELETE",
},
);
};
export const getDeleteV1RevokeApiKeyMutationOptions = <
TError = HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof deleteV1RevokeApiKey>>,
TError,
{ keyId: string },
TContext
>;
request?: SecondParameter<typeof customMutator>;
}): UseMutationOptions<
Awaited<ReturnType<typeof deleteV1RevokeApiKey>>,
TError,
{ keyId: string },
TContext
> => {
const mutationKey = ["deleteV1RevokeApiKey"];
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 deleteV1RevokeApiKey>>,
{ keyId: string }
> = (props) => {
const { keyId } = props ?? {};
return deleteV1RevokeApiKey(keyId, requestOptions);
};
return { mutationFn, ...mutationOptions };
};
export type DeleteV1RevokeApiKeyMutationResult = NonNullable<
Awaited<ReturnType<typeof deleteV1RevokeApiKey>>
>;
export type DeleteV1RevokeApiKeyMutationError = HTTPValidationError;
/**
* @summary Revoke API key
*/
export const useDeleteV1RevokeApiKey = <
TError = HTTPValidationError,
TContext = unknown,
>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof deleteV1RevokeApiKey>>,
TError,
{ keyId: string },
TContext
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof deleteV1RevokeApiKey>>,
TError,
{ keyId: string },
TContext
> => {
const mutationOptions = getDeleteV1RevokeApiKeyMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};
/**
* Suspend an API key
* @summary Suspend API key
*/
export type postV1SuspendApiKeyResponse200 = {
data: APIKeyWithoutHash;
status: 200;
};
export type postV1SuspendApiKeyResponse422 = {
data: HTTPValidationError;
status: 422;
};
export type postV1SuspendApiKeyResponseComposite =
| postV1SuspendApiKeyResponse200
| postV1SuspendApiKeyResponse422;
export type postV1SuspendApiKeyResponse =
postV1SuspendApiKeyResponseComposite & {
headers: Headers;
};
export const getPostV1SuspendApiKeyUrl = (keyId: string) => {
return `/api/api-keys/${keyId}/suspend`;
};
export const postV1SuspendApiKey = async (
keyId: string,
options?: RequestInit,
): Promise<postV1SuspendApiKeyResponse> => {
return customMutator<postV1SuspendApiKeyResponse>(
getPostV1SuspendApiKeyUrl(keyId),
{
...options,
method: "POST",
},
);
};
export const getPostV1SuspendApiKeyMutationOptions = <
TError = HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV1SuspendApiKey>>,
TError,
{ keyId: string },
TContext
>;
request?: SecondParameter<typeof customMutator>;
}): UseMutationOptions<
Awaited<ReturnType<typeof postV1SuspendApiKey>>,
TError,
{ keyId: string },
TContext
> => {
const mutationKey = ["postV1SuspendApiKey"];
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 postV1SuspendApiKey>>,
{ keyId: string }
> = (props) => {
const { keyId } = props ?? {};
return postV1SuspendApiKey(keyId, requestOptions);
};
return { mutationFn, ...mutationOptions };
};
export type PostV1SuspendApiKeyMutationResult = NonNullable<
Awaited<ReturnType<typeof postV1SuspendApiKey>>
>;
export type PostV1SuspendApiKeyMutationError = HTTPValidationError;
/**
* @summary Suspend API key
*/
export const usePostV1SuspendApiKey = <
TError = HTTPValidationError,
TContext = unknown,
>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV1SuspendApiKey>>,
TError,
{ keyId: string },
TContext
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof postV1SuspendApiKey>>,
TError,
{ keyId: string },
TContext
> => {
const mutationOptions = getPostV1SuspendApiKeyMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};
/**
* Update API key permissions
* @summary Update key permissions
*/
export type putV1UpdateKeyPermissionsResponse200 = {
data: APIKeyWithoutHash;
status: 200;
};
export type putV1UpdateKeyPermissionsResponse422 = {
data: HTTPValidationError;
status: 422;
};
export type putV1UpdateKeyPermissionsResponseComposite =
| putV1UpdateKeyPermissionsResponse200
| putV1UpdateKeyPermissionsResponse422;
export type putV1UpdateKeyPermissionsResponse =
putV1UpdateKeyPermissionsResponseComposite & {
headers: Headers;
};
export const getPutV1UpdateKeyPermissionsUrl = (keyId: string) => {
return `/api/api-keys/${keyId}/permissions`;
};
export const putV1UpdateKeyPermissions = async (
keyId: string,
updatePermissionsRequest: UpdatePermissionsRequest,
options?: RequestInit,
): Promise<putV1UpdateKeyPermissionsResponse> => {
return customMutator<putV1UpdateKeyPermissionsResponse>(
getPutV1UpdateKeyPermissionsUrl(keyId),
{
...options,
method: "PUT",
headers: { "Content-Type": "application/json", ...options?.headers },
body: JSON.stringify(updatePermissionsRequest),
},
);
};
export const getPutV1UpdateKeyPermissionsMutationOptions = <
TError = HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof putV1UpdateKeyPermissions>>,
TError,
{ keyId: string; data: UpdatePermissionsRequest },
TContext
>;
request?: SecondParameter<typeof customMutator>;
}): UseMutationOptions<
Awaited<ReturnType<typeof putV1UpdateKeyPermissions>>,
TError,
{ keyId: string; data: UpdatePermissionsRequest },
TContext
> => {
const mutationKey = ["putV1UpdateKeyPermissions"];
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 putV1UpdateKeyPermissions>>,
{ keyId: string; data: UpdatePermissionsRequest }
> = (props) => {
const { keyId, data } = props ?? {};
return putV1UpdateKeyPermissions(keyId, data, requestOptions);
};
return { mutationFn, ...mutationOptions };
};
export type PutV1UpdateKeyPermissionsMutationResult = NonNullable<
Awaited<ReturnType<typeof putV1UpdateKeyPermissions>>
>;
export type PutV1UpdateKeyPermissionsMutationBody = UpdatePermissionsRequest;
export type PutV1UpdateKeyPermissionsMutationError = HTTPValidationError;
/**
* @summary Update key permissions
*/
export const usePutV1UpdateKeyPermissions = <
TError = HTTPValidationError,
TContext = unknown,
>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof putV1UpdateKeyPermissions>>,
TError,
{ keyId: string; data: UpdatePermissionsRequest },
TContext
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof putV1UpdateKeyPermissions>>,
TError,
{ keyId: string; data: UpdatePermissionsRequest },
TContext
> => {
const mutationOptions = getPutV1UpdateKeyPermissionsMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};

View File

@@ -0,0 +1,535 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import { useMutation, useQuery } from "@tanstack/react-query";
import type {
DataTag,
DefinedInitialDataOptions,
DefinedUseQueryResult,
MutationFunction,
QueryClient,
QueryFunction,
QueryKey,
UndefinedInitialDataOptions,
UseMutationOptions,
UseMutationResult,
UseQueryOptions,
UseQueryResult,
} from "@tanstack/react-query";
import type { HTTPValidationError } from "../../models/hTTPValidationError";
import type { NotificationPreference } from "../../models/notificationPreference";
import type { NotificationPreferenceDTO } from "../../models/notificationPreferenceDTO";
import type { PostV1UpdateUserEmail200 } from "../../models/postV1UpdateUserEmail200";
import { customMutator } from "../../../mutators/custom-mutator";
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
/**
* @summary Get or create user
*/
export type postV1GetOrCreateUserResponse200 = {
data: unknown;
status: 200;
};
export type postV1GetOrCreateUserResponseComposite =
postV1GetOrCreateUserResponse200;
export type postV1GetOrCreateUserResponse =
postV1GetOrCreateUserResponseComposite & {
headers: Headers;
};
export const getPostV1GetOrCreateUserUrl = () => {
return `/api/auth/user`;
};
export const postV1GetOrCreateUser = async (
options?: RequestInit,
): Promise<postV1GetOrCreateUserResponse> => {
return customMutator<postV1GetOrCreateUserResponse>(
getPostV1GetOrCreateUserUrl(),
{
...options,
method: "POST",
},
);
};
export const getPostV1GetOrCreateUserMutationOptions = <
TError = unknown,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV1GetOrCreateUser>>,
TError,
void,
TContext
>;
request?: SecondParameter<typeof customMutator>;
}): UseMutationOptions<
Awaited<ReturnType<typeof postV1GetOrCreateUser>>,
TError,
void,
TContext
> => {
const mutationKey = ["postV1GetOrCreateUser"];
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 postV1GetOrCreateUser>>,
void
> = () => {
return postV1GetOrCreateUser(requestOptions);
};
return { mutationFn, ...mutationOptions };
};
export type PostV1GetOrCreateUserMutationResult = NonNullable<
Awaited<ReturnType<typeof postV1GetOrCreateUser>>
>;
export type PostV1GetOrCreateUserMutationError = unknown;
/**
* @summary Get or create user
*/
export const usePostV1GetOrCreateUser = <TError = unknown, TContext = unknown>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV1GetOrCreateUser>>,
TError,
void,
TContext
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof postV1GetOrCreateUser>>,
TError,
void,
TContext
> => {
const mutationOptions = getPostV1GetOrCreateUserMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};
/**
* @summary Update user email
*/
export type postV1UpdateUserEmailResponse200 = {
data: PostV1UpdateUserEmail200;
status: 200;
};
export type postV1UpdateUserEmailResponse422 = {
data: HTTPValidationError;
status: 422;
};
export type postV1UpdateUserEmailResponseComposite =
| postV1UpdateUserEmailResponse200
| postV1UpdateUserEmailResponse422;
export type postV1UpdateUserEmailResponse =
postV1UpdateUserEmailResponseComposite & {
headers: Headers;
};
export const getPostV1UpdateUserEmailUrl = () => {
return `/api/auth/user/email`;
};
export const postV1UpdateUserEmail = async (
postV1UpdateUserEmailBody: string,
options?: RequestInit,
): Promise<postV1UpdateUserEmailResponse> => {
return customMutator<postV1UpdateUserEmailResponse>(
getPostV1UpdateUserEmailUrl(),
{
...options,
method: "POST",
headers: { "Content-Type": "application/json", ...options?.headers },
body: JSON.stringify(postV1UpdateUserEmailBody),
},
);
};
export const getPostV1UpdateUserEmailMutationOptions = <
TError = HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV1UpdateUserEmail>>,
TError,
{ data: string },
TContext
>;
request?: SecondParameter<typeof customMutator>;
}): UseMutationOptions<
Awaited<ReturnType<typeof postV1UpdateUserEmail>>,
TError,
{ data: string },
TContext
> => {
const mutationKey = ["postV1UpdateUserEmail"];
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 postV1UpdateUserEmail>>,
{ data: string }
> = (props) => {
const { data } = props ?? {};
return postV1UpdateUserEmail(data, requestOptions);
};
return { mutationFn, ...mutationOptions };
};
export type PostV1UpdateUserEmailMutationResult = NonNullable<
Awaited<ReturnType<typeof postV1UpdateUserEmail>>
>;
export type PostV1UpdateUserEmailMutationBody = string;
export type PostV1UpdateUserEmailMutationError = HTTPValidationError;
/**
* @summary Update user email
*/
export const usePostV1UpdateUserEmail = <
TError = HTTPValidationError,
TContext = unknown,
>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV1UpdateUserEmail>>,
TError,
{ data: string },
TContext
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof postV1UpdateUserEmail>>,
TError,
{ data: string },
TContext
> => {
const mutationOptions = getPostV1UpdateUserEmailMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};
/**
* @summary Get notification preferences
*/
export type getV1GetNotificationPreferencesResponse200 = {
data: NotificationPreference;
status: 200;
};
export type getV1GetNotificationPreferencesResponseComposite =
getV1GetNotificationPreferencesResponse200;
export type getV1GetNotificationPreferencesResponse =
getV1GetNotificationPreferencesResponseComposite & {
headers: Headers;
};
export const getGetV1GetNotificationPreferencesUrl = () => {
return `/api/auth/user/preferences`;
};
export const getV1GetNotificationPreferences = async (
options?: RequestInit,
): Promise<getV1GetNotificationPreferencesResponse> => {
return customMutator<getV1GetNotificationPreferencesResponse>(
getGetV1GetNotificationPreferencesUrl(),
{
...options,
method: "GET",
},
);
};
export const getGetV1GetNotificationPreferencesQueryKey = () => {
return [`/api/auth/user/preferences`] as const;
};
export const getGetV1GetNotificationPreferencesQueryOptions = <
TData = Awaited<ReturnType<typeof getV1GetNotificationPreferences>>,
TError = unknown,
>(options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1GetNotificationPreferences>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
}) => {
const { query: queryOptions, request: requestOptions } = options ?? {};
const queryKey =
queryOptions?.queryKey ?? getGetV1GetNotificationPreferencesQueryKey();
const queryFn: QueryFunction<
Awaited<ReturnType<typeof getV1GetNotificationPreferences>>
> = ({ signal }) =>
getV1GetNotificationPreferences({ signal, ...requestOptions });
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
Awaited<ReturnType<typeof getV1GetNotificationPreferences>>,
TError,
TData
> & { queryKey: DataTag<QueryKey, TData, TError> };
};
export type GetV1GetNotificationPreferencesQueryResult = NonNullable<
Awaited<ReturnType<typeof getV1GetNotificationPreferences>>
>;
export type GetV1GetNotificationPreferencesQueryError = unknown;
export function useGetV1GetNotificationPreferences<
TData = Awaited<ReturnType<typeof getV1GetNotificationPreferences>>,
TError = unknown,
>(
options: {
query: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1GetNotificationPreferences>>,
TError,
TData
>
> &
Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getV1GetNotificationPreferences>>,
TError,
Awaited<ReturnType<typeof getV1GetNotificationPreferences>>
>,
"initialData"
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetV1GetNotificationPreferences<
TData = Awaited<ReturnType<typeof getV1GetNotificationPreferences>>,
TError = unknown,
>(
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1GetNotificationPreferences>>,
TError,
TData
>
> &
Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getV1GetNotificationPreferences>>,
TError,
Awaited<ReturnType<typeof getV1GetNotificationPreferences>>
>,
"initialData"
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetV1GetNotificationPreferences<
TData = Awaited<ReturnType<typeof getV1GetNotificationPreferences>>,
TError = unknown,
>(
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1GetNotificationPreferences>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
/**
* @summary Get notification preferences
*/
export function useGetV1GetNotificationPreferences<
TData = Awaited<ReturnType<typeof getV1GetNotificationPreferences>>,
TError = unknown,
>(
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1GetNotificationPreferences>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
} {
const queryOptions = getGetV1GetNotificationPreferencesQueryOptions(options);
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
TData,
TError
> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey;
return query;
}
/**
* @summary Update notification preferences
*/
export type postV1UpdateNotificationPreferencesResponse200 = {
data: NotificationPreference;
status: 200;
};
export type postV1UpdateNotificationPreferencesResponse422 = {
data: HTTPValidationError;
status: 422;
};
export type postV1UpdateNotificationPreferencesResponseComposite =
| postV1UpdateNotificationPreferencesResponse200
| postV1UpdateNotificationPreferencesResponse422;
export type postV1UpdateNotificationPreferencesResponse =
postV1UpdateNotificationPreferencesResponseComposite & {
headers: Headers;
};
export const getPostV1UpdateNotificationPreferencesUrl = () => {
return `/api/auth/user/preferences`;
};
export const postV1UpdateNotificationPreferences = async (
notificationPreferenceDTO: NotificationPreferenceDTO,
options?: RequestInit,
): Promise<postV1UpdateNotificationPreferencesResponse> => {
return customMutator<postV1UpdateNotificationPreferencesResponse>(
getPostV1UpdateNotificationPreferencesUrl(),
{
...options,
method: "POST",
headers: { "Content-Type": "application/json", ...options?.headers },
body: JSON.stringify(notificationPreferenceDTO),
},
);
};
export const getPostV1UpdateNotificationPreferencesMutationOptions = <
TError = HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV1UpdateNotificationPreferences>>,
TError,
{ data: NotificationPreferenceDTO },
TContext
>;
request?: SecondParameter<typeof customMutator>;
}): UseMutationOptions<
Awaited<ReturnType<typeof postV1UpdateNotificationPreferences>>,
TError,
{ data: NotificationPreferenceDTO },
TContext
> => {
const mutationKey = ["postV1UpdateNotificationPreferences"];
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 postV1UpdateNotificationPreferences>>,
{ data: NotificationPreferenceDTO }
> = (props) => {
const { data } = props ?? {};
return postV1UpdateNotificationPreferences(data, requestOptions);
};
return { mutationFn, ...mutationOptions };
};
export type PostV1UpdateNotificationPreferencesMutationResult = NonNullable<
Awaited<ReturnType<typeof postV1UpdateNotificationPreferences>>
>;
export type PostV1UpdateNotificationPreferencesMutationBody =
NotificationPreferenceDTO;
export type PostV1UpdateNotificationPreferencesMutationError =
HTTPValidationError;
/**
* @summary Update notification preferences
*/
export const usePostV1UpdateNotificationPreferences = <
TError = HTTPValidationError,
TContext = unknown,
>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV1UpdateNotificationPreferences>>,
TError,
{ data: NotificationPreferenceDTO },
TContext
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof postV1UpdateNotificationPreferences>>,
TError,
{ data: NotificationPreferenceDTO },
TContext
> => {
const mutationOptions =
getPostV1UpdateNotificationPreferencesMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};

View File

@@ -0,0 +1,322 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
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 { GetV1ListAvailableBlocks200Item } from "../../models/getV1ListAvailableBlocks200Item";
import type { HTTPValidationError } from "../../models/hTTPValidationError";
import type { PostV1ExecuteGraphBlock200 } from "../../models/postV1ExecuteGraphBlock200";
import type { PostV1ExecuteGraphBlockBody } from "../../models/postV1ExecuteGraphBlockBody";
import { customMutator } from "../../../mutators/custom-mutator";
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
/**
* @summary List available blocks
*/
export type getV1ListAvailableBlocksResponse200 = {
data: GetV1ListAvailableBlocks200Item[];
status: 200;
};
export type getV1ListAvailableBlocksResponseComposite =
getV1ListAvailableBlocksResponse200;
export type getV1ListAvailableBlocksResponse =
getV1ListAvailableBlocksResponseComposite & {
headers: Headers;
};
export const getGetV1ListAvailableBlocksUrl = () => {
return `/api/blocks`;
};
export const getV1ListAvailableBlocks = async (
options?: RequestInit,
): Promise<getV1ListAvailableBlocksResponse> => {
return customMutator<getV1ListAvailableBlocksResponse>(
getGetV1ListAvailableBlocksUrl(),
{
...options,
method: "GET",
},
);
};
export const getGetV1ListAvailableBlocksQueryKey = () => {
return [`/api/blocks`] as const;
};
export const getGetV1ListAvailableBlocksQueryOptions = <
TData = Awaited<ReturnType<typeof getV1ListAvailableBlocks>>,
TError = unknown,
>(options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1ListAvailableBlocks>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
}) => {
const { query: queryOptions, request: requestOptions } = options ?? {};
const queryKey =
queryOptions?.queryKey ?? getGetV1ListAvailableBlocksQueryKey();
const queryFn: QueryFunction<
Awaited<ReturnType<typeof getV1ListAvailableBlocks>>
> = ({ signal }) => getV1ListAvailableBlocks({ signal, ...requestOptions });
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
Awaited<ReturnType<typeof getV1ListAvailableBlocks>>,
TError,
TData
> & { queryKey: DataTag<QueryKey, TData, TError> };
};
export type GetV1ListAvailableBlocksQueryResult = NonNullable<
Awaited<ReturnType<typeof getV1ListAvailableBlocks>>
>;
export type GetV1ListAvailableBlocksQueryError = unknown;
export function useGetV1ListAvailableBlocks<
TData = Awaited<ReturnType<typeof getV1ListAvailableBlocks>>,
TError = unknown,
>(
options: {
query: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1ListAvailableBlocks>>,
TError,
TData
>
> &
Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getV1ListAvailableBlocks>>,
TError,
Awaited<ReturnType<typeof getV1ListAvailableBlocks>>
>,
"initialData"
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetV1ListAvailableBlocks<
TData = Awaited<ReturnType<typeof getV1ListAvailableBlocks>>,
TError = unknown,
>(
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1ListAvailableBlocks>>,
TError,
TData
>
> &
Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getV1ListAvailableBlocks>>,
TError,
Awaited<ReturnType<typeof getV1ListAvailableBlocks>>
>,
"initialData"
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetV1ListAvailableBlocks<
TData = Awaited<ReturnType<typeof getV1ListAvailableBlocks>>,
TError = unknown,
>(
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1ListAvailableBlocks>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
/**
* @summary List available blocks
*/
export function useGetV1ListAvailableBlocks<
TData = Awaited<ReturnType<typeof getV1ListAvailableBlocks>>,
TError = unknown,
>(
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1ListAvailableBlocks>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
} {
const queryOptions = getGetV1ListAvailableBlocksQueryOptions(options);
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
TData,
TError
> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey;
return query;
}
/**
* @summary Execute graph block
*/
export type postV1ExecuteGraphBlockResponse200 = {
data: PostV1ExecuteGraphBlock200;
status: 200;
};
export type postV1ExecuteGraphBlockResponse422 = {
data: HTTPValidationError;
status: 422;
};
export type postV1ExecuteGraphBlockResponseComposite =
| postV1ExecuteGraphBlockResponse200
| postV1ExecuteGraphBlockResponse422;
export type postV1ExecuteGraphBlockResponse =
postV1ExecuteGraphBlockResponseComposite & {
headers: Headers;
};
export const getPostV1ExecuteGraphBlockUrl = (blockId: string) => {
return `/api/blocks/${blockId}/execute`;
};
export const postV1ExecuteGraphBlock = async (
blockId: string,
postV1ExecuteGraphBlockBody: PostV1ExecuteGraphBlockBody,
options?: RequestInit,
): Promise<postV1ExecuteGraphBlockResponse> => {
return customMutator<postV1ExecuteGraphBlockResponse>(
getPostV1ExecuteGraphBlockUrl(blockId),
{
...options,
method: "POST",
headers: { "Content-Type": "application/json", ...options?.headers },
body: JSON.stringify(postV1ExecuteGraphBlockBody),
},
);
};
export const getPostV1ExecuteGraphBlockMutationOptions = <
TError = HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV1ExecuteGraphBlock>>,
TError,
{ blockId: string; data: PostV1ExecuteGraphBlockBody },
TContext
>;
request?: SecondParameter<typeof customMutator>;
}): UseMutationOptions<
Awaited<ReturnType<typeof postV1ExecuteGraphBlock>>,
TError,
{ blockId: string; data: PostV1ExecuteGraphBlockBody },
TContext
> => {
const mutationKey = ["postV1ExecuteGraphBlock"];
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 postV1ExecuteGraphBlock>>,
{ blockId: string; data: PostV1ExecuteGraphBlockBody }
> = (props) => {
const { blockId, data } = props ?? {};
return postV1ExecuteGraphBlock(blockId, data, requestOptions);
};
return { mutationFn, ...mutationOptions };
};
export type PostV1ExecuteGraphBlockMutationResult = NonNullable<
Awaited<ReturnType<typeof postV1ExecuteGraphBlock>>
>;
export type PostV1ExecuteGraphBlockMutationBody = PostV1ExecuteGraphBlockBody;
export type PostV1ExecuteGraphBlockMutationError = HTTPValidationError;
/**
* @summary Execute graph block
*/
export const usePostV1ExecuteGraphBlock = <
TError = HTTPValidationError,
TContext = unknown,
>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV1ExecuteGraphBlock>>,
TError,
{ blockId: string; data: PostV1ExecuteGraphBlockBody },
TContext
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof postV1ExecuteGraphBlock>>,
TError,
{ blockId: string; data: PostV1ExecuteGraphBlockBody },
TContext
> => {
const mutationOptions = getPostV1ExecuteGraphBlockMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,265 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import { useMutation } from "@tanstack/react-query";
import type {
MutationFunction,
QueryClient,
UseMutationOptions,
UseMutationResult,
} from "@tanstack/react-query";
import type { HTTPValidationError } from "../../models/hTTPValidationError";
import type { PostV1HandlePostmarkEmailWebhooksBody } from "../../models/postV1HandlePostmarkEmailWebhooksBody";
import type { PostV1OneClickEmailUnsubscribeParams } from "../../models/postV1OneClickEmailUnsubscribeParams";
import { customMutator } from "../../../mutators/custom-mutator";
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
/**
* @summary One Click Email Unsubscribe
*/
export type postV1OneClickEmailUnsubscribeResponse200 = {
data: unknown;
status: 200;
};
export type postV1OneClickEmailUnsubscribeResponse422 = {
data: HTTPValidationError;
status: 422;
};
export type postV1OneClickEmailUnsubscribeResponseComposite =
| postV1OneClickEmailUnsubscribeResponse200
| postV1OneClickEmailUnsubscribeResponse422;
export type postV1OneClickEmailUnsubscribeResponse =
postV1OneClickEmailUnsubscribeResponseComposite & {
headers: Headers;
};
export const getPostV1OneClickEmailUnsubscribeUrl = (
params: PostV1OneClickEmailUnsubscribeParams,
) => {
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/email/unsubscribe?${stringifiedParams}`
: `/api/email/unsubscribe`;
};
export const postV1OneClickEmailUnsubscribe = async (
params: PostV1OneClickEmailUnsubscribeParams,
options?: RequestInit,
): Promise<postV1OneClickEmailUnsubscribeResponse> => {
return customMutator<postV1OneClickEmailUnsubscribeResponse>(
getPostV1OneClickEmailUnsubscribeUrl(params),
{
...options,
method: "POST",
},
);
};
export const getPostV1OneClickEmailUnsubscribeMutationOptions = <
TError = HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV1OneClickEmailUnsubscribe>>,
TError,
{ params: PostV1OneClickEmailUnsubscribeParams },
TContext
>;
request?: SecondParameter<typeof customMutator>;
}): UseMutationOptions<
Awaited<ReturnType<typeof postV1OneClickEmailUnsubscribe>>,
TError,
{ params: PostV1OneClickEmailUnsubscribeParams },
TContext
> => {
const mutationKey = ["postV1OneClickEmailUnsubscribe"];
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 postV1OneClickEmailUnsubscribe>>,
{ params: PostV1OneClickEmailUnsubscribeParams }
> = (props) => {
const { params } = props ?? {};
return postV1OneClickEmailUnsubscribe(params, requestOptions);
};
return { mutationFn, ...mutationOptions };
};
export type PostV1OneClickEmailUnsubscribeMutationResult = NonNullable<
Awaited<ReturnType<typeof postV1OneClickEmailUnsubscribe>>
>;
export type PostV1OneClickEmailUnsubscribeMutationError = HTTPValidationError;
/**
* @summary One Click Email Unsubscribe
*/
export const usePostV1OneClickEmailUnsubscribe = <
TError = HTTPValidationError,
TContext = unknown,
>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV1OneClickEmailUnsubscribe>>,
TError,
{ params: PostV1OneClickEmailUnsubscribeParams },
TContext
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof postV1OneClickEmailUnsubscribe>>,
TError,
{ params: PostV1OneClickEmailUnsubscribeParams },
TContext
> => {
const mutationOptions =
getPostV1OneClickEmailUnsubscribeMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};
/**
* @summary Handle Postmark Email Webhooks
*/
export type postV1HandlePostmarkEmailWebhooksResponse200 = {
data: unknown;
status: 200;
};
export type postV1HandlePostmarkEmailWebhooksResponse422 = {
data: HTTPValidationError;
status: 422;
};
export type postV1HandlePostmarkEmailWebhooksResponseComposite =
| postV1HandlePostmarkEmailWebhooksResponse200
| postV1HandlePostmarkEmailWebhooksResponse422;
export type postV1HandlePostmarkEmailWebhooksResponse =
postV1HandlePostmarkEmailWebhooksResponseComposite & {
headers: Headers;
};
export const getPostV1HandlePostmarkEmailWebhooksUrl = () => {
return `/api/email/`;
};
export const postV1HandlePostmarkEmailWebhooks = async (
postV1HandlePostmarkEmailWebhooksBody: PostV1HandlePostmarkEmailWebhooksBody,
options?: RequestInit,
): Promise<postV1HandlePostmarkEmailWebhooksResponse> => {
return customMutator<postV1HandlePostmarkEmailWebhooksResponse>(
getPostV1HandlePostmarkEmailWebhooksUrl(),
{
...options,
method: "POST",
headers: { "Content-Type": "application/json", ...options?.headers },
body: JSON.stringify(postV1HandlePostmarkEmailWebhooksBody),
},
);
};
export const getPostV1HandlePostmarkEmailWebhooksMutationOptions = <
TError = HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV1HandlePostmarkEmailWebhooks>>,
TError,
{ data: PostV1HandlePostmarkEmailWebhooksBody },
TContext
>;
request?: SecondParameter<typeof customMutator>;
}): UseMutationOptions<
Awaited<ReturnType<typeof postV1HandlePostmarkEmailWebhooks>>,
TError,
{ data: PostV1HandlePostmarkEmailWebhooksBody },
TContext
> => {
const mutationKey = ["postV1HandlePostmarkEmailWebhooks"];
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 postV1HandlePostmarkEmailWebhooks>>,
{ data: PostV1HandlePostmarkEmailWebhooksBody }
> = (props) => {
const { data } = props ?? {};
return postV1HandlePostmarkEmailWebhooks(data, requestOptions);
};
return { mutationFn, ...mutationOptions };
};
export type PostV1HandlePostmarkEmailWebhooksMutationResult = NonNullable<
Awaited<ReturnType<typeof postV1HandlePostmarkEmailWebhooks>>
>;
export type PostV1HandlePostmarkEmailWebhooksMutationBody =
PostV1HandlePostmarkEmailWebhooksBody;
export type PostV1HandlePostmarkEmailWebhooksMutationError =
HTTPValidationError;
/**
* @summary Handle Postmark Email Webhooks
*/
export const usePostV1HandlePostmarkEmailWebhooks = <
TError = HTTPValidationError,
TContext = unknown,
>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV1HandlePostmarkEmailWebhooks>>,
TError,
{ data: PostV1HandlePostmarkEmailWebhooksBody },
TContext
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof postV1HandlePostmarkEmailWebhooks>>,
TError,
{ data: PostV1HandlePostmarkEmailWebhooksBody },
TContext
> => {
const mutationOptions =
getPostV1HandlePostmarkEmailWebhooksMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,187 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import { useQuery } from "@tanstack/react-query";
import type {
DataTag,
DefinedInitialDataOptions,
DefinedUseQueryResult,
QueryClient,
QueryFunction,
QueryKey,
UndefinedInitialDataOptions,
UseQueryOptions,
UseQueryResult,
} from "@tanstack/react-query";
import { customMutator } from "../../../mutators/custom-mutator";
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
/**
* @summary Health
*/
export type getHealthHealthResponse200 = {
data: unknown;
status: 200;
};
export type getHealthHealthResponseComposite = getHealthHealthResponse200;
export type getHealthHealthResponse = getHealthHealthResponseComposite & {
headers: Headers;
};
export const getGetHealthHealthUrl = () => {
return `/health`;
};
export const getHealthHealth = async (
options?: RequestInit,
): Promise<getHealthHealthResponse> => {
return customMutator<getHealthHealthResponse>(getGetHealthHealthUrl(), {
...options,
method: "GET",
});
};
export const getGetHealthHealthQueryKey = () => {
return [`/health`] as const;
};
export const getGetHealthHealthQueryOptions = <
TData = Awaited<ReturnType<typeof getHealthHealth>>,
TError = unknown,
>(options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof getHealthHealth>>, TError, TData>
>;
request?: SecondParameter<typeof customMutator>;
}) => {
const { query: queryOptions, request: requestOptions } = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetHealthHealthQueryKey();
const queryFn: QueryFunction<Awaited<ReturnType<typeof getHealthHealth>>> = ({
signal,
}) => getHealthHealth({ signal, ...requestOptions });
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
Awaited<ReturnType<typeof getHealthHealth>>,
TError,
TData
> & { queryKey: DataTag<QueryKey, TData, TError> };
};
export type GetHealthHealthQueryResult = NonNullable<
Awaited<ReturnType<typeof getHealthHealth>>
>;
export type GetHealthHealthQueryError = unknown;
export function useGetHealthHealth<
TData = Awaited<ReturnType<typeof getHealthHealth>>,
TError = unknown,
>(
options: {
query: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getHealthHealth>>,
TError,
TData
>
> &
Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getHealthHealth>>,
TError,
Awaited<ReturnType<typeof getHealthHealth>>
>,
"initialData"
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetHealthHealth<
TData = Awaited<ReturnType<typeof getHealthHealth>>,
TError = unknown,
>(
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getHealthHealth>>,
TError,
TData
>
> &
Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getHealthHealth>>,
TError,
Awaited<ReturnType<typeof getHealthHealth>>
>,
"initialData"
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetHealthHealth<
TData = Awaited<ReturnType<typeof getHealthHealth>>,
TError = unknown,
>(
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getHealthHealth>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
/**
* @summary Health
*/
export function useGetHealthHealth<
TData = Awaited<ReturnType<typeof getHealthHealth>>,
TError = unknown,
>(
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getHealthHealth>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
} {
const queryOptions = getGetHealthHealthQueryOptions(options);
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
TData,
TError
> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey;
return query;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,666 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import { useMutation, useQuery } from "@tanstack/react-query";
import type {
DataTag,
DefinedInitialDataOptions,
DefinedUseQueryResult,
MutationFunction,
QueryClient,
QueryFunction,
QueryKey,
UndefinedInitialDataOptions,
UseMutationOptions,
UseMutationResult,
UseQueryOptions,
UseQueryResult,
} from "@tanstack/react-query";
import type { HTTPValidationError } from "../../models/hTTPValidationError";
import type { UserOnboardingUpdate } from "../../models/userOnboardingUpdate";
import { customMutator } from "../../../mutators/custom-mutator";
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
/**
* @summary Get onboarding status
*/
export type getV1GetOnboardingStatusResponse200 = {
data: unknown;
status: 200;
};
export type getV1GetOnboardingStatusResponseComposite =
getV1GetOnboardingStatusResponse200;
export type getV1GetOnboardingStatusResponse =
getV1GetOnboardingStatusResponseComposite & {
headers: Headers;
};
export const getGetV1GetOnboardingStatusUrl = () => {
return `/api/onboarding`;
};
export const getV1GetOnboardingStatus = async (
options?: RequestInit,
): Promise<getV1GetOnboardingStatusResponse> => {
return customMutator<getV1GetOnboardingStatusResponse>(
getGetV1GetOnboardingStatusUrl(),
{
...options,
method: "GET",
},
);
};
export const getGetV1GetOnboardingStatusQueryKey = () => {
return [`/api/onboarding`] as const;
};
export const getGetV1GetOnboardingStatusQueryOptions = <
TData = Awaited<ReturnType<typeof getV1GetOnboardingStatus>>,
TError = unknown,
>(options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1GetOnboardingStatus>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
}) => {
const { query: queryOptions, request: requestOptions } = options ?? {};
const queryKey =
queryOptions?.queryKey ?? getGetV1GetOnboardingStatusQueryKey();
const queryFn: QueryFunction<
Awaited<ReturnType<typeof getV1GetOnboardingStatus>>
> = ({ signal }) => getV1GetOnboardingStatus({ signal, ...requestOptions });
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
Awaited<ReturnType<typeof getV1GetOnboardingStatus>>,
TError,
TData
> & { queryKey: DataTag<QueryKey, TData, TError> };
};
export type GetV1GetOnboardingStatusQueryResult = NonNullable<
Awaited<ReturnType<typeof getV1GetOnboardingStatus>>
>;
export type GetV1GetOnboardingStatusQueryError = unknown;
export function useGetV1GetOnboardingStatus<
TData = Awaited<ReturnType<typeof getV1GetOnboardingStatus>>,
TError = unknown,
>(
options: {
query: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1GetOnboardingStatus>>,
TError,
TData
>
> &
Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getV1GetOnboardingStatus>>,
TError,
Awaited<ReturnType<typeof getV1GetOnboardingStatus>>
>,
"initialData"
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetV1GetOnboardingStatus<
TData = Awaited<ReturnType<typeof getV1GetOnboardingStatus>>,
TError = unknown,
>(
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1GetOnboardingStatus>>,
TError,
TData
>
> &
Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getV1GetOnboardingStatus>>,
TError,
Awaited<ReturnType<typeof getV1GetOnboardingStatus>>
>,
"initialData"
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetV1GetOnboardingStatus<
TData = Awaited<ReturnType<typeof getV1GetOnboardingStatus>>,
TError = unknown,
>(
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1GetOnboardingStatus>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
/**
* @summary Get onboarding status
*/
export function useGetV1GetOnboardingStatus<
TData = Awaited<ReturnType<typeof getV1GetOnboardingStatus>>,
TError = unknown,
>(
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1GetOnboardingStatus>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
} {
const queryOptions = getGetV1GetOnboardingStatusQueryOptions(options);
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
TData,
TError
> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey;
return query;
}
/**
* @summary Update onboarding progress
*/
export type patchV1UpdateOnboardingProgressResponse200 = {
data: unknown;
status: 200;
};
export type patchV1UpdateOnboardingProgressResponse422 = {
data: HTTPValidationError;
status: 422;
};
export type patchV1UpdateOnboardingProgressResponseComposite =
| patchV1UpdateOnboardingProgressResponse200
| patchV1UpdateOnboardingProgressResponse422;
export type patchV1UpdateOnboardingProgressResponse =
patchV1UpdateOnboardingProgressResponseComposite & {
headers: Headers;
};
export const getPatchV1UpdateOnboardingProgressUrl = () => {
return `/api/onboarding`;
};
export const patchV1UpdateOnboardingProgress = async (
userOnboardingUpdate: UserOnboardingUpdate,
options?: RequestInit,
): Promise<patchV1UpdateOnboardingProgressResponse> => {
return customMutator<patchV1UpdateOnboardingProgressResponse>(
getPatchV1UpdateOnboardingProgressUrl(),
{
...options,
method: "PATCH",
headers: { "Content-Type": "application/json", ...options?.headers },
body: JSON.stringify(userOnboardingUpdate),
},
);
};
export const getPatchV1UpdateOnboardingProgressMutationOptions = <
TError = HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof patchV1UpdateOnboardingProgress>>,
TError,
{ data: UserOnboardingUpdate },
TContext
>;
request?: SecondParameter<typeof customMutator>;
}): UseMutationOptions<
Awaited<ReturnType<typeof patchV1UpdateOnboardingProgress>>,
TError,
{ data: UserOnboardingUpdate },
TContext
> => {
const mutationKey = ["patchV1UpdateOnboardingProgress"];
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 patchV1UpdateOnboardingProgress>>,
{ data: UserOnboardingUpdate }
> = (props) => {
const { data } = props ?? {};
return patchV1UpdateOnboardingProgress(data, requestOptions);
};
return { mutationFn, ...mutationOptions };
};
export type PatchV1UpdateOnboardingProgressMutationResult = NonNullable<
Awaited<ReturnType<typeof patchV1UpdateOnboardingProgress>>
>;
export type PatchV1UpdateOnboardingProgressMutationBody = UserOnboardingUpdate;
export type PatchV1UpdateOnboardingProgressMutationError = HTTPValidationError;
/**
* @summary Update onboarding progress
*/
export const usePatchV1UpdateOnboardingProgress = <
TError = HTTPValidationError,
TContext = unknown,
>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof patchV1UpdateOnboardingProgress>>,
TError,
{ data: UserOnboardingUpdate },
TContext
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof patchV1UpdateOnboardingProgress>>,
TError,
{ data: UserOnboardingUpdate },
TContext
> => {
const mutationOptions =
getPatchV1UpdateOnboardingProgressMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};
/**
* @summary Get recommended agents
*/
export type getV1GetRecommendedAgentsResponse200 = {
data: unknown;
status: 200;
};
export type getV1GetRecommendedAgentsResponseComposite =
getV1GetRecommendedAgentsResponse200;
export type getV1GetRecommendedAgentsResponse =
getV1GetRecommendedAgentsResponseComposite & {
headers: Headers;
};
export const getGetV1GetRecommendedAgentsUrl = () => {
return `/api/onboarding/agents`;
};
export const getV1GetRecommendedAgents = async (
options?: RequestInit,
): Promise<getV1GetRecommendedAgentsResponse> => {
return customMutator<getV1GetRecommendedAgentsResponse>(
getGetV1GetRecommendedAgentsUrl(),
{
...options,
method: "GET",
},
);
};
export const getGetV1GetRecommendedAgentsQueryKey = () => {
return [`/api/onboarding/agents`] as const;
};
export const getGetV1GetRecommendedAgentsQueryOptions = <
TData = Awaited<ReturnType<typeof getV1GetRecommendedAgents>>,
TError = unknown,
>(options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1GetRecommendedAgents>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
}) => {
const { query: queryOptions, request: requestOptions } = options ?? {};
const queryKey =
queryOptions?.queryKey ?? getGetV1GetRecommendedAgentsQueryKey();
const queryFn: QueryFunction<
Awaited<ReturnType<typeof getV1GetRecommendedAgents>>
> = ({ signal }) => getV1GetRecommendedAgents({ signal, ...requestOptions });
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
Awaited<ReturnType<typeof getV1GetRecommendedAgents>>,
TError,
TData
> & { queryKey: DataTag<QueryKey, TData, TError> };
};
export type GetV1GetRecommendedAgentsQueryResult = NonNullable<
Awaited<ReturnType<typeof getV1GetRecommendedAgents>>
>;
export type GetV1GetRecommendedAgentsQueryError = unknown;
export function useGetV1GetRecommendedAgents<
TData = Awaited<ReturnType<typeof getV1GetRecommendedAgents>>,
TError = unknown,
>(
options: {
query: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1GetRecommendedAgents>>,
TError,
TData
>
> &
Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getV1GetRecommendedAgents>>,
TError,
Awaited<ReturnType<typeof getV1GetRecommendedAgents>>
>,
"initialData"
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetV1GetRecommendedAgents<
TData = Awaited<ReturnType<typeof getV1GetRecommendedAgents>>,
TError = unknown,
>(
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1GetRecommendedAgents>>,
TError,
TData
>
> &
Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getV1GetRecommendedAgents>>,
TError,
Awaited<ReturnType<typeof getV1GetRecommendedAgents>>
>,
"initialData"
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetV1GetRecommendedAgents<
TData = Awaited<ReturnType<typeof getV1GetRecommendedAgents>>,
TError = unknown,
>(
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1GetRecommendedAgents>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
/**
* @summary Get recommended agents
*/
export function useGetV1GetRecommendedAgents<
TData = Awaited<ReturnType<typeof getV1GetRecommendedAgents>>,
TError = unknown,
>(
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1GetRecommendedAgents>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
} {
const queryOptions = getGetV1GetRecommendedAgentsQueryOptions(options);
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
TData,
TError
> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey;
return query;
}
/**
* @summary Check onboarding enabled
*/
export type getV1CheckOnboardingEnabledResponse200 = {
data: unknown;
status: 200;
};
export type getV1CheckOnboardingEnabledResponseComposite =
getV1CheckOnboardingEnabledResponse200;
export type getV1CheckOnboardingEnabledResponse =
getV1CheckOnboardingEnabledResponseComposite & {
headers: Headers;
};
export const getGetV1CheckOnboardingEnabledUrl = () => {
return `/api/onboarding/enabled`;
};
export const getV1CheckOnboardingEnabled = async (
options?: RequestInit,
): Promise<getV1CheckOnboardingEnabledResponse> => {
return customMutator<getV1CheckOnboardingEnabledResponse>(
getGetV1CheckOnboardingEnabledUrl(),
{
...options,
method: "GET",
},
);
};
export const getGetV1CheckOnboardingEnabledQueryKey = () => {
return [`/api/onboarding/enabled`] as const;
};
export const getGetV1CheckOnboardingEnabledQueryOptions = <
TData = Awaited<ReturnType<typeof getV1CheckOnboardingEnabled>>,
TError = unknown,
>(options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1CheckOnboardingEnabled>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
}) => {
const { query: queryOptions, request: requestOptions } = options ?? {};
const queryKey =
queryOptions?.queryKey ?? getGetV1CheckOnboardingEnabledQueryKey();
const queryFn: QueryFunction<
Awaited<ReturnType<typeof getV1CheckOnboardingEnabled>>
> = ({ signal }) =>
getV1CheckOnboardingEnabled({ signal, ...requestOptions });
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
Awaited<ReturnType<typeof getV1CheckOnboardingEnabled>>,
TError,
TData
> & { queryKey: DataTag<QueryKey, TData, TError> };
};
export type GetV1CheckOnboardingEnabledQueryResult = NonNullable<
Awaited<ReturnType<typeof getV1CheckOnboardingEnabled>>
>;
export type GetV1CheckOnboardingEnabledQueryError = unknown;
export function useGetV1CheckOnboardingEnabled<
TData = Awaited<ReturnType<typeof getV1CheckOnboardingEnabled>>,
TError = unknown,
>(
options: {
query: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1CheckOnboardingEnabled>>,
TError,
TData
>
> &
Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getV1CheckOnboardingEnabled>>,
TError,
Awaited<ReturnType<typeof getV1CheckOnboardingEnabled>>
>,
"initialData"
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetV1CheckOnboardingEnabled<
TData = Awaited<ReturnType<typeof getV1CheckOnboardingEnabled>>,
TError = unknown,
>(
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1CheckOnboardingEnabled>>,
TError,
TData
>
> &
Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getV1CheckOnboardingEnabled>>,
TError,
Awaited<ReturnType<typeof getV1CheckOnboardingEnabled>>
>,
"initialData"
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetV1CheckOnboardingEnabled<
TData = Awaited<ReturnType<typeof getV1CheckOnboardingEnabled>>,
TError = unknown,
>(
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1CheckOnboardingEnabled>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
/**
* @summary Check onboarding enabled
*/
export function useGetV1CheckOnboardingEnabled<
TData = Awaited<ReturnType<typeof getV1CheckOnboardingEnabled>>,
TError = unknown,
>(
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1CheckOnboardingEnabled>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
} {
const queryOptions = getGetV1CheckOnboardingEnabledQueryOptions(options);
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
TData,
TError
> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey;
return query;
}

View File

@@ -0,0 +1,139 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import { useMutation } from "@tanstack/react-query";
import type {
MutationFunction,
QueryClient,
UseMutationOptions,
UseMutationResult,
} from "@tanstack/react-query";
import type { ApiResponse } from "../../models/apiResponse";
import type { ChatRequest } from "../../models/chatRequest";
import type { HTTPValidationError } from "../../models/hTTPValidationError";
import { customMutator } from "../../../mutators/custom-mutator";
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
/**
* Proxy requests to Otto API while adding necessary security headers and logging.
Requires an authenticated user.
* @summary Proxy Otto Chat Request
*/
export type postV2ProxyOttoChatRequestResponse200 = {
data: ApiResponse;
status: 200;
};
export type postV2ProxyOttoChatRequestResponse422 = {
data: HTTPValidationError;
status: 422;
};
export type postV2ProxyOttoChatRequestResponseComposite =
| postV2ProxyOttoChatRequestResponse200
| postV2ProxyOttoChatRequestResponse422;
export type postV2ProxyOttoChatRequestResponse =
postV2ProxyOttoChatRequestResponseComposite & {
headers: Headers;
};
export const getPostV2ProxyOttoChatRequestUrl = () => {
return `/api/otto/ask`;
};
export const postV2ProxyOttoChatRequest = async (
chatRequest: ChatRequest,
options?: RequestInit,
): Promise<postV2ProxyOttoChatRequestResponse> => {
return customMutator<postV2ProxyOttoChatRequestResponse>(
getPostV2ProxyOttoChatRequestUrl(),
{
...options,
method: "POST",
headers: { "Content-Type": "application/json", ...options?.headers },
body: JSON.stringify(chatRequest),
},
);
};
export const getPostV2ProxyOttoChatRequestMutationOptions = <
TError = HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV2ProxyOttoChatRequest>>,
TError,
{ data: ChatRequest },
TContext
>;
request?: SecondParameter<typeof customMutator>;
}): UseMutationOptions<
Awaited<ReturnType<typeof postV2ProxyOttoChatRequest>>,
TError,
{ data: ChatRequest },
TContext
> => {
const mutationKey = ["postV2ProxyOttoChatRequest"];
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 postV2ProxyOttoChatRequest>>,
{ data: ChatRequest }
> = (props) => {
const { data } = props ?? {};
return postV2ProxyOttoChatRequest(data, requestOptions);
};
return { mutationFn, ...mutationOptions };
};
export type PostV2ProxyOttoChatRequestMutationResult = NonNullable<
Awaited<ReturnType<typeof postV2ProxyOttoChatRequest>>
>;
export type PostV2ProxyOttoChatRequestMutationBody = ChatRequest;
export type PostV2ProxyOttoChatRequestMutationError = HTTPValidationError;
/**
* @summary Proxy Otto Chat Request
*/
export const usePostV2ProxyOttoChatRequest = <
TError = HTTPValidationError,
TContext = unknown,
>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV2ProxyOttoChatRequest>>,
TError,
{ data: ChatRequest },
TContext
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof postV2ProxyOttoChatRequest>>,
TError,
{ data: ChatRequest },
TContext
> => {
const mutationOptions = getPostV2ProxyOttoChatRequestMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};

View File

@@ -0,0 +1,895 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
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 { BodyPostV2ExecuteAPreset } from "../../models/bodyPostV2ExecuteAPreset";
import type { GetV2ListPresetsParams } from "../../models/getV2ListPresetsParams";
import type { HTTPValidationError } from "../../models/hTTPValidationError";
import type { LibraryAgentPreset } from "../../models/libraryAgentPreset";
import type { LibraryAgentPresetResponse } from "../../models/libraryAgentPresetResponse";
import type { LibraryAgentPresetUpdatable } from "../../models/libraryAgentPresetUpdatable";
import type { PostV2CreateANewPresetBody } from "../../models/postV2CreateANewPresetBody";
import type { PostV2ExecuteAPreset200 } from "../../models/postV2ExecuteAPreset200";
import { customMutator } from "../../../mutators/custom-mutator";
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
/**
* Retrieve a paginated list of presets for the current user.
* @summary List presets
*/
export type getV2ListPresetsResponse200 = {
data: LibraryAgentPresetResponse;
status: 200;
};
export type getV2ListPresetsResponse422 = {
data: HTTPValidationError;
status: 422;
};
export type getV2ListPresetsResponseComposite =
| getV2ListPresetsResponse200
| getV2ListPresetsResponse422;
export type getV2ListPresetsResponse = getV2ListPresetsResponseComposite & {
headers: Headers;
};
export const getGetV2ListPresetsUrl = (params: GetV2ListPresetsParams) => {
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/library/presets?${stringifiedParams}`
: `/api/library/presets`;
};
export const getV2ListPresets = async (
params: GetV2ListPresetsParams,
options?: RequestInit,
): Promise<getV2ListPresetsResponse> => {
return customMutator<getV2ListPresetsResponse>(
getGetV2ListPresetsUrl(params),
{
...options,
method: "GET",
},
);
};
export const getGetV2ListPresetsQueryKey = (params: GetV2ListPresetsParams) => {
return [`/api/library/presets`, ...(params ? [params] : [])] as const;
};
export const getGetV2ListPresetsQueryOptions = <
TData = Awaited<ReturnType<typeof getV2ListPresets>>,
TError = HTTPValidationError,
>(
params: GetV2ListPresetsParams,
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV2ListPresets>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
) => {
const { query: queryOptions, request: requestOptions } = options ?? {};
const queryKey =
queryOptions?.queryKey ?? getGetV2ListPresetsQueryKey(params);
const queryFn: QueryFunction<
Awaited<ReturnType<typeof getV2ListPresets>>
> = ({ signal }) => getV2ListPresets(params, { signal, ...requestOptions });
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
Awaited<ReturnType<typeof getV2ListPresets>>,
TError,
TData
> & { queryKey: DataTag<QueryKey, TData, TError> };
};
export type GetV2ListPresetsQueryResult = NonNullable<
Awaited<ReturnType<typeof getV2ListPresets>>
>;
export type GetV2ListPresetsQueryError = HTTPValidationError;
export function useGetV2ListPresets<
TData = Awaited<ReturnType<typeof getV2ListPresets>>,
TError = HTTPValidationError,
>(
params: GetV2ListPresetsParams,
options: {
query: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV2ListPresets>>,
TError,
TData
>
> &
Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getV2ListPresets>>,
TError,
Awaited<ReturnType<typeof getV2ListPresets>>
>,
"initialData"
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetV2ListPresets<
TData = Awaited<ReturnType<typeof getV2ListPresets>>,
TError = HTTPValidationError,
>(
params: GetV2ListPresetsParams,
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV2ListPresets>>,
TError,
TData
>
> &
Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getV2ListPresets>>,
TError,
Awaited<ReturnType<typeof getV2ListPresets>>
>,
"initialData"
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetV2ListPresets<
TData = Awaited<ReturnType<typeof getV2ListPresets>>,
TError = HTTPValidationError,
>(
params: GetV2ListPresetsParams,
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV2ListPresets>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
/**
* @summary List presets
*/
export function useGetV2ListPresets<
TData = Awaited<ReturnType<typeof getV2ListPresets>>,
TError = HTTPValidationError,
>(
params: GetV2ListPresetsParams,
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV2ListPresets>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
} {
const queryOptions = getGetV2ListPresetsQueryOptions(params, options);
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
TData,
TError
> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey;
return query;
}
/**
* Create a new preset for the current user.
* @summary Create a new preset
*/
export type postV2CreateANewPresetResponse200 = {
data: LibraryAgentPreset;
status: 200;
};
export type postV2CreateANewPresetResponse422 = {
data: HTTPValidationError;
status: 422;
};
export type postV2CreateANewPresetResponseComposite =
| postV2CreateANewPresetResponse200
| postV2CreateANewPresetResponse422;
export type postV2CreateANewPresetResponse =
postV2CreateANewPresetResponseComposite & {
headers: Headers;
};
export const getPostV2CreateANewPresetUrl = () => {
return `/api/library/presets`;
};
export const postV2CreateANewPreset = async (
postV2CreateANewPresetBody: PostV2CreateANewPresetBody,
options?: RequestInit,
): Promise<postV2CreateANewPresetResponse> => {
return customMutator<postV2CreateANewPresetResponse>(
getPostV2CreateANewPresetUrl(),
{
...options,
method: "POST",
headers: { "Content-Type": "application/json", ...options?.headers },
body: JSON.stringify(postV2CreateANewPresetBody),
},
);
};
export const getPostV2CreateANewPresetMutationOptions = <
TError = HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV2CreateANewPreset>>,
TError,
{ data: PostV2CreateANewPresetBody },
TContext
>;
request?: SecondParameter<typeof customMutator>;
}): UseMutationOptions<
Awaited<ReturnType<typeof postV2CreateANewPreset>>,
TError,
{ data: PostV2CreateANewPresetBody },
TContext
> => {
const mutationKey = ["postV2CreateANewPreset"];
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 postV2CreateANewPreset>>,
{ data: PostV2CreateANewPresetBody }
> = (props) => {
const { data } = props ?? {};
return postV2CreateANewPreset(data, requestOptions);
};
return { mutationFn, ...mutationOptions };
};
export type PostV2CreateANewPresetMutationResult = NonNullable<
Awaited<ReturnType<typeof postV2CreateANewPreset>>
>;
export type PostV2CreateANewPresetMutationBody = PostV2CreateANewPresetBody;
export type PostV2CreateANewPresetMutationError = HTTPValidationError;
/**
* @summary Create a new preset
*/
export const usePostV2CreateANewPreset = <
TError = HTTPValidationError,
TContext = unknown,
>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV2CreateANewPreset>>,
TError,
{ data: PostV2CreateANewPresetBody },
TContext
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof postV2CreateANewPreset>>,
TError,
{ data: PostV2CreateANewPresetBody },
TContext
> => {
const mutationOptions = getPostV2CreateANewPresetMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};
/**
* Retrieve details for a specific preset by its ID.
* @summary Get a specific preset
*/
export type getV2GetASpecificPresetResponse200 = {
data: LibraryAgentPreset;
status: 200;
};
export type getV2GetASpecificPresetResponse422 = {
data: HTTPValidationError;
status: 422;
};
export type getV2GetASpecificPresetResponseComposite =
| getV2GetASpecificPresetResponse200
| getV2GetASpecificPresetResponse422;
export type getV2GetASpecificPresetResponse =
getV2GetASpecificPresetResponseComposite & {
headers: Headers;
};
export const getGetV2GetASpecificPresetUrl = (presetId: string) => {
return `/api/library/presets/${presetId}`;
};
export const getV2GetASpecificPreset = async (
presetId: string,
options?: RequestInit,
): Promise<getV2GetASpecificPresetResponse> => {
return customMutator<getV2GetASpecificPresetResponse>(
getGetV2GetASpecificPresetUrl(presetId),
{
...options,
method: "GET",
},
);
};
export const getGetV2GetASpecificPresetQueryKey = (presetId: string) => {
return [`/api/library/presets/${presetId}`] as const;
};
export const getGetV2GetASpecificPresetQueryOptions = <
TData = Awaited<ReturnType<typeof getV2GetASpecificPreset>>,
TError = HTTPValidationError,
>(
presetId: string,
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV2GetASpecificPreset>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
) => {
const { query: queryOptions, request: requestOptions } = options ?? {};
const queryKey =
queryOptions?.queryKey ?? getGetV2GetASpecificPresetQueryKey(presetId);
const queryFn: QueryFunction<
Awaited<ReturnType<typeof getV2GetASpecificPreset>>
> = ({ signal }) =>
getV2GetASpecificPreset(presetId, { signal, ...requestOptions });
return {
queryKey,
queryFn,
enabled: !!presetId,
...queryOptions,
} as UseQueryOptions<
Awaited<ReturnType<typeof getV2GetASpecificPreset>>,
TError,
TData
> & { queryKey: DataTag<QueryKey, TData, TError> };
};
export type GetV2GetASpecificPresetQueryResult = NonNullable<
Awaited<ReturnType<typeof getV2GetASpecificPreset>>
>;
export type GetV2GetASpecificPresetQueryError = HTTPValidationError;
export function useGetV2GetASpecificPreset<
TData = Awaited<ReturnType<typeof getV2GetASpecificPreset>>,
TError = HTTPValidationError,
>(
presetId: string,
options: {
query: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV2GetASpecificPreset>>,
TError,
TData
>
> &
Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getV2GetASpecificPreset>>,
TError,
Awaited<ReturnType<typeof getV2GetASpecificPreset>>
>,
"initialData"
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetV2GetASpecificPreset<
TData = Awaited<ReturnType<typeof getV2GetASpecificPreset>>,
TError = HTTPValidationError,
>(
presetId: string,
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV2GetASpecificPreset>>,
TError,
TData
>
> &
Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getV2GetASpecificPreset>>,
TError,
Awaited<ReturnType<typeof getV2GetASpecificPreset>>
>,
"initialData"
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetV2GetASpecificPreset<
TData = Awaited<ReturnType<typeof getV2GetASpecificPreset>>,
TError = HTTPValidationError,
>(
presetId: string,
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV2GetASpecificPreset>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
/**
* @summary Get a specific preset
*/
export function useGetV2GetASpecificPreset<
TData = Awaited<ReturnType<typeof getV2GetASpecificPreset>>,
TError = HTTPValidationError,
>(
presetId: string,
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV2GetASpecificPreset>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
} {
const queryOptions = getGetV2GetASpecificPresetQueryOptions(
presetId,
options,
);
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
TData,
TError
> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey;
return query;
}
/**
* Update an existing preset by its ID.
* @summary Update an existing preset
*/
export type patchV2UpdateAnExistingPresetResponse200 = {
data: LibraryAgentPreset;
status: 200;
};
export type patchV2UpdateAnExistingPresetResponse422 = {
data: HTTPValidationError;
status: 422;
};
export type patchV2UpdateAnExistingPresetResponseComposite =
| patchV2UpdateAnExistingPresetResponse200
| patchV2UpdateAnExistingPresetResponse422;
export type patchV2UpdateAnExistingPresetResponse =
patchV2UpdateAnExistingPresetResponseComposite & {
headers: Headers;
};
export const getPatchV2UpdateAnExistingPresetUrl = (presetId: string) => {
return `/api/library/presets/${presetId}`;
};
export const patchV2UpdateAnExistingPreset = async (
presetId: string,
libraryAgentPresetUpdatable: LibraryAgentPresetUpdatable,
options?: RequestInit,
): Promise<patchV2UpdateAnExistingPresetResponse> => {
return customMutator<patchV2UpdateAnExistingPresetResponse>(
getPatchV2UpdateAnExistingPresetUrl(presetId),
{
...options,
method: "PATCH",
headers: { "Content-Type": "application/json", ...options?.headers },
body: JSON.stringify(libraryAgentPresetUpdatable),
},
);
};
export const getPatchV2UpdateAnExistingPresetMutationOptions = <
TError = HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof patchV2UpdateAnExistingPreset>>,
TError,
{ presetId: string; data: LibraryAgentPresetUpdatable },
TContext
>;
request?: SecondParameter<typeof customMutator>;
}): UseMutationOptions<
Awaited<ReturnType<typeof patchV2UpdateAnExistingPreset>>,
TError,
{ presetId: string; data: LibraryAgentPresetUpdatable },
TContext
> => {
const mutationKey = ["patchV2UpdateAnExistingPreset"];
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 patchV2UpdateAnExistingPreset>>,
{ presetId: string; data: LibraryAgentPresetUpdatable }
> = (props) => {
const { presetId, data } = props ?? {};
return patchV2UpdateAnExistingPreset(presetId, data, requestOptions);
};
return { mutationFn, ...mutationOptions };
};
export type PatchV2UpdateAnExistingPresetMutationResult = NonNullable<
Awaited<ReturnType<typeof patchV2UpdateAnExistingPreset>>
>;
export type PatchV2UpdateAnExistingPresetMutationBody =
LibraryAgentPresetUpdatable;
export type PatchV2UpdateAnExistingPresetMutationError = HTTPValidationError;
/**
* @summary Update an existing preset
*/
export const usePatchV2UpdateAnExistingPreset = <
TError = HTTPValidationError,
TContext = unknown,
>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof patchV2UpdateAnExistingPreset>>,
TError,
{ presetId: string; data: LibraryAgentPresetUpdatable },
TContext
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof patchV2UpdateAnExistingPreset>>,
TError,
{ presetId: string; data: LibraryAgentPresetUpdatable },
TContext
> => {
const mutationOptions =
getPatchV2UpdateAnExistingPresetMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};
/**
* Delete an existing preset by its ID.
* @summary Delete a preset
*/
export type deleteV2DeleteAPresetResponse204 = {
data: void;
status: 204;
};
export type deleteV2DeleteAPresetResponse422 = {
data: HTTPValidationError;
status: 422;
};
export type deleteV2DeleteAPresetResponseComposite =
| deleteV2DeleteAPresetResponse204
| deleteV2DeleteAPresetResponse422;
export type deleteV2DeleteAPresetResponse =
deleteV2DeleteAPresetResponseComposite & {
headers: Headers;
};
export const getDeleteV2DeleteAPresetUrl = (presetId: string) => {
return `/api/library/presets/${presetId}`;
};
export const deleteV2DeleteAPreset = async (
presetId: string,
options?: RequestInit,
): Promise<deleteV2DeleteAPresetResponse> => {
return customMutator<deleteV2DeleteAPresetResponse>(
getDeleteV2DeleteAPresetUrl(presetId),
{
...options,
method: "DELETE",
},
);
};
export const getDeleteV2DeleteAPresetMutationOptions = <
TError = HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof deleteV2DeleteAPreset>>,
TError,
{ presetId: string },
TContext
>;
request?: SecondParameter<typeof customMutator>;
}): UseMutationOptions<
Awaited<ReturnType<typeof deleteV2DeleteAPreset>>,
TError,
{ presetId: string },
TContext
> => {
const mutationKey = ["deleteV2DeleteAPreset"];
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 deleteV2DeleteAPreset>>,
{ presetId: string }
> = (props) => {
const { presetId } = props ?? {};
return deleteV2DeleteAPreset(presetId, requestOptions);
};
return { mutationFn, ...mutationOptions };
};
export type DeleteV2DeleteAPresetMutationResult = NonNullable<
Awaited<ReturnType<typeof deleteV2DeleteAPreset>>
>;
export type DeleteV2DeleteAPresetMutationError = HTTPValidationError;
/**
* @summary Delete a preset
*/
export const useDeleteV2DeleteAPreset = <
TError = HTTPValidationError,
TContext = unknown,
>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof deleteV2DeleteAPreset>>,
TError,
{ presetId: string },
TContext
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof deleteV2DeleteAPreset>>,
TError,
{ presetId: string },
TContext
> => {
const mutationOptions = getDeleteV2DeleteAPresetMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};
/**
* Execute a preset with the given graph and node input for the current user.
* @summary Execute a preset
*/
export type postV2ExecuteAPresetResponse200 = {
data: PostV2ExecuteAPreset200;
status: 200;
};
export type postV2ExecuteAPresetResponse422 = {
data: HTTPValidationError;
status: 422;
};
export type postV2ExecuteAPresetResponseComposite =
| postV2ExecuteAPresetResponse200
| postV2ExecuteAPresetResponse422;
export type postV2ExecuteAPresetResponse =
postV2ExecuteAPresetResponseComposite & {
headers: Headers;
};
export const getPostV2ExecuteAPresetUrl = (presetId: string) => {
return `/api/library/presets/${presetId}/execute`;
};
export const postV2ExecuteAPreset = async (
presetId: string,
bodyPostV2ExecuteAPreset: BodyPostV2ExecuteAPreset,
options?: RequestInit,
): Promise<postV2ExecuteAPresetResponse> => {
return customMutator<postV2ExecuteAPresetResponse>(
getPostV2ExecuteAPresetUrl(presetId),
{
...options,
method: "POST",
headers: { "Content-Type": "application/json", ...options?.headers },
body: JSON.stringify(bodyPostV2ExecuteAPreset),
},
);
};
export const getPostV2ExecuteAPresetMutationOptions = <
TError = HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV2ExecuteAPreset>>,
TError,
{ presetId: string; data: BodyPostV2ExecuteAPreset },
TContext
>;
request?: SecondParameter<typeof customMutator>;
}): UseMutationOptions<
Awaited<ReturnType<typeof postV2ExecuteAPreset>>,
TError,
{ presetId: string; data: BodyPostV2ExecuteAPreset },
TContext
> => {
const mutationKey = ["postV2ExecuteAPreset"];
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 postV2ExecuteAPreset>>,
{ presetId: string; data: BodyPostV2ExecuteAPreset }
> = (props) => {
const { presetId, data } = props ?? {};
return postV2ExecuteAPreset(presetId, data, requestOptions);
};
return { mutationFn, ...mutationOptions };
};
export type PostV2ExecuteAPresetMutationResult = NonNullable<
Awaited<ReturnType<typeof postV2ExecuteAPreset>>
>;
export type PostV2ExecuteAPresetMutationBody = BodyPostV2ExecuteAPreset;
export type PostV2ExecuteAPresetMutationError = HTTPValidationError;
/**
* @summary Execute a preset
*/
export const usePostV2ExecuteAPreset = <
TError = HTTPValidationError,
TContext = unknown,
>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV2ExecuteAPreset>>,
TError,
{ presetId: string; data: BodyPostV2ExecuteAPreset },
TContext
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof postV2ExecuteAPreset>>,
TError,
{ presetId: string; data: BodyPostV2ExecuteAPreset },
TContext
> => {
const mutationOptions = getPostV2ExecuteAPresetMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};

View File

@@ -0,0 +1,640 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
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 { DeleteV1DeleteExecutionSchedule200 } from "../../models/deleteV1DeleteExecutionSchedule200";
import type { GraphExecutionJobInfo } from "../../models/graphExecutionJobInfo";
import type { HTTPValidationError } from "../../models/hTTPValidationError";
import type { ScheduleCreationRequest } from "../../models/scheduleCreationRequest";
import { customMutator } from "../../../mutators/custom-mutator";
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
/**
* @summary Create execution schedule
*/
export type postV1CreateExecutionScheduleResponse200 = {
data: GraphExecutionJobInfo;
status: 200;
};
export type postV1CreateExecutionScheduleResponse422 = {
data: HTTPValidationError;
status: 422;
};
export type postV1CreateExecutionScheduleResponseComposite =
| postV1CreateExecutionScheduleResponse200
| postV1CreateExecutionScheduleResponse422;
export type postV1CreateExecutionScheduleResponse =
postV1CreateExecutionScheduleResponseComposite & {
headers: Headers;
};
export const getPostV1CreateExecutionScheduleUrl = (graphId: string) => {
return `/api/graphs/${graphId}/schedules`;
};
export const postV1CreateExecutionSchedule = async (
graphId: string,
scheduleCreationRequest: ScheduleCreationRequest,
options?: RequestInit,
): Promise<postV1CreateExecutionScheduleResponse> => {
return customMutator<postV1CreateExecutionScheduleResponse>(
getPostV1CreateExecutionScheduleUrl(graphId),
{
...options,
method: "POST",
headers: { "Content-Type": "application/json", ...options?.headers },
body: JSON.stringify(scheduleCreationRequest),
},
);
};
export const getPostV1CreateExecutionScheduleMutationOptions = <
TError = HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV1CreateExecutionSchedule>>,
TError,
{ graphId: string; data: ScheduleCreationRequest },
TContext
>;
request?: SecondParameter<typeof customMutator>;
}): UseMutationOptions<
Awaited<ReturnType<typeof postV1CreateExecutionSchedule>>,
TError,
{ graphId: string; data: ScheduleCreationRequest },
TContext
> => {
const mutationKey = ["postV1CreateExecutionSchedule"];
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 postV1CreateExecutionSchedule>>,
{ graphId: string; data: ScheduleCreationRequest }
> = (props) => {
const { graphId, data } = props ?? {};
return postV1CreateExecutionSchedule(graphId, data, requestOptions);
};
return { mutationFn, ...mutationOptions };
};
export type PostV1CreateExecutionScheduleMutationResult = NonNullable<
Awaited<ReturnType<typeof postV1CreateExecutionSchedule>>
>;
export type PostV1CreateExecutionScheduleMutationBody = ScheduleCreationRequest;
export type PostV1CreateExecutionScheduleMutationError = HTTPValidationError;
/**
* @summary Create execution schedule
*/
export const usePostV1CreateExecutionSchedule = <
TError = HTTPValidationError,
TContext = unknown,
>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV1CreateExecutionSchedule>>,
TError,
{ graphId: string; data: ScheduleCreationRequest },
TContext
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof postV1CreateExecutionSchedule>>,
TError,
{ graphId: string; data: ScheduleCreationRequest },
TContext
> => {
const mutationOptions =
getPostV1CreateExecutionScheduleMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};
/**
* @summary List execution schedules for a graph
*/
export type getV1ListExecutionSchedulesForAGraphResponse200 = {
data: GraphExecutionJobInfo[];
status: 200;
};
export type getV1ListExecutionSchedulesForAGraphResponse422 = {
data: HTTPValidationError;
status: 422;
};
export type getV1ListExecutionSchedulesForAGraphResponseComposite =
| getV1ListExecutionSchedulesForAGraphResponse200
| getV1ListExecutionSchedulesForAGraphResponse422;
export type getV1ListExecutionSchedulesForAGraphResponse =
getV1ListExecutionSchedulesForAGraphResponseComposite & {
headers: Headers;
};
export const getGetV1ListExecutionSchedulesForAGraphUrl = (graphId: string) => {
return `/api/graphs/${graphId}/schedules`;
};
export const getV1ListExecutionSchedulesForAGraph = async (
graphId: string,
options?: RequestInit,
): Promise<getV1ListExecutionSchedulesForAGraphResponse> => {
return customMutator<getV1ListExecutionSchedulesForAGraphResponse>(
getGetV1ListExecutionSchedulesForAGraphUrl(graphId),
{
...options,
method: "GET",
},
);
};
export const getGetV1ListExecutionSchedulesForAGraphQueryKey = (
graphId: string,
) => {
return [`/api/graphs/${graphId}/schedules`] as const;
};
export const getGetV1ListExecutionSchedulesForAGraphQueryOptions = <
TData = Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAGraph>>,
TError = HTTPValidationError,
>(
graphId: string,
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAGraph>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
) => {
const { query: queryOptions, request: requestOptions } = options ?? {};
const queryKey =
queryOptions?.queryKey ??
getGetV1ListExecutionSchedulesForAGraphQueryKey(graphId);
const queryFn: QueryFunction<
Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAGraph>>
> = ({ signal }) =>
getV1ListExecutionSchedulesForAGraph(graphId, {
signal,
...requestOptions,
});
return {
queryKey,
queryFn,
enabled: !!graphId,
...queryOptions,
} as UseQueryOptions<
Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAGraph>>,
TError,
TData
> & { queryKey: DataTag<QueryKey, TData, TError> };
};
export type GetV1ListExecutionSchedulesForAGraphQueryResult = NonNullable<
Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAGraph>>
>;
export type GetV1ListExecutionSchedulesForAGraphQueryError =
HTTPValidationError;
export function useGetV1ListExecutionSchedulesForAGraph<
TData = Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAGraph>>,
TError = HTTPValidationError,
>(
graphId: string,
options: {
query: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAGraph>>,
TError,
TData
>
> &
Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAGraph>>,
TError,
Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAGraph>>
>,
"initialData"
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetV1ListExecutionSchedulesForAGraph<
TData = Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAGraph>>,
TError = HTTPValidationError,
>(
graphId: string,
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAGraph>>,
TError,
TData
>
> &
Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAGraph>>,
TError,
Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAGraph>>
>,
"initialData"
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetV1ListExecutionSchedulesForAGraph<
TData = Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAGraph>>,
TError = HTTPValidationError,
>(
graphId: string,
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAGraph>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
/**
* @summary List execution schedules for a graph
*/
export function useGetV1ListExecutionSchedulesForAGraph<
TData = Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAGraph>>,
TError = HTTPValidationError,
>(
graphId: string,
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAGraph>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
} {
const queryOptions = getGetV1ListExecutionSchedulesForAGraphQueryOptions(
graphId,
options,
);
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
TData,
TError
> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey;
return query;
}
/**
* @summary List execution schedules for a user
*/
export type getV1ListExecutionSchedulesForAUserResponse200 = {
data: GraphExecutionJobInfo[];
status: 200;
};
export type getV1ListExecutionSchedulesForAUserResponseComposite =
getV1ListExecutionSchedulesForAUserResponse200;
export type getV1ListExecutionSchedulesForAUserResponse =
getV1ListExecutionSchedulesForAUserResponseComposite & {
headers: Headers;
};
export const getGetV1ListExecutionSchedulesForAUserUrl = () => {
return `/api/schedules`;
};
export const getV1ListExecutionSchedulesForAUser = async (
options?: RequestInit,
): Promise<getV1ListExecutionSchedulesForAUserResponse> => {
return customMutator<getV1ListExecutionSchedulesForAUserResponse>(
getGetV1ListExecutionSchedulesForAUserUrl(),
{
...options,
method: "GET",
},
);
};
export const getGetV1ListExecutionSchedulesForAUserQueryKey = () => {
return [`/api/schedules`] as const;
};
export const getGetV1ListExecutionSchedulesForAUserQueryOptions = <
TData = Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAUser>>,
TError = unknown,
>(options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAUser>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
}) => {
const { query: queryOptions, request: requestOptions } = options ?? {};
const queryKey =
queryOptions?.queryKey ?? getGetV1ListExecutionSchedulesForAUserQueryKey();
const queryFn: QueryFunction<
Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAUser>>
> = ({ signal }) =>
getV1ListExecutionSchedulesForAUser({ signal, ...requestOptions });
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAUser>>,
TError,
TData
> & { queryKey: DataTag<QueryKey, TData, TError> };
};
export type GetV1ListExecutionSchedulesForAUserQueryResult = NonNullable<
Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAUser>>
>;
export type GetV1ListExecutionSchedulesForAUserQueryError = unknown;
export function useGetV1ListExecutionSchedulesForAUser<
TData = Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAUser>>,
TError = unknown,
>(
options: {
query: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAUser>>,
TError,
TData
>
> &
Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAUser>>,
TError,
Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAUser>>
>,
"initialData"
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetV1ListExecutionSchedulesForAUser<
TData = Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAUser>>,
TError = unknown,
>(
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAUser>>,
TError,
TData
>
> &
Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAUser>>,
TError,
Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAUser>>
>,
"initialData"
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetV1ListExecutionSchedulesForAUser<
TData = Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAUser>>,
TError = unknown,
>(
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAUser>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
/**
* @summary List execution schedules for a user
*/
export function useGetV1ListExecutionSchedulesForAUser<
TData = Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAUser>>,
TError = unknown,
>(
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof getV1ListExecutionSchedulesForAUser>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
} {
const queryOptions =
getGetV1ListExecutionSchedulesForAUserQueryOptions(options);
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
TData,
TError
> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey;
return query;
}
/**
* @summary Delete execution schedule
*/
export type deleteV1DeleteExecutionScheduleResponse200 = {
data: DeleteV1DeleteExecutionSchedule200;
status: 200;
};
export type deleteV1DeleteExecutionScheduleResponse422 = {
data: HTTPValidationError;
status: 422;
};
export type deleteV1DeleteExecutionScheduleResponseComposite =
| deleteV1DeleteExecutionScheduleResponse200
| deleteV1DeleteExecutionScheduleResponse422;
export type deleteV1DeleteExecutionScheduleResponse =
deleteV1DeleteExecutionScheduleResponseComposite & {
headers: Headers;
};
export const getDeleteV1DeleteExecutionScheduleUrl = (scheduleId: string) => {
return `/api/schedules/${scheduleId}`;
};
export const deleteV1DeleteExecutionSchedule = async (
scheduleId: string,
options?: RequestInit,
): Promise<deleteV1DeleteExecutionScheduleResponse> => {
return customMutator<deleteV1DeleteExecutionScheduleResponse>(
getDeleteV1DeleteExecutionScheduleUrl(scheduleId),
{
...options,
method: "DELETE",
},
);
};
export const getDeleteV1DeleteExecutionScheduleMutationOptions = <
TError = HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof deleteV1DeleteExecutionSchedule>>,
TError,
{ scheduleId: string },
TContext
>;
request?: SecondParameter<typeof customMutator>;
}): UseMutationOptions<
Awaited<ReturnType<typeof deleteV1DeleteExecutionSchedule>>,
TError,
{ scheduleId: string },
TContext
> => {
const mutationKey = ["deleteV1DeleteExecutionSchedule"];
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 deleteV1DeleteExecutionSchedule>>,
{ scheduleId: string }
> = (props) => {
const { scheduleId } = props ?? {};
return deleteV1DeleteExecutionSchedule(scheduleId, requestOptions);
};
return { mutationFn, ...mutationOptions };
};
export type DeleteV1DeleteExecutionScheduleMutationResult = NonNullable<
Awaited<ReturnType<typeof deleteV1DeleteExecutionSchedule>>
>;
export type DeleteV1DeleteExecutionScheduleMutationError = HTTPValidationError;
/**
* @summary Delete execution schedule
*/
export const useDeleteV1DeleteExecutionSchedule = <
TError = HTTPValidationError,
TContext = unknown,
>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof deleteV1DeleteExecutionSchedule>>,
TError,
{ scheduleId: string },
TContext
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof deleteV1DeleteExecutionSchedule>>,
TError,
{ scheduleId: string },
TContext
> => {
const mutationOptions =
getDeleteV1DeleteExecutionScheduleMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,140 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import { useMutation } from "@tanstack/react-query";
import type {
MutationFunction,
QueryClient,
UseMutationOptions,
UseMutationResult,
} from "@tanstack/react-query";
import type { HTTPValidationError } from "../../models/hTTPValidationError";
import type { TurnstileVerifyRequest } from "../../models/turnstileVerifyRequest";
import type { TurnstileVerifyResponse } from "../../models/turnstileVerifyResponse";
import { customMutator } from "../../../mutators/custom-mutator";
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
/**
* Verify a Cloudflare Turnstile token.
This endpoint verifies a token returned by the Cloudflare Turnstile challenge
on the client side. It returns whether the verification was successful.
* @summary Verify Turnstile Token
*/
export type postV2VerifyTurnstileTokenResponse200 = {
data: TurnstileVerifyResponse;
status: 200;
};
export type postV2VerifyTurnstileTokenResponse422 = {
data: HTTPValidationError;
status: 422;
};
export type postV2VerifyTurnstileTokenResponseComposite =
| postV2VerifyTurnstileTokenResponse200
| postV2VerifyTurnstileTokenResponse422;
export type postV2VerifyTurnstileTokenResponse =
postV2VerifyTurnstileTokenResponseComposite & {
headers: Headers;
};
export const getPostV2VerifyTurnstileTokenUrl = () => {
return `/api/turnstile/verify`;
};
export const postV2VerifyTurnstileToken = async (
turnstileVerifyRequest: TurnstileVerifyRequest,
options?: RequestInit,
): Promise<postV2VerifyTurnstileTokenResponse> => {
return customMutator<postV2VerifyTurnstileTokenResponse>(
getPostV2VerifyTurnstileTokenUrl(),
{
...options,
method: "POST",
headers: { "Content-Type": "application/json", ...options?.headers },
body: JSON.stringify(turnstileVerifyRequest),
},
);
};
export const getPostV2VerifyTurnstileTokenMutationOptions = <
TError = HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV2VerifyTurnstileToken>>,
TError,
{ data: TurnstileVerifyRequest },
TContext
>;
request?: SecondParameter<typeof customMutator>;
}): UseMutationOptions<
Awaited<ReturnType<typeof postV2VerifyTurnstileToken>>,
TError,
{ data: TurnstileVerifyRequest },
TContext
> => {
const mutationKey = ["postV2VerifyTurnstileToken"];
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 postV2VerifyTurnstileToken>>,
{ data: TurnstileVerifyRequest }
> = (props) => {
const { data } = props ?? {};
return postV2VerifyTurnstileToken(data, requestOptions);
};
return { mutationFn, ...mutationOptions };
};
export type PostV2VerifyTurnstileTokenMutationResult = NonNullable<
Awaited<ReturnType<typeof postV2VerifyTurnstileToken>>
>;
export type PostV2VerifyTurnstileTokenMutationBody = TurnstileVerifyRequest;
export type PostV2VerifyTurnstileTokenMutationError = HTTPValidationError;
/**
* @summary Verify Turnstile Token
*/
export const usePostV2VerifyTurnstileToken = <
TError = HTTPValidationError,
TContext = unknown,
>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV2VerifyTurnstileToken>>,
TError,
{ data: TurnstileVerifyRequest },
TContext
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof postV2VerifyTurnstileToken>>,
TError,
{ data: TurnstileVerifyRequest },
TContext
> => {
const mutationOptions = getPostV2VerifyTurnstileTokenMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};

View File

@@ -0,0 +1,19 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import type { APIKeyCredentialsTitle } from "./aPIKeyCredentialsTitle";
import type { APIKeyCredentialsExpiresAt } from "./aPIKeyCredentialsExpiresAt";
export interface APIKeyCredentials {
id?: string;
provider: string;
title?: APIKeyCredentialsTitle;
type?: "api_key";
api_key: string;
/** Unix timestamp (seconds) indicating when the API key expires (if at all) */
expires_at?: APIKeyCredentialsExpiresAt;
}

View File

@@ -0,0 +1,12 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
/**
* Unix timestamp (seconds) indicating when the API key expires (if at all)
*/
export type APIKeyCredentialsExpiresAt = number | null;

View File

@@ -0,0 +1,9 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type APIKeyCredentialsTitle = string | null;

View File

@@ -0,0 +1,18 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type APIKeyPermission =
(typeof APIKeyPermission)[keyof typeof APIKeyPermission];
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const APIKeyPermission = {
EXECUTE_GRAPH: "EXECUTE_GRAPH",
READ_GRAPH: "READ_GRAPH",
EXECUTE_BLOCK: "EXECUTE_BLOCK",
READ_BLOCK: "READ_BLOCK",
} as const;

View File

@@ -0,0 +1,16 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type APIKeyStatus = (typeof APIKeyStatus)[keyof typeof APIKeyStatus];
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const APIKeyStatus = {
ACTIVE: "ACTIVE",
REVOKED: "REVOKED",
SUSPENDED: "SUSPENDED",
} as const;

View File

@@ -0,0 +1,26 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import type { APIKeyStatus } from "./aPIKeyStatus";
import type { APIKeyPermission } from "./aPIKeyPermission";
import type { APIKeyWithoutHashLastUsedAt } from "./aPIKeyWithoutHashLastUsedAt";
import type { APIKeyWithoutHashRevokedAt } from "./aPIKeyWithoutHashRevokedAt";
import type { APIKeyWithoutHashDescription } from "./aPIKeyWithoutHashDescription";
export interface APIKeyWithoutHash {
id: string;
name: string;
prefix: string;
postfix: string;
status: APIKeyStatus;
permissions: APIKeyPermission[];
created_at: string;
last_used_at: APIKeyWithoutHashLastUsedAt;
revoked_at: APIKeyWithoutHashRevokedAt;
description: APIKeyWithoutHashDescription;
user_id: string;
}

View File

@@ -0,0 +1,9 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type APIKeyWithoutHashDescription = string | null;

View File

@@ -0,0 +1,9 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type APIKeyWithoutHashLastUsedAt = string | null;

View File

@@ -0,0 +1,9 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type APIKeyWithoutHashRevokedAt = string | null;

View File

@@ -0,0 +1,12 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export interface AddUserCreditsResponse {
new_balance: number;
transaction_key: string;
}

View File

@@ -0,0 +1,20 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type AgentExecutionStatus =
(typeof AgentExecutionStatus)[keyof typeof AgentExecutionStatus];
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const AgentExecutionStatus = {
INCOMPLETE: "INCOMPLETE",
QUEUED: "QUEUED",
RUNNING: "RUNNING",
COMPLETED: "COMPLETED",
TERMINATED: "TERMINATED",
FAILED: "FAILED",
} as const;

View File

@@ -0,0 +1,14 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import type { Document } from "./document";
export interface ApiResponse {
answer: string;
documents: Document[];
success: boolean;
}

View File

@@ -0,0 +1,12 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export interface AutoTopUpConfig {
amount: number;
threshold: number;
}

View File

@@ -0,0 +1,23 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import type { Node } from "./node";
import type { Link } from "./link";
import type { BaseGraphInputForkedFromId } from "./baseGraphInputForkedFromId";
import type { BaseGraphInputForkedFromVersion } from "./baseGraphInputForkedFromVersion";
export interface BaseGraphInput {
id?: string;
version?: number;
is_active?: boolean;
name: string;
description: string;
nodes?: Node[];
links?: Link[];
forked_from_id?: BaseGraphInputForkedFromId;
forked_from_version?: BaseGraphInputForkedFromVersion;
}

View File

@@ -0,0 +1,9 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type BaseGraphInputForkedFromId = string | null;

View File

@@ -0,0 +1,9 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type BaseGraphInputForkedFromVersion = number | null;

View File

@@ -0,0 +1,27 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import type { Node } from "./node";
import type { Link } from "./link";
import type { BaseGraphOutputForkedFromId } from "./baseGraphOutputForkedFromId";
import type { BaseGraphOutputForkedFromVersion } from "./baseGraphOutputForkedFromVersion";
import type { BaseGraphOutputInputSchema } from "./baseGraphOutputInputSchema";
import type { BaseGraphOutputOutputSchema } from "./baseGraphOutputOutputSchema";
export interface BaseGraphOutput {
id?: string;
version?: number;
is_active?: boolean;
name: string;
description: string;
nodes?: Node[];
links?: Link[];
forked_from_id?: BaseGraphOutputForkedFromId;
forked_from_version?: BaseGraphOutputForkedFromVersion;
readonly input_schema: BaseGraphOutputInputSchema;
readonly output_schema: BaseGraphOutputOutputSchema;
}

View File

@@ -0,0 +1,9 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type BaseGraphOutputForkedFromId = string | null;

View File

@@ -0,0 +1,9 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type BaseGraphOutputForkedFromVersion = number | null;

View File

@@ -0,0 +1,9 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type BaseGraphOutputInputSchema = { [key: string]: unknown };

View File

@@ -0,0 +1,9 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type BaseGraphOutputOutputSchema = { [key: string]: unknown };

View File

@@ -0,0 +1,12 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export interface BodyPostV1Callback {
code: string;
state_token: string;
}

View File

@@ -0,0 +1,14 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import type { BodyPostV1ExecuteGraphAgentInputs } from "./bodyPostV1ExecuteGraphAgentInputs";
import type { BodyPostV1ExecuteGraphAgentCredentialsInputs } from "./bodyPostV1ExecuteGraphAgentCredentialsInputs";
export interface BodyPostV1ExecuteGraphAgent {
inputs?: BodyPostV1ExecuteGraphAgentInputs;
credentials_inputs?: BodyPostV1ExecuteGraphAgentCredentialsInputs;
}

View File

@@ -0,0 +1,12 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import type { CredentialsMetaInput } from "./credentialsMetaInput";
export type BodyPostV1ExecuteGraphAgentCredentialsInputs = {
[key: string]: CredentialsMetaInput;
};

View File

@@ -0,0 +1,9 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type BodyPostV1ExecuteGraphAgentInputs = { [key: string]: unknown };

View File

@@ -0,0 +1,16 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import type { BodyPostV1LogRawAnalyticsData } from "./bodyPostV1LogRawAnalyticsData";
export interface BodyPostV1LogRawAnalytics {
type: string;
/** The data to log */
data: BodyPostV1LogRawAnalyticsData;
/** Indexable field for any count based analytical measures like page order clicking, tutorial step completion, etc. */
data_index: string;
}

View File

@@ -0,0 +1,12 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
/**
* The data to log
*/
export type BodyPostV1LogRawAnalyticsData = { [key: string]: unknown };

View File

@@ -0,0 +1,13 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export interface BodyPostV2AddCreditsToUser {
user_id: string;
amount: number;
comments: string;
}

View File

@@ -0,0 +1,11 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export interface BodyPostV2AddMarketplaceAgent {
store_listing_version_id: string;
}

View File

@@ -0,0 +1,12 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import type { BodyPostV2ExecuteAPresetInputs } from "./bodyPostV2ExecuteAPresetInputs";
export interface BodyPostV2ExecuteAPreset {
inputs?: BodyPostV2ExecuteAPresetInputs;
}

View File

@@ -0,0 +1,9 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type BodyPostV2ExecuteAPresetInputs = { [key: string]: unknown };

View File

@@ -0,0 +1,11 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export interface BodyPostV2UploadSubmissionMedia {
file: Blob;
}

View File

@@ -0,0 +1,17 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import type { Message } from "./message";
import type { ChatRequestGraphId } from "./chatRequestGraphId";
export interface ChatRequest {
query: string;
conversation_history: Message[];
message_id: string;
include_graph_data?: boolean;
graph_id?: ChatRequestGraphId;
}

View File

@@ -0,0 +1,9 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type ChatRequestGraphId = string | null;

View File

@@ -0,0 +1,15 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import type { APIKeyPermission } from "./aPIKeyPermission";
import type { CreateAPIKeyRequestDescription } from "./createAPIKeyRequestDescription";
export interface CreateAPIKeyRequest {
name: string;
permissions: APIKeyPermission[];
description?: CreateAPIKeyRequestDescription;
}

View File

@@ -0,0 +1,9 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type CreateAPIKeyRequestDescription = string | null;

View File

@@ -0,0 +1,13 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import type { APIKeyWithoutHash } from "./aPIKeyWithoutHash";
export interface CreateAPIKeyResponse {
api_key: APIKeyWithoutHash;
plain_text_key: string;
}

View File

@@ -0,0 +1,12 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import type { Graph } from "./graph";
export interface CreateGraph {
graph: Graph;
}

View File

@@ -0,0 +1,18 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export interface Creator {
name: string;
username: string;
description: string;
avatar_url: string;
num_agents: number;
agent_rating: number;
agent_runs: number;
is_featured: boolean;
}

View File

@@ -0,0 +1,18 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export interface CreatorDetails {
name: string;
username: string;
description: string;
links: string[];
avatar_url: string;
agent_rating: number;
agent_runs: number;
top_categories: string[];
}

View File

@@ -0,0 +1,14 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import type { Creator } from "./creator";
import type { Pagination } from "./pagination";
export interface CreatorsResponse {
creators: Creator[];
pagination: Pagination;
}

View File

@@ -0,0 +1,13 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export interface CredentialsDeletionNeedsConfirmationResponse {
deleted?: false;
need_confirmation?: true;
message: string;
}

View File

@@ -0,0 +1,14 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import type { CredentialsDeletionResponseRevoked } from "./credentialsDeletionResponseRevoked";
export interface CredentialsDeletionResponse {
deleted?: true;
/** Indicates whether the credentials were also revoked by their provider. `None`/`null` if not applicable, e.g. when deleting non-revocable credentials such as API keys. */
revoked: CredentialsDeletionResponseRevoked;
}

View File

@@ -0,0 +1,12 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
/**
* Indicates whether the credentials were also revoked by their provider. `None`/`null` if not applicable, e.g. when deleting non-revocable credentials such as API keys.
*/
export type CredentialsDeletionResponseRevoked = boolean | null;

View File

@@ -0,0 +1,17 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import type { CredentialsMetaInputTitle } from "./credentialsMetaInputTitle";
import type { ProviderName } from "./providerName";
import type { CredentialsMetaInputType } from "./credentialsMetaInputType";
export interface CredentialsMetaInput {
id: string;
title?: CredentialsMetaInputTitle;
provider: ProviderName;
type: CredentialsMetaInputType;
}

View File

@@ -0,0 +1,9 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type CredentialsMetaInputTitle = string | null;

View File

@@ -0,0 +1,18 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type CredentialsMetaInputType =
(typeof CredentialsMetaInputType)[keyof typeof CredentialsMetaInputType];
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const CredentialsMetaInputType = {
api_key: "api_key",
oauth2: "oauth2",
user_password: "user_password",
host_scoped: "host_scoped",
} as const;

View File

@@ -0,0 +1,23 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import type { CredentialsMetaResponseType } from "./credentialsMetaResponseType";
import type { CredentialsMetaResponseTitle } from "./credentialsMetaResponseTitle";
import type { CredentialsMetaResponseScopes } from "./credentialsMetaResponseScopes";
import type { CredentialsMetaResponseUsername } from "./credentialsMetaResponseUsername";
import type { CredentialsMetaResponseHost } from "./credentialsMetaResponseHost";
export interface CredentialsMetaResponse {
id: string;
provider: string;
type: CredentialsMetaResponseType;
title: CredentialsMetaResponseTitle;
scopes: CredentialsMetaResponseScopes;
username: CredentialsMetaResponseUsername;
/** Host pattern for host-scoped credentials */
host?: CredentialsMetaResponseHost;
}

View File

@@ -0,0 +1,12 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
/**
* Host pattern for host-scoped credentials
*/
export type CredentialsMetaResponseHost = string | null;

View File

@@ -0,0 +1,9 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type CredentialsMetaResponseScopes = string[] | null;

View File

@@ -0,0 +1,9 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type CredentialsMetaResponseTitle = string | null;

View File

@@ -0,0 +1,18 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type CredentialsMetaResponseType =
(typeof CredentialsMetaResponseType)[keyof typeof CredentialsMetaResponseType];
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const CredentialsMetaResponseType = {
api_key: "api_key",
oauth2: "oauth2",
user_password: "user_password",
host_scoped: "host_scoped",
} as const;

View File

@@ -0,0 +1,9 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type CredentialsMetaResponseUsername = string | null;

View File

@@ -0,0 +1,19 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type CreditTransactionType =
(typeof CreditTransactionType)[keyof typeof CreditTransactionType];
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const CreditTransactionType = {
TOP_UP: "TOP_UP",
USAGE: "USAGE",
GRANT: "GRANT",
REFUND: "REFUND",
CARD_CHECK: "CARD_CHECK",
} as const;

View File

@@ -0,0 +1,11 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export interface DeleteGraphResponse {
version_counts: number;
}

View File

@@ -0,0 +1,13 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import type { CredentialsDeletionResponse } from "./credentialsDeletionResponse";
import type { CredentialsDeletionNeedsConfirmationResponse } from "./credentialsDeletionNeedsConfirmationResponse";
export type DeleteV1DeleteCredentials200 =
| CredentialsDeletionResponse
| CredentialsDeletionNeedsConfirmationResponse;

View File

@@ -0,0 +1,11 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type DeleteV1DeleteCredentialsParams = {
force?: boolean;
};

View File

@@ -0,0 +1,9 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type DeleteV1DeleteExecutionSchedule200 = { [key: string]: unknown };

View File

@@ -0,0 +1,12 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export interface Document {
url: string;
relevance_score: number;
}

View File

@@ -0,0 +1,11 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export interface ExecuteGraphResponse {
graph_exec_id: string;
}

View File

@@ -0,0 +1,17 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import type { OAuth2Credentials } from "./oAuth2Credentials";
import type { APIKeyCredentials } from "./aPIKeyCredentials";
import type { UserPasswordCredentials } from "./userPasswordCredentials";
import type { HostScopedCredentialsOutput } from "./hostScopedCredentialsOutput";
export type GetV1GetCredential200 =
| OAuth2Credentials
| APIKeyCredentials
| UserPasswordCredentials
| HostScopedCredentialsOutput;

View File

@@ -0,0 +1,13 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type GetV1GetCreditHistoryParams = {
transaction_time?: string | null;
transaction_type?: string | null;
transaction_count_limit?: number;
};

View File

@@ -0,0 +1,13 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import type { GraphExecution } from "./graphExecution";
import type { GraphExecutionWithNodes } from "./graphExecutionWithNodes";
export type GetV1GetExecutionDetails200 =
| GraphExecution
| GraphExecutionWithNodes;

View File

@@ -0,0 +1,11 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type GetV1GetGraphVersionParams = {
for_export?: boolean;
};

View File

@@ -0,0 +1,12 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type GetV1GetSpecificGraphParams = {
version?: number | null;
for_export?: boolean;
};

View File

@@ -0,0 +1,9 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type GetV1GetUserCredits200 = { [key: string]: number };

View File

@@ -0,0 +1,9 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type GetV1ListAvailableBlocks200Item = { [key: string]: unknown };

View File

@@ -0,0 +1,13 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import type { APIKeyWithoutHash } from "./aPIKeyWithoutHash";
import type { GetV1ListUserApiKeys200AnyOf } from "./getV1ListUserApiKeys200AnyOf";
export type GetV1ListUserApiKeys200 =
| APIKeyWithoutHash[]
| GetV1ListUserApiKeys200AnyOf;

View File

@@ -0,0 +1,9 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type GetV1ListUserApiKeys200AnyOf = { [key: string]: string };

View File

@@ -0,0 +1,11 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type GetV1LoginParams = {
scopes?: string;
};

View File

@@ -0,0 +1,9 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type GetV1ManagePaymentMethods200 = { [key: string]: string };

View File

@@ -0,0 +1,15 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import type { SubmissionStatus } from "./submissionStatus";
export type GetV2GetAdminListingsHistoryParams = {
status?: SubmissionStatus | null;
search?: string | null;
page?: number;
page_size?: number;
};

View File

@@ -0,0 +1,10 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import type { LibraryAgent } from "./libraryAgent";
export type GetV2GetAgentByStoreId200 = LibraryAgent | null;

View File

@@ -0,0 +1,15 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import type { CreditTransactionType } from "./creditTransactionType";
export type GetV2GetAllUsersHistoryParams = {
search?: string | null;
page?: number;
page_size?: number;
transaction_filter?: CreditTransactionType | null;
};

View File

@@ -0,0 +1,11 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type GetV2GetLibraryAgentByGraphIdParams = {
version?: number | null;
};

View File

@@ -0,0 +1,29 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import type { LibraryAgentSort } from "./libraryAgentSort";
export type GetV2ListLibraryAgentsParams = {
/**
* Search term to filter agents
*/
search_term?: string | null;
/**
* Criteria to sort results by
*/
sort_by?: LibraryAgentSort;
/**
* Page number to retrieve (must be >= 1)
* @minimum 1
*/
page?: number;
/**
* Number of agents per page (must be >= 1)
* @minimum 1
*/
page_size?: number;
};

View File

@@ -0,0 +1,12 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type GetV2ListMySubmissionsParams = {
page?: number;
page_size?: number;
};

View File

@@ -0,0 +1,22 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type GetV2ListPresetsParams = {
/**
* @minimum 1
*/
page?: number;
/**
* @minimum 1
*/
page_size?: number;
/**
* Allows to filter presets by a specific agent graph
*/
graph_id: string | null;
};

View File

@@ -0,0 +1,17 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type GetV2ListStoreAgentsParams = {
featured?: boolean;
creator?: string | null;
sorted_by?: string | null;
search_query?: string | null;
category?: string | null;
page?: number;
page_size?: number;
};

Some files were not shown because too many files have changed in this diff Show More