@vonage/client-sdk 1.1.0-alpha.10 → 1.1.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 +184 -32
- package/dist/client/VonageClient.d.ts +111 -12
- package/dist/client/index.cjs +158 -7
- package/dist/client/index.mjs +158 -7
- package/dist/coreExtend.d.ts +54 -6
- package/dist/utils/ClientConfig.d.ts +17 -0
- package/dist/vonageClientSDK.js +158 -7
- package/dist/vonageClientSDK.min.js +1 -1
- package/dist/vonageClientSDK.min.mjs +1 -1
- package/dist/vonageClientSDK.mjs +158 -7
- package/package.json +4 -2
- package/snippet.js +98 -0
package/dist/coreExtend.d.ts
CHANGED
|
@@ -4,37 +4,85 @@ declare module './kotlin/clientsdk-clientcore_js' {
|
|
|
4
4
|
interface CombinedClientJS {
|
|
5
5
|
/**
|
|
6
6
|
* Mute your leg of a call
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* [[include:call_mute.txt]]
|
|
10
|
+
*
|
|
7
11
|
* @param callId - Call ID
|
|
8
12
|
* @returns void
|
|
13
|
+
* @group Voice
|
|
9
14
|
*/
|
|
10
15
|
mute(callId: string): Promise<void>;
|
|
11
16
|
/**
|
|
12
17
|
* Unmute your leg of a call
|
|
13
18
|
* @param callId - Call ID
|
|
14
19
|
* @returns void
|
|
20
|
+
* @group Voice
|
|
15
21
|
*/
|
|
16
22
|
unmute(callId: string): Promise<void>;
|
|
17
23
|
/**
|
|
18
24
|
* Earmuff your leg of a call
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* [[include:earmuff_event.txt]]
|
|
28
|
+
*
|
|
19
29
|
* @param callId - Call ID
|
|
20
30
|
* @returns void
|
|
31
|
+
* @group Voice
|
|
21
32
|
*/
|
|
22
33
|
enableEarmuff(callId: string): Promise<void>;
|
|
23
34
|
/**
|
|
24
35
|
* Unearmuff your leg of a call
|
|
25
36
|
* @param callId - Call ID
|
|
26
37
|
* @returns void
|
|
38
|
+
* @group Voice
|
|
27
39
|
*/
|
|
28
40
|
disableEarmuff(callId: string): Promise<void>;
|
|
29
|
-
}
|
|
30
|
-
interface CoreClientJS {
|
|
31
41
|
/**
|
|
32
|
-
*
|
|
42
|
+
* Send a string of digits to a call via DTMF
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* [[include:send_dtmf_digits.txt]]
|
|
46
|
+
*
|
|
47
|
+
* @param callId - Call ID
|
|
48
|
+
* @param digits - DTMF digits
|
|
49
|
+
* @returns void
|
|
50
|
+
* @group Voice
|
|
51
|
+
*/
|
|
52
|
+
sendDTMF(callId: string, digits: string): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Answer a call
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* [[include:answer_call.txt]]
|
|
58
|
+
*
|
|
59
|
+
* @param callId - Call ID
|
|
60
|
+
* @returns void
|
|
61
|
+
* @group Voice
|
|
62
|
+
*/
|
|
63
|
+
answerCall(callId: string): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* Reject a call
|
|
33
66
|
*
|
|
34
|
-
* @
|
|
35
|
-
*
|
|
67
|
+
* @example
|
|
68
|
+
* [[include:reject_call.txt]]
|
|
69
|
+
*
|
|
70
|
+
* @param callId - Call ID
|
|
71
|
+
* @returns void
|
|
72
|
+
* @group Voice
|
|
73
|
+
*/
|
|
74
|
+
rejectCall(callId: string): Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* Reconnect a call
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* [[include:reconnect_call.txt]]
|
|
80
|
+
*
|
|
81
|
+
* @param callId - Call ID
|
|
82
|
+
* @returns void
|
|
83
|
+
* @group Voice
|
|
36
84
|
*/
|
|
37
|
-
|
|
85
|
+
reconnectCall(callId: string): Promise<void>;
|
|
38
86
|
}
|
|
39
87
|
}
|
|
40
88
|
}
|
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
import vonage from '../utils/vonage';
|
|
2
2
|
export declare const ConfigRegion: typeof vonage.CoreClientConfigRegionJS;
|
|
3
|
+
/**
|
|
4
|
+
* Represents the configuration object for the client.
|
|
5
|
+
*
|
|
6
|
+
* The `ClientConfig` class provides a convenient way to configure the client by specifying various properties.
|
|
7
|
+
* These properties control different aspects of the client's behavior, such as API URLs, media reoffer, and WebSocket settings.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* [[include:set_client_config.txt]]
|
|
11
|
+
*/
|
|
3
12
|
export declare class ClientConfig extends vonage.CoreClientConfigJS {
|
|
13
|
+
/**
|
|
14
|
+
* Constructs a new instance of the class.
|
|
15
|
+
*
|
|
16
|
+
* @param {string} region The region where the API and WebSocket URLs should be configured.
|
|
17
|
+
* Valid values are "EU" (Europe), "US" (United States), or "AP" (Asia Pacific).
|
|
18
|
+
* The URLs will be automatically set based on the selected region.
|
|
19
|
+
* Defaults to "US" if no region is specified.
|
|
20
|
+
*/
|
|
4
21
|
constructor(region?: vonage.CoreClientConfigRegionJS);
|
|
5
22
|
}
|
package/dist/vonageClientSDK.js
CHANGED
|
@@ -75485,7 +75485,24 @@
|
|
|
75485
75485
|
}
|
|
75486
75486
|
|
|
75487
75487
|
const ConfigRegion = clientsdkClientcore_jsExports.vonage.CoreClientConfigRegionJS;
|
|
75488
|
+
/**
|
|
75489
|
+
* Represents the configuration object for the client.
|
|
75490
|
+
*
|
|
75491
|
+
* The `ClientConfig` class provides a convenient way to configure the client by specifying various properties.
|
|
75492
|
+
* These properties control different aspects of the client's behavior, such as API URLs, media reoffer, and WebSocket settings.
|
|
75493
|
+
*
|
|
75494
|
+
* @example
|
|
75495
|
+
* [[include:set_client_config.txt]]
|
|
75496
|
+
*/
|
|
75488
75497
|
class ClientConfig extends clientsdkClientcore_jsExports.vonage.CoreClientConfigJS {
|
|
75498
|
+
/**
|
|
75499
|
+
* Constructs a new instance of the class.
|
|
75500
|
+
*
|
|
75501
|
+
* @param {string} region The region where the API and WebSocket URLs should be configured.
|
|
75502
|
+
* Valid values are "EU" (Europe), "US" (United States), or "AP" (Asia Pacific).
|
|
75503
|
+
* The URLs will be automatically set based on the selected region.
|
|
75504
|
+
* Defaults to "US" if no region is specified.
|
|
75505
|
+
*/
|
|
75489
75506
|
constructor(region = ConfigRegion.US) {
|
|
75490
75507
|
super(region);
|
|
75491
75508
|
}
|
|
@@ -75529,6 +75546,36 @@
|
|
|
75529
75546
|
* DO NOT ADD CODE HERE UNLESS REALLY NEEDEED!!111!
|
|
75530
75547
|
*/
|
|
75531
75548
|
class VonageClient extends clientsdkClientcore_jsExports.vonage.CombinedClientJS {
|
|
75549
|
+
/**
|
|
75550
|
+
* @internal
|
|
75551
|
+
*/
|
|
75552
|
+
get core() {
|
|
75553
|
+
return super.core;
|
|
75554
|
+
}
|
|
75555
|
+
/**
|
|
75556
|
+
* @internal
|
|
75557
|
+
*/
|
|
75558
|
+
get media() {
|
|
75559
|
+
return super.media;
|
|
75560
|
+
}
|
|
75561
|
+
/**
|
|
75562
|
+
* @internal
|
|
75563
|
+
*/
|
|
75564
|
+
get emitter() {
|
|
75565
|
+
return super.emitter;
|
|
75566
|
+
}
|
|
75567
|
+
/**
|
|
75568
|
+
* @internal
|
|
75569
|
+
*/
|
|
75570
|
+
set emitter(value) {
|
|
75571
|
+
super.emitter = value;
|
|
75572
|
+
}
|
|
75573
|
+
/**
|
|
75574
|
+
* @internal
|
|
75575
|
+
*/
|
|
75576
|
+
hangupWithReason(callId, reasonText, reasonCode) {
|
|
75577
|
+
return super.hangupWithReason(callId, reasonText, reasonCode);
|
|
75578
|
+
}
|
|
75532
75579
|
constructor() {
|
|
75533
75580
|
super(new HttpClient(), new SocketClient(), new MediaClient());
|
|
75534
75581
|
/**
|
|
@@ -75536,6 +75583,10 @@
|
|
|
75536
75583
|
* @internal
|
|
75537
75584
|
*/
|
|
75538
75585
|
this.callbacks = new Map();
|
|
75586
|
+
/**
|
|
75587
|
+
* @internal
|
|
75588
|
+
*/
|
|
75589
|
+
this.__doNotUseIt = super.__doNotUseIt;
|
|
75539
75590
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
75540
75591
|
const _this = this;
|
|
75541
75592
|
this.emitter = new Proxy(Object(), {
|
|
@@ -75564,6 +75615,9 @@
|
|
|
75564
75615
|
/**
|
|
75565
75616
|
* Register a callback for an event.
|
|
75566
75617
|
*
|
|
75618
|
+
* @example
|
|
75619
|
+
* [[include:register_listener.txt]]
|
|
75620
|
+
*
|
|
75567
75621
|
* @param event - the event to register for (e.g. 'legStatusUpdate')
|
|
75568
75622
|
* @param callback - the callback to register for the event
|
|
75569
75623
|
* @returns a symbol that can be used to unregister the callback
|
|
@@ -75581,6 +75635,9 @@
|
|
|
75581
75635
|
/**
|
|
75582
75636
|
* Unregister a callback for an event.
|
|
75583
75637
|
*
|
|
75638
|
+
* @example
|
|
75639
|
+
* [[include:unregister_listener.txt]]
|
|
75640
|
+
*
|
|
75584
75641
|
* @param event - the event to register for (e.g. 'legStatusUpdate')
|
|
75585
75642
|
* @param callbackSymbol - the callback symbol to unregister
|
|
75586
75643
|
* @returns true if the callback was unregistered, false otherwise
|
|
@@ -75596,16 +75653,15 @@
|
|
|
75596
75653
|
/**
|
|
75597
75654
|
* Clear all callbacks for an event.
|
|
75598
75655
|
*
|
|
75599
|
-
* @
|
|
75656
|
+
* @example
|
|
75657
|
+
* [[include: clear_callbacks.txt]]
|
|
75658
|
+
*
|
|
75659
|
+
* @param event - the event to unregister from (e.g. 'legStatusUpdate')
|
|
75600
75660
|
* @returns void
|
|
75601
75661
|
*
|
|
75602
75662
|
* @remarks
|
|
75603
75663
|
* This is useful for cleaning up callbacks when you no longer need them.
|
|
75604
75664
|
*
|
|
75605
|
-
* @example
|
|
75606
|
-
* ```ts
|
|
75607
|
-
* client.clearCallbacks('legStatusUpdate');
|
|
75608
|
-
* ```
|
|
75609
75665
|
*/
|
|
75610
75666
|
clearCallbacks(event) {
|
|
75611
75667
|
const callbacks = this.callbacks.get(event);
|
|
@@ -75619,6 +75675,9 @@
|
|
|
75619
75675
|
* and returned. If a sessionId is provided, it will be used
|
|
75620
75676
|
* to resume an existing session.
|
|
75621
75677
|
*
|
|
75678
|
+
* @example
|
|
75679
|
+
* [[include:create_session.txt]]
|
|
75680
|
+
*
|
|
75622
75681
|
* @param token
|
|
75623
75682
|
* @param sessionId - optional sessionId to use
|
|
75624
75683
|
* @returns the `sessionId` of the session
|
|
@@ -75631,10 +75690,33 @@
|
|
|
75631
75690
|
return _super.createSession.call(this, token, sessionId || null);
|
|
75632
75691
|
});
|
|
75633
75692
|
}
|
|
75693
|
+
/**
|
|
75694
|
+
* Get the Peer Connection for a call
|
|
75695
|
+
*
|
|
75696
|
+
* @experimental
|
|
75697
|
+
* @group Voice
|
|
75698
|
+
* @param id - The Call Id
|
|
75699
|
+
*/
|
|
75700
|
+
getPeerConnection(id) {
|
|
75701
|
+
return super.getPeerConnection(id);
|
|
75702
|
+
}
|
|
75703
|
+
/**
|
|
75704
|
+
* Get the Leg for a call
|
|
75705
|
+
*
|
|
75706
|
+
* @group Voice
|
|
75707
|
+
* @param legId - The Leg Id
|
|
75708
|
+
*/
|
|
75709
|
+
getLeg(legId) {
|
|
75710
|
+
return super.getLeg(legId);
|
|
75711
|
+
}
|
|
75634
75712
|
/**
|
|
75635
75713
|
* Make a server call to the Vonage API.
|
|
75636
75714
|
* This is used to initiate a call using the Voice API and NCCO.
|
|
75637
75715
|
*
|
|
75716
|
+
* @example
|
|
75717
|
+
* [[include:outbound_call.txt]]
|
|
75718
|
+
*
|
|
75719
|
+
* @group Voice
|
|
75638
75720
|
* @param context - the context to send to the server passed as Custom data to the voice answer webhook
|
|
75639
75721
|
* @returns the `callId` of the call
|
|
75640
75722
|
*/
|
|
@@ -75649,9 +75731,10 @@
|
|
|
75649
75731
|
/**
|
|
75650
75732
|
* Hangup a call.
|
|
75651
75733
|
*
|
|
75652
|
-
* @
|
|
75653
|
-
*
|
|
75734
|
+
* @example
|
|
75735
|
+
* [[include:call_hangup.txt]]
|
|
75654
75736
|
*
|
|
75737
|
+
* @group Voice
|
|
75655
75738
|
* @param callId - the `callId` of the call to hangup
|
|
75656
75739
|
* @param reasonText - optional reason text to send to the other party
|
|
75657
75740
|
* @param reasonCode - optional reason code to send to the other party
|
|
@@ -75684,6 +75767,11 @@
|
|
|
75684
75767
|
/**
|
|
75685
75768
|
* Get a list of Conversations for the user.
|
|
75686
75769
|
*
|
|
75770
|
+
* @example
|
|
75771
|
+
* [[include:get_conversations.txt]]
|
|
75772
|
+
*
|
|
75773
|
+
* @group Chat
|
|
75774
|
+
* @beta
|
|
75687
75775
|
* @param order - the order to return the conversations in (default: 'asc')
|
|
75688
75776
|
* @param pageSize - the number of conversations to return per page (default: 100)
|
|
75689
75777
|
* @param cursor - the cursor to use for pagination (default: null)
|
|
@@ -75700,6 +75788,11 @@
|
|
|
75700
75788
|
/**
|
|
75701
75789
|
* Get a Conversation's Events
|
|
75702
75790
|
*
|
|
75791
|
+
* @example
|
|
75792
|
+
* [[include:get_conversation_events.txt]]
|
|
75793
|
+
*
|
|
75794
|
+
* @group Chat
|
|
75795
|
+
* @beta
|
|
75703
75796
|
* @param id - the Conversation's id
|
|
75704
75797
|
* @param order - the order to return the events in (default: 'asc')
|
|
75705
75798
|
* @param pageSize - the number of events to return per page (default: 100)
|
|
@@ -75716,6 +75809,12 @@
|
|
|
75716
75809
|
}
|
|
75717
75810
|
/**
|
|
75718
75811
|
* Get a Conversation's Members
|
|
75812
|
+
*
|
|
75813
|
+
* @example
|
|
75814
|
+
* [[include:get_conversation_members.txt]]
|
|
75815
|
+
*
|
|
75816
|
+
* @group Chat
|
|
75817
|
+
* @beta
|
|
75719
75818
|
* @param id - the Conversation's id
|
|
75720
75819
|
* @param order - the order to return the members in (default: 'asc')
|
|
75721
75820
|
* @param pageSize - the number of members to return per page (default: 100)
|
|
@@ -75732,6 +75831,12 @@
|
|
|
75732
75831
|
}
|
|
75733
75832
|
/**
|
|
75734
75833
|
* Create a conversation
|
|
75834
|
+
*
|
|
75835
|
+
* @example
|
|
75836
|
+
* [[include:create_conversation.txt]]
|
|
75837
|
+
*
|
|
75838
|
+
* @group Chat
|
|
75839
|
+
* @beta
|
|
75735
75840
|
* @param name - the name of the conversation
|
|
75736
75841
|
* @param displayName - the display name of the conversation
|
|
75737
75842
|
* @returns the `cid` of the conversation
|
|
@@ -75746,6 +75851,10 @@
|
|
|
75746
75851
|
}
|
|
75747
75852
|
/**
|
|
75748
75853
|
* Get a Conversation
|
|
75854
|
+
*
|
|
75855
|
+
* @example
|
|
75856
|
+
* [[include:get_conversation.txt]]
|
|
75857
|
+
*
|
|
75749
75858
|
* @param id - the Conversation's id
|
|
75750
75859
|
* @returns the `Conversation`
|
|
75751
75860
|
*/
|
|
@@ -75759,6 +75868,12 @@
|
|
|
75759
75868
|
}
|
|
75760
75869
|
/**
|
|
75761
75870
|
* Leave a Conversation
|
|
75871
|
+
*
|
|
75872
|
+
* @example
|
|
75873
|
+
* [[include:leave_conversation.txt]]
|
|
75874
|
+
*
|
|
75875
|
+
* @group Chat
|
|
75876
|
+
* @beta
|
|
75762
75877
|
* @param id - the Conversation's id
|
|
75763
75878
|
* @returns void
|
|
75764
75879
|
*/
|
|
@@ -75772,6 +75887,12 @@
|
|
|
75772
75887
|
}
|
|
75773
75888
|
/**
|
|
75774
75889
|
* Join a Conversation
|
|
75890
|
+
*
|
|
75891
|
+
* @example
|
|
75892
|
+
* [[include:join_conversation.txt]]
|
|
75893
|
+
*
|
|
75894
|
+
* @group Chat
|
|
75895
|
+
* @beta
|
|
75775
75896
|
* @param id - the Conversation's id
|
|
75776
75897
|
* @returns the `memberId` of the member
|
|
75777
75898
|
*/
|
|
@@ -75785,6 +75906,12 @@
|
|
|
75785
75906
|
}
|
|
75786
75907
|
/**
|
|
75787
75908
|
* Delete a Conversation
|
|
75909
|
+
*
|
|
75910
|
+
* @example
|
|
75911
|
+
* [[include:delete_conversation.txt]]
|
|
75912
|
+
*
|
|
75913
|
+
* @group Chat
|
|
75914
|
+
* @beta
|
|
75788
75915
|
* @param id - the Conversation's id
|
|
75789
75916
|
* @returns void
|
|
75790
75917
|
*/
|
|
@@ -75798,6 +75925,12 @@
|
|
|
75798
75925
|
}
|
|
75799
75926
|
/**
|
|
75800
75927
|
* Invite a user to a Conversation by user's `name`
|
|
75928
|
+
*
|
|
75929
|
+
* @example
|
|
75930
|
+
* [[include:invite_to_conversation.txt]]
|
|
75931
|
+
*
|
|
75932
|
+
* @group Chat
|
|
75933
|
+
* @beta
|
|
75801
75934
|
* @param id - the Conversation's id
|
|
75802
75935
|
* @param name - the namne of the user to invite
|
|
75803
75936
|
* @returns the `memberId` of the member
|
|
@@ -75812,6 +75945,12 @@
|
|
|
75812
75945
|
}
|
|
75813
75946
|
/**
|
|
75814
75947
|
* Send a text message to a Conversation
|
|
75948
|
+
*
|
|
75949
|
+
* @example
|
|
75950
|
+
* [[include:send_text_message.txt]]
|
|
75951
|
+
*
|
|
75952
|
+
* @group Chat
|
|
75953
|
+
* @beta
|
|
75815
75954
|
* @param id - the Conversation's id
|
|
75816
75955
|
* @param text - the Body of the message
|
|
75817
75956
|
* @returns the `timestamp` of the message
|
|
@@ -75826,6 +75965,12 @@
|
|
|
75826
75965
|
}
|
|
75827
75966
|
/**
|
|
75828
75967
|
* Send a custom message to a Conversation
|
|
75968
|
+
*
|
|
75969
|
+
* @example
|
|
75970
|
+
* [[include:send_custom_message.txt]]
|
|
75971
|
+
*
|
|
75972
|
+
* @group Chat
|
|
75973
|
+
* @beta
|
|
75829
75974
|
* @param id - the Conversation's id
|
|
75830
75975
|
* @param customData - the body of the message
|
|
75831
75976
|
* @returns the `timestamp` of the message
|
|
@@ -75843,6 +75988,12 @@
|
|
|
75843
75988
|
}
|
|
75844
75989
|
/**
|
|
75845
75990
|
* Get a Member of a Conversation
|
|
75991
|
+
*
|
|
75992
|
+
* @example
|
|
75993
|
+
* [[include:get_conversation_member.txt]]
|
|
75994
|
+
*
|
|
75995
|
+
* @group Chat
|
|
75996
|
+
* @beta
|
|
75846
75997
|
* @param cid - the Conversation's id
|
|
75847
75998
|
* @param mid - the Member's id
|
|
75848
75999
|
* @returns the `Member`
|