mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
🔧 fix: Axios Proxy Usage And Bump mongoose (#6298)
* fix: bump mongoose to fix nested schema errors * fix: Enhance Axios instance creation with improved proxy handling and error logging * fix: Refactor Axios instance creation and remove proxy handling from file upload functions * fix: Update proxy configuration in Axios instance creation and add unit tests
This commit is contained in:
parent
cbd5bd2405
commit
cf03731cc8
6 changed files with 279 additions and 102 deletions
|
|
@ -48,15 +48,37 @@ const sendEvent = (res, event) => {
|
||||||
res.write(`event: message\ndata: ${JSON.stringify(event)}\n\n`);
|
res.write(`event: message\ndata: ${JSON.stringify(event)}\n\n`);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates and configures an Axios instance with optional proxy settings.
|
||||||
|
*
|
||||||
|
* @typedef {import('axios').AxiosInstance} AxiosInstance
|
||||||
|
* @typedef {import('axios').AxiosProxyConfig} AxiosProxyConfig
|
||||||
|
*
|
||||||
|
* @returns {AxiosInstance} A configured Axios instance
|
||||||
|
* @throws {Error} If there's an issue creating the Axios instance or parsing the proxy URL
|
||||||
|
*/
|
||||||
function createAxiosInstance() {
|
function createAxiosInstance() {
|
||||||
const instance = axios.create();
|
const instance = axios.create();
|
||||||
|
|
||||||
if (process.env.proxy) {
|
if (process.env.proxy) {
|
||||||
const url = new URL(process.env.proxy);
|
try {
|
||||||
instance.defaults.proxy = {
|
const url = new URL(process.env.proxy);
|
||||||
host: url.hostname,
|
|
||||||
protocol: url.protocol.replace(':', ''),
|
/** @type {AxiosProxyConfig} */
|
||||||
};
|
const proxyConfig = {
|
||||||
|
host: url.hostname.replace(/^\[|\]$/g, ''),
|
||||||
|
protocol: url.protocol.replace(':', ''),
|
||||||
|
};
|
||||||
|
|
||||||
|
if (url.port) {
|
||||||
|
proxyConfig.port = parseInt(url.port, 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
instance.defaults.proxy = proxyConfig;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error parsing proxy URL:', error);
|
||||||
|
throw new Error(`Invalid proxy URL: ${process.env.proxy}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return instance;
|
return instance;
|
||||||
|
|
|
||||||
126
api/config/index.spec.js
Normal file
126
api/config/index.spec.js
Normal file
|
|
@ -0,0 +1,126 @@
|
||||||
|
const axios = require('axios');
|
||||||
|
const { createAxiosInstance } = require('./index');
|
||||||
|
|
||||||
|
// Mock axios
|
||||||
|
jest.mock('axios', () => ({
|
||||||
|
interceptors: {
|
||||||
|
request: { use: jest.fn(), eject: jest.fn() },
|
||||||
|
response: { use: jest.fn(), eject: jest.fn() },
|
||||||
|
},
|
||||||
|
create: jest.fn().mockReturnValue({
|
||||||
|
defaults: {
|
||||||
|
proxy: null,
|
||||||
|
},
|
||||||
|
get: jest.fn().mockResolvedValue({ data: {} }),
|
||||||
|
post: jest.fn().mockResolvedValue({ data: {} }),
|
||||||
|
put: jest.fn().mockResolvedValue({ data: {} }),
|
||||||
|
delete: jest.fn().mockResolvedValue({ data: {} }),
|
||||||
|
}),
|
||||||
|
get: jest.fn().mockResolvedValue({ data: {} }),
|
||||||
|
post: jest.fn().mockResolvedValue({ data: {} }),
|
||||||
|
put: jest.fn().mockResolvedValue({ data: {} }),
|
||||||
|
delete: jest.fn().mockResolvedValue({ data: {} }),
|
||||||
|
reset: jest.fn().mockImplementation(function () {
|
||||||
|
this.get.mockClear();
|
||||||
|
this.post.mockClear();
|
||||||
|
this.put.mockClear();
|
||||||
|
this.delete.mockClear();
|
||||||
|
this.create.mockClear();
|
||||||
|
}),
|
||||||
|
}));
|
||||||
|
|
||||||
|
describe('createAxiosInstance', () => {
|
||||||
|
const originalEnv = process.env;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
// Reset mocks
|
||||||
|
jest.clearAllMocks();
|
||||||
|
// Create a clean copy of process.env
|
||||||
|
process.env = { ...originalEnv };
|
||||||
|
// Default: no proxy
|
||||||
|
delete process.env.proxy;
|
||||||
|
});
|
||||||
|
|
||||||
|
afterAll(() => {
|
||||||
|
// Restore original process.env
|
||||||
|
process.env = originalEnv;
|
||||||
|
});
|
||||||
|
|
||||||
|
test('creates an axios instance without proxy when no proxy env is set', () => {
|
||||||
|
const instance = createAxiosInstance();
|
||||||
|
|
||||||
|
expect(axios.create).toHaveBeenCalledTimes(1);
|
||||||
|
expect(instance.defaults.proxy).toBeNull();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('configures proxy correctly with hostname and protocol', () => {
|
||||||
|
process.env.proxy = 'http://example.com';
|
||||||
|
|
||||||
|
const instance = createAxiosInstance();
|
||||||
|
|
||||||
|
expect(axios.create).toHaveBeenCalledTimes(1);
|
||||||
|
expect(instance.defaults.proxy).toEqual({
|
||||||
|
host: 'example.com',
|
||||||
|
protocol: 'http',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test('configures proxy correctly with hostname, protocol and port', () => {
|
||||||
|
process.env.proxy = 'https://proxy.example.com:8080';
|
||||||
|
|
||||||
|
const instance = createAxiosInstance();
|
||||||
|
|
||||||
|
expect(axios.create).toHaveBeenCalledTimes(1);
|
||||||
|
expect(instance.defaults.proxy).toEqual({
|
||||||
|
host: 'proxy.example.com',
|
||||||
|
protocol: 'https',
|
||||||
|
port: 8080,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test('handles proxy URLs with authentication', () => {
|
||||||
|
process.env.proxy = 'http://user:pass@proxy.example.com:3128';
|
||||||
|
|
||||||
|
const instance = createAxiosInstance();
|
||||||
|
|
||||||
|
expect(axios.create).toHaveBeenCalledTimes(1);
|
||||||
|
expect(instance.defaults.proxy).toEqual({
|
||||||
|
host: 'proxy.example.com',
|
||||||
|
protocol: 'http',
|
||||||
|
port: 3128,
|
||||||
|
// Note: The current implementation doesn't handle auth - if needed, add this functionality
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test('throws error when proxy URL is invalid', () => {
|
||||||
|
process.env.proxy = 'invalid-url';
|
||||||
|
|
||||||
|
expect(() => createAxiosInstance()).toThrow('Invalid proxy URL');
|
||||||
|
expect(axios.create).toHaveBeenCalledTimes(1);
|
||||||
|
});
|
||||||
|
|
||||||
|
// If you want to test the actual URL parsing more thoroughly
|
||||||
|
test('handles edge case proxy URLs correctly', () => {
|
||||||
|
// IPv6 address
|
||||||
|
process.env.proxy = 'http://[::1]:8080';
|
||||||
|
|
||||||
|
let instance = createAxiosInstance();
|
||||||
|
|
||||||
|
expect(instance.defaults.proxy).toEqual({
|
||||||
|
host: '::1',
|
||||||
|
protocol: 'http',
|
||||||
|
port: 8080,
|
||||||
|
});
|
||||||
|
|
||||||
|
// URL with path (which should be ignored for proxy config)
|
||||||
|
process.env.proxy = 'http://proxy.example.com:8080/some/path';
|
||||||
|
|
||||||
|
instance = createAxiosInstance();
|
||||||
|
|
||||||
|
expect(instance.defaults.proxy).toEqual({
|
||||||
|
host: 'proxy.example.com',
|
||||||
|
protocol: 'http',
|
||||||
|
port: 8080,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
@ -82,7 +82,7 @@
|
||||||
"memorystore": "^1.6.7",
|
"memorystore": "^1.6.7",
|
||||||
"mime": "^3.0.0",
|
"mime": "^3.0.0",
|
||||||
"module-alias": "^2.2.3",
|
"module-alias": "^2.2.3",
|
||||||
"mongoose": "^8.9.5",
|
"mongoose": "^8.12.1",
|
||||||
"multer": "^1.4.5-lts.1",
|
"multer": "^1.4.5-lts.1",
|
||||||
"nanoid": "^3.3.7",
|
"nanoid": "^3.3.7",
|
||||||
"nodemailer": "^6.9.15",
|
"nodemailer": "^6.9.15",
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
const axios = require('axios');
|
|
||||||
const FormData = require('form-data');
|
const FormData = require('form-data');
|
||||||
const { getCodeBaseURL } = require('@librechat/agents');
|
const { getCodeBaseURL } = require('@librechat/agents');
|
||||||
|
const { createAxiosInstance } = require('~/config');
|
||||||
const { logAxiosError } = require('~/utils');
|
const { logAxiosError } = require('~/utils');
|
||||||
|
|
||||||
|
const axios = createAxiosInstance();
|
||||||
|
|
||||||
const MAX_FILE_SIZE = 150 * 1024 * 1024;
|
const MAX_FILE_SIZE = 150 * 1024 * 1024;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -27,13 +29,6 @@ async function getCodeOutputDownloadStream(fileIdentifier, apiKey) {
|
||||||
timeout: 15000,
|
timeout: 15000,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (process.env.PROXY) {
|
|
||||||
options.proxy = {
|
|
||||||
host: process.env.PROXY,
|
|
||||||
protocol: process.env.PROXY.startsWith('https') ? 'https' : 'http',
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const response = await axios(options);
|
const response = await axios(options);
|
||||||
return response;
|
return response;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
@ -79,13 +74,6 @@ async function uploadCodeEnvFile({ req, stream, filename, apiKey, entity_id = ''
|
||||||
maxBodyLength: MAX_FILE_SIZE,
|
maxBodyLength: MAX_FILE_SIZE,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (process.env.PROXY) {
|
|
||||||
options.proxy = {
|
|
||||||
host: process.env.PROXY,
|
|
||||||
protocol: process.env.PROXY.startsWith('https') ? 'https' : 'http',
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const response = await axios.post(`${baseURL}/upload`, form, options);
|
const response = await axios.post(`${baseURL}/upload`, form, options);
|
||||||
|
|
||||||
/** @type {{ message: string; session_id: string; files: Array<{ fileId: string; filename: string }> }} */
|
/** @type {{ message: string; session_id: string; files: Array<{ fileId: string; filename: string }> }} */
|
||||||
|
|
|
||||||
201
package-lock.json
generated
201
package-lock.json
generated
|
|
@ -98,7 +98,7 @@
|
||||||
"memorystore": "^1.6.7",
|
"memorystore": "^1.6.7",
|
||||||
"mime": "^3.0.0",
|
"mime": "^3.0.0",
|
||||||
"module-alias": "^2.2.3",
|
"module-alias": "^2.2.3",
|
||||||
"mongoose": "^8.9.5",
|
"mongoose": "^8.12.1",
|
||||||
"multer": "^1.4.5-lts.1",
|
"multer": "^1.4.5-lts.1",
|
||||||
"nanoid": "^3.3.7",
|
"nanoid": "^3.3.7",
|
||||||
"nodemailer": "^6.9.15",
|
"nodemailer": "^6.9.15",
|
||||||
|
|
@ -677,7 +677,6 @@
|
||||||
"version": "11.0.5",
|
"version": "11.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-11.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-11.0.5.tgz",
|
||||||
"integrity": "sha512-coYR071JRaHa+xoEvvYqvnIHaVqaYrLPbsufM9BF63HkwI5Lgmy2QR8Q5K/lYDYo5AK82wOvSOS0UsLTpTG7uQ==",
|
"integrity": "sha512-coYR071JRaHa+xoEvvYqvnIHaVqaYrLPbsufM9BF63HkwI5Lgmy2QR8Q5K/lYDYo5AK82wOvSOS0UsLTpTG7uQ==",
|
||||||
"devOptional": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/webidl-conversions": "*"
|
"@types/webidl-conversions": "*"
|
||||||
}
|
}
|
||||||
|
|
@ -691,6 +690,14 @@
|
||||||
"node": ">= 14"
|
"node": ">= 14"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"api/node_modules/bson": {
|
||||||
|
"version": "6.10.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/bson/-/bson-6.10.3.tgz",
|
||||||
|
"integrity": "sha512-MTxGsqgYTwfshYWTRdmZRC+M7FnG1b4y7RO7p2k3X24Wq0yv1m77Wsj0BzlPzd/IowgESfsruQCUToa7vbOpPQ==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16.20.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"api/node_modules/cookie-parser": {
|
"api/node_modules/cookie-parser": {
|
||||||
"version": "1.4.7",
|
"version": "1.4.7",
|
||||||
"resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.4.7.tgz",
|
"resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.4.7.tgz",
|
||||||
|
|
@ -880,13 +887,12 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"api/node_modules/mongodb": {
|
"api/node_modules/mongodb": {
|
||||||
"version": "6.10.0",
|
"version": "6.14.2",
|
||||||
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.10.0.tgz",
|
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.14.2.tgz",
|
||||||
"integrity": "sha512-gP9vduuYWb9ZkDM546M+MP2qKVk5ZG2wPF63OvSRuUbqCR+11ZCAE1mOfllhlAG0wcoJY5yDL/rV3OmYEwXIzg==",
|
"integrity": "sha512-kMEHNo0F3P6QKDq17zcDuPeaywK/YaJVCEQRzPF3TOM/Bl9MFg64YE5Tu7ifj37qZJMhwU1tl2Ioivws5gRG5Q==",
|
||||||
"devOptional": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@mongodb-js/saslprep": "^1.1.5",
|
"@mongodb-js/saslprep": "^1.1.9",
|
||||||
"bson": "^6.7.0",
|
"bson": "^6.10.3",
|
||||||
"mongodb-connection-string-url": "^3.0.0"
|
"mongodb-connection-string-url": "^3.0.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
@ -894,7 +900,7 @@
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@aws-sdk/credential-providers": "^3.188.0",
|
"@aws-sdk/credential-providers": "^3.188.0",
|
||||||
"@mongodb-js/zstd": "^1.1.0",
|
"@mongodb-js/zstd": "^1.1.0 || ^2.0.0",
|
||||||
"gcp-metadata": "^5.2.0",
|
"gcp-metadata": "^5.2.0",
|
||||||
"kerberos": "^2.0.1",
|
"kerberos": "^2.0.1",
|
||||||
"mongodb-client-encryption": ">=6.0.0 <7",
|
"mongodb-client-encryption": ">=6.0.0 <7",
|
||||||
|
|
@ -929,7 +935,6 @@
|
||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.1.tgz",
|
||||||
"integrity": "sha512-XqMGwRX0Lgn05TDB4PyG2h2kKO/FfWJyCzYQbIhXUxz7ETt0I/FqHjUeqj37irJ+Dl1ZtU82uYyj14u2XsZKfg==",
|
"integrity": "sha512-XqMGwRX0Lgn05TDB4PyG2h2kKO/FfWJyCzYQbIhXUxz7ETt0I/FqHjUeqj37irJ+Dl1ZtU82uYyj14u2XsZKfg==",
|
||||||
"devOptional": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/whatwg-url": "^11.0.2",
|
"@types/whatwg-url": "^11.0.2",
|
||||||
"whatwg-url": "^13.0.0"
|
"whatwg-url": "^13.0.0"
|
||||||
|
|
@ -939,7 +944,6 @@
|
||||||
"version": "4.1.1",
|
"version": "4.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz",
|
||||||
"integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==",
|
"integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==",
|
||||||
"devOptional": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"punycode": "^2.3.0"
|
"punycode": "^2.3.0"
|
||||||
},
|
},
|
||||||
|
|
@ -951,7 +955,6 @@
|
||||||
"version": "7.0.0",
|
"version": "7.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz",
|
||||||
"integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==",
|
"integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==",
|
||||||
"devOptional": true,
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
}
|
}
|
||||||
|
|
@ -960,7 +963,6 @@
|
||||||
"version": "13.0.0",
|
"version": "13.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-13.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-13.0.0.tgz",
|
||||||
"integrity": "sha512-9WWbymnqj57+XEuqADHrCJ2eSXzn8WXIW/YSGaZtb2WKAInQ6CHfaUUcTyyver0p8BDg5StLQq8h1vtZuwmOig==",
|
"integrity": "sha512-9WWbymnqj57+XEuqADHrCJ2eSXzn8WXIW/YSGaZtb2WKAInQ6CHfaUUcTyyver0p8BDg5StLQq8h1vtZuwmOig==",
|
||||||
"devOptional": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"tr46": "^4.1.1",
|
"tr46": "^4.1.1",
|
||||||
"webidl-conversions": "^7.0.0"
|
"webidl-conversions": "^7.0.0"
|
||||||
|
|
@ -1008,6 +1010,27 @@
|
||||||
"node": ">=16.20.1"
|
"node": ">=16.20.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"api/node_modules/mongoose": {
|
||||||
|
"version": "8.12.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.12.1.tgz",
|
||||||
|
"integrity": "sha512-UW22y8QFVYmrb36hm8cGncfn4ARc/XsYWQwRTaj0gxtQk1rDuhzDO1eBantS+hTTatfAIS96LlRCJrcNHvW5+Q==",
|
||||||
|
"dependencies": {
|
||||||
|
"bson": "^6.10.3",
|
||||||
|
"kareem": "2.6.3",
|
||||||
|
"mongodb": "~6.14.0",
|
||||||
|
"mpath": "0.9.0",
|
||||||
|
"mquery": "5.0.0",
|
||||||
|
"ms": "2.1.3",
|
||||||
|
"sift": "17.1.3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16.20.1"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/mongoose"
|
||||||
|
}
|
||||||
|
},
|
||||||
"api/node_modules/node-fetch": {
|
"api/node_modules/node-fetch": {
|
||||||
"version": "2.6.7",
|
"version": "2.6.7",
|
||||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
|
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
|
||||||
|
|
@ -22564,6 +22587,8 @@
|
||||||
"version": "6.10.1",
|
"version": "6.10.1",
|
||||||
"resolved": "https://registry.npmjs.org/bson/-/bson-6.10.1.tgz",
|
"resolved": "https://registry.npmjs.org/bson/-/bson-6.10.1.tgz",
|
||||||
"integrity": "sha512-P92xmHDQjSKPLHqFxefqMxASNq/aWJMEZugpCjf+AF/pgcUpMMQCg7t7+ewko0/u8AapvF3luf/FoehddEK+sA==",
|
"integrity": "sha512-P92xmHDQjSKPLHqFxefqMxASNq/aWJMEZugpCjf+AF/pgcUpMMQCg7t7+ewko0/u8AapvF3luf/FoehddEK+sA==",
|
||||||
|
"optional": true,
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.20.1"
|
"node": ">=16.20.1"
|
||||||
}
|
}
|
||||||
|
|
@ -31839,6 +31864,8 @@
|
||||||
"version": "6.12.0",
|
"version": "6.12.0",
|
||||||
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.12.0.tgz",
|
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.12.0.tgz",
|
||||||
"integrity": "sha512-RM7AHlvYfS7jv7+BXund/kR64DryVI+cHbVAy9P61fnb1RcWZqOW1/Wj2YhqMCx+MuYhqTRGv7AwHBzmsCKBfA==",
|
"integrity": "sha512-RM7AHlvYfS7jv7+BXund/kR64DryVI+cHbVAy9P61fnb1RcWZqOW1/Wj2YhqMCx+MuYhqTRGv7AwHBzmsCKBfA==",
|
||||||
|
"optional": true,
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@mongodb-js/saslprep": "^1.1.9",
|
"@mongodb-js/saslprep": "^1.1.9",
|
||||||
"bson": "^6.10.1",
|
"bson": "^6.10.1",
|
||||||
|
|
@ -31893,6 +31920,8 @@
|
||||||
"version": "11.0.5",
|
"version": "11.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-11.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-11.0.5.tgz",
|
||||||
"integrity": "sha512-coYR071JRaHa+xoEvvYqvnIHaVqaYrLPbsufM9BF63HkwI5Lgmy2QR8Q5K/lYDYo5AK82wOvSOS0UsLTpTG7uQ==",
|
"integrity": "sha512-coYR071JRaHa+xoEvvYqvnIHaVqaYrLPbsufM9BF63HkwI5Lgmy2QR8Q5K/lYDYo5AK82wOvSOS0UsLTpTG7uQ==",
|
||||||
|
"optional": true,
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/webidl-conversions": "*"
|
"@types/webidl-conversions": "*"
|
||||||
}
|
}
|
||||||
|
|
@ -31901,6 +31930,8 @@
|
||||||
"version": "3.0.2",
|
"version": "3.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.2.tgz",
|
||||||
"integrity": "sha512-rMO7CGo/9BFwyZABcKAWL8UJwH/Kc2x0g72uhDWzG48URRax5TCIcJ7Rc3RZqffZzO/Gwff/jyKwCU9TN8gehA==",
|
"integrity": "sha512-rMO7CGo/9BFwyZABcKAWL8UJwH/Kc2x0g72uhDWzG48URRax5TCIcJ7Rc3RZqffZzO/Gwff/jyKwCU9TN8gehA==",
|
||||||
|
"optional": true,
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/whatwg-url": "^11.0.2",
|
"@types/whatwg-url": "^11.0.2",
|
||||||
"whatwg-url": "^14.1.0 || ^13.0.0"
|
"whatwg-url": "^14.1.0 || ^13.0.0"
|
||||||
|
|
@ -31910,6 +31941,8 @@
|
||||||
"version": "5.0.0",
|
"version": "5.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-5.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/tr46/-/tr46-5.0.0.tgz",
|
||||||
"integrity": "sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==",
|
"integrity": "sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==",
|
||||||
|
"optional": true,
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"punycode": "^2.3.1"
|
"punycode": "^2.3.1"
|
||||||
},
|
},
|
||||||
|
|
@ -31921,6 +31954,8 @@
|
||||||
"version": "14.1.0",
|
"version": "14.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.1.0.tgz",
|
||||||
"integrity": "sha512-jlf/foYIKywAt3x/XWKZ/3rz8OSJPiWktjmk891alJUEjiVxKX9LEO92qH3hv4aJ0mN3MWPvGMCy8jQi95xK4w==",
|
"integrity": "sha512-jlf/foYIKywAt3x/XWKZ/3rz8OSJPiWktjmk891alJUEjiVxKX9LEO92qH3hv4aJ0mN3MWPvGMCy8jQi95xK4w==",
|
||||||
|
"optional": true,
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"tr46": "^5.0.0",
|
"tr46": "^5.0.0",
|
||||||
"webidl-conversions": "^7.0.0"
|
"webidl-conversions": "^7.0.0"
|
||||||
|
|
@ -31929,27 +31964,6 @@
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mongoose": {
|
|
||||||
"version": "8.9.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.9.5.tgz",
|
|
||||||
"integrity": "sha512-SPhOrgBm0nKV3b+IIHGqpUTOmgVL5Z3OO9AwkFEmvOZznXTvplbomstCnPOGAyungtRXE5pJTgKpKcZTdjeESg==",
|
|
||||||
"dependencies": {
|
|
||||||
"bson": "^6.10.1",
|
|
||||||
"kareem": "2.6.3",
|
|
||||||
"mongodb": "~6.12.0",
|
|
||||||
"mpath": "0.9.0",
|
|
||||||
"mquery": "5.0.0",
|
|
||||||
"ms": "2.1.3",
|
|
||||||
"sift": "17.1.3"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=16.20.1"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "opencollective",
|
|
||||||
"url": "https://opencollective.com/mongoose"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/moo-color": {
|
"node_modules/moo-color": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/moo-color/-/moo-color-1.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/moo-color/-/moo-color-1.0.3.tgz",
|
||||||
|
|
@ -41152,9 +41166,9 @@
|
||||||
"packages/data-schemas": {
|
"packages/data-schemas": {
|
||||||
"name": "@librechat/data-schemas",
|
"name": "@librechat/data-schemas",
|
||||||
"version": "0.0.2",
|
"version": "0.0.2",
|
||||||
"license": "ISC",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"mongoose": "^8.9.5"
|
"mongoose": "^8.12.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rollup/plugin-alias": "^5.1.0",
|
"@rollup/plugin-alias": "^5.1.0",
|
||||||
|
|
@ -41182,6 +41196,14 @@
|
||||||
"keyv": "^4.5.4"
|
"keyv": "^4.5.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"packages/data-schemas/node_modules/@types/whatwg-url": {
|
||||||
|
"version": "11.0.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-11.0.5.tgz",
|
||||||
|
"integrity": "sha512-coYR071JRaHa+xoEvvYqvnIHaVqaYrLPbsufM9BF63HkwI5Lgmy2QR8Q5K/lYDYo5AK82wOvSOS0UsLTpTG7uQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/webidl-conversions": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"packages/data-schemas/node_modules/brace-expansion": {
|
"packages/data-schemas/node_modules/brace-expansion": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
|
||||||
|
|
@ -41193,12 +41215,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"packages/data-schemas/node_modules/bson": {
|
"packages/data-schemas/node_modules/bson": {
|
||||||
"version": "5.5.1",
|
"version": "6.10.3",
|
||||||
"resolved": "https://registry.npmjs.org/bson/-/bson-5.5.1.tgz",
|
"resolved": "https://registry.npmjs.org/bson/-/bson-6.10.3.tgz",
|
||||||
"integrity": "sha512-ix0EwukN2EpC0SRWIj/7B5+A6uQMQy6KMREI9qQqvgpkV2frH63T0UDVd1SYedL6dNCmDBYB3QtXi4ISk9YT+g==",
|
"integrity": "sha512-MTxGsqgYTwfshYWTRdmZRC+M7FnG1b4y7RO7p2k3X24Wq0yv1m77Wsj0BzlPzd/IowgESfsruQCUToa7vbOpPQ==",
|
||||||
"license": "Apache-2.0",
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.20.1"
|
"node": ">=16.20.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"packages/data-schemas/node_modules/glob": {
|
"packages/data-schemas/node_modules/glob": {
|
||||||
|
|
@ -41238,15 +41259,6 @@
|
||||||
"@pkgjs/parseargs": "^0.11.0"
|
"@pkgjs/parseargs": "^0.11.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"packages/data-schemas/node_modules/kareem": {
|
|
||||||
"version": "2.5.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/kareem/-/kareem-2.5.1.tgz",
|
|
||||||
"integrity": "sha512-7jFxRVm+jD+rkq3kY0iZDJfsO2/t4BBPeEb2qKn2lR/9KhuksYk5hxzfRYWMPV8P/x2d0kHD306YyWLzjjH+uA==",
|
|
||||||
"license": "Apache-2.0",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"packages/data-schemas/node_modules/minimatch": {
|
"packages/data-schemas/node_modules/minimatch": {
|
||||||
"version": "9.0.5",
|
"version": "9.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",
|
||||||
|
|
@ -41264,27 +41276,25 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"packages/data-schemas/node_modules/mongodb": {
|
"packages/data-schemas/node_modules/mongodb": {
|
||||||
"version": "5.9.2",
|
"version": "6.14.2",
|
||||||
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-5.9.2.tgz",
|
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.14.2.tgz",
|
||||||
"integrity": "sha512-H60HecKO4Bc+7dhOv4sJlgvenK4fQNqqUIlXxZYQNbfEWSALGAwGoyJd/0Qwk4TttFXUOHJ2ZJQe/52ScaUwtQ==",
|
"integrity": "sha512-kMEHNo0F3P6QKDq17zcDuPeaywK/YaJVCEQRzPF3TOM/Bl9MFg64YE5Tu7ifj37qZJMhwU1tl2Ioivws5gRG5Q==",
|
||||||
"license": "Apache-2.0",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bson": "^5.5.0",
|
"@mongodb-js/saslprep": "^1.1.9",
|
||||||
"mongodb-connection-string-url": "^2.6.0",
|
"bson": "^6.10.3",
|
||||||
"socks": "^2.7.1"
|
"mongodb-connection-string-url": "^3.0.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.20.1"
|
"node": ">=16.20.1"
|
||||||
},
|
|
||||||
"optionalDependencies": {
|
|
||||||
"@mongodb-js/saslprep": "^1.1.0"
|
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@aws-sdk/credential-providers": "^3.188.0",
|
"@aws-sdk/credential-providers": "^3.188.0",
|
||||||
"@mongodb-js/zstd": "^1.0.0",
|
"@mongodb-js/zstd": "^1.1.0 || ^2.0.0",
|
||||||
"kerberos": "^1.0.0 || ^2.0.0",
|
"gcp-metadata": "^5.2.0",
|
||||||
"mongodb-client-encryption": ">=2.3.0 <3",
|
"kerberos": "^2.0.1",
|
||||||
"snappy": "^7.2.2"
|
"mongodb-client-encryption": ">=6.0.0 <7",
|
||||||
|
"snappy": "^7.2.2",
|
||||||
|
"socks": "^2.7.1"
|
||||||
},
|
},
|
||||||
"peerDependenciesMeta": {
|
"peerDependenciesMeta": {
|
||||||
"@aws-sdk/credential-providers": {
|
"@aws-sdk/credential-providers": {
|
||||||
|
|
@ -41293,6 +41303,9 @@
|
||||||
"@mongodb-js/zstd": {
|
"@mongodb-js/zstd": {
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
|
"gcp-metadata": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
"kerberos": {
|
"kerberos": {
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
|
|
@ -41301,25 +41314,36 @@
|
||||||
},
|
},
|
||||||
"snappy": {
|
"snappy": {
|
||||||
"optional": true
|
"optional": true
|
||||||
|
},
|
||||||
|
"socks": {
|
||||||
|
"optional": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"packages/data-schemas/node_modules/mongoose": {
|
"packages/data-schemas/node_modules/mongodb-connection-string-url": {
|
||||||
"version": "7.8.6",
|
"version": "3.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/mongoose/-/mongoose-7.8.6.tgz",
|
"resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.2.tgz",
|
||||||
"integrity": "sha512-1oVPRHvcmPVwk/zeSTEzayzQEVeYQM1D5zrkLsttfNNB7pPRUmkKeFu6gpbvyEswOuZLrWJjqB8kSTY+k2AZOA==",
|
"integrity": "sha512-rMO7CGo/9BFwyZABcKAWL8UJwH/Kc2x0g72uhDWzG48URRax5TCIcJ7Rc3RZqffZzO/Gwff/jyKwCU9TN8gehA==",
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bson": "^5.5.0",
|
"@types/whatwg-url": "^11.0.2",
|
||||||
"kareem": "2.5.1",
|
"whatwg-url": "^14.1.0 || ^13.0.0"
|
||||||
"mongodb": "5.9.2",
|
}
|
||||||
|
},
|
||||||
|
"packages/data-schemas/node_modules/mongoose": {
|
||||||
|
"version": "8.12.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.12.1.tgz",
|
||||||
|
"integrity": "sha512-UW22y8QFVYmrb36hm8cGncfn4ARc/XsYWQwRTaj0gxtQk1rDuhzDO1eBantS+hTTatfAIS96LlRCJrcNHvW5+Q==",
|
||||||
|
"dependencies": {
|
||||||
|
"bson": "^6.10.3",
|
||||||
|
"kareem": "2.6.3",
|
||||||
|
"mongodb": "~6.14.0",
|
||||||
"mpath": "0.9.0",
|
"mpath": "0.9.0",
|
||||||
"mquery": "5.0.0",
|
"mquery": "5.0.0",
|
||||||
"ms": "2.1.3",
|
"ms": "2.1.3",
|
||||||
"sift": "16.0.1"
|
"sift": "17.1.3"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.20.1"
|
"node": ">=16.20.1"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "opencollective",
|
"type": "opencollective",
|
||||||
|
|
@ -41342,11 +41366,28 @@
|
||||||
"url": "https://github.com/sponsors/isaacs"
|
"url": "https://github.com/sponsors/isaacs"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"packages/data-schemas/node_modules/sift": {
|
"packages/data-schemas/node_modules/tr46": {
|
||||||
"version": "16.0.1",
|
"version": "5.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/sift/-/sift-16.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/tr46/-/tr46-5.0.0.tgz",
|
||||||
"integrity": "sha512-Wv6BjQ5zbhW7VFefWusVP33T/EM0vYikCaQ2qR8yULbsilAT8/wQaXvuQ3ptGLpoKx+lihJE3y2UTgKDyyNHZQ==",
|
"integrity": "sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==",
|
||||||
"license": "MIT"
|
"dependencies": {
|
||||||
|
"punycode": "^2.3.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"packages/data-schemas/node_modules/whatwg-url": {
|
||||||
|
"version": "14.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.1.1.tgz",
|
||||||
|
"integrity": "sha512-mDGf9diDad/giZ/Sm9Xi2YcyzaFpbdLpJPr+E9fSkyQ7KpQD4SdFcugkRQYzhmfI4KeV4Qpnn2sKPdo+kmsgRQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"tr46": "^5.0.0",
|
||||||
|
"webidl-conversions": "^7.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"packages/mcp": {
|
"packages/mcp": {
|
||||||
"name": "librechat-mcp",
|
"name": "librechat-mcp",
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@
|
||||||
"access": "public"
|
"access": "public"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"mongoose": "^8.9.5"
|
"mongoose": "^8.12.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"keyv": "^4.5.4"
|
"keyv": "^4.5.4"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue