mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-30 03:00:41 -04:00
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.
64 lines
1.6 KiB
TypeScript
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",
|
|
// },
|
|
// },
|
|
});
|