@vonage/client-sdk 1.2.0-alpha.11 → 1.2.0-alpha.13
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 +6 -2
- package/dist/client/VonageClient.d.ts +20 -3
- package/dist/client/index.cjs +11687 -11204
- package/dist/client/index.mjs +11688 -11204
- package/dist/kotlin/{ConversationEvents.d.ts → JsUnions.d.ts} +163 -98
- package/dist/kotlin/clientsdk-clientcore_js.d.ts +78 -40
- package/dist/utils/index.d.ts +1 -1
- package/dist/vonageClientSDK.js +11238 -10739
- package/dist/vonageClientSDK.min.js +1 -1
- package/dist/vonageClientSDK.min.mjs +1 -1
- package/dist/vonageClientSDK.mjs +11239 -10739
- package/package.json +1 -1
- package/dist/kotlin/From.d.ts +0 -26
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
|
|
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
|
-
|
|
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:
|
|
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;
|
|
@@ -192,13 +195,14 @@ export declare class VonageClient extends vonage.CombinedClientJS {
|
|
|
192
195
|
* @param order - the order to return the events in (default: 'asc')
|
|
193
196
|
* @param pageSize - the number of events to return per page (default: 100)
|
|
194
197
|
* @param cursor - the cursor to use for pagination (default: null)
|
|
198
|
+
* @param eventFilter - the event types to filter by (default: null)
|
|
195
199
|
* @returns a `EventsPage` containing the events
|
|
196
200
|
*
|
|
197
201
|
* @privateRemarks
|
|
198
202
|
* * This is a workaround for the to ensure exhaustiveness of the `ConversationEvent` type
|
|
199
203
|
* * the kotlin core does not support union types
|
|
200
204
|
*/
|
|
201
|
-
getConversationEvents(id: string, order?: PresentingOrder, pageSize?: number, cursor?: string | null, eventFilter?: string[] | null): Promise<
|
|
205
|
+
getConversationEvents(id: string, order?: PresentingOrder, pageSize?: number, cursor?: string | null, eventFilter?: string[] | null): Promise<EventPage>;
|
|
202
206
|
/**
|
|
203
207
|
* Get a Conversation's Members
|
|
204
208
|
*
|
|
@@ -312,6 +316,19 @@ export declare class VonageClient extends vonage.CombinedClientJS {
|
|
|
312
316
|
* @returns the `timestamp` of the message
|
|
313
317
|
*/
|
|
314
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>;
|
|
315
332
|
/**
|
|
316
333
|
* Get a Member of a Conversation
|
|
317
334
|
*
|