LibreChat/packages/data-schemas/src/schema/group.ts
Danny Avila 66bd419baa
🔐 feat: Granular Role-based Permissions + Entra ID Group Discovery (#7804)
WIP: pre-granular-permissions commit

feat: Add category and support contact fields to Agent schema and UI components

Revert "feat: Add category and support contact fields to Agent schema and UI components"

This reverts commit c43a52b4c9.

Fix: Update import for renderHook in useAgentCategories.spec.tsx

fix: Update icon rendering in AgentCategoryDisplay tests to use empty spans

refactor: Improve category synchronization logic and clean up AgentConfig component

refactor: Remove unused UI flow translations from translation.json

feat: agent marketplace features

🔐 feat: Granular Role-based Permissions + Entra ID Group Discovery (#7804)
2025-08-13 16:24:17 -04:00

56 lines
1 KiB
TypeScript

import { Schema } from 'mongoose';
import type { IGroup } from '~/types';
const groupSchema = new Schema<IGroup>(
{
name: {
type: String,
required: true,
index: true,
},
description: {
type: String,
required: false,
},
email: {
type: String,
required: false,
index: true,
},
avatar: {
type: String,
required: false,
},
memberIds: [
{
type: String,
},
],
source: {
type: String,
enum: ['local', 'entra'],
default: 'local',
},
/** External ID (e.g., Entra ID) */
idOnTheSource: {
type: String,
sparse: true,
index: true,
required: function (this: IGroup) {
return this.source !== 'local';
},
},
},
{ timestamps: true },
);
groupSchema.index(
{ idOnTheSource: 1, source: 1 },
{
unique: true,
partialFilterExpression: { idOnTheSource: { $exists: true } },
},
);
groupSchema.index({ memberIds: 1 });
export default groupSchema;