call-control-sdk 2.0.0 → 2.1.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 +12 -22
- package/dist/index.d.mts +3 -11
- package/dist/index.d.ts +3 -11
- package/dist/index.js +586 -94
- package/dist/index.mjs +593 -96
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# React Call Control SDK
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Achala provide call control SDK with Material-UI components, providing a draggable control panel for call management.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
@@ -16,7 +16,7 @@ A React-based call control SDK with Material-UI components, providing a draggabl
|
|
|
16
16
|
## Installation
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
npm install
|
|
19
|
+
npm install call-control-sdk
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
## Peer Dependencies
|
|
@@ -32,17 +32,21 @@ npm install react react-dom @mui/material @mui/icons-material @emotion/react @em
|
|
|
32
32
|
### 1. Initialize the SDK
|
|
33
33
|
|
|
34
34
|
```typescript
|
|
35
|
-
import { initCallSDK } from '
|
|
35
|
+
import { initCallSDK } from 'call-control-sdk';
|
|
36
36
|
|
|
37
37
|
// Initialize at the top level of your app
|
|
38
|
-
|
|
38
|
+
initSDK(
|
|
39
|
+
"API_KEY",
|
|
40
|
+
"TENANT_ID",
|
|
41
|
+
"AGENT_ID",
|
|
42
|
+
"BASE_URL");
|
|
39
43
|
```
|
|
40
44
|
|
|
41
45
|
### 2. Use the CallControlPanel
|
|
42
46
|
|
|
43
47
|
```typescript
|
|
44
48
|
import React from 'react';
|
|
45
|
-
import { CallControlPanel } from '
|
|
49
|
+
import { CallControlPanel } from 'call-control-sdk';
|
|
46
50
|
|
|
47
51
|
function App() {
|
|
48
52
|
const handleDataChange = ({ mobileNumber, callReferenceId, agentLoginId }) => {
|
|
@@ -58,24 +62,11 @@ function App() {
|
|
|
58
62
|
}
|
|
59
63
|
```
|
|
60
64
|
|
|
61
|
-
### 3. Update Call Data (Optional)
|
|
62
|
-
|
|
63
|
-
```typescript
|
|
64
|
-
import { updateCallData } from 'react-call-control-sdk';
|
|
65
|
-
|
|
66
|
-
// Update call information
|
|
67
|
-
updateCallData({
|
|
68
|
-
mobileNumber: '+1-555-123-4567',
|
|
69
|
-
callReferenceId: 'CALL-2024-001',
|
|
70
|
-
agentLoginId: 'AGENT-123'
|
|
71
|
-
});
|
|
72
|
-
```
|
|
73
|
-
|
|
74
65
|
## API Reference
|
|
75
66
|
|
|
76
|
-
### `
|
|
67
|
+
### `initSDK(sdkApiKey: string, tenantId: string, agentId: string, baseUrl: string)`
|
|
77
68
|
|
|
78
|
-
Initializes the SDK with an API key. Must be called before using any components.
|
|
69
|
+
Initializes the SDK with an API key, tenantId, agentId, baseUrl. Must be called before using any components.
|
|
79
70
|
|
|
80
71
|
**Parameters:**
|
|
81
72
|
- `sdkApiKey` (string): Your API key for SDK authentication
|
|
@@ -103,7 +94,6 @@ Updates the call data that will be passed to the `onDataChange` callback.
|
|
|
103
94
|
|
|
104
95
|
### Status Management
|
|
105
96
|
- **Idle**: Default state, no active call
|
|
106
|
-
- **Ready**: Agent is ready to take calls
|
|
107
97
|
- **Break**: Agent is on break
|
|
108
98
|
|
|
109
99
|
### Call Controls
|
|
@@ -153,4 +143,4 @@ function App() {
|
|
|
153
143
|
|
|
154
144
|
## License
|
|
155
145
|
|
|
156
|
-
MIT ©
|
|
146
|
+
MIT © RDX
|
package/dist/index.d.mts
CHANGED
|
@@ -8,6 +8,7 @@ interface CallData {
|
|
|
8
8
|
interface CallControlPanelProps {
|
|
9
9
|
onDataChange?: (data: CallData) => void;
|
|
10
10
|
}
|
|
11
|
+
type CallStatus = "idle" | "ready" | "break";
|
|
11
12
|
|
|
12
13
|
declare function CallControlPanel({ onDataChange }: CallControlPanelProps): react_jsx_runtime.JSX.Element;
|
|
13
14
|
|
|
@@ -16,15 +17,6 @@ declare function CallControlPanel({ onDataChange }: CallControlPanelProps): reac
|
|
|
16
17
|
* @param sdkApiKey - The API key for SDK authentication
|
|
17
18
|
* @throws {Error} When API key is missing or invalid
|
|
18
19
|
*/
|
|
19
|
-
declare function
|
|
20
|
-
/**
|
|
21
|
-
* Update call data (used by host application)
|
|
22
|
-
* @param data - Partial call data to update
|
|
23
|
-
*/
|
|
24
|
-
declare function updateCallData(data: {
|
|
25
|
-
mobileNumber?: string;
|
|
26
|
-
callReferenceId?: string;
|
|
27
|
-
agentLoginId?: string;
|
|
28
|
-
}): void;
|
|
20
|
+
declare function initSDK(sdkApiKey: string, tenantId: string, agentId: string, baseUrl: string): void;
|
|
29
21
|
|
|
30
|
-
export { CallControlPanel,
|
|
22
|
+
export { CallControlPanel, type CallControlPanelProps, type CallData, type CallStatus, initSDK };
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ interface CallData {
|
|
|
8
8
|
interface CallControlPanelProps {
|
|
9
9
|
onDataChange?: (data: CallData) => void;
|
|
10
10
|
}
|
|
11
|
+
type CallStatus = "idle" | "ready" | "break";
|
|
11
12
|
|
|
12
13
|
declare function CallControlPanel({ onDataChange }: CallControlPanelProps): react_jsx_runtime.JSX.Element;
|
|
13
14
|
|
|
@@ -16,15 +17,6 @@ declare function CallControlPanel({ onDataChange }: CallControlPanelProps): reac
|
|
|
16
17
|
* @param sdkApiKey - The API key for SDK authentication
|
|
17
18
|
* @throws {Error} When API key is missing or invalid
|
|
18
19
|
*/
|
|
19
|
-
declare function
|
|
20
|
-
/**
|
|
21
|
-
* Update call data (used by host application)
|
|
22
|
-
* @param data - Partial call data to update
|
|
23
|
-
*/
|
|
24
|
-
declare function updateCallData(data: {
|
|
25
|
-
mobileNumber?: string;
|
|
26
|
-
callReferenceId?: string;
|
|
27
|
-
agentLoginId?: string;
|
|
28
|
-
}): void;
|
|
20
|
+
declare function initSDK(sdkApiKey: string, tenantId: string, agentId: string, baseUrl: string): void;
|
|
29
21
|
|
|
30
|
-
export { CallControlPanel,
|
|
22
|
+
export { CallControlPanel, type CallControlPanelProps, type CallData, type CallStatus, initSDK };
|