Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

🔐 feat: Group schema support, refine user schema security, and improve types (#9070)

Marco Berettac78fd0fc8372
diff --git a/package-lock.json b/package-lock.json
index 1c4b14c997..9bf8acf6ac 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -51874,7 +51874,7 @@
},
"packages/data-schemas": {
"name": "@librechat/data-schemas",
- "version": "0.0.15",
+ "version": "0.0.16",
"license": "MIT",
"devDependencies": {
"@rollup/plugin-alias": "^5.1.0",
diff --git a/packages/data-schemas/package.json b/packages/data-schemas/package.json
index 71c5ccc630..91068d2e6c 100644
--- a/packages/data-schemas/package.json
+++ b/packages/data-schemas/package.json
@@ -1,6 +1,6 @@
{
"name": "@librechat/data-schemas",
- "version": "0.0.15",
+ "version": "0.0.16",
"description": "Mongoose schemas and models for LibreChat",
"type": "module",
"main": "dist/index.cjs",
diff --git a/packages/data-schemas/src/schema/index.ts b/packages/data-schemas/src/schema/index.ts
index a7de162e0b..2d94db5301 100644
--- a/packages/data-schemas/src/schema/index.ts
+++ b/packages/data-schemas/src/schema/index.ts
@@ -23,3 +23,4 @@ export { default as toolCallSchema } from './toolCall';
export { default as transactionSchema } from './transaction';
export { default as userSchema } from './user';
export { default as memorySchema } from './memory';
+export { default as groupSchema } from './group';
diff --git a/packages/data-schemas/src/schema/user.ts b/packages/data-schemas/src/schema/user.ts
index 3a0f140546..d46d4f9c87 100644
--- a/packages/data-schemas/src/schema/user.ts
+++ b/packages/data-schemas/src/schema/user.ts
@@ -51,6 +51,7 @@ const userSchema = new Schema<IUser>(
trim: true,
minlength: 8,
maxlength: 128,
+ select: false,
},
avatar: {
type: String,
@@ -114,6 +115,7 @@ const userSchema = new Schema<IUser>(
},
totpSecret: {
type: String,
+ select: false,
},
backupCodes: {
type: [BackupCodeSchema],
diff --git a/packages/data-schemas/src/types/group.ts b/packages/data-schemas/src/types/group.ts
index 22d68a6aab..4a46b417e7 100644
--- a/packages/data-schemas/src/types/group.ts
+++ b/packages/data-schemas/src/types/group.ts
@@ -1,6 +1,6 @@
-import type { Document, Types } from 'mongoose';
+import { Document } from 'mongoose';
-export type Group = {
+export interface IGroup extends Document {
/** The name of the group */
name: string;
/** Optional description of the group */
@@ -15,9 +15,7 @@ export type Group = {
source: 'local' | 'entra';
/** External ID (e.g., Entra ID) - required for non-local sources */
idOnTheSource?: string;
-};
-
-export type IGroup = Group &
- Document & {
- _id: Types.ObjectId;
- };
+ /** Timestamps */
+ createdAt?: Date;
+ updatedAt?: Date;
+}