mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-03-10 10:02:36 +01:00
🗑️ chore: Remove Deprecated Project Model and Associated Fields (#11773)
* chore: remove projects and projectIds usage * chore: empty line linting * chore: remove isCollaborative property across agent models and related tests - Removed the isCollaborative property from agent models, controllers, and tests, as it is deprecated in favor of ACL permissions. - Updated related validation schemas and data provider types to reflect this change. - Ensured all references to isCollaborative were stripped from the codebase to maintain consistency and clarity.
This commit is contained in:
parent
591e59ec5b
commit
edef01df7f
41 changed files with 94 additions and 821 deletions
|
|
@ -13,7 +13,6 @@ import { createActionModel } from './action';
|
|||
import { createAssistantModel } from './assistant';
|
||||
import { createFileModel } from './file';
|
||||
import { createBannerModel } from './banner';
|
||||
import { createProjectModel } from './project';
|
||||
import { createKeyModel } from './key';
|
||||
import { createPluginAuthModel } from './pluginAuth';
|
||||
import { createTransactionModel } from './transaction';
|
||||
|
|
@ -48,7 +47,6 @@ export function createModels(mongoose: typeof import('mongoose')) {
|
|||
Assistant: createAssistantModel(mongoose),
|
||||
File: createFileModel(mongoose),
|
||||
Banner: createBannerModel(mongoose),
|
||||
Project: createProjectModel(mongoose),
|
||||
Key: createKeyModel(mongoose),
|
||||
PluginAuth: createPluginAuthModel(mongoose),
|
||||
Transaction: createTransactionModel(mongoose),
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
import projectSchema, { IMongoProject } from '~/schema/project';
|
||||
|
||||
/**
|
||||
* Creates or returns the Project model using the provided mongoose instance and schema
|
||||
*/
|
||||
export function createProjectModel(mongoose: typeof import('mongoose')) {
|
||||
return mongoose.models.Project || mongoose.model<IMongoProject>('Project', projectSchema);
|
||||
}
|
||||
|
|
@ -76,10 +76,6 @@ const agentSchema = new Schema<IAgent>(
|
|||
type: [{ type: Schema.Types.Mixed }],
|
||||
default: [],
|
||||
},
|
||||
isCollaborative: {
|
||||
type: Boolean,
|
||||
default: undefined,
|
||||
},
|
||||
conversation_starters: {
|
||||
type: [String],
|
||||
default: [],
|
||||
|
|
@ -88,11 +84,6 @@ const agentSchema = new Schema<IAgent>(
|
|||
type: Schema.Types.Mixed,
|
||||
default: {},
|
||||
},
|
||||
projectIds: {
|
||||
type: [Schema.Types.ObjectId],
|
||||
ref: 'Project',
|
||||
index: true,
|
||||
},
|
||||
versions: {
|
||||
type: [Schema.Types.Mixed],
|
||||
default: [],
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ export { default as keySchema } from './key';
|
|||
export { default as messageSchema } from './message';
|
||||
export { default as pluginAuthSchema } from './pluginAuth';
|
||||
export { default as presetSchema } from './preset';
|
||||
export { default as projectSchema } from './project';
|
||||
export { default as promptSchema } from './prompt';
|
||||
export { default as promptGroupSchema } from './promptGroup';
|
||||
export { default as roleSchema } from './role';
|
||||
|
|
|
|||
|
|
@ -1,34 +0,0 @@
|
|||
import { Schema, Document, Types } from 'mongoose';
|
||||
|
||||
export interface IMongoProject extends Document {
|
||||
name: string;
|
||||
promptGroupIds: Types.ObjectId[];
|
||||
agentIds: string[];
|
||||
createdAt?: Date;
|
||||
updatedAt?: Date;
|
||||
}
|
||||
|
||||
const projectSchema = new Schema<IMongoProject>(
|
||||
{
|
||||
name: {
|
||||
type: String,
|
||||
required: true,
|
||||
index: true,
|
||||
},
|
||||
promptGroupIds: {
|
||||
type: [Schema.Types.ObjectId],
|
||||
ref: 'PromptGroup',
|
||||
default: [],
|
||||
},
|
||||
agentIds: {
|
||||
type: [String],
|
||||
ref: 'Agent',
|
||||
default: [],
|
||||
},
|
||||
},
|
||||
{
|
||||
timestamps: true,
|
||||
},
|
||||
);
|
||||
|
||||
export default projectSchema;
|
||||
|
|
@ -22,12 +22,6 @@ const promptGroupSchema = new Schema<IPromptGroupDocument>(
|
|||
default: '',
|
||||
index: true,
|
||||
},
|
||||
projectIds: {
|
||||
type: [Schema.Types.ObjectId],
|
||||
ref: 'Project',
|
||||
index: true,
|
||||
default: [],
|
||||
},
|
||||
productionId: {
|
||||
type: Schema.Types.ObjectId,
|
||||
ref: 'Prompt',
|
||||
|
|
|
|||
|
|
@ -31,11 +31,8 @@ export interface IAgent extends Omit<Document, 'model'> {
|
|||
/** @deprecated Use edges instead */
|
||||
agent_ids?: string[];
|
||||
edges?: GraphEdge[];
|
||||
/** @deprecated Use ACL permissions instead */
|
||||
isCollaborative?: boolean;
|
||||
conversation_starters?: string[];
|
||||
tool_resources?: unknown;
|
||||
projectIds?: Types.ObjectId[];
|
||||
versions?: Omit<IAgent, 'versions'>[];
|
||||
category: string;
|
||||
support_contact?: ISupportContact;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ export interface IPromptGroup {
|
|||
numberOfGenerations: number;
|
||||
oneliner: string;
|
||||
category: string;
|
||||
projectIds: Types.ObjectId[];
|
||||
productionId: Types.ObjectId;
|
||||
author: Types.ObjectId;
|
||||
authorName: string;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue