Files
AutoGPT/autogpt_platform/frontend/orval.config.ts
Abhimanyu Yadav f2a26b547b feat(frontend): add prefetch queries for various endpoints and enhance API configurations (#10394)
This update enhances the performance and user experience by allowing
data to be prefetched, reducing loading times on the frontend.

### Changes
- Introduced `usePrefetch` in Orval configuration to support
prefetching.
- Added prefetch queries for user profiles, admin listings history,
notification preferences, and execution schedules.
- Updated OpenAPI specifications to include descriptions for provider
names and adjusted required fields in request models.
- Enhanced the Navbar component to utilize the new prefetch
functionality for user profile data.
- Improved type definitions for various models to ensure better
integration with the API.

### 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] I’ve checked everything manually, and everything is working fine.
2025-07-16 12:46:02 +00:00

64 lines
1.6 KiB
TypeScript

import { defineConfig } from "orval";
export default defineConfig({
autogpt_api_client: {
input: {
target: `./src/app/api/openapi.json`,
override: {
transformer: "./src/app/api/transformers/fix-tags.mjs",
},
},
output: {
workspace: "./src/app/api",
target: `./__generated__/endpoints`,
schemas: "./__generated__/models",
mode: "tags-split",
client: "react-query",
httpClient: "fetch",
indexFiles: false,
override: {
mutator: {
path: "./mutators/custom-mutator.ts",
name: "customMutator",
},
query: {
useQuery: true,
useMutation: true,
usePrefetch: true,
// Will add more as their use cases arise
},
operations: {
"getV2List library agents": {
query: {
useInfinite: true,
useInfiniteQueryParam: "page",
},
},
},
},
},
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",
// },
// },
});