@microsoft/omnichannel-chat-sdk 0.3.1-main.c96fb51 → 1.0.1-main.1082fd3

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 (155) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +72 -11
  3. package/lib/OmnichannelChatSDK.d.ts +40 -24
  4. package/lib/OmnichannelChatSDK.js +1058 -398
  5. package/lib/OmnichannelChatSDK.js.map +1 -1
  6. package/lib/config/settings.d.ts +2 -1
  7. package/lib/config/settings.js +3 -1
  8. package/lib/config/settings.js.map +1 -1
  9. package/lib/core/{IAuthSettings.d.ts → AuthSettings.d.ts} +1 -1
  10. package/lib/core/{IAuthSettings.js → AuthSettings.js} +1 -1
  11. package/lib/core/AuthSettings.js.map +1 -0
  12. package/lib/core/ChatConfig.d.ts +10 -0
  13. package/lib/core/{IChatConfig.js → ChatConfig.js} +1 -1
  14. package/lib/core/ChatConfig.js.map +1 -0
  15. package/lib/core/{IChatSDKConfig.d.ts → ChatSDKConfig.d.ts} +7 -7
  16. package/lib/core/{IChatSDKConfig.js → ChatSDKConfig.js} +1 -1
  17. package/lib/core/ChatSDKConfig.js.map +1 -0
  18. package/lib/core/ChatSDKExceptionDetails.d.ts +5 -0
  19. package/lib/core/ChatSDKExceptionDetails.js +3 -0
  20. package/lib/core/ChatSDKExceptionDetails.js.map +1 -0
  21. package/lib/core/ChatTranscriptBody.d.ts +5 -0
  22. package/lib/core/ChatTranscriptBody.js +3 -0
  23. package/lib/core/ChatTranscriptBody.js.map +1 -0
  24. package/lib/core/{ILiveChatContext.d.ts → LiveChatContext.d.ts} +1 -1
  25. package/lib/core/LiveChatContext.js +3 -0
  26. package/lib/core/LiveChatContext.js.map +1 -0
  27. package/lib/core/LiveChatVersion.d.ts +5 -0
  28. package/lib/core/LiveChatVersion.js +9 -0
  29. package/lib/core/LiveChatVersion.js.map +1 -0
  30. package/lib/core/{IOmnichannelConfig.d.ts → OmnichannelConfig.d.ts} +1 -1
  31. package/lib/core/OmnichannelConfig.js +3 -0
  32. package/lib/core/OmnichannelConfig.js.map +1 -0
  33. package/lib/core/OmnichannelErrorCodes.d.ts +4 -0
  34. package/lib/core/OmnichannelErrorCodes.js +8 -0
  35. package/lib/core/OmnichannelErrorCodes.js.map +1 -0
  36. package/lib/core/PostChatContext.d.ts +5 -0
  37. package/lib/core/PostChatContext.js +3 -0
  38. package/lib/core/PostChatContext.js.map +1 -0
  39. package/lib/core/{IStartChatOptionalParams.d.ts → StartChatOptionalParams.d.ts} +3 -3
  40. package/lib/core/StartChatOptionalParams.js +3 -0
  41. package/lib/core/StartChatOptionalParams.js.map +1 -0
  42. package/lib/core/messaging/ACSChatMessageType.d.ts +7 -0
  43. package/lib/core/messaging/ACSChatMessageType.js +11 -0
  44. package/lib/core/messaging/ACSChatMessageType.js.map +1 -0
  45. package/lib/core/messaging/ACSClient.d.ts +44 -0
  46. package/lib/core/messaging/ACSClient.js +588 -0
  47. package/lib/core/messaging/ACSClient.js.map +1 -0
  48. package/lib/core/messaging/ACSClientConfig.d.ts +4 -0
  49. package/lib/core/messaging/ACSClientConfig.js +3 -0
  50. package/lib/core/messaging/ACSClientConfig.js.map +1 -0
  51. package/lib/core/messaging/ACSParticipantDisplayName.d.ts +6 -0
  52. package/lib/core/messaging/ACSParticipantDisplayName.js +10 -0
  53. package/lib/core/messaging/ACSParticipantDisplayName.js.map +1 -0
  54. package/lib/core/messaging/ACSSessionInfo.d.ts +5 -0
  55. package/lib/core/messaging/ACSSessionInfo.js +3 -0
  56. package/lib/core/messaging/ACSSessionInfo.js.map +1 -0
  57. package/lib/core/{ChatAdapterConfig.d.ts → messaging/ChatAdapterConfig.d.ts} +2 -0
  58. package/lib/core/{ChatAdapterConfig.js → messaging/ChatAdapterConfig.js} +0 -0
  59. package/lib/core/messaging/ChatAdapterConfig.js.map +1 -0
  60. package/lib/core/messaging/ChatAdapterOptionalParams.d.ts +14 -0
  61. package/lib/core/messaging/ChatAdapterOptionalParams.js +3 -0
  62. package/lib/core/messaging/ChatAdapterOptionalParams.js.map +1 -0
  63. package/lib/core/{ChatAdapterProtocols.d.ts → messaging/ChatAdapterProtocols.d.ts} +1 -0
  64. package/lib/core/{ChatAdapterProtocols.js → messaging/ChatAdapterProtocols.js} +3 -1
  65. package/lib/core/messaging/ChatAdapterProtocols.js.map +1 -0
  66. package/lib/core/{IChatSDKMessage.d.ts → messaging/ChatSDKMessage.d.ts} +2 -1
  67. package/lib/core/messaging/ChatSDKMessage.js +3 -0
  68. package/lib/core/messaging/ChatSDKMessage.js.map +1 -0
  69. package/lib/core/{IC3Config.d.ts → messaging/IC3Config.d.ts} +0 -0
  70. package/lib/core/{IC3Config.js → messaging/IC3Config.js} +0 -0
  71. package/lib/core/messaging/IC3Config.js.map +1 -0
  72. package/lib/core/messaging/MessageTags.d.ts +3 -0
  73. package/lib/core/messaging/MessageTags.js +7 -0
  74. package/lib/core/messaging/MessageTags.js.map +1 -0
  75. package/lib/core/messaging/OmnichannelMessage.d.ts +64 -0
  76. package/lib/core/messaging/OmnichannelMessage.js +52 -0
  77. package/lib/core/messaging/OmnichannelMessage.js.map +1 -0
  78. package/lib/core/{OnNewMessageOptionalParams.d.ts → messaging/OnNewMessageOptionalParams.d.ts} +0 -0
  79. package/lib/core/{OnNewMessageOptionalParams.js → messaging/OnNewMessageOptionalParams.js} +0 -0
  80. package/lib/core/messaging/OnNewMessageOptionalParams.js.map +1 -0
  81. package/lib/external/ACSAdapter/AMSFileManager.d.ts +39 -0
  82. package/lib/external/ACSAdapter/AMSFileManager.js +306 -0
  83. package/lib/external/ACSAdapter/AMSFileManager.js.map +1 -0
  84. package/lib/external/ACSAdapter/createChannelDataEgressMiddleware.d.ts +5 -0
  85. package/lib/external/ACSAdapter/createChannelDataEgressMiddleware.js +34 -0
  86. package/lib/external/ACSAdapter/createChannelDataEgressMiddleware.js.map +1 -0
  87. package/lib/external/ACSAdapter/createFormatEgressTagsMiddleware.d.ts +2 -0
  88. package/lib/external/ACSAdapter/createFormatEgressTagsMiddleware.js +31 -0
  89. package/lib/external/ACSAdapter/createFormatEgressTagsMiddleware.js.map +1 -0
  90. package/lib/external/ACSAdapter/createFormatIngressTagsMiddleware.d.ts +2 -0
  91. package/lib/external/ACSAdapter/createFormatIngressTagsMiddleware.js +25 -0
  92. package/lib/external/ACSAdapter/createFormatIngressTagsMiddleware.js.map +1 -0
  93. package/lib/external/IC3Adapter/IChatToken.d.ts +2 -0
  94. package/lib/external/IC3Adapter/IIC3AdapterOptions.d.ts +12 -0
  95. package/lib/index.d.ts +2 -2
  96. package/lib/telemetry/AriaTelemetry.d.ts +3 -0
  97. package/lib/telemetry/AriaTelemetry.js +124 -4
  98. package/lib/telemetry/AriaTelemetry.js.map +1 -1
  99. package/lib/telemetry/EventMarker.d.ts +3 -0
  100. package/lib/telemetry/EventMarker.js +13 -0
  101. package/lib/telemetry/EventMarker.js.map +1 -0
  102. package/lib/telemetry/ScenarioMarker.d.ts +11 -7
  103. package/lib/telemetry/ScenarioMarker.js +16 -7
  104. package/lib/telemetry/ScenarioMarker.js.map +1 -1
  105. package/lib/telemetry/ScenarioType.d.ts +2 -0
  106. package/lib/telemetry/ScenarioType.js +2 -0
  107. package/lib/telemetry/ScenarioType.js.map +1 -1
  108. package/lib/telemetry/TelemetryEvent.d.ts +7 -4
  109. package/lib/telemetry/TelemetryEvent.js +6 -10
  110. package/lib/telemetry/TelemetryEvent.js.map +1 -1
  111. package/lib/tsconfig.tsbuildinfo +5171 -1324
  112. package/lib/utils/WebUtils.d.ts +3 -1
  113. package/lib/utils/WebUtils.js +8 -2
  114. package/lib/utils/WebUtils.js.map +1 -1
  115. package/lib/utils/createOmnichannelMessage.d.ts +11 -0
  116. package/lib/utils/createOmnichannelMessage.js +63 -0
  117. package/lib/utils/createOmnichannelMessage.js.map +1 -0
  118. package/lib/utils/libraries.d.ts +3 -1
  119. package/lib/utils/libraries.js +9 -2
  120. package/lib/utils/libraries.js.map +1 -1
  121. package/lib/utils/locale.d.ts +3 -0
  122. package/lib/utils/locale.js +60 -0
  123. package/lib/utils/locale.js.map +1 -0
  124. package/lib/utils/loggers.d.ts +50 -6
  125. package/lib/utils/loggers.js +221 -2
  126. package/lib/utils/loggers.js.map +1 -1
  127. package/lib/utils/utilities.js +10 -3
  128. package/lib/utils/utilities.js.map +1 -1
  129. package/lib/validators/OmnichannelConfigValidator.d.ts +2 -2
  130. package/lib/validators/OmnichannelConfigValidator.js.map +1 -1
  131. package/lib/validators/SDKConfigValidators.d.ts +3 -3
  132. package/lib/validators/SDKConfigValidators.js.map +1 -1
  133. package/package.json +5 -1
  134. package/lib/core/ChatAdapterConfig.js.map +0 -1
  135. package/lib/core/ChatAdapterProtocols.js.map +0 -1
  136. package/lib/core/IAuthSettings.js.map +0 -1
  137. package/lib/core/IC3Config.js.map +0 -1
  138. package/lib/core/IChatConfig.d.ts +0 -5
  139. package/lib/core/IChatConfig.js.map +0 -1
  140. package/lib/core/IChatSDKConfig.js.map +0 -1
  141. package/lib/core/IChatSDKMessage.js +0 -3
  142. package/lib/core/IChatSDKMessage.js.map +0 -1
  143. package/lib/core/IChatTranscriptBody.d.ts +0 -5
  144. package/lib/core/IChatTranscriptBody.js +0 -3
  145. package/lib/core/IChatTranscriptBody.js.map +0 -1
  146. package/lib/core/ILiveChatContext.js +0 -3
  147. package/lib/core/ILiveChatContext.js.map +0 -1
  148. package/lib/core/IOmnichannelConfig.js +0 -3
  149. package/lib/core/IOmnichannelConfig.js.map +0 -1
  150. package/lib/core/IStartChatOptionalParams.js +0 -3
  151. package/lib/core/IStartChatOptionalParams.js.map +0 -1
  152. package/lib/core/MessageTags.d.ts +0 -1
  153. package/lib/core/MessageTags.js +0 -5
  154. package/lib/core/MessageTags.js.map +0 -1
  155. package/lib/core/OnNewMessageOptionalParams.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -3,9 +3,39 @@ All notable changes to this project will be documented in this file.
3
3
 
4
4
  ## [Unreleased]
5
5
 
6
+ ### Added
7
+ - Add `getPostChatSurveyContext` API method
8
+ - Add `GetPostChatSurveyContext` telemetry event
9
+ - Add `widgetId` & `clientMessageId` as metadata on sending message
10
+ - Update `ChatConfig` interface with `LiveChatVersion`, `allowedFileExtensions` & `maxUploadFileSize` properties
11
+ - Add ability to automatically detect locale from chat config
12
+ - Add `runtimeId` attribute in `OmnichannelChatSDK` & `ChatSDKRuntimeId` field in telemetry
13
+ - Add ability to automatically pass locale from chat config on calling `ChatSDK.emailLiveChatTranscript()`
14
+ - Bubble up `WidgetUseOutsideOperatingHour` exception
15
+ - Add `acs_webchat-chat-adapter` middleware to add default `channelData.tags` & `channelData.metadata`
16
+ - Update `ChatConfig` interface with `msdyn_enablemarkdown` property
17
+
18
+ ### Fix
19
+ - Add `acs_webchat-chat-adapter` middlewares to format `channelData.tags`
20
+ - Skip `session init` call on existing conversation
21
+ - Fix `chat reconnect` not ending the conversation on calling `ChatSDK.endChat()`
22
+ - Fix on messaging client not sending heartbeat on new conversations subsequent to the first conversation
23
+ - Fix `ChatSDK.getConversationDetails()` not passing `authenticatedUserToken`
24
+ - Fix `IC3Client.dispose()` called when `IC3Client` is `undefined`
25
+
26
+ ### Changed
27
+ - README: added examples on usages of the post chat APIs.
28
+ - Uptake [@azure/communication-chat@1.1.1](https://www.npmjs.com/package/@azure/communication-chat/v/1.1.1)
29
+ - Uptake [acs_webchat-chat-adapter@0.0.35-beta.2](https://unpkg.com/acs_webchat-chat-adapter@0.0.35-beta.2/dist/chat-adapter.js)
30
+ - Update `locale` property in `ChatTranscriptBody` interface to be optional
31
+
32
+ ## [1.0.0] - 2021-10-08
6
33
  ### Added
7
34
  - Add `GetAuthToken` & `GetPreChatSurvey` telemetry events
8
35
  - Add `Domain` telemetry base property
36
+ - Add `GetCurrentLiveChatContext`, `GetMessages`, `SendMessages`, `OnNewMessage` & `OnTypingEvent` telemetry events
37
+ - Live Chat V2 Support
38
+ - Add `PlatformDetails` telemetry event
9
39
 
10
40
  ### Changed
11
41
  - Uptake [@microsoft/ocsdk@0.3.0](https://www.npmjs.com/package/@microsoft/ocsdk/v/0.3.0)
package/README.md CHANGED
@@ -11,9 +11,10 @@ Please make sure you have a chat widget configured before using this package or
11
11
  ## Table of Contents
12
12
  - [Live Chat Widget vs. Chat SDK](#live-chat-widget-vs-chat-sdk)
13
13
  - [Installation](#installation)
14
+ - [Installation on React Native](#installation-on-react-native)
14
15
  - [API Reference](#api-reference)
15
16
  - [API Examples](#api-examples)
16
- - [Sample Apps](samples/)
17
+ - [Sample Apps](https://github.com/microsoft/omnichannel-chat-sdk-samples)
17
18
  - [Common Scenarios](#common-scenarios)
18
19
  - [Feature Comparisons](#feature-comparisons)
19
20
  - [Telemetry](#telemetry)
@@ -34,14 +35,12 @@ Omnichannel offers an live chat widget (LCW) by default. You can use the Chat SD
34
35
  | Bring Your Own Widget | ❌ | ✔ | |
35
36
  | Web Support | ✔ | ✔ |
36
37
  | React Native Support | ❌ | ✔ |
37
- | Escalation to Voice & Video | ✔ | Web Only |
38
- | Co-browse | ✔ | Web Only |
39
- | Screen Sharing | ✔ | Web Only |
38
+ | Escalation to Voice & Video | ✔ | | Only supported on Web |
39
+ | Co-browse | ✔ | 3rd party add-on | Only supported on Web |
40
+ | Screen Sharing | ✔ | 3rd party add-on | Only supported on Web |
40
41
  | Authenticated Chat | ✔ | ✔ |
41
42
  | Pre-chat Survey | ✔ | ✔ |
42
- | Post-chat Survey | ✔ | |
43
- | Queue Position | ✔ | ✔ |
44
- | Average Wait Time | ✔ | ✔ |
43
+ | Post-chat Survey | ✔ | |
45
44
  | Download Transcript | ✔ | ✔ |
46
45
  | Email Transcript | ✔ | ✔ |
47
46
  | Data Masking | ✔ | ✔ |
@@ -51,6 +50,8 @@ Omnichannel offers an live chat widget (LCW) by default. You can use the Chat SD
51
50
  | Persistent Chat | ✔ | ✔ |
52
51
  | Chat Reconnect | ✔ | ✔ |
53
52
  | Operating Hours | ✔ | ✔ |
53
+ | Queue Position | ✔ | ✔ | No SDK method. Handled as *system message* |
54
+ | Average Wait Time | ✔ | ✔ | No SDK method. Handled as *system message* |
54
55
 
55
56
  **\*** BYOI: Bring Your Own Implementation
56
57
 
@@ -60,6 +61,51 @@ Omnichannel offers an live chat widget (LCW) by default. You can use the Chat SD
60
61
  npm install @microsoft/omnichannel-chat-sdk --save
61
62
  ```
62
63
 
64
+ ## Installation on React Native
65
+
66
+ The following steps will be required to run Omnichannel Chat SDK on React Native:
67
+
68
+ 1. Install `node-libs-react-native`
69
+ ```
70
+ npm install node-libs-react-native --save-dev
71
+ ```
72
+
73
+ 1. Install `react-native-randomBytes`
74
+ ```
75
+ npm install react-native-randombytes --save-dev
76
+ ```
77
+
78
+ 1. Install `react-native-get-random-values`
79
+ ```
80
+ npm install react-native-get-random-values --save-dev
81
+ ```
82
+
83
+ 1. Install `react-native-url-polyfill`
84
+ ```
85
+ npm install react-native-url-polyfill --save-dev
86
+ ```
87
+
88
+ 1. Update *metro.config.js* to use React Native compatible Node Core modules
89
+ ```ts
90
+ module.exports = {
91
+ // ...
92
+ resolver: {
93
+ extraNodeModules: {
94
+ ...require('node-libs-react-native'),
95
+ net: require.resolve('node-libs-react-native/mock/net'),
96
+ tls: require.resolve('node-libs-react-native/mock/tls')
97
+ }
98
+ }
99
+ };
100
+ ```
101
+
102
+ 1. Add following *import* on top of your entry point file
103
+ ```ts
104
+ import 'node-libs-react-native/globals';
105
+ import 'react-native-get-random-values';
106
+ import 'react-native-url-polyfill';
107
+ ```
108
+
63
109
  ## API Reference
64
110
 
65
111
  | Method | Description | Notes |
@@ -85,8 +131,9 @@ Omnichannel offers an live chat widget (LCW) by default. You can use the Chat SD
85
131
  | OmnichannelChatSDK.getLiveChatTranscript() | Get transcript data (JSON) | |
86
132
  | OmnichannelChatSDK.uploadFileAttachment() | Send file attachment | |
87
133
  | OmnichannelChatSDK.downloadFileAttachment() | Download file attachment | |
88
- | OmnichannelChatSDK.createChatAdapter() | Get IC3Adapter | **Web only** |
89
- | OmnichannelChatSDK.getVoiceVideoCalling() | Get VoiceVideoCall SDK for Escalation to Voice & Video| **Web only** |
134
+ | OmnichannelChatSDK.createChatAdapter() | Get Chat Adapter | **Web only** |
135
+ | OmnichannelChatSDK.getVoiceVideoCalling() | Get VoiceVideoCall SDK for Escalation to Voice & Video | **Web only** |
136
+ | OmnichannelChatSDK.getPostChatSurveyContext() | Get post chat survey link, survey locale, and whether an agent has joined the survey | |
90
137
 
91
138
  ## API examples
92
139
 
@@ -164,6 +211,21 @@ Omnichannel offers an live chat widget (LCW) by default. You can use the Chat SD
164
211
  const preChatSurvey = await getPreChatSurvey(parseToJSON); // Adaptive Cards payload data as string
165
212
  ```
166
213
 
214
+ ### Get PostChat Survey
215
+ ```ts
216
+ try {
217
+ const context = await chatSDK.getPostChatSurveyContext();
218
+ if (context.participantJoined) { // participantJoined will be true if an agent has joined the conversation, or a bot has joined the conversation and the bot survey flag has been turned on on the admin side.
219
+ // formsProLocale is the default language you have set on the CustomerVoice portal. You can override this url parameter with any locale that CustomerVoice supports.
220
+ // If "&lang=" is not set on the url, the locale will be English.
221
+ const linkToSend = context.surveyInviteLink + "&lang=" + context.formsProLocale;
222
+ // This link is accessible and will redirect to the survey page. Use it as you see fit.
223
+ }
224
+ } catch (ex) {
225
+ // If the post chat should not be shown by any reason (e.g. post chat is not enabled), promise will be rejected.
226
+ }
227
+ ```
228
+
167
229
  ### Start Chat
168
230
  ```ts
169
231
  const customContext = {
@@ -273,8 +335,7 @@ Omnichannel offers an live chat widget (LCW) by default. You can use the Chat SD
273
335
  ```ts
274
336
  const body = {
275
337
  emailAddress: 'contoso@microsoft.com',
276
- attachmentMessage: 'Attachment Message',
277
- locale: 'en-us'
338
+ attachmentMessage: 'Attachment Message'
278
339
  };
279
340
  await chatSDK.emailLiveChatTranscript(body);
280
341
  ```
@@ -1,32 +1,44 @@
1
- import IChatConfig from "./core/IChatConfig";
2
- import IChatSDKConfig from "./core/IChatSDKConfig";
3
- import IChatSDKMessage from "./core/IChatSDKMessage";
1
+ import ACSClient from "./core/messaging/ACSClient";
2
+ import { ParticipantsRemovedEvent } from '@azure/communication-signaling';
3
+ import ChatAdapterOptionalParams from "./core/messaging/ChatAdapterOptionalParams";
4
+ import ChatConfig from "./core/ChatConfig";
5
+ import ChatReconnectContext from "./core/ChatReconnectContext";
6
+ import ChatReconnectOptionalParams from "./core/ChatReconnectOptionalParams";
7
+ import ChatSDKConfig from "./core/ChatSDKConfig";
8
+ import ChatSDKMessage from "./core/messaging/ChatSDKMessage";
9
+ import ChatTranscriptBody from "./core/ChatTranscriptBody";
10
+ import FileMetadata from "@microsoft/omnichannel-amsclient/lib/FileMetadata";
11
+ import FramedClient from "@microsoft/omnichannel-amsclient/lib/FramedClient";
12
+ import FramedlessClient from "@microsoft/omnichannel-amsclient/lib/FramedlessClient";
4
13
  import IChatToken from "./external/IC3Adapter/IChatToken";
5
- import IChatTranscriptBody from "./core/IChatTranscriptBody";
6
14
  import IFileInfo from "@microsoft/omnichannel-ic3core/lib/interfaces/IFileInfo";
7
15
  import IFileMetadata from "@microsoft/omnichannel-ic3core/lib/model/IFileMetadata";
8
- import ILiveChatContext from "./core/ILiveChatContext";
9
16
  import IMessage from "@microsoft/omnichannel-ic3core/lib/model/IMessage";
10
- import IOmnichannelConfig from "./core/IOmnichannelConfig";
11
17
  import IRawMessage from "@microsoft/omnichannel-ic3core/lib/model/IRawMessage";
12
18
  import IRawThread from "@microsoft/omnichannel-ic3core/lib/interfaces/IRawThread";
13
- import IStartChatOptionalParams from "./core/IStartChatOptionalParams";
19
+ import LiveChatContext from "./core/LiveChatContext";
14
20
  import LiveWorkItemDetails from "./core/LiveWorkItemDetails";
15
- import OnNewMessageOptionalParams from "./core/OnNewMessageOptionalParams";
16
- import ChatReconnectOptionalParams from "./core/ChatReconnectOptionalParams";
17
- import ChatReconnectContext from "./core/ChatReconnectContext";
21
+ import OmnichannelConfig from "./core/OmnichannelConfig";
22
+ import OmnichannelMessage from "./core/messaging/OmnichannelMessage";
23
+ import OnNewMessageOptionalParams from "./core/messaging/OnNewMessageOptionalParams";
24
+ import StartChatOptionalParams from "./core/StartChatOptionalParams";
18
25
  declare class OmnichannelChatSDK {
19
26
  private debug;
27
+ runtimeId: string;
20
28
  OCSDKProvider: unknown;
21
29
  IC3SDKProvider: unknown;
22
30
  OCClient: any;
23
31
  IC3Client: any;
24
- omnichannelConfig: IOmnichannelConfig;
25
- chatSDKConfig: IChatSDKConfig;
32
+ ACSClient: ACSClient | null;
33
+ AMSClient: FramedClient | FramedlessClient | null;
34
+ omnichannelConfig: OmnichannelConfig;
35
+ chatSDKConfig: ChatSDKConfig;
26
36
  isInitialized: boolean;
37
+ localeId: string;
27
38
  requestId: string;
28
39
  private chatToken;
29
40
  private liveChatConfig;
41
+ private liveChatVersion;
30
42
  private dataMaskingRules;
31
43
  private authSettings;
32
44
  private authenticatedUserToken;
@@ -37,43 +49,47 @@ declare class OmnichannelChatSDK {
37
49
  private scenarioMarker;
38
50
  private ic3ClientLogger;
39
51
  private ocSdkLogger;
52
+ private acsClientLogger;
53
+ private acsAdapterLogger;
40
54
  private isPersistentChat;
41
55
  private isChatReconnect;
42
56
  private reconnectId;
43
57
  private refreshTokenTimer;
44
- constructor(omnichannelConfig: IOmnichannelConfig, chatSDKConfig?: IChatSDKConfig);
58
+ constructor(omnichannelConfig: OmnichannelConfig, chatSDKConfig?: ChatSDKConfig);
45
59
  setDebug(flag: boolean): void;
46
- initialize(): Promise<IChatConfig>;
60
+ initialize(): Promise<ChatConfig>;
47
61
  getChatReconnectContext(optionalParams?: ChatReconnectOptionalParams): Promise<ChatReconnectContext>;
48
- startChat(optionalParams?: IStartChatOptionalParams): Promise<void>;
62
+ startChat(optionalParams?: StartChatOptionalParams): Promise<void>;
49
63
  endChat(): Promise<void>;
50
- getCurrentLiveChatContext(): Promise<ILiveChatContext | {}>;
64
+ getCurrentLiveChatContext(): Promise<LiveChatContext | {}>;
51
65
  getConversationDetails(): Promise<LiveWorkItemDetails>;
52
66
  /**
53
67
  * Gets PreChat Survey.
54
68
  * @param parse Whether to parse PreChatSurvey to JSON or not.
55
69
  */
56
70
  getPreChatSurvey(parse?: boolean): Promise<any>;
57
- getLiveChatConfig(cached?: boolean): Promise<IChatConfig>;
71
+ getLiveChatConfig(cached?: boolean): Promise<ChatConfig>;
58
72
  getChatToken(cached?: boolean): Promise<IChatToken>;
59
73
  getCallingToken(): Promise<string>;
60
- getMessages(): Promise<IMessage[] | undefined>;
74
+ getMessages(): Promise<IMessage[] | OmnichannelMessage[] | undefined>;
61
75
  getDataMaskingRules(): Promise<any>;
62
- sendMessage(message: IChatSDKMessage): Promise<void>;
76
+ sendMessage(message: ChatSDKMessage): Promise<void>;
63
77
  onNewMessage(onNewMessageCallback: CallableFunction, optionalParams?: OnNewMessageOptionalParams | unknown): Promise<void>;
64
78
  sendTypingEvent(): Promise<void>;
65
79
  onTypingEvent(onTypingEventCallback: CallableFunction): Promise<void>;
66
- onAgentEndSession(onAgentEndSessionCallback: (message: IRawThread) => void): Promise<void>;
67
- uploadFileAttachment(fileInfo: IFileInfo | File): Promise<IRawMessage>;
68
- downloadFileAttachment(fileMetadata: IFileMetadata): Promise<Blob>;
69
- emailLiveChatTranscript(body: IChatTranscriptBody): Promise<any>;
80
+ onAgentEndSession(onAgentEndSessionCallback: (message: IRawThread | ParticipantsRemovedEvent) => void): Promise<void>;
81
+ uploadFileAttachment(fileInfo: IFileInfo | File): Promise<IRawMessage | OmnichannelMessage>;
82
+ downloadFileAttachment(fileMetadata: FileMetadata | IFileMetadata): Promise<Blob>;
83
+ emailLiveChatTranscript(body: ChatTranscriptBody): Promise<any>;
70
84
  getLiveChatTranscript(): Promise<any>;
71
- createChatAdapter(protocol?: string): Promise<unknown>;
85
+ createChatAdapter(optionalParams?: ChatAdapterOptionalParams): Promise<unknown>;
72
86
  getVoiceVideoCalling(params?: any): Promise<any>;
87
+ getPostChatSurveyContext(): Promise<any>;
73
88
  private getIC3Client;
74
89
  private getChatConfig;
75
90
  private resolveIC3ClientUrl;
76
91
  private resolveChatAdapterUrl;
77
92
  private updateChatToken;
93
+ private setAuthTokenProvider;
78
94
  }
79
95
  export default OmnichannelChatSDK;