mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 17:00:15 +01:00
* fix: remove unique field from assistant_id, which can be shared between different users * refactor: remove unique user fields from actions/assistant queries * feat: only allow user who saved action to delete it * refactor: allow deletions for anyone with builder access * refactor: update user.id when updating assistants/actions records, instead of searching with it * fix: stringify response data in case it's an object * fix: correctly handle path input * fix(decryptV2): handle edge case where value is already decrypted
33 lines
624 B
JavaScript
33 lines
624 B
JavaScript
const mongoose = require('mongoose');
|
|
|
|
const assistantSchema = mongoose.Schema(
|
|
{
|
|
user: {
|
|
type: mongoose.Schema.Types.ObjectId,
|
|
ref: 'User',
|
|
required: true,
|
|
},
|
|
assistant_id: {
|
|
type: String,
|
|
index: true,
|
|
required: true,
|
|
},
|
|
avatar: {
|
|
type: {
|
|
filepath: String,
|
|
source: String,
|
|
},
|
|
default: undefined,
|
|
},
|
|
access_level: {
|
|
type: Number,
|
|
},
|
|
file_ids: { type: [String], default: undefined },
|
|
actions: { type: [String], default: undefined },
|
|
},
|
|
{
|
|
timestamps: true,
|
|
},
|
|
);
|
|
|
|
module.exports = assistantSchema;
|