mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-16 13:00:55 +00:00
* 🚜 feat: Support Native PostgreSQL Tool Favorites
* fix: Guard PostgreSQL Reconciliation and Connection Leases
* fix: Scope Favorites Erasure Fences to Deletion Attempts
* fix: Preserve Account Erasure Ownership Until Cancellation Completes
* fix: Reject Unsupported PostgreSQL Command Flags Before Connecting
* fix: Keep Command Validation Compatible With the TypeScript Target
* fix: Keep Migration Previews Read-Only and Preserve Erasure Recovery Identity
* fix: Fence Erasure Recovery Across Tenant and Ownership Changes
* fix: Isolate Migration Dependencies and Keep Mongo Scans Outside Transactions
* fix: Inject PostgreSQL Backend Factories at Composition Roots
* ci: Shard Complete Mutation Work Without Relaxing the Aggregate Gate
---------
Co-authored-by: Lia <lia@librechat.ai>
51 lines
1.4 KiB
JavaScript
51 lines
1.4 KiB
JavaScript
const mongoose = require('mongoose');
|
|
const {
|
|
createMethods,
|
|
createToolFavoriteMethods,
|
|
createPostgresFavoriteBackend,
|
|
} = require('@librechat/data-schemas');
|
|
const {
|
|
matchModelName,
|
|
findMatchingPattern,
|
|
isDeploymentSkillId,
|
|
createMessageBudgetReader,
|
|
createFavoriteRuntime,
|
|
getPersistenceConfig,
|
|
createChannelStorageConfigReader,
|
|
} = require('@librechat/api');
|
|
const getLogStores = require('~/cache/getLogStores');
|
|
|
|
const messageBudget = createMessageBudgetReader();
|
|
const channelStorageConfig = createChannelStorageConfigReader();
|
|
|
|
const favorites = createFavoriteRuntime(
|
|
createToolFavoriteMethods(mongoose),
|
|
process.env,
|
|
createPostgresFavoriteBackend,
|
|
);
|
|
|
|
const methods = createMethods(mongoose, {
|
|
toolFavorites: favorites.methods,
|
|
matchModelName,
|
|
findMatchingPattern,
|
|
isExternalSkillId: isDeploymentSkillId,
|
|
getCache: getLogStores,
|
|
getChannelStorageConfig: channelStorageConfig.getConfig,
|
|
getMCPAppMessageBudget: messageBudget.getBudget,
|
|
});
|
|
|
|
const seedDatabase = async () => {
|
|
await methods.initializeRoles();
|
|
await methods.seedDefaultRoles();
|
|
await methods.ensureDefaultCategories();
|
|
await methods.seedSystemGrants();
|
|
};
|
|
|
|
module.exports = {
|
|
...methods,
|
|
initializeFavorites: (config) => favorites.initialize(getPersistenceConfig(config)),
|
|
closeFavorites: favorites.close,
|
|
initializeMessageBudget: messageBudget.initialize,
|
|
initializeChannelStorageConfig: channelStorageConfig.initialize,
|
|
seedDatabase,
|
|
};
|