@vonage/client-sdk 1.2.0-alpha.12 → 1.2.0-alpha.14
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 +10 -14
- package/dist/client/VonageClient.d.ts +4 -4
- package/dist/client/index.cjs +8576 -8260
- package/dist/client/index.mjs +8576 -8261
- package/dist/kotlin/JsUnions.d.ts +113 -113
- package/dist/kotlin/clientsdk-clientcore_js.d.ts +61 -38
- package/dist/utils/ConversationModels.d.ts +2 -0
- package/dist/vonageClientSDK.js +8583 -8267
- package/dist/vonageClientSDK.min.js +1 -1
- package/dist/vonageClientSDK.min.mjs +1 -1
- package/dist/vonageClientSDK.mjs +8583 -8268
- package/package.json +1 -1
- package/dist/utils/ConversationMessageModels.d.ts +0 -5
package/README.md
CHANGED
|
@@ -160,32 +160,26 @@ client.on(
|
|
|
160
160
|
// await client.hangup(call);
|
|
161
161
|
await client.hangup(call, 'reason-text', 'reason-code');
|
|
162
162
|
|
|
163
|
-
client.on('callHangup', async (callId: string, callQuality: RTCQuality) => {
|
|
164
|
-
if (callId == call) {
|
|
165
|
-
console.log(`Call ${callId} has hanged up, callQuality:${callQuality}`);
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
|
|
169
163
|
client.on('callHangup', (callId, callQuality, reason) => {
|
|
170
164
|
if (callId == call) {
|
|
171
165
|
console.log('The call has finished');
|
|
172
166
|
}
|
|
173
|
-
console.log(`
|
|
167
|
+
console.log(`This was your call MOS score: `, callQuality.mos_score);
|
|
174
168
|
const reason_name = reason.name;
|
|
175
169
|
if (reason_name === 'LOCAL_HANGUP') {
|
|
176
|
-
console.log('
|
|
170
|
+
console.log('You hung up the call');
|
|
177
171
|
return;
|
|
178
172
|
} else if (reason_name === 'REMOTE_HANGUP') {
|
|
179
|
-
console.log('
|
|
173
|
+
console.log('Call was hung up remotely');
|
|
180
174
|
return;
|
|
181
175
|
} else if (reason_name === 'REMOTE_REJECT') {
|
|
182
|
-
console.log('
|
|
176
|
+
console.log('Call was rejected');
|
|
183
177
|
return;
|
|
184
178
|
} else if (reason_name === 'MEDIA_TIMEOUT') {
|
|
185
|
-
console.log('media
|
|
179
|
+
console.log('Timeout due to media failure');
|
|
186
180
|
return;
|
|
187
181
|
} else if (reason_name === 'REMOTE_NO_ANSWER_TIMEOUT') {
|
|
188
|
-
console.log('remote
|
|
182
|
+
console.log('Timeout due to missing remote answer');
|
|
189
183
|
return;
|
|
190
184
|
} else {
|
|
191
185
|
return exhaustiveCheck(reason_name);
|
|
@@ -201,12 +195,14 @@ try {
|
|
|
201
195
|
const pageSize = 10;
|
|
202
196
|
const conversations: Conversation[] = [];
|
|
203
197
|
const includeCustomData = false;
|
|
198
|
+
const orderBy = OrderBy.CREATED;
|
|
204
199
|
do {
|
|
205
200
|
const response: ConversationsPage = await client.getConversations(
|
|
206
201
|
PresentingOrder.ASC,
|
|
207
202
|
pageSize,
|
|
208
203
|
cursor,
|
|
209
|
-
includeCustomData
|
|
204
|
+
includeCustomData,
|
|
205
|
+
orderBy
|
|
210
206
|
);
|
|
211
207
|
conversations.push(...response.conversations);
|
|
212
208
|
cursor = response.nextCursor;
|
|
@@ -221,7 +217,7 @@ try {
|
|
|
221
217
|
|
|
222
218
|
```ts
|
|
223
219
|
try {
|
|
224
|
-
const timestamp = await client.
|
|
220
|
+
const timestamp = await client.sendMessageTextEvent(
|
|
225
221
|
'conversationId',
|
|
226
222
|
'Hello there'
|
|
227
223
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import vonage from '../utils/vonage';
|
|
2
|
-
import { Conversation, ConversationsPage, Member, MembersPage, PresentingOrder, ConversationEvent, PersistentConversationEvent } from '../utils';
|
|
2
|
+
import { Conversation, ConversationsPage, Member, MembersPage, PresentingOrder, ConversationEvent, PersistentConversationEvent, OrderBy } from '../utils';
|
|
3
3
|
/**
|
|
4
4
|
* The Vonage Client SDK for JS/TS provides a simple interface
|
|
5
5
|
* For the Vonage Voice and Messaging APIs.
|
|
@@ -182,7 +182,7 @@ export declare class VonageClient extends vonage.CombinedClientJS {
|
|
|
182
182
|
* @param cursor - the cursor to use for pagination (default: null)
|
|
183
183
|
* @returns a `ConversationsPage` containing the conversations
|
|
184
184
|
*/
|
|
185
|
-
getConversations(order?: PresentingOrder, pageSize?: number, cursor?: string | null, includeCustomData?: boolean): Promise<ConversationsPage>;
|
|
185
|
+
getConversations(order?: PresentingOrder, pageSize?: number, cursor?: string | null, includeCustomData?: boolean, orderBy?: OrderBy | null): Promise<ConversationsPage>;
|
|
186
186
|
/**
|
|
187
187
|
* Get a Conversation's Events
|
|
188
188
|
*
|
|
@@ -302,7 +302,7 @@ export declare class VonageClient extends vonage.CombinedClientJS {
|
|
|
302
302
|
* @param text - the Body of the message
|
|
303
303
|
* @returns the `timestamp` of the message
|
|
304
304
|
*/
|
|
305
|
-
|
|
305
|
+
sendMessageTextEvent(id: string, text: string): Promise<string>;
|
|
306
306
|
/**
|
|
307
307
|
* Send a custom message to a Conversation
|
|
308
308
|
*
|
|
@@ -315,7 +315,7 @@ export declare class VonageClient extends vonage.CombinedClientJS {
|
|
|
315
315
|
* @param customData - the body of the message
|
|
316
316
|
* @returns the `timestamp` of the message
|
|
317
317
|
*/
|
|
318
|
-
|
|
318
|
+
sendMessageCustomEvent(id: string, customData: JSONValue): Promise<string>;
|
|
319
319
|
/**
|
|
320
320
|
* Send an ephemeral event to a Conversation
|
|
321
321
|
*
|