cloud-ide-model-schema 1.1.145 → 1.1.148

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.
@@ -21,8 +21,16 @@ var auth_user_mst = new mongoose_1.Schema({
21
21
  },
22
22
  user_middlename: {
23
23
  type: String,
24
- minlength: 3,
25
- maxlength: 20
24
+ maxlength: 20,
25
+ // Allow empty strings - middle name is optional
26
+ validate: {
27
+ validator: function (value) {
28
+ // If value is provided and not empty, it must be at least 3 characters
29
+ // If value is empty or undefined, it's valid (optional field)
30
+ return !value || value.trim().length === 0 || value.trim().length >= 3;
31
+ },
32
+ message: 'Middle name must be at least 3 characters if provided'
33
+ }
26
34
  },
27
35
  user_lastname: {
28
36
  type: String,
@@ -78,8 +86,7 @@ var auth_user_mst = new mongoose_1.Schema({
78
86
  // Indexes for performance optimization
79
87
  // Compound index for user listing queries (sorting and filtering)
80
88
  auth_user_mst.index({ user_fullname: 1, user_username: 1 });
81
- // Index for email search queries
82
- auth_user_mst.index({ user_emailid: 1 });
89
+ // Note: user_emailid already has unique: true which creates an index automatically
83
90
  // Index for username search (already unique, but explicit index for clarity)
84
91
  auth_user_mst.index({ user_username: 1 });
85
92
  // Index for fullname search
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "typescript": "^5.8.3"
10
10
  },
11
11
  "name": "cloud-ide-model-schema",
12
- "version": "1.1.145",
12
+ "version": "1.1.148",
13
13
  "description": "Pachage for schema management of Cloud IDEsys LMS",
14
14
  "main": "lib/index.js",
15
15
  "types": "lib/index.d.ts",