@vonage/client-sdk 1.1.0-alpha.7 → 1.1.0-rc.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.
@@ -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
- * Get the peer connection for a call
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
- * @internal
35
- * @param id - Call ID
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
- getPeerConnection(id: string): RTCPeerConnection;
85
+ reconnectCall(callId: string): Promise<void>;
38
86
  }
39
87
  }
40
88
  }
@@ -649,18 +649,22 @@ export namespace vonage {
649
649
  get name(): "REMOTE_REJECT";
650
650
  get ordinal(): 1;
651
651
  };
652
+ static get REMOTE_NO_ANSWER_TIMEOUT(): vonage.HangupReasonJS & {
653
+ get name(): "REMOTE_NO_ANSWER_TIMEOUT";
654
+ get ordinal(): 2;
655
+ };
652
656
  static get LOCAL_HANGUP(): vonage.HangupReasonJS & {
653
657
  get name(): "LOCAL_HANGUP";
654
- get ordinal(): 2;
658
+ get ordinal(): 3;
655
659
  };
656
660
  static get MEDIA_TIMEOUT(): vonage.HangupReasonJS & {
657
661
  get name(): "MEDIA_TIMEOUT";
658
- get ordinal(): 3;
662
+ get ordinal(): 4;
659
663
  };
660
664
  static values(): Array<vonage.HangupReasonJS>;
661
665
  static valueOf(value: string): vonage.HangupReasonJS;
662
- get name(): "REMOTE_HANGUP" | "REMOTE_REJECT" | "LOCAL_HANGUP" | "MEDIA_TIMEOUT";
663
- 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;
664
668
  static get Companion(): {
665
669
  getReason(reason: any/* com.vonage.clientcore.core.api.HangupReason */): vonage.HangupReasonJS;
666
670
  };
@@ -703,7 +707,7 @@ export namespace vonage {
703
707
  }
704
708
  export namespace vonage {
705
709
  interface HttpClientJS {
706
- 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;
707
711
  }
708
712
  interface SocketClientJS {
709
713
  delegate: Nullable<vonage.SocketClientDelegateJS>;
@@ -735,15 +739,22 @@ export namespace vonage {
735
739
  }
736
740
  export namespace vonage {
737
741
  class HttpClientErrorJS extends Error {
738
- constructor(message?: Nullable<string>, responseCode?: Nullable<number>, responseBody?: Nullable<string>, cause?: Nullable<Error>);
739
- get responseCode(): Nullable<number>;
740
- get responseBody(): Nullable<string>;
742
+ constructor(message?: Nullable<string>, cause?: Nullable<Error>);
741
743
  get coreError(): any/* com.vonage.clientcore.core.middlewares.http.HTTPClientError */;
742
744
  component1(): Nullable<string>;
743
- component2(): Nullable<number>;
744
- component3(): Nullable<string>;
745
- component4(): Nullable<Error>;
746
- 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;
747
758
  toString(): string;
748
759
  hashCode(): number;
749
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
  }