@vonage/client-sdk 1.1.0-alpha.1 → 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.
@@ -2,12 +2,87 @@ import './kotlin/clientsdk-clientcore_js';
2
2
  declare module './kotlin/clientsdk-clientcore_js' {
3
3
  namespace vonage {
4
4
  interface CombinedClientJS {
5
- say(callId: string, params: Partial<CallSayParams> & {
6
- text: string;
7
- }): Promise<unknown>;
8
- }
9
- interface CoreClientJS {
10
- getPeerConnection(id: string): RTCPeerConnection;
5
+ /**
6
+ * Mute your leg of a call
7
+ *
8
+ * @example
9
+ * [[include:call_mute.txt]]
10
+ *
11
+ * @param callId - Call ID
12
+ * @returns void
13
+ * @group Voice
14
+ */
15
+ mute(callId: string): Promise<void>;
16
+ /**
17
+ * Unmute your leg of a call
18
+ * @param callId - Call ID
19
+ * @returns void
20
+ * @group Voice
21
+ */
22
+ unmute(callId: string): Promise<void>;
23
+ /**
24
+ * Earmuff your leg of a call
25
+ *
26
+ * @example
27
+ * [[include:earmuff_event.txt]]
28
+ *
29
+ * @param callId - Call ID
30
+ * @returns void
31
+ * @group Voice
32
+ */
33
+ enableEarmuff(callId: string): Promise<void>;
34
+ /**
35
+ * Unearmuff your leg of a call
36
+ * @param callId - Call ID
37
+ * @returns void
38
+ * @group Voice
39
+ */
40
+ disableEarmuff(callId: string): Promise<void>;
41
+ /**
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
66
+ *
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
84
+ */
85
+ reconnectCall(callId: string): Promise<void>;
11
86
  }
12
87
  }
13
88
  }
@@ -34,6 +34,7 @@ export namespace vonage {
34
34
  getConversationEvents(cid: string, order: Nullable<vonage.PresentingOrderJS>, pageSize: Nullable<number>, cursor: Nullable<string>): Promise<vonage.EventsPageJS>;
35
35
  getConversationMember(cid: string, mid: string): Promise<vonage.MemberJS>;
36
36
  sendTextMessage(cid: string, text: string): Promise<string>;
37
+ sendCustomMessage(cid: string, customData: string): Promise<string>;
37
38
  setConfig(config: vonage.CoreClientConfigJS): void;
38
39
  createSession(token: string, sessionId: Nullable<string>): Promise<string>;
39
40
  deleteSession(): Promise<any>;
@@ -64,9 +65,10 @@ export namespace vonage {
64
65
  get nextCursor(): Nullable<string>;
65
66
  }
66
67
  interface ConversationEventJS {
68
+ readonly id: Nullable<number>;
67
69
  readonly timestamp: string;
68
70
  readonly conversationId: string;
69
- readonly from: string;
71
+ readonly from: Nullable<string>;
70
72
  readonly __doNotUseIt: __doNotImplementIt;
71
73
  }
72
74
  class MemberInvitedEventJS implements vonage.ConversationEventJS {
@@ -81,8 +83,8 @@ export namespace vonage {
81
83
  namespace MemberInvitedEventJS {
82
84
  class Body {
83
85
  private constructor();
84
- get invitee(): string;
85
- get invitedBy(): Nullable<string>;
86
+ get invitee(): vonage.UserJS;
87
+ get inviter(): Nullable<vonage.UserJS>;
86
88
  }
87
89
  }
88
90
  class MemberJoinedEventJS implements vonage.ConversationEventJS {
@@ -97,7 +99,7 @@ export namespace vonage {
97
99
  namespace MemberJoinedEventJS {
98
100
  class Body {
99
101
  private constructor();
100
- get username(): string;
102
+ get user(): vonage.UserJS;
101
103
  }
102
104
  }
103
105
  class MemberLeftEventJS implements vonage.ConversationEventJS {
@@ -112,7 +114,7 @@ export namespace vonage {
112
114
  namespace MemberLeftEventJS {
113
115
  class Body {
114
116
  private constructor();
115
- get username(): string;
117
+ get user(): vonage.UserJS;
116
118
  }
117
119
  }
118
120
  class UnknownEventJS implements vonage.ConversationEventJS {
@@ -121,7 +123,7 @@ export namespace vonage {
121
123
  get id(): Nullable<number>;
122
124
  get timestamp(): string;
123
125
  get conversationId(): string;
124
- get from(): string;
126
+ get from(): Nullable<string>;
125
127
  readonly __doNotUseIt: __doNotImplementIt;
126
128
  }
127
129
  }
@@ -131,11 +133,11 @@ export namespace vonage {
131
133
  readonly body: vonage.MessageEventBodyJS;
132
134
  readonly timestamp: string;
133
135
  readonly conversationId: string;
134
- readonly from: string;
136
+ readonly from: Nullable<string>;
135
137
  readonly __doNotUseIt: __doNotImplementIt;
136
138
  }
137
139
  interface MessageEventBodyJS {
138
- readonly sender: string;
140
+ readonly sender: vonage.UserJS;
139
141
  readonly __doNotUseIt: __doNotImplementIt;
140
142
  }
141
143
  class TextMessageEventJS implements vonage.MessageEventJS {
@@ -150,11 +152,28 @@ export namespace vonage {
150
152
  namespace TextMessageEventJS {
151
153
  class Body implements vonage.MessageEventBodyJS {
152
154
  private constructor();
153
- get sender(): string;
155
+ get sender(): vonage.UserJS;
154
156
  get text(): string;
155
157
  readonly __doNotUseIt: __doNotImplementIt;
156
158
  }
157
159
  }
160
+ class CustomMessageEventJS implements vonage.MessageEventJS {
161
+ private constructor();
162
+ get id(): number;
163
+ get timestamp(): string;
164
+ get conversationId(): string;
165
+ get from(): string;
166
+ get body(): vonage.CustomMessageEventJS.Body;
167
+ readonly __doNotUseIt: __doNotImplementIt;
168
+ }
169
+ namespace CustomMessageEventJS {
170
+ class Body implements vonage.MessageEventBodyJS {
171
+ private constructor();
172
+ get sender(): vonage.UserJS;
173
+ get customData(): string;
174
+ readonly __doNotUseIt: __doNotImplementIt;
175
+ }
176
+ }
158
177
  }
159
178
  export namespace vonage {
160
179
  abstract class PresentingOrderJS {
@@ -406,6 +425,7 @@ export namespace vonage {
406
425
  private constructor();
407
426
  get type(): vonage.VonageErrorTypeJS;
408
427
  get code(): Nullable<string>;
428
+ get kmpCause(): Nullable<Error>;
409
429
  }
410
430
  abstract class VonageErrorTypeJS {
411
431
  private constructor();
@@ -456,6 +476,7 @@ export namespace vonage {
456
476
  getConversationEvents(cid: string, order: Nullable<vonage.PresentingOrderJS>, pageSize: Nullable<number>, cursor: Nullable<string>): Promise<vonage.EventsPageJS>;
457
477
  getConversationMember(cid: string, mid: string): Promise<vonage.MemberJS>;
458
478
  sendTextMessage(cid: string, text: string): Promise<string>;
479
+ sendCustomMessage(cid: string, customData: string): Promise<string>;
459
480
  setConfig(config: vonage.CoreClientConfigJS): void;
460
481
  createSession(token: string, sessionId: Nullable<string>): Promise<string>;
461
482
  deleteSession(): Promise<any>;
@@ -628,18 +649,22 @@ export namespace vonage {
628
649
  get name(): "REMOTE_REJECT";
629
650
  get ordinal(): 1;
630
651
  };
652
+ static get REMOTE_NO_ANSWER_TIMEOUT(): vonage.HangupReasonJS & {
653
+ get name(): "REMOTE_NO_ANSWER_TIMEOUT";
654
+ get ordinal(): 2;
655
+ };
631
656
  static get LOCAL_HANGUP(): vonage.HangupReasonJS & {
632
657
  get name(): "LOCAL_HANGUP";
633
- get ordinal(): 2;
658
+ get ordinal(): 3;
634
659
  };
635
660
  static get MEDIA_TIMEOUT(): vonage.HangupReasonJS & {
636
661
  get name(): "MEDIA_TIMEOUT";
637
- get ordinal(): 3;
662
+ get ordinal(): 4;
638
663
  };
639
664
  static values(): Array<vonage.HangupReasonJS>;
640
665
  static valueOf(value: string): vonage.HangupReasonJS;
641
- get name(): "REMOTE_HANGUP" | "REMOTE_REJECT" | "LOCAL_HANGUP" | "MEDIA_TIMEOUT";
642
- get ordinal(): 0 | 1 | 2 | 3;
666
+ get name(): "REMOTE_HANGUP" | "REMOTE_REJECT" | "REMOTE_NO_ANSWER_TIMEOUT" | "LOCAL_HANGUP" | "MEDIA_TIMEOUT";
667
+ get ordinal(): 0 | 1 | 2 | 3 | 4;
643
668
  static get Companion(): {
644
669
  getReason(reason: any/* com.vonage.clientcore.core.api.HangupReason */): vonage.HangupReasonJS;
645
670
  };
@@ -682,7 +707,7 @@ export namespace vonage {
682
707
  }
683
708
  export namespace vonage {
684
709
  interface HttpClientJS {
685
- request(verb: string, url: string, headers: Json, body: Nullable<string>, callback: (p0: Nullable<vonage.HttpClientErrorJS>, p1: Nullable<string>) => void): void;
710
+ request(verb: string, url: string, headers: Json, body: Nullable<string>, callback: (p0: Nullable<vonage.HttpClientErrorJS>, p1: Nullable<vonage.HttpClientResponseJS>) => void): void;
686
711
  }
687
712
  interface SocketClientJS {
688
713
  delegate: Nullable<vonage.SocketClientDelegateJS>;
@@ -694,7 +719,7 @@ export namespace vonage {
694
719
  }
695
720
  interface SocketClientDelegateJS {
696
721
  didReceiveNewSocketEvent(type: string, body: string): void;
697
- didReceiveNewSocketConnectionStatusEvent(type: string, reason: Nullable<string>): void;
722
+ didReceiveNewSocketConnectionStatusEvent(type: string, reason: Nullable<string>, timestamp: any/* kotlin.Number */, retryNumber: Nullable<number>): void;
698
723
  }
699
724
  interface MediaClientJS {
700
725
  delegate: Nullable<vonage.MediaClientDelegateJS>;
@@ -714,15 +739,22 @@ export namespace vonage {
714
739
  }
715
740
  export namespace vonage {
716
741
  class HttpClientErrorJS extends Error {
717
- constructor(message?: Nullable<string>, responseCode?: Nullable<number>, responseBody?: Nullable<string>, cause?: Nullable<Error>);
718
- get responseCode(): Nullable<number>;
719
- get responseBody(): Nullable<string>;
742
+ constructor(message?: Nullable<string>, cause?: Nullable<Error>);
720
743
  get coreError(): any/* com.vonage.clientcore.core.middlewares.http.HTTPClientError */;
721
744
  component1(): Nullable<string>;
722
- component2(): Nullable<number>;
723
- component3(): Nullable<string>;
724
- component4(): Nullable<Error>;
725
- copy(message?: Nullable<string>, responseCode?: Nullable<number>, responseBody?: Nullable<string>, cause?: Nullable<Error>): vonage.HttpClientErrorJS;
745
+ component2(): Nullable<Error>;
746
+ copy(message?: Nullable<string>, cause?: Nullable<Error>): vonage.HttpClientErrorJS;
747
+ toString(): string;
748
+ hashCode(): number;
749
+ equals(other: Nullable<any>): boolean;
750
+ }
751
+ class HttpClientResponseJS {
752
+ constructor(statusCode: number, body?: Nullable<string>);
753
+ get statusCode(): number;
754
+ get body(): Nullable<string>;
755
+ component1(): number;
756
+ component2(): Nullable<string>;
757
+ copy(statusCode?: number, body?: Nullable<string>): vonage.HttpClientResponseJS;
726
758
  toString(): string;
727
759
  hashCode(): number;
728
760
  equals(other: Nullable<any>): boolean;
@@ -3,6 +3,6 @@ import vonage from '../utils/vonage';
3
3
  type HttpHeaders = Record<string, string | number | boolean>;
4
4
  declare class HttpClient implements vonage.HttpClientJS {
5
5
  private stringToVerb;
6
- request(verb: string, url: string, headers: HttpHeaders, body: string | null, callback: (p0: KMPPackage.Nullable<vonage.HttpClientErrorJS>, p1: KMPPackage.Nullable<string>) => void): Promise<void>;
6
+ request(verb: string, url: string, headers: HttpHeaders, body: string | null, callback: (p0: KMPPackage.Nullable<vonage.HttpClientErrorJS>, p1: KMPPackage.Nullable<vonage.HttpClientResponseJS>) => void): Promise<void>;
7
7
  }
8
8
  export default HttpClient;
@@ -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
  }
@@ -1,3 +1,5 @@
1
1
  import vonage from '../utils/vonage';
2
2
  export type TextMessageEvent = vonage.TextMessageEventJS;
3
3
  export declare const TextMessageEvent: typeof vonage.TextMessageEventJS;
4
+ export type CustomMessageEvent = vonage.CustomMessageEventJS;
5
+ export declare const CustomMessageEvent: typeof vonage.CustomMessageEventJS;