mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-28 22:28:51 +01:00
- Refactored model creation functions to enhance clarity and consistency across the data-schemas. - Introduced createModels and createMethods functions to streamline the instantiation of Mongoose models and methods. - Updated test-role.js to utilize the new createModels and createMethods for better organization.
18 lines
641 B
TypeScript
18 lines
641 B
TypeScript
import { createUserMethods, type UserMethods } from './user';
|
|
import { createSessionMethods, type SessionMethods } from './session';
|
|
import { createTokenMethods, type TokenMethods } from './token';
|
|
import { createRoleMethods, type RoleMethods } from './role';
|
|
|
|
/**
|
|
* Creates all database methods for all collections
|
|
*/
|
|
export function createMethods(mongoose: typeof import('mongoose')) {
|
|
return {
|
|
...createUserMethods(mongoose),
|
|
...createSessionMethods(mongoose),
|
|
...createTokenMethods(mongoose),
|
|
...createRoleMethods(mongoose),
|
|
};
|
|
}
|
|
|
|
export type AllMethods = UserMethods & SessionMethods & TokenMethods & RoleMethods;
|