ahs-cti 1.0.1-beta.45 → 1.0.1-beta.46

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useGetCallerData
3
- } from "./chunk-BI4BLVVA.mjs";
3
+ } from "./chunk-IY5NGMWS.mjs";
4
4
  import {
5
5
  SDKPageHeader
6
6
  } from "./chunk-I5VT6XXH.mjs";
@@ -2767,4 +2767,4 @@ var campaigns_default = Campaigns;
2767
2767
  export {
2768
2768
  campaigns_default as default
2769
2769
  };
2770
- //# sourceMappingURL=campaigns-6OW7BOTF.mjs.map
2770
+ //# sourceMappingURL=campaigns-6G56DSDE.mjs.map
@@ -8,9 +8,9 @@ import { useState, useEffect } from "react";
8
8
  var useGetCallerData = () => {
9
9
  var _a, _b;
10
10
  const sdkState = sdkStateManager.getState();
11
- const { process_id, process_name, status, phone_number, agent_id, call_id, call_details } = sdkState.callData;
11
+ const { process_id, process_name, status, phone_number, agent_id, call_id, call_details, socket_info } = sdkState.callData;
12
12
  const initialLeadData = sdkStateManager.getTransferLeadData();
13
- const initialCallData = __spreadValues({
13
+ const initialCallData = __spreadValues(__spreadValues({
14
14
  phone_number,
15
15
  status,
16
16
  callReferenceId: call_id,
@@ -19,15 +19,15 @@ var useGetCallerData = () => {
19
19
  process_name,
20
20
  call_details,
21
21
  auto_wrapup_time: (_b = (_a = sdkState.backendCallControls) == null ? void 0 : _a.auto_wrapup_time) != null ? _b : null
22
- }, initialLeadData !== void 0 && { lead_data: initialLeadData });
22
+ }, initialLeadData !== void 0 && { lead_data: initialLeadData }), socket_info !== void 0 && { socket_info });
23
23
  const [callData, setCallData] = useState(initialCallData);
24
24
  useEffect(() => {
25
25
  const unsubscribe = sdkStateManager.subscribe(() => {
26
26
  var _a2, _b2;
27
27
  const state = sdkStateManager.getState();
28
- const { process_id: process_id2, process_name: process_name2, status: status2, phone_number: phone_number2, agent_id: agent_id2, call_id: call_id2, call_details: call_details2, auto_wrapup_time } = state.callData;
28
+ const { process_id: process_id2, process_name: process_name2, status: status2, phone_number: phone_number2, agent_id: agent_id2, call_id: call_id2, call_details: call_details2, auto_wrapup_time, socket_info: socket_info2 } = state.callData;
29
29
  const lead_data = sdkStateManager.getTransferLeadData();
30
- const currentCallData = __spreadValues({
30
+ const currentCallData = __spreadValues(__spreadValues({
31
31
  phone_number: phone_number2,
32
32
  status: status2,
33
33
  callReferenceId: call_id2,
@@ -36,7 +36,7 @@ var useGetCallerData = () => {
36
36
  process_name: process_name2,
37
37
  call_details: call_details2,
38
38
  auto_wrapup_time: (_b2 = auto_wrapup_time != null ? auto_wrapup_time : (_a2 = state.backendCallControls) == null ? void 0 : _a2.auto_wrapup_time) != null ? _b2 : null
39
- }, lead_data !== void 0 && { lead_data });
39
+ }, lead_data !== void 0 && { lead_data }), socket_info2 !== void 0 && { socket_info: socket_info2 });
40
40
  setCallData(currentCallData);
41
41
  });
42
42
  return unsubscribe;
@@ -47,4 +47,4 @@ var useGetCallerData = () => {
47
47
  export {
48
48
  useGetCallerData
49
49
  };
50
- //# sourceMappingURL=chunk-BI4BLVVA.mjs.map
50
+ //# sourceMappingURL=chunk-IY5NGMWS.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../call-control-sdk/lib/hooks/useGetCallerData.ts"],"sourcesContent":["import { useState, useEffect } from \"react\";\r\nimport { sdkStateManager } from \"./sdk-state\";\r\nimport type { CallData } from \"../../types\";\r\n\r\nexport const useGetCallerData = (): CallData => {\r\n\tconst sdkState = sdkStateManager.getState();\r\n\tconst { process_id, process_name, status, phone_number, agent_id, call_id, call_details, socket_info } =\r\n\t\tsdkState.callData;\r\n\tconst initialLeadData = sdkStateManager.getTransferLeadData();\r\n\tconst initialCallData = {\r\n\t\tphone_number,\r\n\t\tstatus,\r\n\t\tcallReferenceId: call_id,\r\n\t\tagent_id,\r\n\t\tprocess_id,\r\n\t\tprocess_name,\r\n\t\tcall_details,\r\n\t\tauto_wrapup_time: sdkState.backendCallControls?.auto_wrapup_time ?? null,\r\n\t\t...(initialLeadData !== undefined && { lead_data: initialLeadData }),\r\n\t\t...(socket_info !== undefined && { socket_info }),\r\n\t};\r\n\tconst [callData, setCallData] = useState<CallData>(initialCallData);\r\n\r\n\tuseEffect(() => {\r\n\t\tconst unsubscribe = sdkStateManager.subscribe(() => {\r\n\t\t\tconst state = sdkStateManager.getState();\r\n\t\t\tconst { process_id, process_name, status, phone_number, agent_id, call_id, call_details, auto_wrapup_time, socket_info } =\r\n\t\t\t\tstate.callData;\r\n\t\t\tconst lead_data = sdkStateManager.getTransferLeadData();\r\n\t\t\tconst currentCallData = {\r\n\t\t\t\tphone_number,\r\n\t\t\t\tstatus,\r\n\t\t\t\tcallReferenceId: call_id,\r\n\t\t\t\tagent_id,\r\n\t\t\t\tprocess_id,\r\n\t\t\t\tprocess_name,\r\n\t\t\t\tcall_details,\r\n\t\t\t\tauto_wrapup_time: auto_wrapup_time ?? state.backendCallControls?.auto_wrapup_time ?? null,\r\n\t\t\t\t...(lead_data !== undefined && { lead_data }),\r\n\t\t\t\t...(socket_info !== undefined && { socket_info }),\r\n\t\t\t};\r\n\t\t\tsetCallData(currentCallData);\r\n\t\t});\r\n\r\n\t\treturn unsubscribe;\r\n\t}, []);\r\n\r\n\treturn callData;\r\n};\r\n"],"mappings":";;;;;;AAAA,SAAS,UAAU,iBAAiB;AAI7B,IAAM,mBAAmB,MAAgB;AAJhD;AAKC,QAAM,WAAW,gBAAgB,SAAS;AAC1C,QAAM,EAAE,YAAY,cAAc,QAAQ,cAAc,UAAU,SAAS,cAAc,YAAY,IACpG,SAAS;AACV,QAAM,kBAAkB,gBAAgB,oBAAoB;AAC5D,QAAM,kBAAkB;AAAA,IACvB;AAAA,IACA;AAAA,IACA,iBAAiB;AAAA,IACjB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,mBAAkB,oBAAS,wBAAT,mBAA8B,qBAA9B,YAAkD;AAAA,KAChE,oBAAoB,UAAa,EAAE,WAAW,gBAAgB,IAC9D,gBAAgB,UAAa,EAAE,YAAY;AAEhD,QAAM,CAAC,UAAU,WAAW,IAAI,SAAmB,eAAe;AAElE,YAAU,MAAM;AACf,UAAM,cAAc,gBAAgB,UAAU,MAAM;AAxBtD,UAAAA,KAAAC;AAyBG,YAAM,QAAQ,gBAAgB,SAAS;AACvC,YAAM,EAAE,YAAAC,aAAY,cAAAC,eAAc,QAAAC,SAAQ,cAAAC,eAAc,UAAAC,WAAU,SAAAC,UAAS,cAAAC,eAAc,kBAAkB,aAAAC,aAAY,IACtH,MAAM;AACP,YAAM,YAAY,gBAAgB,oBAAoB;AACtD,YAAM,kBAAkB;AAAA,QACvB,cAAAJ;AAAA,QACA,QAAAD;AAAA,QACA,iBAAiBG;AAAA,QACjB,UAAAD;AAAA,QACA,YAAAJ;AAAA,QACA,cAAAC;AAAA,QACA,cAAAK;AAAA,QACA,mBAAkBP,MAAA,+CAAoBD,MAAA,MAAM,wBAAN,gBAAAA,IAA2B,qBAA/C,OAAAC,MAAmE;AAAA,SACjF,cAAc,UAAa,EAAE,UAAU,IACvCQ,iBAAgB,UAAa,EAAE,aAAAA,aAAY;AAEhD,kBAAY,eAAe;AAAA,IAC5B,CAAC;AAED,WAAO;AAAA,EACR,GAAG,CAAC,CAAC;AAEL,SAAO;AACR;","names":["_a","_b","process_id","process_name","status","phone_number","agent_id","call_id","call_details","socket_info"]}
package/dist/index.d.mts CHANGED
@@ -684,8 +684,12 @@ interface CallData {
684
684
  call_uuid?: string;
685
685
  [key: string]: any;
686
686
  };
687
- /** Raw socket/state call data full unprocessed snapshot from the SDK state manager */
688
- socket_info?: any;
687
+ /** Lead data set by the host app; attached when available */
688
+ lead_data?: any;
689
+ /** Raw socket payload from the most recent WebSocket message */
690
+ socket_info?: Record<string, any>;
691
+ /** Call Sage AI analysis data from the most recent WebSocket message */
692
+ call_sage?: Record<string, any> | null;
689
693
  break_details?: {
690
694
  type: string;
691
695
  value: string;
@@ -1568,6 +1572,31 @@ declare const useGetAuthorizationToken: () => string | undefined;
1568
1572
  */
1569
1573
  declare const useGetCallerData: () => CallData;
1570
1574
 
1575
+ /**
1576
+ * 📡 Socket Data Interface
1577
+ * Raw WebSocket payload fields exposed by useGetSocketData.
1578
+ */
1579
+ interface SocketData {
1580
+ socket_info?: Record<string, any>;
1581
+ call_sage?: Record<string, any> | null;
1582
+ }
1583
+
1584
+ /**
1585
+ * 📡 Socket Data Hook
1586
+ * @function useGetSocketData
1587
+ * @description Reactive hook that re-renders only when socket_info or call_sage
1588
+ * actually change (deep equality). Use this instead of useGetCallerData when you
1589
+ * only care about live socket events and Call Sage AI data.
1590
+ *
1591
+ * @returns {SocketData} Latest { socket_info, call_sage } from the WebSocket stream
1592
+ *
1593
+ * @example
1594
+ * ```typescript
1595
+ * const { socket_info, call_sage } = useGetSocketData();
1596
+ * ```
1597
+ */
1598
+ declare const useGetSocketData: () => SocketData;
1599
+
1571
1600
  /**
1572
1601
  * 🗃️ SDK State Interface
1573
1602
  *
@@ -2457,4 +2486,4 @@ interface SDKAccessDeniedProps {
2457
2486
 
2458
2487
  declare const SDKAccessDenied: React.FC<SDKAccessDeniedProps>;
2459
2488
 
2460
- export { type APIResponse, type AgentStatus, CallControlPanel, type CallControlPanelProps, type CallData, type CallInitiationFunction, type CallTerminationFunction, type ChangeModePayload, type CleanupOperation, type ConferenceCallPayload, type ConferenceLine, type ControlsFromPermissions, type DispositionType, type EndCallData, type EndCallPayLoadData, type EndCallPayload, type ErrorResponse, type FollowUpType, type HookStateTypes, type InitSDKParams, type LiveStatusPageProps, type LogoutFunction, type LogoutHookStateTypes, type LogoutPayload, type ProcessData, SDKAccessDenied, type SDKAccessDeniedProps, type SDKBit, type SDKConfig, type SDKEntitlement, type SDKEntitlements, type SDKInitResult, SDKPages, type SDKPermissionContextValue, SDKPermissionGuard, type SDKPermissionGuardProps, type SDKPermissionState, type SDKPermissionsHook, type SDKState, SDKStateManager, SDK_MENU_CODES, SDK_PERMISSIONS, SDK_WILDCARD, type StartCallPayload, type StartCalltData, type StartCalltHookStateTypes, type StartMonitoringPayload, type StopMonitoringPayload, type StorageType, type SupervisorMonitorMode, type URLConfig, type UseCallMonitoringReturn, type UseClickToCallReturn, type UseClickToConferenceReturn, type UseEndCallReturn, type UseLogoutReturn, changeMonitorMode, clickToCall, clickToConference, endCall, getSDKVersion, initSDK, isSDKInitialized, logout, sdkStateManager, setTransferLeadData, startMonitoring, stopMonitoring, useCallMonitoring, useClickToCall, useClickToConference, useEndCall, useGetAuthorizationToken, useGetCallerData, useLogout, useSDKPermissions, useSDKState };
2489
+ export { type APIResponse, type AgentStatus, CallControlPanel, type CallControlPanelProps, type CallData, type CallInitiationFunction, type CallTerminationFunction, type ChangeModePayload, type CleanupOperation, type ConferenceCallPayload, type ConferenceLine, type ControlsFromPermissions, type DispositionType, type EndCallData, type EndCallPayLoadData, type EndCallPayload, type ErrorResponse, type FollowUpType, type HookStateTypes, type InitSDKParams, type LiveStatusPageProps, type LogoutFunction, type LogoutHookStateTypes, type LogoutPayload, type ProcessData, SDKAccessDenied, type SDKAccessDeniedProps, type SDKBit, type SDKConfig, type SDKEntitlement, type SDKEntitlements, type SDKInitResult, SDKPages, type SDKPermissionContextValue, SDKPermissionGuard, type SDKPermissionGuardProps, type SDKPermissionState, type SDKPermissionsHook, type SDKState, SDKStateManager, SDK_MENU_CODES, SDK_PERMISSIONS, SDK_WILDCARD, type SocketData, type StartCallPayload, type StartCalltData, type StartCalltHookStateTypes, type StartMonitoringPayload, type StopMonitoringPayload, type StorageType, type SupervisorMonitorMode, type URLConfig, type UseCallMonitoringReturn, type UseClickToCallReturn, type UseClickToConferenceReturn, type UseEndCallReturn, type UseLogoutReturn, changeMonitorMode, clickToCall, clickToConference, endCall, getSDKVersion, initSDK, isSDKInitialized, logout, sdkStateManager, setTransferLeadData, startMonitoring, stopMonitoring, useCallMonitoring, useClickToCall, useClickToConference, useEndCall, useGetAuthorizationToken, useGetCallerData, useGetSocketData, useLogout, useSDKPermissions, useSDKState };
package/dist/index.d.ts CHANGED
@@ -684,8 +684,12 @@ interface CallData {
684
684
  call_uuid?: string;
685
685
  [key: string]: any;
686
686
  };
687
- /** Raw socket/state call data full unprocessed snapshot from the SDK state manager */
688
- socket_info?: any;
687
+ /** Lead data set by the host app; attached when available */
688
+ lead_data?: any;
689
+ /** Raw socket payload from the most recent WebSocket message */
690
+ socket_info?: Record<string, any>;
691
+ /** Call Sage AI analysis data from the most recent WebSocket message */
692
+ call_sage?: Record<string, any> | null;
689
693
  break_details?: {
690
694
  type: string;
691
695
  value: string;
@@ -1568,6 +1572,31 @@ declare const useGetAuthorizationToken: () => string | undefined;
1568
1572
  */
1569
1573
  declare const useGetCallerData: () => CallData;
1570
1574
 
1575
+ /**
1576
+ * 📡 Socket Data Interface
1577
+ * Raw WebSocket payload fields exposed by useGetSocketData.
1578
+ */
1579
+ interface SocketData {
1580
+ socket_info?: Record<string, any>;
1581
+ call_sage?: Record<string, any> | null;
1582
+ }
1583
+
1584
+ /**
1585
+ * 📡 Socket Data Hook
1586
+ * @function useGetSocketData
1587
+ * @description Reactive hook that re-renders only when socket_info or call_sage
1588
+ * actually change (deep equality). Use this instead of useGetCallerData when you
1589
+ * only care about live socket events and Call Sage AI data.
1590
+ *
1591
+ * @returns {SocketData} Latest { socket_info, call_sage } from the WebSocket stream
1592
+ *
1593
+ * @example
1594
+ * ```typescript
1595
+ * const { socket_info, call_sage } = useGetSocketData();
1596
+ * ```
1597
+ */
1598
+ declare const useGetSocketData: () => SocketData;
1599
+
1571
1600
  /**
1572
1601
  * 🗃️ SDK State Interface
1573
1602
  *
@@ -2457,5 +2486,5 @@ interface SDKAccessDeniedProps {
2457
2486
 
2458
2487
  declare const SDKAccessDenied: React.FC<SDKAccessDeniedProps>;
2459
2488
 
2460
- export type { APIResponse, AgentStatus, CallControlPanelProps, CallData, CallInitiationFunction, CallTerminationFunction, ChangeModePayload, CleanupOperation, ConferenceCallPayload, ConferenceLine, ControlsFromPermissions, DispositionType, EndCallData, EndCallPayLoadData, EndCallPayload, ErrorResponse, FollowUpType, HookStateTypes, InitSDKParams, LiveStatusPageProps, LogoutFunction, LogoutHookStateTypes, LogoutPayload, ProcessData, SDKAccessDeniedProps, SDKBit, SDKConfig, SDKEntitlement, SDKEntitlements, SDKInitResult, SDKPermissionContextValue, SDKPermissionGuardProps, SDKPermissionState, SDKPermissionsHook, SDKState, StartCallPayload, StartCalltData, StartCalltHookStateTypes, StartMonitoringPayload, StopMonitoringPayload, StorageType, SupervisorMonitorMode, URLConfig, UseCallMonitoringReturn, UseClickToCallReturn, UseClickToConferenceReturn, UseEndCallReturn, UseLogoutReturn }
2461
- export { CallControlPanel, SDKAccessDenied, SDKPages, SDKPermissionGuard, SDKStateManager, SDK_MENU_CODES, SDK_PERMISSIONS, SDK_WILDCARD, changeMonitorMode, clickToCall, clickToConference, endCall, getSDKVersion, initSDK, isSDKInitialized, logout, sdkStateManager, setTransferLeadData, startMonitoring, stopMonitoring, useCallMonitoring, useClickToCall, useClickToConference, useEndCall, useGetAuthorizationToken, useGetCallerData, useLogout, useSDKPermissions, useSDKState };
2489
+ export type { APIResponse, AgentStatus, CallControlPanelProps, CallData, CallInitiationFunction, CallTerminationFunction, ChangeModePayload, CleanupOperation, ConferenceCallPayload, ConferenceLine, ControlsFromPermissions, DispositionType, EndCallData, EndCallPayLoadData, EndCallPayload, ErrorResponse, FollowUpType, HookStateTypes, InitSDKParams, LiveStatusPageProps, LogoutFunction, LogoutHookStateTypes, LogoutPayload, ProcessData, SDKAccessDeniedProps, SDKBit, SDKConfig, SDKEntitlement, SDKEntitlements, SDKInitResult, SDKPermissionContextValue, SDKPermissionGuardProps, SDKPermissionState, SDKPermissionsHook, SDKState, SocketData, StartCallPayload, StartCalltData, StartCalltHookStateTypes, StartMonitoringPayload, StopMonitoringPayload, StorageType, SupervisorMonitorMode, URLConfig, UseCallMonitoringReturn, UseClickToCallReturn, UseClickToConferenceReturn, UseEndCallReturn, UseLogoutReturn }
2490
+ export { CallControlPanel, SDKAccessDenied, SDKPages, SDKPermissionGuard, SDKStateManager, SDK_MENU_CODES, SDK_PERMISSIONS, SDK_WILDCARD, changeMonitorMode, clickToCall, clickToConference, endCall, getSDKVersion, initSDK, isSDKInitialized, logout, sdkStateManager, setTransferLeadData, startMonitoring, stopMonitoring, useCallMonitoring, useClickToCall, useClickToConference, useEndCall, useGetAuthorizationToken, useGetCallerData, useGetSocketData, useLogout, useSDKPermissions, useSDKState };