@vonage/client-sdk 1.2.1 → 1.3.0-alpha.1

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.
@@ -1,5 +1,6 @@
1
1
  import vonage from '../utils/vonage';
2
- import { Conversation, ConversationsPage, Member, MembersPage, PresentingOrder, OrderBy, ClientInitConfigObject, ClientConfigObject } from '../utils';
2
+ import { Conversation, ConversationsPage, Member, MembersPage, PresentingOrder, OrderBy, ClientInitConfigObject, ClientConfigObject, Json, CustomData } from '../utils';
3
+ import { Nullable } from '../kotlin/clientsdk-clientcore_js';
3
4
  import { ConversationEvent, PersistentConversationEvent } from '../kotlin/JsUnions';
4
5
  /**
5
6
  * The Vonage Client SDK for JS/TS provides a simple interface
@@ -37,14 +38,11 @@ export type CallSayParams = Partial<vonage.CallSayParams> & {
37
38
  };
38
39
  export type CallDisconnectReason = vonage.CallDisconnectReasonJS;
39
40
  export declare const CallDisconnectReason: typeof vonage.CallDisconnectReasonJS;
40
- type JSONValue = string | number | boolean | {
41
- [x: string]: JSONValue;
42
- } | JSONValue[];
43
- /**
44
- * @deprecated Use {@link ClientInitConfig.loggingLevel} instead.
45
- * @param level - The logging level to set.
46
- */
47
- export declare const setVonageClientLoggingLevel: typeof vonage.setDefaultLoggingLevel;
41
+ export type RtcStats = vonage.RTCStatsJS;
42
+ export type CreateConversationParameters = Omit<vonage.CreateConversationParametersJS, 'ttl' | 'customData'> & {
43
+ ttl?: Nullable<number>;
44
+ customData?: Nullable<CustomData>;
45
+ };
48
46
  /**
49
47
  * VonageClient is the main entry point for the Vonage Client SDK.
50
48
  *
@@ -72,7 +70,7 @@ export declare class VonageClient extends vonage.CombinedClientJS {
72
70
  * Register a callback for an event.
73
71
  *
74
72
  * @example
75
- * [[include: snippet_RegisterListener.txt]]
73
+ * [[include: snippet_OnConversationEventListener.txt]]
76
74
  *
77
75
  * @param event - the event to register for (e.g. 'legStatusUpdate')
78
76
  * @param callback - the callback to register for the event
@@ -99,7 +97,7 @@ export declare class VonageClient extends vonage.CombinedClientJS {
99
97
  * Clear all callbacks for an event.
100
98
  *
101
99
  * @example
102
- * [[include: snippet_Clear_Callbacks.txt]]
100
+ * [[include: snippet_ClearCallbacks.txt]]
103
101
  *
104
102
  * @param event - the event to unregister from (e.g. 'legStatusUpdate')
105
103
  * @returns void
@@ -154,7 +152,7 @@ export declare class VonageClient extends vonage.CombinedClientJS {
154
152
  * Hangup a call.
155
153
  *
156
154
  * @example
157
- * [[include: snippet_CallHangup.txt]]
155
+ * [[include: snippet_Hangup.txt]]
158
156
  *
159
157
  * @group Voice
160
158
  * @param callId - the `callId` of the call to hangup
@@ -176,7 +174,7 @@ export declare class VonageClient extends vonage.CombinedClientJS {
176
174
  * Sends a TTS message to the Call
177
175
  *
178
176
  * @example
179
- * [[include: snippet_CallSay.txt]]
177
+ * [[include: snippet_Say.txt]]
180
178
  *
181
179
  * @group Voice
182
180
  * @param callId - the `callId` of the call to send the message to
@@ -242,11 +240,11 @@ export declare class VonageClient extends vonage.CombinedClientJS {
242
240
  *
243
241
  * @group Chat
244
242
  * @beta
245
- * @param name - the name of the conversation
246
- * @param displayName - the display name of the conversation
243
+ * @param parameters - A [CreateConversationParameters] object containing the parameters for the creation request.
244
+ *
247
245
  * @returns the `cid` of the conversation
248
246
  */
249
- createConversation(name?: string, displayName?: string): Promise<string>;
247
+ createConversation(parameters?: Nullable<CreateConversationParameters>): Promise<string>;
250
248
  /**
251
249
  * Get a Conversation
252
250
  *
@@ -331,7 +329,20 @@ export declare class VonageClient extends vonage.CombinedClientJS {
331
329
  * @param customData - the body of the message
332
330
  * @returns the `timestamp` of the message
333
331
  */
334
- sendMessageCustomEvent(id: string, customData: JSONValue): Promise<string>;
332
+ sendMessageCustomEvent(id: string, customData: CustomData): Promise<string>;
333
+ /**
334
+ * Send a Image message to a Conversation.
335
+ *
336
+ * @example
337
+ * [[include: snippet_SendImageMessage.txt]]
338
+ *
339
+ * @group Chat
340
+ * @beta
341
+ * @param id - the Conversation's id
342
+ * @param imageUrl - the url of the image resource.
343
+ * @returns the `timestamp` of the message
344
+ */
345
+ sendMessageImageEvent(id: string, imageUrl: URL): Promise<string>;
335
346
  /**
336
347
  * Send an ephemeral event to a Conversation
337
348
  *
@@ -341,15 +352,15 @@ export declare class VonageClient extends vonage.CombinedClientJS {
341
352
  * @group Chat
342
353
  * @beta
343
354
  * @param id - the Conversation's id
344
- * @param customBody - the body of the event
355
+ * @param customData - the body of the event
345
356
  * @returns the `timestamp` of the message
346
357
  */
347
- sendEphemeralEvent(id: string, customBody: JSONValue): Promise<string>;
358
+ sendEphemeralEvent(id: string, customData: CustomData): Promise<string>;
348
359
  /**
349
360
  * Delete an Event in a Conversation
350
361
  *
351
362
  * @example
352
- * [[include:delete_event.txt]]
363
+ * [[include:snippet_DeleteEvent.txt]]
353
364
  *
354
365
  * @group Chat
355
366
  * @beta