@librechat/data-schemas 0.0.20 → 0.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -227,6 +227,7 @@ const agentCategorySchema = new mongoose.Schema({
227
227
  timestamps: true,
228
228
  });
229
229
  agentCategorySchema.index({ isActive: 1, order: 1 });
230
+ agentCategorySchema.index({ order: 1, label: 1 });
230
231
 
231
232
  const assistantSchema = new mongoose.Schema({
232
233
  user: {
@@ -505,6 +506,9 @@ const conversationPreset = {
505
506
  disableStreaming: {
506
507
  type: Boolean,
507
508
  },
509
+ fileTokenLimit: {
510
+ type: Number,
511
+ },
508
512
  /** Reasoning models only */
509
513
  reasoning_effort: {
510
514
  type: String,
@@ -3051,13 +3055,27 @@ function createTokenMethods(mongoose) {
3051
3055
  async function deleteTokens(query) {
3052
3056
  try {
3053
3057
  const Token = mongoose.models.Token;
3058
+ const conditions = [];
3059
+ if (query.userId !== undefined) {
3060
+ conditions.push({ userId: query.userId });
3061
+ }
3062
+ if (query.token !== undefined) {
3063
+ conditions.push({ token: query.token });
3064
+ }
3065
+ if (query.email !== undefined) {
3066
+ conditions.push({ email: query.email });
3067
+ }
3068
+ if (query.identifier !== undefined) {
3069
+ conditions.push({ identifier: query.identifier });
3070
+ }
3071
+ /**
3072
+ * If no conditions are specified, throw an error to prevent accidental deletion of all tokens
3073
+ */
3074
+ if (conditions.length === 0) {
3075
+ throw new Error('At least one query parameter must be provided');
3076
+ }
3054
3077
  return await Token.deleteMany({
3055
- $or: [
3056
- { userId: query.userId },
3057
- { token: query.token },
3058
- { email: query.email },
3059
- { identifier: query.identifier },
3060
- ],
3078
+ $or: conditions,
3061
3079
  });
3062
3080
  }
3063
3081
  catch (error) {