@librechat/data-schemas 0.0.37 → 0.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +38 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +39 -9
- package/dist/index.es.js.map +1 -1
- package/dist/types/types/user.d.ts +6 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -94,6 +94,7 @@ async function loadDefaultInterface({ config, configDefaults, }) {
|
|
|
94
94
|
fileCitations: interfaceConfig === null || interfaceConfig === void 0 ? void 0 : interfaceConfig.fileCitations,
|
|
95
95
|
peoplePicker: interfaceConfig === null || interfaceConfig === void 0 ? void 0 : interfaceConfig.peoplePicker,
|
|
96
96
|
marketplace: interfaceConfig === null || interfaceConfig === void 0 ? void 0 : interfaceConfig.marketplace,
|
|
97
|
+
remoteAgents: interfaceConfig === null || interfaceConfig === void 0 ? void 0 : interfaceConfig.remoteAgents,
|
|
97
98
|
});
|
|
98
99
|
return loadedInterface;
|
|
99
100
|
}
|
|
@@ -2630,6 +2631,15 @@ const userSchema = new mongoose.Schema({
|
|
|
2630
2631
|
type: [BackupCodeSchema],
|
|
2631
2632
|
select: false,
|
|
2632
2633
|
},
|
|
2634
|
+
pendingTotpSecret: {
|
|
2635
|
+
type: String,
|
|
2636
|
+
select: false,
|
|
2637
|
+
},
|
|
2638
|
+
pendingBackupCodes: {
|
|
2639
|
+
type: [BackupCodeSchema],
|
|
2640
|
+
select: false,
|
|
2641
|
+
default: undefined,
|
|
2642
|
+
},
|
|
2633
2643
|
refreshToken: {
|
|
2634
2644
|
type: [SessionSchema],
|
|
2635
2645
|
},
|
|
@@ -3004,9 +3014,11 @@ const createMeiliMongooseModel = ({ index, attributesToIndex, syncOptions, }) =>
|
|
|
3004
3014
|
try {
|
|
3005
3015
|
// Add documents to MeiliSearch
|
|
3006
3016
|
await index.addDocumentsInBatches(formattedDocs);
|
|
3007
|
-
// Update MongoDB to mark documents as indexed
|
|
3017
|
+
// Update MongoDB to mark documents as indexed.
|
|
3018
|
+
// { timestamps: false } prevents Mongoose from touching updatedAt, preserving
|
|
3019
|
+
// original conversation/message timestamps (fixes sidebar chronological sort).
|
|
3008
3020
|
const docsIds = documents.map((doc) => doc._id);
|
|
3009
|
-
await this.updateMany({ _id: { $in: docsIds } }, { $set: { _meiliIndex: true } });
|
|
3021
|
+
await this.updateMany({ _id: { $in: docsIds } }, { $set: { _meiliIndex: true } }, { timestamps: false });
|
|
3010
3022
|
}
|
|
3011
3023
|
catch (error) {
|
|
3012
3024
|
logger.error('[processSyncBatch] Error processing batch:', error);
|
|
@@ -3253,7 +3265,6 @@ function mongoMeili(schema, options) {
|
|
|
3253
3265
|
const client = new meilisearch.MeiliSearch({ host, apiKey });
|
|
3254
3266
|
/** Create index only if it doesn't exist */
|
|
3255
3267
|
const index = client.index(indexName);
|
|
3256
|
-
// Check if index exists and create if needed
|
|
3257
3268
|
(async () => {
|
|
3258
3269
|
try {
|
|
3259
3270
|
await index.getRawInfo();
|
|
@@ -3264,19 +3275,38 @@ function mongoMeili(schema, options) {
|
|
|
3264
3275
|
if (errorCode === 'index_not_found') {
|
|
3265
3276
|
try {
|
|
3266
3277
|
logger.info(`[mongoMeili] Creating new index: ${indexName}`);
|
|
3267
|
-
await client.createIndex(indexName, { primaryKey });
|
|
3268
|
-
|
|
3278
|
+
const enqueued = await client.createIndex(indexName, { primaryKey });
|
|
3279
|
+
const task = await client.waitForTask(enqueued.taskUid, {
|
|
3280
|
+
timeOutMs: 10000,
|
|
3281
|
+
intervalMs: 100,
|
|
3282
|
+
});
|
|
3283
|
+
logger.debug(`[mongoMeili] Index ${indexName} creation task:`, task);
|
|
3284
|
+
if (task.status !== 'succeeded') {
|
|
3285
|
+
const taskError = task.error;
|
|
3286
|
+
if ((taskError === null || taskError === void 0 ? void 0 : taskError.code) === 'index_already_exists') {
|
|
3287
|
+
logger.debug(`[mongoMeili] Index ${indexName} was created by another instance`);
|
|
3288
|
+
}
|
|
3289
|
+
else {
|
|
3290
|
+
logger.warn(`[mongoMeili] Index ${indexName} creation failed:`, taskError);
|
|
3291
|
+
}
|
|
3292
|
+
}
|
|
3293
|
+
else {
|
|
3294
|
+
logger.info(`[mongoMeili] Successfully created index: ${indexName}`);
|
|
3295
|
+
}
|
|
3269
3296
|
}
|
|
3270
3297
|
catch (createError) {
|
|
3271
|
-
|
|
3272
|
-
|
|
3298
|
+
if (createError instanceof meilisearch.MeiliSearchTimeOutError) {
|
|
3299
|
+
logger.warn(`[mongoMeili] Timed out waiting for index ${indexName} creation`);
|
|
3300
|
+
}
|
|
3301
|
+
else {
|
|
3302
|
+
logger.warn(`[mongoMeili] Error creating index ${indexName}:`, createError);
|
|
3303
|
+
}
|
|
3273
3304
|
}
|
|
3274
3305
|
}
|
|
3275
3306
|
else {
|
|
3276
3307
|
logger.error(`[mongoMeili] Error checking index ${indexName}:`, error);
|
|
3277
3308
|
}
|
|
3278
3309
|
}
|
|
3279
|
-
// Configure index settings to make 'user' field filterable
|
|
3280
3310
|
try {
|
|
3281
3311
|
await index.updateSettings({
|
|
3282
3312
|
filterableAttributes: ['user'],
|