@vonage/client-sdk 1.2.1-beta.6 → 1.2.1-snapshot.100.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.
Files changed (116) hide show
  1. package/README.md +11 -8
  2. package/api_docs/ts/.nojekyll +1 -0
  3. package/api_docs/ts/assets/highlight.css +127 -0
  4. package/api_docs/ts/assets/main.js +59 -0
  5. package/api_docs/ts/assets/navigation.js +1 -0
  6. package/api_docs/ts/assets/search.js +1 -0
  7. package/api_docs/ts/assets/style.css +1394 -0
  8. package/api_docs/ts/classes/ClientConfig.html +13 -0
  9. package/api_docs/ts/classes/ClientInitConfig.html +12 -0
  10. package/api_docs/ts/classes/VonageClient.html +308 -0
  11. package/api_docs/ts/functions/none.html +2 -0
  12. package/api_docs/ts/functions/setDefaultLoggingLevel.html +3 -0
  13. package/api_docs/ts/functions/setVonageClientLoggingLevel.html +3 -0
  14. package/api_docs/ts/functions/some.html +3 -0
  15. package/api_docs/ts/index.html +33 -0
  16. package/api_docs/ts/interfaces/CallSayParams.html +8 -0
  17. package/api_docs/ts/interfaces/Channel.html +8 -0
  18. package/api_docs/ts/interfaces/ClientConfigObject.html +18 -0
  19. package/api_docs/ts/interfaces/ClientInitConfigObject.html +24 -0
  20. package/api_docs/ts/interfaces/Conversation.html +20 -0
  21. package/api_docs/ts/interfaces/ConversationProperties.html +8 -0
  22. package/api_docs/ts/interfaces/ConversationTimestamp.html +5 -0
  23. package/api_docs/ts/interfaces/ConversationsPage.html +8 -0
  24. package/api_docs/ts/interfaces/CreateConversationParameters.html +15 -0
  25. package/api_docs/ts/interfaces/CustomConversationEvent.html +17 -0
  26. package/api_docs/ts/interfaces/EmbeddedInfo.html +9 -0
  27. package/api_docs/ts/interfaces/EphemeralConversationEvent.html +13 -0
  28. package/api_docs/ts/interfaces/EventDeleteConversationEvent.html +15 -0
  29. package/api_docs/ts/interfaces/EventsPage.html +8 -0
  30. package/api_docs/ts/interfaces/GetConversationEventsParameters.html +14 -0
  31. package/api_docs/ts/interfaces/GetConversationMembersParameters.html +8 -0
  32. package/api_docs/ts/interfaces/GetConversationsParameters.html +12 -0
  33. package/api_docs/ts/interfaces/Leg.html +20 -0
  34. package/api_docs/ts/interfaces/LegChannel.html +8 -0
  35. package/api_docs/ts/interfaces/Location.html +6 -0
  36. package/api_docs/ts/interfaces/Member.html +12 -0
  37. package/api_docs/ts/interfaces/MemberChannel.html +8 -0
  38. package/api_docs/ts/interfaces/MemberEventBody.html +6 -0
  39. package/api_docs/ts/interfaces/MemberInvitedEvent.html +15 -0
  40. package/api_docs/ts/interfaces/MemberJoinedEvent.html +15 -0
  41. package/api_docs/ts/interfaces/MemberLeftEvent.html +15 -0
  42. package/api_docs/ts/interfaces/MemberTimestamp.html +5 -0
  43. package/api_docs/ts/interfaces/MembersPage.html +8 -0
  44. package/api_docs/ts/interfaces/MessageAudioEvent.html +15 -0
  45. package/api_docs/ts/interfaces/MessageAudioEventBody.html +6 -0
  46. package/api_docs/ts/interfaces/MessageCustomEvent.html +15 -0
  47. package/api_docs/ts/interfaces/MessageCustomEventBody.html +6 -0
  48. package/api_docs/ts/interfaces/MessageFileEvent.html +15 -0
  49. package/api_docs/ts/interfaces/MessageFileEventBody.html +7 -0
  50. package/api_docs/ts/interfaces/MessageImageEvent.html +15 -0
  51. package/api_docs/ts/interfaces/MessageImageEventBody.html +7 -0
  52. package/api_docs/ts/interfaces/MessageLocationEvent.html +15 -0
  53. package/api_docs/ts/interfaces/MessageLocationEventBody.html +7 -0
  54. package/api_docs/ts/interfaces/MessageTemplateEvent.html +15 -0
  55. package/api_docs/ts/interfaces/MessageTemplateEventBody.html +10 -0
  56. package/api_docs/ts/interfaces/MessageTextEvent.html +15 -0
  57. package/api_docs/ts/interfaces/MessageTextEventBody.html +7 -0
  58. package/api_docs/ts/interfaces/MessageVCardEvent.html +15 -0
  59. package/api_docs/ts/interfaces/MessageVCardEventBody.html +7 -0
  60. package/api_docs/ts/interfaces/MessageVideoEvent.html +15 -0
  61. package/api_docs/ts/interfaces/MessageVideoEventBody.html +7 -0
  62. package/api_docs/ts/interfaces/RTCQuality.html +11 -0
  63. package/api_docs/ts/interfaces/RtcStats.html +11 -0
  64. package/api_docs/ts/interfaces/System.html +7 -0
  65. package/api_docs/ts/interfaces/Template.html +4 -0
  66. package/api_docs/ts/interfaces/UpdateConversationParameters.html +17 -0
  67. package/api_docs/ts/interfaces/User.html +16 -0
  68. package/api_docs/ts/interfaces/UserChannels.html +14 -0
  69. package/api_docs/ts/interfaces/UserTimestamp.html +5 -0
  70. package/api_docs/ts/interfaces/VonageEvent.html +2 -0
  71. package/api_docs/ts/interfaces/VonageLogger.html +10 -0
  72. package/api_docs/ts/interfaces/Whatsapp.html +4 -0
  73. package/api_docs/ts/modules.html +82 -0
  74. package/api_docs/ts/types/ChannelType.html +2 -0
  75. package/api_docs/ts/types/ConfigRegion.html +3 -0
  76. package/api_docs/ts/types/ConversationEvent.html +2 -0
  77. package/api_docs/ts/types/ConversationState.html +2 -0
  78. package/api_docs/ts/types/CustomData.html +3 -0
  79. package/api_docs/ts/types/From.html +2 -0
  80. package/api_docs/ts/types/Json.html +2 -0
  81. package/api_docs/ts/types/JsonValue.html +2 -0
  82. package/api_docs/ts/types/LoggingLevel.html +4 -0
  83. package/api_docs/ts/types/MemberState.html +2 -0
  84. package/api_docs/ts/types/NonPersistentConversationEvent.html +2 -0
  85. package/api_docs/ts/types/Option.html +3 -0
  86. package/api_docs/ts/types/OrderBy.html +2 -0
  87. package/api_docs/ts/types/PersistentConversationEvent.html +2 -0
  88. package/api_docs/ts/types/PresentingOrder.html +2 -0
  89. package/api_docs/ts/types/Topics.html +2 -0
  90. package/api_docs/ts/variables/Topics-1.html +2 -0
  91. package/dist/client/VonageClient.d.ts +260 -29
  92. package/dist/client/index.cjs +28243 -23482
  93. package/dist/client/index.mjs +28237 -23481
  94. package/dist/coreExtend.d.ts +9 -13
  95. package/dist/kotlin/JsUnions.d.ts +143 -92
  96. package/dist/kotlin/clientsdk-clientcore_js.d.ts +268 -197
  97. package/dist/lib/MediaClient.d.ts +1 -1
  98. package/dist/lib/SocketClient.d.ts +7 -2
  99. package/dist/utils/ClientConfig.d.ts +72 -21
  100. package/dist/utils/ConversationEventBodies.d.ts +134 -0
  101. package/dist/utils/ConversationModels.d.ts +150 -12
  102. package/dist/utils/ErrorModels.d.ts +1 -0
  103. package/dist/utils/JsonUtils.d.ts +15 -0
  104. package/dist/utils/Option.d.ts +20 -0
  105. package/dist/utils/RequestParameterModels.d.ts +108 -0
  106. package/dist/utils/index.d.ts +6 -2
  107. package/dist/utils/logging.d.ts +53 -1
  108. package/dist/vonageClientSDK.js +27845 -22942
  109. package/dist/vonageClientSDK.min.js +1 -1
  110. package/dist/vonageClientSDK.min.mjs +1 -1
  111. package/dist/vonageClientSDK.mjs +27839 -22941
  112. package/package.json +7 -3
  113. package/scripts/replaceAllDoNotUseOrImplement.js +25 -0
  114. package/typedoc.json +43 -0
  115. package/dist/global.d.ts +0 -7
  116. package/dist/utils/ConnectivityManager.d.ts +0 -11
@@ -1,11 +1,11 @@
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;
6
7
  private audio;
7
8
  private intervalId;
8
- private connectivityManager;
9
9
  constructor();
10
10
  enableRtcStatsCollection(interval: number, mediaId: string): void;
11
11
  enableMediaInbound(closure: (err: unknown, offerSDP: KMPPackage.Nullable<string>) => void, offerSDP: string, rtcId: string): Promise<void>;
@@ -3,10 +3,15 @@ import vonage from '../utils/vonage';
3
3
  declare class SocketClient implements vonage.SocketClientJS {
4
4
  delegate: KMPPackage.Nullable<vonage.SocketClientDelegateJS>;
5
5
  private socket;
6
+ private token;
7
+ private sessionId;
8
+ private setQuery;
6
9
  emit(type: string, msg: unknown, _callback: (p0: KMPPackage.Nullable<Error>, p1: KMPPackage.Nullable<string>) => void): void;
7
- connect(host: string, path: string, reconnectionAttempts: number, reconnectionDelay: number, randomizationFactor: number, query: string): void;
10
+ connect(host: string, path: string, reconnectionAttempts: number, reconnectionDelay: number, randomizationFactor: number, token: string, sessionId: KMPPackage.Nullable<string>, query: string): void;
8
11
  disconnect(): void;
9
12
  startVerifyResponseTimer(milliseconds: number, callback: () => void): void;
10
- setConnectParamsSocketConfig(token: string): void;
13
+ setConnectParamsSocketConfig(sessionId: string, token: string): void;
14
+ setSocketSessionId(sessionId: string): void;
15
+ setSocketToken(token: string): void;
11
16
  }
12
17
  export default SocketClient;
@@ -1,27 +1,74 @@
1
1
  import { Nullable } from '../kotlin/clientsdk-clientcore_js';
2
2
  import vonage from '../utils/vonage';
3
+ import { LoggingLevel, VonageLogger, VonageLoggerJS } from './logging';
4
+ /**
5
+ * The datacenter region for the Client.
6
+ *
7
+ * It can be set either via {@link ClientInitConfigObject} or {@link ClientConfigObject}.
8
+ */
9
+ export type ConfigRegion = vonage.CoreClientConfigRegionJS | typeof vonage.CoreClientConfigRegionJS.prototype.name;
3
10
  export declare const ConfigRegion: typeof vonage.CoreClientConfigRegionJS;
4
- export type ClientConfigObject = ConfigObjectJS;
5
- export type ClientInitConfigObject = InitConfigObjectJS;
11
+ /**
12
+ * An convenience union for {@link ConfigObjectJS} allowing to pass strings for enum properties.
13
+ */
14
+ /**
15
+ * Represents the configuration object for the client.
16
+ *
17
+ * The `ClientConfig` class provides a convenient way to configure the client by specifying various properties.
18
+ * These properties control different aspects of the client's behavior, such as API URLs, media reoffer, and WebSocket settings.
19
+ *
20
+ * @property region The Vonage datacenter to use
21
+ * @property apiUrl The API URL of your chosen datacenter, if set overrides default from region
22
+ * @property websocketUrl The WebSocket URL of your chosen datacenter, if set overrides default from region
23
+ * @property websocketPath The Path component appended to the Websocket URL
24
+ * @property rtcStatsTelemetry Allow users to enable RTCStats
25
+ * @property autoReconnectMedia Allow the sdk to automatically reconnect media when network interface changes
26
+ * @interface
27
+ *
28
+ * @example
29
+ * [[include:snippet_SetClientConfig.txt]]
30
+ */
31
+ export type ClientConfigObject = ConfigObjectJS | ({
32
+ region?: ConfigRegion;
33
+ } & Omit<ConfigObjectJS, 'region'>);
34
+ /**
35
+ * Represents the configuration object used to initialize the client.
36
+ *
37
+ * The `ClientInitConfig` class provides a convenient way to configure the client by specifying various properties.
38
+ * These properties include all the ones in {@link ClientConfigObject} plus {@link loggingLevel}, {@link customLoggers} and {@link disableInternalLogger}.
39
+ *
40
+ * @property loggingLevel The Logging Level to use
41
+ * @property customLoggers A List of custom loggers
42
+ * @property disableInternalLogger Whether to enable the SDK internal logger
43
+ * @property region The Vonage datacenter to use
44
+ * @property apiUrl The API URL of your chosen datacenter, if set overrides default from region
45
+ * @property websocketUrl The WebSocket URL of your chosen datacenter, if set overrides default from region
46
+ * @property websocketPath The Path component appended to the Websocket URL
47
+ * @property rtcStatsTelemetry Allow users to enable RTCStats
48
+ * @property autoReconnectMedia Allow the sdk to automatically reconnect media when network interface changes
49
+ * @interface
50
+ *
51
+ * @example
52
+ * [[include:snippet_Logging.txt]]
53
+ */
54
+ export type ClientInitConfigObject = InitConfigObjectJS | ({
55
+ region?: ConfigRegion;
56
+ loggingLevel?: LoggingLevel;
57
+ customLoggers?: VonageLogger[];
58
+ } & Omit<InitConfigObjectJS, 'region' | 'loggingLevel' | 'customLoggers'>);
6
59
  export interface ConfigObjectJS {
7
60
  region?: Nullable<vonage.CoreClientConfigRegionJS>;
8
61
  apiUrl?: Nullable<string>;
9
62
  websocketUrl?: Nullable<string>;
10
63
  websocketPath?: Nullable<string>;
11
- autoMediaReoffer?: Nullable<boolean>;
64
+ rtcStatsTelemetry?: Nullable<boolean>;
65
+ autoReconnectMedia?: Nullable<boolean>;
12
66
  }
13
67
  export interface InitConfigObjectJS extends ConfigObjectJS {
14
68
  loggingLevel?: Nullable<vonage.LoggingLevelJS>;
69
+ customLoggers?: Nullable<VonageLoggerJS[]>;
70
+ disableInternalLogger?: Nullable<boolean>;
15
71
  }
16
- /**
17
- * Represents the configuration object for the client.
18
- *
19
- * The `ClientConfig` class provides a convenient way to configure the client by specifying various properties.
20
- * These properties control different aspects of the client's behavior, such as API URLs, media reoffer, and WebSocket settings.
21
- *
22
- * @example
23
- * [[include:set_client_config.txt]]
24
- */
25
72
  export declare class ClientConfig extends vonage.CoreClientConfigJS {
26
73
  /**
27
74
  * Constructs a new instance of the class.
@@ -31,17 +78,21 @@ export declare class ClientConfig extends vonage.CoreClientConfigJS {
31
78
  * The URLs will be automatically set based on the selected region.
32
79
  * Defaults to "US" if no region is specified.
33
80
  */
34
- constructor(region?: vonage.CoreClientConfigRegionJS);
81
+ constructor(region?: ConfigRegion);
35
82
  }
36
- export declare class ClientInitConfig extends vonage.CoreClientInitConfigJS {
83
+ export declare class ClientInitConfig implements InitConfigObjectJS {
84
+ loggingLevel: vonage.LoggingLevelJS;
85
+ region: vonage.CoreClientConfigRegionJS;
86
+ customLoggers: VonageLoggerJS[];
87
+ disableInternalLogger: boolean;
88
+ apiUrl?: Nullable<string>;
89
+ websocketUrl?: Nullable<string>;
90
+ websocketPath?: Nullable<string>;
91
+ rtcStatsTelemetry?: Nullable<boolean>;
92
+ autoReconnectMedia?: Nullable<boolean>;
37
93
  /**
38
94
  * Constructs a new instance of the class.
39
- *
40
- * @param loggingLevel The logging level to set for the SDK. Default is Error.
41
- * @param region The region where the API and WebSocket URLs should be configured.
42
- * Valid values are "EU" (Europe), "US" (United States), or "AP" (Asia Pacific).
43
- * The URLs will be automatically set based on the selected region.
44
- * Defaults to "US" if no region is specified.
45
95
  */
46
- constructor(loggingLevel?: vonage.LoggingLevelJS, region?: vonage.CoreClientConfigRegionJS);
96
+ constructor(loggingLevel?: LoggingLevel, region?: ConfigRegion, customLoggers?: Array<VonageLogger | VonageLoggerJS>);
47
97
  }
98
+ export declare const convertInitConfig: (config: ClientInitConfigObject) => InitConfigObjectJS;
@@ -0,0 +1,134 @@
1
+ import vonage from '../utils/vonage';
2
+ /**
3
+ * The {@link MessageAudioEvent} Body type
4
+ *
5
+ * @beta
6
+ * @property audio The audio URL
7
+ * @property deleted The message deletion timestamp
8
+ * @interface
9
+ * @group Chat
10
+ */
11
+ export type MessageAudioEventBody = vonage.MessageAudioEventJS.MessageAudioEventBody;
12
+ /**
13
+ * The {@link MessageCustomEvent} Body type
14
+ *
15
+ * @beta
16
+ * @property custom The message custom data
17
+ * @property deleted The message deletion timestamp
18
+ * @interface
19
+ * @group Chat
20
+ */
21
+ export type MessageCustomEventBody = vonage.MessageCustomEventJS.MessageCustomEventBody;
22
+ /**
23
+ * The {@link MessageFileEvent} Body type
24
+ *
25
+ * @beta
26
+ * @property fileUrl The file URL
27
+ * @property deleted The message deletion timestamp
28
+ * @interface
29
+ * @group Chat
30
+ */
31
+ export type MessageFileEventBody = vonage.MessageFileEventJS.MessageFileEventBody;
32
+ /**
33
+ * The {@link MessageImageEvent} Body type
34
+ *
35
+ * @beta
36
+ * @property imageUrl The image URL
37
+ * @property deleted The message deletion timestamp
38
+ * @interface
39
+ * @group Chat
40
+ */
41
+ export type MessageImageEventBody = vonage.MessageImageEventJS.MessageImageEventBody;
42
+ /**
43
+ * The {@link MessageLocationEvent} Body type
44
+ *
45
+ * @beta
46
+ * @property location The {@link Location} object
47
+ * @property deleted The message deletion timestamp
48
+ * @interface
49
+ * @group Chat
50
+ */
51
+ export type MessageLocationEventBody = vonage.MessageLocationEventJS.MessageLocationEventBody;
52
+ /**
53
+ * The {@link MessageTemplateEvent} Body type
54
+ *
55
+ * @beta
56
+ * @property template The {@link Template} object
57
+ * @property whatsapp The {@link Whatsapp} object
58
+ * @property deleted The message deletion timestamp
59
+ * @interface
60
+ * @group Chat
61
+ */
62
+ export type MessageTemplateEventBody = vonage.MessageTemplateEventJS.MessageTemplateEventBody;
63
+ /**
64
+ * The {@link MessageVCardEvent} Body type
65
+ *
66
+ * @beta
67
+ * @property vcardUrl The VCard URL
68
+ * @property deleted The message deletion timestamp
69
+ * @interface
70
+ * @group Chat
71
+ */
72
+ export type MessageVCardEventBody = vonage.MessageVCardEventJS.MessageVCardEventBody;
73
+ /**
74
+ * The {@link MessageVideoEvent} Body type
75
+ *
76
+ * @beta
77
+ * @property videoUrl The Video URL
78
+ * @property deleted The message deletion timestamp
79
+ * @interface
80
+ * @group Chat
81
+ */
82
+ export type MessageVideoEventBody = vonage.MessageVideoEventJS.MessageVideoEventBody;
83
+ /**
84
+ * The {@link MessageTextEvent} Body type
85
+ *
86
+ * @beta
87
+ * @property text The message text
88
+ * @property deleted The message deletion timestamp
89
+ * @interface
90
+ * @group Chat
91
+ */
92
+ export type MessageTextEventBody = vonage.MessageTextEventJS.MessageTextEventBody;
93
+ /**
94
+ * The {@link MemberInvitedEvent}, {@link MemberJoinedEvent} and {@link MemberLeftEvent} Body type
95
+ *
96
+ * @beta
97
+ * @property memberId The member id
98
+ * @property user The {@link User} associated to the member
99
+ * @interface
100
+ * @group Chat
101
+ */
102
+ export type MemberEventBody = vonage.MemberEventBodyJS;
103
+ /**
104
+ * The Location object for a {@link MessageLocationEventBody}
105
+ *
106
+ * @beta
107
+ * @group Chat
108
+ */
109
+ export interface Location {
110
+ name?: string | null;
111
+ address?: string | null;
112
+ latitude: string;
113
+ longitude: string;
114
+ }
115
+ /**
116
+ * The Template object for a {@link MessageTemplateEventBody}
117
+ *
118
+ * @beta
119
+ * @group Chat
120
+ */
121
+ export interface Template {
122
+ name: string;
123
+ parameters?: string[] | null;
124
+ }
125
+ /**
126
+ * The Whatsapp object for a {@link MessageTemplateEventBody}
127
+ *
128
+ * @beta
129
+ * @group Chat
130
+ */
131
+ export interface Whatsapp {
132
+ policy: string;
133
+ locale: string;
134
+ }
@@ -1,16 +1,154 @@
1
1
  import vonage from '../utils/vonage';
2
- export type Conversation = vonage.ConversationJS;
3
- export type ConversationsPage = vonage.ConversationsPageJS;
4
- export type ConversationState = vonage.ConversationStateJS;
5
- export declare const ConversationState: typeof vonage.ConversationStateJS;
6
- export type Member = vonage.MemberJS;
7
- export type MembersPage = vonage.MembersPageJS;
8
- export type MemberState = vonage.MemberStateJS;
9
- export declare const MemberState: typeof vonage.MemberStateJS;
2
+ import { ConversationState, MemberState, PersistentConversationEvent } from '../kotlin/JsUnions';
3
+ /**
4
+ * Represents a conversation
5
+ *
6
+ * @property id The conversation id
7
+ * @property name The conversation name
8
+ * @property timestamp The conversation timestamp
9
+ * @property memberId The user member id in the conversation
10
+ * @property memberState The user member state in the conversation
11
+ * @property displayName The conversation display name
12
+ * @property imageUrl The conversation image url
13
+ * @property state The conversation state
14
+ * @property properties The conversation properties
15
+ * @interface
16
+ */
17
+ export type Conversation = vonage.ConversationJS & {
18
+ memberState?: MemberState;
19
+ state?: ConversationState;
20
+ };
21
+ /**
22
+ * Represents a {@link Conversation} timestamps
23
+ *
24
+ * @interface
25
+ */
26
+ export type ConversationTimestamp = vonage.ConversationTimestampJS;
27
+ /**
28
+ * Represents the properties for a {@link Conversation}
29
+ *
30
+ * @property ttl The time-to-live (TTL) for the conversation in seconds.
31
+ * @property customSortKey A string according to which Conversations will be ordered
32
+ * @property customData The Conversation custom data
33
+ * @interface
34
+ */
35
+ export type ConversationProperties = vonage.ConversationJS.Properties;
36
+ /**
37
+ * Represents a page of conversations
38
+ *
39
+ * @beta
40
+ * @property conversations The conversations in the page
41
+ * @property previousCursor The cursor to fetch the previous page
42
+ * @property nextCursor The cursor to fetch the next page
43
+ * @interface
44
+ * @group Chat
45
+ */
46
+ export type ConversationsPage = vonage.ConversationsPageJS & {
47
+ conversations: Conversation[];
48
+ };
49
+ /**
50
+ * Represents a page of conversation events
51
+ *
52
+ * @beta
53
+ * @property events The events in the page
54
+ * @property previousCursor The cursor to fetch the previous page
55
+ * @property nextCursor The cursor to fetch the next page
56
+ * @interface
57
+ * @group Chat
58
+ */
59
+ export type EventsPage = vonage.EventsPageJS & {
60
+ events: PersistentConversationEvent[];
61
+ };
62
+ /**
63
+ * Represents the membership of a user in a conversation
64
+ *
65
+ * @property id The member id
66
+ * @property state The member state
67
+ * @property user The user associated to the member
68
+ * @property channel The member channel
69
+ * @property timestamp The member timestamp
70
+ * @interface
71
+ */
72
+ export type Member = vonage.MemberJS & {
73
+ state?: MemberState;
74
+ };
75
+ /**
76
+ * Represents a {@link Member} timestamps
77
+ *
78
+ * @interface
79
+ */
80
+ export type MemberTimestamp = vonage.MemberTimestampJS;
81
+ /**
82
+ * Represents a page of conversation members
83
+ *
84
+ * @beta
85
+ * @property members The members in the page
86
+ * @property previousCursor The cursor to fetch the previous page
87
+ * @property nextCursor The cursor to fetch the next page
88
+ * @interface
89
+ * @group Chat
90
+ */
91
+ export type MembersPage = vonage.MembersPageJS & {
92
+ members: Member[];
93
+ };
94
+ /**
95
+ * Represents an SDK user
96
+ *
97
+ * @property id The user id
98
+ * @property name The user name
99
+ * @property displayName The user display name
100
+ * @property channels The user channels
101
+ * @property timestamp The user timestamp
102
+ * @property imageUrl The user image url
103
+ * @property customData The user custom data
104
+ * @interface
105
+ */
10
106
  export type User = vonage.UserJS;
107
+ /**
108
+ * Represents an {@link User} timestamps
109
+ *
110
+ * @interface
111
+ */
112
+ export type UserTimestamp = vonage.UserTimestampJS;
113
+ /**
114
+ * The type of a {@link MemberChannel}
115
+ */
11
116
  export type ChannelType = vonage.ChannelTypeJS;
12
117
  export declare const ChannelType: typeof vonage.ChannelTypeJS;
13
- export type PresentingOrder = vonage.PresentingOrderJS;
14
- export declare const PresentingOrder: typeof vonage.PresentingOrderJS;
15
- export type OrderBy = vonage.OrderByJS;
16
- export declare const OrderBy: typeof vonage.OrderByJS;
118
+ /**
119
+ * Represents a Member Channel
120
+ *
121
+ * @property type The {@link ChannelType}
122
+ * @property from The from {@link Channel}
123
+ * @property to The to {@link Channel}
124
+ * @interface
125
+ */
126
+ export type MemberChannel = vonage.MemberChannelJS;
127
+ /**
128
+ * Represents a Channel.
129
+ * It will hold either an id or a number, depending on the Channel,
130
+ * but never both of them.
131
+ *
132
+ * @property id The Channel id
133
+ * @property number The Channel number
134
+ * @interface
135
+ */
136
+ export type Channel = vonage.ChannelJS;
137
+ /**
138
+ * Represents all the Channels of a certain {@link User}.
139
+ * For each type of Channel, it will hold an array of {@link Channel}
140
+ *
141
+ * @property app
142
+ * @property phone
143
+ * @property pstn
144
+ * @property sip
145
+ * @property vbc
146
+ * @property websocket
147
+ * @property sms
148
+ * @property mms
149
+ * @property whatsapp
150
+ * @property viber
151
+ * @property messenger
152
+ * @interface
153
+ */
154
+ export type UserChannels = vonage.UserChannelsJS;
@@ -13,6 +13,7 @@ export declare const CSErrorCodes: {
13
13
  readonly INVALID_CURSOR: string;
14
14
  readonly VALIDATION_FAIL: string;
15
15
  readonly CONVERSATION_MAX_NUMBER_OF_MEMBERS: string;
16
+ readonly CUSTOM_DATA_OVERALL_LIMIT_EXCEEDED: string;
16
17
  };
17
18
  export declare const SessionErrorCodes: {
18
19
  readonly EMPTY_TOKEN: string;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * A valid Json property value
3
+ */
4
+ export type JsonValue = object | null | boolean | string | number;
5
+ /**
6
+ * A Json Object or an array of Json object
7
+ */
8
+ export type Json = {
9
+ [property: string]: Json | JsonValue;
10
+ } | Json[];
11
+ /**
12
+ * Represents custom data, which can be a JSON object or a JSON-formatted string.
13
+ * There is a 2MB limit on the size of the custom data object.
14
+ */
15
+ export type CustomData = Json | string;
@@ -0,0 +1,20 @@
1
+ import vonage from './vonage';
2
+ /**
3
+ * Represents an Either monad for optional properties.
4
+ *
5
+ * @beta
6
+ * It can be also set via the helper functions {@link some} and {@link none}.
7
+ */
8
+ export type Option<T> = vonage.utils.OptionJS<T>;
9
+ export declare const Option: typeof vonage.utils.OptionJS;
10
+ export declare const mapOption: <T>(value?: T | undefined) => Option<T | null>;
11
+ /**
12
+ * @param value The wrapped value
13
+ * @returns An {@link Option.Some}
14
+ */
15
+ export declare const some: <T>(value: T) => Option<T>;
16
+ /**
17
+ *
18
+ * @returns An {@link Option.None}
19
+ */
20
+ export declare const none: <T>() => Option<T>;
@@ -0,0 +1,108 @@
1
+ import vonage from './vonage';
2
+ import { CustomData } from './JsonUtils';
3
+ import { Nullable } from '../kotlin/clientsdk-clientcore_js';
4
+ import { Option } from './Option';
5
+ /**
6
+ * Parameters object for {@link VonageClient.createConversation}
7
+ *
8
+ * @beta
9
+ * @property name The name to initialize the conversation with
10
+ * @property displayName The displayName to initialize the conversation with
11
+ * @property imageUrl The name to imageUrl the conversation with
12
+ * @property ttl The time-to-live (in seconds) to initialize the conversation with
13
+ * @property customSortKey The customSortKey to initialize the conversation with.
14
+ * When {@link GetConversationsParameters.orderBy} is set to {@link OrderBy.CUSTOM_SORT_KEY}, conversations will be sorted according to the value of this property.
15
+ * @property customData Custom data associated with the conversation
16
+ * @interface
17
+ * @group Chat
18
+ */
19
+ export type CreateConversationParameters = Omit<vonage.CreateConversationParametersJS, 'ttl' | 'customData'> & {
20
+ ttl?: Nullable<number>;
21
+ customData?: Nullable<CustomData>;
22
+ };
23
+ /**
24
+ * Parameters object for {@link VonageClient.getConversations}
25
+ *
26
+ * @beta
27
+ * @property order The order in which conversations are presented, default is {@link PresentingOrder.ASC}.
28
+ * @property pageSize The maximum number of conversations to retrieve per request, default is 10.
29
+ * @property cursor The cursor indicating the starting point for pagination, default is the first page.
30
+ * @property includeCustomData Indicates whether to include custom data in the results, default is false.
31
+ * @property orderBy The strategy for ordering the conversations, default is {@link OrderBy.CREATED}.
32
+ * @interface
33
+ * @group Chat
34
+ */
35
+ export type GetConversationsParameters = Omit<vonage.GetConversationsParametersJS, 'pageSize'> & {
36
+ pageSize?: Nullable<number>;
37
+ };
38
+ /**
39
+ * Parameters object for {@link VonageClient.getConversationEvents}
40
+ *
41
+ * @beta
42
+ * @property order The order in which conversation events are presented, default is {@link PresentingOrder.ASC}.
43
+ * @property pageSize The maximum number of conversation events to retrieve per request, default is 10.
44
+ * @property cursor The cursor indicating the starting point for pagination, default is the first page.
45
+ * @property eventFilter A list of strings containing the types of events to be fetched and should have maximum 5 elements, default includes all events.
46
+ * @property includeDeletedEvents Indicates whether to include deleted events in the list, default is false.
47
+ * @property startId Specify the starting id of the events to be returned, default includes all events.
48
+ * @interface
49
+ * @group Chat
50
+ */
51
+ export type GetConversationEventsParameters = Omit<vonage.GetConversationEventsParametersJS, 'pageSize' | 'startId'> & {
52
+ pageSize?: Nullable<number>;
53
+ startId?: Nullable<number>;
54
+ };
55
+ /**
56
+ * Parameters object for {@link VonageClient.getConversationMembers}
57
+ *
58
+ * @beta
59
+ * @property order The order in which conversation members are presented, default is {@link PresentingOrder.ASC}.
60
+ * @property pageSize The maximum number of conversation members to retrieve per request, default is 10.
61
+ * @property cursor The cursor indicating the starting point for pagination, default is the first page.
62
+ * @interface
63
+ * @group Chat
64
+ */
65
+ export type GetConversationMembersParameters = Omit<vonage.GetConversationMembersParametersJS, 'pageSize'> & {
66
+ pageSize?: Nullable<number>;
67
+ };
68
+ /**
69
+ * Parameters object for {@link VonageClient.updateConversation}.
70
+ *
71
+ * Every property is an {@link Option} monad.
72
+ * When set to {@link Option.Some} the property will be updated.
73
+ * When set to {@link Option.None} the property will remain unchanged.
74
+ *
75
+ * @beta
76
+ * @property name The name of the conversation.
77
+ * @property displayName A display name for the conversation.
78
+ * @property imageUrl The URL of an image associated with the conversation.
79
+ * @property ttl The time-to-live (TTL) for the conversation in seconds.
80
+ * @property customSortKey A custom sort key for the conversation.
81
+ * @property customData Custom data associated with the conversation.
82
+ * @interface
83
+ * @group Chat
84
+ */
85
+ export interface UpdateConversationParameters {
86
+ name?: string | Option<string>;
87
+ displayName?: string | null | Option<string | null | undefined>;
88
+ imageUrl?: string | null | Option<string | null | undefined>;
89
+ ttl?: number | Option<number>;
90
+ customSortKey?: string | null | Option<string | null | undefined>;
91
+ customData?: CustomData | null | Option<CustomData | null | undefined>;
92
+ }
93
+ /**
94
+ * The order in which paginated objects are presented.
95
+ *
96
+ * @beta
97
+ * @group Chat
98
+ */
99
+ export type PresentingOrder = vonage.PresentingOrderJS;
100
+ export declare const PresentingOrder: typeof vonage.PresentingOrderJS;
101
+ /**
102
+ * The sorting strategy used for paginated objects.
103
+ *
104
+ * @beta
105
+ * @group Chat
106
+ */
107
+ export type OrderBy = vonage.OrderByJS;
108
+ export declare const OrderBy: typeof vonage.OrderByJS;
@@ -1,5 +1,9 @@
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, setVonageClientLoggingLevel } from './logging';
3
+ export * from './JsonUtils';
3
4
  export * from './ConversationModels';
4
5
  export * from '../kotlin/JsUnions';
5
6
  export * from './ErrorModels';
7
+ export * from './RequestParameterModels';
8
+ export * from './Option';
9
+ export * from './ConversationEventBodies';
@@ -1,3 +1,55 @@
1
+ import { Nullable } from '../kotlin/clientsdk-clientcore_js';
1
2
  import vonage from '../utils/vonage';
3
+ /**
4
+ * A group of Topics that a {@link VonageLogger} can subscribe to
5
+ */
6
+ export type Topics = vonage.Topics | typeof Topics.prototype.name;
7
+ /**
8
+ * A group of Topics that a {@link VonageLogger} can subscribe to
9
+ */
10
+ export declare const Topics: typeof vonage.Topics;
11
+ export type Topic = vonage.TopicJS;
12
+ export declare const Topic: typeof vonage.TopicJS;
13
+ export type LoggingLevelName = typeof vonage.LoggingLevelJS.prototype.name;
14
+ /**
15
+ * The Client Logging Level.
16
+ *
17
+ * It can be set for the internal logger via {@link ClientInitConfigObject.loggingLevel}
18
+ * as well as for a custom logger via {@link VonageLogger.minLogLevel}.
19
+ */
20
+ export type LoggingLevel = vonage.LoggingLevelJS | LoggingLevelName;
2
21
  export declare const LoggingLevel: typeof vonage.LoggingLevelJS;
3
- export declare const setDefaultLoggingLevel: typeof vonage.setDefaultLoggingLevel;
22
+ /**
23
+ * @deprecated Use {@link ClientInitConfigObject.loggingLevel} instead.
24
+ * @param level - The logging level to set.
25
+ */
26
+ export declare const setDefaultLoggingLevel: (level: LoggingLevel) => void;
27
+ /**
28
+ * @deprecated Use {@link ClientInitConfigObject.loggingLevel} instead.
29
+ * @param level - The logging level to set.
30
+ */
31
+ export declare const setVonageClientLoggingLevel: (level: LoggingLevel) => void;
32
+ /**
33
+ * An interface representing a client logger to be set via {@link ClientInitConfigObject.customLoggers}
34
+ *
35
+ * @property name The name of the logger.
36
+ * @property minLogLevel The minimum log level of the logger.
37
+ * @property topics The topics that the logger is subscribed to.
38
+ * @property onLog The callback to be invoked when a log is emitted.
39
+ * @interface
40
+ *
41
+ * @example
42
+ * [[include: snippet_Logging.txt]]
43
+ */
44
+ export type VonageLogger = VonageLoggerJS | ({
45
+ minLogLevel?: LoggingLevel;
46
+ topics?: Topics[];
47
+ } & Omit<VonageLoggerJS, 'minLogLevel' | 'topics'>);
48
+ export declare const convertLogger: (logger: VonageLogger) => VonageLoggerJS;
49
+ export interface VonageLoggerJS {
50
+ name: string;
51
+ minLogLevel?: Nullable<vonage.LoggingLevelJS>;
52
+ topics?: Nullable<vonage.Topics[]>;
53
+ onLog(level: LoggingLevelName, topic: Topic, message: string): void;
54
+ }
55
+ export declare const createVonageLogger: (name: string, onLog: (level: LoggingLevelName, topic: Topic, message: string) => void, minLogLevel?: LoggingLevel, topics?: Topics[]) => VonageLogger;