@optimiser/common 1.0.256 → 1.0.259
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/lib/utility.js +21 -10
- package/package.json +1 -1
package/dist/lib/utility.js
CHANGED
|
@@ -257,8 +257,8 @@ function GetPageFieldData(pageName, db, mdb, msp_d, next, callback) {
|
|
|
257
257
|
ExtraLookupFields: [
|
|
258
258
|
"UserStatus",
|
|
259
259
|
"IsAppUser"
|
|
260
|
-
]
|
|
261
|
-
OnLinkRender: "if(lookupRecord.IsAppUser==true){isHyperlink=false;}"
|
|
260
|
+
]
|
|
261
|
+
/*,OnLinkRender: "if(lookupRecord.IsAppUser==true){isHyperlink=false;}"*/
|
|
262
262
|
}
|
|
263
263
|
};
|
|
264
264
|
createdDateObj = {
|
|
@@ -296,8 +296,8 @@ function GetPageFieldData(pageName, db, mdb, msp_d, next, callback) {
|
|
|
296
296
|
ExtraLookupFields: [
|
|
297
297
|
"UserStatus",
|
|
298
298
|
"IsAppUser"
|
|
299
|
-
]
|
|
300
|
-
OnLinkRender: "if(lookupRecord.IsAppUser==true){isHyperlink=false;}"
|
|
299
|
+
]
|
|
300
|
+
/*,OnLinkRender: "if(lookupRecord.IsAppUser==true){isHyperlink=false;}"*/
|
|
301
301
|
}
|
|
302
302
|
};
|
|
303
303
|
modDateObj = {
|
|
@@ -2614,7 +2614,8 @@ paratemter : {
|
|
|
2614
2614
|
*/
|
|
2615
2615
|
function SignoutUserFromAllDevices(options, dbMaster, redisClient) {
|
|
2616
2616
|
if (dbMaster) {
|
|
2617
|
-
|
|
2617
|
+
//commented by Nidhi on 24-Feb-2022, removing session id for seaching sessions
|
|
2618
|
+
// let sessionID: any = '';
|
|
2618
2619
|
var updateQuery_1 = { "IsActive": false, "Description": options.Description, "ModifiedBy": options.RemovedBy, "ModifiedDate": new Date() };
|
|
2619
2620
|
dbMaster.collection('Session').find({ "UserID": options.UserID, "IsActive": true }, { projection: { "_id": 1, "SessionKey": 1, "Platform": 1 } }).toArray(function (err, data) {
|
|
2620
2621
|
if (err) {
|
|
@@ -2622,7 +2623,7 @@ function SignoutUserFromAllDevices(options, dbMaster, redisClient) {
|
|
|
2622
2623
|
options.callback({ message: 'error', error: err });
|
|
2623
2624
|
}
|
|
2624
2625
|
if (data) {
|
|
2625
|
-
|
|
2626
|
+
// sessionID = data.map(x => x._id);
|
|
2626
2627
|
if (options.Platform) {
|
|
2627
2628
|
data = data.filter(function (x) { return (x.Platform == options.Platform); });
|
|
2628
2629
|
}
|
|
@@ -2635,7 +2636,14 @@ function SignoutUserFromAllDevices(options, dbMaster, redisClient) {
|
|
|
2635
2636
|
}
|
|
2636
2637
|
}
|
|
2637
2638
|
}
|
|
2638
|
-
|
|
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) {
|
|
2639
2647
|
if (err) {
|
|
2640
2648
|
if (options.callback)
|
|
2641
2649
|
options.callback({ message: 'error', error: err });
|
|
@@ -3461,9 +3469,12 @@ function SyncUserLicenceConsumedCount(msp_d, db, dbMaster) {
|
|
|
3461
3469
|
companyLicencesData_1 = (companySetting.Setting.Licences) ? companySetting.Setting.Licences : {};
|
|
3462
3470
|
if (isEmptyObj(companyLicencesData_1) == false) {
|
|
3463
3471
|
for (i in companyLicencesData_1) {
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
companyLicenceType
|
|
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
|
+
}
|
|
3467
3478
|
}
|
|
3468
3479
|
}
|
|
3469
3480
|
db.collection('UserLicence').aggregate([
|