@microsoft/omnichannel-chat-widget 0.1.0-main.488d6f1 → 0.1.0-main.4eb4d1f
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/README.md +35 -11
- package/lib/cjs/common/Constants.js +52 -6
- package/lib/cjs/common/telemetry/TelemetryConstants.js +58 -6
- package/lib/cjs/common/telemetry/TelemetryHelper.js +13 -0
- package/lib/cjs/common/telemetry/TelemetryManager.js +17 -6
- package/lib/cjs/common/telemetry/defaultConfigs/defaultAriaConfig.js +1 -1
- package/lib/cjs/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.js +4 -1
- package/lib/cjs/common/telemetry/loggers/ariaTelemetryLogger.js +33 -13
- package/lib/cjs/common/telemetry/loggers/consoleLogger.js +6 -5
- package/lib/cjs/common/utils.js +76 -2
- package/lib/cjs/components/callingcontainerstateful/CallingContainerStateful.js +14 -0
- package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +20 -4
- package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +6 -42
- package/lib/cjs/components/footerstateful/FooterStateful.js +1 -2
- package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +11 -2
- package/lib/cjs/components/headerstateful/HeaderStateful.js +3 -9
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +23 -0
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.js +1 -0
- package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +70 -0
- package/lib/cjs/components/livechatwidget/common/createAdapter.js +9 -1
- package/lib/cjs/components/livechatwidget/common/createMarkdown.js +31 -30
- package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +14 -17
- package/lib/cjs/components/livechatwidget/common/endChat.js +94 -11
- package/lib/cjs/components/livechatwidget/common/initCallingSdk.js +1 -1
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +35 -6
- package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +115 -22
- package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +6 -17
- package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +6 -9
- package/lib/cjs/components/livechatwidget/common/shareObservable.js +45 -0
- package/lib/cjs/components/livechatwidget/common/startChat.js +169 -50
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +233 -78
- package/lib/cjs/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +8 -0
- package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +5 -10
- package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +19 -3
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +80 -0
- package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +6 -0
- package/lib/cjs/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.js +1 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +14 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +25 -48
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +3 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +52 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.js +98 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +117 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +6 -6
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +45 -0
- package/lib/cjs/contexts/common/ConversationState.js +3 -2
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +9 -7
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +8 -3
- package/lib/cjs/contexts/createReducer.js +16 -10
- package/lib/cjs/controller/componentController.js +3 -3
- package/lib/cjs/plugins/newMessageEventHandler.js +99 -0
- package/lib/esm/common/Constants.js +48 -5
- package/lib/esm/common/telemetry/TelemetryConstants.js +54 -5
- package/lib/esm/common/telemetry/TelemetryHelper.js +13 -1
- package/lib/esm/common/telemetry/TelemetryManager.js +15 -6
- package/lib/esm/common/telemetry/defaultConfigs/defaultAriaConfig.js +1 -1
- package/lib/esm/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.js +4 -1
- package/lib/esm/common/telemetry/loggers/ariaTelemetryLogger.js +36 -14
- package/lib/esm/common/telemetry/loggers/consoleLogger.js +6 -5
- package/lib/esm/common/utils.js +55 -1
- package/lib/esm/components/callingcontainerstateful/CallingContainerStateful.js +14 -0
- package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +22 -7
- package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +6 -37
- package/lib/esm/components/footerstateful/FooterStateful.js +1 -2
- package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +9 -3
- package/lib/esm/components/headerstateful/HeaderStateful.js +3 -9
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +14 -0
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.js +1 -0
- package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +59 -0
- package/lib/esm/components/livechatwidget/common/createAdapter.js +9 -2
- package/lib/esm/components/livechatwidget/common/createMarkdown.js +31 -30
- package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +14 -18
- package/lib/esm/components/livechatwidget/common/endChat.js +91 -13
- package/lib/esm/components/livechatwidget/common/initCallingSdk.js +1 -1
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +30 -7
- package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +104 -22
- package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +5 -14
- package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +6 -9
- package/lib/esm/components/livechatwidget/common/shareObservable.js +38 -0
- package/lib/esm/components/livechatwidget/common/startChat.js +166 -52
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +219 -78
- package/lib/esm/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +6 -0
- package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +7 -11
- package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +20 -4
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +72 -0
- package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +6 -0
- package/lib/esm/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +5 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +23 -46
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +2 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +41 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.js +94 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +107 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +6 -6
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +32 -0
- package/lib/esm/contexts/common/ConversationState.js +3 -2
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +9 -7
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +8 -3
- package/lib/esm/contexts/createReducer.js +16 -9
- package/lib/esm/controller/componentController.js +3 -3
- package/lib/esm/plugins/newMessageEventHandler.js +82 -0
- package/lib/types/common/Constants.d.ts +26 -2
- package/lib/types/common/interfaces/IContextDataStore.d.ts +2 -2
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +42 -4
- package/lib/types/common/telemetry/TelemetryHelper.d.ts +3 -1
- package/lib/types/common/telemetry/definitions/Payload.d.ts +12 -9
- package/lib/types/common/telemetry/interfaces/ITelemetryConfig.d.ts +3 -3
- package/lib/types/common/utils.d.ts +7 -1
- package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulParams.d.ts +4 -4
- package/lib/types/components/footerstateful/audionotificationstateful/interfaces/IAudioNotificationStatefulParams.d.ts +0 -1
- package/lib/types/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.d.ts +5 -0
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.d.ts +6 -0
- package/lib/types/components/livechatwidget/common/ChatAdapterShim.d.ts +7 -0
- package/lib/types/components/livechatwidget/common/endChat.d.ts +4 -1
- package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +6 -2
- package/lib/types/components/livechatwidget/common/setPostChatContextAndLoadSurvey.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/shareObservable.d.ts +1 -0
- package/lib/types/components/livechatwidget/common/startChat.d.ts +4 -2
- package/lib/types/components/livechatwidget/common/startProactiveChat.d.ts +1 -1
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetComponentOverrides.d.ts +1 -0
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +2 -1
- package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulProps.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/common/mockchatsdk.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.d.ts +4 -0
- package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.d.ts +3 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.d.ts +1 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.d.ts +5 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.d.ts +1 -0
- package/lib/types/contexts/common/ConversationState.d.ts +3 -2
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +2 -1
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +10 -8
- package/lib/types/plugins/newMessageEventHandler.d.ts +2 -0
- package/package.json +9 -11
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/* eslint-disable indent */
|
|
2
2
|
import { LiveChatWidgetActionType } from "./common/LiveChatWidgetActionType";
|
|
3
|
-
import { TelemetryManager } from "../common/telemetry/TelemetryManager";
|
|
4
3
|
export const createReducer = () => {
|
|
5
4
|
const reducer = (state, action) => {
|
|
6
5
|
var _action$payload, _action$payload2, _action$payload3;
|
|
@@ -62,6 +61,14 @@ export const createReducer = () => {
|
|
|
62
61
|
}
|
|
63
62
|
};
|
|
64
63
|
|
|
64
|
+
case LiveChatWidgetActionType.SET_CUSTOM_CONTEXT:
|
|
65
|
+
return { ...state,
|
|
66
|
+
domainStates: { ...state.domainStates,
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
68
|
+
customContext: action.payload
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
65
72
|
case LiveChatWidgetActionType.SET_PREVIOUS_FOCUSED_ELEMENT:
|
|
66
73
|
return { ...state,
|
|
67
74
|
appStates: { ...state.appStates,
|
|
@@ -84,13 +91,6 @@ export const createReducer = () => {
|
|
|
84
91
|
}
|
|
85
92
|
};
|
|
86
93
|
|
|
87
|
-
case LiveChatWidgetActionType.SET_SHOULD_SHOW_POST_CHAT:
|
|
88
|
-
return { ...state,
|
|
89
|
-
appStates: { ...state.appStates,
|
|
90
|
-
shouldShowPostChat: action.payload
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
|
|
94
94
|
case LiveChatWidgetActionType.SHOW_CALLING_CONTAINER:
|
|
95
95
|
return { ...state,
|
|
96
96
|
uiStates: { ...state.uiStates,
|
|
@@ -188,7 +188,6 @@ export const createReducer = () => {
|
|
|
188
188
|
};
|
|
189
189
|
|
|
190
190
|
case LiveChatWidgetActionType.SET_TELEMETRY_DATA:
|
|
191
|
-
TelemetryManager.InternalTelemetryData = action.payload;
|
|
192
191
|
return { ...state,
|
|
193
192
|
domainStates: { ...state.domainStates,
|
|
194
193
|
telemetryInternalData: action.payload
|
|
@@ -228,6 +227,14 @@ export const createReducer = () => {
|
|
|
228
227
|
}
|
|
229
228
|
};
|
|
230
229
|
|
|
230
|
+
case LiveChatWidgetActionType.SET_WIDGET_SIZE:
|
|
231
|
+
return { ...state,
|
|
232
|
+
domainStates: { ...state.domainStates,
|
|
233
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
234
|
+
widgetSize: action.payload
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
|
|
231
238
|
default:
|
|
232
239
|
return state;
|
|
233
240
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConversationState } from "../contexts/common/ConversationState";
|
|
2
2
|
export const shouldShowChatButton = state => {
|
|
3
|
-
return state.appStates.isMinimized || state.appStates.conversationState === ConversationState.Closed;
|
|
3
|
+
return (state.appStates.isMinimized || state.appStates.conversationState === ConversationState.Closed) && state.appStates.skipChatButtonRendering == false; // Do not show chat button in case of popout
|
|
4
4
|
};
|
|
5
5
|
export const shouldShowProactiveChatPane = state => {
|
|
6
6
|
return !state.appStates.isMinimized && state.appStates.conversationState === ConversationState.ProactiveChat;
|
|
@@ -18,13 +18,13 @@ export const shouldShowWebChatContainer = state => {
|
|
|
18
18
|
return state.appStates.conversationState === ConversationState.Active || state.appStates.conversationState === ConversationState.InActive;
|
|
19
19
|
};
|
|
20
20
|
export const shouldShowLoadingPane = state => {
|
|
21
|
-
return !state.appStates.isMinimized &&
|
|
21
|
+
return !state.appStates.isMinimized && state.appStates.conversationState === ConversationState.Loading;
|
|
22
22
|
};
|
|
23
23
|
export const shouldShowReconnectChatPane = state => {
|
|
24
24
|
return !state.appStates.isMinimized && state.appStates.conversationState === ConversationState.ReconnectChat;
|
|
25
25
|
};
|
|
26
26
|
export const shouldShowPostChatLoadingPane = state => {
|
|
27
|
-
return !state.appStates.isMinimized && state.appStates.
|
|
27
|
+
return !state.appStates.isMinimized && state.appStates.conversationState === ConversationState.PostchatLoading;
|
|
28
28
|
};
|
|
29
29
|
export const shouldShowOutOfOfficeHoursPane = state => {
|
|
30
30
|
return !state.appStates.isMinimized && state.appStates.conversationState === ConversationState.OutOfOffice;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { BroadcastEvent, LogLevel, TelemetryEvent } from "../common/telemetry/TelemetryConstants";
|
|
2
|
+
import { BroadcastService } from "@microsoft/omnichannel-chat-components";
|
|
3
|
+
import { Constants } from "../common/Constants";
|
|
4
|
+
import { TelemetryHelper } from "../common/telemetry/TelemetryHelper";
|
|
5
|
+
export const createOnNewAdapterActivityHandler = (chatId, userId) => {
|
|
6
|
+
const onNewAdapterActivityHandler = activity => {
|
|
7
|
+
var _activity$channelData, _activity$channelData2, _activity$channelData3;
|
|
8
|
+
|
|
9
|
+
const isActivityMessage = (activity === null || activity === void 0 ? void 0 : activity.type) === Constants.message;
|
|
10
|
+
const isNotHistoryMessage = isActivityMessage && !(activity !== null && activity !== void 0 && (_activity$channelData = activity.channelData) !== null && _activity$channelData !== void 0 && (_activity$channelData2 = _activity$channelData.tags) !== null && _activity$channelData2 !== void 0 && _activity$channelData2.includes(Constants.historyMessageTag)) && !(activity !== null && activity !== void 0 && (_activity$channelData3 = activity.channelData) !== null && _activity$channelData3 !== void 0 && _activity$channelData3.fromList);
|
|
11
|
+
|
|
12
|
+
if (isNotHistoryMessage) {
|
|
13
|
+
raiseMessageEvent(activity);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const raiseMessageEvent = activity => {
|
|
18
|
+
if ((activity === null || activity === void 0 ? void 0 : activity.type) === Constants.message) {
|
|
19
|
+
var _text, _text2, _activity$channelData4, _activity$from;
|
|
20
|
+
|
|
21
|
+
const payload = {
|
|
22
|
+
// To identify hidden contents vs empty content
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
|
+
text: (activity === null || activity === void 0 ? void 0 : (_text = activity.text) === null || _text === void 0 ? void 0 : _text.length) >= 1 ? `*contents hidden (${activity === null || activity === void 0 ? void 0 : (_text2 = activity.text) === null || _text2 === void 0 ? void 0 : _text2.length} chars)*` : "",
|
|
25
|
+
type: activity === null || activity === void 0 ? void 0 : activity.type,
|
|
26
|
+
timestamp: activity === null || activity === void 0 ? void 0 : activity.timestamp,
|
|
27
|
+
userId: userId,
|
|
28
|
+
tags: activity === null || activity === void 0 ? void 0 : (_activity$channelData4 = activity.channelData) === null || _activity$channelData4 === void 0 ? void 0 : _activity$channelData4.tags,
|
|
29
|
+
messageType: ""
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
if ((activity === null || activity === void 0 ? void 0 : (_activity$from = activity.from) === null || _activity$from === void 0 ? void 0 : _activity$from.role) === Constants.userMessageTag) {
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
34
|
+
payload.messageType = Constants.userMessageTag;
|
|
35
|
+
const newMessageSentEvent = {
|
|
36
|
+
eventName: BroadcastEvent.NewMessageSent,
|
|
37
|
+
payload: payload
|
|
38
|
+
};
|
|
39
|
+
BroadcastService.postMessage(newMessageSentEvent);
|
|
40
|
+
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
41
|
+
Event: TelemetryEvent.MessageSent,
|
|
42
|
+
Description: "New message sent"
|
|
43
|
+
});
|
|
44
|
+
} else {
|
|
45
|
+
var _activity$channelData5, _activity$channelData6;
|
|
46
|
+
|
|
47
|
+
if (activity !== null && activity !== void 0 && (_activity$channelData5 = activity.channelData) !== null && _activity$channelData5 !== void 0 && (_activity$channelData6 = _activity$channelData5.tags) !== null && _activity$channelData6 !== void 0 && _activity$channelData6.includes(Constants.systemMessageTag)) {
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
49
|
+
payload.messageType = Constants.systemMessageTag;
|
|
50
|
+
} else {
|
|
51
|
+
var _activity$channelData7, _activity$channelData8, _activity$channelData9;
|
|
52
|
+
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
54
|
+
const messageHasNoText = !(activity !== null && activity !== void 0 && activity.text); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
55
|
+
|
|
56
|
+
const messageHasNoTags = !(activity !== null && activity !== void 0 && activity.channelData) || !(activity !== null && activity !== void 0 && (_activity$channelData7 = activity.channelData) !== null && _activity$channelData7 !== void 0 && _activity$channelData7.tags) || (activity === null || activity === void 0 ? void 0 : (_activity$channelData8 = activity.channelData) === null || _activity$channelData8 === void 0 ? void 0 : (_activity$channelData9 = _activity$channelData8.tags) === null || _activity$channelData9 === void 0 ? void 0 : _activity$channelData9.length) === 0; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
57
|
+
|
|
58
|
+
const messageHasNoAttachments = !(activity !== null && activity !== void 0 && activity.attachments) || (activity === null || activity === void 0 ? void 0 : activity.attachments.length) === 0;
|
|
59
|
+
|
|
60
|
+
if (messageHasNoTags && messageHasNoText && messageHasNoAttachments) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
payload.messageType = Constants.userMessageTag;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const newMessageReceivedEvent = {
|
|
68
|
+
eventName: BroadcastEvent.NewMessageReceived,
|
|
69
|
+
payload: payload
|
|
70
|
+
};
|
|
71
|
+
BroadcastService.postMessage(newMessageReceivedEvent);
|
|
72
|
+
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
73
|
+
Event: TelemetryEvent.MessageReceived,
|
|
74
|
+
Description: "New message received",
|
|
75
|
+
Data: payload
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
return onNewAdapterActivityHandler;
|
|
82
|
+
};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
export declare class Constants {
|
|
2
|
+
static readonly magicCodeBroadcastChannel = "MagicCodeChannel";
|
|
3
|
+
static readonly magicCodeResponseBroadcastChannel = "MagicCodeResponseChannel";
|
|
2
4
|
static readonly systemMessageTag = "system";
|
|
3
5
|
static readonly userMessageTag = "user";
|
|
6
|
+
static readonly historyMessageTag = "history";
|
|
4
7
|
static readonly agentEndConversationMessageTag = "agentendconversation";
|
|
8
|
+
static readonly supervisorForceCloseMessageTag = "supervisorforceclosedconversation";
|
|
5
9
|
static readonly receivedMessageClassName = "ms_lcw_webchat_received_message";
|
|
6
10
|
static readonly sentMessageClassName = "ms_lcw_webchat_sent_message";
|
|
7
11
|
static readonly webchatChannelId = "webchat";
|
|
@@ -13,7 +17,6 @@ export declare class Constants {
|
|
|
13
17
|
static readonly true = "true";
|
|
14
18
|
static readonly false = "false";
|
|
15
19
|
static readonly maximumUnreadMessageCount = 99;
|
|
16
|
-
static readonly widgetStateDataKey = "LcwChatWidgetState";
|
|
17
20
|
static readonly channelIdKey = "ChannelId-";
|
|
18
21
|
static readonly ChannelId = "lcw";
|
|
19
22
|
static readonly CustomerTag = "FromCustomer";
|
|
@@ -31,6 +34,10 @@ export declare class Constants {
|
|
|
31
34
|
static readonly queuePositionMessageTag = "queueposition";
|
|
32
35
|
static readonly averageWaitTimeMessageTag = "averagewaittime";
|
|
33
36
|
static readonly message = "message";
|
|
37
|
+
static readonly hiddenTag = "Hidden";
|
|
38
|
+
static readonly prefixTimestampTag = "ServerMessageTimestamp_";
|
|
39
|
+
static readonly acsChannel = "ACS_CHANNEL";
|
|
40
|
+
static readonly publicMessageTag = "public";
|
|
34
41
|
static readonly supportedAdaptiveCardContentTypes: Array<string>;
|
|
35
42
|
static readonly maxUploadFileSize = "500000";
|
|
36
43
|
static readonly imageRegex: RegExp;
|
|
@@ -56,7 +63,6 @@ export declare class Constants {
|
|
|
56
63
|
static readonly ProactiveChatInviteTimeoutInMs = 60000;
|
|
57
64
|
static readonly InputSubmit = "InputSubmit";
|
|
58
65
|
static readonly ReconnectIdAttributeName = "oc.reconnectid";
|
|
59
|
-
static readonly redirectPageRequest = "redirectPageRequest";
|
|
60
66
|
static readonly LiveChatWidget = "LiveChatWidgetNew";
|
|
61
67
|
static readonly GuidPattern = "xx-x-4m-ym-xxx";
|
|
62
68
|
static readonly Default = "default";
|
|
@@ -69,6 +75,8 @@ export declare class Constants {
|
|
|
69
75
|
static readonly OpenLinkIconCssClass = "webchat__markdown__external-link-icon";
|
|
70
76
|
static readonly internetConnectionTestUrl = "https://ocsdk-prod.azureedge.net/public/connecttest.txt";
|
|
71
77
|
static readonly internetConnectionTestUrlText = "Omnichannel Connect Test";
|
|
78
|
+
static readonly ChatWidgetStateChangedPrefix = "ChatWidgetStateChanged";
|
|
79
|
+
static readonly PostChatLoadingDurationInMs = 2000;
|
|
72
80
|
}
|
|
73
81
|
export declare const Regex: {
|
|
74
82
|
new (): {};
|
|
@@ -135,6 +143,12 @@ export declare enum ElementType {
|
|
|
135
143
|
export declare enum ChatSDKError {
|
|
136
144
|
WidgetUseOutsideOperatingHour = "WidgetUseOutsideOperatingHour"
|
|
137
145
|
}
|
|
146
|
+
export declare enum EnvironmentVersion {
|
|
147
|
+
prod = "prod",
|
|
148
|
+
dogfood = "df",
|
|
149
|
+
int = "int",
|
|
150
|
+
test = "test"
|
|
151
|
+
}
|
|
138
152
|
export declare class TranscriptConstants {
|
|
139
153
|
static readonly ChatTranscriptsBodyColor = "#F5F5F5";
|
|
140
154
|
static readonly TranscriptMessageEmojiMessageType = "http://schema.skype.com/emoji";
|
|
@@ -147,3 +161,13 @@ export declare class TranscriptConstants {
|
|
|
147
161
|
static readonly AgentDialogColor = "#2266E3";
|
|
148
162
|
static readonly AgentFontColor = "white";
|
|
149
163
|
}
|
|
164
|
+
export declare class AriaTelemetryConstants {
|
|
165
|
+
static readonly GERMANY_ENDPOINT: string;
|
|
166
|
+
static readonly GCCH_ENDPOINT: string;
|
|
167
|
+
static readonly DOD_ENDPOINT: string;
|
|
168
|
+
static readonly EUROPE_ENDPOINT: string;
|
|
169
|
+
static readonly MOONCAKE_ENDPOINT: string;
|
|
170
|
+
static readonly Public: string;
|
|
171
|
+
static readonly EU: string;
|
|
172
|
+
static readonly lcwEUDomainNames: Array<string>;
|
|
173
|
+
}
|
|
@@ -6,9 +6,9 @@ export interface IContextDataStore {
|
|
|
6
6
|
/**
|
|
7
7
|
* setData: Set data to data store
|
|
8
8
|
*/
|
|
9
|
-
setData: (key: string, value: string) => void;
|
|
9
|
+
setData: (key: string, value: any, type: string) => void;
|
|
10
10
|
/**
|
|
11
11
|
* removeData: Remove data from data store by key
|
|
12
12
|
*/
|
|
13
|
-
removeData
|
|
13
|
+
removeData: (key: string, type: string) => void;
|
|
14
14
|
}
|
|
@@ -17,6 +17,32 @@ export declare enum LogLevel {
|
|
|
17
17
|
WARN = "WARN",
|
|
18
18
|
ERROR = "ERROR"
|
|
19
19
|
}
|
|
20
|
+
export declare enum BroadcastEvent {
|
|
21
|
+
LoadPostChatSurvey = "LoadPostChatSurvey",
|
|
22
|
+
ChatEnded = "ChatEnded",
|
|
23
|
+
NewMessageNotification = "NewMessageNotification",
|
|
24
|
+
UnreadMessageCount = "UnreadMessageCount",
|
|
25
|
+
StartProactiveChat = "StartProactiveChat",
|
|
26
|
+
ProactiveChatStartChat = "ProactiveChatStartChat",
|
|
27
|
+
ProactiveChatStartPopoutChat = "ProactiveChatStartPopoutChat",
|
|
28
|
+
ProactiveChatIsInPopoutMode = "ProactiveChatIsInPopoutMode",
|
|
29
|
+
ResetProactiveChatParams = "ResetProactiveChatParams",
|
|
30
|
+
InvalidAdaptiveCardFormat = "InvalidAdaptiveCardFormat",
|
|
31
|
+
NewMessageSent = "NewMessageSent",
|
|
32
|
+
NewMessageReceived = "NewMessageReceived",
|
|
33
|
+
RedirectPageRequest = "RedirectPageRequest",
|
|
34
|
+
StartChat = "StartChat",
|
|
35
|
+
StartChatSkippingChatButtonRendering = "StartChatSkippingChatButtonRendering",
|
|
36
|
+
StartUnauthenticatedReconnectChat = "StartUnauthenticatedReconnectChat",
|
|
37
|
+
InitiateEndChat = "InitiateEndChat",
|
|
38
|
+
SetCustomContext = "SetCustomContext",
|
|
39
|
+
ChatRetrievedFromCache = "ChatRetrievedFromCache",
|
|
40
|
+
MaximizeChat = "MaximizeChat",
|
|
41
|
+
ChatInitiated = "ChatInitiated",
|
|
42
|
+
CloseChat = "CloseChat",
|
|
43
|
+
InitiateEndChatOnBrowserUnload = "InitiateEndChatOnBrowserUnload",
|
|
44
|
+
ClosePopoutWindow = "ClosePopoutWindow"
|
|
45
|
+
}
|
|
20
46
|
export declare enum TelemetryEvent {
|
|
21
47
|
CallAdded = "CallAdded",
|
|
22
48
|
LocalVideoStreamAdded = "LocalVideoStreamAdded",
|
|
@@ -63,7 +89,10 @@ export declare enum TelemetryEvent {
|
|
|
63
89
|
PrechatSurveyLoaded = "PrechatSurveyLoaded",
|
|
64
90
|
PrechatSubmitted = "PrechatSubmitted",
|
|
65
91
|
StartChatSDKCall = "StartChatCall",
|
|
66
|
-
|
|
92
|
+
StartChatEventRecevied = "StartChatEventReceived",
|
|
93
|
+
EndChatSDKCall = "EndChatSDKCall",
|
|
94
|
+
EndChatEventReceived = "EndChatEventReceived",
|
|
95
|
+
WindowClosed = "WindowClosed",
|
|
67
96
|
OnNewMessageFailed = "OnNewMessageFailed",
|
|
68
97
|
OnNewMessageAudioNotificationFailed = "OnNewMessageAudioNotificationFailed",
|
|
69
98
|
DownloadTranscriptResponseNullOrUndefined = "DownloadTranscriptResponseNullOrUndefined",
|
|
@@ -77,6 +106,7 @@ export declare enum TelemetryEvent {
|
|
|
77
106
|
LoadingPaneLoaded = "LoadingPaneLoaded",
|
|
78
107
|
EmailTranscriptLoaded = "EmailTranscriptLoaded",
|
|
79
108
|
OutOfOfficePaneLoaded = "OutOfOfficePaneLoaded",
|
|
109
|
+
PostChatSurveyLoadingPaneLoaded = "PostChatSurveyLoadingPaneLoaded",
|
|
80
110
|
PostChatSurveyLoaded = "PostChatSurveyLoaded",
|
|
81
111
|
ConfirmationPaneLoaded = "ConfirmationPaneLoaded",
|
|
82
112
|
ProactiveChatPaneLoaded = "ProactiveChatPaneLoaded",
|
|
@@ -87,6 +117,12 @@ export declare enum TelemetryEvent {
|
|
|
87
117
|
EmailTranscriptButtonClicked = "EmailTranscriptButtonClicked",
|
|
88
118
|
EmailTranscriptCancelButtonClicked = "EmailTranscriptCancelButtonClicked",
|
|
89
119
|
AudioToggleButtonClicked = "AudioToggleButtonClicked",
|
|
120
|
+
SuppressBotMagicCodeSucceeded = "SuppressBotMagicCodeSucceeded",
|
|
121
|
+
SuppressBotMagicCodeFailed = "SuppressBotMagicCodeFailed",
|
|
122
|
+
GetConversationDetailsException = "GetConversationDetailsException",
|
|
123
|
+
BrowserUnloadEventStarted = "BrowserUnloadEventStarted",
|
|
124
|
+
GetAuthTokenCalled = "GetAuthTokenCalled",
|
|
125
|
+
ReceivedNullOrEmptyToken = "ReceivedNullOrEmptyToken",
|
|
90
126
|
ProcessingHTMLTextMiddlewareFailed = "ProcessingHTMLTextMiddlewareFailed",
|
|
91
127
|
ProcessingSanitizationMiddlewareFailed = "ProcessingSanitizationMiddlewareFailed",
|
|
92
128
|
FormatTagsMiddlewareJSONStringifyFailed = "FormatTagsMiddlewareJSONStringifyFailed",
|
|
@@ -98,6 +134,7 @@ export declare enum TelemetryEvent {
|
|
|
98
134
|
InvalidConfiguration = "InvalidConfiguration",
|
|
99
135
|
SendTypingIndicatorSucceeded = "SendTypingIndicatorSucceeded",
|
|
100
136
|
SendTypingIndicatorFailed = "SendTypingIndicatorFailed",
|
|
137
|
+
WebChatEvent = "WebChatEvent",
|
|
101
138
|
PreChatSurveyStartChatMethodFailed = "PreChatSurveyStartChatMethodFailed",
|
|
102
139
|
ChatAlreadyTriggered = "ChatAlreadyTriggered",
|
|
103
140
|
StartProactiveChatEventReceived = "StartProactiveChatEventReceived",
|
|
@@ -106,16 +143,17 @@ export declare enum TelemetryEvent {
|
|
|
106
143
|
ProactiveChatRejected = "ProactiveChatRejected",
|
|
107
144
|
IncomingProactiveChatScreenLoaded = "IncomingProactiveChatScreenLoaded",
|
|
108
145
|
ProactiveChatClosed = "ProactiveChatClosed",
|
|
109
|
-
ProactiveChatStartChat = "ProactiveChatStartChat",
|
|
110
|
-
ProactiveChatStartPopoutChat = "ProactiveChatStartPopoutChat",
|
|
111
146
|
ReconnectChatContinueConversation = "ReconnectChatContinueConversation",
|
|
112
147
|
ReconnectChatStartNewConversation = "ReconnectChatStartNewConversation",
|
|
113
148
|
ReconnectChatMinimize = "ReconnectChatMinimize",
|
|
114
|
-
|
|
149
|
+
MessageSent = "MessageSent",
|
|
150
|
+
MessageReceived = "MessageReceived",
|
|
151
|
+
CustomContextReceived = "CustomContextReceived"
|
|
115
152
|
}
|
|
116
153
|
export interface TelemetryInput {
|
|
117
154
|
scenarioType: ScenarioType;
|
|
118
155
|
payload: TelemetryData;
|
|
156
|
+
telemetryInfo?: any;
|
|
119
157
|
}
|
|
120
158
|
export declare class TelemetryConstants {
|
|
121
159
|
private static map;
|
|
@@ -11,6 +11,7 @@ export interface TelemetryEventWrapper {
|
|
|
11
11
|
Description?: string;
|
|
12
12
|
ExceptionDetails?: any;
|
|
13
13
|
ElapsedTimeInMilliseconds?: number;
|
|
14
|
+
Data?: any;
|
|
14
15
|
}
|
|
15
16
|
export declare class TelemetryHelper {
|
|
16
17
|
static callId: string;
|
|
@@ -30,9 +31,10 @@ export declare class TelemetryHelper {
|
|
|
30
31
|
static addWidgetDataToTelemetry(telemetryConfig: ITelemetryConfig, telemetryInternalData: IInternalTelemetryData): IInternalTelemetryData;
|
|
31
32
|
static addSessionDataToTelemetry(chatSession: LiveChatContext, telemetryInternalData: IInternalTelemetryData): IInternalTelemetryData;
|
|
32
33
|
static addConversationDataToTelemetry(liveWorkItem: LiveWorkItemDetails, telemetryInternalData: IInternalTelemetryData): IInternalTelemetryData;
|
|
33
|
-
static logCallingEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper, callId?: string
|
|
34
|
+
static logCallingEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper, callId?: string) => void;
|
|
34
35
|
static logLoadingEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
|
|
35
36
|
static logActionEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
|
|
36
37
|
static logSDKEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
|
|
37
38
|
static logConfigDataEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
|
|
39
|
+
static logWebChatEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
|
|
38
40
|
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface BaseTelemetryData {
|
|
2
|
+
Data?: any;
|
|
3
|
+
}
|
|
4
|
+
export interface ConfigValidationTelemetryData extends BaseTelemetryData {
|
|
2
5
|
Event?: string;
|
|
3
6
|
RequestId?: string;
|
|
4
7
|
LCWVersion?: string;
|
|
@@ -8,7 +11,7 @@ export interface ConfigValidationTelemetryData {
|
|
|
8
11
|
ExceptionDetails?: object;
|
|
9
12
|
Domain?: string;
|
|
10
13
|
}
|
|
11
|
-
export interface LoadTelemetryData {
|
|
14
|
+
export interface LoadTelemetryData extends BaseTelemetryData {
|
|
12
15
|
Event?: string;
|
|
13
16
|
ResourcePath?: string;
|
|
14
17
|
ElapsedTimeInMilliseconds?: number;
|
|
@@ -20,18 +23,18 @@ export interface LoadTelemetryData {
|
|
|
20
23
|
OCChatWidgetVersion?: string;
|
|
21
24
|
OCChatComponentsVersion?: string;
|
|
22
25
|
}
|
|
23
|
-
export interface MessageProcessingErrorData {
|
|
26
|
+
export interface MessageProcessingErrorData extends BaseTelemetryData {
|
|
24
27
|
Event: string;
|
|
25
28
|
ExceptionDetails: object;
|
|
26
29
|
}
|
|
27
|
-
export interface OCChatSDKTelemetryData {
|
|
30
|
+
export interface OCChatSDKTelemetryData extends BaseTelemetryData {
|
|
28
31
|
RequestId: string;
|
|
29
32
|
Event?: string;
|
|
30
33
|
ElapsedTimeInMilliseconds?: number;
|
|
31
34
|
TransactionId: string;
|
|
32
35
|
ExceptionDetails?: object;
|
|
33
36
|
}
|
|
34
|
-
export interface IC3ClientTelemetryData {
|
|
37
|
+
export interface IC3ClientTelemetryData extends BaseTelemetryData {
|
|
35
38
|
SubscriptionId?: string;
|
|
36
39
|
EndpointUrl?: string;
|
|
37
40
|
EndpointId?: string;
|
|
@@ -42,7 +45,7 @@ export interface IC3ClientTelemetryData {
|
|
|
42
45
|
ShouldBubbleToHost?: boolean;
|
|
43
46
|
Description?: string;
|
|
44
47
|
}
|
|
45
|
-
export interface WebChatTelemetryData {
|
|
48
|
+
export interface WebChatTelemetryData extends BaseTelemetryData {
|
|
46
49
|
data?: any;
|
|
47
50
|
dimensions?: any;
|
|
48
51
|
duration?: number;
|
|
@@ -53,7 +56,7 @@ export interface WebChatTelemetryData {
|
|
|
53
56
|
name?: string;
|
|
54
57
|
type?: string;
|
|
55
58
|
}
|
|
56
|
-
export interface ACSAdapterTelemetryData {
|
|
59
|
+
export interface ACSAdapterTelemetryData extends BaseTelemetryData {
|
|
57
60
|
Description?: string;
|
|
58
61
|
ACSUserId?: string;
|
|
59
62
|
ChatThreadId?: string;
|
|
@@ -63,14 +66,14 @@ export interface ACSAdapterTelemetryData {
|
|
|
63
66
|
ErrorCode?: string;
|
|
64
67
|
ExceptionDetails?: any;
|
|
65
68
|
}
|
|
66
|
-
export interface ActionTelemetryData {
|
|
69
|
+
export interface ActionTelemetryData extends BaseTelemetryData {
|
|
67
70
|
Event?: string;
|
|
68
71
|
ElapsedTimeInMilliseconds?: number;
|
|
69
72
|
ActionType?: string;
|
|
70
73
|
ExceptionDetails?: object;
|
|
71
74
|
Description?: string;
|
|
72
75
|
}
|
|
73
|
-
export interface CallingTelemetryData {
|
|
76
|
+
export interface CallingTelemetryData extends BaseTelemetryData {
|
|
74
77
|
CallId?: string;
|
|
75
78
|
Event?: string;
|
|
76
79
|
ElapsedTimeInMilliseconds?: number;
|
|
@@ -32,13 +32,13 @@ export interface ITelemetryConfig {
|
|
|
32
32
|
/**
|
|
33
33
|
* Omnichannel chat widget version
|
|
34
34
|
*/
|
|
35
|
-
chatWidgetVersion
|
|
35
|
+
chatWidgetVersion: string;
|
|
36
36
|
/**
|
|
37
37
|
* Omnichannel chat components version
|
|
38
38
|
*/
|
|
39
|
-
chatComponentVersion
|
|
39
|
+
chatComponentVersion: string;
|
|
40
40
|
/**
|
|
41
41
|
* Omnichannel Chat SDK Version
|
|
42
42
|
*/
|
|
43
|
-
OCChatSDKVersion
|
|
43
|
+
OCChatSDKVersion: string;
|
|
44
44
|
}
|
|
@@ -18,6 +18,12 @@ export declare const extractPreChatSurveyResponseValues: (preChatSurvey: string,
|
|
|
18
18
|
value: string;
|
|
19
19
|
}[]) => {};
|
|
20
20
|
export declare const isNullOrUndefined: (obj: any) => boolean;
|
|
21
|
-
export declare const isNullOrEmptyString: (s: string) => boolean;
|
|
21
|
+
export declare const isNullOrEmptyString: (s: string | null) => boolean;
|
|
22
22
|
export declare const newGuid: () => string;
|
|
23
23
|
export declare const createTimer: () => ITimer;
|
|
24
|
+
export declare const getDomain: (hostValue: any) => string;
|
|
25
|
+
export declare const getWidgetCacheId: (orgId: string, widgetId: string) => string;
|
|
26
|
+
export declare const getWidgetEndChatEventName: (orgId: string, widgetId: string) => string;
|
|
27
|
+
export declare const getStateFromCache: (orgId: string, widgetId: string) => any;
|
|
28
|
+
export declare const isUndefinedOrEmpty: (object: any) => boolean;
|
|
29
|
+
export declare const addDelayInMs: (ms: number) => Promise<void>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
|
|
1
2
|
import { IConfirmationPaneStatefulProps } from "./IConfirmationPaneStatefulProps";
|
|
2
3
|
export interface IConfirmationPaneStatefulParams extends IConfirmationPaneStatefulProps {
|
|
3
4
|
/**
|
|
@@ -5,10 +6,9 @@ export interface IConfirmationPaneStatefulParams extends IConfirmationPaneStatef
|
|
|
5
6
|
*/
|
|
6
7
|
setPostChatContext: () => Promise<void>;
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
+
* prepareEndChat: Internal Prop injected for checking PostChat contexts and trigerring end of chat
|
|
9
10
|
* @param adapter : The chat adapter for the live chat session
|
|
10
|
-
* @param
|
|
11
|
-
* @param skipCloseChat : If set to true endchat will skip closing the live chat instance
|
|
11
|
+
* @param state : The chat state where the conversation is currently in
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
prepareEndChat: (adapter: any, state: ILiveChatWidgetContext) => Promise<void>;
|
|
14
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const downloadTranscript: (chatSDK: any, renderMarkDown?: ((transcriptContent: string) => string) | undefined, bannerMessageOnError?: string
|
|
1
|
+
export declare const downloadTranscript: (chatSDK: any, renderMarkDown?: ((transcriptContent: string) => string) | undefined, bannerMessageOnError?: string, attachmentMessage?: string) => Promise<void>;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { Dispatch } from "react";
|
|
2
2
|
import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
|
|
3
3
|
import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
|
|
4
|
-
|
|
4
|
+
import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
|
|
5
|
+
declare const prepareEndChat: (props: ILiveChatWidgetProps, chatSDK: any, setAdapter: any, setWebChatStyles: any, dispatch: Dispatch<ILiveChatWidgetAction>, adapter: any, state: ILiveChatWidgetContext) => Promise<void>;
|
|
6
|
+
declare const endChat: (props: ILiveChatWidgetProps, chatSDK: any, setAdapter: any, setWebChatStyles: any, dispatch: Dispatch<ILiveChatWidgetAction>, adapter: any, skipEndChatSDK?: boolean, skipCloseChat?: boolean, postMessageToOtherTab?: boolean) => Promise<void>;
|
|
7
|
+
export { prepareEndChat, endChat };
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import "regenerator-runtime/runtime";
|
|
2
|
+
import ChatConfig from "@microsoft/omnichannel-chat-sdk/lib/core/ChatConfig";
|
|
2
3
|
import { Dispatch } from "react";
|
|
3
4
|
import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
|
|
4
5
|
import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
|
|
6
|
+
declare const getChatReconnectContext: (chatSDK: any, reconnectId?: string) => Promise<any>;
|
|
5
7
|
declare const getReconnectIdForAuthenticatedChat: (props: ILiveChatWidgetProps, chatSDK: any) => Promise<string | undefined>;
|
|
6
|
-
declare const handleUnauthenticatedReconnectChat: (dispatch: Dispatch<ILiveChatWidgetAction>, reconnectId: string, initStartChat: any) => Promise<void>;
|
|
7
|
-
|
|
8
|
+
declare const handleUnauthenticatedReconnectChat: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string) => Promise<string | null>) | undefined, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, reconnectId: string, initStartChat: any, redirectInSameWindow: boolean | undefined) => Promise<void>;
|
|
9
|
+
declare const startUnauthenticatedReconnectChat: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string) => Promise<string | null>) | undefined, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, reconnectId: string, initStartChat: any) => Promise<void>;
|
|
10
|
+
declare const handleRedirectUnauthenticatedReconnectChat: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string) => Promise<string | null>) | undefined, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, initStartChat: any, reconnectId: string, redirectInSameWindow: boolean | undefined) => Promise<void>;
|
|
11
|
+
export { getChatReconnectContext, getReconnectIdForAuthenticatedChat, handleUnauthenticatedReconnectChat, startUnauthenticatedReconnectChat, handleRedirectUnauthenticatedReconnectChat };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Dispatch } from "react";
|
|
2
2
|
import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
|
|
3
|
-
export declare const setPostChatContextAndLoadSurvey: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, persistedChat?: boolean
|
|
3
|
+
export declare const setPostChatContextAndLoadSurvey: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, persistedChat?: boolean) => Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function shareObservable(observable: any): any;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import ChatConfig from "@microsoft/omnichannel-chat-sdk/lib/core/ChatConfig";
|
|
1
2
|
import { Dispatch } from "react";
|
|
2
3
|
import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
|
|
3
4
|
import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
|
|
4
5
|
import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
|
|
5
6
|
declare const prepareStartChat: (props: ILiveChatWidgetProps, chatSDK: any, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any) => Promise<void>;
|
|
6
|
-
declare const
|
|
7
|
-
|
|
7
|
+
declare const setPreChatAndInitiateChat: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string) => Promise<string | null>) | undefined, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, isProactiveChat?: boolean | false, proactiveChatEnablePrechatState?: boolean | false) => Promise<void>;
|
|
8
|
+
declare const initStartChat: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string) => Promise<string | null>) | undefined, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, params?: any, persistedState?: any) => Promise<void>;
|
|
9
|
+
export { prepareStartChat, initStartChat, setPreChatAndInitiateChat };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Dispatch } from "react";
|
|
2
2
|
import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
|
|
3
3
|
import { IProactiveChatNotificationConfig } from "../../proactivechatpanestateful/interfaces/IProactiveChatNotificationConfig";
|
|
4
|
-
export declare const startProactiveChat: (dispatch: Dispatch<ILiveChatWidgetAction>, notificationConfig?: IProactiveChatNotificationConfig
|
|
4
|
+
export declare const startProactiveChat: (dispatch: Dispatch<ILiveChatWidgetAction>, notificationConfig?: IProactiveChatNotificationConfig, enablePreChat?: boolean, inNewWindow?: boolean) => void;
|
package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetComponentOverrides.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export interface ILiveChatWidgetComponentOverrides {
|
|
|
9
9
|
outOfOfficeHoursPane?: ReactNode | string;
|
|
10
10
|
postChatLoadingPane?: ReactNode | string;
|
|
11
11
|
postChatSurveyPane?: ReactNode | string;
|
|
12
|
+
preChatSurveyPane?: ReactNode | string;
|
|
12
13
|
proactiveChatPane?: ReactNode | string;
|
|
13
14
|
reconnectChatPane?: ReactNode | string;
|
|
14
15
|
webChatContainer?: ReactNode | string;
|
|
@@ -45,8 +45,9 @@ export interface ILiveChatWidgetProps {
|
|
|
45
45
|
proactiveChatPaneProps?: IProactiveChatPaneStatefulProps;
|
|
46
46
|
reconnectChatPaneProps?: IReconnectChatPaneStatefulProps;
|
|
47
47
|
styleProps?: ILiveChatWidgetStyleProps;
|
|
48
|
-
telemetryConfig
|
|
48
|
+
telemetryConfig: ITelemetryConfig;
|
|
49
49
|
webChatContainerProps?: IWebChatContainerStatefulProps;
|
|
50
50
|
liveChatContextFromCache?: ILiveChatWidgetContext;
|
|
51
51
|
contextDataStore?: IContextDataStore;
|
|
52
|
+
getAuthToken?: (authClientFunction?: string) => Promise<string | null>;
|
|
52
53
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IReconnectChatPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/reconnectchatpane/interfaces/IReconnectChatPaneProps";
|
|
2
2
|
export interface IReconnectChatPaneStatefulProps extends IReconnectChatPaneProps {
|
|
3
|
-
authClientFunction?: string;
|
|
4
3
|
isReconnectEnabled?: boolean;
|
|
5
4
|
reconnectId?: string;
|
|
5
|
+
redirectInSameWindow?: boolean;
|
|
6
6
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import MockAdapter from "./mockadapter";
|
|
2
2
|
export declare class MockChatSDK {
|
|
3
3
|
protected sleep: (ms: any) => Promise<unknown>;
|
|
4
|
+
isMockModeOn: boolean;
|
|
4
5
|
startChat(): Promise<void>;
|
|
5
6
|
endChat(): null;
|
|
7
|
+
getChatToken(): null;
|
|
6
8
|
createChatAdapter(): MockAdapter;
|
|
7
9
|
getPreChatSurvey(parseToJson: boolean): string;
|
|
8
10
|
getConversationDetails(): {};
|