ahs-cti 1.0.1-beta.2 → 1.0.1-beta.21

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
@@ -1,411 +1,413 @@
1
1
  import React from 'react';
2
2
 
3
- /**
4
- * @fileoverview TypeScript Declaration File for SDK State Manager
5
- * @description Type declarations for the SDK state management system.
6
- * Provides type definitions for centralized state management in the Call Control SDK.
7
- *
8
- * @author CTI SDK Team
9
- * @version 6.x.x
10
- * @since 2024
11
- */
12
-
13
- /**
14
- * Inline type definitions to avoid Rollup DTS bundler resolution issues
15
- * with relative imports from handwritten .d.ts files.
16
- */
17
- type SDKConfig$1 = {
18
- disableEndCallButton?: boolean;
19
- enableSmsServices?: boolean;
20
- enableQueueName?: boolean;
21
- enableRingtone?: boolean;
22
- disabledMoreOptionsButton?: boolean;
23
- disabledDialButton?: boolean;
24
- disableCallTransferButton?: boolean;
25
- disableBlindTransfer?: boolean;
26
- disableAttendedTransfer?: boolean;
27
- disableWarmTransfer?: boolean;
28
- isDraggable?: boolean;
29
- disableSoftPhone?: boolean;
30
- disableConferenceButton?: boolean;
31
- disableHoldButton?: boolean;
32
- disableMuteButton?: boolean;
33
- disabled?: any;
34
- enabled?: any;
35
- outlined?: any;
36
- auto_wrapup_time?: number;
37
- break_time?: number;
38
- sdkPosition?: "horizontal" | "vertical";
39
- };
40
-
41
- type CallStatus =
42
- | "IDLE"
43
- | "READY"
44
- | "BREAK"
45
- | "ONCALL"
46
- | "WRAPUP"
47
- | "RINGING"
48
- | "DIALING"
49
- | "MISSED"
50
- | "HOLD"
51
- | "UNHOLD"
52
- | "MUTE"
53
- | "UNMUTE"
54
- | "DISCONNECTED"
55
- | "CONFERENCE"
56
- | string;
57
-
58
- type CallData$1 = {
59
- mode?: string;
60
- queue_name?: string;
61
- mobileNumber?: string;
62
- callReferenceId?: string;
63
- convoxId?: string;
64
- type?: string;
65
- status: string;
66
- agent_id: number;
67
- phone_number?: string;
68
- event_time?: string;
69
- convox_id?: string;
70
- process_id?: string;
71
- process_name?: string;
72
- mute?: number;
73
- hold?: number;
74
- };
75
-
76
- type ConferenceLineTypes = {
77
- line: number;
78
- status: string;
79
- type: "external" | "internal" | "";
80
- phone: string;
81
- isMute: boolean;
82
- isHold: boolean;
83
- isCallStart: boolean;
84
- isMergeCall: boolean;
85
- };
86
-
87
- type SDKState$1 = {
88
- authorization: any;
89
- openConferenceDialog: boolean;
90
- openCallTransferDialog: boolean;
91
- process?: { process_id: number; process_name: string } | null;
92
- agentId: string;
93
- sessionId?: string;
94
- sdkConfig: SDKConfig$1 | null;
95
- urlConfig: any | null;
96
- isInitialized: boolean;
97
- convox_id?: string;
98
- process_id?: number;
99
- callStartTime: number | null;
100
- position?: { x: number; y: number };
101
- controlPanelPosition: { x: number; y: number };
102
- iframePosition: { x: number; y: number };
103
- callData: CallData$1;
104
- conferenceLine: ConferenceLineTypes[];
105
- hold: number;
106
- mute: number;
107
- agentStatus: string;
108
- sdk: any | null;
109
- isPermissionsLoaded: boolean;
110
- userPermissions: string[] | null;
111
- menuEntitlements: Array<{ code: string; name: string; enabled: boolean }> | null;
112
- consultInfo: any | null;
113
- };
114
-
115
- /**
116
- * @interface SDKStateManager
117
- * @description Interface for the SDK state manager class
118
- */
119
- interface SDKStateManager {
120
- /**
121
- * Initialize the SDK with API key, tenant ID, agent ID, and optional configuration
122
- * @param apiKey - API key for authentication
123
- * @param tenantId - Tenant identifier
124
- * @param agentId - Agent identifier
125
- * @param urlConfig - Optional URL configuration
126
- * @param res - Optional initialization response
127
- * @param callControlConfig - Optional call control configuration
128
- */
129
- initialize(apiKey: string, tenantId: string, agentId: string, urlConfig?: any, res?: any, callControlConfig?: SDKConfig$1): void;
130
-
131
- /**
132
- * Get the current state
133
- * @returns Current SDK state
134
- */
135
- getState(): SDKState$1;
136
-
137
- /**
138
- * Subscribe to state changes
139
- * @param listener - Callback function to be called on state changes
140
- * @returns Unsubscribe function
141
- */
142
- subscribe(listener: () => void): () => void;
143
-
144
- /**
145
- * Set holding state
146
- * @param isHolding - Whether call is on hold
147
- */
148
- setHolding(isHolding: boolean): void;
149
-
150
- /**
151
- * Set muted state
152
- * @param isMuted - Whether call is muted
153
- */
154
- setMuted(isMuted: boolean): void;
155
-
156
- /**
157
- * Set call status
158
- * @param status - Current call status
159
- */
160
- setStatus(status: CallStatus): void;
161
-
162
- /**
163
- * Set process information
164
- * @param process - Process data with ID and name
165
- */
166
- setProcess(process: { process_id: number; process_name: string }): void;
167
-
168
- /**
169
- * Set control panel position
170
- * @param position - X and Y coordinates
171
- */
172
- setControlPanelPosition(position: { x: number; y: number }): void;
173
-
174
- /**
175
- * Set iframe position
176
- * @param position - X and Y coordinates
177
- */
178
- setIframePosition(position: { x: number; y: number }): void;
179
-
180
- /**
181
- * Start a call (set start time and status)
182
- */
183
- startCall(): void;
184
-
185
- /**
186
- * End a call (reset call state)
187
- */
188
- endCall(): void;
189
-
190
- /**
191
- * Set initialization check flag
192
- */
193
- setInitCheck(): void;
194
-
195
- /**
196
- * Set conference dialog open state
197
- * @param open - Whether conference dialog is open
198
- */
199
- setOpenConferenceDialog(open: boolean): void;
200
-
201
- /**
202
- * Set call transfer dialog open state
203
- * @param open - Whether call transfer dialog is open
204
- */
205
- setOpenCallTransferDialog(open: boolean): void;
206
-
207
- /**
208
- * Update call data
209
- * @param data - Partial call data to update
210
- */
211
- updateCallData(data: Partial<CallData$1>): void;
212
-
213
- /**
214
- * Update conference data
215
- * @param data - Array of conference line data
216
- */
217
- updateConferenceData(data: ConferenceLineTypes[]): void;
218
-
219
- /**
220
- * Set specific conference line
221
- * @param line - Conference line data
222
- */
223
- setConferenceLine(line: ConferenceLineTypes): void;
224
-
225
- /**
226
- * Reset conference lines to initial state
227
- */
228
- resetConferenceLines(): void;
229
-
230
- /**
231
- * Clear storage and reset to initial state
232
- */
233
- clearStorageAndReset(): void;
234
-
235
- /**
236
- * Debug storage data
237
- */
238
- debugStorage(): void;
239
-
240
- /**
241
- * Get conference lines
242
- * @returns Array of conference line data
243
- */
244
- getConferenceLines(): ConferenceLineTypes[];
245
-
246
- /**
247
- * Set SDK permissions from user info
248
- * @param userInfo - User info object from init response
249
- */
250
- setSDKPermissions(userInfo: any): void;
251
-
252
- /**
253
- * Get entitlement-based controls configuration
254
- * @returns Controls configuration derived from permissions
255
- */
256
- getControlsConfig(): Partial<SDKConfig$1>;
257
- }
258
-
259
- /**
260
- * @class SDKStateManager
261
- * @description Centralized state management class for the Call Control SDK.
262
- * Handles state persistence, subscriptions, and provides methods for state updates.
263
- */
264
- declare class SDKStateManager implements SDKStateManager {
265
- /**
266
- * Initialize the SDK with API key, tenant ID, agent ID, and optional configuration
267
- * @param apiKey - API key for authentication
268
- * @param tenantId - Tenant identifier
269
- * @param agentId - Agent identifier
270
- * @param urlConfig - Optional URL configuration
271
- * @param res - Optional initialization response
272
- * @param callControlConfig - Optional call control configuration
273
- */
274
- public initialize(apiKey: string, tenantId: string, agentId: string, urlConfig?: any, res?: any, callControlConfig?: SDKConfig$1): void;
275
-
276
- /**
277
- * Get the current state
278
- * @returns Current SDK state
279
- */
280
- public getState(): SDKState$1;
281
-
282
- /**
283
- * Subscribe to state changes
284
- * @param listener - Callback function to be called on state changes
285
- * @returns Unsubscribe function
286
- */
287
- public subscribe(listener: () => void): () => void;
288
-
289
- /**
290
- * Set holding state
291
- * @param isHolding - Whether call is on hold
292
- */
293
- public setHolding(isHolding: boolean): void;
294
-
295
- /**
296
- * Set muted state
297
- * @param isMuted - Whether call is muted
298
- */
299
- public setMuted(isMuted: boolean): void;
300
-
301
- /**
302
- * Set call status
303
- * @param status - Current call status
304
- */
305
- public setStatus(status: CallStatus): void;
306
-
307
- /**
308
- * Set process information
309
- * @param process - Process data with ID and name
310
- */
311
- public setProcess(process: { process_id: number; process_name: string }): void;
312
-
313
- /**
314
- * Set control panel position
315
- * @param position - X and Y coordinates
316
- */
317
- public setControlPanelPosition(position: { x: number; y: number }): void;
318
-
319
- /**
320
- * Set iframe position
321
- * @param position - X and Y coordinates
322
- */
323
- public setIframePosition(position: { x: number; y: number }): void;
324
-
325
- /**
326
- * Start a call (set start time and status)
327
- */
328
- public startCall(): void;
329
-
330
- /**
331
- * End a call (reset call state)
332
- */
333
- public endCall(): void;
334
-
335
- /**
336
- * Set initialization check flag
337
- */
338
- public setInitCheck(): void;
339
-
340
- /**
341
- * Set conference dialog open state
342
- * @param open - Whether conference dialog is open
343
- */
344
- public setOpenConferenceDialog(open: boolean): void;
345
-
346
- /**
347
- * Set call transfer dialog open state
348
- * @param open - Whether call transfer dialog is open
349
- */
350
- public setOpenCallTransferDialog(open: boolean): void;
351
-
352
- /**
353
- * Update call data
354
- * @param data - Partial call data to update
355
- */
356
- public updateCallData(data: Partial<CallData$1>): void;
357
-
358
- /**
359
- * Update conference data
360
- * @param data - Array of conference line data
361
- */
362
- public updateConferenceData(data: ConferenceLineTypes[]): void;
363
-
364
- /**
365
- * Set specific conference line
366
- * @param line - Conference line data
367
- */
368
- public setConferenceLine(line: ConferenceLineTypes): void;
369
-
370
- /**
371
- * Reset conference lines to initial state
372
- */
373
- public resetConferenceLines(): void;
374
-
375
- /**
376
- * Clear storage and reset to initial state
377
- */
378
- public clearStorageAndReset(): void;
379
-
380
- /**
381
- * Debug storage data
382
- */
383
- public debugStorage(): void;
384
-
385
- /**
386
- * Get conference lines
387
- * @returns Array of conference line data
388
- */
389
- public getConferenceLines(): ConferenceLineTypes[];
390
-
391
- /**
392
- * Set SDK permissions from user info
393
- * @param userInfo - User info object from init response
394
- */
395
- public setSDKPermissions(userInfo: any): void;
396
-
397
- /**
398
- * Get entitlement-based controls configuration
399
- * @returns Controls configuration derived from permissions
400
- */
401
- public getControlsConfig(): Partial<SDKConfig$1>;
402
- }
403
-
404
- /**
405
- * @constant sdkStateManager
406
- * @description Singleton instance of the SDK state manager
407
- * @type {SDKStateManager}
408
- */
3
+ /**
4
+ * @fileoverview TypeScript Declaration File for SDK State Manager
5
+ * @description Type declarations for the SDK state management system.
6
+ * Provides type definitions for centralized state management in the Call Control SDK.
7
+ *
8
+ * @author CTI SDK Team
9
+ * @version 6.x.x
10
+ * @since 2024
11
+ */
12
+
13
+ /**
14
+ * Inline type definitions to avoid Rollup DTS bundler resolution issues
15
+ * with relative imports from handwritten .d.ts files.
16
+ */
17
+ type SDKConfig$1 = {
18
+ disableEndCallButton?: boolean;
19
+ disableEndConference?: boolean;
20
+ enableSmsServices?: boolean;
21
+ enableQueueName?: boolean;
22
+ enableRingtone?: boolean;
23
+ disabledMoreOptionsButton?: boolean;
24
+ disabledDialButton?: boolean;
25
+ disableCallTransferButton?: boolean;
26
+ disableBlindTransfer?: boolean;
27
+ disableAttendedTransfer?: boolean;
28
+ disableWarmTransfer?: boolean;
29
+ isDraggable?: boolean;
30
+ disableSoftPhone?: boolean;
31
+ disableConferenceButton?: boolean;
32
+ disableHoldButton?: boolean;
33
+ disableMuteButton?: boolean;
34
+ disabled?: any;
35
+ enabled?: any;
36
+ outlined?: any;
37
+ auto_wrapup_time?: number;
38
+ break_time?: number;
39
+ sdkPosition?: "horizontal" | "vertical";
40
+ };
41
+
42
+ type CallStatus =
43
+ | "IDLE"
44
+ | "READY"
45
+ | "BREAK"
46
+ | "ONCALL"
47
+ | "WRAPUP"
48
+ | "RINGING"
49
+ | "DIALING"
50
+ | "MISSED"
51
+ | "HOLD"
52
+ | "UNHOLD"
53
+ | "MUTE"
54
+ | "UNMUTE"
55
+ | "DISCONNECTED"
56
+ | "CONFERENCE"
57
+ | string;
58
+
59
+ type CallData$1 = {
60
+ mode?: string;
61
+ queue_name?: string;
62
+ mobileNumber?: string;
63
+ callReferenceId?: string;
64
+ callId?: string;
65
+ type?: string;
66
+ status: string;
67
+ agent_id: number;
68
+ phone_number?: string;
69
+ event_time?: string;
70
+ call_id?: string;
71
+ process_id?: string;
72
+ process_name?: string;
73
+ mute?: number;
74
+ hold?: number;
75
+ auto_wrapup_time?: number | null;
76
+ };
77
+
78
+ type ConferenceLineTypes = {
79
+ line: number;
80
+ status: string;
81
+ type: "external" | "internal" | "";
82
+ phone: string;
83
+ isMute: boolean;
84
+ isHold: boolean;
85
+ isCallStart: boolean;
86
+ isMergeCall: boolean;
87
+ };
88
+
89
+ type SDKState$1 = {
90
+ authorization: any;
91
+ openConferenceDialog: boolean;
92
+ openCallTransferDialog: boolean;
93
+ process?: { process_id: number; process_name: string } | null;
94
+ agentId: string;
95
+ sessionId?: string;
96
+ sdkConfig: SDKConfig$1 | null;
97
+ urlConfig: any | null;
98
+ isInitialized: boolean;
99
+ call_id?: string;
100
+ process_id?: number;
101
+ callStartTime: number | null;
102
+ position?: { x: number; y: number };
103
+ controlPanelPosition: { x: number; y: number };
104
+ iframePosition: { x: number; y: number };
105
+ callData: CallData$1;
106
+ conferenceLine: ConferenceLineTypes[];
107
+ hold: number;
108
+ mute: number;
109
+ agentStatus: string;
110
+ sdk: any | null;
111
+ isPermissionsLoaded: boolean;
112
+ userPermissions: string[] | null;
113
+ menuEntitlements: Array<{ code: string; name: string; enabled: boolean }> | null;
114
+ consultInfo: any | null;
115
+ };
116
+
117
+ /**
118
+ * @interface SDKStateManager
119
+ * @description Interface for the SDK state manager class
120
+ */
121
+ interface SDKStateManager {
122
+ /**
123
+ * Initialize the SDK with API key, tenant ID, agent ID, and optional configuration
124
+ * @param apiKey - API key for authentication
125
+ * @param tenantId - Tenant identifier
126
+ * @param agentId - Agent identifier
127
+ * @param urlConfig - Optional URL configuration
128
+ * @param res - Optional initialization response
129
+ * @param callControlConfig - Optional call control configuration
130
+ */
131
+ initialize(apiKey: string, tenantId: string, agentId: string, urlConfig?: any, res?: any, callControlConfig?: SDKConfig$1): void;
132
+
133
+ /**
134
+ * Get the current state
135
+ * @returns Current SDK state
136
+ */
137
+ getState(): SDKState$1;
138
+
139
+ /**
140
+ * Subscribe to state changes
141
+ * @param listener - Callback function to be called on state changes
142
+ * @returns Unsubscribe function
143
+ */
144
+ subscribe(listener: () => void): () => void;
145
+
146
+ /**
147
+ * Set holding state
148
+ * @param isHolding - Whether call is on hold
149
+ */
150
+ setHolding(isHolding: boolean): void;
151
+
152
+ /**
153
+ * Set muted state
154
+ * @param isMuted - Whether call is muted
155
+ */
156
+ setMuted(isMuted: boolean): void;
157
+
158
+ /**
159
+ * Set call status
160
+ * @param status - Current call status
161
+ */
162
+ setStatus(status: CallStatus): void;
163
+
164
+ /**
165
+ * Set process information
166
+ * @param process - Process data with ID and name
167
+ */
168
+ setProcess(process: { process_id: number; process_name: string }): void;
169
+
170
+ /**
171
+ * Set control panel position
172
+ * @param position - X and Y coordinates
173
+ */
174
+ setControlPanelPosition(position: { x: number; y: number }): void;
175
+
176
+ /**
177
+ * Set iframe position
178
+ * @param position - X and Y coordinates
179
+ */
180
+ setIframePosition(position: { x: number; y: number }): void;
181
+
182
+ /**
183
+ * Start a call (set start time and status)
184
+ */
185
+ startCall(): void;
186
+
187
+ /**
188
+ * End a call (reset call state)
189
+ */
190
+ endCall(): void;
191
+
192
+ /**
193
+ * Set initialization check flag
194
+ */
195
+ setInitCheck(): void;
196
+
197
+ /**
198
+ * Set conference dialog open state
199
+ * @param open - Whether conference dialog is open
200
+ */
201
+ setOpenConferenceDialog(open: boolean): void;
202
+
203
+ /**
204
+ * Set call transfer dialog open state
205
+ * @param open - Whether call transfer dialog is open
206
+ */
207
+ setOpenCallTransferDialog(open: boolean): void;
208
+
209
+ /**
210
+ * Update call data
211
+ * @param data - Partial call data to update
212
+ */
213
+ updateCallData(data: Partial<CallData$1>): void;
214
+
215
+ /**
216
+ * Update conference data
217
+ * @param data - Array of conference line data
218
+ */
219
+ updateConferenceData(data: ConferenceLineTypes[]): void;
220
+
221
+ /**
222
+ * Set specific conference line
223
+ * @param line - Conference line data
224
+ */
225
+ setConferenceLine(line: ConferenceLineTypes): void;
226
+
227
+ /**
228
+ * Reset conference lines to initial state
229
+ */
230
+ resetConferenceLines(): void;
231
+
232
+ /**
233
+ * Clear storage and reset to initial state
234
+ */
235
+ clearStorageAndReset(): void;
236
+
237
+ /**
238
+ * Debug storage data
239
+ */
240
+ debugStorage(): void;
241
+
242
+ /**
243
+ * Get conference lines
244
+ * @returns Array of conference line data
245
+ */
246
+ getConferenceLines(): ConferenceLineTypes[];
247
+
248
+ /**
249
+ * Set SDK permissions from user info
250
+ * @param userInfo - User info object from init response
251
+ */
252
+ setSDKPermissions(userInfo: any): void;
253
+
254
+ /**
255
+ * Get entitlement-based controls configuration
256
+ * @returns Controls configuration derived from permissions
257
+ */
258
+ getControlsConfig(): Partial<SDKConfig$1>;
259
+ }
260
+
261
+ /**
262
+ * @class SDKStateManager
263
+ * @description Centralized state management class for the Call Control SDK.
264
+ * Handles state persistence, subscriptions, and provides methods for state updates.
265
+ */
266
+ declare class SDKStateManager implements SDKStateManager {
267
+ /**
268
+ * Initialize the SDK with API key, tenant ID, agent ID, and optional configuration
269
+ * @param apiKey - API key for authentication
270
+ * @param tenantId - Tenant identifier
271
+ * @param agentId - Agent identifier
272
+ * @param urlConfig - Optional URL configuration
273
+ * @param res - Optional initialization response
274
+ * @param callControlConfig - Optional call control configuration
275
+ */
276
+ public initialize(apiKey: string, tenantId: string, agentId: string, urlConfig?: any, res?: any, callControlConfig?: SDKConfig$1): void;
277
+
278
+ /**
279
+ * Get the current state
280
+ * @returns Current SDK state
281
+ */
282
+ public getState(): SDKState$1;
283
+
284
+ /**
285
+ * Subscribe to state changes
286
+ * @param listener - Callback function to be called on state changes
287
+ * @returns Unsubscribe function
288
+ */
289
+ public subscribe(listener: () => void): () => void;
290
+
291
+ /**
292
+ * Set holding state
293
+ * @param isHolding - Whether call is on hold
294
+ */
295
+ public setHolding(isHolding: boolean): void;
296
+
297
+ /**
298
+ * Set muted state
299
+ * @param isMuted - Whether call is muted
300
+ */
301
+ public setMuted(isMuted: boolean): void;
302
+
303
+ /**
304
+ * Set call status
305
+ * @param status - Current call status
306
+ */
307
+ public setStatus(status: CallStatus): void;
308
+
309
+ /**
310
+ * Set process information
311
+ * @param process - Process data with ID and name
312
+ */
313
+ public setProcess(process: { process_id: number; process_name: string }): void;
314
+
315
+ /**
316
+ * Set control panel position
317
+ * @param position - X and Y coordinates
318
+ */
319
+ public setControlPanelPosition(position: { x: number; y: number }): void;
320
+
321
+ /**
322
+ * Set iframe position
323
+ * @param position - X and Y coordinates
324
+ */
325
+ public setIframePosition(position: { x: number; y: number }): void;
326
+
327
+ /**
328
+ * Start a call (set start time and status)
329
+ */
330
+ public startCall(): void;
331
+
332
+ /**
333
+ * End a call (reset call state)
334
+ */
335
+ public endCall(): void;
336
+
337
+ /**
338
+ * Set initialization check flag
339
+ */
340
+ public setInitCheck(): void;
341
+
342
+ /**
343
+ * Set conference dialog open state
344
+ * @param open - Whether conference dialog is open
345
+ */
346
+ public setOpenConferenceDialog(open: boolean): void;
347
+
348
+ /**
349
+ * Set call transfer dialog open state
350
+ * @param open - Whether call transfer dialog is open
351
+ */
352
+ public setOpenCallTransferDialog(open: boolean): void;
353
+
354
+ /**
355
+ * Update call data
356
+ * @param data - Partial call data to update
357
+ */
358
+ public updateCallData(data: Partial<CallData$1>): void;
359
+
360
+ /**
361
+ * Update conference data
362
+ * @param data - Array of conference line data
363
+ */
364
+ public updateConferenceData(data: ConferenceLineTypes[]): void;
365
+
366
+ /**
367
+ * Set specific conference line
368
+ * @param line - Conference line data
369
+ */
370
+ public setConferenceLine(line: ConferenceLineTypes): void;
371
+
372
+ /**
373
+ * Reset conference lines to initial state
374
+ */
375
+ public resetConferenceLines(): void;
376
+
377
+ /**
378
+ * Clear storage and reset to initial state
379
+ */
380
+ public clearStorageAndReset(): void;
381
+
382
+ /**
383
+ * Debug storage data
384
+ */
385
+ public debugStorage(): void;
386
+
387
+ /**
388
+ * Get conference lines
389
+ * @returns Array of conference line data
390
+ */
391
+ public getConferenceLines(): ConferenceLineTypes[];
392
+
393
+ /**
394
+ * Set SDK permissions from user info
395
+ * @param userInfo - User info object from init response
396
+ */
397
+ public setSDKPermissions(userInfo: any): void;
398
+
399
+ /**
400
+ * Get entitlement-based controls configuration
401
+ * @returns Controls configuration derived from permissions
402
+ */
403
+ public getControlsConfig(): Partial<SDKConfig$1>;
404
+ }
405
+
406
+ /**
407
+ * @constant sdkStateManager
408
+ * @description Singleton instance of the SDK state manager
409
+ * @type {SDKStateManager}
410
+ */
409
411
  declare const sdkStateManager: SDKStateManager;
410
412
 
411
413
  /**
@@ -583,12 +585,22 @@ declare const CallControlPanel: React.ComponentType<CallControlPanelProps>;
583
585
  *
584
586
  * @properties
585
587
  * - `CallHistory` - Call History page component
588
+ * - `Campaigns` - Campaigns / Call Scheduling page component
589
+ * - `LoginReport` - Agent Login Report page component
590
+ * - `CdrReports` - CDR (Call Detail Records) Report page component
591
+ * - `AgentPerformanceReport` - Agent Performance Report page component
592
+ * - `AgentDetailReport` - Agent Detail Report page component
586
593
  *
587
594
  * @since 1.0.0
588
595
  * @author CTI SDK Team
589
596
  */
590
597
  declare const SDKPages: {
591
598
  readonly CallHistory: React.ComponentType<any>;
599
+ readonly Campaigns: React.ComponentType<any>;
600
+ readonly LoginReport: React.ComponentType<any>;
601
+ readonly CdrReports: React.ComponentType<any>;
602
+ readonly AgentPerformanceReport: React.ComponentType<any>;
603
+ readonly AgentDetailReport: React.ComponentType<any>;
592
604
  };
593
605
 
594
606
  // =============================================================================
@@ -620,6 +632,8 @@ interface CallData {
620
632
  phone_number?: string;
621
633
  process_id?: string;
622
634
  process_name?: string;
635
+ /** Raw socket/state call data — full unprocessed snapshot from the SDK state manager */
636
+ socket_info?: any;
623
637
  }
624
638
 
625
639
  /**
@@ -645,6 +659,7 @@ interface CallData {
645
659
  */
646
660
  interface SDKConfig {
647
661
  disableEndCallButton?: boolean;
662
+ disableEndConference?: boolean;
648
663
  disabledDialButton?: boolean;
649
664
  enableSmsServices?: boolean;
650
665
  enableQueueName?: boolean;
@@ -665,7 +680,7 @@ interface URLConfig {
665
680
  password: string;
666
681
  webSocketURL: string;
667
682
  coreBaseURL: string;
668
- accessToken: string;
683
+ accessToken?: string;
669
684
  }
670
685
 
671
686
  /**
@@ -708,126 +723,64 @@ interface CallControlPanelProps {
708
723
  */
709
724
 
710
725
  /**
711
- * 📞 End Call Payload Interface
726
+ * End Call Payload Interface
712
727
  *
713
728
  * @interface EndCallPayload
714
- * @description 📊 Defines the structure for call termination API payload data
715
- * Contains all necessary information for ending a call with proper disposition
729
+ * @description Defines the options for ending a call. All fields are optional —
730
+ * any omitted field falls back to the current session/call state automatically.
716
731
  *
717
732
  * @properties
718
- * - `action: string` - 🎯 API action type ("ENDCALL")
719
- * - `disposition: string` - 📝 Call outcome classification
720
- * - `userId: string` - 👤 Agent identifier
721
- * - `processid: string` - ⚙️ Process identifier
722
- * - `mobile_number: string` - 📱 Customer phone number
723
- * - `set_followUp: string` - 📅 Follow-up requirement ("Y" or "N")
724
- * - `callback_date: string` - 📅 Scheduled callback date
725
- * - `callback_hrs: string` - 🕐 Scheduled callback hour
726
- * - `callback_mins: string` - 🕐 Scheduled callback minute
727
- * - `refno?: string` - 🔗 Optional call reference number
733
+ * - `call_id?: string` - Convox call ID (defaults to active call's call_id)
734
+ * - `agent_id?: string` - Agent identifier (defaults to logged-in agent)
735
+ * - `set_followUp?: string` - Whether a follow-up is required: "Y" or "N" (default: "N")
736
+ * - `callback_date?: string` - Scheduled callback date (YYYY-MM-DD)
737
+ * - `callback_hrs?: number` - Scheduled callback hour (0–23)
738
+ * - `callback_mins?: number` - Scheduled callback minute (0–59)
739
+ * - `mobile_number?: string` - Customer phone number (defaults to active call's phone_number)
740
+ * - `list_comments?: string` - Optional comments for the call log
741
+ * - `call_reference_id?: string` - Call reference ID (defaults to active call's call_id)
742
+ * - `disposition?: string` - Call outcome code (default: "RES")
743
+ * - `line_number?: number` - Conference line number (default: 0)
744
+ * - `reason?: string` - End reason sent to server (default: "normal")
745
+ * - `is_mark_as_break?: boolean` - Whether agent is going on break after the call (sent in request body)
746
+ * - `patientLog?: any` - Optional patient/contact log data
728
747
  *
729
748
  * @example
730
749
  * ```typescript
731
- * // Basic end call payload
732
- * const endCallPayload: EndCallPayload = {
733
- * action: "ENDCALL",
734
- * disposition: "RES",
735
- * userId: "agent123",
736
- * processid: "proc001",
737
- * mobile_number: "1234567890",
738
- * set_followUp: "N",
739
- * callback_date: "",
740
- * callback_hrs: "",
741
- * callback_mins: ""
742
- * };
750
+ * // Minimal all defaults applied from session state
751
+ * await endCall();
743
752
  *
744
- * // With callback scheduling
745
- * const endCallWithCallback: EndCallPayload = {
746
- * action: "ENDCALL",
753
+ * // With disposition and follow-up callback
754
+ * await endCall({
747
755
  * disposition: "RES",
748
- * userId: "agent123",
749
- * processid: "proc001",
750
- * mobile_number: "1234567890",
751
756
  * set_followUp: "Y",
752
- * callback_date: "2024-01-15",
753
- * callback_hrs: "14",
754
- * callback_mins: "30"
755
- * };
757
+ * callback_date: "2026-05-20",
758
+ * callback_hrs: 10,
759
+ * callback_mins: 30,
760
+ * });
761
+ *
762
+ * // Agent going on break after call
763
+ * await endCall({ disposition: "RES", is_mark_as_break: true });
756
764
  * ```
757
765
  *
758
766
  * @since 1.0.0
759
767
  * @author CTI SDK Team
760
768
  */
761
769
  interface EndCallPayload {
762
- /**
763
- * 🎯 API action type
764
- * @description The action type for the API call
765
- * @type {string}
766
- */
767
- action: string;
768
-
769
- /**
770
- * 📝 Call outcome classification
771
- * @description Classification of how the call ended
772
- * @type {string}
773
- */
774
- disposition: string;
775
-
776
- /**
777
- * 👤 Agent identifier
778
- * @description Unique identifier for the agent ending the call
779
- * @type {string}
780
- */
781
- userId: string;
782
-
783
- /**
784
- * ⚙️ Process identifier
785
- * @description Unique identifier for the process
786
- * @type {string}
787
- */
788
- processid: string;
789
-
790
- /**
791
- * 📱 Customer phone number
792
- * @description Phone number of the customer
793
- * @type {string}
794
- */
795
- mobile_number: string;
796
-
797
- /**
798
- * 📅 Follow-up requirement
799
- * @description Whether a follow-up is required ("Y" or "N")
800
- * @type {string}
801
- */
802
- set_followUp: string;
803
-
804
- /**
805
- * 📅 Scheduled callback date
806
- * @description Date for scheduled callback (YYYY-MM-DD format)
807
- * @type {string}
808
- */
809
- callback_date: string;
810
-
811
- /**
812
- * 🕐 Scheduled callback hour
813
- * @description Hour for scheduled callback (0-23)
814
- * @type {string}
815
- */
816
- callback_hrs: string;
817
-
818
- /**
819
- * 🕐 Scheduled callback minute
820
- * @description Minute for scheduled callback (0-59)
821
- * @type {string}
822
- */
823
- callback_mins: string;
824
-
825
- /**
826
- * 🔗 Optional call reference number
827
- * @description Optional reference number for the call
828
- * @type {string | undefined}
829
- */
830
- refno?: string;
770
+ call_id?: string;
771
+ agent_id?: string;
772
+ set_followUp?: string;
773
+ callback_date?: string;
774
+ callback_hrs?: number;
775
+ callback_mins?: number;
776
+ mobile_number?: string;
777
+ list_comments?: string;
778
+ call_reference_id?: string;
779
+ is_mark_as_break?: boolean;
780
+ disposition?: string;
781
+ line_number?: number;
782
+ reason?: string;
783
+ patientLog?: any;
831
784
  }
832
785
 
833
786
  /**
@@ -1142,7 +1095,7 @@ interface ProcessData {
1142
1095
  * Contains information about the current call
1143
1096
  *
1144
1097
  * @properties
1145
- * - `convox_id: string` - 🔗 Call reference identifier
1098
+ * - `call_id: string` - 🔗 Call reference identifier
1146
1099
  * - `phone_number: string` - 📱 Customer phone number
1147
1100
  *
1148
1101
  * @since 1.0.0
@@ -1154,7 +1107,7 @@ interface EndCallPayLoadData {
1154
1107
  * @description Unique identifier for the call
1155
1108
  * @type {string}
1156
1109
  */
1157
- convox_id: string;
1110
+ call_id: string;
1158
1111
 
1159
1112
  /**
1160
1113
  * 📱 Customer phone number
@@ -1718,13 +1671,17 @@ interface StartCallPayload {
1718
1671
  /** Optional auto-answer flag; defaults to false when omitted. */
1719
1672
  auto_answer?: boolean;
1720
1673
  /** Optional Convox call id passthrough. */
1721
- convox_id?: string;
1674
+ call_id?: string;
1722
1675
  /** Optional caller-provided reference id. */
1723
1676
  reference_id?: string;
1724
1677
  /** Optional source identifier (e.g. campaign, dialpad). */
1725
1678
  call_source?: string;
1726
1679
  /** Optional case id passthrough. */
1727
1680
  caseId?: string;
1681
+ /** Whether the call is being made during wrap-up. */
1682
+ isWrapup?: boolean;
1683
+ /** Convox call UUID of the parent call; used for wrap-up chaining. */
1684
+ parentCallUuid?: string;
1728
1685
  }
1729
1686
 
1730
1687
  interface ConferenceCallPayload {
@@ -2237,16 +2194,6 @@ interface ErrorResponse {
2237
2194
  // ⚡ FRAMEWORK-AGNOSTIC ACTION EXPORTS (for Angular / non-React consumers)
2238
2195
  // =============================================================================
2239
2196
 
2240
- interface EndCallOptions {
2241
- disposition?: string;
2242
- followUp?: string;
2243
- callbackDate?: string;
2244
- callbackHrs?: string;
2245
- callbackMins?: string;
2246
- isBreak?: boolean;
2247
- patientLog?: any;
2248
- }
2249
-
2250
2197
  type SupervisorMonitorMode = "listen" | "whisper" | "barge";
2251
2198
 
2252
2199
  interface StartMonitoringPayload {
@@ -2269,7 +2216,7 @@ interface ChangeModePayload {
2269
2216
 
2270
2217
  declare function clickToCall(payload: StartCallPayload): Promise<any>;
2271
2218
  declare function clickToConference(payload: ConferenceCallPayload): Promise<any>;
2272
- declare function endCall(options?: EndCallOptions): Promise<any>;
2219
+ declare function endCall(options?: EndCallPayload): Promise<any>;
2273
2220
  declare function logout(): Promise<void>;
2274
2221
  declare function startMonitoring(payload: StartMonitoringPayload): Promise<any>;
2275
2222
  declare function stopMonitoring(payload: StopMonitoringPayload): Promise<any>;
@@ -2288,6 +2235,162 @@ interface UseClickToConferenceReturn {
2288
2235
  data: any;
2289
2236
  }
2290
2237
 
2291
- declare function useClickToConference(): UseClickToConferenceReturn;
2238
+ declare function useClickToConference(): UseClickToConferenceReturn;
2239
+
2240
+ // =============================================================================
2241
+ // 📊 CALL MONITORING HOOK
2242
+ // =============================================================================
2243
+
2244
+ interface UseCallMonitoringReturn {
2245
+ startMonitoring: (payload: StartMonitoringPayload) => Promise<any>;
2246
+ stopMonitoring: (payload: StopMonitoringPayload) => Promise<any>;
2247
+ changeMode: (payload: ChangeModePayload) => Promise<any>;
2248
+ isLoading: boolean;
2249
+ isSuccess: boolean;
2250
+ isError: boolean;
2251
+ error: any;
2252
+ data: any;
2253
+ }
2254
+
2255
+ declare const useCallMonitoring: () => UseCallMonitoringReturn;
2256
+
2257
+ // =============================================================================
2258
+ // 🗃️ SDK STATE HOOK
2259
+ // =============================================================================
2260
+
2261
+ declare const useSDKState: () => any;
2262
+
2263
+ // =============================================================================
2264
+ // 🛡️ ENTITLEMENTS / PERMISSIONS
2265
+ // =============================================================================
2266
+
2267
+ /** "*" wildcard literal used in permission and menu codes. */
2268
+ declare const SDK_WILDCARD: "*";
2269
+
2270
+ /** Menu entitlement codes (used by SDKPages and SDKPermissionGuard). */
2271
+ declare const SDK_MENU_CODES: {
2272
+ readonly WILDCARD: "*";
2273
+ readonly CALL_HISTORY: "call_history";
2274
+ readonly CAMPAIGNS: "dialer_auto";
2275
+ readonly LOGIN_REPORT: "login_report";
2276
+ readonly CDR_REPORT: "cdr_report";
2277
+ readonly AGENT_PERFORMANCE_REPORT: "agent_performance";
2278
+ readonly AGENT_DETAIL_REPORT: "agent_detail";
2279
+ };
2280
+
2281
+ /** SDK permission codes — feature-level entitlements. */
2282
+ declare const SDK_PERMISSIONS: {
2283
+ readonly WILDCARD: "*";
2284
+ readonly CALLS: "calls";
2285
+ readonly CALL_TRANSFER: "call_transfer";
2286
+ readonly CALL_CONFERENCE: "call_conference";
2287
+ readonly CALL_INBOUND: "call_inbound";
2288
+ readonly CALL_OUTBOUND: "call_outbound";
2289
+ readonly CONFERENCE: "call_conference";
2290
+ readonly TRANSFER_BLIND: "call_transfer_blind";
2291
+ readonly TRANSFER_ATTENDED: "call_transfer_attended";
2292
+ readonly TRANSFER_WARM: "call_transfer_warm";
2293
+ readonly CAMPAIGNS_CREATE: "campaigns:create";
2294
+ readonly CAMPAIGNS_READ: "campaigns:read";
2295
+ readonly CAMPAIGNS_UPDATE: "campaigns:update";
2296
+ readonly CAMPAIGNS_DELETE: "campaigns:delete";
2297
+ readonly CAMPAIGNS_MANAGE: "campaigns:manage";
2298
+ readonly CAMPAIGNS_CONTROL: "campaigns:control";
2299
+ readonly REPORTS_AGENT_LOGIN_READ: "reports:agent_login:read";
2300
+ readonly REPORTS_AGENT_LOGIN_EXPORT: "reports:agent_login:export";
2301
+ readonly REPORTS_AGENT_LOGIN_MANAGE: "reports:agent_login:manage";
2302
+ readonly REPORTS_CDR_READ: "reports:cdr:read";
2303
+ readonly REPORTS_CDR_EXPORT: "reports:cdr:export";
2304
+ readonly REPORTS_CDR_MANAGE: "reports:cdr:manage";
2305
+ };
2306
+
2307
+ // ─── Entitlement types ────────────────────────────────────────────────────────
2308
+
2309
+ interface SDKBit {
2310
+ code: string;
2311
+ enabled: boolean;
2312
+ }
2313
+
2314
+ interface SDKEntitlement {
2315
+ enabled: boolean;
2316
+ items: SDKBit[];
2317
+ }
2318
+
2319
+ interface SDKEntitlements {
2320
+ calls?: SDKEntitlement;
2321
+ call_controls?: SDKEntitlement;
2322
+ call_transfer?: SDKEntitlement;
2323
+ call_conference?: SDKEntitlement;
2324
+ [key: string]: any;
2325
+ }
2326
+
2327
+ interface SDKPermissionState {
2328
+ sdk: SDKEntitlements | null;
2329
+ isLoaded: boolean;
2330
+ error: Error | null;
2331
+ }
2332
+
2333
+ interface ControlsFromPermissions {
2334
+ disabledDialButton: boolean;
2335
+ disableEndCallButton: boolean;
2336
+ disableCallTransferButton: boolean;
2337
+ disableBlindTransfer: boolean;
2338
+ disableAttendedTransfer: boolean;
2339
+ disableWarmTransfer: boolean;
2340
+ disableConferenceButton: boolean;
2341
+ disableHoldButton: boolean;
2342
+ disableMuteButton: boolean;
2343
+ disabledMoreOptionsButton: boolean;
2344
+ }
2345
+
2346
+ interface SDKPermissionContextValue {
2347
+ state: SDKPermissionState;
2348
+ isBitEnabled: (category: keyof SDKEntitlements, bitCode: string) => boolean;
2349
+ getControlsConfig: () => ControlsFromPermissions;
2350
+ }
2351
+
2352
+ // ─── useSDKPermissions hook ───────────────────────────────────────────────────
2353
+
2354
+ interface SDKPermissionsHook {
2355
+ permissions: string[];
2356
+ menuEntitlements: Array<{ code: string; name: string; enabled: boolean }>;
2357
+ isLoaded: boolean;
2358
+ hasPermission: (permission: string) => boolean;
2359
+ hasAnyPermission: (permissions: string[]) => boolean;
2360
+ hasAllPermissions: (permissions: string[]) => boolean;
2361
+ hasMenuFeature: (code: string) => boolean;
2362
+ }
2363
+
2364
+ declare function useSDKPermissions(): SDKPermissionsHook;
2365
+
2366
+ // ─── Permission guard & access denied components ──────────────────────────────
2367
+
2368
+ interface SDKPermissionGuardProps {
2369
+ children?: React.ReactNode;
2370
+ /** Single permission code (e.g. "calls:inbound") */
2371
+ permission?: string;
2372
+ /** Multiple permission codes — ANY match grants access by default */
2373
+ permissions?: string[];
2374
+ /** When true, ALL permissions must be granted */
2375
+ requireAll?: boolean;
2376
+ /** One or more menu feature codes — ANY match grants access by default */
2377
+ menuFeature?: string | string[];
2378
+ /** When true, ALL menu features must be enabled */
2379
+ requireAllMenus?: boolean;
2380
+ /** Custom fallback rendered when access is denied */
2381
+ fallback?: React.ReactNode;
2382
+ /** Show the default Access Denied UI when denied. Defaults to true. */
2383
+ showFallback?: boolean;
2384
+ /** Callback fired when the guard denies access */
2385
+ onDenied?: () => void;
2386
+ }
2387
+
2388
+ declare const SDKPermissionGuard: React.FC<SDKPermissionGuardProps>;
2389
+
2390
+ interface SDKAccessDeniedProps {
2391
+ message?: string;
2392
+ }
2393
+
2394
+ declare const SDKAccessDenied: React.FC<SDKAccessDeniedProps>;
2292
2395
 
2293
- export { type APIResponse, type AgentStatus, CallControlPanel, type CallControlPanelProps, type CallData, type CallInitiationFunction, type CallTerminationFunction, type ChangeModePayload, type CleanupOperation, type ConferenceCallPayload, 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 UseClickToConferenceReturn, type UseEndCallReturn, type UseLogoutReturn, changeMonitorMode, clickToCall, clickToConference, endCall, getSDKVersion, initSDK, isSDKInitialized, logout, sdkStateManager, startMonitoring, stopMonitoring, useClickToCall, useClickToConference, useEndCall, useGetAuthorizationToken, useGetCallerData, useLogout };
2396
+ 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 LogoutFunction, type LogoutHookStateTypes, type LogoutPayload, type ProcessData, SDKAccessDenied, type SDKAccessDeniedProps, type SDKBit, type SDKConfig, type SDKEntitlement, type SDKEntitlements, 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, startMonitoring, stopMonitoring, useCallMonitoring, useClickToCall, useClickToConference, useEndCall, useGetAuthorizationToken, useGetCallerData, useLogout, useSDKPermissions, useSDKState };