@vonage/client-sdk 1.2.1 → 1.3.0-snapshot.42.0

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.
@@ -6,7 +6,7 @@ declare module './kotlin/clientsdk-clientcore_js' {
6
6
  * Mute your leg of a call
7
7
  *
8
8
  * @example
9
- * [[include: snippet_CallMute.txt]]
9
+ * [[include: snippet_Mute.txt]]
10
10
  *
11
11
  * @param callId - Call ID
12
12
  * @returns void
@@ -24,7 +24,7 @@ declare module './kotlin/clientsdk-clientcore_js' {
24
24
  * Earmuff your leg of a call
25
25
  *
26
26
  * @example
27
- * [[include: snippet_EarmuffEvent.txt]]
27
+ * [[include: snippet_EnableEarmuff.txt]]
28
28
  *
29
29
  * @param callId - Call ID
30
30
  * @returns void
@@ -33,6 +33,10 @@ declare module './kotlin/clientsdk-clientcore_js' {
33
33
  enableEarmuff(callId: string): Promise<void>;
34
34
  /**
35
35
  * Unearmuff your leg of a call
36
+ *
37
+ * @example
38
+ * [[include: snippet_DisableEarmuff.txt]]
39
+ *
36
40
  * @param callId - Call ID
37
41
  * @returns void
38
42
  * @group Voice
@@ -42,7 +46,7 @@ declare module './kotlin/clientsdk-clientcore_js' {
42
46
  * Send a string of digits to a call via DTMF
43
47
  *
44
48
  * @example
45
- * [[include: snippet_SendDtmfDigits.txt]]
49
+ * [[include: snippet_Dtmf.txt]]
46
50
  *
47
51
  * @param callId - Call ID
48
52
  * @param digits - DTMF digits
@@ -12,6 +12,7 @@ export declare namespace vonage {
12
12
  callMediaReconnecting(callId: string): void;
13
13
  callMediaReconnection(callId: string): void;
14
14
  callMediaDisconnect(callId: string, reason: vonage.CallDisconnectReasonJS): void;
15
+ rtcStatsUpdate(rtcStats: vonage.RTCStatsJS, legId: string): void;
15
16
  reconnecting(): void;
16
17
  reconnection(): void;
17
18
  sessionError(reason: vonage.SessionErrorReasonJS): void;
@@ -20,7 +21,7 @@ export declare namespace vonage {
20
21
  }
21
22
  export declare namespace vonage {
22
23
  class CombinedClientJS implements vonage.IChatClientJS, vonage.IVoiceClientJS {
23
- constructor(http: vonage.HttpClientJS, socket: vonage.SocketClientJS, media: vonage.MediaClientJS);
24
+ constructor(config: vonage.InitConfigObjectJS, http: vonage.HttpClientJS, socket: vonage.SocketClientJS, media: vonage.MediaClientJS);
24
25
  get media(): vonage.MediaClientJS;
25
26
  get core(): any/* com.vonage.clientcore.core.CoreClientWithMedia */;
26
27
  get emitter(): Nullable<vonage.CombinedEvents>;
@@ -36,6 +37,7 @@ export declare namespace vonage {
36
37
  getConversationMember(cid: string, mid: string): Promise<vonage.MemberJS>;
37
38
  sendMessageTextEvent(cid: string, text: string): Promise<string>;
38
39
  sendMessageCustomEvent(cid: string, customData: string): Promise<string>;
40
+ sendMessageImageEvent(cid: string, imageURL: URL): Promise<string>;
39
41
  sendEphemeralEvent(cid: string, customBody: string): Promise<string>;
40
42
  deleteEvent(id: number, conversationId: string): Promise<any>;
41
43
  setConfig(config: vonage.ConfigObjectJS): void;
@@ -675,6 +677,7 @@ export declare namespace vonage {
675
677
  getConversationMember(cid: string, mid: string): Promise<vonage.MemberJS>;
676
678
  sendMessageTextEvent(cid: string, text: string): Promise<string>;
677
679
  sendMessageCustomEvent(cid: string, customData: string): Promise<string>;
680
+ sendMessageImageEvent(cid: string, imageURL: URL): Promise<string>;
678
681
  sendEphemeralEvent(cid: string, customBody: string): Promise<string>;
679
682
  deleteEvent(id: number, conversationId: string): Promise<any>;
680
683
  setConfig(config: vonage.ConfigObjectJS): void;
@@ -694,23 +697,35 @@ export declare namespace vonage {
694
697
  reconnection(): void;
695
698
  sessionError(reason: vonage.SessionErrorReasonJS): void;
696
699
  }
700
+ interface VonageLoggerJS {
701
+ readonly name: string;
702
+ readonly minLogLevel?: Nullable<vonage.LoggingLevelJS>;
703
+ readonly topics?: Nullable<Array<vonage.Topics>>;
704
+ onLog(logLevel: string, topic: vonage.TopicJS, message: string): void;
705
+ }
697
706
  interface ConfigObjectJS {
698
707
  readonly region?: Nullable<vonage.CoreClientConfigRegionJS>;
699
708
  readonly apiUrl?: Nullable<string>;
700
709
  readonly websocketUrl?: Nullable<string>;
701
710
  readonly websocketPath?: Nullable<string>;
702
711
  readonly autoMediaReoffer?: Nullable<boolean>;
712
+ readonly rtcStatsTelemetry?: Nullable<boolean>;
703
713
  }
704
714
  interface InitConfigObjectJS extends vonage.ConfigObjectJS {
705
715
  readonly loggingLevel?: Nullable<vonage.LoggingLevelJS>;
716
+ readonly customLoggers?: Nullable<Array<vonage.VonageLoggerJS>>;
717
+ readonly disableInternalLogger?: Nullable<boolean>;
706
718
  readonly region?: Nullable<vonage.CoreClientConfigRegionJS>;
707
719
  readonly apiUrl?: Nullable<string>;
708
720
  readonly websocketUrl?: Nullable<string>;
709
721
  readonly websocketPath?: Nullable<string>;
710
722
  readonly autoMediaReoffer?: Nullable<boolean>;
723
+ readonly rtcStatsTelemetry?: Nullable<boolean>;
711
724
  }
712
725
  }
713
726
  export declare namespace vonage {
727
+ const DEFAULT_REGION: vonage.CoreClientConfigRegionJS;
728
+ const DEFAULT_LOGGING_LEVEL: vonage.LoggingLevelJS;
714
729
  abstract class CoreClientConfigRegionJS {
715
730
  private constructor();
716
731
  get coreRegion(): any/* com.vonage.clientcore.core.api.ClientConfigRegion */;
@@ -742,12 +757,54 @@ export declare namespace vonage {
742
757
  set websocketPath(value: string);
743
758
  get autoMediaReoffer(): boolean;
744
759
  set autoMediaReoffer(value: boolean);
760
+ get rtcStatsTelemetry(): boolean;
761
+ set rtcStatsTelemetry(value: boolean);
762
+ }
763
+ class TopicJS {
764
+ constructor(name: string, tag: string);
765
+ get name(): string;
766
+ get tag(): string;
767
+ copy(name?: string, tag?: string): vonage.TopicJS;
768
+ toString(): string;
769
+ hashCode(): number;
770
+ equals(other: Nullable<any>): boolean;
745
771
  }
746
- class CoreClientInitConfigJS extends vonage.CoreClientConfigJS implements vonage.InitConfigObjectJS {
747
- constructor(loggingLevel?: vonage.LoggingLevelJS, region?: vonage.CoreClientConfigRegionJS);
748
- get loggingLevel(): vonage.LoggingLevelJS;
749
- set loggingLevel(value: vonage.LoggingLevelJS);
772
+ abstract class Topics {
773
+ private constructor();
774
+ static get HTTP(): vonage.Topics & {
775
+ get name(): "HTTP";
776
+ get ordinal(): 0;
777
+ };
778
+ static get WS(): vonage.Topics & {
779
+ get name(): "WS";
780
+ get ordinal(): 1;
781
+ };
782
+ static get MEDIA(): vonage.Topics & {
783
+ get name(): "MEDIA";
784
+ get ordinal(): 2;
785
+ };
786
+ static get API(): vonage.Topics & {
787
+ get name(): "API";
788
+ get ordinal(): 3;
789
+ };
790
+ static get STORE(): vonage.Topics & {
791
+ get name(): "STORE";
792
+ get ordinal(): 4;
793
+ };
794
+ static get REDUCER(): vonage.Topics & {
795
+ get name(): "REDUCER";
796
+ get ordinal(): 5;
797
+ };
798
+ static get DEFAULT(): vonage.Topics & {
799
+ get name(): "DEFAULT";
800
+ get ordinal(): 6;
801
+ };
802
+ static values(): Array<vonage.Topics>;
803
+ static valueOf(value: string): vonage.Topics;
804
+ get name(): "HTTP" | "WS" | "MEDIA" | "API" | "STORE" | "REDUCER" | "DEFAULT";
805
+ get ordinal(): 0 | 1 | 2 | 3 | 4 | 5 | 6;
750
806
  }
807
+ function createVonageLoggerJS(name: string, minLogLevel: vonage.LoggingLevelJS | undefined, topics: Array<vonage.Topics> | undefined, onLog: (p0: string, p1: vonage.TopicJS, p2: string) => void): vonage.VonageLoggerJS;
751
808
  abstract class LoggingLevelJS {
752
809
  private constructor();
753
810
  static get Verbose(): vonage.LoggingLevelJS & {
@@ -826,6 +883,7 @@ export declare namespace vonage {
826
883
  callMediaReconnecting(callId: string): void;
827
884
  callMediaReconnection(callId: string): void;
828
885
  callMediaDisconnect(callId: string, reason: vonage.CallDisconnectReasonJS): void;
886
+ rtcStatsUpdate(rtcStats: vonage.RTCStatsJS, legId: string): void;
829
887
  reconnecting(): void;
830
888
  reconnection(): void;
831
889
  sessionError(reason: vonage.SessionErrorReasonJS): void;
@@ -961,7 +1019,7 @@ export declare namespace vonage {
961
1019
  enableRtcStatsCollection(interval: any/* kotlin.Number */, mediaId: string): void;
962
1020
  }
963
1021
  interface MediaClientDelegateJS {
964
- onRtcStats(rtcStats: vonage.RTCStatsJS): void;
1022
+ onRtcStats(rtcStats: vonage.RTCStatsJS, legId: string): void;
965
1023
  onConnectionChange(id: string, status: string): void;
966
1024
  onNetworkChange(legId: string, status: string): void;
967
1025
  }
@@ -1032,21 +1090,22 @@ export declare namespace vonage {
1032
1090
  equals(other: Nullable<any>): boolean;
1033
1091
  }
1034
1092
  class RTCStatsJS {
1035
- constructor(audioRecvPackets: Nullable<any>/* Nullable<kotlin.Number> */, audioRecvPacketsLost: Nullable<any>/* Nullable<kotlin.Number> */, audioRecvBytes: Nullable<any>/* Nullable<kotlin.Number> */, audioRecvJitter: Nullable<any>/* Nullable<kotlin.Number> */, audioSentPackets: Nullable<any>/* Nullable<kotlin.Number> */, audioSentBytes: Nullable<any>/* Nullable<kotlin.Number> */, audioSentPacketsLost: Nullable<any>/* Nullable<kotlin.Number> */, audioRtt: Nullable<any>/* Nullable<kotlin.Number> */, audioSentJitter: Nullable<any>/* Nullable<kotlin.Number> */, legId: string);
1036
- get audioRecvPackets(): Nullable<any>/* Nullable<kotlin.Number> */;
1037
- get audioRecvPacketsLost(): Nullable<any>/* Nullable<kotlin.Number> */;
1038
- get audioRecvBytes(): Nullable<any>/* Nullable<kotlin.Number> */;
1039
- get audioRecvJitter(): Nullable<any>/* Nullable<kotlin.Number> */;
1040
- get audioSentPackets(): Nullable<any>/* Nullable<kotlin.Number> */;
1041
- get audioSentBytes(): Nullable<any>/* Nullable<kotlin.Number> */;
1042
- get audioSentPacketsLost(): Nullable<any>/* Nullable<kotlin.Number> */;
1043
- get audioRtt(): Nullable<any>/* Nullable<kotlin.Number> */;
1044
- get audioSentJitter(): Nullable<any>/* Nullable<kotlin.Number> */;
1045
- get legId(): string;
1046
- copy(audioRecvPackets?: Nullable<any>/* Nullable<kotlin.Number> */, audioRecvPacketsLost?: Nullable<any>/* Nullable<kotlin.Number> */, audioRecvBytes?: Nullable<any>/* Nullable<kotlin.Number> */, audioRecvJitter?: Nullable<any>/* Nullable<kotlin.Number> */, audioSentPackets?: Nullable<any>/* Nullable<kotlin.Number> */, audioSentBytes?: Nullable<any>/* Nullable<kotlin.Number> */, audioSentPacketsLost?: Nullable<any>/* Nullable<kotlin.Number> */, audioRtt?: Nullable<any>/* Nullable<kotlin.Number> */, audioSentJitter?: Nullable<any>/* Nullable<kotlin.Number> */, legId?: string): vonage.RTCStatsJS;
1093
+ constructor(audioRecvPackets: any/* kotlin.Number */, audioRecvPacketsLost: any/* kotlin.Number */, audioRecvBytes: any/* kotlin.Number */, audioRecvJitter: any/* kotlin.Number */, audioSentPackets: any/* kotlin.Number */, audioSentBytes: any/* kotlin.Number */, audioSentPacketsLost: any/* kotlin.Number */, audioRtt: any/* kotlin.Number */, audioSentJitter: any/* kotlin.Number */);
1094
+ get audioRecvPackets(): any/* kotlin.Number */;
1095
+ get audioRecvPacketsLost(): any/* kotlin.Number */;
1096
+ get audioRecvBytes(): any/* kotlin.Number */;
1097
+ get audioRecvJitter(): any/* kotlin.Number */;
1098
+ get audioSentPackets(): any/* kotlin.Number */;
1099
+ get audioSentBytes(): any/* kotlin.Number */;
1100
+ get audioSentPacketsLost(): any/* kotlin.Number */;
1101
+ get audioRtt(): any/* kotlin.Number */;
1102
+ get audioSentJitter(): any/* kotlin.Number */;
1103
+ copy(audioRecvPackets?: any/* kotlin.Number */, audioRecvPacketsLost?: any/* kotlin.Number */, audioRecvBytes?: any/* kotlin.Number */, audioRecvJitter?: any/* kotlin.Number */, audioSentPackets?: any/* kotlin.Number */, audioSentBytes?: any/* kotlin.Number */, audioSentPacketsLost?: any/* kotlin.Number */, audioRtt?: any/* kotlin.Number */, audioSentJitter?: any/* kotlin.Number */): vonage.RTCStatsJS;
1047
1104
  toString(): string;
1048
1105
  hashCode(): number;
1049
1106
  equals(other: Nullable<any>): boolean;
1107
+ static get Companion(): {
1108
+ };
1050
1109
  }
1051
1110
  }
1052
1111
  export as namespace clientsdk_clientcore_js;
@@ -1,5 +1,6 @@
1
1
  import * as KMPPackage from '../kotlin/clientsdk-clientcore_js';
2
2
  import vonage from '../utils/vonage';
3
+ import 'webrtc-adapter';
3
4
  declare class MediaClient implements vonage.MediaClientJS {
4
5
  delegate: KMPPackage.Nullable<vonage.MediaClientDelegateJS>;
5
6
  private pcs;
@@ -1,22 +1,28 @@
1
1
  import { Nullable } from '../kotlin/clientsdk-clientcore_js';
2
2
  import vonage from '../utils/vonage';
3
+ import { LoggingLevel, VonageLogger, VonageLoggerJS } from './logging';
4
+ export type ConfigRegion = vonage.CoreClientConfigRegionJS | typeof vonage.CoreClientConfigRegionJS.prototype.name;
3
5
  export declare const ConfigRegion: typeof vonage.CoreClientConfigRegionJS;
4
6
  export type ClientConfigObject = ConfigObjectJS | ({
5
- region?: typeof vonage.CoreClientConfigRegionJS.prototype.name;
7
+ region?: ConfigRegion;
6
8
  } & Omit<ConfigObjectJS, 'region'>);
7
9
  export type ClientInitConfigObject = InitConfigObjectJS | ({
8
- region?: typeof vonage.CoreClientConfigRegionJS.prototype.name;
9
- loggingLevel?: typeof vonage.LoggingLevelJS.prototype.name;
10
- } & Omit<InitConfigObjectJS, 'region' | 'loggingLevel'>);
10
+ region?: ConfigRegion;
11
+ loggingLevel?: LoggingLevel;
12
+ customLoggers?: VonageLogger[];
13
+ } & Omit<InitConfigObjectJS, 'region' | 'loggingLevel' | 'customLoggers'>);
11
14
  export interface ConfigObjectJS {
12
15
  region?: Nullable<vonage.CoreClientConfigRegionJS>;
13
16
  apiUrl?: Nullable<string>;
14
17
  websocketUrl?: Nullable<string>;
15
18
  websocketPath?: Nullable<string>;
16
19
  autoMediaReoffer?: Nullable<boolean>;
20
+ rtcStatsTelemetry?: Nullable<boolean>;
17
21
  }
18
22
  export interface InitConfigObjectJS extends ConfigObjectJS {
19
23
  loggingLevel?: Nullable<vonage.LoggingLevelJS>;
24
+ customLoggers?: Nullable<VonageLoggerJS[]>;
25
+ disableInternalLogger?: Nullable<boolean>;
20
26
  }
21
27
  /**
22
28
  * Represents the configuration object for the client.
@@ -25,7 +31,7 @@ export interface InitConfigObjectJS extends ConfigObjectJS {
25
31
  * These properties control different aspects of the client's behavior, such as API URLs, media reoffer, and WebSocket settings.
26
32
  *
27
33
  * @example
28
- * [[include:set_client_config.txt]]
34
+ * [[include:snippet_setClientConfig.txt]]
29
35
  */
30
36
  export declare class ClientConfig extends vonage.CoreClientConfigJS {
31
37
  /**
@@ -36,17 +42,20 @@ export declare class ClientConfig extends vonage.CoreClientConfigJS {
36
42
  * The URLs will be automatically set based on the selected region.
37
43
  * Defaults to "US" if no region is specified.
38
44
  */
39
- constructor(region?: vonage.CoreClientConfigRegionJS | typeof vonage.CoreClientConfigRegionJS.prototype.name);
45
+ constructor(region?: ConfigRegion);
40
46
  }
41
- export declare class ClientInitConfig extends vonage.CoreClientInitConfigJS {
47
+ export declare class ClientInitConfig implements InitConfigObjectJS {
48
+ loggingLevel: vonage.LoggingLevelJS;
49
+ region: vonage.CoreClientConfigRegionJS;
50
+ customLoggers: VonageLoggerJS[];
51
+ disableInternalLogger: boolean;
52
+ apiUrl?: Nullable<string>;
53
+ websocketUrl?: Nullable<string>;
54
+ websocketPath?: Nullable<string>;
55
+ autoMediaReoffer?: Nullable<boolean>;
42
56
  /**
43
57
  * Constructs a new instance of the class.
44
- *
45
- * @param loggingLevel The logging level to set for the SDK. Default is Error.
46
- * @param region The region where the API and WebSocket URLs should be configured.
47
- * Valid values are "EU" (Europe), "US" (United States), or "AP" (Asia Pacific).
48
- * The URLs will be automatically set based on the selected region.
49
- * Defaults to "US" if no region is specified.
50
58
  */
51
- constructor(loggingLevel?: vonage.LoggingLevelJS | typeof vonage.LoggingLevelJS.prototype.name, region?: vonage.CoreClientConfigRegionJS | typeof vonage.CoreClientConfigRegionJS.prototype.name);
59
+ constructor(loggingLevel?: LoggingLevel, region?: ConfigRegion, customLoggers?: Array<VonageLogger | VonageLoggerJS>);
52
60
  }
61
+ export declare const convertInitConfig: (config: ClientInitConfigObject) => InitConfigObjectJS;
@@ -1,5 +1,5 @@
1
- export * from './ClientConfig';
2
- export * from './logging';
1
+ export { ClientConfig, ClientInitConfig, ClientConfigObject, ClientInitConfigObject, ConfigRegion, convertInitConfig } from './ClientConfig';
2
+ export { type Topic, type VonageLogger, LoggingLevel, Topics, createVonageLogger, setDefaultLoggingLevel } from './logging';
3
3
  export * from './ConversationModels';
4
4
  export * from '../kotlin/JsUnions';
5
5
  export * from './ErrorModels';
@@ -1,3 +1,26 @@
1
+ import { Nullable } from '../kotlin/clientsdk-clientcore_js';
1
2
  import vonage from '../utils/vonage';
3
+ export type Topics = vonage.Topics | typeof Topics.prototype.name;
4
+ export declare const Topics: typeof vonage.Topics;
5
+ export type Topic = vonage.TopicJS;
6
+ export declare const Topic: typeof vonage.TopicJS;
7
+ export type LoggingLevelName = typeof vonage.LoggingLevelJS.prototype.name;
8
+ export type LoggingLevel = vonage.LoggingLevelJS | LoggingLevelName;
2
9
  export declare const LoggingLevel: typeof vonage.LoggingLevelJS;
10
+ /**
11
+ * @deprecated Use {@link ClientInitConfig.loggingLevel} instead.
12
+ * @param level - The logging level to set.
13
+ */
3
14
  export declare const setDefaultLoggingLevel: typeof vonage.setDefaultLoggingLevel;
15
+ export type VonageLogger = VonageLoggerJS | ({
16
+ minLogLevel?: LoggingLevel;
17
+ topics?: Topics[];
18
+ } & Omit<VonageLoggerJS, 'minLogLevel' | 'topics'>);
19
+ export declare const convertLogger: (logger: VonageLogger) => VonageLoggerJS;
20
+ export interface VonageLoggerJS {
21
+ name: string;
22
+ minLogLevel?: Nullable<vonage.LoggingLevelJS>;
23
+ topics?: Nullable<vonage.Topics[]>;
24
+ onLog(level: LoggingLevelName, topic: Topic, message: string): void;
25
+ }
26
+ export declare const createVonageLogger: (name: string, onLog: (level: LoggingLevelName, topic: Topic, message: string) => void, minLogLevel?: LoggingLevel, topics?: Topics[]) => VonageLogger;