@ai-vyumi/livecall 0.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/dist/VyumiLiveCall.d.ts +122 -0
- package/dist/VyumiLiveCall.js +185 -0
- package/dist/callbacks/callbacks.d.ts +149 -0
- package/dist/callbacks/callbacks.js +2 -0
- package/dist/config/const.d.ts +1 -0
- package/dist/config/const.js +4 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +10 -0
- package/dist/kit/index.d.ts +12 -0
- package/dist/kit/index.js +514 -0
- package/dist/network/axios.d.ts +8 -0
- package/dist/network/axios.js +49 -0
- package/dist/network/route.d.ts +9 -0
- package/dist/network/route.js +41 -0
- package/dist/service/CallService.d.ts +25 -0
- package/dist/service/CallService.js +225 -0
- package/dist/service/InitServices.d.ts +1 -0
- package/dist/service/InitServices.js +32 -0
- package/dist/service/UserServices.d.ts +1 -0
- package/dist/service/UserServices.js +22 -0
- package/dist/service/WebSocketService.d.ts +24 -0
- package/dist/service/WebSocketService.js +85 -0
- package/dist/service/ZegoServices.d.ts +19 -0
- package/dist/service/ZegoServices.js +216 -0
- package/dist/session/SessionManager.d.ts +36 -0
- package/dist/session/SessionManager.js +94 -0
- package/dist/types/types.d.ts +41 -0
- package/dist/types/types.js +2 -0
- package/dist/utils/Logger.d.ts +7 -0
- package/dist/utils/Logger.js +30 -0
- package/dist/utils/utils.d.ts +1 -0
- package/dist/utils/utils.js +7 -0
- package/package.json +27 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { CallInteractionCallback, CallSessionCallback } from './callbacks/callbacks';
|
|
2
|
+
import { MediaType } from './types/types';
|
|
3
|
+
declare class VyumiLiveCall {
|
|
4
|
+
/**
|
|
5
|
+
* Initializes the Vyumi Live Call SDK.
|
|
6
|
+
*
|
|
7
|
+
* This must be called once during application startup before
|
|
8
|
+
* invoking any other SDK functions. The Brand ID is provided
|
|
9
|
+
* by Vyumi and is required for SDK configuration and API access.
|
|
10
|
+
*
|
|
11
|
+
* Debug logs can optionally be enabled for development purposes.
|
|
12
|
+
* It is recommended to disable debug logs in production builds.
|
|
13
|
+
*
|
|
14
|
+
* @param brandId The unique Brand ID provided by Vyumi.
|
|
15
|
+
* @param debug Pass true to enable SDK debug logs, false to disable them.
|
|
16
|
+
*/
|
|
17
|
+
initialize(brandId: string, debug?: boolean): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Initiates an instant call request.
|
|
20
|
+
*
|
|
21
|
+
* This attempts to connect the customer with an available agent.
|
|
22
|
+
* Call session updates such as queue status, agent availability,
|
|
23
|
+
* room readiness, and call completion are delivered through the
|
|
24
|
+
* provided CallSessionCallback.
|
|
25
|
+
*
|
|
26
|
+
* @param payload Object containing customer information and call metadata.
|
|
27
|
+
* @param call_type Type of call to initiate (audio or video).
|
|
28
|
+
* @param sessionCallback Callback used to monitor call session events.
|
|
29
|
+
*/
|
|
30
|
+
initiateCall(payload: Record<string, any>, call_type: MediaType, sessionCallback: CallSessionCallback): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Joins the active call room.
|
|
33
|
+
*
|
|
34
|
+
* This must be called after receiving the room-ready event from
|
|
35
|
+
* the CallSessionCallback. The provided view handles are used
|
|
36
|
+
* to render the local and remote video streams.
|
|
37
|
+
*
|
|
38
|
+
* Microphone permission is required. Camera permission is also
|
|
39
|
+
* required when joining a video call.
|
|
40
|
+
*
|
|
41
|
+
* @param remoteViewHandle Native view handle used for rendering the remote participant's video stream.
|
|
42
|
+
* @param localViewHandle Native view handle used for rendering the local camera preview.
|
|
43
|
+
* @param interactionCallback Callback used to receive call interaction events.
|
|
44
|
+
*/
|
|
45
|
+
joinCall(remoteViewHandle: number, localViewHandle: number, interactionCallback: CallInteractionCallback): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Mutes or unmutes the microphone.
|
|
48
|
+
|
|
49
|
+
* Description: This function is used to control whether to use the collected audio data. Mute (turn off the microphone) will use the muted data to replace the audio data collected by the device for streaming. At this time, the microphone device will still be occupied.
|
|
50
|
+
* Default value: The default is `false`, which means no muting.
|
|
51
|
+
*
|
|
52
|
+
* @param mute Whether to mute (disable) the microphone, `true`: mute (disable) microphone, `false`: enable microphone.
|
|
53
|
+
*/
|
|
54
|
+
muteMicrophone(mute: boolean): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Switches to the front or the rear camera (for the specified channel).
|
|
57
|
+
* Default value: The default is `true` which means the front camera is used.
|
|
58
|
+
*
|
|
59
|
+
* @param enable `true`: use the front camera, `false`: use the the rear camera.
|
|
60
|
+
*/
|
|
61
|
+
flipCamera(flip: boolean): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Turns on/off the camera (for the specified channel).
|
|
64
|
+
*
|
|
65
|
+
* @param enable Whether to turn on the camera, `true`: turn on camera, `false`: turn off camera
|
|
66
|
+
*/
|
|
67
|
+
enableCamera(enable: boolean): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Mutes or unmutes the audio output speaker.
|
|
70
|
+
*
|
|
71
|
+
* Description: After mute speaker, all the SDK sounds will not play, including playing stream, mediaplayer, etc.
|
|
72
|
+
* Default value: The default is `false`, which means no muting.
|
|
73
|
+
*
|
|
74
|
+
* @param mute Whether to mute (disable) speaker audio output, `true`: mute (disable) speaker audio output, `false`: enable speaker audio output.
|
|
75
|
+
*/
|
|
76
|
+
muteSpeaker(mute: boolean): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* Sends a Message.
|
|
79
|
+
*
|
|
80
|
+
* @param message The content of the message. Required: Yes. Value range: The length does not exceed 1024 bytes.
|
|
81
|
+
|
|
82
|
+
*/
|
|
83
|
+
sendMessage(message: string): Promise<void>;
|
|
84
|
+
/**
|
|
85
|
+
* Ends the current active call session.
|
|
86
|
+
*
|
|
87
|
+
* This should always be called when the call screen is closed
|
|
88
|
+
* or when the conversation is finished to ensure that all
|
|
89
|
+
* resources are released properly.
|
|
90
|
+
*/
|
|
91
|
+
endCall(): Promise<void>;
|
|
92
|
+
/**
|
|
93
|
+
* Cancels an ongoing call request.
|
|
94
|
+
*
|
|
95
|
+
* This can be used while the customer is waiting for an
|
|
96
|
+
* available agent before the call room has been joined.
|
|
97
|
+
* Once cancelled, the call request is terminated and
|
|
98
|
+
* the customer is removed from the queue.
|
|
99
|
+
*/
|
|
100
|
+
cancelCall(): Promise<void>;
|
|
101
|
+
/**
|
|
102
|
+
* Fetches available time slots for scheduling calls.
|
|
103
|
+
*
|
|
104
|
+
* The response contains available dates and time slots
|
|
105
|
+
* along with the number of agents available for each slot.
|
|
106
|
+
*
|
|
107
|
+
* @param queryParams The customer's timezone (default: "Asia/Calcutta").
|
|
108
|
+
*/
|
|
109
|
+
getScheduleTimeSlots(queryParams: Record<string, any>): Promise<void>;
|
|
110
|
+
/**
|
|
111
|
+
* Schedules a call for a future time slot.
|
|
112
|
+
*
|
|
113
|
+
* The payload must contain required customer details such as
|
|
114
|
+
* name, mobile number, scheduled time (UTC), country code,
|
|
115
|
+
* WhatsApp subscription status, and timezone.
|
|
116
|
+
*
|
|
117
|
+
* @param payload JSONObject containing scheduling details.
|
|
118
|
+
*/
|
|
119
|
+
scheduleCall(payload: Record<string, any>): Promise<void>;
|
|
120
|
+
}
|
|
121
|
+
declare const vyumiLiveCall: VyumiLiveCall;
|
|
122
|
+
export default vyumiLiveCall;
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const CallService_1 = __importDefault(require("./service/CallService"));
|
|
16
|
+
const InitServices_1 = require("./service/InitServices");
|
|
17
|
+
const ZegoServices_1 = __importDefault(require("./service/ZegoServices"));
|
|
18
|
+
class VyumiLiveCall {
|
|
19
|
+
/**
|
|
20
|
+
* Initializes the Vyumi Live Call SDK.
|
|
21
|
+
*
|
|
22
|
+
* This must be called once during application startup before
|
|
23
|
+
* invoking any other SDK functions. The Brand ID is provided
|
|
24
|
+
* by Vyumi and is required for SDK configuration and API access.
|
|
25
|
+
*
|
|
26
|
+
* Debug logs can optionally be enabled for development purposes.
|
|
27
|
+
* It is recommended to disable debug logs in production builds.
|
|
28
|
+
*
|
|
29
|
+
* @param brandId The unique Brand ID provided by Vyumi.
|
|
30
|
+
* @param debug Pass true to enable SDK debug logs, false to disable them.
|
|
31
|
+
*/
|
|
32
|
+
initialize(brandId_1) {
|
|
33
|
+
return __awaiter(this, arguments, void 0, function* (brandId, debug = false) {
|
|
34
|
+
yield (0, InitServices_1.initializeVyumiService)(brandId, debug);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Initiates an instant call request.
|
|
39
|
+
*
|
|
40
|
+
* This attempts to connect the customer with an available agent.
|
|
41
|
+
* Call session updates such as queue status, agent availability,
|
|
42
|
+
* room readiness, and call completion are delivered through the
|
|
43
|
+
* provided CallSessionCallback.
|
|
44
|
+
*
|
|
45
|
+
* @param payload Object containing customer information and call metadata.
|
|
46
|
+
* @param call_type Type of call to initiate (audio or video).
|
|
47
|
+
* @param sessionCallback Callback used to monitor call session events.
|
|
48
|
+
*/
|
|
49
|
+
initiateCall(payload, call_type, sessionCallback) {
|
|
50
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
51
|
+
yield CallService_1.default.initiateCall(payload, call_type, sessionCallback);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Joins the active call room.
|
|
56
|
+
*
|
|
57
|
+
* This must be called after receiving the room-ready event from
|
|
58
|
+
* the CallSessionCallback. The provided view handles are used
|
|
59
|
+
* to render the local and remote video streams.
|
|
60
|
+
*
|
|
61
|
+
* Microphone permission is required. Camera permission is also
|
|
62
|
+
* required when joining a video call.
|
|
63
|
+
*
|
|
64
|
+
* @param remoteViewHandle Native view handle used for rendering the remote participant's video stream.
|
|
65
|
+
* @param localViewHandle Native view handle used for rendering the local camera preview.
|
|
66
|
+
* @param interactionCallback Callback used to receive call interaction events.
|
|
67
|
+
*/
|
|
68
|
+
joinCall(remoteViewHandle, localViewHandle, interactionCallback) {
|
|
69
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
yield CallService_1.default.joinCall({ remoteViewHandle, localViewHandle, interactionCallback });
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Mutes or unmutes the microphone.
|
|
75
|
+
|
|
76
|
+
* Description: This function is used to control whether to use the collected audio data. Mute (turn off the microphone) will use the muted data to replace the audio data collected by the device for streaming. At this time, the microphone device will still be occupied.
|
|
77
|
+
* Default value: The default is `false`, which means no muting.
|
|
78
|
+
*
|
|
79
|
+
* @param mute Whether to mute (disable) the microphone, `true`: mute (disable) microphone, `false`: enable microphone.
|
|
80
|
+
*/
|
|
81
|
+
muteMicrophone(mute) {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
83
|
+
yield ZegoServices_1.default.muteMicrophone(mute);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Switches to the front or the rear camera (for the specified channel).
|
|
88
|
+
* Default value: The default is `true` which means the front camera is used.
|
|
89
|
+
*
|
|
90
|
+
* @param enable `true`: use the front camera, `false`: use the the rear camera.
|
|
91
|
+
*/
|
|
92
|
+
flipCamera(flip) {
|
|
93
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
94
|
+
yield ZegoServices_1.default.flipCamera(flip);
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Turns on/off the camera (for the specified channel).
|
|
99
|
+
*
|
|
100
|
+
* @param enable Whether to turn on the camera, `true`: turn on camera, `false`: turn off camera
|
|
101
|
+
*/
|
|
102
|
+
enableCamera(enable) {
|
|
103
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
104
|
+
yield ZegoServices_1.default.enableCamera(enable);
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Mutes or unmutes the audio output speaker.
|
|
109
|
+
*
|
|
110
|
+
* Description: After mute speaker, all the SDK sounds will not play, including playing stream, mediaplayer, etc.
|
|
111
|
+
* Default value: The default is `false`, which means no muting.
|
|
112
|
+
*
|
|
113
|
+
* @param mute Whether to mute (disable) speaker audio output, `true`: mute (disable) speaker audio output, `false`: enable speaker audio output.
|
|
114
|
+
*/
|
|
115
|
+
muteSpeaker(mute) {
|
|
116
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
117
|
+
yield ZegoServices_1.default.muteSpeaker(mute);
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Sends a Message.
|
|
122
|
+
*
|
|
123
|
+
* @param message The content of the message. Required: Yes. Value range: The length does not exceed 1024 bytes.
|
|
124
|
+
|
|
125
|
+
*/
|
|
126
|
+
sendMessage(message) {
|
|
127
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
128
|
+
yield ZegoServices_1.default.sendMessage(message);
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Ends the current active call session.
|
|
133
|
+
*
|
|
134
|
+
* This should always be called when the call screen is closed
|
|
135
|
+
* or when the conversation is finished to ensure that all
|
|
136
|
+
* resources are released properly.
|
|
137
|
+
*/
|
|
138
|
+
endCall() {
|
|
139
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
140
|
+
yield CallService_1.default.endCall();
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Cancels an ongoing call request.
|
|
145
|
+
*
|
|
146
|
+
* This can be used while the customer is waiting for an
|
|
147
|
+
* available agent before the call room has been joined.
|
|
148
|
+
* Once cancelled, the call request is terminated and
|
|
149
|
+
* the customer is removed from the queue.
|
|
150
|
+
*/
|
|
151
|
+
cancelCall() {
|
|
152
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
153
|
+
yield CallService_1.default.cancelCall();
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Fetches available time slots for scheduling calls.
|
|
158
|
+
*
|
|
159
|
+
* The response contains available dates and time slots
|
|
160
|
+
* along with the number of agents available for each slot.
|
|
161
|
+
*
|
|
162
|
+
* @param queryParams The customer's timezone (default: "Asia/Calcutta").
|
|
163
|
+
*/
|
|
164
|
+
getScheduleTimeSlots(queryParams) {
|
|
165
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
166
|
+
yield CallService_1.default.getCallTimeSlots(queryParams);
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Schedules a call for a future time slot.
|
|
171
|
+
*
|
|
172
|
+
* The payload must contain required customer details such as
|
|
173
|
+
* name, mobile number, scheduled time (UTC), country code,
|
|
174
|
+
* WhatsApp subscription status, and timezone.
|
|
175
|
+
*
|
|
176
|
+
* @param payload JSONObject containing scheduling details.
|
|
177
|
+
*/
|
|
178
|
+
scheduleCall(payload) {
|
|
179
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
180
|
+
yield CallService_1.default.scheduleCall(payload);
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
const vyumiLiveCall = new VyumiLiveCall();
|
|
185
|
+
exports.default = vyumiLiveCall;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { Message } from '../types/types';
|
|
2
|
+
/**
|
|
3
|
+
* Callback interface for call session lifecycle events.
|
|
4
|
+
*
|
|
5
|
+
* Implement this interface to receive updates about agent assignment,
|
|
6
|
+
* queue status, room readiness, and session-related errors.
|
|
7
|
+
*/
|
|
8
|
+
export interface CallSessionCallback {
|
|
9
|
+
/**
|
|
10
|
+
* Called when the call room has been successfully created and is ready to join.
|
|
11
|
+
*
|
|
12
|
+
* Use this callback to update the UI and notify the user that the call
|
|
13
|
+
* session is ready.
|
|
14
|
+
*
|
|
15
|
+
* @param message Information about the room readiness state.
|
|
16
|
+
*/
|
|
17
|
+
onRoomReady: (message: string) => void;
|
|
18
|
+
/**
|
|
19
|
+
* Called when no agents are currently available to handle the call request.
|
|
20
|
+
*
|
|
21
|
+
* Implement this callback to show an appropriate message or retry option
|
|
22
|
+
* to the user.
|
|
23
|
+
*
|
|
24
|
+
* @param message Details about agent unavailability.
|
|
25
|
+
*/
|
|
26
|
+
onAgentNotAvailable: (message: string) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Called while the SDK is attempting to connect the user to an available agent.
|
|
29
|
+
*
|
|
30
|
+
* Use this callback to display a loading state or connection progress indicator.
|
|
31
|
+
*
|
|
32
|
+
* @param message Information about the current connection status.
|
|
33
|
+
*/
|
|
34
|
+
onConnectingToAgent: (message: string) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Called when an agent has been successfully assigned to the call.
|
|
37
|
+
*
|
|
38
|
+
* Implement this callback to update the UI and prepare for the call session.
|
|
39
|
+
*
|
|
40
|
+
* @param message Information about the assigned agent.
|
|
41
|
+
*/
|
|
42
|
+
onAgentAssigned: (message: string) => void;
|
|
43
|
+
/**
|
|
44
|
+
* Called whenever the user's position in the queue changes.
|
|
45
|
+
*
|
|
46
|
+
* Use this callback to display the latest queue position to the user.
|
|
47
|
+
*
|
|
48
|
+
* @param message Information about the queue update.
|
|
49
|
+
* @param queuePosition Current position of the user in the queue.
|
|
50
|
+
*/
|
|
51
|
+
onQueueUpdate: (message: string, queuePosition: number) => void;
|
|
52
|
+
/**
|
|
53
|
+
* Called when a session-related error occurs.
|
|
54
|
+
*
|
|
55
|
+
* Implement this callback to handle errors and display appropriate messages.
|
|
56
|
+
*
|
|
57
|
+
* @param message Error description.
|
|
58
|
+
*/
|
|
59
|
+
onError: (message: string) => void;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Callback interface for live call interaction events.
|
|
63
|
+
*
|
|
64
|
+
* Implement this interface to receive updates during an active call,
|
|
65
|
+
* such as messages, remote participant state changes, permissions,
|
|
66
|
+
* network quality, and call termination.
|
|
67
|
+
*/
|
|
68
|
+
export interface CallInteractionCallback {
|
|
69
|
+
/**
|
|
70
|
+
* Called when a new chat message is received during an active call.
|
|
71
|
+
*
|
|
72
|
+
* Use this callback to display incoming messages in the chat UI.
|
|
73
|
+
*
|
|
74
|
+
* @param message Received message object.
|
|
75
|
+
*/
|
|
76
|
+
onReceivingMessage: (message: Message) => void;
|
|
77
|
+
/**
|
|
78
|
+
* Called when the remote participant's microphone state changes.
|
|
79
|
+
*
|
|
80
|
+
* Use this callback to update microphone indicators in the UI.
|
|
81
|
+
*
|
|
82
|
+
* @param muted Indicates whether the remote microphone is muted.
|
|
83
|
+
*/
|
|
84
|
+
onRemoteMicUpdate: (muted: boolean) => void;
|
|
85
|
+
/**
|
|
86
|
+
* Called when the remote participant's camera state changes.
|
|
87
|
+
*
|
|
88
|
+
* Use this callback to show or hide the remote video stream,
|
|
89
|
+
* or update camera status indicators.
|
|
90
|
+
*
|
|
91
|
+
* @param enabled Indicates whether the remote camera is enabled.
|
|
92
|
+
*/
|
|
93
|
+
onRemoteCameraUpdate: (enabled: boolean) => void;
|
|
94
|
+
/**
|
|
95
|
+
* Called when the call has ended, either by the user,
|
|
96
|
+
* the agent, or due to a system event.
|
|
97
|
+
*
|
|
98
|
+
* Implement this callback to clean up resources and navigate
|
|
99
|
+
* the user away from the call screen.
|
|
100
|
+
*/
|
|
101
|
+
onCallEnded: () => void;
|
|
102
|
+
/**
|
|
103
|
+
* Called when a required permission (such as microphone or camera)
|
|
104
|
+
* is not granted by the user.
|
|
105
|
+
*
|
|
106
|
+
* This callback is optional.
|
|
107
|
+
*
|
|
108
|
+
* @param message Details about the missing permission.
|
|
109
|
+
*/
|
|
110
|
+
onPermissionError?: (message: string) => void;
|
|
111
|
+
/**
|
|
112
|
+
* Called when an error occurs during an active call session.
|
|
113
|
+
*
|
|
114
|
+
* Implement this callback to log errors and notify the user.
|
|
115
|
+
*
|
|
116
|
+
* @param message Error description.
|
|
117
|
+
*/
|
|
118
|
+
onError: (message: string) => void;
|
|
119
|
+
/**
|
|
120
|
+
* Called when the network quality of the connected agent changes.
|
|
121
|
+
*
|
|
122
|
+
* Use this callback to display network quality indicators
|
|
123
|
+
* and provide feedback about connection stability.
|
|
124
|
+
*
|
|
125
|
+
* @param quality Network quality value provided by the SDK.
|
|
126
|
+
*/
|
|
127
|
+
onAgentNetworkQuality: (quality: number) => void;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Simplified callback interface for applications that only need
|
|
131
|
+
* basic call lifecycle events.
|
|
132
|
+
*/
|
|
133
|
+
export interface VyumiLiveCallCallback {
|
|
134
|
+
/**
|
|
135
|
+
* Called when the call has ended.
|
|
136
|
+
*
|
|
137
|
+
* Implement this callback to perform cleanup and update the UI.
|
|
138
|
+
*/
|
|
139
|
+
onCallEnded: () => void;
|
|
140
|
+
/**
|
|
141
|
+
* Called when an unrecoverable error occurs.
|
|
142
|
+
*
|
|
143
|
+
* Implement this callback to display an error message
|
|
144
|
+
* or perform custom error handling.
|
|
145
|
+
*
|
|
146
|
+
* @param message Error description.
|
|
147
|
+
*/
|
|
148
|
+
onError: (message: string) => void;
|
|
149
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const API_BASE_URL = "https://api.vyumi.ai";
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.VyumiPrebuildCall = exports.VyumiLiveCall = void 0;
|
|
7
|
+
var VyumiLiveCall_1 = require("./VyumiLiveCall");
|
|
8
|
+
Object.defineProperty(exports, "VyumiLiveCall", { enumerable: true, get: function () { return __importDefault(VyumiLiveCall_1).default; } });
|
|
9
|
+
var index_1 = require("./kit/index");
|
|
10
|
+
Object.defineProperty(exports, "VyumiPrebuildCall", { enumerable: true, get: function () { return __importDefault(index_1).default; } });
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { VyumiLiveCallCallback } from '../callbacks/callbacks';
|
|
2
|
+
export interface ChatMessage {
|
|
3
|
+
id: string;
|
|
4
|
+
text: string;
|
|
5
|
+
from: 'user' | 'agent';
|
|
6
|
+
time: string;
|
|
7
|
+
name: string;
|
|
8
|
+
}
|
|
9
|
+
declare const VyumiPrebuildCall: React.FC<{
|
|
10
|
+
vyumiLiveCallCallBacks: VyumiLiveCallCallback;
|
|
11
|
+
}>;
|
|
12
|
+
export default VyumiPrebuildCall;
|