@microsoft/omnichannel-chat-sdk
Advanced tools
Comparing version 1.0.1-main.4ac6840 to 1.0.1-main.4ed9317
@@ -7,8 +7,15 @@ # Changelog | ||
### Added | ||
- Add Post Chat Survey Support | ||
- Add `getPostChatSurveyContext` & `initializePostChatRenderer` and `renderPostChatSurvey` API methods | ||
- Add `GetPostChatSurveyContext`, `RenderPostChatSurvey`, and `InitializePostChatRenderer` telemetry events | ||
- Add `getPostChatSurveyContext` API method | ||
- Add `GetPostChatSurveyContext` telemetry event | ||
- Add `widgetId` & `clientMessageId` as metadata on sending message | ||
- Update `ChatConfig` interface with `LiveChatVersion`, `allowedFileExtensions` & `maxUploadFileSize` properties | ||
### Fix | ||
- Add `acs_webchat-chat-adapter` middlewares to format `channelData.tags` | ||
- Skip `session init` call on existing conversation | ||
### Changed | ||
- README: added examples on usages of the post chat APIs. | ||
- Uptake [@azure/communication-chat@1.1.1](https://www.npmjs.com/package/@azure/communication-chat/v/1.1.1) | ||
- 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) | ||
@@ -15,0 +22,0 @@ ## [1.0.0] - 2021-10-08 |
declare const ic3ClientVersion = "2021.08.14.1"; | ||
declare const webChatIC3AdapterVersion = "0.1.0-master.2dba07b"; | ||
declare const webChatACSAdapterVersion = "0.0.30"; | ||
declare const webChatACSAdapterVersion = "0.0.35-beta.2"; | ||
declare const ariaTelemetryKey = "c7655518acf1403f93ff6b9f77942f0a-d01a02fd-6b50-4de3-a566-62eda11f93bc-7083"; | ||
export { ic3ClientVersion, webChatIC3AdapterVersion, webChatACSAdapterVersion, ariaTelemetryKey }; |
@@ -8,3 +8,3 @@ "use strict"; | ||
exports.webChatIC3AdapterVersion = webChatIC3AdapterVersion; | ||
var webChatACSAdapterVersion = '0.0.30'; | ||
var webChatACSAdapterVersion = '0.0.35-beta.2'; | ||
exports.webChatACSAdapterVersion = webChatACSAdapterVersion; | ||
@@ -11,0 +11,0 @@ var ariaTelemetryKey = 'c7655518acf1403f93ff6b9f77942f0a-d01a02fd-6b50-4de3-a566-62eda11f93bc-7083'; |
@@ -5,3 +5,6 @@ export default interface ChatConfig { | ||
LiveChatConfigAuthSettings: unknown; | ||
LiveChatVersion: number; | ||
LiveWSAndLiveChatEngJoin: any; | ||
allowedFileExtensions: string; | ||
maxUploadFileSize: string; | ||
} |
@@ -396,3 +396,3 @@ "use strict"; | ||
senderDisplayName: ACSParticipantDisplayName_1.default.Customer, | ||
metadata: __assign({ deliveryMode: DeliveryMode_1.default.Bridged, tags: JSON.stringify([MessageTags_1.defaultMessageTags]) }, message.metadata) | ||
metadata: __assign({ deliveryMode: DeliveryMode_1.default.Bridged, tags: MessageTags_1.defaultMessageTags.join(',') }, message.metadata) | ||
}; | ||
@@ -399,0 +399,0 @@ _e.label = 1; |
@@ -23,3 +23,2 @@ import ACSClient from "./core/messaging/ACSClient"; | ||
import OnNewMessageOptionalParams from "./core/messaging/OnNewMessageOptionalParams"; | ||
import PostChatContext from "./core/PostChatContext"; | ||
import StartChatOptionalParams from "./core/StartChatOptionalParams"; | ||
@@ -87,4 +86,2 @@ declare class OmnichannelChatSDK { | ||
getPostChatSurveyContext(): Promise<any>; | ||
initializePostChatRenderer(): Promise<void>; | ||
renderPostChatSurvey(containerId: string, postChatContext: PostChatContext): Promise<void>; | ||
private getIC3Client; | ||
@@ -91,0 +88,0 @@ private getChatConfig; |
@@ -35,6 +35,4 @@ declare enum TelemetryEvent { | ||
GetChatReconnectContext = "GetChatReconnectContext", | ||
GetPostChatSurveyContext = "GetPostChatSurveyContext", | ||
RenderPostChatSurvey = "RenderPostChatSurvey", | ||
InitializePostChatRenderer = "InitializePostChatRenderer" | ||
GetPostChatSurveyContext = "GetPostChatSurveyContext" | ||
} | ||
export default TelemetryEvent; |
@@ -39,6 +39,4 @@ "use strict"; | ||
TelemetryEvent["GetPostChatSurveyContext"] = "GetPostChatSurveyContext"; | ||
TelemetryEvent["RenderPostChatSurvey"] = "RenderPostChatSurvey"; | ||
TelemetryEvent["InitializePostChatRenderer"] = "InitializePostChatRenderer"; | ||
})(TelemetryEvent || (TelemetryEvent = {})); | ||
exports.default = TelemetryEvent; | ||
//# sourceMappingURL=TelemetryEvent.js.map |
declare const getIC3ClientCDNUrl: (version?: string) => string; | ||
declare const getIC3AdapterCDNUrl: (version?: string) => string; | ||
declare const getACSAdapterCDNUrl: (version?: string) => string; | ||
declare const getMsfpEmbedScript: () => string; | ||
declare const _default: { | ||
@@ -9,5 +8,4 @@ getIC3ClientCDNUrl: (version?: string) => string; | ||
getACSAdapterCDNUrl: (version?: string) => string; | ||
getMsfpEmbedScript: () => string; | ||
}; | ||
export default _default; | ||
export { getIC3ClientCDNUrl, getIC3AdapterCDNUrl, getACSAdapterCDNUrl, getMsfpEmbedScript }; | ||
export { getIC3ClientCDNUrl, getIC3AdapterCDNUrl, getACSAdapterCDNUrl }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getMsfpEmbedScript = exports.getACSAdapterCDNUrl = exports.getIC3AdapterCDNUrl = exports.getIC3ClientCDNUrl = void 0; | ||
exports.getACSAdapterCDNUrl = exports.getIC3AdapterCDNUrl = exports.getIC3ClientCDNUrl = void 0; | ||
var settings_1 = require("../config/settings"); | ||
@@ -23,16 +23,7 @@ var getIC3ClientCDNUrl = function (version) { | ||
exports.getACSAdapterCDNUrl = getACSAdapterCDNUrl; | ||
var getMsfpEmbedScript = function () { | ||
var msfpEmbedScript = '<script src="https://oc-cdn-ocprod.azureedge.net/livechatwidget/WebChatControl/lib/Embed.min.js" type="text/javascript"></script>' + | ||
'<link rel="stylesheet" type="text/css" href="https://mfpembedcdnwus2.azureedge.net/mfpembedcontwus2/Embed.css" />' + | ||
'<script type = "text/javascript" >function renderSurvey(parentElementId,surveyurl,FirstName, LastName, locale){var se = new SurveyEmbed(surveyurl,"https://mfpembedcdnmsit.azureedge.net/mfpembedcontmsit/","true");' + | ||
'var context = {"First Name": FirstName,"Last Name": LastName,"locale": locale,"showmultilingual":"false"};se.renderInline(parentElementId, context);}</script>'; | ||
return msfpEmbedScript; | ||
}; | ||
exports.getMsfpEmbedScript = getMsfpEmbedScript; | ||
exports.default = { | ||
getIC3ClientCDNUrl: getIC3ClientCDNUrl, | ||
getIC3AdapterCDNUrl: getIC3AdapterCDNUrl, | ||
getACSAdapterCDNUrl: getACSAdapterCDNUrl, | ||
getMsfpEmbedScript: getMsfpEmbedScript | ||
getACSAdapterCDNUrl: getACSAdapterCDNUrl | ||
}; | ||
//# sourceMappingURL=libraries.js.map |
{ | ||
"name": "@microsoft/omnichannel-chat-sdk", | ||
"version": "1.0.1-main.4ac6840", | ||
"version": "1.0.1-main.4ed9317", | ||
"description": "Microsoft Omnichannel Chat SDK", | ||
@@ -42,3 +42,3 @@ "files": [ | ||
"dependencies": { | ||
"@azure/communication-chat": "1.1.0-beta.2", | ||
"@azure/communication-chat": "1.1.1", | ||
"@azure/communication-common": "1.1.0", | ||
@@ -45,0 +45,0 @@ "@microsoft/ocsdk": "^0.3.0", |
@@ -17,3 +17,3 @@ # Omnichannel Chat SDK | ||
- [API Examples](#api-examples) | ||
- [Sample Apps](samples/) | ||
- [Sample Apps](https://github.com/microsoft/omnichannel-chat-sdk-samples) | ||
- [Common Scenarios](#common-scenarios) | ||
@@ -44,3 +44,3 @@ - [Feature Comparisons](#feature-comparisons) | ||
| Pre-chat Survey | ✔ | ✔ | | ||
| Post-chat Survey | ✔ | ❌ | | ||
| Post-chat Survey | ✔ | ✔ | | ||
| Download Transcript | ✔ | ✔ | | ||
@@ -70,3 +70,22 @@ | Email Transcript | ✔ | ✔ | | ||
1. Run `npm install node-libs-react-native --save-dev` | ||
1. Install `node-libs-react-native` | ||
``` | ||
npm install node-libs-react-native --save-dev | ||
``` | ||
1. Install `react-native-randomBytes` | ||
``` | ||
npm install react-native-randombytes --save-dev | ||
``` | ||
1. Install `react-native-get-random-values` | ||
``` | ||
npm install react-native-get-random-values --save-dev | ||
``` | ||
1. Install `react-native-url-polyfill` | ||
``` | ||
npm install react-native-url-polyfill --save-dev | ||
``` | ||
1. Update *metro.config.js* to use React Native compatible Node Core modules | ||
@@ -86,20 +105,7 @@ ```ts | ||
1. Import 'node-libs-react-native/globals' on top of your entry point file | ||
1. Add following *import* on top of your entry point file | ||
```ts | ||
import 'node-libs-react-native/globals'; | ||
``` | ||
1. Install `react-native-randomBytes` | ||
``` | ||
npm install react-native-randombytes --save-dev | ||
``` | ||
1. Install `react-native-get-random-values` | ||
``` | ||
npm install react-native-get-random-values --save-dev | ||
``` | ||
1. Import `react-native-get-random-values` on top of your entry point file | ||
```ts | ||
import 'react-native-get-random-values'; | ||
import 'react-native-url-polyfill'; | ||
``` | ||
@@ -134,2 +140,3 @@ | ||
| OmnichannelChatSDK.getVoiceVideoCalling() | Get VoiceVideoCall SDK for Escalation to Voice & Video | **Web only** | | ||
| OmnichannelChatSDK.getPostChatSurveyContext() | Get post chat survey link, survey locale, and whether an agent has joined the survey | | | ||
@@ -212,2 +219,17 @@ ## API examples | ||
### Get PostChat Survey | ||
```ts | ||
try { | ||
const context = await chatSDK.getPostChatSurveyContext(); | ||
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. | ||
// formsProLocale is the default language you have set on the CustomerVoice portal. You can override this url parameter with any locale that CustomerVoice supports. | ||
// If "&lang=" is not set on the url, the locale will be English. | ||
const linkToSend = context.surveyInviteLink + "&lang=" + context.formsProLocale; | ||
// This link is accessible and will redirect to the survey page. Use it as you see fit. | ||
} | ||
} catch (ex) { | ||
// If the post chat should not be shown by any reason (e.g. post chat is not enabled), promise will be rejected. | ||
} | ||
``` | ||
### Start Chat | ||
@@ -214,0 +236,0 @@ ```ts |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
240
749
1186965
11585
+ Added@azure/communication-chat@1.1.1(transitive)
+ Added@azure/communication-signaling@1.0.0-beta.11(transitive)
+ Added@azure/core-client@1.9.2(transitive)
+ Added@azure/core-rest-pipeline@1.18.2(transitive)
+ Added@azure/core-tracing@1.2.0(transitive)
+ Addedagent-base@7.1.3(transitive)
+ Addeddebug@4.4.0(transitive)
+ Addedhttp-proxy-agent@7.0.2(transitive)
+ Addedhttps-proxy-agent@7.0.6(transitive)
+ Addedms@2.1.3(transitive)
- Removed@azure/communication-chat@1.1.0-beta.2(transitive)
- Removed@azure/communication-signaling@1.0.0-beta.8(transitive)
- Removed@azure/core-asynciterator-polyfill@1.0.2(transitive)
- Removed@azure/core-http@1.2.6(transitive)
- Removed@opentelemetry/api@0.10.2(transitive)
- Removed@opentelemetry/context-base@0.10.2(transitive)
- Removed@types/node@22.10.10(transitive)
- Removed@types/tunnel@0.0.1(transitive)
- Removedform-data@3.0.2(transitive)
- Removedundici-types@6.20.0(transitive)
- Removedxml2js@0.4.23(transitive)