@optimiser/common 1.0.342 → 1.0.343
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.d.ts +1 -10
- package/dist/lib/utility.js +13 -43
- package/package.json +1 -1
package/dist/lib/utility.d.ts
CHANGED
|
@@ -263,15 +263,6 @@ declare function InvitationMailReplyContent(fromUser: string, fromEmail: string)
|
|
|
263
263
|
* @return boolean
|
|
264
264
|
*/
|
|
265
265
|
declare function HasFiscalOperator(filter: any): boolean;
|
|
266
|
-
/**
|
|
267
|
-
* TODO: Return bulk object of Update URL data
|
|
268
|
-
*
|
|
269
|
-
* @param eventIds - ObjectId[]
|
|
270
|
-
* @param companyId - string
|
|
271
|
-
* @param secretKey - string
|
|
272
|
-
* @return object[]
|
|
273
|
-
*/
|
|
274
|
-
declare function GetBulkUpdateURLData(eventIds: ObjectId[], companyId: string, secretKey: string): any[];
|
|
275
266
|
/**
|
|
276
267
|
* TODO: Return Encrypted URL
|
|
277
268
|
*
|
|
@@ -281,4 +272,4 @@ declare function GetBulkUpdateURLData(eventIds: ObjectId[], companyId: string, s
|
|
|
281
272
|
* @return object
|
|
282
273
|
*/
|
|
283
274
|
declare function GetEncryptedURL(options: GetEncryptedURLOptions): any[];
|
|
284
|
-
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,
|
|
275
|
+
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 };
|
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.GetEncryptedURL = exports.
|
|
83
|
+
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");
|
|
@@ -5361,34 +5361,6 @@ function HasFiscalOperator(filter) {
|
|
|
5361
5361
|
return false;
|
|
5362
5362
|
}
|
|
5363
5363
|
exports.HasFiscalOperator = HasFiscalOperator;
|
|
5364
|
-
/**
|
|
5365
|
-
* TODO: Return bulk object of Update URL data
|
|
5366
|
-
*
|
|
5367
|
-
* @param eventIds - ObjectId[]
|
|
5368
|
-
* @param companyId - string
|
|
5369
|
-
* @param secretKey - string
|
|
5370
|
-
* @return object[]
|
|
5371
|
-
*/
|
|
5372
|
-
function GetBulkUpdateURLData(eventIds, companyId, secretKey) {
|
|
5373
|
-
var bulkOps = [];
|
|
5374
|
-
eventIds.forEach(function (event) {
|
|
5375
|
-
// Process each value in the array
|
|
5376
|
-
console.log(event);
|
|
5377
|
-
var eventIdStr = event.toString();
|
|
5378
|
-
var url = cryptoService.encrypt(secretKey, companyId + "-" + eventIdStr).cipherText;
|
|
5379
|
-
bulkOps.push({
|
|
5380
|
-
updateOne: {
|
|
5381
|
-
filter: {
|
|
5382
|
-
"_id": event,
|
|
5383
|
-
"StartDate": { $gt: new Date() }
|
|
5384
|
-
},
|
|
5385
|
-
update: { $set: { UniqueURL: url } }
|
|
5386
|
-
}
|
|
5387
|
-
});
|
|
5388
|
-
});
|
|
5389
|
-
return bulkOps;
|
|
5390
|
-
}
|
|
5391
|
-
exports.GetBulkUpdateURLData = GetBulkUpdateURLData;
|
|
5392
5364
|
/**
|
|
5393
5365
|
* TODO: Return Encrypted URL
|
|
5394
5366
|
*
|
|
@@ -5398,28 +5370,26 @@ exports.GetBulkUpdateURLData = GetBulkUpdateURLData;
|
|
|
5398
5370
|
* @return object
|
|
5399
5371
|
*/
|
|
5400
5372
|
function GetEncryptedURL(options) {
|
|
5401
|
-
var recordIds = options.recordIds, companyId = options.companyId, secretKey = options.secretKey, prefixUrl = options.prefixUrl, apiUrl = options.apiUrl
|
|
5402
|
-
var
|
|
5373
|
+
var recordIds = options.recordIds, companyId = options.companyId, secretKey = options.secretKey, prefixUrl = options.prefixUrl, apiUrl = options.apiUrl;
|
|
5374
|
+
var data = {};
|
|
5403
5375
|
recordIds.forEach(function (record) {
|
|
5404
|
-
var _a, _b;
|
|
5405
5376
|
// Process each value in the array
|
|
5406
5377
|
var recordIdStr = record.toString();
|
|
5407
5378
|
var url = cryptoService.encrypt(secretKey, companyId + "-" + recordIdStr).cipherText;
|
|
5408
5379
|
var apiEncryptedURL = "" + prefixUrl + apiUrl + url;
|
|
5409
|
-
|
|
5410
|
-
bulkOps.push({
|
|
5411
|
-
updateMany: {
|
|
5412
|
-
filter: (_a = {},
|
|
5413
|
-
_a[fieldName] = { $exists: false },
|
|
5414
|
-
_a[filterKey] = record,
|
|
5415
|
-
_a),
|
|
5416
|
-
update: { $set: (_b = {}, _b[fieldName] = apiEncryptedURL, _b[qrFieldWithAlias] = false, _b) }
|
|
5417
|
-
}
|
|
5418
|
-
});
|
|
5380
|
+
data[recordIdStr] = apiEncryptedURL;
|
|
5419
5381
|
});
|
|
5420
|
-
return
|
|
5382
|
+
return data;
|
|
5421
5383
|
}
|
|
5422
5384
|
exports.GetEncryptedURL = GetEncryptedURL;
|
|
5385
|
+
/**
|
|
5386
|
+
* TODO: Build QRField/PENDING field true
|
|
5387
|
+
*
|
|
5388
|
+
* @param fieldSchema - AnyObjectInterface field related schema information
|
|
5389
|
+
* @param updateObj - object contains data
|
|
5390
|
+
* @param db - object db connecttion
|
|
5391
|
+
* @return object
|
|
5392
|
+
*/
|
|
5423
5393
|
function BuildQRDataField(fieldSchema, updateObj, db) {
|
|
5424
5394
|
if (constants_1.default.QrPendingFields === fieldSchema.UIDataType) {
|
|
5425
5395
|
var fldValue = null;
|