@measurequick/measurequick-report-generator 1.5.191 → 1.5.192

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measurequick/measurequick-report-generator",
3
- "version": "1.5.191",
3
+ "version": "1.5.192",
4
4
  "description": "Generates PDF documents for various measureQuick applications.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -39,7 +39,7 @@ export async function getReport(payload, options = {}) {
39
39
  let companyImage = null;
40
40
  let companyImageType = null;
41
41
  try {
42
- companyImageType = util.checkCompanyLogo?.(payload.meta);
42
+ companyImageType = util.checkCompanyLogo ? util.checkCompanyLogo(payload.meta) : null;
43
43
  } catch (e) {}
44
44
  if (companyImageType === "jpg") {
45
45
  companyImage = await pdfDoc.embedJpg(
@@ -55,7 +55,7 @@ export async function getReport(payload, options = {}) {
55
55
  let profileImage = null;
56
56
  let profileImageType = null;
57
57
  try {
58
- profileImageType = util.checkProfilePicture?.(payload.meta);
58
+ profileImageType = util.checkProfilePicture ? util.checkProfilePicture(payload.meta) : null;
59
59
  } catch (e) {}
60
60
  if (profileImageType) {
61
61
  let profilePicBase64;
@@ -89,7 +89,7 @@ export async function getReport(payload, options = {}) {
89
89
  }
90
90
 
91
91
  // Set tech name
92
- if (payload.meta.profile_settings?.techFirstName || payload.meta.profile_settings?.techLastName) {
92
+ if ((payload.meta.profile_settings && payload.meta.profile_settings.techFirstName) || (payload.meta.profile_settings && payload.meta.profile_settings.techLastName)) {
93
93
  const techName = `${payload.meta.profile_settings.techFirstName || ""} ${payload.meta.profile_settings.techLastName || ""}`.trim();
94
94
  form.getTextField("TechName").setText(techName);
95
95
  }
@@ -102,8 +102,8 @@ export async function getReport(payload, options = {}) {
102
102
  }
103
103
 
104
104
  // Get AI summary and notes from payload or options
105
- const aiSummary = options.aiSummary || util.getAiSummary?.(payload) || "";
106
- const notes = options.notes || util.getAiNotes?.(payload) || "";
105
+ const aiSummary = options.aiSummary || (util.getAiSummary ? util.getAiSummary(payload) : "") || "";
106
+ const notes = options.notes || (util.getAiNotes ? util.getAiNotes(payload) : "") || "";
107
107
 
108
108
  // Combine content
109
109
  let fullContent = "";
@@ -260,8 +260,8 @@ function wrapText(text, font, fontSize, maxWidth) {
260
260
  * @param {Object} payload - The report payload
261
261
  */
262
262
  export async function addNotesSummaryPages(pdfDoc, payload) {
263
- const aiSummary = util.getAiSummary?.(payload) || "";
264
- const notes = util.getAiNotes?.(payload) || "";
263
+ const aiSummary = (util.getAiSummary ? util.getAiSummary(payload) : "") || "";
264
+ const notes = (util.getAiNotes ? util.getAiNotes(payload) : "") || "";
265
265
 
266
266
  if (!aiSummary && !notes) return;
267
267