@optimiser/common 1.0.242 → 1.0.246
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/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/lib/connection.d.ts +13 -1
- package/dist/lib/connection.js +96 -0
- package/dist/lib/helper.d.ts +3 -1
- package/dist/lib/helper.js +16 -6
- package/dist/lib/memoryserverclient.d.ts +39 -0
- package/dist/lib/memoryserverclient.js +196 -0
- package/dist/lib/operautilitycommon.d.ts +60 -1
- package/dist/lib/operautilitycommon.js +512 -1
- package/dist/lib/utility.d.ts +8 -1
- package/dist/lib/utility.js +157 -64
- package/package.json +1 -1
package/dist/lib/utility.js
CHANGED
|
@@ -80,7 +80,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
80
80
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
81
81
|
};
|
|
82
82
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
83
|
-
exports.CreateBanquetingVATSettingsData = exports.ValidateSanitizeUserInput = exports.CheckCaptcha = exports.ErrorHandlerForServices = exports.CheckPageAuthentication = exports.GetUserProfile = exports.RemoveFieldsFromFilters = exports.GetDayIndex = exports.GetWeekDayInfoInMonth = exports.GetInterValFromOccurance = exports.GetWeekDayByDayAndOccurance = exports.CheckDateNotInPast = exports.NextServiceDateForDashboard = exports.SyncCompanyLicenceInMasterCompanyAfterAdd = exports.CheckDataPermission = exports.BroadCastEventToAllCompanyUsers = exports.SyncUserLicenceConsumedCount = exports.ReactivateFieldInOtherCollection = exports.SyncTagCountAfterUpdate = exports.UpdateTagCountAfterDelete = exports.SyncListSchemaFieldInOtherCollection = exports.isEmptyObj = exports.GetIPDetailsFromReq = exports.parseMSPCookie = exports.SendMailToCustomer = exports.MailTemplateStructure = exports.SendMailToSupport = exports.SendResetPasswordMail = exports.ConvertJsonToXLXS = exports.MakeUserPasswordInvalid = exports.GetUserProfilePermissions = exports.ExecuteDynamicDQLQuery = exports.ExecuteDynamicDMLQuery = exports.GetCompanyEncryptionKey = exports.GetEmailClientConfigs = exports.sendMailWithUserAccount = exports.UserLicenseConsumeCalculate = exports.SignoutMultipleUsersFromAllDevices = exports.SignoutUsersWithPromise = exports.SignoutUserFromAllDevices = exports.SyncUserDetailsWithMasterDB = exports.GenerateId = exports.VerifyAWSEmailConfig = exports.GetMaxKeyValueListSchema = exports.ExtractChildUsersTree = exports.GetMyTeamUsers = exports.VerifyEmailPassword = exports.CheckFilterFieldsProjection = exports.AddLog = exports.GirdHeaderFilters = exports.FilterConditions = exports.BuildLookupFieldProjection = exports.BuildFieldProjection = exports.BuildGridFieldProjection = exports.CheckDataBeforeUpdate = exports.CheckDataBeforeAdd = exports.BuildLookupDataField = exports.SyncUserInOtherCollection = exports.SyncFieldInOtherCollection = exports.SyncFieldInSameCollectionByObjectIDWithPromise = exports.SyncFieldInSameCollectionByObjectID = exports.SyncFieldInSameCollection = exports.DeleteFieldInOtherCollection = exports.SyncParentObjectData = exports.SyncChildObjectData = exports.UpdateRecentViewObject = exports.GetFieldDetail = exports.GetPageObjectSchema = exports.GetPageFieldData = exports.CheckUserProfileField = exports.IsEqualValue = exports.IsEqualArrays = exports.GetObjectByKeyValueFromList = exports.ConvertFileByteSize = exports.ReturnJsonResponse = exports.CheckForWhiteListedDomain = void 0;
|
|
83
|
+
exports.CreateBanquetingVATSettingsData = exports.ValidateSanitizeUserInput = exports.CheckCaptcha = exports.ErrorHandlerForServices = exports.CheckPageAuthentication = exports.GetUserProfile = exports.RemoveFieldsFromFilters = exports.GetDayIndex = exports.GetWeekDayInfoInMonth = exports.GetInterValFromOccurance = exports.GetWeekDayByDayAndOccurance = exports.CheckDateNotInPast = exports.NextServiceDateForDashboard = exports.SyncCompanyLicenceInMasterCompanyAfterAdd = exports.CheckDataPermission = exports.BroadCastEventToAllCompanyUsers = exports.SyncUserLicenceConsumedCount = exports.ReactivateFieldInOtherCollection = exports.SyncTagCountAfterUpdate = exports.UpdateTagCountAfterDelete = exports.SyncListSchemaFieldInOtherCollection = exports.isEmptyObj = exports.GetIPDetailsFromReq = exports.parseMSPCookie = exports.SendMailToCustomer = exports.MailTemplateStructure = exports.SendMailToSupport = exports.SendResetPasswordMail = exports.ConvertJsonToXLXS = exports.MakeUserPasswordInvalid = exports.GetUserProfilePermissions = exports.ExecuteDynamicDQLQuery = exports.ExecuteDynamicDMLQuery = exports.GetCompanyEncryptionKey = exports.GetEmailClientConfigs = exports.sendMailWithUserAccount = exports.UserLicenseConsumeCalculate = exports.SignoutMultipleUsersFromAllDevices = exports.SignoutUsersWithPromise = exports.SignoutUserFromAllDevices = exports.SyncUserDetailsWithMasterDB = exports.GenerateId = exports.VerifyAWSEmailConfig = exports.GetMaxKeyValueListSchema = exports.ExtractChildUsersTree = exports.GetMyTeamUsers = exports.VerifyEmailPassword = exports.CheckFilterFieldsProjection = exports.AddLog = exports.FieldsGridHeaderFilters = exports.GirdHeaderFilters = exports.FilterConditions = exports.BuildLookupFieldProjection = exports.BuildFieldProjection = exports.BuildGridFieldProjection = exports.CheckDataBeforeUpdate = exports.CheckDataBeforeAdd = exports.BuildLookupDataField = exports.SyncUserInOtherCollection = exports.SyncFieldInOtherCollection = exports.SyncFieldInSameCollectionByObjectIDWithPromise = exports.SyncFieldInSameCollectionByObjectID = exports.SyncFieldInSameCollection = exports.DeleteFieldInOtherCollection = exports.SyncParentObjectData = exports.SyncChildObjectData = exports.UpdateRecentViewFields = exports.UpdateRecentViewObject = exports.GetFieldDetail = exports.GetPageObjectSchema = exports.GetPageFieldData = exports.CheckUserProfileField = exports.IsEqualValue = exports.IsEqualArrays = exports.GetObjectByKeyValueFromList = exports.ConvertFileByteSize = exports.ReturnJsonResponse = exports.CheckForWhiteListedDomain = void 0;
|
|
84
84
|
var moment_1 = __importDefault(require("moment"));
|
|
85
85
|
var nodemailer_1 = __importDefault(require("nodemailer"));
|
|
86
86
|
var mongodb_1 = require("mongodb");
|
|
@@ -206,7 +206,7 @@ function GetPageFieldData(pageName, db, mdb, msp_d, next, callback) {
|
|
|
206
206
|
else {
|
|
207
207
|
db.collection("ObjectSchema").findOne({ 'Name': pageData.ObjectName }, function (err, objectData) {
|
|
208
208
|
return __awaiter(this, void 0, void 0, function () {
|
|
209
|
-
var removeFieldsFromFilter, j, filterData, _loop_2, i,
|
|
209
|
+
var removeFieldsFromFilter, j, filterData, _loop_2, i, createdByObj, createdDateObj, modByObj, modDateObj, g, group, childObjectSchema, _loop_3, i, _loop_4, i, idObject, idObject_1;
|
|
210
210
|
return __generator(this, function (_a) {
|
|
211
211
|
switch (_a.label) {
|
|
212
212
|
case 0:
|
|
@@ -236,47 +236,6 @@ function GetPageFieldData(pageName, db, mdb, msp_d, next, callback) {
|
|
|
236
236
|
_loop_2(i);
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
|
-
if (!(pageData.Groups != undefined)) return [3 /*break*/, 5];
|
|
240
|
-
g = 0;
|
|
241
|
-
_a.label = 1;
|
|
242
|
-
case 1:
|
|
243
|
-
if (!(g < pageData.Groups.length)) return [3 /*break*/, 5];
|
|
244
|
-
group = pageData.Groups[g];
|
|
245
|
-
if (!group.IsRealLookup) return [3 /*break*/, 3];
|
|
246
|
-
return [4 /*yield*/, db.collection('ObjectSchema').findOne({ 'Name': group.ChildObject })];
|
|
247
|
-
case 2:
|
|
248
|
-
childObjectSchema = _a.sent();
|
|
249
|
-
_loop_3 = function (i) {
|
|
250
|
-
var fld = group.Fields[i];
|
|
251
|
-
var fldSchema = childObjectSchema.Fields.find(function (x) { return x.Name == fld.Name; });
|
|
252
|
-
if (fldSchema) {
|
|
253
|
-
fld.Schema = fldSchema;
|
|
254
|
-
fld.ObjectName = group.ChildObject;
|
|
255
|
-
fld.UniqueID = group.Name + '.' + fld.Name;
|
|
256
|
-
}
|
|
257
|
-
};
|
|
258
|
-
for (i = 0; i < group.Fields.length; i++) {
|
|
259
|
-
_loop_3(i);
|
|
260
|
-
}
|
|
261
|
-
return [3 /*break*/, 4];
|
|
262
|
-
case 3:
|
|
263
|
-
_loop_4 = function (i) {
|
|
264
|
-
var fld = group.Fields[i];
|
|
265
|
-
var fldSchema = objectData.Fields.find(function (x) { return x.Name == fld.Name; });
|
|
266
|
-
if (fldSchema) {
|
|
267
|
-
fld.Schema = fldSchema;
|
|
268
|
-
fld.ObjectName = pageData.ObjectName;
|
|
269
|
-
fld.UniqueID = fld.Name;
|
|
270
|
-
}
|
|
271
|
-
};
|
|
272
|
-
for (i = 0; i < group.Fields.length; i++) {
|
|
273
|
-
_loop_4(i);
|
|
274
|
-
}
|
|
275
|
-
_a.label = 4;
|
|
276
|
-
case 4:
|
|
277
|
-
g++;
|
|
278
|
-
return [3 /*break*/, 1];
|
|
279
|
-
case 5:
|
|
280
239
|
createdByObj = {
|
|
281
240
|
Name: "CreatedBy",
|
|
282
241
|
DisplayName: "Created By",
|
|
@@ -301,12 +260,26 @@ function GetPageFieldData(pageName, db, mdb, msp_d, next, callback) {
|
|
|
301
260
|
]
|
|
302
261
|
}
|
|
303
262
|
};
|
|
263
|
+
createdDateObj = {
|
|
264
|
+
Name: "CreatedDate",
|
|
265
|
+
DisplayName: "Created Date",
|
|
266
|
+
UniqueID: "CreatedDate",
|
|
267
|
+
Sequence: 101,
|
|
268
|
+
HideON: "both",
|
|
269
|
+
Schema: {
|
|
270
|
+
Name: "CreatedDate",
|
|
271
|
+
HideON: "both",
|
|
272
|
+
DisplayName: "Created Date",
|
|
273
|
+
ApiName: "CreatedDate",
|
|
274
|
+
UIDataType: "datetime"
|
|
275
|
+
}
|
|
276
|
+
};
|
|
304
277
|
modByObj = {
|
|
305
278
|
Name: "ModifiedBy",
|
|
306
279
|
DisplayName: "Modified By",
|
|
307
280
|
ApiName: "ModifiedBy",
|
|
308
281
|
HideON: "both",
|
|
309
|
-
Sequence:
|
|
282
|
+
Sequence: 102,
|
|
310
283
|
UniqueID: "ModifiedBy",
|
|
311
284
|
Schema: {
|
|
312
285
|
Name: "ModifiedBy",
|
|
@@ -325,20 +298,6 @@ function GetPageFieldData(pageName, db, mdb, msp_d, next, callback) {
|
|
|
325
298
|
]
|
|
326
299
|
}
|
|
327
300
|
};
|
|
328
|
-
createdDateObj = {
|
|
329
|
-
Name: "CreatedDate",
|
|
330
|
-
DisplayName: "Created Date",
|
|
331
|
-
UniqueID: "CreatedDate",
|
|
332
|
-
Sequence: 102,
|
|
333
|
-
HideON: "both",
|
|
334
|
-
Schema: {
|
|
335
|
-
Name: "CreatedDate",
|
|
336
|
-
HideON: "both",
|
|
337
|
-
DisplayName: "Created Date",
|
|
338
|
-
ApiName: "CreatedDate",
|
|
339
|
-
UIDataType: "datetime"
|
|
340
|
-
}
|
|
341
|
-
};
|
|
342
301
|
modDateObj = {
|
|
343
302
|
Name: "ModifiedDate",
|
|
344
303
|
DisplayName: "Modified Date",
|
|
@@ -353,6 +312,73 @@ function GetPageFieldData(pageName, db, mdb, msp_d, next, callback) {
|
|
|
353
312
|
UIDataType: "datetime"
|
|
354
313
|
}
|
|
355
314
|
};
|
|
315
|
+
if (!(pageData.Groups != undefined)) return [3 /*break*/, 5];
|
|
316
|
+
g = 0;
|
|
317
|
+
_a.label = 1;
|
|
318
|
+
case 1:
|
|
319
|
+
if (!(g < pageData.Groups.length)) return [3 /*break*/, 5];
|
|
320
|
+
group = pageData.Groups[g];
|
|
321
|
+
if (!group.IsRealLookup) return [3 /*break*/, 3];
|
|
322
|
+
return [4 /*yield*/, db.collection('ObjectSchema').findOne({ 'Name': group.ChildObject })];
|
|
323
|
+
case 2:
|
|
324
|
+
childObjectSchema = _a.sent();
|
|
325
|
+
_loop_3 = function (i) {
|
|
326
|
+
var fld = group.Fields[i];
|
|
327
|
+
var fldSchema = childObjectSchema.Fields.find(function (x) { return x.Name == fld.Name; });
|
|
328
|
+
if (fldSchema) {
|
|
329
|
+
fld.Schema = fldSchema;
|
|
330
|
+
fld.ObjectName = group.ChildObject;
|
|
331
|
+
fld.UniqueID = group.Name + '.' + fld.Name;
|
|
332
|
+
if (pageData.Type == "ObjectDetail" && fldSchema.UIDataType == "collection") { // By Kashish - To handle System Fields in Group Collection Field
|
|
333
|
+
if (fld.Schema && fld.Schema.Fields.length > 0) {
|
|
334
|
+
fld.Schema.Fields.splice(0, 0, {
|
|
335
|
+
Name: "_id",
|
|
336
|
+
Sequence: 0,
|
|
337
|
+
UIDataType: "objectid",
|
|
338
|
+
UniqueID: "_id",
|
|
339
|
+
DisplayName: "ID",
|
|
340
|
+
HideON: "both"
|
|
341
|
+
});
|
|
342
|
+
fld.Schema.Fields.splice(fld.Schema.Fields.length, null, createdByObj.Schema, createdDateObj.Schema, modByObj.Schema, modDateObj.Schema);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
};
|
|
347
|
+
for (i = 0; i < group.Fields.length; i++) {
|
|
348
|
+
_loop_3(i);
|
|
349
|
+
}
|
|
350
|
+
return [3 /*break*/, 4];
|
|
351
|
+
case 3:
|
|
352
|
+
_loop_4 = function (i) {
|
|
353
|
+
var fld = group.Fields[i];
|
|
354
|
+
var fldSchema = objectData.Fields.find(function (x) { return x.Name == fld.Name; });
|
|
355
|
+
if (fldSchema) {
|
|
356
|
+
fld.Schema = fldSchema;
|
|
357
|
+
fld.ObjectName = pageData.ObjectName;
|
|
358
|
+
fld.UniqueID = fld.Name;
|
|
359
|
+
if (pageData.Type == "ObjectDetail" && fldSchema.UIDataType == "collection") { // By Kashish - To handle System Fields in Group Collection Field
|
|
360
|
+
if (fld.Schema && fld.Schema.Fields.length > 0) {
|
|
361
|
+
fld.Schema.Fields.splice(0, 0, {
|
|
362
|
+
Name: "_id",
|
|
363
|
+
Sequence: 0,
|
|
364
|
+
UIDataType: "objectid",
|
|
365
|
+
UniqueID: "_id",
|
|
366
|
+
DisplayName: "ID",
|
|
367
|
+
HideON: "both"
|
|
368
|
+
});
|
|
369
|
+
fld.Schema.Fields.splice(fld.Schema.Fields.length, null, createdByObj.Schema, createdDateObj.Schema, modByObj.Schema, modDateObj.Schema);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
for (i = 0; i < group.Fields.length; i++) {
|
|
375
|
+
_loop_4(i);
|
|
376
|
+
}
|
|
377
|
+
_a.label = 4;
|
|
378
|
+
case 4:
|
|
379
|
+
g++;
|
|
380
|
+
return [3 /*break*/, 1];
|
|
381
|
+
case 5:
|
|
356
382
|
if (pageData.Fields && pageData.Type == "ObjectGrid") {
|
|
357
383
|
idObject = {
|
|
358
384
|
Name: "_id",
|
|
@@ -387,7 +413,7 @@ function GetPageFieldData(pageName, db, mdb, msp_d, next, callback) {
|
|
|
387
413
|
s.Schema.Fields.splice(0, 0, idObject_1);
|
|
388
414
|
//By Kashish : To handle System Info Fields
|
|
389
415
|
if (createdByObj && createdDateObj && modByObj && modDateObj) {
|
|
390
|
-
s.Schema.Fields.splice(
|
|
416
|
+
s.Schema.Fields.splice(s.Schema.Fields.length, null, createdByObj.Schema, createdDateObj.Schema, modByObj.Schema, modDateObj.Schema);
|
|
391
417
|
}
|
|
392
418
|
}
|
|
393
419
|
});
|
|
@@ -460,6 +486,21 @@ function UpdateRecentViewObject(objectName, objectID, userID, db) {
|
|
|
460
486
|
});
|
|
461
487
|
}
|
|
462
488
|
exports.UpdateRecentViewObject = UpdateRecentViewObject;
|
|
489
|
+
function UpdateRecentViewFields(objectName, fieldID, userID, db) {
|
|
490
|
+
db.collection('RecentViewObject').findOne({ 'ObjectName': objectName, 'FieldID': fieldID, 'ViewedBy': userID }, { projection: { _id: 1 } }, function (err, viewedData) {
|
|
491
|
+
if (viewedData)
|
|
492
|
+
db.collection('RecentViewObject').updateOne({ '_id': viewedData._id }, { $set: { 'ViewedDate': new Date() } });
|
|
493
|
+
else
|
|
494
|
+
db.collection("RecentViewObject").insertOne({ 'ObjectName': objectName, 'FieldID': fieldID, 'ViewedBy': userID, 'ViewedDate': new Date() });
|
|
495
|
+
db.collection("RecentViewObject").find({ 'ObjectName': objectName, 'ViewedBy': userID }, { projection: { _id: 1 } }).sort({ 'ViewedDate': -1 }).skip(10).toArray(function (err, data) {
|
|
496
|
+
if (data && data.length > 0) {
|
|
497
|
+
var idsArry = data.map(function (i) { return i._id; });
|
|
498
|
+
db.collection("RecentViewObject").deleteMany({ _id: { $in: idsArry } });
|
|
499
|
+
}
|
|
500
|
+
});
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
exports.UpdateRecentViewFields = UpdateRecentViewFields;
|
|
463
504
|
//Sync child object
|
|
464
505
|
function SyncChildObjectData(pageData, objectID, db) {
|
|
465
506
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -2147,6 +2188,58 @@ function GirdHeaderFilters(filters, fields) {
|
|
|
2147
2188
|
return { '$and': sets };
|
|
2148
2189
|
}
|
|
2149
2190
|
exports.GirdHeaderFilters = GirdHeaderFilters;
|
|
2191
|
+
function FieldsGridHeaderFilters(filters, fields) {
|
|
2192
|
+
var sets = [];
|
|
2193
|
+
var lookupFieldsSets = [];
|
|
2194
|
+
var _loop_15 = function (i) {
|
|
2195
|
+
var _a;
|
|
2196
|
+
var obj = filters[i];
|
|
2197
|
+
var field = fields.find(function (x) { return x.UniqueID == obj.Name; });
|
|
2198
|
+
if (field) {
|
|
2199
|
+
var matchValue = null;
|
|
2200
|
+
var fldName = field.UniqueID;
|
|
2201
|
+
if (["lookup", "multilookup"].includes(field.Schema.UIDataType)) {
|
|
2202
|
+
fldName += '_SearchValue';
|
|
2203
|
+
lookupFieldsSets.push((_a = {}, _a[fldName] = new RegExp(obj.Value.trim().replace(/[-[\]{}()*+?.,\\/^$|#\s]/g, "\\$&"), 'i'), _a));
|
|
2204
|
+
return "continue";
|
|
2205
|
+
}
|
|
2206
|
+
if (["dropdown", "multiselect"].includes(field.Schema.UIDataType)) {
|
|
2207
|
+
if (field.Schema.LookupObject) {
|
|
2208
|
+
matchValue = { '$in': bson_1.EJSON.parse(JSON.stringify(obj.Value)) };
|
|
2209
|
+
}
|
|
2210
|
+
else {
|
|
2211
|
+
matchValue = { '$in': obj.Value };
|
|
2212
|
+
}
|
|
2213
|
+
}
|
|
2214
|
+
else if (["date", "datetime"].includes(field.Schema.UIDataType))
|
|
2215
|
+
matchValue = { '$gte': moment_1.default(obj.Value.From).startOf('day').toDate(), '$lte': moment_1.default(obj.Value.To).endOf('day').toDate() };
|
|
2216
|
+
// else if (field.Schema.UIDataType == 'time')
|
|
2217
|
+
// matchValue = (obj.Value == 'true');
|
|
2218
|
+
else if (field.Schema.UIDataType == 'checkbox') {
|
|
2219
|
+
if (obj.Value == 'true')
|
|
2220
|
+
matchValue = true;
|
|
2221
|
+
else
|
|
2222
|
+
matchValue = { $ne: true };
|
|
2223
|
+
}
|
|
2224
|
+
else if (field.Schema.UIDataType == 'int')
|
|
2225
|
+
matchValue = { '$eq': parseInt(obj.Value) };
|
|
2226
|
+
else if (["decimal", "percent"].includes(field.Schema.UIDataType))
|
|
2227
|
+
matchValue = { '$eq': mongodb_1.Decimal128.fromString(obj.Value) };
|
|
2228
|
+
else if (field.Schema.UIDataType == 'objectid')
|
|
2229
|
+
matchValue = { '$eq': obj.Value };
|
|
2230
|
+
else
|
|
2231
|
+
matchValue = { '$regex': obj.Value.trim().replace(/[-[\]{}()*+?.,\\/^$|#\s]/g, "\\$&"), '$options': 'i' };
|
|
2232
|
+
var fieldMatch = {};
|
|
2233
|
+
fieldMatch['Fields.' + fldName] = matchValue;
|
|
2234
|
+
sets.push(fieldMatch);
|
|
2235
|
+
}
|
|
2236
|
+
};
|
|
2237
|
+
for (var i = 0; i < filters.length; i++) {
|
|
2238
|
+
_loop_15(i);
|
|
2239
|
+
}
|
|
2240
|
+
return { '$and': sets, 'lookupConditions': lookupFieldsSets };
|
|
2241
|
+
}
|
|
2242
|
+
exports.FieldsGridHeaderFilters = FieldsGridHeaderFilters;
|
|
2150
2243
|
/** @desc:{
|
|
2151
2244
|
objectName: It's a name of Collection.
|
|
2152
2245
|
logAction: Add | Modify | Delete
|
|
@@ -2180,7 +2273,7 @@ function AddLog(req, objectName, logAction, objLogProp, db, next) {
|
|
|
2180
2273
|
exports.AddLog = AddLog;
|
|
2181
2274
|
function CheckFilterFieldsProjection(condition, fields, pageData, project) {
|
|
2182
2275
|
if (condition != undefined && condition.Filters.length > 0) {
|
|
2183
|
-
var
|
|
2276
|
+
var _loop_16 = function (i) {
|
|
2184
2277
|
var objFilter = condition.Filters[i];
|
|
2185
2278
|
if (objFilter.Type == "Child") {
|
|
2186
2279
|
CheckFilterFieldsProjection(objFilter, fields, pageData, project);
|
|
@@ -2198,7 +2291,7 @@ function CheckFilterFieldsProjection(condition, fields, pageData, project) {
|
|
|
2198
2291
|
}
|
|
2199
2292
|
};
|
|
2200
2293
|
for (var i = 0; i < condition.Filters.length; i++) {
|
|
2201
|
-
|
|
2294
|
+
_loop_16(i);
|
|
2202
2295
|
}
|
|
2203
2296
|
}
|
|
2204
2297
|
}
|
|
@@ -3787,7 +3880,7 @@ function GetDayIndex(day) {
|
|
|
3787
3880
|
exports.GetDayIndex = GetDayIndex;
|
|
3788
3881
|
function GetUserProfile(msp_d, db, mdb, next) {
|
|
3789
3882
|
return __awaiter(this, void 0, void 0, function () {
|
|
3790
|
-
var userData, userProfile_1, error_3, objectIDs_1, modules_1, licenceDetail, moduleList,
|
|
3883
|
+
var userData, userProfile_1, error_3, objectIDs_1, modules_1, licenceDetail, moduleList, _loop_17, i, error_4;
|
|
3791
3884
|
return __generator(this, function (_a) {
|
|
3792
3885
|
switch (_a.label) {
|
|
3793
3886
|
case 0:
|
|
@@ -3850,14 +3943,14 @@ function GetUserProfile(msp_d, db, mdb, next) {
|
|
|
3850
3943
|
moduleList = userProfile_1[0].ModuleList;
|
|
3851
3944
|
userProfile_1[0].HasControlPanelAccess = [];
|
|
3852
3945
|
if (userProfile_1[0].Permissions) {
|
|
3853
|
-
|
|
3946
|
+
_loop_17 = function (i) {
|
|
3854
3947
|
userProfile_1[0].Permissions[i].ModuleData = moduleList.find(function (x) { return x._id == userProfile_1[0].Permissions[i].ModuleID; });
|
|
3855
3948
|
if (userProfile_1[0].Permissions[i].Operations.includes("Control Panel")) {
|
|
3856
3949
|
userProfile_1[0].HasControlPanelAccess.push(userProfile_1[0].Permissions[i].ModuleID);
|
|
3857
3950
|
}
|
|
3858
3951
|
};
|
|
3859
3952
|
for (i = 0; i < userProfile_1[0].Permissions.length; i++) {
|
|
3860
|
-
|
|
3953
|
+
_loop_17(i);
|
|
3861
3954
|
}
|
|
3862
3955
|
}
|
|
3863
3956
|
if (moduleList.length == 0) {
|