@vonage/client-sdk 1.3.0-alpha.2 → 1.3.0-alpha.4
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 +9 -6
- package/api_docs/ts/assets/navigation.js +1 -1
- package/api_docs/ts/assets/search.js +1 -1
- package/api_docs/ts/classes/ClientConfig.html +7 -205
- package/api_docs/ts/classes/ClientInitConfig.html +4 -148
- package/api_docs/ts/classes/VonageClient.html +232 -1102
- package/api_docs/ts/functions/setDefaultLoggingLevel.html +3 -76
- package/api_docs/ts/functions/setVonageClientLoggingLevel.html +3 -76
- package/api_docs/ts/index.html +2 -86
- package/api_docs/ts/interfaces/ConversationEvent.html +4 -108
- package/api_docs/ts/interfaces/ConversationState.html +122 -1125
- package/api_docs/ts/interfaces/CustomConversationEvent.html +12 -173
- package/api_docs/ts/interfaces/EmbeddedInfo.html +7 -125
- package/api_docs/ts/interfaces/EphemeralConversationEvent.html +10 -153
- package/api_docs/ts/interfaces/EventDeleteConversationEvent.html +15 -0
- package/api_docs/ts/interfaces/From.html +3 -96
- package/api_docs/ts/interfaces/Location.html +5 -0
- package/api_docs/ts/interfaces/MemberInvitedEvent.html +11 -163
- package/api_docs/ts/interfaces/MemberJoinedEvent.html +11 -163
- package/api_docs/ts/interfaces/MemberLeftEvent.html +11 -163
- package/api_docs/ts/interfaces/MemberState.html +122 -1125
- package/api_docs/ts/interfaces/MessageAudioEvent.html +11 -163
- package/api_docs/ts/interfaces/MessageCustomEvent.html +11 -163
- package/api_docs/ts/interfaces/MessageFileEvent.html +11 -163
- package/api_docs/ts/interfaces/MessageImageEvent.html +11 -163
- package/api_docs/ts/interfaces/MessageLocationEvent.html +11 -163
- package/api_docs/ts/interfaces/MessageTemplateEvent.html +11 -163
- package/api_docs/ts/interfaces/MessageTextEvent.html +11 -163
- package/api_docs/ts/interfaces/MessageVCardEvent.html +11 -163
- package/api_docs/ts/interfaces/MessageVideoEvent.html +11 -163
- package/api_docs/ts/interfaces/NonPersistentConversationEvent.html +5 -138
- package/api_docs/ts/interfaces/PersistentConversationEvent.html +4 -112
- package/api_docs/ts/interfaces/System.html +5 -133
- package/api_docs/ts/interfaces/Template.html +3 -0
- package/api_docs/ts/interfaces/Whatsapp.html +3 -0
- package/api_docs/ts/modules.html +9 -127
- package/api_docs/ts/types/CustomData.html +2 -64
- package/dist/client/VonageClient.d.ts +146 -17
- package/dist/client/index.cjs +20242 -18998
- package/dist/client/index.mjs +20242 -18998
- package/dist/kotlin/JsUnions.d.ts +17 -2
- package/dist/kotlin/clientsdk-clientcore_js.d.ts +79 -77
- package/dist/utils/ConversationModels.d.ts +18 -1
- package/dist/utils/RequestParameterModels.d.ts +17 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/vonageClientSDK.js +19935 -18726
- package/dist/vonageClientSDK.min.js +1 -1
- package/dist/vonageClientSDK.min.mjs +1 -1
- package/dist/vonageClientSDK.mjs +19935 -18726
- package/package.json +3 -2
- package/scripts/replaceAllDoNotUseOrImplement.js +25 -0
- package/typedoc.json +40 -0
- package/api_docs/ts/functions/convertInitConfig.html +0 -70
- package/api_docs/ts/functions/createVonageLogger.html +0 -91
- package/api_docs/ts/interfaces/EventsPage.html +0 -109
- package/api_docs/ts/types/CallDisconnectReason.html +0 -61
- package/api_docs/ts/types/CallSayParams.html +0 -66
- package/api_docs/ts/types/CancelReason.html +0 -61
- package/api_docs/ts/types/ChannelType.html +0 -61
- package/api_docs/ts/types/ClientConfigObject.html +0 -61
- package/api_docs/ts/types/ClientInitConfigObject.html +0 -61
- package/api_docs/ts/types/ConfigRegion.html +0 -61
- package/api_docs/ts/types/Conversation.html +0 -68
- package/api_docs/ts/types/ConversationsPage.html +0 -66
- package/api_docs/ts/types/CreateConversationParameters.html +0 -68
- package/api_docs/ts/types/HangupReason.html +0 -61
- package/api_docs/ts/types/Json.html +0 -66
- package/api_docs/ts/types/JsonValue.html +0 -61
- package/api_docs/ts/types/Leg.html +0 -61
- package/api_docs/ts/types/LegStatus.html +0 -61
- package/api_docs/ts/types/LoggingLevel.html +0 -61
- package/api_docs/ts/types/Member.html +0 -66
- package/api_docs/ts/types/MembersPage.html +0 -66
- package/api_docs/ts/types/OrderBy.html +0 -61
- package/api_docs/ts/types/PresentingOrder.html +0 -61
- package/api_docs/ts/types/RTCQuality.html +0 -61
- package/api_docs/ts/types/RtcStats.html +0 -61
- package/api_docs/ts/types/SessionErrorReason.html +0 -61
- package/api_docs/ts/types/Topic.html +0 -61
- package/api_docs/ts/types/Topics.html +0 -61
- package/api_docs/ts/types/User.html +0 -61
- package/api_docs/ts/types/VonageError.html +0 -61
- package/api_docs/ts/types/VonageErrorType.html +0 -61
- package/api_docs/ts/types/VonageLogger.html +0 -61
- package/api_docs/ts/variables/CSErrorCodes.html +0 -82
- package/api_docs/ts/variables/CallDisconnectReason-1.html +0 -61
- package/api_docs/ts/variables/CancelReason-1.html +0 -61
- package/api_docs/ts/variables/ChannelType-1.html +0 -61
- package/api_docs/ts/variables/ConfigRegion-1.html +0 -61
- package/api_docs/ts/variables/HangupReason-1.html +0 -61
- package/api_docs/ts/variables/LegStatus-1.html +0 -61
- package/api_docs/ts/variables/LoggingLevel-1.html +0 -61
- package/api_docs/ts/variables/OrderBy-1.html +0 -61
- package/api_docs/ts/variables/PresentingOrder-1.html +0 -61
- package/api_docs/ts/variables/SessionErrorCodes.html +0 -96
- package/api_docs/ts/variables/SessionErrorReason-1.html +0 -61
- package/api_docs/ts/variables/Topic-1.html +0 -61
- package/api_docs/ts/variables/Topics-1.html +0 -61
- package/api_docs/ts/variables/VonageError-1.html +0 -61
- package/api_docs/ts/variables/VonageErrorType-1.html +0 -61
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import vonage from '../utils/vonage';
|
|
2
|
-
import { Conversation, ConversationsPage, Member, MembersPage, PresentingOrder,
|
|
2
|
+
import { Conversation, ConversationsPage, EventsPage, Member, MembersPage, PresentingOrder, ClientInitConfigObject, ClientConfigObject, Json, CustomData, Location, Template, Whatsapp, CreateConversationParameters, GetConversationsParameters, OrderBy, GetConversationEventsParameters, GetConversationMembersParameters } from '../utils';
|
|
3
3
|
import { Nullable } from '../kotlin/clientsdk-clientcore_js';
|
|
4
|
-
import { ConversationEvent
|
|
4
|
+
import { ConversationEvent } from '../kotlin/JsUnions';
|
|
5
5
|
/**
|
|
6
6
|
* The Vonage Client SDK for JS/TS provides a simple interface
|
|
7
7
|
* For the Vonage Voice and Messaging APIs.
|
|
@@ -14,15 +14,9 @@ import { ConversationEvent, PersistentConversationEvent } from '../kotlin/JsUnio
|
|
|
14
14
|
* @packageDocumentation
|
|
15
15
|
*/
|
|
16
16
|
export * from '../utils';
|
|
17
|
-
export interface EventsPage extends vonage.EventsPageJS {
|
|
18
|
-
events: PersistentConversationEvent[];
|
|
19
|
-
}
|
|
20
17
|
interface VonageEvent extends vonage.CombinedEvents {
|
|
21
18
|
conversationEvent: (event: ConversationEvent) => void;
|
|
22
19
|
}
|
|
23
|
-
type EventPage = vonage.EventsPageJS & {
|
|
24
|
-
events: PersistentConversationEvent[];
|
|
25
|
-
};
|
|
26
20
|
export type RTCQuality = vonage.RTCQualityJS;
|
|
27
21
|
export type CancelReason = vonage.CancelReasonJS;
|
|
28
22
|
export declare const CancelReason: typeof vonage.CancelReasonJS;
|
|
@@ -39,10 +33,6 @@ export type CallSayParams = Partial<vonage.CallSayParams> & {
|
|
|
39
33
|
export type CallDisconnectReason = vonage.CallDisconnectReasonJS;
|
|
40
34
|
export declare const CallDisconnectReason: typeof vonage.CallDisconnectReasonJS;
|
|
41
35
|
export type RtcStats = vonage.RTCStatsJS;
|
|
42
|
-
export type CreateConversationParameters = Omit<vonage.CreateConversationParametersJS, 'ttl' | 'customData'> & {
|
|
43
|
-
ttl?: Nullable<number>;
|
|
44
|
-
customData?: Nullable<CustomData>;
|
|
45
|
-
};
|
|
46
36
|
/**
|
|
47
37
|
* VonageClient is the main entry point for the Vonage Client SDK.
|
|
48
38
|
*
|
|
@@ -190,9 +180,21 @@ export declare class VonageClient extends vonage.CombinedClientJS {
|
|
|
190
180
|
*
|
|
191
181
|
* @group Chat
|
|
192
182
|
* @beta
|
|
183
|
+
* @param parameters - A {@link GetConversationsParameters} object containing the parameters for the request.
|
|
184
|
+
* @returns a `ConversationsPage` containing the conversations
|
|
185
|
+
*/
|
|
186
|
+
getConversations(parameters?: Nullable<GetConversationsParameters>): Promise<ConversationsPage>;
|
|
187
|
+
/**
|
|
188
|
+
* Get a list of Conversations for the user.
|
|
189
|
+
*
|
|
190
|
+
* @deprecated Use {@link getConversations(parameters)} instead.
|
|
191
|
+
* @group Chat
|
|
192
|
+
* @beta
|
|
193
193
|
* @param order - the order to return the conversations in (default: 'asc')
|
|
194
194
|
* @param pageSize - the number of conversations to return per page (default: 100)
|
|
195
195
|
* @param cursor - the cursor to use for pagination (default: null)
|
|
196
|
+
* @param includeCustomData - include custom data (default: false)
|
|
197
|
+
* @param orderBy - order by strategy (default: null)
|
|
196
198
|
* @returns a `ConversationsPage` containing the conversations
|
|
197
199
|
*/
|
|
198
200
|
getConversations(order?: PresentingOrder, pageSize?: number, cursor?: string | null, includeCustomData?: boolean, orderBy?: OrderBy | null): Promise<ConversationsPage>;
|
|
@@ -205,18 +207,30 @@ export declare class VonageClient extends vonage.CombinedClientJS {
|
|
|
205
207
|
* @group Chat
|
|
206
208
|
* @beta
|
|
207
209
|
* @param id - the Conversation's id
|
|
210
|
+
* @param parameters - A {@link GetConversationEventsParameters} object containing the parameters for the request.
|
|
211
|
+
* @returns a {@link EventsPage} containing the events
|
|
212
|
+
*/
|
|
213
|
+
getConversationEvents(id: string, parameters?: Nullable<GetConversationEventsParameters>): Promise<EventsPage>;
|
|
214
|
+
/**
|
|
215
|
+
* Get a Conversation's Events
|
|
216
|
+
*
|
|
217
|
+
* @deprecated Use {@link getConversationEvents(id, parameters)} instead.
|
|
218
|
+
* @group Chat
|
|
219
|
+
* @beta
|
|
220
|
+
* @param id - the Conversation's id
|
|
208
221
|
* @param order - the order to return the events in (default: 'asc')
|
|
209
222
|
* @param pageSize - the number of events to return per page (default: 100)
|
|
210
223
|
* @param cursor - the cursor to use for pagination (default: null)
|
|
211
224
|
* @param eventFilter - the event types to filter by (default: null)
|
|
212
225
|
* @param includeDeletedEvents - A boolean, which when sent as true, will include `deletedEvents` in the list, default is false
|
|
213
|
-
* @
|
|
226
|
+
* @param startId - A number, the starting id of the events to be returned (default: null)
|
|
227
|
+
* @returns a {@link EventsPage} containing the events
|
|
214
228
|
*
|
|
215
229
|
* @privateRemarks
|
|
216
230
|
* * This is a workaround for the to ensure exhaustiveness of the `ConversationEvent` type
|
|
217
231
|
* * the kotlin core does not support union types
|
|
218
232
|
*/
|
|
219
|
-
getConversationEvents(id: string, order?: PresentingOrder, pageSize?: number, cursor?: string | null, eventFilter?: string[] | null, includeDeletedEvents?: boolean): Promise<
|
|
233
|
+
getConversationEvents(id: string, order?: PresentingOrder, pageSize?: number, cursor?: string | null, eventFilter?: string[] | null, includeDeletedEvents?: boolean, startId?: number): Promise<EventsPage>;
|
|
220
234
|
/**
|
|
221
235
|
* Get a Conversation's Members
|
|
222
236
|
*
|
|
@@ -226,6 +240,17 @@ export declare class VonageClient extends vonage.CombinedClientJS {
|
|
|
226
240
|
* @group Chat
|
|
227
241
|
* @beta
|
|
228
242
|
* @param id - the Conversation's id
|
|
243
|
+
* @param parameters - A {@link GetConversationMembersParameters} object containing the parameters for the request.
|
|
244
|
+
* @returns a `MembersPage` containing the members
|
|
245
|
+
*/
|
|
246
|
+
getConversationMembers(id: string, parameters?: Nullable<GetConversationMembersParameters>): Promise<MembersPage>;
|
|
247
|
+
/**
|
|
248
|
+
* Get a Conversation's Members
|
|
249
|
+
*
|
|
250
|
+
* @deprecated Use {@link getConversationMembers(id, parameters)} instead.
|
|
251
|
+
* @group Chat
|
|
252
|
+
* @beta
|
|
253
|
+
* @param id - the Conversation's id
|
|
229
254
|
* @param order - the order to return the members in (default: 'asc')
|
|
230
255
|
* @param pageSize - the number of members to return per page (default: 100)
|
|
231
256
|
* @param cursor - the cursor to use for pagination (default: null)
|
|
@@ -240,21 +265,32 @@ export declare class VonageClient extends vonage.CombinedClientJS {
|
|
|
240
265
|
*
|
|
241
266
|
* @group Chat
|
|
242
267
|
* @beta
|
|
243
|
-
* @param parameters - A
|
|
268
|
+
* @param parameters - A {@link CreateConversationParameters} object containing the parameters for the creation request.
|
|
244
269
|
*
|
|
245
270
|
* @returns the `cid` of the conversation
|
|
246
271
|
*/
|
|
247
272
|
createConversation(parameters?: Nullable<CreateConversationParameters>): Promise<string>;
|
|
273
|
+
/**
|
|
274
|
+
* Create a conversation
|
|
275
|
+
*
|
|
276
|
+
* @deprecated Use {@link createConversation(parameters)} instead.
|
|
277
|
+
* @group Chat
|
|
278
|
+
* @beta
|
|
279
|
+
* @param name - the name of the conversation
|
|
280
|
+
* @param displayName - the display name of the conversation
|
|
281
|
+
* @returns the `cid` of the conversation
|
|
282
|
+
*/
|
|
283
|
+
createConversation(name?: string, displayName?: string): Promise<string>;
|
|
248
284
|
/**
|
|
249
285
|
* Get a Conversation
|
|
250
286
|
*
|
|
251
287
|
* @example
|
|
252
288
|
* [[include: snippet_GetConversation.txt]]
|
|
253
289
|
*
|
|
254
|
-
* @param
|
|
290
|
+
* @param conversationIdOrName - the Conversation's id or conversation name
|
|
255
291
|
* @returns the `Conversation`
|
|
256
292
|
*/
|
|
257
|
-
getConversation(
|
|
293
|
+
getConversation(conversationIdOrName: string): Promise<Conversation>;
|
|
258
294
|
/**
|
|
259
295
|
* Leave a Conversation
|
|
260
296
|
*
|
|
@@ -343,6 +379,85 @@ export declare class VonageClient extends vonage.CombinedClientJS {
|
|
|
343
379
|
* @returns the `timestamp` of the message
|
|
344
380
|
*/
|
|
345
381
|
sendMessageImageEvent(id: string, imageUrl: URL): Promise<string>;
|
|
382
|
+
/**
|
|
383
|
+
* Send a Vidoe message to a Conversation.
|
|
384
|
+
*
|
|
385
|
+
* @example
|
|
386
|
+
* [[include: snippet_SendVideoMessage.txt]]
|
|
387
|
+
*
|
|
388
|
+
* @group Chat
|
|
389
|
+
* @beta
|
|
390
|
+
* @param id - the Conversation's id
|
|
391
|
+
* @param videoUrl - the url of the video resource.
|
|
392
|
+
* @returns the `timestamp` of the message
|
|
393
|
+
*/
|
|
394
|
+
sendMessageVideoEvent(id: string, videoUrl: URL): Promise<string>;
|
|
395
|
+
/**
|
|
396
|
+
* Send a file message to a Conversation.
|
|
397
|
+
*
|
|
398
|
+
* @example
|
|
399
|
+
* [[include: snippet_SendFileMessage.txt]]
|
|
400
|
+
*
|
|
401
|
+
* @group Chat
|
|
402
|
+
* @beta
|
|
403
|
+
* @param id - the Conversation's id
|
|
404
|
+
* @param fileUrl - the url of the file resource.
|
|
405
|
+
* @returns the `timestamp` of the message
|
|
406
|
+
*/
|
|
407
|
+
sendMessageFileEvent(id: string, fileUrl: URL): Promise<string>;
|
|
408
|
+
/**
|
|
409
|
+
* Send a audio message to a Conversation.
|
|
410
|
+
*
|
|
411
|
+
* @example
|
|
412
|
+
* [[include: snippet_SendAudioMessage.txt]]
|
|
413
|
+
*
|
|
414
|
+
* @group Chat
|
|
415
|
+
* @beta
|
|
416
|
+
* @param id - the Conversation's id
|
|
417
|
+
* @param audioUrl - the url of the audio resource.
|
|
418
|
+
* @returns the `timestamp` of the message
|
|
419
|
+
*/
|
|
420
|
+
sendMessageAudioEvent(id: string, audioUrl: URL): Promise<string>;
|
|
421
|
+
/**
|
|
422
|
+
* Send a vcard message to a Conversation.
|
|
423
|
+
*
|
|
424
|
+
* @example
|
|
425
|
+
* [[include: snippet_SendVCardMessage.txt]]
|
|
426
|
+
*
|
|
427
|
+
* @group Chat
|
|
428
|
+
* @beta
|
|
429
|
+
* @param id - the Conversation's id
|
|
430
|
+
* @param vCardUrl - the url of the vCardUrl resource.
|
|
431
|
+
* @returns the `timestamp` of the message
|
|
432
|
+
*/
|
|
433
|
+
sendMessageVCardEvent(id: string, vCardUrl: URL): Promise<string>;
|
|
434
|
+
/**
|
|
435
|
+
* Send a Location message to a Conversation.
|
|
436
|
+
*
|
|
437
|
+
* @example
|
|
438
|
+
* [[include: snippet_SendLocationMessage.txt]]
|
|
439
|
+
*
|
|
440
|
+
* @group Chat
|
|
441
|
+
* @beta
|
|
442
|
+
* @param id - the Conversation's id
|
|
443
|
+
* @param location - the description of the location.
|
|
444
|
+
* @returns the `timestamp` of the message
|
|
445
|
+
*/
|
|
446
|
+
sendMessageLocationEvent(id: string, location: Location): Promise<string>;
|
|
447
|
+
/**
|
|
448
|
+
* Send a template message to a Conversation.
|
|
449
|
+
*
|
|
450
|
+
* @example
|
|
451
|
+
* [[include: snippet_SendMessageTemplateEvent.txt]]
|
|
452
|
+
*
|
|
453
|
+
* @group Chat
|
|
454
|
+
* @beta
|
|
455
|
+
* @param id - the Conversation's id
|
|
456
|
+
* @param whatsappObject - the description(locale and policies of business account) of the location.
|
|
457
|
+
* @param templateObject - the description(name and paramters) of the template.
|
|
458
|
+
* @returns the `timestamp` of the message
|
|
459
|
+
*/
|
|
460
|
+
sendMessageTemplateEvent(id: string, templateObject: Template, whatsappObject: Whatsapp): Promise<string>;
|
|
346
461
|
/**
|
|
347
462
|
* Send an ephemeral event to a Conversation
|
|
348
463
|
*
|
|
@@ -356,6 +471,20 @@ export declare class VonageClient extends vonage.CombinedClientJS {
|
|
|
356
471
|
* @returns the `timestamp` of the message
|
|
357
472
|
*/
|
|
358
473
|
sendEphemeralEvent(id: string, customData: CustomData): Promise<string>;
|
|
474
|
+
/**
|
|
475
|
+
* Send a Custom event to a Conversation
|
|
476
|
+
*
|
|
477
|
+
* @example
|
|
478
|
+
* [[include: snippet_SendCustomEvent.txt]]
|
|
479
|
+
*
|
|
480
|
+
* @group Chat
|
|
481
|
+
* @beta
|
|
482
|
+
* @param id - the Conversation's id
|
|
483
|
+
* @param type - the type of the custom event. Type must start with `custom:<...>`
|
|
484
|
+
* @param customData - the body of the event
|
|
485
|
+
* @returns the `timestamp` of the message
|
|
486
|
+
*/
|
|
487
|
+
sendCustomEvent(id: string, eventType: string, customData: CustomData): Promise<string>;
|
|
359
488
|
/**
|
|
360
489
|
* Delete an Event in a Conversation
|
|
361
490
|
*
|