@optimiser/common 1.0.349 → 1.0.351
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/helper.js +5 -7
- package/dist/lib/utility.d.ts +9 -1
- package/dist/lib/utility.js +57 -1
- package/package.json +1 -1
package/dist/lib/helper.js
CHANGED
|
@@ -106,13 +106,11 @@ function GetEmailwiseUnsubscribeData(db, mailID, domainID) {
|
|
|
106
106
|
}
|
|
107
107
|
var _loop_1 = function (i) {
|
|
108
108
|
compaignObj = listSchema_1[i];
|
|
109
|
-
if (
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
obj.push({ 'Key': compaignObj.Key, 'Value': compaignObj.Value, 'DomainID': compaignObj.DomainID, 'checked': false });
|
|
115
|
-
}
|
|
109
|
+
if (lstData != null && lstData.CampaignUnsubsCategory && lstData.CampaignUnsubsCategory.length > 0 && lstData.CampaignUnsubsCategory.filter(function (p) { return p == listSchema_1[i].Key; }).length > 0) {
|
|
110
|
+
obj.push({ 'Key': compaignObj.Key, 'Value': compaignObj.Value, 'DomainID': compaignObj.DomainID, 'checked': true, 'HideForUser': compaignObj.HideForUser });
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
obj.push({ 'Key': compaignObj.Key, 'Value': compaignObj.Value, 'DomainID': compaignObj.DomainID, 'checked': false, 'HideForUser': compaignObj.HideForUser });
|
|
116
114
|
}
|
|
117
115
|
};
|
|
118
116
|
var compaignObj;
|
package/dist/lib/utility.d.ts
CHANGED
|
@@ -281,4 +281,12 @@ declare function GenerateBase64QRCodeData(data: string, options?: any): Promise<
|
|
|
281
281
|
* @return array of all sharing of child file folders
|
|
282
282
|
*/
|
|
283
283
|
declare function GetFileFolderDetailsInFolderForDriveSharing(parentFolderID: any, db: Db): Promise<any>;
|
|
284
|
-
|
|
284
|
+
/**
|
|
285
|
+
* TODO: Sync total slots remainig in Event Registration
|
|
286
|
+
*
|
|
287
|
+
* @param1 registration id || ObjectId
|
|
288
|
+
* @param2 database connection || Db
|
|
289
|
+
* @return NA
|
|
290
|
+
*/
|
|
291
|
+
declare function SyncTotalSlotRemaining(registrationID: any, db: Db): Promise<void>;
|
|
292
|
+
export { CheckForWhiteListedDomain, ReturnJsonResponse, ConvertFileByteSize, GetObjectByKeyValueFromList, IsEqualArrays, IsEqualValue, CheckUserProfileField, GetPageFieldData, GetPageObjectSchema, GetFieldDetail, UpdateRecentViewObject, UpdateRecentViewFields, SyncChildObjectData, SyncParentObjectData, DeleteFieldInOtherCollection, SyncFieldInSameCollection, SyncFieldInSameCollectionByObjectID, SyncFieldInSameCollectionByObjectIDWithPromise, SyncFieldInOtherCollection, SyncUserInOtherCollection, GetObjectByString, BuildLookupDataField, CheckDataBeforeAdd, CheckDataBeforeUpdate, BuildGridFieldProjection, BuildFieldProjection, BuildLookupFieldProjection, FilterConditions, GirdHeaderFilters, FieldsGridHeaderFilters, AddLog, CheckFilterFieldsProjection, VerifyEmailPassword, GetMyTeamUsers, ExtractChildUsersTree, GetMaxKeyValueListSchema, VerifyAWSEmailConfig, GenerateId, SyncUserDetailsWithMasterDB, SignoutUserFromAllDevices, SignoutUsersWithPromise, SignoutMultipleUsersFromAllDevices, UserLicenseConsumeCalculate, sendMailWithUserAccount, GetEmailClientConfigs, GetCompanyEncryptionKey, ExecuteDynamicDMLQuery, ExecuteDynamicDQLQuery, GetUserProfilePermissions, MakeUserPasswordInvalid, ConvertJsonToXLXS, SendResetPasswordMail, SendMailToSupport, MailTemplateStructure, SendMailToCustomer, parseMSPCookie, GetIPDetailsFromReq, isEmptyObj, SyncListSchemaFieldInOtherCollection, UpdateTagCountAfterDelete, SyncTagCountAfterUpdate, ReactivateFieldInOtherCollection, SyncUserLicenceConsumedCount, BroadCastEventToAllCompanyUsers, CheckDataPermission, SyncCompanyLicenceInMasterCompanyAfterAdd, NextServiceDateForDashboard, CheckDateNotInPast, GetWeekDayByDayAndOccurance, GetInterValFromOccurance, GetWeekDayInfoInMonth, GetDayIndex, RemoveFieldsFromFilters, GetUserProfile, CheckPageAuthentication, ErrorHandlerForServices, CheckCaptcha, IsStringValue, ValidateSanitizeUserInput, ValidateUserInput, CheckConditionalField, CheckExpressionOnDateField, AddDaysToDate, CreateBanquetingVATSettingsData, CheckReportFolderAccess, GetMailFromString, InvitationMailReplyContent, HasFiscalOperator, GetEncryptedURL, GenerateBase64QRCodeData, GetFileFolderDetailsInFolderForDriveSharing, SyncTotalSlotRemaining };
|
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.GetFileFolderDetailsInFolderForDriveSharing = exports.GenerateBase64QRCodeData = exports.GetEncryptedURL = exports.HasFiscalOperator = exports.InvitationMailReplyContent = exports.GetMailFromString = exports.CheckReportFolderAccess = exports.CreateBanquetingVATSettingsData = exports.AddDaysToDate = exports.CheckExpressionOnDateField = exports.CheckConditionalField = exports.ValidateUserInput = exports.ValidateSanitizeUserInput = exports.IsStringValue = 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.GetObjectByString = 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;
|
|
83
|
+
exports.SyncTotalSlotRemaining = exports.GetFileFolderDetailsInFolderForDriveSharing = exports.GenerateBase64QRCodeData = exports.GetEncryptedURL = exports.HasFiscalOperator = exports.InvitationMailReplyContent = exports.GetMailFromString = exports.CheckReportFolderAccess = exports.CreateBanquetingVATSettingsData = exports.AddDaysToDate = exports.CheckExpressionOnDateField = exports.CheckConditionalField = exports.ValidateUserInput = exports.ValidateSanitizeUserInput = exports.IsStringValue = 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.GetObjectByString = 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");
|
|
@@ -5512,3 +5512,59 @@ function GetFileFolderDetailsInFolderForDriveSharing(parentFolderID, db) {
|
|
|
5512
5512
|
});
|
|
5513
5513
|
}
|
|
5514
5514
|
exports.GetFileFolderDetailsInFolderForDriveSharing = GetFileFolderDetailsInFolderForDriveSharing;
|
|
5515
|
+
/**
|
|
5516
|
+
* TODO: Sync total slots remainig in Event Registration
|
|
5517
|
+
*
|
|
5518
|
+
* @param1 registration id || ObjectId
|
|
5519
|
+
* @param2 database connection || Db
|
|
5520
|
+
* @return NA
|
|
5521
|
+
*/
|
|
5522
|
+
function SyncTotalSlotRemaining(registrationID, db) {
|
|
5523
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5524
|
+
var registrationData, totalDelegates, maximumRegistration, eventSchema, regDelegates_1, includeGuestInRegCount, registeredDelegates, remainingSlots;
|
|
5525
|
+
return __generator(this, function (_a) {
|
|
5526
|
+
switch (_a.label) {
|
|
5527
|
+
case 0:
|
|
5528
|
+
if (!registrationID) return [3 /*break*/, 7];
|
|
5529
|
+
return [4 /*yield*/, db.collection('EventRegistration').findOne({ '_id': registrationID, 'IsActive': true })];
|
|
5530
|
+
case 1:
|
|
5531
|
+
registrationData = _a.sent();
|
|
5532
|
+
if (!registrationData) return [3 /*break*/, 7];
|
|
5533
|
+
totalDelegates = 0;
|
|
5534
|
+
maximumRegistration = registrationData.MaximumRegistration;
|
|
5535
|
+
if (!(maximumRegistration == undefined)) return [3 /*break*/, 3];
|
|
5536
|
+
return [4 /*yield*/, db.collection('EventRegistration').updateOne({ '_id': registrationID, 'IsActive': true }, { $set: { 'TotalSlotRemaining': null } })];
|
|
5537
|
+
case 2:
|
|
5538
|
+
_a.sent();
|
|
5539
|
+
return [3 /*break*/, 7];
|
|
5540
|
+
case 3: return [4 /*yield*/, db.collection('ObjectSchema').findOne({ Name: "EventRegistration" })];
|
|
5541
|
+
case 4:
|
|
5542
|
+
eventSchema = _a.sent();
|
|
5543
|
+
regDelegates_1 = (eventSchema === null || eventSchema === void 0 ? void 0 : eventSchema.RegisteredDelegates) || [];
|
|
5544
|
+
includeGuestInRegCount = registrationData.IncludeGuestInRegCount;
|
|
5545
|
+
return [4 /*yield*/, db.collection('EventDelegate').find({ 'EventID': registrationData.EventID, 'RegistrationType': registrationID, 'IsActive': true }).toArray()];
|
|
5546
|
+
case 5:
|
|
5547
|
+
registeredDelegates = _a.sent();
|
|
5548
|
+
// let registeredDelegates = delegatesAllData.filter(x => x.RegistrationType == registrationID.toString() && x._id !== delegateID);
|
|
5549
|
+
if (registeredDelegates) {
|
|
5550
|
+
if (includeGuestInRegCount) {
|
|
5551
|
+
totalDelegates = registeredDelegates.filter(function (x) { return regDelegates_1.includes(x.status); }).length;
|
|
5552
|
+
}
|
|
5553
|
+
else {
|
|
5554
|
+
totalDelegates = registeredDelegates.filter(function (x) { return x.IsGuest != true && regDelegates_1.includes(x.status); }).length;
|
|
5555
|
+
}
|
|
5556
|
+
}
|
|
5557
|
+
remainingSlots = maximumRegistration - totalDelegates;
|
|
5558
|
+
if (remainingSlots < 0 || isNaN(remainingSlots)) {
|
|
5559
|
+
remainingSlots = 0;
|
|
5560
|
+
}
|
|
5561
|
+
return [4 /*yield*/, db.collection('EventRegistration').updateOne({ '_id': registrationID, 'IsActive': true }, { $set: { 'TotalSlotRemaining': remainingSlots } })];
|
|
5562
|
+
case 6:
|
|
5563
|
+
_a.sent();
|
|
5564
|
+
_a.label = 7;
|
|
5565
|
+
case 7: return [2 /*return*/];
|
|
5566
|
+
}
|
|
5567
|
+
});
|
|
5568
|
+
});
|
|
5569
|
+
}
|
|
5570
|
+
exports.SyncTotalSlotRemaining = SyncTotalSlotRemaining;
|