🔧 refactor: Integrate PrincipalModel Enum for Principal Handling

- Replaced string literals for principal models ('User', 'Group') with the new PrincipalModel enum across various models, services, and tests to enhance type safety and consistency.
- Updated permission handling in multiple files to utilize the PrincipalModel enum, improving maintainability and reducing potential errors.
- Ensured all relevant tests reflect these changes to maintain coverage and functionality.
This commit is contained in:
Danny Avila 2025-08-02 16:14:11 -04:00
parent 49d1cefe71
commit 28d63dab71
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956
10 changed files with 61 additions and 30 deletions

View file

@ -22,6 +22,16 @@ jest.mock('librechat-data-provider', () => ({
GROUP: 'group',
PUBLIC: 'public',
},
PrincipalModel: {
USER: 'User',
GROUP: 'Group',
},
ResourceType: {
AGENT: 'agent',
PROJECT: 'project',
FILE: 'file',
PROMPTGROUP: 'promptGroup',
},
FileContext: { message_attachment: 'message_attachment' },
FileSources: { local: 'local' },
EModelEndpoint: { assistants: 'assistants' },