mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-02 08:38:51 +01:00
🛒 feat: Implement Marketplace Permissions Management UI
- Added MarketplaceAdminSettings component for managing marketplace permissions. - Updated roles.js to include marketplace permissions in the API. - Refactored interface.js to streamline marketplace permissions handling. - Enhanced Marketplace component to integrate admin settings. - Updated localization files to include new marketplace-related keys. - Added new API endpoint for updating marketplace permissions in data-service.
This commit is contained in:
parent
a434d28579
commit
d07c2b3475
10 changed files with 297 additions and 29 deletions
|
|
@ -278,6 +278,9 @@ export const updateAgentPermissions = (roleName: string) => `${getRole(roleName)
|
|||
export const updatePeoplePickerPermissions = (roleName: string) =>
|
||||
`${getRole(roleName)}/people-picker`;
|
||||
|
||||
export const updateMarketplacePermissions = (roleName: string) =>
|
||||
`${getRole(roleName)}/marketplace`;
|
||||
|
||||
/* Conversation Tags */
|
||||
export const conversationTags = (tag?: string) =>
|
||||
`/api/tags${tag != null && tag ? `/${encodeURIComponent(tag)}` : ''}`;
|
||||
|
|
|
|||
|
|
@ -541,16 +541,7 @@ export const interfaceSchema = z
|
|||
.optional(),
|
||||
marketplace: z
|
||||
.object({
|
||||
admin: z
|
||||
.object({
|
||||
use: z.boolean().optional(),
|
||||
})
|
||||
.optional(),
|
||||
user: z
|
||||
.object({
|
||||
use: z.boolean().optional(),
|
||||
})
|
||||
.optional(),
|
||||
use: z.boolean().optional(),
|
||||
})
|
||||
.optional(),
|
||||
fileSearch: z.boolean().optional(),
|
||||
|
|
@ -576,12 +567,7 @@ export const interfaceSchema = z
|
|||
roles: true,
|
||||
},
|
||||
marketplace: {
|
||||
admin: {
|
||||
use: false,
|
||||
},
|
||||
user: {
|
||||
use: false,
|
||||
},
|
||||
use: false,
|
||||
},
|
||||
fileSearch: true,
|
||||
fileCitations: true,
|
||||
|
|
|
|||
|
|
@ -800,6 +800,12 @@ export function updatePeoplePickerPermissions(
|
|||
);
|
||||
}
|
||||
|
||||
export function updateMarketplacePermissions(
|
||||
variables: m.UpdateMarketplacePermVars,
|
||||
): Promise<m.UpdatePermResponse> {
|
||||
return request.put(endpoints.updateMarketplacePermissions(variables.roleName), variables.updates);
|
||||
}
|
||||
|
||||
/* Tags */
|
||||
export function getConversationTags(): Promise<t.TConversationTagsResponse> {
|
||||
return request.get(endpoints.conversationTags());
|
||||
|
|
|
|||
|
|
@ -305,6 +305,15 @@ export type UpdatePeoplePickerPermOptions = MutationOptions<
|
|||
types.TError | null | undefined
|
||||
>;
|
||||
|
||||
export type UpdateMarketplacePermVars = UpdatePermVars<p.TMarketplacePermissions>;
|
||||
|
||||
export type UpdateMarketplacePermOptions = MutationOptions<
|
||||
UpdatePermResponse,
|
||||
UpdateMarketplacePermVars,
|
||||
unknown,
|
||||
types.TError | null | undefined
|
||||
>;
|
||||
|
||||
export type UpdateConversationTagOptions = MutationOptions<
|
||||
types.TConversationTag,
|
||||
types.TConversationTagRequest
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue