@optimiser/common 1.0.266 → 1.0.267

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.
@@ -423,7 +423,7 @@ var Connection = /** @class */ (function () {
423
423
  Type: "ERROR"
424
424
  })];
425
425
  }
426
- db.collection("User").findOne({ _id: new mongodb_1.ObjectID(req.cookies.msp_d.ui) }).then(function (user) {
426
+ db.collection("User").findOne({ _id: new mongodb_1.ObjectId(req.cookies.msp_d.ui) }).then(function (user) {
427
427
  if (!user) {
428
428
  return _this.ReturnJsonResponse(req, res, {
429
429
  Data: {},
package/dist/lib/event.js CHANGED
@@ -57,7 +57,7 @@ var Event = /** @class */ (function () {
57
57
  switch (_a.label) {
58
58
  case 0:
59
59
  if (!(db && userId && data && data.PushNotificationObj && !data.PushNotificationObj["endpoint"])) return [3 /*break*/, 2];
60
- return [4 /*yield*/, db.collection('UserNotification').findOne({ UserID: new mongodb_1.ObjectID(userId) })];
60
+ return [4 /*yield*/, db.collection('UserNotification').findOne({ UserID: new mongodb_1.ObjectId(userId) })];
61
61
  case 1:
62
62
  userObj = _a.sent();
63
63
  if (userObj && userObj.endpoint && userObj.keys && data.PushNotificationObj) {
@@ -130,8 +130,8 @@ var Event = /** @class */ (function () {
130
130
  CreatedDate: new Date(),
131
131
  Users: [],
132
132
  EventObjectName: data.EventObjectName,
133
- EventID: new mongodb_1.ObjectID(data.EventID),
134
- CreatedBy: new mongodb_1.ObjectID(data.CreatedBy),
133
+ EventID: new mongodb_1.ObjectId(data.EventID),
134
+ CreatedBy: new mongodb_1.ObjectId(data.CreatedBy),
135
135
  Message: data.Message
136
136
  };
137
137
  var Userid = [];
@@ -139,7 +139,7 @@ var Event = /** @class */ (function () {
139
139
  Userid.push({
140
140
  "IsSeen": false,
141
141
  "IsNew": true,
142
- "UserID": new mongodb_1.ObjectID(id)
142
+ "UserID": new mongodb_1.ObjectId(id)
143
143
  });
144
144
  });
145
145
  saveObj.Users = Userid;
@@ -1,4 +1,4 @@
1
- import { Db, ObjectID } from "mongodb";
1
+ import { Db, ObjectId } from "mongodb";
2
2
  import { AnyObjectInterface } from "../modals/utility.modal";
3
3
  declare function GetCompanyDetails(Master_DB: Db, companyId: string): Promise<any>;
4
4
  declare function GetListSchema(db: Db, listName: string): Promise<Error | AnyObjectInterface[] | []>;
@@ -6,7 +6,7 @@ declare function GetEmailwiseUnsubscribeData(db: Db, mailID: string, domainID?:
6
6
  declare function GenerateAutoIncrementFieldValue(db: Db, autoIncrementID: string): Promise<null | string>;
7
7
  declare function GetAccountDetailByName(db: Db, accountName: string): Promise<AnyObjectInterface | null>;
8
8
  declare function GetContactDetailByEmail(db: Db, contactEmail: string): Promise<null | AnyObjectInterface>;
9
- declare function GetSystemEmailTemplate(db: Db, TemplateIDArray: ObjectID[]): Promise<null | AnyObjectInterface>;
9
+ declare function GetSystemEmailTemplate(db: Db, TemplateIDArray: ObjectId[]): Promise<null | AnyObjectInterface>;
10
10
  declare function UpdateContactDetails(db: Db, contactData: AnyObjectInterface): void;
11
11
  declare function CreateContact(db: Db, contactData: AnyObjectInterface): Promise<null | AnyObjectInterface>;
12
12
  declare function MapAccountContact(db: Db, dataObj: AnyObjectInterface): void;
@@ -50,7 +50,7 @@ declare const GetEmailSubscribeStatus: (db: Db, email: string) => Promise<Error
50
50
  * @param {mongodbQueryOptions} object, params to pass on db queries
51
51
  * @returns resolve success | error object
52
52
  */
53
- declare const SubscribeEmailForAllDomains: (db: Db, email: string, isSubscribe: boolean, companyID: ObjectID, comment?: string, mongodbQueryOptions?: any) => Promise<unknown>;
53
+ declare const SubscribeEmailForAllDomains: (db: Db, email: string, isSubscribe: boolean, companyID: ObjectId, comment?: string, mongodbQueryOptions?: any) => Promise<unknown>;
54
54
  /**
55
55
  * checking phone number is valid and has dialing code
56
56
  * if it has dialing code then get country code, get its optimiser country phone code
@@ -45,7 +45,7 @@ var constants_1 = __importDefault(require("../constants"));
45
45
  var moment_1 = __importDefault(require("moment"));
46
46
  var libphonenumber_js_1 = require("libphonenumber-js");
47
47
  function GetCompanyDetails(Master_DB, companyId) {
48
- return Master_DB.collection('Company').findOne({ _id: new mongodb_1.ObjectID(companyId) });
48
+ return Master_DB.collection('Company').findOne({ _id: new mongodb_1.ObjectId(companyId) });
49
49
  }
50
50
  exports.GetCompanyDetails = GetCompanyDetails;
51
51
  function GetListSchema(db, listName) {
@@ -519,7 +519,7 @@ var EmailPrioritySearch = function (params) { return __awaiter(void 0, void 0, v
519
519
  if (!(memoryServerSearchData && Object.keys(memoryServerSearchData.response).length !== 0)) return [3 /*break*/, 4];
520
520
  id = (_b = memoryServerSearchData === null || memoryServerSearchData === void 0 ? void 0 : memoryServerSearchData.response) === null || _b === void 0 ? void 0 : _b._id;
521
521
  if (!(id && id !== '')) return [3 /*break*/, 3];
522
- convertedToObjectID = new mongodb_1.ObjectID(id);
522
+ convertedToObjectID = new mongodb_1.ObjectId(id);
523
523
  return [4 /*yield*/, params.db.collection(params.ProfileType).findOne({ '_id': convertedToObjectID }, mongodbTransactionQueryopts)];
524
524
  case 2:
525
525
  result = _c.sent();
@@ -157,7 +157,7 @@ function GenerateTaskNotifications(req, options, db, event) {
157
157
  if (!tasks_1[0].ListSublist)
158
158
  return [2 /*return*/];
159
159
  return [4 /*yield*/, db.collection('TaskList').findOne({
160
- _id: new mongodb_1.ObjectID(tasks_1[0].ListSublist)
160
+ _id: new mongodb_1.ObjectId(tasks_1[0].ListSublist)
161
161
  })];
162
162
  case 3:
163
163
  list = _b.sent();
@@ -179,12 +179,12 @@ function GenerateTaskNotifications(req, options, db, event) {
179
179
  info['taskBeforeEdit'] = options.taskBeforeEdit;
180
180
  return [3 /*break*/, 8];
181
181
  case 4: return [4 /*yield*/, db.collection('Task').findOne({
182
- _id: new mongodb_1.ObjectID(options.taskID)
182
+ _id: new mongodb_1.ObjectId(options.taskID)
183
183
  })];
184
184
  case 5:
185
185
  task = _b.sent();
186
186
  return [4 /*yield*/, db.collection('TaskList').findOne({
187
- _id: new mongodb_1.ObjectID(task.ListSublist)
187
+ _id: new mongodb_1.ObjectId(task.ListSublist)
188
188
  })];
189
189
  case 6:
190
190
  list = _b.sent();
@@ -262,10 +262,10 @@ function CreateNotificationContent(info, req, db, event) {
262
262
  return __generator(this, function (_b) {
263
263
  switch (_b.label) {
264
264
  case 0:
265
- UserID = new mongodb_1.ObjectID(req.cookies.msp_d.ui);
265
+ UserID = new mongodb_1.ObjectId(req.cookies.msp_d.ui);
266
266
  Payload = {};
267
267
  FetchUsers = function (query) { return db.collection('User').find(query).toArray(); };
268
- ListInfo = function (id) { return db.collection('TaskList').findOne({ _id: new mongodb_1.ObjectID(id) }); };
268
+ ListInfo = function (id) { return db.collection('TaskList').findOne({ _id: new mongodb_1.ObjectId(id) }); };
269
269
  TaskInfo = function (TaskNumber) { return db.collection('Task').findOne({ TaskNumber: TaskNumber }); };
270
270
  NotificationContent = {};
271
271
  _a = info.page;
@@ -354,7 +354,7 @@ function CreateNotificationContent(info, req, db, event) {
354
354
  creator = _b.sent();
355
355
  creator = creator[0];
356
356
  return [3 /*break*/, 13];
357
- case 11: return [4 /*yield*/, FetchUsers({ _id: new mongodb_1.ObjectID(info.receiverId), "UserStatus": { $not: { $eq: "Blocked" } } })];
357
+ case 11: return [4 /*yield*/, FetchUsers({ _id: new mongodb_1.ObjectId(info.receiverId), "UserStatus": { $not: { $eq: "Blocked" } } })];
358
358
  case 12:
359
359
  users = _b.sent();
360
360
  creator = info.senderData[0];
@@ -398,7 +398,7 @@ function CreateNotificationContent(info, req, db, event) {
398
398
  if (!(info.event == 'EDIT_TASK')) return [3 /*break*/, 17];
399
399
  if ((req.body.AssignedTo ? req.body.AssignedTo.$oid : (oldTaskData.AssignedTo).toString()) == (oldTaskData.OwnerID).toString())
400
400
  return [2 /*return*/];
401
- receiverId_1 = new mongodb_1.ObjectID((req.cookies.msp_d.ui == (oldTaskData.AssignedTo).toString()) ? oldTaskData.OwnerID : (oldTaskData.AssignedTo).toString());
401
+ receiverId_1 = new mongodb_1.ObjectId((req.cookies.msp_d.ui == (oldTaskData.AssignedTo).toString()) ? oldTaskData.OwnerID : (oldTaskData.AssignedTo).toString());
402
402
  return [4 /*yield*/, FetchUsers({
403
403
  _id: receiverId_1,
404
404
  "UserStatus": { $not: { $eq: "Blocked" } }
@@ -492,7 +492,7 @@ function CreateNotificationContent(info, req, db, event) {
492
492
  return [3 /*break*/, 20];
493
493
  case 17:
494
494
  if (!(info.event == "EDIT_TASK_INLINE")) return [3 /*break*/, 20];
495
- receiverId_2 = new mongodb_1.ObjectID((req.cookies.msp_d.ui == (oldTaskData.AssignedTo).toString()) ? oldTaskData.OwnerID : (oldTaskData.AssignedTo).toString());
495
+ receiverId_2 = new mongodb_1.ObjectId((req.cookies.msp_d.ui == (oldTaskData.AssignedTo).toString()) ? oldTaskData.OwnerID : (oldTaskData.AssignedTo).toString());
496
496
  return [4 /*yield*/, FetchUsers({ _id: receiverId_2, "UserStatus": { $not: { $eq: "Blocked" } } })];
497
497
  case 18:
498
498
  receiverData_2 = _b.sent();
@@ -1,6 +1,6 @@
1
1
  import { Moment } from "moment";
2
2
  import { NextFunction, Response } from "express";
3
- import { ObjectID, ObjectId, Db } from "mongodb";
3
+ import { ObjectId, Db } from "mongodb";
4
4
  import { ResponseStructure, OPT_ERROR } from "../modals/connection.modal";
5
5
  import { Express } from '../modals/log.modal';
6
6
  import { AnyObjectInterface, callBackInterface } from "../modals/utility.modal";
@@ -14,10 +14,10 @@ declare function CheckUserProfileField(pageData: AnyObjectInterface, profileData
14
14
  declare function GetPageFieldData(pageName: string, db: any, mdb: any, msp_d: any, next: NextFunction, callback: callBackInterface): void;
15
15
  declare function GetPageObjectSchema(pageName: string, db: Db, next: NextFunction, callback: callBackInterface): void;
16
16
  declare function GetFieldDetail(objectName: string, fieldName: string, db: any, callback: callBackInterface, next: NextFunction): void;
17
- declare function UpdateRecentViewObject(objectName: string, objectID: ObjectID, userID: ObjectID, db: Db): void;
18
- declare function UpdateRecentViewFields(objectName: string, fieldID: string, userID: ObjectID, db: Db): void;
19
- declare function SyncChildObjectData(pageData: AnyObjectInterface, objectID: ObjectID, db: Db): Promise<void>;
20
- declare function SyncParentObjectData(pageData: AnyObjectInterface, objectID: ObjectID, db: Db): Promise<void>;
17
+ declare function UpdateRecentViewObject(objectName: string, objectID: ObjectId, userID: ObjectId, db: Db): void;
18
+ declare function UpdateRecentViewFields(objectName: string, fieldID: string, userID: ObjectId, db: Db): void;
19
+ declare function SyncChildObjectData(pageData: AnyObjectInterface, objectID: ObjectId, db: Db): Promise<void>;
20
+ declare function SyncParentObjectData(pageData: AnyObjectInterface, objectID: ObjectId, db: Db): Promise<void>;
21
21
  /**
22
22
  * Delete field in other collection after delete records
23
23
  * @param mongodbTransactionQueryopts to maintain session for transactions
@@ -1348,7 +1348,7 @@ function SyncUserInOtherCollection(options, db, callback, next) {
1348
1348
  else if (field.UIDataType == "multilookup") {
1349
1349
  query.match = (_b = {}, _b[field.Name] = { "$nin": [null] }, _b[field.Name + constants_1.default.LookupAlias] = { "$nin": [null] }, _b);
1350
1350
  query.set[field.Name + '.$[e]'] = userData["toUserData"]._id;
1351
- query.set["ModifiedBy"] = new mongodb_1.ObjectID(msp_d.ui);
1351
+ query.set["ModifiedBy"] = new mongodb_1.ObjectId(msp_d.ui);
1352
1352
  query.set["ModifiedDate"] = new Date();
1353
1353
  query.arrayFilters = (_c = {}, _c['e._id'] = userData["fromUserData"]._id, _c);
1354
1354
  if (query.set && query.arrayFilters)
@@ -2050,7 +2050,7 @@ function FilterConditions(condition, match, fields) {
2050
2050
  case "multiselect":
2051
2051
  if (field.Schema.LookupObject) {
2052
2052
  for (var i_7 = 0; i_7 < obj.Value.length; i_7++) {
2053
- obj.Value[i_7] = new mongodb_1.ObjectID(obj.Value[i_7]);
2053
+ obj.Value[i_7] = new mongodb_1.ObjectId(obj.Value[i_7]);
2054
2054
  }
2055
2055
  }
2056
2056
  break;
@@ -2290,7 +2290,7 @@ function AddLog(req, objectName, logAction, objLogProp, db, next) {
2290
2290
  logObj.Action = logAction;
2291
2291
  if (objLogProp.ObjectID)
2292
2292
  if (objLogProp.ObjectID.$oid) {
2293
- logObj.ObjectID = new mongodb_1.ObjectID(objLogProp.ObjectID.$oid);
2293
+ logObj.ObjectID = new mongodb_1.ObjectId(objLogProp.ObjectID.$oid);
2294
2294
  }
2295
2295
  else {
2296
2296
  logObj.ObjectID = objLogProp.ObjectID;
@@ -2384,7 +2384,7 @@ caledar sharing settings : caledar sharing settings
2384
2384
  function GetMyTeamUsers(options, next) {
2385
2385
  var usersList = [];
2386
2386
  var db = options.db;
2387
- db.collection("Company").findOne({ '_id': new mongodb_1.ObjectID(options.CompanyID) }, function (error, result) {
2387
+ db.collection("Company").findOne({ '_id': new mongodb_1.ObjectId(options.CompanyID) }, function (error, result) {
2388
2388
  if (result) {
2389
2389
  var calendarSetting = result.Setting;
2390
2390
  if (calendarSetting.CalendarShare == "private") {
@@ -2420,8 +2420,8 @@ function GetMyTeamUsers(options, next) {
2420
2420
  pendingCalls_1 = pendingCalls_1 - 1;
2421
2421
  db.collection("User").find({
2422
2422
  $or: [
2423
- { '_id': new mongodb_1.ObjectID(options.SupervisorID) },
2424
- { 'SupervisorID': new mongodb_1.ObjectID(options.SupervisorID) }
2423
+ { '_id': new mongodb_1.ObjectId(options.SupervisorID) },
2424
+ { 'SupervisorID': new mongodb_1.ObjectId(options.SupervisorID) }
2425
2425
  ],
2426
2426
  'IsActive': true,
2427
2427
  "MySettings.IsHideFromAllUsers": { $ne: true }
@@ -2466,7 +2466,7 @@ function GetMyTeamUsers(options, next) {
2466
2466
  counter_2 = counter_2 + 1;
2467
2467
  pendingCalls_2 = pendingCalls_2 - 1;
2468
2468
  db.collection("User").find({
2469
- 'SupervisorID': new mongodb_1.ObjectID(options.SupervisorID),
2469
+ 'SupervisorID': new mongodb_1.ObjectId(options.SupervisorID),
2470
2470
  'IsActive': true,
2471
2471
  "MySettings.IsHideFromAllUsers": { $ne: true }
2472
2472
  }, { projection: { _id: 1, FirstName: 1, LastName: 1, UserStatus: 1 } }).toArray(function (error, result) {
@@ -2515,7 +2515,7 @@ function GetMyTeamUsers(options, next) {
2515
2515
  }
2516
2516
  exports.GetMyTeamUsers = GetMyTeamUsers;
2517
2517
  function ExtractChildUsersTree(userId, childUsersArray, usersTraversed, counter, db, onFetch) {
2518
- db.collection("User").find({ 'IsActive': true, 'SupervisorID': new mongodb_1.ObjectID(userId), "MySettings.IsHideFromAllUsers": { $ne: true } }, { projection: { _id: 1, FirstName: 1, LastName: 1, UserStatus: 1 } }).toArray(function (error, result) {
2518
+ db.collection("User").find({ 'IsActive': true, 'SupervisorID': new mongodb_1.ObjectId(userId), "MySettings.IsHideFromAllUsers": { $ne: true } }, { projection: { _id: 1, FirstName: 1, LastName: 1, UserStatus: 1 } }).toArray(function (error, result) {
2519
2519
  if (error) {
2520
2520
  //res.json({ message: err.message, status: 'failed' })
2521
2521
  }
@@ -2582,7 +2582,7 @@ exports.VerifyAWSEmailConfig = VerifyAWSEmailConfig;
2582
2582
  function GenerateId(obj) {
2583
2583
  Object.keys(obj).forEach(function (key) {
2584
2584
  if (key == "_id" && obj[key] == "$id") {
2585
- obj[key] = new mongodb_1.ObjectID();
2585
+ obj[key] = new mongodb_1.ObjectId();
2586
2586
  }
2587
2587
  else if (Array.isArray(obj[key])) {
2588
2588
  for (var i = 0; i < obj[key].length; i++) {
@@ -3938,15 +3938,16 @@ function GetDayIndex(day) {
3938
3938
  }
3939
3939
  exports.GetDayIndex = GetDayIndex;
3940
3940
  function GetUserProfile(msp_d, db, mdb, next) {
3941
+ var _a;
3941
3942
  return __awaiter(this, void 0, void 0, function () {
3942
3943
  var userData, userProfile_1, error_3, objectIDs_1, modules_1, licenceDetail, moduleList, _loop_17, i, error_4;
3943
- return __generator(this, function (_a) {
3944
- switch (_a.label) {
3944
+ return __generator(this, function (_b) {
3945
+ switch (_b.label) {
3945
3946
  case 0:
3946
- _a.trys.push([0, 10, , 11]);
3947
- return [4 /*yield*/, db.collection("User").findOne({ '_id': new mongodb_1.ObjectID(msp_d.ui), IsActive: true }, { projection: { 'LicenceDetail': 1 } })];
3947
+ _b.trys.push([0, 10, , 11]);
3948
+ return [4 /*yield*/, db.collection("User").findOne({ '_id': new mongodb_1.ObjectId(msp_d.ui), IsActive: true }, { projection: { 'LicenceDetail': 1 } })];
3948
3949
  case 1:
3949
- userData = _a.sent();
3950
+ userData = _b.sent();
3950
3951
  if (!userData) {
3951
3952
  return [2 /*return*/, { statusCode: 500, message: "User data not found.", data: {} }];
3952
3953
  }
@@ -3954,11 +3955,11 @@ function GetUserProfile(msp_d, db, mdb, next) {
3954
3955
  return [2 /*return*/, { statusCode: 200, message: "There is no licence assigned to this user, please contact your administrator.", data: {} }];
3955
3956
  }
3956
3957
  userProfile_1 = undefined;
3957
- _a.label = 2;
3958
+ _b.label = 2;
3958
3959
  case 2:
3959
- _a.trys.push([2, 4, , 5]);
3960
+ _b.trys.push([2, 4, , 5]);
3960
3961
  return [4 /*yield*/, db.collection("UserProfile").aggregate([
3961
- { $match: { _id: new mongodb_1.ObjectID(msp_d.upi), IsActive: true } },
3962
+ { $match: { _id: new mongodb_1.ObjectId(msp_d.upi), IsActive: true } },
3962
3963
  {
3963
3964
  $lookup: {
3964
3965
  from: "ModuleMaster",
@@ -3973,10 +3974,10 @@ function GetUserProfile(msp_d, db, mdb, next) {
3973
3974
  { $project: { _id: 1, Name: 1, IsAdmin: 1, UserMenu: 1, Permissions: 1, ModuleList: 1, IsSystemDefine: 1 } },
3974
3975
  ]).toArray()];
3975
3976
  case 3:
3976
- userProfile_1 = _a.sent();
3977
+ userProfile_1 = _b.sent();
3977
3978
  return [3 /*break*/, 5];
3978
3979
  case 4:
3979
- error_3 = _a.sent();
3980
+ error_3 = _b.sent();
3980
3981
  console.log('No Module provided to userprofile');
3981
3982
  return [2 /*return*/, { statusCode: 500, message: "Your profile doesn't have any module access. Please contact your Administrator.", data: {} }];
3982
3983
  case 5:
@@ -3992,7 +3993,7 @@ function GetUserProfile(msp_d, db, mdb, next) {
3992
3993
  modules_1 = [];
3993
3994
  return [4 /*yield*/, mdb.collection("Licences").find({ '_id': { $in: objectIDs_1 }, 'Status': 'active', 'IsActive': true }).toArray()];
3994
3995
  case 7:
3995
- licenceDetail = _a.sent();
3996
+ licenceDetail = _b.sent();
3996
3997
  if (licenceDetail && licenceDetail.length > 0) {
3997
3998
  licenceDetail.forEach(function (licence) {
3998
3999
  modules_1 = modules_1.concat(licence.Modules);
@@ -4004,7 +4005,7 @@ function GetUserProfile(msp_d, db, mdb, next) {
4004
4005
  if (userProfile_1[0].Permissions) {
4005
4006
  _loop_17 = function (i) {
4006
4007
  userProfile_1[0].Permissions[i].ModuleData = moduleList.find(function (x) { return x._id == userProfile_1[0].Permissions[i].ModuleID; });
4007
- if (userProfile_1[0].Permissions[i].Operations.includes("Control Panel")) {
4008
+ if ((_a = userProfile_1[0].Permissions[i].Operations) === null || _a === void 0 ? void 0 : _a.includes("Control Panel")) {
4008
4009
  userProfile_1[0].HasControlPanelAccess.push(userProfile_1[0].Permissions[i].ModuleID);
4009
4010
  }
4010
4011
  };
@@ -4025,7 +4026,7 @@ function GetUserProfile(msp_d, db, mdb, next) {
4025
4026
  case 8: return [2 /*return*/, { statusCode: 200, message: "There is no licence assigned to this user, please contact your administrator.", data: {} }];
4026
4027
  case 9: return [3 /*break*/, 11];
4027
4028
  case 10:
4028
- error_4 = _a.sent();
4029
+ error_4 = _b.sent();
4029
4030
  console.error("Internal Error in GetUserProfile Utility function : " + error_4);
4030
4031
  next(error_4);
4031
4032
  return [3 /*break*/, 11];
@@ -4215,7 +4216,7 @@ function ValidateSanitizeUserInput(inputFields, pageData) {
4215
4216
  if (inputFields.hasOwnProperty(key)) {
4216
4217
  val = inputFields[key];
4217
4218
  //if (val !== null && (typeof val === 'object' || mongodb.ObjectID.isValid(val))) {
4218
- if (val !== null && (typeof val === 'object' || mongodb_1.ObjectID.isValid(val))) {
4219
+ if (val !== null && (typeof val === 'object' || mongodb_1.ObjectId.isValid(val))) {
4219
4220
  inputItem[key] = val;
4220
4221
  }
4221
4222
  else {
@@ -4275,7 +4276,7 @@ function CreateBanquetingVATSettingsData(msp_d, db, sdata, next) {
4275
4276
  switch (_b.label) {
4276
4277
  case 0:
4277
4278
  _b.trys.push([0, 6, , 7]);
4278
- userID = new mongodb_1.ObjectID(msp_d.ui);
4279
+ userID = new mongodb_1.ObjectId(msp_d.ui);
4279
4280
  return [4 /*yield*/, db.collection('ObjectSchema').findOne({ Name: "BanquetingVATSettings" })];
4280
4281
  case 1:
4281
4282
  schemaData = _b.sent();
@@ -4323,7 +4324,7 @@ function CheckReportFolderAccess(report, db, msp_d, folderActiveStatus) {
4323
4324
  switch (_a.label) {
4324
4325
  case 0:
4325
4326
  shareFolderIds = [];
4326
- userID = new mongodb_1.ObjectID(msp_d.ui);
4327
+ userID = new mongodb_1.ObjectId(msp_d.ui);
4327
4328
  FolderList = [];
4328
4329
  return [4 /*yield*/, db.collection('User').findOne({ _id: userID }, { projection: { MySettings: 1 } })];
4329
4330
  case 1:
@@ -569,7 +569,7 @@ var checkForLookupAndListSchema = function (object, key, schema, restoredObject,
569
569
  return __generator(this, function (_a) {
570
570
  switch (_a.label) {
571
571
  case 0:
572
- objectid = mongodb_1.default.ObjectID;
572
+ objectid = mongodb_1.default.ObjectId;
573
573
  if (!(schema.find(function (o) { return o.Name == key && o.LookupFields && o.LookupFields.length > 0; }) && key !== 'Tag')) return [3 /*break*/, 1];
574
574
  objSchema = schema.find(function (o) { return o.Name == key; });
575
575
  schemalookupfieldsDisplayValue_1 = objSchema.LookupFields;
@@ -660,7 +660,7 @@ var checkForLookupAndListSchema = function (object, key, schema, restoredObject,
660
660
  if (!(key == 'CreatedBy' && objectid.isValid(object[key]) || key == 'ModifiedBy' && objectid.isValid(object[key]))) return [3 /*break*/, 11];
661
661
  db = global['dbConnections'][req.DBName];
662
662
  return [4 /*yield*/, db.collection('User').findOne({
663
- _id: new mongodb_1.default.ObjectID(object[key])
663
+ _id: new mongodb_1.default.ObjectId(object[key])
664
664
  })];
665
665
  case 10:
666
666
  UserInfo = _a.sent();
@@ -808,8 +808,8 @@ var mapAttendeToContactAndUser = function (attendee, key, filterdObj, db) {
808
808
  switch (_a.label) {
809
809
  case 0:
810
810
  Users = [];
811
- (attendee.Id) ? Users.push(new mongodb_1.default.ObjectID(attendee.Id)) : '';
812
- (attendee.InvitedBy) ? Users.push(new mongodb_1.default.ObjectID(attendee.InvitedBy)) : '';
811
+ (attendee.Id) ? Users.push(new mongodb_1.default.ObjectId(attendee.Id)) : '';
812
+ (attendee.InvitedBy) ? Users.push(new mongodb_1.default.ObjectId(attendee.InvitedBy)) : '';
813
813
  return [4 /*yield*/, db.collection('ViewAttendee').find({ _id: { $in: Users } }, { projection: { Name: 1 } }).toArray()];
814
814
  case 1:
815
815
  alluserInfo = _a.sent();
@@ -904,7 +904,7 @@ var mapDriveFolderIdToFolderName = function (driveObj, db) {
904
904
  driveObj['FolderName'] = driveObj.FolderId;
905
905
  delete driveObj.FolderId;
906
906
  return [3 /*break*/, 3];
907
- case 1: return [4 /*yield*/, db.collection('Drive').findOne({ _id: new mongodb_1.default.ObjectID(driveObj.FolderId) }, { projection: { FileName: 1, _id: 0 } })];
907
+ case 1: return [4 /*yield*/, db.collection('Drive').findOne({ _id: new mongodb_1.default.ObjectId(driveObj.FolderId) }, { projection: { FileName: 1, _id: 0 } })];
908
908
  case 2:
909
909
  parentFolderName = _a.sent();
910
910
  delete driveObj.FolderId;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optimiser/common",
3
- "version": "1.0.266",
3
+ "version": "1.0.267",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -22,12 +22,12 @@
22
22
  "aws-sdk": "^2.786.0",
23
23
  "axios": "^0.21.1",
24
24
  "bson": "^4.2.0",
25
- "exceljs": "^4.2.1",
25
+ "exceljs": "^4.3.0",
26
26
  "express": "^4.17.1",
27
27
  "express-validator": "^6.9.2",
28
28
  "geoip-lite": "^1.4.2",
29
29
  "ioredis": "^4.17.3",
30
- "libphonenumber-js": "^1.9.23",
30
+ "libphonenumber-js": "^1.9.51",
31
31
  "moment": "^2.25.3",
32
32
  "moment-timezone": "^0.5.27",
33
33
  "mongo-sanitize": "^1.1.0",