mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-21 21:50:49 +02:00
🔐 feat: Group schema support, refine user schema security, and improve types (#9070)
* feat: Add groupSchema and update userSchema to hide sensitive fields * chore: Bump version of @librechat/data-schemas to 0.0.16
This commit is contained in:
parent
d711fc7852
commit
c78fd0fc83
5 changed files with 11 additions and 10 deletions
2
package-lock.json
generated
2
package-lock.json
generated
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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],
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue