@threatcaptain/tc-reports 0.2.6 → 0.2.8

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/index.cjs CHANGED
@@ -28751,16 +28751,16 @@ const Dashboard = () => {
28751
28751
  };
28752
28752
  const BreachLikelihood = ({ reportData }) => {
28753
28753
  var _a;
28754
- const { clientData, assessmentData, user } = reportData;
28754
+ const { clientData, securityAssessment, mspInfo } = reportData;
28755
28755
  const calculateBreachLikelihood = (protectionLevel) => {
28756
- if ((assessmentData == null ? void 0 : assessmentData.overall_breach_likelihood) !== null && (assessmentData == null ? void 0 : assessmentData.overall_breach_likelihood) !== void 0) {
28757
- return Math.round(assessmentData.overall_breach_likelihood);
28756
+ if ((securityAssessment == null ? void 0 : securityAssessment.overall_breach_likelihood) !== null && (securityAssessment == null ? void 0 : securityAssessment.overall_breach_likelihood) !== void 0) {
28757
+ return Math.round(securityAssessment.overall_breach_likelihood);
28758
28758
  }
28759
28759
  return Math.max(5, 100 - protectionLevel);
28760
28760
  };
28761
28761
  const calculateProtectionLevel = () => {
28762
- if (assessmentData == null ? void 0 : assessmentData.findings) {
28763
- const findings = assessmentData.findings;
28762
+ if (securityAssessment == null ? void 0 : securityAssessment.findings) {
28763
+ const findings = securityAssessment.findings;
28764
28764
  const totalControls = 18;
28765
28765
  let implementedControls = 0;
28766
28766
  for (let i = 1; i <= totalControls; i++) {
@@ -28959,7 +28959,7 @@ const BreachLikelihood = ({ reportData }) => {
28959
28959
  ] }),
28960
28960
  (() => {
28961
28961
  var _a2;
28962
- const controlMappings = ((_a2 = clientData.assessmentData) == null ? void 0 : _a2.control_mappings) || [];
28962
+ const controlMappings = ((_a2 = clientData.securityAssessment) == null ? void 0 : _a2.control_mappings) || [];
28963
28963
  const implementedControls = Array.isArray(controlMappings) ? controlMappings.filter((c2) => c2.implemented === true) : [];
28964
28964
  const potentialControls = Array.isArray(controlMappings) ? controlMappings.filter((c2) => c2.implemented !== true) : [];
28965
28965
  const renderControlRow = (control) => {
@@ -29146,7 +29146,7 @@ const BreachLikelihood = ({ reportData }) => {
29146
29146
  /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-semibold text-slate-900 mb-4", children: "Control Implementation Impact" }),
29147
29147
  (() => {
29148
29148
  var _a2;
29149
- const controlMappings = ((_a2 = clientData.assessmentData) == null ? void 0 : _a2.control_mappings) || [];
29149
+ const controlMappings = ((_a2 = clientData.securityAssessment) == null ? void 0 : _a2.control_mappings) || [];
29150
29150
  const implementedControls = Array.isArray(controlMappings) ? controlMappings.filter(
29151
29151
  (control) => control.implemented === true
29152
29152
  ) : [];
@@ -29282,7 +29282,14 @@ const BreachLikelihood = ({ reportData }) => {
29282
29282
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-lg mb-4", children: [
29283
29283
  /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Contact:" }),
29284
29284
  " ",
29285
- (user == null ? void 0 : user.email) || "contact@company.com"
29285
+ (mspInfo == null ? void 0 : mspInfo.contact_email) ? /* @__PURE__ */ jsxRuntime.jsx(
29286
+ "a",
29287
+ {
29288
+ href: `mailto:${mspInfo == null ? void 0 : mspInfo.contact_email}`,
29289
+ className: "underline",
29290
+ children: mspInfo == null ? void 0 : mspInfo.contact_email
29291
+ }
29292
+ ) : "contact@company.com"
29286
29293
  ] }),
29287
29294
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm opacity-80", children: "Every day you wait is another day criminals could strike. Every protection you add makes your business safer." })
29288
29295
  ] })
@@ -29611,7 +29618,7 @@ const UnifiedCostBreakdownChart = ({
29611
29618
  };
29612
29619
  const FinancialImpact = ({ reportData }) => {
29613
29620
  var _a;
29614
- const { clientData, simulationData, user } = reportData;
29621
+ const { clientData, simulationData, mspInfo } = reportData;
29615
29622
  const { industry } = clientData;
29616
29623
  const displayExecutiveSummary = () => {
29617
29624
  if (clientData.executiveSummary) return clientData.executiveSummary;
@@ -30034,7 +30041,7 @@ const FinancialImpact = ({ reportData }) => {
30034
30041
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-slate-600 mb-4", children: "Let's discuss these findings and develop a customized cybersecurity roadmap for your organization." }),
30035
30042
  /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-slate-600", children: [
30036
30043
  "Contact us at: ",
30037
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-slate-900", children: (user == null ? void 0 : user.email) || /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "red", fontWeight: "bold" }, children: "NEEDS MSP EMAIL ADDRESS" }) })
30044
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-slate-900", children: (mspInfo == null ? void 0 : mspInfo.contact_email) ? /* @__PURE__ */ jsxRuntime.jsx("a", { href: `mailto:${mspInfo == null ? void 0 : mspInfo.contact_email}`, className: "underline", children: mspInfo == null ? void 0 : mspInfo.contact_email }) : "contact@company.com" })
30038
30045
  ] })
30039
30046
  ] })
30040
30047
  ] }),
@@ -30729,10 +30736,8 @@ const ReportBuilder = ({
30729
30736
  clientData,
30730
30737
  assessmentData,
30731
30738
  simulationData,
30732
- mspCompanyName,
30733
- user
30739
+ mspInfo
30734
30740
  }) => {
30735
- var _a;
30736
30741
  const [searchParams] = reactRouterDom.useSearchParams();
30737
30742
  const reportTemplate = searchParams.get("template");
30738
30743
  const templateArray = (reportTemplate == null ? void 0 : reportTemplate.split(",").map((item) => item.trim())) || [];
@@ -30741,8 +30746,9 @@ const ReportBuilder = ({
30741
30746
  const showInsuranceHealthScore = templateArray.includes(
30742
30747
  "insurance-health-score"
30743
30748
  );
30744
- const insuranceHealthData = (_a = assessmentData[0]) == null ? void 0 : _a.insurance_health;
30745
- const financialSimulationData = simulationData.storedSimulation;
30749
+ const securityAssessment = assessmentData.securityAssessments;
30750
+ const insuranceHealthData = assessmentData.insuranceAssessment;
30751
+ const financialSimulationData = simulationData;
30746
30752
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
30747
30753
  !clientData.id && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-w-4xl mx-auto bg-white p-8 flex items-center justify-center min-h-[600px]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center space-y-4", children: [
30748
30754
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-16 h-16 bg-slate-100 rounded-full flex items-center justify-center mx-auto", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "w-8 h-8 text-slate-400" }) }),
@@ -30767,10 +30773,10 @@ const ReportBuilder = ({
30767
30773
  id: "print-report",
30768
30774
  className: "report-wrapper max-w-4xl mx-auto bg-white p-8 space-y-8",
30769
30775
  children: [
30770
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mx-auto w-20 h-20 bg-slate-200 rounded-lg flex items-center justify-center", children: clientData.logo ? /* @__PURE__ */ jsxRuntime.jsx(
30776
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mx-auto w-20 h-20 bg-slate-200 rounded-lg flex items-center justify-center", children: mspInfo.company_logo ? /* @__PURE__ */ jsxRuntime.jsx(
30771
30777
  "img",
30772
30778
  {
30773
- src: clientData.logo,
30779
+ src: mspInfo.company_logo,
30774
30780
  alt: "MSP Logo",
30775
30781
  className: "w-full h-full object-contain rounded-lg"
30776
30782
  }
@@ -30786,7 +30792,7 @@ const ReportBuilder = ({
30786
30792
  ] }),
30787
30793
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between", children: [
30788
30794
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-slate-700", children: "Prepared By:" }),
30789
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-slate-900", children: mspCompanyName || /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "red", fontWeight: "bold" }, children: "NEEDS ACTUAL MSP NAME" }) })
30795
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-slate-900", children: mspInfo.company_name || /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "red", fontWeight: "bold" }, children: "NEEDS ACTUAL MSP NAME" }) })
30790
30796
  ] }),
30791
30797
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between", children: [
30792
30798
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-slate-700", children: "Assessment Date:" }),
@@ -30799,15 +30805,20 @@ const ReportBuilder = ({
30799
30805
  reportData: {
30800
30806
  clientData,
30801
30807
  simulationData: financialSimulationData,
30802
- user
30808
+ mspInfo
30803
30809
  }
30804
30810
  }
30805
30811
  ),
30806
- showBreachLikelihood && /* @__PURE__ */ jsxRuntime.jsx(BreachLikelihood, { reportData: { clientData, assessmentData, user } }),
30812
+ showBreachLikelihood && /* @__PURE__ */ jsxRuntime.jsx(
30813
+ BreachLikelihood,
30814
+ {
30815
+ reportData: { clientData, securityAssessment, mspInfo }
30816
+ }
30817
+ ),
30807
30818
  showInsuranceHealthScore && /* @__PURE__ */ jsxRuntime.jsx(
30808
30819
  InsuranceHealthScore,
30809
30820
  {
30810
- reportData: { clientData, insuranceHealthData }
30821
+ reportData: { clientData, insuranceHealthData, mspInfo }
30811
30822
  }
30812
30823
  ),
30813
30824
  /* @__PURE__ */ jsxRuntime.jsxs("footer", { className: "report-page text-center pt-8 border-t border-slate-200", children: [
@@ -30816,7 +30827,7 @@ const ReportBuilder = ({
30816
30827
  /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-slate-400 mt-2", children: [
30817
30828
  "Generated by",
30818
30829
  " ",
30819
- mspCompanyName ? mspCompanyName : /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "red", fontWeight: "bold" }, children: "NEEDS ACTUAL MSP NAME" }),
30830
+ mspInfo.company_name ? mspInfo.company_name : /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "red", fontWeight: "bold" }, children: "NEEDS ACTUAL MSP NAME" }),
30820
30831
  " on ",
30821
30832
  (/* @__PURE__ */ new Date()).toLocaleDateString()
30822
30833
  ] })