mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-15 15:08:10 +01:00
refactor: consolidate agent marketplace endpoints into main agents API and improve data management consistency
- Remove dedicated marketplace controller and routes, merging functionality into main agents v1 API - Add countPromotedAgents function to Agent model for promoted agents count - Enhance getListAgents handler with marketplace filtering (category, search, promoted status) - Move getAgentCategories from marketplace to v1 controller with same functionality - Update agent mutations to invalidate marketplace queries and handle multiple permission levels - Improve cache management by updating all agent query variants (VIEW/EDIT permissions) - Consolidate agent data access patterns for better maintainability and consistency - Remove duplicate marketplace route definitions and middleware
This commit is contained in:
parent
3f6d7ab7c7
commit
6a28d01b20
14 changed files with 291 additions and 412 deletions
|
|
@ -451,7 +451,7 @@ export const revertAgentVersion = ({
|
|||
* Get agent categories with counts for marketplace tabs
|
||||
*/
|
||||
export const getAgentCategories = (): Promise<t.TMarketplaceCategory[]> => {
|
||||
return request.get(endpoints.agents({ path: 'marketplace/categories' }));
|
||||
return request.get(endpoints.agents({ path: 'categories' }));
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -467,7 +467,7 @@ export const getMarketplaceAgents = (params: {
|
|||
}): Promise<a.AgentListResponse> => {
|
||||
return request.get(
|
||||
endpoints.agents({
|
||||
path: 'marketplace',
|
||||
// path: 'marketplace',
|
||||
options: params,
|
||||
}),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -286,11 +286,11 @@ export type AgentUpdateParams = {
|
|||
|
||||
export type AgentListParams = {
|
||||
limit?: number;
|
||||
before?: string | null;
|
||||
after?: string | null;
|
||||
order?: 'asc' | 'desc';
|
||||
provider?: AgentProvider;
|
||||
requiredPermission?: number;
|
||||
requiredPermission: number;
|
||||
category?: string;
|
||||
search?: string;
|
||||
cursor?: string;
|
||||
promoted?: 0 | 1;
|
||||
};
|
||||
|
||||
export type AgentListResponse = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue