mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-03-01 05:40:17 +01:00
47 lines
855 B
TypeScript
47 lines
855 B
TypeScript
import { Schema } from 'mongoose';
|
|
import type { IAgentCategory } from '~/types';
|
|
|
|
const agentCategorySchema = new Schema<IAgentCategory>(
|
|
{
|
|
value: {
|
|
type: String,
|
|
required: true,
|
|
unique: true,
|
|
trim: true,
|
|
lowercase: true,
|
|
index: true,
|
|
},
|
|
label: {
|
|
type: String,
|
|
required: true,
|
|
trim: true,
|
|
},
|
|
description: {
|
|
type: String,
|
|
trim: true,
|
|
default: '',
|
|
},
|
|
order: {
|
|
type: Number,
|
|
default: 0,
|
|
index: true,
|
|
},
|
|
isActive: {
|
|
type: Boolean,
|
|
default: true,
|
|
index: true,
|
|
},
|
|
custom: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
},
|
|
{
|
|
timestamps: true,
|
|
},
|
|
);
|
|
|
|
agentCategorySchema.index({ isActive: 1, order: 1 });
|
|
agentCategorySchema.index({ order: 1, label: 1 });
|
|
|
|
export default agentCategorySchema;
|