@microsoft/omnichannel-chat-sdk 1.0.1-main.c789d78 → 1.0.1-main.d137e38
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.
- package/CHANGELOG.md +15 -3
- package/README.md +39 -40
- package/lib/OmnichannelChatSDK.d.ts +3 -3
- package/lib/OmnichannelChatSDK.js +196 -234
- package/lib/OmnichannelChatSDK.js.map +1 -1
- package/lib/config/settings.d.ts +1 -1
- package/lib/config/settings.js +1 -1
- package/lib/config/settings.js.map +1 -1
- package/lib/core/ChatConfig.d.ts +3 -0
- package/lib/core/messaging/ACSClient.js +1 -1
- package/lib/core/messaging/ACSClient.js.map +1 -1
- package/lib/external/ACSAdapter/createFormatEgressTagsMiddleware.d.ts +2 -0
- package/lib/external/ACSAdapter/createFormatEgressTagsMiddleware.js +31 -0
- package/lib/external/ACSAdapter/createFormatEgressTagsMiddleware.js.map +1 -0
- package/lib/external/ACSAdapter/createFormatIngressTagsMiddleware.d.ts +2 -0
- package/lib/external/ACSAdapter/createFormatIngressTagsMiddleware.js +25 -0
- package/lib/external/ACSAdapter/createFormatIngressTagsMiddleware.js.map +1 -0
- package/lib/telemetry/AriaTelemetry.js +5 -0
- package/lib/telemetry/AriaTelemetry.js.map +1 -1
- package/lib/telemetry/ScenarioMarker.d.ts +2 -0
- package/lib/telemetry/ScenarioMarker.js +7 -3
- package/lib/telemetry/ScenarioMarker.js.map +1 -1
- package/lib/telemetry/TelemetryEvent.d.ts +1 -3
- package/lib/telemetry/TelemetryEvent.js +0 -2
- package/lib/telemetry/TelemetryEvent.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +760 -1075
- package/lib/utils/WebUtils.d.ts +3 -1
- package/lib/utils/WebUtils.js +8 -2
- package/lib/utils/WebUtils.js.map +1 -1
- package/lib/utils/libraries.d.ts +1 -3
- package/lib/utils/libraries.js +2 -11
- package/lib/utils/libraries.js.map +1 -1
- package/lib/utils/locale.d.ts +1 -0
- package/lib/utils/locale.js +2 -1
- package/lib/utils/locale.js.map +1 -1
- package/lib/utils/loggers.d.ts +8 -0
- package/lib/utils/loggers.js +24 -0
- package/lib/utils/loggers.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
@@ -4,12 +4,24 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
## [Unreleased]
|
5
5
|
|
6
6
|
### Added
|
7
|
-
- Add
|
8
|
-
- Add `
|
9
|
-
- Add `
|
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
|
+
|
15
|
+
### Fix
|
16
|
+
- Add `acs_webchat-chat-adapter` middlewares to format `channelData.tags`
|
17
|
+
- Skip `session init` call on existing conversation
|
18
|
+
- Fix `chat reconnect` not ending the conversation on calling `ChatSDK.endChat()`
|
19
|
+
- Fix on messaging client not sending heartbeat on new conversations subsequent to the first conversation
|
10
20
|
|
11
21
|
### Changed
|
12
22
|
- README: added examples on usages of the post chat APIs.
|
23
|
+
- Uptake [@azure/communication-chat@1.1.1](https://www.npmjs.com/package/@azure/communication-chat/v/1.1.1)
|
24
|
+
- 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
25
|
|
14
26
|
## [1.0.0] - 2021-10-08
|
15
27
|
### Added
|
package/README.md
CHANGED
@@ -14,7 +14,7 @@ Please make sure you have a chat widget configured before using this package or
|
|
14
14
|
- [Installation on React Native](#installation-on-react-native)
|
15
15
|
- [API Reference](#api-reference)
|
16
16
|
- [API Examples](#api-examples)
|
17
|
-
- [Sample Apps](samples
|
17
|
+
- [Sample Apps](https://github.com/microsoft/omnichannel-chat-sdk-samples)
|
18
18
|
- [Common Scenarios](#common-scenarios)
|
19
19
|
- [Feature Comparisons](#feature-comparisons)
|
20
20
|
- [Telemetry](#telemetry)
|
@@ -35,14 +35,12 @@ Omnichannel offers an live chat widget (LCW) by default. You can use the Chat SD
|
|
35
35
|
| Bring Your Own Widget | ❌ | ✔ | |
|
36
36
|
| Web Support | ✔ | ✔ |
|
37
37
|
| React Native Support | ❌ | ✔ |
|
38
|
-
| Escalation to Voice & Video | ✔ |
|
39
|
-
| Co-browse | ✔ |
|
40
|
-
| Screen Sharing | ✔ |
|
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 |
|
41
41
|
| Authenticated Chat | ✔ | ✔ |
|
42
42
|
| Pre-chat Survey | ✔ | ✔ |
|
43
|
-
| Post-chat Survey | ✔ |
|
44
|
-
| Queue Position | ✔ | ✔ |
|
45
|
-
| Average Wait Time | ✔ | ✔ |
|
43
|
+
| Post-chat Survey | ✔ | ✔ |
|
46
44
|
| Download Transcript | ✔ | ✔ |
|
47
45
|
| Email Transcript | ✔ | ✔ |
|
48
46
|
| Data Masking | ✔ | ✔ |
|
@@ -52,6 +50,8 @@ Omnichannel offers an live chat widget (LCW) by default. You can use the Chat SD
|
|
52
50
|
| Persistent Chat | ✔ | ✔ |
|
53
51
|
| Chat Reconnect | ✔ | ✔ |
|
54
52
|
| Operating Hours | ✔ | ✔ |
|
53
|
+
| Queue Position | ✔ | ✔ | No SDK method. Handled as *system message* |
|
54
|
+
| Average Wait Time | ✔ | ✔ | No SDK method. Handled as *system message* |
|
55
55
|
|
56
56
|
**\*** BYOI: Bring Your Own Implementation
|
57
57
|
|
@@ -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.
|
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,14 +99,11 @@ The following steps will be required to run Omnichannel Chat SDK on React Native
|
|
80
99
|
};
|
81
100
|
```
|
82
101
|
|
83
|
-
1.
|
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
|
105
|
+
import 'react-native-get-random-values';
|
106
|
+
import 'react-native-url-polyfill';
|
91
107
|
```
|
92
108
|
|
93
109
|
## API Reference
|
@@ -117,10 +133,7 @@ The following steps will be required to run Omnichannel Chat SDK on React Native
|
|
117
133
|
| OmnichannelChatSDK.downloadFileAttachment() | Download file attachment | |
|
118
134
|
| OmnichannelChatSDK.createChatAdapter() | Get IC3Adapter | **Web only** |
|
119
135
|
| OmnichannelChatSDK.getVoiceVideoCalling() | Get VoiceVideoCall SDK for Escalation to Voice & Video | **Web only** |
|
120
|
-
| OmnichannelChatSDK.getPostChatSurveyContext() | Get post chat survey link
|
121
|
-
| OmnichannelChatSDK.initializePostChatRenderer() | Load necessary scripts and styles to render the FormsPro survey | **Web only** |
|
122
|
-
| OmnichannelChatSDK.renderPostChatSurvey() | Render the FormsPro survey | **Web only** |
|
123
|
-
|
136
|
+
| OmnichannelChatSDK.getPostChatSurveyContext() | Get post chat survey link, survey locale, and whether an agent has joined the survey | |
|
124
137
|
|
125
138
|
## API examples
|
126
139
|
|
@@ -198,31 +211,18 @@ The following steps will be required to run Omnichannel Chat SDK on React Native
|
|
198
211
|
const preChatSurvey = await getPreChatSurvey(parseToJSON); // Adaptive Cards payload data as string
|
199
212
|
```
|
200
213
|
|
201
|
-
###
|
202
|
-
`Option 1: Directly use the survey link`
|
203
|
-
```ts
|
204
|
-
try {
|
205
|
-
const context = await chatSDK.getPostChatSurveyContext();
|
206
|
-
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.
|
207
|
-
const linkToSend = context.surveyInviteLink + "&lang=" + context.formsProLocale;
|
208
|
-
// This link is accessible and will redirect to the survey in another tab. Use it as you see fit.
|
209
|
-
}
|
210
|
-
} catch (ex) {
|
211
|
-
// If the post chat should not show by any reason (e.g. post chat is not enabled), promise will be rejected.
|
212
|
-
}
|
213
|
-
```
|
214
|
-
|
215
|
-
`Option 2: Render the FormsPro Survey in a specified container`
|
214
|
+
### Get PostChat Survey
|
216
215
|
```ts
|
217
|
-
await chatSDK.initializePostChatRenderer(); // This method is needed to embed FormsPro survey in the widget. It can be called anytime before actually rendering the survey for best performance of you page.
|
218
|
-
|
219
216
|
try {
|
220
217
|
const context = await chatSDK.getPostChatSurveyContext();
|
221
|
-
if (context
|
222
|
-
|
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
223
|
}
|
224
224
|
} catch (ex) {
|
225
|
-
|
225
|
+
// If the post chat should not be shown by any reason (e.g. post chat is not enabled), promise will be rejected.
|
226
226
|
}
|
227
227
|
```
|
228
228
|
|
@@ -335,8 +335,7 @@ The following steps will be required to run Omnichannel Chat SDK on React Native
|
|
335
335
|
```ts
|
336
336
|
const body = {
|
337
337
|
emailAddress: 'contoso@microsoft.com',
|
338
|
-
attachmentMessage: 'Attachment Message'
|
339
|
-
locale: 'en-us'
|
338
|
+
attachmentMessage: 'Attachment Message'
|
340
339
|
};
|
341
340
|
await chatSDK.emailLiveChatTranscript(body);
|
342
341
|
```
|
@@ -20,10 +20,10 @@ import LiveWorkItemDetails from "./core/LiveWorkItemDetails";
|
|
20
20
|
import OmnichannelConfig from "./core/OmnichannelConfig";
|
21
21
|
import OmnichannelMessage from "./core/messaging/OmnichannelMessage";
|
22
22
|
import OnNewMessageOptionalParams from "./core/messaging/OnNewMessageOptionalParams";
|
23
|
-
import PostChatContext from "./core/PostChatContext";
|
24
23
|
import StartChatOptionalParams from "./core/StartChatOptionalParams";
|
25
24
|
declare class OmnichannelChatSDK {
|
26
25
|
private debug;
|
26
|
+
runtimeId: string;
|
27
27
|
OCSDKProvider: unknown;
|
28
28
|
IC3SDKProvider: unknown;
|
29
29
|
OCClient: any;
|
@@ -33,6 +33,7 @@ declare class OmnichannelChatSDK {
|
|
33
33
|
omnichannelConfig: OmnichannelConfig;
|
34
34
|
chatSDKConfig: ChatSDKConfig;
|
35
35
|
isInitialized: boolean;
|
36
|
+
localeId: string;
|
36
37
|
requestId: string;
|
37
38
|
private chatToken;
|
38
39
|
private liveChatConfig;
|
@@ -83,12 +84,11 @@ declare class OmnichannelChatSDK {
|
|
83
84
|
createChatAdapter(protocol?: string | null): Promise<unknown>;
|
84
85
|
getVoiceVideoCalling(params?: any): Promise<any>;
|
85
86
|
getPostChatSurveyContext(): Promise<any>;
|
86
|
-
initializePostChatRenderer(): Promise<void>;
|
87
|
-
renderPostChatSurvey(containerId: string, postChatContext: PostChatContext): Promise<void>;
|
88
87
|
private getIC3Client;
|
89
88
|
private getChatConfig;
|
90
89
|
private resolveIC3ClientUrl;
|
91
90
|
private resolveChatAdapterUrl;
|
92
91
|
private updateChatToken;
|
92
|
+
private setAuthTokenProvider;
|
93
93
|
}
|
94
94
|
export default OmnichannelChatSDK;
|