@optimiser/common 1.0.390 → 1.0.392

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.
@@ -88,7 +88,14 @@ declare function MakeUserPasswordInvalid(options: AnyObjectInterface): void;
88
88
  declare function ConvertJsonToXLXS(data: AnyObjectInterface, params: AnyObjectInterface | undefined, filePath: string): Promise<void>;
89
89
  declare function SendResetPasswordMail(db: Db, userDetails: AnyObjectInterface, type?: string): Promise<unknown>;
90
90
  declare function SendMailToSupport(mailData: AnyObjectInterface, callback: callBackInterface): void;
91
- declare function MailTemplateStructure(content: string, HasDontReplyContent?: boolean, isActivityTemplate?: boolean): void;
91
+ /**
92
+ * Common Mail Template Structure
93
+ * @param {string} content It is html body content sent over mail
94
+ * @param {boolean} hasDontReplyContent boolean flag to conditionally append static footer do not reply content
95
+ * @param {boolean} isActivityTemplate boolean flag to conditionally use activity mail template instead of common mail template
96
+ * @reply {string} wraps the complete content structure
97
+ */
98
+ declare function MailTemplateStructure(content: string, hasDontReplyContent?: boolean, isActivityTemplate?: boolean): string;
92
99
  declare function SendMailToCustomer(mailData: AnyObjectInterface, callback: callBackInterface): void;
93
100
  declare function parseMSPCookie(cookie: AnyObjectInterface): any;
94
101
  declare function isEmptyObj(object: AnyObjectInterface): boolean;
@@ -3455,13 +3455,20 @@ function SendMailToSupport(mailData, callback) {
3455
3455
  });
3456
3456
  }
3457
3457
  exports.SendMailToSupport = SendMailToSupport;
3458
- function MailTemplateStructure(content, HasDontReplyContent, isActivityTemplate) {
3458
+ /**
3459
+ * Common Mail Template Structure
3460
+ * @param {string} content It is html body content sent over mail
3461
+ * @param {boolean} hasDontReplyContent boolean flag to conditionally append static footer do not reply content
3462
+ * @param {boolean} isActivityTemplate boolean flag to conditionally use activity mail template instead of common mail template
3463
+ * @reply {string} wraps the complete content structure
3464
+ */
3465
+ function MailTemplateStructure(content, hasDontReplyContent, isActivityTemplate) {
3459
3466
  if (isActivityTemplate === void 0) { isActivityTemplate = false; }
3460
3467
  if (isActivityTemplate) {
3461
- ACTIVITY_MAIL_TEMPLATE(content);
3468
+ return ACTIVITY_MAIL_TEMPLATE(content);
3462
3469
  }
3463
3470
  else {
3464
- COMMON_MAIL_TEMPLATE(content, HasDontReplyContent);
3471
+ return COMMON_MAIL_TEMPLATE(content, hasDontReplyContent);
3465
3472
  }
3466
3473
  /* `<body style='background-color: #eee;'>
3467
3474
  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="background:#eee;">
@@ -4852,11 +4859,11 @@ function ValidateUserInput(options) {
4852
4859
  return [4 /*yield*/, db.collection(objectName).findOne({ '_id': documentID })];
4853
4860
  case 2:
4854
4861
  parentData = _k.sent();
4855
- oldValue = parentData[fieldName] || null;
4862
+ oldValue = parentData[fieldName] != undefined ? parentData[fieldName] : null;
4856
4863
  newValue = fieldData;
4857
4864
  // Check if newValue is undefined
4858
4865
  if (newValue === undefined) {
4859
- return [2 /*return*/, "break"];
4866
+ return [2 /*return*/, "continue"];
4860
4867
  }
4861
4868
  isSame = false;
4862
4869
  if (field.UIDataType == 'multiselect' || field.UIDataType == 'multilookup') {
@@ -5744,9 +5751,20 @@ function ValidateStateCountryField(_a) {
5744
5751
  });
5745
5752
  });
5746
5753
  }
5754
+ /**
5755
+ * Activity Mail Template Structure
5756
+ * @param {string} content It is html body content sent over mail
5757
+ * @reply {string} wraps the complete content structure
5758
+ */
5747
5759
  var ACTIVITY_MAIL_TEMPLATE = function (content) {
5748
5760
  return "<html xmlns:v=\"urn:schemas-microsoft-com:vml\">\n <head>\n <style> v:* { behavior: url(#default#VML); }</style >\n </head>\n <body style='background-color: #fff;'>\n <table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\n <!-- <table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" style=\"background:#fff;\"> -->\n <tr>\n <td align=\"center\" valign=\"top\">\n <table width=\"650\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" style=\"background:#fff;\">\n <tr>\n <td align=\"center\" valign=\"top\" bgcolor=\"#fff\" style=\"background-color: #fff; text-align: left; padding-right: 0px; padding-left: 0px; font-size:16px; font-family:Arial, Helvetica, sans-serif; color:#000000;\">\n ".concat(content, "\n <p style=\"margin-bottom: 1em;\">\n Thanks,<br>\n ").concat(constants_1.default.ProjectName, " team\n </p>\n </td>\n </tr> \n </table>\n <tr>\n <td>\n <tr>\n <td style=\"text-align: center;\">\n <table style=\"margin: 0 auto;\">\n <tr>\n <td style=\"padding: 3px; font-size:13px; font-family:Arial, Helvetica, sans-serif;\">Powered By</td>\n <td style=\"padding: 3px;\"><a target=\"_blank\" href=\"https://www.optimiser.com\"><img src=\"https://platform.optimiser.com/images/MainLogo.png\" style=\"height: 45px;\"></a></td>\n </tr>\n </table>\n </td>\n </tr>\n </td>\n </tr>\n </td>\n </tr>\n </table>\n </body>");
5749
5761
  };
5750
- var COMMON_MAIL_TEMPLATE = function (content, HasDontReplyContent) {
5751
- return "<html xmlns:v=\"urn:schemas-microsoft-com:vml\">\n <head>\n <style> v:* { behavior: url(#default#VML); }</style >\n </head>\n <body style='background-color: #fff;'>\n <table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\n <!-- <table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" style=\"background:#fff;\"> -->\n <tr>\n <td align=\"center\" valign=\"top\">\n <table width=\"650\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" style=\"background:#fff;\">\n <tr>\n <td align=\"left\" valign=\"top\" bgcolor=\"#ffffff\" style=\"padding-top:16px; padding-bottom:12px; padding-left: 20px; padding-right: 20px; background-color: #fff; border-bottom: 1px solid #fff;\">\n <img src=\"https://platform.optimiser.com/images/MainLogo.png\" alt=\"Optimiser\"/>\n </td>\n </tr>\n <tr>\n <td align=\"center\" valign=\"top\" bgcolor=\"#fff\" style=\"background-color: #fff; text-align: left; padding-right: 0px; padding-left: 0px; font-size:16px; font-family:Arial, Helvetica, sans-serif; color:#000000;\">\n ".concat(content, "\n <p style=\"margin-bottom: 1em;\">\n Thanks,<br>\n ").concat(constants_1.default.ProjectName, " team\n </p>\n </td>\n </tr>\n <tr>\n <td align=\"center\" valign=\"top\" bgcolor=\"##075DA8\" style=\" border-top: 1px solid #dee2e6; background-color: #075DA8;\">\n <p style=\"font-size:13px; font-family:Arial, Helvetica, sans-serif; color:#fff; margin:1.8em; font-weight:normal;\">\n <a href=\"https://www.optimiser.com/\" style=\"color:#fff; text-decoration:underline; \">www.optimiser.com</a> | <a href=\"mailto:support@optimiser.com\" style=\"color:#fff; text-decoration:underline; \">support@optimiser.com</a> | \n +44 (0)203 972 1666\n </p>\n </td>\n </tr>\n ").concat(HasDontReplyContent ? "<tr>\n <td align=\"center\" valign=\"top\" bgcolor=\"#fff\" style=\"margin-top: 1em;background-color: #fff; text-align: left; padding-right: 0px; padding-left: 0px; font-size:13px; font-family:Arial, Helvetica, sans-serif; color:#000000;\">\n <p style=\"margin-top: 1em;\">\n ##DonotReplyContent##\n </p>\n </td>\n </tr>" : '', " \n </table>\n </td>\n </tr>\n </table>\n </body>");
5762
+ /**
5763
+ * Common Mail Template Structure
5764
+ * @param {string} content It is html body content sent over mail
5765
+ * @param {boolean} hasDontReplyContent boolean flag to conditionally append static footer do not reply content
5766
+ * @reply {string} wraps the complete content structure
5767
+ */
5768
+ var COMMON_MAIL_TEMPLATE = function (content, hasDontReplyContent) {
5769
+ return "<html xmlns:v=\"urn:schemas-microsoft-com:vml\">\n <head>\n <style> v:* { behavior: url(#default#VML); }</style >\n </head>\n <body style='background-color: #fff;'>\n <table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\n <!-- <table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" style=\"background:#fff;\"> -->\n <tr>\n <td align=\"center\" valign=\"top\">\n <table width=\"650\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" style=\"background:#fff;\">\n <tr>\n <td align=\"left\" valign=\"top\" bgcolor=\"#ffffff\" style=\"padding-top:16px; padding-bottom:12px; padding-left: 20px; padding-right: 20px; background-color: #fff; border-bottom: 1px solid #fff;\">\n <img src=\"https://platform.optimiser.com/images/MainLogo.png\" alt=\"Optimiser\"/>\n </td>\n </tr>\n <tr>\n <td align=\"center\" valign=\"top\" bgcolor=\"#fff\" style=\"background-color: #fff; text-align: left; padding-right: 0px; padding-left: 0px; font-size:16px; font-family:Arial, Helvetica, sans-serif; color:#000000;\">\n ".concat(content, "\n <p style=\"margin-bottom: 1em;\">\n Thanks,<br>\n ").concat(constants_1.default.ProjectName, " team\n </p>\n </td>\n </tr>\n <tr>\n <td align=\"center\" valign=\"top\" bgcolor=\"##075DA8\" style=\" border-top: 1px solid #dee2e6; background-color: #075DA8;\">\n <p style=\"font-size:13px; font-family:Arial, Helvetica, sans-serif; color:#fff; margin:1.8em; font-weight:normal;\">\n <a href=\"https://www.optimiser.com/\" style=\"color:#fff; text-decoration:underline; \">www.optimiser.com</a> | <a href=\"mailto:support@optimiser.com\" style=\"color:#fff; text-decoration:underline; \">support@optimiser.com</a> | \n +44 (0)203 972 1666\n </p>\n </td>\n </tr>\n ").concat(hasDontReplyContent === true ? "<tr>\n <td align=\"center\" valign=\"top\" bgcolor=\"#fff\" style=\"margin-top: 1em;background-color: #fff; text-align: left; padding-right: 0px; padding-left: 0px; font-size:13px; font-family:Arial, Helvetica, sans-serif; color:#000000;\">\n <p style=\"margin-top: 1em;\">\n ##DonotReplyContent##\n </p>\n </td>\n </tr>" : '', " \n </table>\n </td>\n </tr>\n </table>\n </body>");
5752
5770
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optimiser/common",
3
- "version": "1.0.390",
3
+ "version": "1.0.392",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {