@optimiser/common 1.0.255 → 1.0.258

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.
@@ -2614,13 +2614,16 @@ paratemter : {
2614
2614
  */
2615
2615
  function SignoutUserFromAllDevices(options, dbMaster, redisClient) {
2616
2616
  if (dbMaster) {
2617
+ //commented by Nidhi on 24-Feb-2022, removing session id for seaching sessions
2618
+ // let sessionID: any = '';
2617
2619
  var updateQuery_1 = { "IsActive": false, "Description": options.Description, "ModifiedBy": options.RemovedBy, "ModifiedDate": new Date() };
2618
- dbMaster.collection('Session').find({ "UserID": options.UserID, "IsActive": true }, { projection: { "_id": 0, "SessionKey": 1, "Platform": 1 } }).toArray(function (err, data) {
2620
+ dbMaster.collection('Session').find({ "UserID": options.UserID, "IsActive": true }, { projection: { "_id": 1, "SessionKey": 1, "Platform": 1 } }).toArray(function (err, data) {
2619
2621
  if (err) {
2620
2622
  if (options.callback)
2621
2623
  options.callback({ message: 'error', error: err });
2622
2624
  }
2623
2625
  if (data) {
2626
+ // sessionID = data.map(x => x._id);
2624
2627
  if (options.Platform) {
2625
2628
  data = data.filter(function (x) { return (x.Platform == options.Platform); });
2626
2629
  }
@@ -2633,7 +2636,14 @@ function SignoutUserFromAllDevices(options, dbMaster, redisClient) {
2633
2636
  }
2634
2637
  }
2635
2638
  }
2636
- dbMaster.collection('Session').updateMany({ "UserID": options.UserID, "IsActive": true }, { $set: updateQuery_1 }, function (err, data) {
2639
+ //added by Nidhi on 24-Feb-2022, searching user session by platform
2640
+ var searchQuery = { "UserID": options.UserID, "IsActive": true };
2641
+ if (options.Platform) {
2642
+ searchQuery["Platform"] = options.Platform;
2643
+ }
2644
+ //commented by Nidhi on 24-Feb-2022, removing session id for seaching sessions
2645
+ //dbMaster.collection('Session').updateMany({ _id: sessionID, "UserID": options.UserID, "IsActive": true }, { $set: updateQuery },
2646
+ dbMaster.collection('Session').updateMany(searchQuery, { $set: updateQuery_1 }, function (err, data) {
2637
2647
  if (err) {
2638
2648
  if (options.callback)
2639
2649
  options.callback({ message: 'error', error: err });
@@ -3459,9 +3469,12 @@ function SyncUserLicenceConsumedCount(msp_d, db, dbMaster) {
3459
3469
  companyLicencesData_1 = (companySetting.Setting.Licences) ? companySetting.Setting.Licences : {};
3460
3470
  if (isEmptyObj(companyLicencesData_1) == false) {
3461
3471
  for (i in companyLicencesData_1) {
3462
- companyLicenceType = companyLicencesData_1[i];
3463
- for (j in companyLicenceType) {
3464
- companyLicenceType[j].NoOfLicenceConsumed = 0;
3472
+ /*Added by Chetan on 07-Mar-2022, Not necessary for Domain Licence*/
3473
+ if (i != "Domain") {
3474
+ companyLicenceType = companyLicencesData_1[i];
3475
+ for (j in companyLicenceType) {
3476
+ companyLicenceType[j].NoOfLicenceConsumed = 0;
3477
+ }
3465
3478
  }
3466
3479
  }
3467
3480
  db.collection('UserLicence').aggregate([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optimiser/common",
3
- "version": "1.0.255",
3
+ "version": "1.0.258",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {