@optimiser/common 1.0.254 → 1.0.257

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 });
@@ -3664,6 +3674,8 @@ function SyncCompanyLicenceInMasterCompanyAfterAdd(fieldsObj, dbMaster) {
3664
3674
  setQuery_1['TotalEnterpriseLicence'] = 0;
3665
3675
  var totalNoOfFeatureLicence = 0;
3666
3676
  var totalNoOfAppLicence = 0;
3677
+ //Added by Chetan on 22Feb2022, for domain licence
3678
+ var totalNoOfDomainLicence = 0;
3667
3679
  for (var c = 0; c < companyLicences.length; c++) {
3668
3680
  var licenceType = companyLicences[c]._id['LicenceType'];
3669
3681
  var licenceName = companyLicences[c]._id['LicenceName'];
@@ -3677,6 +3689,9 @@ function SyncCompanyLicenceInMasterCompanyAfterAdd(fieldsObj, dbMaster) {
3677
3689
  else if (licenceType == 'App') {
3678
3690
  totalNoOfAppLicence += parseInt(companyLicenceTotal);
3679
3691
  }
3692
+ else if (licenceType == 'Domain') {
3693
+ totalNoOfDomainLicence += parseInt(companyLicenceTotal); /*Added by Chetan on 22Feb2022, for domain licence*/
3694
+ }
3680
3695
  for (var i in companyLicencesData_2) {
3681
3696
  if (i == licenceType) {
3682
3697
  var companyLicenceType = companyLicencesData_2[i];
@@ -3690,6 +3705,8 @@ function SyncCompanyLicenceInMasterCompanyAfterAdd(fieldsObj, dbMaster) {
3690
3705
  }
3691
3706
  setQuery_1['TotalFeatureLicence'] = totalNoOfFeatureLicence;
3692
3707
  setQuery_1['TotalAppLicence'] = totalNoOfAppLicence;
3708
+ //Added by Chetan on 22Feb2022, for domain licence
3709
+ setQuery_1['TotalDomainLicence'] = totalNoOfDomainLicence;
3693
3710
  setQuery_1.Setting["Licences"] = companyLicencesData_2;
3694
3711
  dbMaster.collection('Company').updateOne({ _id: companyId_1, 'IsActive': true }, { $set: setQuery_1 });
3695
3712
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optimiser/common",
3
- "version": "1.0.254",
3
+ "version": "1.0.257",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {