call-control-sdk 6.4.9 → 6.4.10-dev.3

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.js CHANGED
@@ -61,7 +61,7 @@ __export(index_exports, {
61
61
  module.exports = __toCommonJS(index_exports);
62
62
 
63
63
  // call-control-sdk/lib/services/endPoint.ts
64
- var IP = "cti.aighospitals.com";
64
+ var IP = "uat-cti.aighospitals.com";
65
65
  var BASE_URL = `https://${IP}:8095`;
66
66
  var WS_BASE_URL = `wss://${IP}:8095`;
67
67
  var VERSION = {
@@ -1418,7 +1418,7 @@ var styles_default = useStyles;
1418
1418
  // call-control-sdk/lib/components/dialog.tsx
1419
1419
  var import_jsx_runtime2 = require("react/jsx-runtime");
1420
1420
  var ConferenceTableRow = ({ each }) => {
1421
- var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
1421
+ var _a2, _b, _c, _d, _e;
1422
1422
  const state = useSDKState();
1423
1423
  const { showToast } = useToast();
1424
1424
  const { disabled, enabled, outlined } = styles_default({
@@ -1471,8 +1471,14 @@ var ConferenceTableRow = ({ each }) => {
1471
1471
  process: (_d2 = (_c2 = state.callData) == null ? void 0 : _c2.process_name) != null ? _d2 : ""
1472
1472
  };
1473
1473
  axios_default.post(END_POINT.CONFERENCE_CALL, payload).then((res) => {
1474
- var _a4;
1475
- showToast((_a4 = res.data) == null ? void 0 : _a4.message, "success");
1474
+ var _a4, _b3, _c3;
1475
+ if (((_a4 = state.callData) == null ? void 0 : _a4.hold) === 1) {
1476
+ handleHoldToggle();
1477
+ }
1478
+ if (((_b3 = state.callData) == null ? void 0 : _b3.mute) === 1) {
1479
+ handleMuteToggle();
1480
+ }
1481
+ showToast((_c3 = res.data) == null ? void 0 : _c3.message, "success");
1476
1482
  sdkStateManager.setConferenceLine(__spreadValues(__spreadValues({}, line), data));
1477
1483
  }).catch((err) => {
1478
1484
  var _a4, _b3, _c3, _d3;
@@ -1530,7 +1536,7 @@ var ConferenceTableRow = ({ each }) => {
1530
1536
  setConferenceCallEnd(false);
1531
1537
  });
1532
1538
  };
1533
- const [holdOrUnHold, { isLoading: holdOrUnHoldLoading }] = usePostRequest({
1539
+ const [holdOrUnHold] = usePostRequest({
1534
1540
  onSuccess: () => {
1535
1541
  sdkStateManager.setHolding(!state.isHolding);
1536
1542
  },
@@ -1538,7 +1544,7 @@ var ConferenceTableRow = ({ each }) => {
1538
1544
  console.log("\u274C Hold operation error:", error);
1539
1545
  }
1540
1546
  });
1541
- const [muteOrUnMute, { isLoading: muteOrUnMuteLoading }] = usePostRequest({
1547
+ const [muteOrUnMute] = usePostRequest({
1542
1548
  onSuccess: () => {
1543
1549
  sdkStateManager.setMuted(!state.isMuted);
1544
1550
  },
@@ -1589,7 +1595,7 @@ var ConferenceTableRow = ({ each }) => {
1589
1595
  {
1590
1596
  sx: {
1591
1597
  padding: "6px",
1592
- width: "100px"
1598
+ width: "150px"
1593
1599
  },
1594
1600
  children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1595
1601
  import_material3.Typography,
@@ -1598,7 +1604,7 @@ var ConferenceTableRow = ({ each }) => {
1598
1604
  sx: {
1599
1605
  px: 1,
1600
1606
  borderRadius: "10px",
1601
- flex: 1
1607
+ width: "150px"
1602
1608
  },
1603
1609
  children: (_e = each == null ? void 0 : each.status) != null ? _e : ""
1604
1610
  }
@@ -1646,17 +1652,20 @@ var ConferenceTableRow = ({ each }) => {
1646
1652
  gap: "10px"
1647
1653
  },
1648
1654
  children: [
1649
- (each == null ? void 0 : each.line) === 1 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Tooltip, { title: ((_f = state.callData) == null ? void 0 : _f.hold) === 1 ? "Resume" : "Hold", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1655
+ (each == null ? void 0 : each.line) === 1 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Tooltip, { title: (each == null ? void 0 : each.status) !== "HOLD" ? "Hold" : "Resume", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1650
1656
  import_material3.Button,
1651
1657
  {
1652
- variant: ((_g = state.callData) == null ? void 0 : _g.hold) === 1 && ((_i = (_h = state.callData) == null ? void 0 : _h.status) == null ? void 0 : _i.toUpperCase()) === "ONCALL" ? "contained" : "outlined",
1653
- onClick: (e) => {
1654
- e.stopPropagation();
1655
- handleHoldToggle();
1658
+ variant: (each == null ? void 0 : each.status) === "HOLD" ? "contained" : "outlined",
1659
+ sx: (each == null ? void 0 : each.status) === "CONFERENCE" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
1660
+ onClick: () => {
1661
+ if (each.status === "HOLD") {
1662
+ onHoldOrUnHoldConferenceCall(each, { isHold: false }, "UNHOLDUSER");
1663
+ } else {
1664
+ onHoldOrUnHoldConferenceCall(each, { isHold: true }, "HOLDUSER");
1665
+ }
1656
1666
  },
1657
- sx: ((_j = state.callData) == null ? void 0 : _j.hold) === 1 && ((_l = (_k = state.callData) == null ? void 0 : _k.status) == null ? void 0 : _l.toUpperCase()) === "ONCALL" ? __spreadValues({}, enabled) : ((_n = (_m = state.callData) == null ? void 0 : _m.status) == null ? void 0 : _n.toUpperCase()) === "ONCALL" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
1658
- disabled: ((_p = (_o = state.callData) == null ? void 0 : _o.status) == null ? void 0 : _p.toUpperCase()) !== "ONCALL" && ((_q = state.callData) == null ? void 0 : _q.hold) !== 1 || holdOrUnHoldLoading,
1659
- children: ((_r = state.callData) == null ? void 0 : _r.hold) === 1 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1667
+ disabled: (each == null ? void 0 : each.status) !== "CONFERENCE" && (each == null ? void 0 : each.status) !== "HOLD" || conferenceCallHoldOrUnHold,
1668
+ children: each.status === "HOLD" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1660
1669
  import_material3.Box,
1661
1670
  {
1662
1671
  sx: {
@@ -1673,12 +1682,12 @@ var ConferenceTableRow = ({ each }) => {
1673
1682
  variant: "body2",
1674
1683
  sx: {
1675
1684
  fontSize: "12px",
1676
- color: ((_s = state.callData) == null ? void 0 : _s.hold) === 1 ? "#fff" : "initial"
1685
+ color: each.status === "HOLD" ? "#fff" : "initial"
1677
1686
  },
1678
1687
  children: "Unhold"
1679
1688
  }
1680
1689
  ),
1681
- holdOrUnHoldLoading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1690
+ conferenceCallHoldOrUnHold ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1682
1691
  import_material3.CircularProgress,
1683
1692
  {
1684
1693
  size: "16px",
@@ -1705,13 +1714,13 @@ var ConferenceTableRow = ({ each }) => {
1705
1714
  {
1706
1715
  variant: "body2",
1707
1716
  sx: {
1708
- color: ((_t = state.callData) == null ? void 0 : _t.hold) === 1 ? "#fff" : "#000",
1717
+ color: each.status === "HOLD" ? "#fff" : "#000",
1709
1718
  fontSize: "12px"
1710
1719
  },
1711
1720
  children: "Hold"
1712
1721
  }
1713
1722
  ),
1714
- holdOrUnHoldLoading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1723
+ conferenceCallHoldOrUnHold ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1715
1724
  import_material3.CircularProgress,
1716
1725
  {
1717
1726
  size: "16px",
@@ -1776,7 +1785,7 @@ var ConferenceTableRow = ({ each }) => {
1776
1785
  children: conferenceCallMerge ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.CircularProgress, { size: "20px" }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.CallSplit, {})
1777
1786
  }
1778
1787
  ) }),
1779
- (each == null ? void 0 : each.line) !== 1 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Tooltip, { title: (each == null ? void 0 : each.status) !== "HOLD" ? "Hold" : "Un Hold", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1788
+ (each == null ? void 0 : each.line) !== 1 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Tooltip, { title: (each == null ? void 0 : each.status) !== "HOLD" ? "Hold" : "Resume", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1780
1789
  import_material3.Button,
1781
1790
  {
1782
1791
  variant: (each == null ? void 0 : each.status) === "HOLD" ? "contained" : "outlined",