@vonage/client-sdk 1.2.0-alpha.0 → 1.2.0-alpha.10

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
@@ -200,11 +200,13 @@ try {
200
200
  let cursor: string | undefined | null = undefined;
201
201
  const pageSize = 10;
202
202
  const conversations: Conversation[] = [];
203
+ const includeCustsomData = false;
203
204
  do {
204
205
  const response: ConversationsPage = await client.getConversations(
205
206
  PresentingOrder.ASC,
206
207
  pageSize,
207
- cursor
208
+ cursor,
209
+ includeCustsomData
208
210
  );
209
211
  conversations.push(...response.conversations);
210
212
  cursor = response.nextCursor;
@@ -233,21 +235,26 @@ try {
233
235
 
234
236
  ```ts
235
237
  client.on('conversationEvent', (event) => {
236
- if (event.kind == 'member:invited') {
237
- return;
238
- }
239
- if (event.kind == 'member:joined') {
240
- return;
241
- }
242
- if (event.kind == 'member:left') {
243
- return;
244
- }
245
- if (event.kind == 'message:text') {
246
- return;
247
- }
248
- if (event.kind == 'message:custom') {
249
- return;
238
+ switch (event.kind) {
239
+ case 'member:invited':
240
+ case 'member:joined':
241
+ case 'member:left':
242
+ case 'message:text':
243
+ case 'message:custom':
244
+ case 'message:audio':
245
+ case 'message:video':
246
+ case 'message:image':
247
+ case 'message:file':
248
+ case 'message:vcard':
249
+ case 'message:location':
250
+ case 'message:template':
251
+ case 'custom':
250
252
  }
253
+ const sender =
254
+ event.from.kind == 'embeddedInfo' ? event.from.user.name : 'System';
255
+ console.log(
256
+ `${sender} sent ${event.kind} event to Conversation ${event.conversationId}`
257
+ );
251
258
  });
252
259
  ```
253
260
 
@@ -177,7 +177,7 @@ export declare class VonageClient extends vonage.CombinedClientJS {
177
177
  * @param cursor - the cursor to use for pagination (default: null)
178
178
  * @returns a `ConversationsPage` containing the conversations
179
179
  */
180
- getConversations(order?: PresentingOrder, pageSize?: number, cursor?: string | null): Promise<ConversationsPage>;
180
+ getConversations(order?: PresentingOrder, pageSize?: number, cursor?: string | null, includeCustomData?: boolean): Promise<ConversationsPage>;
181
181
  /**
182
182
  * Get a Conversation's Events
183
183
  *
@@ -196,7 +196,7 @@ export declare class VonageClient extends vonage.CombinedClientJS {
196
196
  * * This is a workaround for the to ensure exhaustiveness of the `ConversationEvent` type
197
197
  * * the kotlin core does not support union types
198
198
  */
199
- getConversationEvents(id: string, order?: PresentingOrder, pageSize?: number, cursor?: string | null): Promise<EventsPage>;
199
+ getConversationEvents(id: string, order?: PresentingOrder, pageSize?: number, cursor?: string | null, eventFilter?: string[] | null): Promise<EventsPage>;
200
200
  /**
201
201
  * Get a Conversation's Members
202
202
  *