call-control-sdk 4.0.0 → 5.0.0
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/README.md +3 -4
- package/dist/index.d.mts +39 -8
- package/dist/index.d.ts +39 -8
- package/dist/index.js +1600 -840
- package/dist/index.mjs +1546 -791
- package/package.json +67 -57
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Call Control SDK
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Call control SDK component, providing control panel for call management.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
@@ -42,7 +42,6 @@ import { initSDK } from 'call-control-sdk';
|
|
|
42
42
|
apiKey: "apiKey",
|
|
43
43
|
tenantId: "tenantId",
|
|
44
44
|
agentId: "agentId",
|
|
45
|
-
baseUrl: "baseUrl",
|
|
46
45
|
});
|
|
47
46
|
console.log("SDK initialized successfully");
|
|
48
47
|
} catch (error) {
|
|
@@ -73,7 +72,7 @@ function App() {
|
|
|
73
72
|
|
|
74
73
|
## API Reference
|
|
75
74
|
|
|
76
|
-
### `initSDK({apiKey: "apiKey",tenantId: "tenantId",agentId: "agentId",
|
|
75
|
+
### `initSDK({apiKey: "apiKey",tenantId: "tenantId",agentId: "agentId",})`
|
|
77
76
|
|
|
78
77
|
Initializes the SDK with an API key, tenantId, agentId, baseUrl. Must be called before using any components.
|
|
79
78
|
|
|
@@ -130,4 +129,4 @@ All control states are automatically persistent:
|
|
|
130
129
|
|
|
131
130
|
## License
|
|
132
131
|
|
|
133
|
-
MIT © 2025
|
|
132
|
+
MIT © 2025
|
package/dist/index.d.mts
CHANGED
|
@@ -1,16 +1,48 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
|
|
3
3
|
interface CallData {
|
|
4
|
-
mobileNumber
|
|
5
|
-
callReferenceId
|
|
6
|
-
|
|
4
|
+
mobileNumber?: string;
|
|
5
|
+
callReferenceId?: string;
|
|
6
|
+
convoxId?: string;
|
|
7
|
+
type?: string;
|
|
8
|
+
status?: string;
|
|
9
|
+
agent_id?: string;
|
|
10
|
+
phone_number?: string;
|
|
11
|
+
event_time?: string;
|
|
12
|
+
convox_id?: string;
|
|
13
|
+
process_id?: string;
|
|
14
|
+
process_name?: string;
|
|
7
15
|
}
|
|
8
16
|
interface CallControlPanelProps {
|
|
9
|
-
onDataChange?: (data:
|
|
17
|
+
onDataChange?: (data: any) => void;
|
|
10
18
|
}
|
|
11
19
|
type CallStatus = "idle" | "ready" | "break" | "on call" | "wrap up" | "dial" | "hold" | "mute";
|
|
12
20
|
|
|
13
|
-
declare function CallControlPanel({ onDataChange }: CallControlPanelProps): react_jsx_runtime.JSX.Element
|
|
21
|
+
declare function CallControlPanel({ onDataChange }: CallControlPanelProps): react_jsx_runtime.JSX.Element;
|
|
22
|
+
|
|
23
|
+
interface LogoutResponse {
|
|
24
|
+
success: boolean;
|
|
25
|
+
message?: string;
|
|
26
|
+
data?: any;
|
|
27
|
+
}
|
|
28
|
+
interface UseLogoutOptions {
|
|
29
|
+
onSuccess?: (response: LogoutResponse) => void;
|
|
30
|
+
onError?: (error: any) => void;
|
|
31
|
+
onComplete?: () => void;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Custom hook for handling agent logout functionality
|
|
35
|
+
* @param options - Optional callbacks for success, error, and completion
|
|
36
|
+
* @returns Object containing logout function and loading state
|
|
37
|
+
*/
|
|
38
|
+
declare const useLogout: (options?: UseLogoutOptions) => {
|
|
39
|
+
logout: () => void;
|
|
40
|
+
isLoading: boolean;
|
|
41
|
+
isSuccess: boolean;
|
|
42
|
+
isError: boolean;
|
|
43
|
+
error: any;
|
|
44
|
+
data: any;
|
|
45
|
+
};
|
|
14
46
|
|
|
15
47
|
/**
|
|
16
48
|
* Initialize the Call Control SDK with an API key
|
|
@@ -21,8 +53,7 @@ type intiSDKParams = {
|
|
|
21
53
|
apiKey: string;
|
|
22
54
|
tenantId: string;
|
|
23
55
|
agentId: string;
|
|
24
|
-
baseUrl: string;
|
|
25
56
|
};
|
|
26
|
-
declare function initSDK({ apiKey, tenantId, agentId
|
|
57
|
+
declare function initSDK({ apiKey, tenantId, agentId }: intiSDKParams): void;
|
|
27
58
|
|
|
28
|
-
export { CallControlPanel, type CallControlPanelProps, type CallData, type CallStatus, initSDK };
|
|
59
|
+
export { CallControlPanel, type CallControlPanelProps, type CallData, type CallStatus, initSDK, useLogout };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,48 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
|
|
3
3
|
interface CallData {
|
|
4
|
-
mobileNumber
|
|
5
|
-
callReferenceId
|
|
6
|
-
|
|
4
|
+
mobileNumber?: string;
|
|
5
|
+
callReferenceId?: string;
|
|
6
|
+
convoxId?: string;
|
|
7
|
+
type?: string;
|
|
8
|
+
status?: string;
|
|
9
|
+
agent_id?: string;
|
|
10
|
+
phone_number?: string;
|
|
11
|
+
event_time?: string;
|
|
12
|
+
convox_id?: string;
|
|
13
|
+
process_id?: string;
|
|
14
|
+
process_name?: string;
|
|
7
15
|
}
|
|
8
16
|
interface CallControlPanelProps {
|
|
9
|
-
onDataChange?: (data:
|
|
17
|
+
onDataChange?: (data: any) => void;
|
|
10
18
|
}
|
|
11
19
|
type CallStatus = "idle" | "ready" | "break" | "on call" | "wrap up" | "dial" | "hold" | "mute";
|
|
12
20
|
|
|
13
|
-
declare function CallControlPanel({ onDataChange }: CallControlPanelProps): react_jsx_runtime.JSX.Element
|
|
21
|
+
declare function CallControlPanel({ onDataChange }: CallControlPanelProps): react_jsx_runtime.JSX.Element;
|
|
22
|
+
|
|
23
|
+
interface LogoutResponse {
|
|
24
|
+
success: boolean;
|
|
25
|
+
message?: string;
|
|
26
|
+
data?: any;
|
|
27
|
+
}
|
|
28
|
+
interface UseLogoutOptions {
|
|
29
|
+
onSuccess?: (response: LogoutResponse) => void;
|
|
30
|
+
onError?: (error: any) => void;
|
|
31
|
+
onComplete?: () => void;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Custom hook for handling agent logout functionality
|
|
35
|
+
* @param options - Optional callbacks for success, error, and completion
|
|
36
|
+
* @returns Object containing logout function and loading state
|
|
37
|
+
*/
|
|
38
|
+
declare const useLogout: (options?: UseLogoutOptions) => {
|
|
39
|
+
logout: () => void;
|
|
40
|
+
isLoading: boolean;
|
|
41
|
+
isSuccess: boolean;
|
|
42
|
+
isError: boolean;
|
|
43
|
+
error: any;
|
|
44
|
+
data: any;
|
|
45
|
+
};
|
|
14
46
|
|
|
15
47
|
/**
|
|
16
48
|
* Initialize the Call Control SDK with an API key
|
|
@@ -21,8 +53,7 @@ type intiSDKParams = {
|
|
|
21
53
|
apiKey: string;
|
|
22
54
|
tenantId: string;
|
|
23
55
|
agentId: string;
|
|
24
|
-
baseUrl: string;
|
|
25
56
|
};
|
|
26
|
-
declare function initSDK({ apiKey, tenantId, agentId
|
|
57
|
+
declare function initSDK({ apiKey, tenantId, agentId }: intiSDKParams): void;
|
|
27
58
|
|
|
28
|
-
export { CallControlPanel, type CallControlPanelProps, type CallData, type CallStatus, initSDK };
|
|
59
|
+
export { CallControlPanel, type CallControlPanelProps, type CallData, type CallStatus, initSDK, useLogout };
|