orbitx-core-models 11.50.0 → 11.52.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"agent.model.d.ts","sourceRoot":"","sources":["../../src/models/agent.model.ts"],"names":[],"mappings":"AAEA,OAAiB,EAAU,KAAK,EAAE,MAAM,UAAU,CAAC;AAEnD,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AAkHrD,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,MAAM,CAAgD,CAAC;AACjF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"agent.model.d.ts","sourceRoot":"","sources":["../../src/models/agent.model.ts"],"names":[],"mappings":"AAEA,OAAiB,EAAU,KAAK,EAAE,MAAM,UAAU,CAAC;AAEnD,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AAgHrD,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,MAAM,CAAgD,CAAC;AACjF,eAAe,KAAK,CAAC"}
@@ -119,15 +119,14 @@ const agentSchema = new mongoose_1.Schema({
119
119
  }, {
120
120
  timestamps: true,
121
121
  });
122
- agentSchema.pre("save", async function (next) {
122
+ agentSchema.pre("save", async function () {
123
123
  if (!this.isModified("password") || !this.password)
124
- return next();
124
+ return;
125
125
  this.password = await argon2_1.default.hash(this.password, {
126
126
  type: argon2_1.default.argon2id,
127
127
  timeCost: 3,
128
128
  memoryCost: 2 ** 16,
129
129
  });
130
- next();
131
130
  });
132
131
  agentSchema.methods.comparePassword = async function (input) {
133
132
  if (!this.password)
@@ -1 +1 @@
1
- {"version":3,"file":"chat.model.d.ts","sourceRoot":"","sources":["../../src/models/chat.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAsNrD,eAAO,MAAM,IAAI;;;;OAA4C,CAAC"}
1
+ {"version":3,"file":"chat.model.d.ts","sourceRoot":"","sources":["../../src/models/chat.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAqNrD,eAAO,MAAM,IAAI;;;;OAA4C,CAAC"}
@@ -69,7 +69,6 @@ const chatSchema = new mongoose_1.Schema({
69
69
  currentOwnerId: {
70
70
  type: mongoose_1.Schema.Types.ObjectId,
71
71
  ref: "User",
72
- required: true,
73
72
  index: true,
74
73
  },
75
74
  ownershipType: {
@@ -1 +1 @@
1
- {"version":3,"file":"lead.model.d.ts","sourceRoot":"","sources":["../../src/models/lead.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAa,MAAM,8BAA8B,CAAC;AA2LhE,eAAO,MAAM,IAAI;;;;OAA4C,CAAC;AAC9D,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"lead.model.d.ts","sourceRoot":"","sources":["../../src/models/lead.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAa,MAAM,8BAA8B,CAAC;AA0LhE,eAAO,MAAM,IAAI;;;;OAA4C,CAAC;AAC9D,eAAe,IAAI,CAAC"}
@@ -168,7 +168,7 @@ const leadSchema = new mongoose_1.Schema({
168
168
  // ─────────────────────────────────────────────
169
169
  // STRICT FLAG VALIDATION (CRITICAL)
170
170
  // ─────────────────────────────────────────────
171
- leadSchema.pre("save", function (next) {
171
+ leadSchema.pre("save", function () {
172
172
  var _a, _b;
173
173
  if (this.isFlagged) {
174
174
  const hasEmail = !!((_a = this.data) === null || _a === void 0 ? void 0 : _a.email);
@@ -180,7 +180,6 @@ leadSchema.pre("save", function (next) {
180
180
  this.flaggedAt = undefined;
181
181
  }
182
182
  }
183
- next();
184
183
  });
185
184
  // ─────────────────────────────────────────────
186
185
  // INDEXES
@@ -1 +1 @@
1
- {"version":3,"file":"user.model.d.ts","sourceRoot":"","sources":["../../src/models/user.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AA4IrD,eAAO,MAAM,IAAI;;;;OAA4C,CAAC"}
1
+ {"version":3,"file":"user.model.d.ts","sourceRoot":"","sources":["../../src/models/user.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AA0IrD,eAAO,MAAM,IAAI;;;;OAA4C,CAAC"}
@@ -129,15 +129,14 @@ const userSchema = new mongoose_1.Schema({
129
129
  // ─────────────────────────────────────────────
130
130
  // PASSWORD HASH
131
131
  // ─────────────────────────────────────────────
132
- userSchema.pre("save", async function (next) {
132
+ userSchema.pre("save", async function () {
133
133
  if (!this.isModified("password") || !this.password)
134
- return next();
134
+ return;
135
135
  this.password = await argon2_1.default.hash(this.password, {
136
136
  type: argon2_1.default.argon2id,
137
137
  timeCost: 3,
138
138
  memoryCost: 2 ** 16,
139
139
  });
140
- next();
141
140
  });
142
141
  // ─────────────────────────────────────────────
143
142
  // PASSWORD COMPARE (FIXED)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orbitx-core-models",
3
- "version": "11.50.0",
3
+ "version": "11.52.0",
4
4
  "description": "Shared Mongoose models and interfaces for OrbitX services",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",