@microsoft/omnichannel-chat-sdk 1.0.1-main.c6dccf8 → 1.0.1-main.d9ac478

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 (43) hide show
  1. package/CHANGELOG.md +17 -3
  2. package/README.md +41 -20
  3. package/lib/OmnichannelChatSDK.d.ts +5 -4
  4. package/lib/OmnichannelChatSDK.js +225 -259
  5. package/lib/OmnichannelChatSDK.js.map +1 -1
  6. package/lib/config/settings.d.ts +1 -1
  7. package/lib/config/settings.js +1 -1
  8. package/lib/config/settings.js.map +1 -1
  9. package/lib/core/ChatConfig.d.ts +3 -0
  10. package/lib/core/messaging/ACSClient.js +1 -1
  11. package/lib/core/messaging/ACSClient.js.map +1 -1
  12. package/lib/core/messaging/ChatAdapterOptionalParams.d.ts +14 -0
  13. package/lib/core/messaging/ChatAdapterOptionalParams.js +3 -0
  14. package/lib/core/messaging/ChatAdapterOptionalParams.js.map +1 -0
  15. package/lib/external/ACSAdapter/createFormatEgressTagsMiddleware.d.ts +2 -0
  16. package/lib/external/ACSAdapter/createFormatEgressTagsMiddleware.js +31 -0
  17. package/lib/external/ACSAdapter/createFormatEgressTagsMiddleware.js.map +1 -0
  18. package/lib/external/ACSAdapter/createFormatIngressTagsMiddleware.d.ts +2 -0
  19. package/lib/external/ACSAdapter/createFormatIngressTagsMiddleware.js +25 -0
  20. package/lib/external/ACSAdapter/createFormatIngressTagsMiddleware.js.map +1 -0
  21. package/lib/external/IC3Adapter/IIC3AdapterOptions.d.ts +12 -0
  22. package/lib/telemetry/AriaTelemetry.js +5 -0
  23. package/lib/telemetry/AriaTelemetry.js.map +1 -1
  24. package/lib/telemetry/ScenarioMarker.d.ts +2 -0
  25. package/lib/telemetry/ScenarioMarker.js +7 -3
  26. package/lib/telemetry/ScenarioMarker.js.map +1 -1
  27. package/lib/telemetry/TelemetryEvent.d.ts +1 -3
  28. package/lib/telemetry/TelemetryEvent.js +0 -2
  29. package/lib/telemetry/TelemetryEvent.js.map +1 -1
  30. package/lib/tsconfig.tsbuildinfo +813 -1089
  31. package/lib/utils/WebUtils.d.ts +3 -1
  32. package/lib/utils/WebUtils.js +8 -2
  33. package/lib/utils/WebUtils.js.map +1 -1
  34. package/lib/utils/libraries.d.ts +1 -3
  35. package/lib/utils/libraries.js +2 -11
  36. package/lib/utils/libraries.js.map +1 -1
  37. package/lib/utils/locale.d.ts +1 -0
  38. package/lib/utils/locale.js +2 -1
  39. package/lib/utils/locale.js.map +1 -1
  40. package/lib/utils/loggers.d.ts +8 -0
  41. package/lib/utils/loggers.js +24 -0
  42. package/lib/utils/loggers.js.map +1 -1
  43. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -4,12 +4,26 @@ All notable changes to this project will be documented in this file.
4
4
  ## [Unreleased]
5
5
 
6
6
  ### Added
7
- - Add Post Chat Survey Support
8
- - Add `getPostChatSurveyContext` & `initializePostChatRenderer` and `renderPostChatSurvey` API methods
9
- - Add `GetPostChatSurveyContext`, `RenderPostChatSurvey`, and `InitializePostChatRenderer` telemetry events
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 `session init` exceptions
15
+
16
+ ### Fix
17
+ - Add `acs_webchat-chat-adapter` middlewares to format `channelData.tags`
18
+ - Skip `session init` call on existing conversation
19
+ - Fix `chat reconnect` not ending the conversation on calling `ChatSDK.endChat()`
20
+ - Fix on messaging client not sending heartbeat on new conversations subsequent to the first conversation
21
+ - Fix `ChatSDK.getConversationDetails()` not passing `authenticatedUserToken`
10
22
 
11
23
  ### Changed
12
24
  - README: added examples on usages of the post chat APIs.
25
+ - Uptake [@azure/communication-chat@1.1.1](https://www.npmjs.com/package/@azure/communication-chat/v/1.1.1)
26
+ - 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)
13
27
 
14
28
  ## [1.0.0] - 2021-10-08
15
29
  ### Added
package/README.md CHANGED
@@ -40,7 +40,7 @@ Omnichannel offers an live chat widget (LCW) by default. You can use the Chat SD
40
40
  | Screen Sharing | ✔ | 3rd party add-on | Only supported on Web |
41
41
  | Authenticated Chat | ✔ | ✔ |
42
42
  | Pre-chat Survey | ✔ | ✔ |
43
- | Post-chat Survey | ✔ | |
43
+ | Post-chat Survey | ✔ | |
44
44
  | Download Transcript | ✔ | ✔ |
45
45
  | Email Transcript | ✔ | ✔ |
46
46
  | Data Masking | ✔ | ✔ |
@@ -65,7 +65,26 @@ Omnichannel offers an live chat widget (LCW) by default. You can use the Chat SD
65
65
 
66
66
  The following steps will be required to run Omnichannel Chat SDK on React Native:
67
67
 
68
- 1. Run `npm install node-libs-react-native --save-dev`
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
+
69
88
  1. Update *metro.config.js* to use React Native compatible Node Core modules
70
89
  ```ts
71
90
  module.exports = {
@@ -80,24 +99,11 @@ The following steps will be required to run Omnichannel Chat SDK on React Native
80
99
  };
81
100
  ```
82
101
 
83
- 1. Import 'node-libs-react-native/globals' on top of your entry point file
102
+ 1. Add following *import* on top of your entry point file
84
103
  ```ts
85
104
  import 'node-libs-react-native/globals';
86
- ```
87
-
88
- 1. Install `react-native-randomBytes`
89
- ```
90
- npm install react-native-randombytes --save-dev
91
- ```
92
-
93
- 1. Install `react-native-get-random-values`
94
- ```
95
- npm install react-native-get-random-values --save-dev
96
- ```
97
-
98
- 1. Import `react-native-get-random-values` on top of your entry point file
99
- ```ts
100
105
  import 'react-native-get-random-values';
106
+ import 'react-native-url-polyfill';
101
107
  ```
102
108
 
103
109
  ## API Reference
@@ -125,8 +131,9 @@ The following steps will be required to run Omnichannel Chat SDK on React Native
125
131
  | OmnichannelChatSDK.getLiveChatTranscript() | Get transcript data (JSON) | |
126
132
  | OmnichannelChatSDK.uploadFileAttachment() | Send file attachment | |
127
133
  | OmnichannelChatSDK.downloadFileAttachment() | Download file attachment | |
128
- | OmnichannelChatSDK.createChatAdapter() | Get IC3Adapter | **Web only** |
134
+ | OmnichannelChatSDK.createChatAdapter() | Get Chat Adapter | **Web only** |
129
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 | |
130
137
 
131
138
  ## API examples
132
139
 
@@ -204,6 +211,21 @@ The following steps will be required to run Omnichannel Chat SDK on React Native
204
211
  const preChatSurvey = await getPreChatSurvey(parseToJSON); // Adaptive Cards payload data as string
205
212
  ```
206
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
+
207
229
  ### Start Chat
208
230
  ```ts
209
231
  const customContext = {
@@ -313,8 +335,7 @@ The following steps will be required to run Omnichannel Chat SDK on React Native
313
335
  ```ts
314
336
  const body = {
315
337
  emailAddress: 'contoso@microsoft.com',
316
- attachmentMessage: 'Attachment Message',
317
- locale: 'en-us'
338
+ attachmentMessage: 'Attachment Message'
318
339
  };
319
340
  await chatSDK.emailLiveChatTranscript(body);
320
341
  ```
@@ -1,5 +1,6 @@
1
1
  import ACSClient from "./core/messaging/ACSClient";
2
2
  import { ParticipantsRemovedEvent } from '@azure/communication-signaling';
3
+ import ChatAdapterOptionalParams from "./core/messaging/ChatAdapterOptionalParams";
3
4
  import ChatConfig from "./core/ChatConfig";
4
5
  import ChatReconnectContext from "./core/ChatReconnectContext";
5
6
  import ChatReconnectOptionalParams from "./core/ChatReconnectOptionalParams";
@@ -20,10 +21,10 @@ import LiveWorkItemDetails from "./core/LiveWorkItemDetails";
20
21
  import OmnichannelConfig from "./core/OmnichannelConfig";
21
22
  import OmnichannelMessage from "./core/messaging/OmnichannelMessage";
22
23
  import OnNewMessageOptionalParams from "./core/messaging/OnNewMessageOptionalParams";
23
- import PostChatContext from "./core/PostChatContext";
24
24
  import StartChatOptionalParams from "./core/StartChatOptionalParams";
25
25
  declare class OmnichannelChatSDK {
26
26
  private debug;
27
+ runtimeId: string;
27
28
  OCSDKProvider: unknown;
28
29
  IC3SDKProvider: unknown;
29
30
  OCClient: any;
@@ -33,6 +34,7 @@ declare class OmnichannelChatSDK {
33
34
  omnichannelConfig: OmnichannelConfig;
34
35
  chatSDKConfig: ChatSDKConfig;
35
36
  isInitialized: boolean;
37
+ localeId: string;
36
38
  requestId: string;
37
39
  private chatToken;
38
40
  private liveChatConfig;
@@ -80,15 +82,14 @@ declare class OmnichannelChatSDK {
80
82
  downloadFileAttachment(fileMetadata: FileMetadata | IFileMetadata): Promise<Blob>;
81
83
  emailLiveChatTranscript(body: ChatTranscriptBody): Promise<any>;
82
84
  getLiveChatTranscript(): Promise<any>;
83
- createChatAdapter(protocol?: string | null): Promise<unknown>;
85
+ createChatAdapter(optionalParams?: ChatAdapterOptionalParams): Promise<unknown>;
84
86
  getVoiceVideoCalling(params?: any): Promise<any>;
85
87
  getPostChatSurveyContext(): Promise<any>;
86
- initializePostChatRenderer(): Promise<void>;
87
- renderPostChatSurvey(containerId: string, postChatContext: PostChatContext): Promise<void>;
88
88
  private getIC3Client;
89
89
  private getChatConfig;
90
90
  private resolveIC3ClientUrl;
91
91
  private resolveChatAdapterUrl;
92
92
  private updateChatToken;
93
+ private setAuthTokenProvider;
93
94
  }
94
95
  export default OmnichannelChatSDK;