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

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,13 +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
+ const includeCustomData = false;
204
204
  do {
205
205
  const response: ConversationsPage = await client.getConversations(
206
206
  PresentingOrder.ASC,
207
207
  pageSize,
208
208
  cursor,
209
- includeCustsomData
209
+ includeCustomData
210
210
  );
211
211
  conversations.push(...response.conversations);
212
212
  cursor = response.nextCursor;
@@ -249,6 +249,10 @@ client.on('conversationEvent', (event) => {
249
249
  case 'message:location':
250
250
  case 'message:template':
251
251
  case 'custom':
252
+ case 'ephemeral':
253
+ break;
254
+ default:
255
+ exhaustiveCheck(event);
252
256
  }
253
257
  const sender =
254
258
  event.from.kind == 'embeddedInfo' ? event.from.user.name : 'System';
@@ -1,5 +1,5 @@
1
1
  import vonage from '../utils/vonage';
2
- import { Conversation, ConversationsPage, Member, MembersPage, PresentingOrder, ConversationEvent } from '../utils';
2
+ import { Conversation, ConversationsPage, Member, MembersPage, PresentingOrder, ConversationEvent, PersistentConversationEvent } 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.
@@ -13,11 +13,14 @@ import { Conversation, ConversationsPage, Member, MembersPage, PresentingOrder,
13
13
  */
14
14
  export * from '../utils';
15
15
  export interface EventsPage extends vonage.EventsPageJS {
16
- events: ConversationEvent[];
16
+ events: PersistentConversationEvent[];
17
17
  }
18
18
  interface VonageEvent extends vonage.CombinedEvents {
19
19
  conversationEvent: (event: ConversationEvent) => void;
20
20
  }
21
+ type EventPage = vonage.EventsPageJS & {
22
+ events: PersistentConversationEvent[];
23
+ };
21
24
  export type RTCQuality = vonage.RTCQualityJS;
22
25
  export type CancelReason = vonage.CancelReasonJS;
23
26
  export declare const CancelReason: typeof vonage.CancelReasonJS;
@@ -31,6 +34,8 @@ export declare const LegStatus: typeof vonage.LegStatusJS;
31
34
  export type CallSayParams = Partial<vonage.CallSayParams> & {
32
35
  text: string;
33
36
  };
37
+ export type CallDisconnectReason = vonage.CallDisconnectReasonJS;
38
+ export declare const CallDisconnectReason: typeof vonage.CallDisconnectReasonJS;
34
39
  type JSONValue = string | number | boolean | {
35
40
  [x: string]: JSONValue;
36
41
  } | JSONValue[];
@@ -190,13 +195,14 @@ export declare class VonageClient extends vonage.CombinedClientJS {
190
195
  * @param order - the order to return the events in (default: 'asc')
191
196
  * @param pageSize - the number of events to return per page (default: 100)
192
197
  * @param cursor - the cursor to use for pagination (default: null)
198
+ * @param eventFilter - the event types to filter by (default: null)
193
199
  * @returns a `EventsPage` containing the events
194
200
  *
195
201
  * @privateRemarks
196
202
  * * This is a workaround for the to ensure exhaustiveness of the `ConversationEvent` type
197
203
  * * the kotlin core does not support union types
198
204
  */
199
- getConversationEvents(id: string, order?: PresentingOrder, pageSize?: number, cursor?: string | null, eventFilter?: string[] | null): Promise<EventsPage>;
205
+ getConversationEvents(id: string, order?: PresentingOrder, pageSize?: number, cursor?: string | null, eventFilter?: string[] | null): Promise<EventPage>;
200
206
  /**
201
207
  * Get a Conversation's Members
202
208
  *
@@ -310,6 +316,19 @@ export declare class VonageClient extends vonage.CombinedClientJS {
310
316
  * @returns the `timestamp` of the message
311
317
  */
312
318
  sendCustomMessage(id: string, customData: JSONValue): Promise<string>;
319
+ /**
320
+ * Send an ephemeral event to a Conversation
321
+ *
322
+ * @example
323
+ * [[include:send_ephemeral_event.txt]]
324
+ *
325
+ * @group Chat
326
+ * @beta
327
+ * @param id - the Conversation's id
328
+ * @param customBody - the body of the event
329
+ * @returns the `timestamp` of the message
330
+ */
331
+ sendEphemeralEvent(id: string, customBody: JSONValue): Promise<string>;
313
332
  /**
314
333
  * Get a Member of a Conversation
315
334
  *