ahs-cti 1.0.0-beta.8 → 1.0.0-beta.9

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.d.mts CHANGED
@@ -2213,6 +2213,48 @@ interface ErrorResponse {
2213
2213
  * @type {any}
2214
2214
  */
2215
2215
  details?: any;
2216
- }
2216
+ }
2217
+
2218
+
2219
+ // =============================================================================
2220
+ // ⚡ FRAMEWORK-AGNOSTIC ACTION EXPORTS (for Angular / non-React consumers)
2221
+ // =============================================================================
2222
+
2223
+ interface EndCallOptions {
2224
+ disposition?: string;
2225
+ followUp?: string;
2226
+ callbackDate?: string;
2227
+ callbackHrs?: string;
2228
+ callbackMins?: string;
2229
+ isBreak?: boolean;
2230
+ patientLog?: any;
2231
+ }
2232
+
2233
+ type SupervisorMonitorMode = "listen" | "whisper" | "barge";
2234
+
2235
+ interface StartMonitoringPayload {
2236
+ call_id: string;
2237
+ mode: SupervisorMonitorMode;
2238
+ supervisor_extension?: string;
2239
+ agent_extension?: string;
2240
+ }
2241
+
2242
+ interface StopMonitoringPayload {
2243
+ call_uuid: string;
2244
+ session_id?: string;
2245
+ }
2246
+
2247
+ interface ChangeModePayload {
2248
+ call_uuid: string;
2249
+ mode: SupervisorMonitorMode;
2250
+ session_id?: string;
2251
+ }
2252
+
2253
+ declare function clickToCall(payload: StartCallPayload): Promise<any>;
2254
+ declare function endCall(options?: EndCallOptions): Promise<any>;
2255
+ declare function logout(): Promise<void>;
2256
+ declare function startMonitoring(payload: StartMonitoringPayload): Promise<any>;
2257
+ declare function stopMonitoring(payload: StopMonitoringPayload): Promise<any>;
2258
+ declare function changeMonitorMode(payload: ChangeModePayload): Promise<any>;
2217
2259
 
2218
- export { type APIResponse, type AgentStatus, CallControlPanel, type CallControlPanelProps, type CallData, type CallInitiationFunction, type CallTerminationFunction, type CleanupOperation, type ConferenceLine, type DispositionType, type EndCallData, type EndCallPayLoadData, type EndCallPayload, type ErrorResponse, type FollowUpType, type HookStateTypes, type InitSDKParams, type LogoutFunction, type LogoutHookStateTypes, type LogoutPayload, type ProcessData, type SDKConfig, SDKPages, type SDKState, SDKStateManager, type StartCallPayload, type StartCalltData, type StartCalltHookStateTypes, type StorageType, type URLConfig, type UseClickToCallReturn, type UseEndCallReturn, type UseLogoutReturn, getSDKVersion, initSDK, isSDKInitialized, sdkStateManager, useClickToCall, useEndCall, useGetAuthorizationToken, useGetCallerData, useLogout };
2260
+ export { type APIResponse, type AgentStatus, CallControlPanel, type CallControlPanelProps, type CallData, type CallInitiationFunction, type CallTerminationFunction, type ChangeModePayload, type CleanupOperation, type ConferenceLine, type DispositionType, type EndCallData, type EndCallOptions, type EndCallPayLoadData, type EndCallPayload, type ErrorResponse, type FollowUpType, type HookStateTypes, type InitSDKParams, type LogoutFunction, type LogoutHookStateTypes, type LogoutPayload, type ProcessData, type SDKConfig, SDKPages, type SDKState, SDKStateManager, type StartCallPayload, type StartCalltData, type StartCalltHookStateTypes, type StartMonitoringPayload, type StopMonitoringPayload, type StorageType, type SupervisorMonitorMode, type URLConfig, type UseClickToCallReturn, type UseEndCallReturn, type UseLogoutReturn, changeMonitorMode, clickToCall, endCall, getSDKVersion, initSDK, isSDKInitialized, logout, sdkStateManager, startMonitoring, stopMonitoring, useClickToCall, useEndCall, useGetAuthorizationToken, useGetCallerData, useLogout };
package/dist/index.d.ts CHANGED
@@ -2213,6 +2213,48 @@ interface ErrorResponse {
2213
2213
  * @type {any}
2214
2214
  */
2215
2215
  details?: any;
2216
- }
2216
+ }
2217
+
2218
+
2219
+ // =============================================================================
2220
+ // ⚡ FRAMEWORK-AGNOSTIC ACTION EXPORTS (for Angular / non-React consumers)
2221
+ // =============================================================================
2222
+
2223
+ interface EndCallOptions {
2224
+ disposition?: string;
2225
+ followUp?: string;
2226
+ callbackDate?: string;
2227
+ callbackHrs?: string;
2228
+ callbackMins?: string;
2229
+ isBreak?: boolean;
2230
+ patientLog?: any;
2231
+ }
2232
+
2233
+ type SupervisorMonitorMode = "listen" | "whisper" | "barge";
2234
+
2235
+ interface StartMonitoringPayload {
2236
+ call_id: string;
2237
+ mode: SupervisorMonitorMode;
2238
+ supervisor_extension?: string;
2239
+ agent_extension?: string;
2240
+ }
2241
+
2242
+ interface StopMonitoringPayload {
2243
+ call_uuid: string;
2244
+ session_id?: string;
2245
+ }
2246
+
2247
+ interface ChangeModePayload {
2248
+ call_uuid: string;
2249
+ mode: SupervisorMonitorMode;
2250
+ session_id?: string;
2251
+ }
2252
+
2253
+ declare function clickToCall(payload: StartCallPayload): Promise<any>;
2254
+ declare function endCall(options?: EndCallOptions): Promise<any>;
2255
+ declare function logout(): Promise<void>;
2256
+ declare function startMonitoring(payload: StartMonitoringPayload): Promise<any>;
2257
+ declare function stopMonitoring(payload: StopMonitoringPayload): Promise<any>;
2258
+ declare function changeMonitorMode(payload: ChangeModePayload): Promise<any>;
2217
2259
 
2218
- export { type APIResponse, type AgentStatus, CallControlPanel, type CallControlPanelProps, type CallData, type CallInitiationFunction, type CallTerminationFunction, type CleanupOperation, type ConferenceLine, type DispositionType, type EndCallData, type EndCallPayLoadData, type EndCallPayload, type ErrorResponse, type FollowUpType, type HookStateTypes, type InitSDKParams, type LogoutFunction, type LogoutHookStateTypes, type LogoutPayload, type ProcessData, type SDKConfig, SDKPages, type SDKState, SDKStateManager, type StartCallPayload, type StartCalltData, type StartCalltHookStateTypes, type StorageType, type URLConfig, type UseClickToCallReturn, type UseEndCallReturn, type UseLogoutReturn, getSDKVersion, initSDK, isSDKInitialized, sdkStateManager, useClickToCall, useEndCall, useGetAuthorizationToken, useGetCallerData, useLogout };
2260
+ export { type APIResponse, type AgentStatus, CallControlPanel, type CallControlPanelProps, type CallData, type CallInitiationFunction, type CallTerminationFunction, type ChangeModePayload, type CleanupOperation, type ConferenceLine, type DispositionType, type EndCallData, type EndCallOptions, type EndCallPayLoadData, type EndCallPayload, type ErrorResponse, type FollowUpType, type HookStateTypes, type InitSDKParams, type LogoutFunction, type LogoutHookStateTypes, type LogoutPayload, type ProcessData, type SDKConfig, SDKPages, type SDKState, SDKStateManager, type StartCallPayload, type StartCalltData, type StartCalltHookStateTypes, type StartMonitoringPayload, type StopMonitoringPayload, type StorageType, type SupervisorMonitorMode, type URLConfig, type UseClickToCallReturn, type UseEndCallReturn, type UseLogoutReturn, changeMonitorMode, clickToCall, endCall, getSDKVersion, initSDK, isSDKInitialized, logout, sdkStateManager, startMonitoring, stopMonitoring, useClickToCall, useEndCall, useGetAuthorizationToken, useGetCallerData, useLogout };
package/dist/index.js CHANGED
@@ -1304,10 +1304,16 @@ __export(index_exports, {
1304
1304
  SDK_MENU_CODES: () => SDK_MENU_CODES,
1305
1305
  SDK_PERMISSIONS: () => SDK_PERMISSIONS,
1306
1306
  SDK_WILDCARD: () => SDK_WILDCARD,
1307
+ changeMonitorMode: () => changeMonitorMode,
1308
+ clickToCall: () => clickToCall,
1309
+ endCall: () => endCall,
1307
1310
  getSDKVersion: () => getSDKVersion,
1308
1311
  initSDK: () => initSDK,
1309
1312
  isSDKInitialized: () => isSDKInitialized,
1313
+ logout: () => logout,
1310
1314
  sdkStateManager: () => sdkStateManager,
1315
+ startMonitoring: () => startMonitoring,
1316
+ stopMonitoring: () => stopMonitoring,
1311
1317
  useCallMonitoring: () => useCallMonitoring,
1312
1318
  useClickToCall: () => useClickToCall,
1313
1319
  useEndCall: () => useEndCall,
@@ -1647,7 +1653,7 @@ var useCallMonitoring = () => {
1647
1653
  setIsError(false);
1648
1654
  setError(null);
1649
1655
  };
1650
- const startMonitoring = (0, import_react7.useCallback)(async (payload) => {
1656
+ const startMonitoring2 = (0, import_react7.useCallback)(async (payload) => {
1651
1657
  resetState();
1652
1658
  setLoading(true);
1653
1659
  return axios_default.post(END_POINT.SUPERVISOR_CALL_LISTEN, payload).then((res) => {
@@ -1663,7 +1669,7 @@ var useCallMonitoring = () => {
1663
1669
  setLoading(false);
1664
1670
  });
1665
1671
  }, []);
1666
- const stopMonitoring = (0, import_react7.useCallback)(async (payload) => {
1672
+ const stopMonitoring2 = (0, import_react7.useCallback)(async (payload) => {
1667
1673
  resetState();
1668
1674
  setLoading(true);
1669
1675
  return axios_default.post(END_POINT.SUPERVISOR_CALL_LEAVE, payload).then((res) => {
@@ -1696,8 +1702,8 @@ var useCallMonitoring = () => {
1696
1702
  });
1697
1703
  }, []);
1698
1704
  return {
1699
- startMonitoring,
1700
- stopMonitoring,
1705
+ startMonitoring: startMonitoring2,
1706
+ stopMonitoring: stopMonitoring2,
1701
1707
  changeMode,
1702
1708
  isLoading: loading,
1703
1709
  isSuccess: success,
@@ -4016,7 +4022,7 @@ function CallControls({ onDataChange }) {
4016
4022
  state.iframePosition,
4017
4023
  (newPosition) => sdkStateManager.setIframePosition(newPosition)
4018
4024
  );
4019
- const [clickToCall, { isLoading: clickToCallLoading }] = usePostRequest({
4025
+ const [clickToCall2, { isLoading: clickToCallLoading }] = usePostRequest({
4020
4026
  onSuccess: () => {
4021
4027
  setPhoneNumber("");
4022
4028
  setDialerAnchorEl(null);
@@ -4031,7 +4037,7 @@ function CallControls({ onDataChange }) {
4031
4037
  });
4032
4038
  const [updateAgentStatus, { isLoading }] = usePostRequest();
4033
4039
  const [sendNotification] = usePostRequest();
4034
- const [endCall, { isLoading: endCallLoading }] = usePostRequest({
4040
+ const [endCall2, { isLoading: endCallLoading }] = usePostRequest({
4035
4041
  onSuccess: () => {
4036
4042
  sdkStateManager.endCall();
4037
4043
  setOpenCallDisposition(false);
@@ -4102,7 +4108,7 @@ function CallControls({ onDataChange }) {
4102
4108
  phone_number: number,
4103
4109
  userId: state.agentId
4104
4110
  };
4105
- clickToCall(END_POINT.CLICK_TO_CALL, payload);
4111
+ clickToCall2(END_POINT.CLICK_TO_CALL, payload);
4106
4112
  }
4107
4113
  };
4108
4114
  const handleHoldToggle = () => {
@@ -4138,7 +4144,7 @@ function CallControls({ onDataChange }) {
4138
4144
  endcall_type: "CLOSE"
4139
4145
  };
4140
4146
  setPhoneNumber("");
4141
- endCall(END_POINT.END_CALL, payload, {
4147
+ endCall2(END_POINT.END_CALL, payload, {
4142
4148
  params: {
4143
4149
  isBreak: (_q2 = data == null ? void 0 : data.selected_break) != null ? _q2 : false
4144
4150
  }
@@ -5621,6 +5627,85 @@ var SDKPages = {
5621
5627
 
5622
5628
  // call-control-sdk/index.ts
5623
5629
  init_sdk_state();
5630
+
5631
+ // call-control-sdk/lib/angular-services/index.ts
5632
+ var import_vault6 = require("@react-solutions/vault");
5633
+ init_axios();
5634
+ init_endPoint();
5635
+ init_sdk_state();
5636
+ init_storage();
5637
+ async function clickToCall(payload) {
5638
+ var _a2, _b, _c, _d, _e, _f, _g, _h;
5639
+ const state = (0, import_vault6.getItem)(STORAGE_KEY);
5640
+ if (((_a2 = state == null ? void 0 : state.callData) == null ? void 0 : _a2.status) === "IDLE") {
5641
+ const body = {
5642
+ action: "CALL",
5643
+ userId: state == null ? void 0 : state.agentId,
5644
+ phone_number: payload.mobileNumber
5645
+ };
5646
+ const res = await axios_default.post(END_POINT.CLICK_TO_CALL, body);
5647
+ sdkStateManager.resetConferenceLines();
5648
+ return res.data;
5649
+ }
5650
+ if (((_b = state == null ? void 0 : state.callData) == null ? void 0 : _b.status) === "ONCALL") {
5651
+ const line_used = (_d = (_c = state == null ? void 0 : state.conferenceLine) == null ? void 0 : _c.filter((l) => l.line !== 1)) == null ? void 0 : _d.find((l) => l.status === "IDLE" && !(l == null ? void 0 : l.isCallStart));
5652
+ const body = {
5653
+ action: "EXTERNAL_CONFERENCE",
5654
+ operation: `CALL${line_used.line}`,
5655
+ line_used: String(line_used.line),
5656
+ thirdparty_no: payload.mobileNumber,
5657
+ userid: (_f = (_e = state.callData) == null ? void 0 : _e.agent_id) != null ? _f : "",
5658
+ process: (_h = (_g = state.callData) == null ? void 0 : _g.process_name) != null ? _h : ""
5659
+ };
5660
+ const res = await axios_default.post(END_POINT.CONFERENCE_CALL, body);
5661
+ sdkStateManager.setOpenConferenceDialog(true);
5662
+ return res.data;
5663
+ }
5664
+ throw new Error("Agent is not ready");
5665
+ }
5666
+ async function endCall(options = {}) {
5667
+ var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
5668
+ const state = (0, import_vault6.getItem)(STORAGE_KEY);
5669
+ const body = {
5670
+ action: "ENDCALL",
5671
+ userId: state == null ? void 0 : state.agentId,
5672
+ processid: (_c = (_b = (_a2 = state == null ? void 0 : state.process) == null ? void 0 : _a2.process_id) == null ? void 0 : _b.toString()) != null ? _c : "",
5673
+ process_name: (_e = (_d = state == null ? void 0 : state.process) == null ? void 0 : _d.process_name) != null ? _e : "",
5674
+ callreferenceid: (_g = (_f = state == null ? void 0 : state.callData) == null ? void 0 : _f.convox_id) != null ? _g : "",
5675
+ mobile_number: (_i = (_h = state == null ? void 0 : state.callData) == null ? void 0 : _h.phone_number) != null ? _i : "",
5676
+ disposition: (_j = options.disposition) != null ? _j : "RES",
5677
+ set_followUp: (_k = options.followUp) != null ? _k : "N",
5678
+ callback_date: (_l = options.callbackDate) != null ? _l : "",
5679
+ callback_hrs: (_m = options.callbackHrs) != null ? _m : "",
5680
+ callback_mins: (_n = options.callbackMins) != null ? _n : "",
5681
+ endcall_type: "CLOSE",
5682
+ patient_enquiry: (_o = options.patientLog) != null ? _o : null
5683
+ };
5684
+ const res = await axios_default.post(END_POINT.END_CALL, body, {
5685
+ params: { isBreak: (_p = options.isBreak) != null ? _p : false }
5686
+ });
5687
+ sdkStateManager.resetConferenceLines();
5688
+ sdkStateManager.endCall();
5689
+ return res.data;
5690
+ }
5691
+ async function logout() {
5692
+ sdkStateManager.clearStorageAndReset();
5693
+ (0, import_vault6.removeSession)(STORAGE_KEY);
5694
+ }
5695
+ async function startMonitoring(payload) {
5696
+ const res = await axios_default.post(END_POINT.SUPERVISOR_CALL_LISTEN, payload);
5697
+ return res.data;
5698
+ }
5699
+ async function stopMonitoring(payload) {
5700
+ const res = await axios_default.post(END_POINT.SUPERVISOR_CALL_LEAVE, payload);
5701
+ return res.data;
5702
+ }
5703
+ async function changeMonitorMode(payload) {
5704
+ const res = await axios_default.post(END_POINT.SUPERVISOR_CALL_CHANGE_MODE, payload);
5705
+ return res.data;
5706
+ }
5707
+
5708
+ // call-control-sdk/index.ts
5624
5709
  async function initSDK({
5625
5710
  apiKey,
5626
5711
  tenantId,
@@ -5694,10 +5779,16 @@ function isSDKInitialized() {
5694
5779
  SDK_MENU_CODES,
5695
5780
  SDK_PERMISSIONS,
5696
5781
  SDK_WILDCARD,
5782
+ changeMonitorMode,
5783
+ clickToCall,
5784
+ endCall,
5697
5785
  getSDKVersion,
5698
5786
  initSDK,
5699
5787
  isSDKInitialized,
5788
+ logout,
5700
5789
  sdkStateManager,
5790
+ startMonitoring,
5791
+ stopMonitoring,
5701
5792
  useCallMonitoring,
5702
5793
  useClickToCall,
5703
5794
  useEndCall,