@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 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(`this was your call mos score: `, callQuality.mos_score);
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('you hangup the call');
170
+ console.log('You hung up the call');
177
171
  return;
178
172
  } else if (reason_name === 'REMOTE_HANGUP') {
179
- console.log('call was hanged up remotly');
173
+ console.log('Call was hung up remotely');
180
174
  return;
181
175
  } else if (reason_name === 'REMOTE_REJECT') {
182
- console.log('call was rejected');
176
+ console.log('Call was rejected');
183
177
  return;
184
178
  } else if (reason_name === 'MEDIA_TIMEOUT') {
185
- console.log('media timeout');
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 no answer timeout');
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.sendTextMessage(
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
- sendTextMessage(id: string, text: string): Promise<string>;
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
- sendCustomMessage(id: string, customData: JSONValue): Promise<string>;
318
+ sendMessageCustomEvent(id: string, customData: JSONValue): Promise<string>;
319
319
  /**
320
320
  * Send an ephemeral event to a Conversation
321
321
  *