@microsoft/omnichannel-chat-widget 0.1.0-main.488d6f1 → 0.1.0-main.63cfb47
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 +3 -11
- package/lib/cjs/common/Constants.js +4 -2
- package/lib/cjs/common/telemetry/TelemetryConstants.js +34 -5
- package/lib/cjs/common/telemetry/TelemetryHelper.js +13 -0
- package/lib/cjs/common/telemetry/TelemetryManager.js +11 -6
- package/lib/cjs/common/telemetry/defaultConfigs/defaultAriaConfig.js +1 -1
- package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +6 -41
- package/lib/cjs/components/footerstateful/FooterStateful.js +1 -2
- package/lib/cjs/components/headerstateful/HeaderStateful.js +1 -7
- package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +5 -2
- package/lib/cjs/components/livechatwidget/common/endChat.js +39 -3
- package/lib/cjs/components/livechatwidget/common/initCallingSdk.js +1 -1
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +17 -5
- package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +105 -20
- package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +7 -6
- package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +6 -5
- package/lib/cjs/components/livechatwidget/common/startChat.js +43 -30
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +68 -24
- package/lib/cjs/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +8 -0
- package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +2 -2
- package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +4 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +9 -46
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +3 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +6 -6
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +44 -0
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +15 -16
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +5 -1
- package/lib/cjs/contexts/createReducer.js +0 -10
- package/lib/cjs/plugins/newMessageEventHandler.js +102 -0
- package/lib/esm/common/Constants.js +4 -2
- package/lib/esm/common/telemetry/TelemetryConstants.js +30 -4
- package/lib/esm/common/telemetry/TelemetryHelper.js +13 -1
- package/lib/esm/common/telemetry/TelemetryManager.js +10 -6
- package/lib/esm/common/telemetry/defaultConfigs/defaultAriaConfig.js +1 -1
- package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +6 -36
- package/lib/esm/components/footerstateful/FooterStateful.js +1 -2
- package/lib/esm/components/headerstateful/HeaderStateful.js +1 -7
- package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +5 -3
- package/lib/esm/components/livechatwidget/common/endChat.js +40 -6
- package/lib/esm/components/livechatwidget/common/initCallingSdk.js +1 -1
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +13 -4
- package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +94 -20
- package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +4 -3
- package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +6 -5
- package/lib/esm/components/livechatwidget/common/startChat.js +43 -31
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +62 -22
- package/lib/esm/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +6 -0
- package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +3 -3
- package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +4 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +7 -44
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +2 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +6 -6
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +31 -0
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +15 -16
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +5 -1
- package/lib/esm/contexts/createReducer.js +0 -9
- package/lib/esm/plugins/newMessageEventHandler.js +84 -0
- package/lib/types/common/Constants.d.ts +2 -1
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +21 -3
- package/lib/types/common/telemetry/TelemetryHelper.d.ts +1 -0
- 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/livechatwidget/common/endChat.d.ts +4 -1
- package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +5 -2
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetComponentOverrides.d.ts +1 -0
- package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulProps.d.ts +1 -0
- package/lib/types/components/webchatcontainerstateful/common/mockchatsdk.d.ts +1 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.d.ts +0 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.d.ts +1 -0
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +15 -16
- package/lib/types/plugins/newMessageEventHandler.d.ts +2 -0
- package/package.json +6 -5
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.createActivityMiddleware = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _TelemetryConstants = require("../../../../../common/telemetry/TelemetryConstants");
|
|
9
9
|
|
|
10
10
|
var _Constants = require("../../../../../common/Constants");
|
|
11
11
|
|
|
@@ -15,16 +15,16 @@ var _DirectLineSenderRole = require("../../enums/DirectLineSenderRole");
|
|
|
15
15
|
|
|
16
16
|
var _MessageType = require("../../enums/MessageType");
|
|
17
17
|
|
|
18
|
+
var _react = _interopRequireDefault(require("react"));
|
|
19
|
+
|
|
20
|
+
var _TelemetryHelper = require("../../../../../common/telemetry/TelemetryHelper");
|
|
21
|
+
|
|
18
22
|
var _defaultSystemMessageStyles = require("./defaultStyles/defaultSystemMessageStyles");
|
|
19
23
|
|
|
20
24
|
var _defaultUserMessageStyles = require("./defaultStyles/defaultUserMessageStyles");
|
|
21
25
|
|
|
22
26
|
var _utils = require("../../../../../common/utils");
|
|
23
27
|
|
|
24
|
-
var _TelemetryHelper = require("../../../../../common/telemetry/TelemetryHelper");
|
|
25
|
-
|
|
26
|
-
var _TelemetryConstants = require("../../../../../common/telemetry/TelemetryConstants");
|
|
27
|
-
|
|
28
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
29
|
|
|
30
30
|
/******
|
|
@@ -34,49 +34,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
34
34
|
* 1. Renders system messages differently, according to Microsoft LiveChatWidget styles
|
|
35
35
|
* 2. Changes the font size of user messages
|
|
36
36
|
* 3. Decodes certain html characters that came through from chat services
|
|
37
|
-
* 4. Triggers end conversation sequence when the chat thread is deleted
|
|
38
37
|
******/
|
|
39
38
|
const loggedSystemMessages = new Array(); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
40
39
|
|
|
41
|
-
const handleThreadUpdate = channelData => {
|
|
42
|
-
var _channelData$properti, _channelData$properti2;
|
|
43
|
-
|
|
44
|
-
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
45
|
-
Event: _TelemetryConstants.TelemetryEvent.IC3ThreadUpdateEventReceived,
|
|
46
|
-
Description: "IC3 ThreadUpdateEvent Received"
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
const postConversationEndedAction = () => {
|
|
50
|
-
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
51
|
-
Event: _TelemetryConstants.TelemetryEvent.ConversationEndedThreadEventReceived,
|
|
52
|
-
Description: "Conversation is ended by agent side or by timeout."
|
|
53
|
-
});
|
|
54
|
-
}; // If the Thread is deleted, then display post conversation survey if enabled.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const isThreadDeleted = (channelData === null || channelData === void 0 ? void 0 : (_channelData$properti = channelData.properties) === null || _channelData$properti === void 0 ? void 0 : (_channelData$properti2 = _channelData$properti.isdeleted) === null || _channelData$properti2 === void 0 ? void 0 : _channelData$properti2.toLowerCase()) === _Constants.Constants.true;
|
|
58
|
-
|
|
59
|
-
if (isThreadDeleted) {
|
|
60
|
-
postConversationEndedAction();
|
|
61
|
-
return;
|
|
62
|
-
} //check if customer is still in the thread
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
if (channelData.members && channelData.members.length > 0) {
|
|
66
|
-
for (let i = 0; i < channelData.members.length; i++) {
|
|
67
|
-
const id = channelData.members[i].id;
|
|
68
|
-
const tag = channelData.members[i].tag; // In case of ACS customer is not removed from thread and has "left" tag
|
|
69
|
-
|
|
70
|
-
if (id.startsWith(_Constants.Constants.visitorIdPrefix) && tag !== _Constants.Constants.left) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
postConversationEndedAction();
|
|
77
|
-
}; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
78
|
-
|
|
79
|
-
|
|
80
40
|
const handleSystemMessage = (next, args, card, systemMessageStyleProps) => {
|
|
81
41
|
var _card$activity, _card$activity$channe, _card$activity$channe2, _card$activity2, _card$activity2$chann, _card$activity3, _card$activity3$chann, _card$activity3$chann2, _card$activity4, _card$activity4$chann, _card$activity5, _card$activity5$chann, _card$nextVisibleActi, _card$nextVisibleActi2, _card$activity6, _card$activity6$chann, _card$activity7, _card$nextVisibleActi3, _card$activity8;
|
|
82
42
|
|
|
@@ -129,7 +89,10 @@ const createActivityMiddleware = (systemMessageStyleProps, userMessageStyleProps
|
|
|
129
89
|
var _card$activity$channe3;
|
|
130
90
|
|
|
131
91
|
if (((_card$activity$channe3 = card.activity.channelData) === null || _card$activity$channe3 === void 0 ? void 0 : _card$activity$channe3.type) === _MessageType.MessageTypes.Thread) {
|
|
132
|
-
|
|
92
|
+
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
93
|
+
Event: _TelemetryConstants.TelemetryEvent.IC3ThreadUpdateEventReceived,
|
|
94
|
+
Description: "IC3 ThreadUpdateEvent Received"
|
|
95
|
+
});
|
|
133
96
|
}
|
|
134
97
|
|
|
135
98
|
return () => false;
|
|
@@ -11,6 +11,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _FileAttachmentIconManager = require("../../../common/utils/FileAttachmentIconManager");
|
|
13
13
|
|
|
14
|
+
var _TelemetryConstants = require("../../../../../common/telemetry/TelemetryConstants");
|
|
15
|
+
|
|
14
16
|
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
15
17
|
|
|
16
18
|
var _WebChatActionType = require("../../enums/WebChatActionType");
|
|
@@ -211,7 +213,7 @@ const createAttachmentMiddleware = enableInlinePlaying => {
|
|
|
211
213
|
const errorData = "Unable to parse the adaptive card format";
|
|
212
214
|
|
|
213
215
|
_omnichannelChatComponents.BroadcastService.postMessage({
|
|
214
|
-
eventName:
|
|
216
|
+
eventName: _TelemetryConstants.BroadcastEvent.InvalidAdaptiveCardFormat,
|
|
215
217
|
payload: {
|
|
216
218
|
Message: errorData,
|
|
217
219
|
ExceptionDetails: e
|
|
@@ -28,22 +28,22 @@ const createConversationEndMiddleware = conversationEndCallback => _ref => {
|
|
|
28
28
|
var _action$payload;
|
|
29
29
|
|
|
30
30
|
if ((action === null || action === void 0 ? void 0 : action.type) == _WebChatActionType.WebChatActionType.DIRECT_LINE_INCOMING_ACTIVITY && (_action$payload = action.payload) !== null && _action$payload !== void 0 && _action$payload.activity) {
|
|
31
|
-
var _activity$from, _activity$from2, _activity$
|
|
31
|
+
var _activity$from, _activity$from2, _activity$channelData7, _activity$channelData8;
|
|
32
32
|
|
|
33
33
|
const activity = action.payload.activity;
|
|
34
34
|
|
|
35
35
|
if (((_activity$from = activity.from) === null || _activity$from === void 0 ? void 0 : _activity$from.role) === _DirectLineSenderRole.DirectLineSenderRole.Bot && activity.channelId === "ACS_CHANNEL") {
|
|
36
|
-
var _activity$channelData, _activity$channelData2, _activity$channelData3, _activity$channelData4;
|
|
36
|
+
var _activity$channelData, _activity$channelData2, _activity$channelData3, _activity$channelData4, _activity$channelData5, _activity$channelData6;
|
|
37
37
|
|
|
38
38
|
// ACS
|
|
39
|
-
if ((_activity$channelData = activity.channelData) !== null && _activity$channelData !== void 0 && (_activity$channelData2 = _activity$channelData.tags) !== null && _activity$channelData2 !== void 0 && _activity$channelData2.includes(_Constants.Constants.systemMessageTag) && (_activity$channelData3 = activity.channelData) !== null && _activity$channelData3 !== void 0 && (_activity$channelData4 = _activity$channelData3.tags) !== null && _activity$channelData4 !== void 0 && _activity$channelData4.includes(_Constants.Constants.agentEndConversationMessageTag)) {
|
|
39
|
+
if ((_activity$channelData = activity.channelData) !== null && _activity$channelData !== void 0 && (_activity$channelData2 = _activity$channelData.tags) !== null && _activity$channelData2 !== void 0 && _activity$channelData2.includes(_Constants.Constants.systemMessageTag) && ((_activity$channelData3 = activity.channelData) !== null && _activity$channelData3 !== void 0 && (_activity$channelData4 = _activity$channelData3.tags) !== null && _activity$channelData4 !== void 0 && _activity$channelData4.includes(_Constants.Constants.agentEndConversationMessageTag) || (_activity$channelData5 = activity.channelData) !== null && _activity$channelData5 !== void 0 && (_activity$channelData6 = _activity$channelData5.tags) !== null && _activity$channelData6 !== void 0 && _activity$channelData6.includes(_Constants.Constants.supervisorForceCloseMessageTag))) {
|
|
40
40
|
conversationEndCallback();
|
|
41
41
|
}
|
|
42
|
-
} else if (((_activity$from2 = activity.from) === null || _activity$from2 === void 0 ? void 0 : _activity$from2.role) === _DirectLineSenderRole.DirectLineSenderRole.Channel && ((_activity$
|
|
43
|
-
var _activity$
|
|
42
|
+
} else if (((_activity$from2 = activity.from) === null || _activity$from2 === void 0 ? void 0 : _activity$from2.role) === _DirectLineSenderRole.DirectLineSenderRole.Channel && ((_activity$channelData7 = activity.channelData) === null || _activity$channelData7 === void 0 ? void 0 : _activity$channelData7.type) === _MessageType.MessageTypes.Thread && (_activity$channelData8 = activity.channelData) !== null && _activity$channelData8 !== void 0 && _activity$channelData8.properties) {
|
|
43
|
+
var _activity$channelData9, _activity$channelData10, _activity$channelData11, _activity$channelData12;
|
|
44
44
|
|
|
45
45
|
// IC3
|
|
46
|
-
if (((_activity$
|
|
46
|
+
if (((_activity$channelData9 = activity.channelData) === null || _activity$channelData9 === void 0 ? void 0 : (_activity$channelData10 = _activity$channelData9.properties) === null || _activity$channelData10 === void 0 ? void 0 : _activity$channelData10.isdeleted) === _Constants.Constants.truePascal || !((_activity$channelData11 = activity.channelData) !== null && _activity$channelData11 !== void 0 && (_activity$channelData12 = _activity$channelData11.properties) !== null && _activity$channelData12 !== void 0 && _activity$channelData12.containsExternalEntitiesListeningAll)) {
|
|
47
47
|
conversationEndCallback();
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createWebChatTelemetry = createWebChatTelemetry;
|
|
7
|
+
|
|
8
|
+
var _TelemetryConstants = require("../../../../common/telemetry/TelemetryConstants");
|
|
9
|
+
|
|
10
|
+
var _TelemetryHelper = require("../../../../common/telemetry/TelemetryHelper");
|
|
11
|
+
|
|
12
|
+
function createWebChatTelemetry() {
|
|
13
|
+
const handleTelemetry = event => {
|
|
14
|
+
const {
|
|
15
|
+
level
|
|
16
|
+
} = event;
|
|
17
|
+
const loglevel = level ? level.toUpperCase() : "";
|
|
18
|
+
|
|
19
|
+
switch (loglevel) {
|
|
20
|
+
case _TelemetryConstants.LogLevel.DEBUG:
|
|
21
|
+
_TelemetryHelper.TelemetryHelper.logWebChatEvent(_TelemetryConstants.LogLevel.DEBUG, event);
|
|
22
|
+
|
|
23
|
+
break;
|
|
24
|
+
|
|
25
|
+
case _TelemetryConstants.LogLevel.WARN:
|
|
26
|
+
_TelemetryHelper.TelemetryHelper.logWebChatEvent(_TelemetryConstants.LogLevel.WARN, event);
|
|
27
|
+
|
|
28
|
+
break;
|
|
29
|
+
|
|
30
|
+
case _TelemetryConstants.LogLevel.ERROR:
|
|
31
|
+
_TelemetryHelper.TelemetryHelper.logWebChatEvent(_TelemetryConstants.LogLevel.ERROR, event);
|
|
32
|
+
|
|
33
|
+
break;
|
|
34
|
+
|
|
35
|
+
case _TelemetryConstants.LogLevel.INFO:
|
|
36
|
+
default:
|
|
37
|
+
_TelemetryHelper.TelemetryHelper.logWebChatEvent(_TelemetryConstants.LogLevel.INFO, event);
|
|
38
|
+
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
return handleTelemetry;
|
|
44
|
+
}
|
|
@@ -23,20 +23,19 @@ exports.LiveChatWidgetActionType = LiveChatWidgetActionType;
|
|
|
23
23
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_AUDIO_NOTIFICATION"] = 12] = "SET_AUDIO_NOTIFICATION";
|
|
24
24
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_E2VV_ENABLED"] = 13] = "SET_E2VV_ENABLED";
|
|
25
25
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_CONTEXT"] = 14] = "SET_POST_CHAT_CONTEXT";
|
|
26
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
27
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
28
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
29
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
30
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
31
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
32
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
33
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
34
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
35
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
36
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
37
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
38
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
39
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
40
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
41
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONTEXT"] = 30] = "SET_LIVE_CHAT_CONTEXT";
|
|
26
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SHOW_CALLING_CONTAINER"] = 15] = "SHOW_CALLING_CONTAINER";
|
|
27
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_INCOMING_CALL"] = 16] = "SET_INCOMING_CALL";
|
|
28
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_VIDEO_CALL"] = 17] = "DISABLE_VIDEO_CALL";
|
|
29
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_LOCAL_VIDEO"] = 18] = "DISABLE_LOCAL_VIDEO";
|
|
30
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_REMOTE_VIDEO"] = 19] = "DISABLE_REMOTE_VIDEO";
|
|
31
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CHAT_TOKEN"] = 20] = "SET_CHAT_TOKEN";
|
|
32
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SKIP_CHAT_BUTTON_RENDERING"] = 21] = "SET_SKIP_CHAT_BUTTON_RENDERING";
|
|
33
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PROACTIVE_CHAT_PARAMS"] = 22] = "SET_PROACTIVE_CHAT_PARAMS";
|
|
34
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_TELEMETRY_DATA"] = 23] = "SET_TELEMETRY_DATA";
|
|
35
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_RECONNECT_ID"] = 24] = "SET_RECONNECT_ID";
|
|
36
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_UNREAD_MESSAGE_COUNT"] = 25] = "SET_UNREAD_MESSAGE_COUNT";
|
|
37
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_FOCUS_CHAT_BUTTON"] = 26] = "SET_FOCUS_CHAT_BUTTON";
|
|
38
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_ENDED_BY_AGENT"] = 27] = "SET_CONVERSATION_ENDED_BY_AGENT";
|
|
39
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_STATE"] = 28] = "SET_WIDGET_STATE";
|
|
40
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONTEXT"] = 29] = "SET_LIVE_CHAT_CONTEXT";
|
|
42
41
|
})(LiveChatWidgetActionType || (exports.LiveChatWidgetActionType = LiveChatWidgetActionType = {}));
|
|
@@ -12,6 +12,10 @@ var _defaultMiddlewareLocalizedTexts = require("../../components/webchatcontaine
|
|
|
12
12
|
const getLiveChatWidgetContextInitialState = props => {
|
|
13
13
|
var _props$webChatContain;
|
|
14
14
|
|
|
15
|
+
if (props !== null && props !== void 0 && props.liveChatContextFromCache) {
|
|
16
|
+
return props === null || props === void 0 ? void 0 : props.liveChatContextFromCache;
|
|
17
|
+
}
|
|
18
|
+
|
|
15
19
|
const LiveChatWidgetContextInitialState = {
|
|
16
20
|
domainStates: {
|
|
17
21
|
liveChatConfig: props.chatConfig,
|
|
@@ -56,7 +60,7 @@ const getLiveChatWidgetContextInitialState = props => {
|
|
|
56
60
|
focusChatButton: false
|
|
57
61
|
}
|
|
58
62
|
};
|
|
59
|
-
return
|
|
63
|
+
return LiveChatWidgetContextInitialState;
|
|
60
64
|
};
|
|
61
65
|
|
|
62
66
|
exports.getLiveChatWidgetContextInitialState = getLiveChatWidgetContextInitialState;
|
|
@@ -7,8 +7,6 @@ exports.createReducer = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _LiveChatWidgetActionType = require("./common/LiveChatWidgetActionType");
|
|
9
9
|
|
|
10
|
-
var _TelemetryManager = require("../common/telemetry/TelemetryManager");
|
|
11
|
-
|
|
12
10
|
/* eslint-disable indent */
|
|
13
11
|
const createReducer = () => {
|
|
14
12
|
const reducer = (state, action) => {
|
|
@@ -93,13 +91,6 @@ const createReducer = () => {
|
|
|
93
91
|
}
|
|
94
92
|
};
|
|
95
93
|
|
|
96
|
-
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_SHOULD_SHOW_POST_CHAT:
|
|
97
|
-
return { ...state,
|
|
98
|
-
appStates: { ...state.appStates,
|
|
99
|
-
shouldShowPostChat: action.payload
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
|
|
103
94
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SHOW_CALLING_CONTAINER:
|
|
104
95
|
return { ...state,
|
|
105
96
|
uiStates: { ...state.uiStates,
|
|
@@ -197,7 +188,6 @@ const createReducer = () => {
|
|
|
197
188
|
};
|
|
198
189
|
|
|
199
190
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_TELEMETRY_DATA:
|
|
200
|
-
_TelemetryManager.TelemetryManager.InternalTelemetryData = action.payload;
|
|
201
191
|
return { ...state,
|
|
202
192
|
domainStates: { ...state.domainStates,
|
|
203
193
|
telemetryInternalData: action.payload
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createOnNewAdapterActivityHandler = void 0;
|
|
7
|
+
|
|
8
|
+
var _TelemetryConstants = require("../common/telemetry/TelemetryConstants");
|
|
9
|
+
|
|
10
|
+
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
11
|
+
|
|
12
|
+
var _Constants = require("../common/Constants");
|
|
13
|
+
|
|
14
|
+
var _TelemetryHelper = require("../common/telemetry/TelemetryHelper");
|
|
15
|
+
|
|
16
|
+
var _TelemetryManager = require("../common/telemetry/TelemetryManager");
|
|
17
|
+
|
|
18
|
+
const createOnNewAdapterActivityHandler = (chatId, userId) => {
|
|
19
|
+
const onNewAdapterActivityHandler = activity => {
|
|
20
|
+
var _activity$channelData, _activity$channelData2, _activity$channelData3;
|
|
21
|
+
|
|
22
|
+
const isActivityMessage = (activity === null || activity === void 0 ? void 0 : activity.type) === _Constants.Constants.message;
|
|
23
|
+
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.Constants.historyMessageTag)) && !(activity !== null && activity !== void 0 && (_activity$channelData3 = activity.channelData) !== null && _activity$channelData3 !== void 0 && _activity$channelData3.fromList);
|
|
24
|
+
|
|
25
|
+
if (isNotHistoryMessage) {
|
|
26
|
+
raiseMessageEvent(activity);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const raiseMessageEvent = activity => {
|
|
31
|
+
if ((activity === null || activity === void 0 ? void 0 : activity.type) === _Constants.Constants.message) {
|
|
32
|
+
var _TelemetryManager$Int, _activity$from;
|
|
33
|
+
|
|
34
|
+
const payload = {
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
36
|
+
text: activity === null || activity === void 0 ? void 0 : activity.text,
|
|
37
|
+
id: activity === null || activity === void 0 ? void 0 : activity.id,
|
|
38
|
+
type: activity === null || activity === void 0 ? void 0 : activity.type,
|
|
39
|
+
timestamp: activity === null || activity === void 0 ? void 0 : activity.timestamp,
|
|
40
|
+
chatId: chatId,
|
|
41
|
+
userId: userId,
|
|
42
|
+
conversationId: ((_TelemetryManager$Int = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int === void 0 ? void 0 : _TelemetryManager$Int.conversationId) ?? "",
|
|
43
|
+
channelData: activity === null || activity === void 0 ? void 0 : activity.channelData,
|
|
44
|
+
messageType: ""
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
if ((activity === null || activity === void 0 ? void 0 : (_activity$from = activity.from) === null || _activity$from === void 0 ? void 0 : _activity$from.role) === _Constants.Constants.userMessageTag) {
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
49
|
+
payload.messageType = _Constants.Constants.userMessageTag;
|
|
50
|
+
const newMessageSentEvent = {
|
|
51
|
+
eventName: _TelemetryConstants.BroadcastEvent.NewMessageSent,
|
|
52
|
+
payload: payload
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
_omnichannelChatComponents.BroadcastService.postMessage(newMessageSentEvent);
|
|
56
|
+
|
|
57
|
+
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
58
|
+
Event: _TelemetryConstants.TelemetryEvent.MessageSent,
|
|
59
|
+
Description: "New message sent"
|
|
60
|
+
});
|
|
61
|
+
} else {
|
|
62
|
+
var _activity$channelData4, _activity$channelData5;
|
|
63
|
+
|
|
64
|
+
if (activity !== null && activity !== void 0 && (_activity$channelData4 = activity.channelData) !== null && _activity$channelData4 !== void 0 && (_activity$channelData5 = _activity$channelData4.tags) !== null && _activity$channelData5 !== void 0 && _activity$channelData5.includes(_Constants.Constants.systemMessageTag)) {
|
|
65
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
66
|
+
payload.messageType = _Constants.Constants.systemMessageTag;
|
|
67
|
+
} else {
|
|
68
|
+
var _activity$channelData6, _activity$channelData7, _activity$channelData8;
|
|
69
|
+
|
|
70
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
71
|
+
const messageHasNoText = !(activity !== null && activity !== void 0 && activity.text); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
72
|
+
|
|
73
|
+
const messageHasNoTags = !(activity !== null && activity !== void 0 && activity.channelData) || !(activity !== null && activity !== void 0 && (_activity$channelData6 = activity.channelData) !== null && _activity$channelData6 !== void 0 && _activity$channelData6.tags) || (activity === null || activity === void 0 ? void 0 : (_activity$channelData7 = activity.channelData) === null || _activity$channelData7 === void 0 ? void 0 : (_activity$channelData8 = _activity$channelData7.tags) === null || _activity$channelData8 === void 0 ? void 0 : _activity$channelData8.length) === 0; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
74
|
+
|
|
75
|
+
const messageHasNoAttachments = !(activity !== null && activity !== void 0 && activity.attachments) || (activity === null || activity === void 0 ? void 0 : activity.attachments.length) === 0;
|
|
76
|
+
|
|
77
|
+
if (messageHasNoTags && messageHasNoText && messageHasNoAttachments) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
payload.messageType = _Constants.Constants.userMessageTag;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const newMessageReceivedEvent = {
|
|
85
|
+
eventName: _TelemetryConstants.BroadcastEvent.NewMessageReceived,
|
|
86
|
+
payload: payload
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
_omnichannelChatComponents.BroadcastService.postMessage(newMessageReceivedEvent);
|
|
90
|
+
|
|
91
|
+
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
92
|
+
Event: _TelemetryConstants.TelemetryEvent.MessageReceived,
|
|
93
|
+
Description: "New message received"
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
return onNewAdapterActivityHandler;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
exports.createOnNewAdapterActivityHandler = createOnNewAdapterActivityHandler;
|
|
@@ -8,8 +8,12 @@ _defineProperty(Constants, "systemMessageTag", "system");
|
|
|
8
8
|
|
|
9
9
|
_defineProperty(Constants, "userMessageTag", "user");
|
|
10
10
|
|
|
11
|
+
_defineProperty(Constants, "historyMessageTag", "history");
|
|
12
|
+
|
|
11
13
|
_defineProperty(Constants, "agentEndConversationMessageTag", "agentendconversation");
|
|
12
14
|
|
|
15
|
+
_defineProperty(Constants, "supervisorForceCloseMessageTag", "supervisorforceclosedconversation");
|
|
16
|
+
|
|
13
17
|
_defineProperty(Constants, "receivedMessageClassName", "ms_lcw_webchat_received_message");
|
|
14
18
|
|
|
15
19
|
_defineProperty(Constants, "sentMessageClassName", "ms_lcw_webchat_sent_message");
|
|
@@ -118,8 +122,6 @@ _defineProperty(Constants, "InputSubmit", "InputSubmit");
|
|
|
118
122
|
|
|
119
123
|
_defineProperty(Constants, "ReconnectIdAttributeName", "oc.reconnectid");
|
|
120
124
|
|
|
121
|
-
_defineProperty(Constants, "redirectPageRequest", "redirectPageRequest");
|
|
122
|
-
|
|
123
125
|
_defineProperty(Constants, "LiveChatWidget", "LiveChatWidgetNew");
|
|
124
126
|
|
|
125
127
|
_defineProperty(Constants, "GuidPattern", "xx-x-4m-ym-xxx");
|
|
@@ -13,7 +13,7 @@ export let ScenarioType;
|
|
|
13
13
|
ScenarioType["ACS_ADAPTER"] = "LCW_ACSAdapterEvents";
|
|
14
14
|
})(ScenarioType || (ScenarioType = {}));
|
|
15
15
|
|
|
16
|
-
export let LogLevel;
|
|
16
|
+
export let LogLevel; // Events used in certain functionalities that are not being logged
|
|
17
17
|
|
|
18
18
|
(function (LogLevel) {
|
|
19
19
|
LogLevel["INFO"] = "INFO";
|
|
@@ -22,6 +22,24 @@ export let LogLevel;
|
|
|
22
22
|
LogLevel["ERROR"] = "ERROR";
|
|
23
23
|
})(LogLevel || (LogLevel = {}));
|
|
24
24
|
|
|
25
|
+
export let BroadcastEvent; // Events being logged
|
|
26
|
+
|
|
27
|
+
(function (BroadcastEvent) {
|
|
28
|
+
BroadcastEvent["LoadPostChatSurvey"] = "LoadPostChatSurvey";
|
|
29
|
+
BroadcastEvent["EndChat"] = "ChatEnded";
|
|
30
|
+
BroadcastEvent["NewMessageNotification"] = "NewMessageNotification";
|
|
31
|
+
BroadcastEvent["UnreadMessageCount"] = "UnreadMessageCount";
|
|
32
|
+
BroadcastEvent["ChatWidgetStateChanged"] = "ChatWidgetStateChanged";
|
|
33
|
+
BroadcastEvent["ProactiveChatStartChat"] = "ProactiveChatStartChat";
|
|
34
|
+
BroadcastEvent["ProactiveChatStartPopoutChat"] = "ProactiveChatStartPopoutChat";
|
|
35
|
+
BroadcastEvent["InvalidAdaptiveCardFormat"] = "InvalidAdaptiveCardFormat";
|
|
36
|
+
BroadcastEvent["NewMessageSent"] = "NewMessageSent";
|
|
37
|
+
BroadcastEvent["NewMessageReceived"] = "NewMessageReceived";
|
|
38
|
+
BroadcastEvent["RedirectPageRequest"] = "RedirectPageRequest";
|
|
39
|
+
BroadcastEvent["StartChatSkippingChatButtonRendering"] = "StartChatSkippingChatButtonRendering";
|
|
40
|
+
BroadcastEvent["StartUnauthenticatedReconnectChat"] = "StartUnauthenticatedReconnectChat";
|
|
41
|
+
})(BroadcastEvent || (BroadcastEvent = {}));
|
|
42
|
+
|
|
25
43
|
export let TelemetryEvent;
|
|
26
44
|
|
|
27
45
|
(function (TelemetryEvent) {
|
|
@@ -70,7 +88,9 @@ export let TelemetryEvent;
|
|
|
70
88
|
TelemetryEvent["PrechatSurveyLoaded"] = "PrechatSurveyLoaded";
|
|
71
89
|
TelemetryEvent["PrechatSubmitted"] = "PrechatSubmitted";
|
|
72
90
|
TelemetryEvent["StartChatSDKCall"] = "StartChatCall";
|
|
91
|
+
TelemetryEvent["StartChatEventRecevied"] = "StartChatEventReceived";
|
|
73
92
|
TelemetryEvent["EndChatSDKCall"] = "EndChatCall";
|
|
93
|
+
TelemetryEvent["EndChatEventReceived"] = "EndChatEventReceived";
|
|
74
94
|
TelemetryEvent["OnNewMessageFailed"] = "OnNewMessageFailed";
|
|
75
95
|
TelemetryEvent["OnNewMessageAudioNotificationFailed"] = "OnNewMessageAudioNotificationFailed";
|
|
76
96
|
TelemetryEvent["DownloadTranscriptResponseNullOrUndefined"] = "DownloadTranscriptResponseNullOrUndefined";
|
|
@@ -84,6 +104,7 @@ export let TelemetryEvent;
|
|
|
84
104
|
TelemetryEvent["LoadingPaneLoaded"] = "LoadingPaneLoaded";
|
|
85
105
|
TelemetryEvent["EmailTranscriptLoaded"] = "EmailTranscriptLoaded";
|
|
86
106
|
TelemetryEvent["OutOfOfficePaneLoaded"] = "OutOfOfficePaneLoaded";
|
|
107
|
+
TelemetryEvent["PostChatSurveyLoadingPaneLoaded"] = "PostChatSurveyLoadingPaneLoaded";
|
|
87
108
|
TelemetryEvent["PostChatSurveyLoaded"] = "PostChatSurveyLoaded";
|
|
88
109
|
TelemetryEvent["ConfirmationPaneLoaded"] = "ConfirmationPaneLoaded";
|
|
89
110
|
TelemetryEvent["ProactiveChatPaneLoaded"] = "ProactiveChatPaneLoaded";
|
|
@@ -105,6 +126,7 @@ export let TelemetryEvent;
|
|
|
105
126
|
TelemetryEvent["InvalidConfiguration"] = "InvalidConfiguration";
|
|
106
127
|
TelemetryEvent["SendTypingIndicatorSucceeded"] = "SendTypingIndicatorSucceeded";
|
|
107
128
|
TelemetryEvent["SendTypingIndicatorFailed"] = "SendTypingIndicatorFailed";
|
|
129
|
+
TelemetryEvent["WebChatEvent"] = "WebChatEvent";
|
|
108
130
|
TelemetryEvent["PreChatSurveyStartChatMethodFailed"] = "PreChatSurveyStartChatMethodFailed";
|
|
109
131
|
TelemetryEvent["ChatAlreadyTriggered"] = "ChatAlreadyTriggered";
|
|
110
132
|
TelemetryEvent["StartProactiveChatEventReceived"] = "StartProactiveChatEventReceived";
|
|
@@ -113,12 +135,11 @@ export let TelemetryEvent;
|
|
|
113
135
|
TelemetryEvent["ProactiveChatRejected"] = "ProactiveChatRejected";
|
|
114
136
|
TelemetryEvent["IncomingProactiveChatScreenLoaded"] = "IncomingProactiveChatScreenLoaded";
|
|
115
137
|
TelemetryEvent["ProactiveChatClosed"] = "ProactiveChatClosed";
|
|
116
|
-
TelemetryEvent["ProactiveChatStartChat"] = "ProactiveChatStartChat";
|
|
117
|
-
TelemetryEvent["ProactiveChatStartPopoutChat"] = "ProactiveChatStartPopoutChat";
|
|
118
138
|
TelemetryEvent["ReconnectChatContinueConversation"] = "ReconnectChatContinueConversation";
|
|
119
139
|
TelemetryEvent["ReconnectChatStartNewConversation"] = "ReconnectChatStartNewConversation";
|
|
120
140
|
TelemetryEvent["ReconnectChatMinimize"] = "ReconnectChatMinimize";
|
|
121
|
-
TelemetryEvent["
|
|
141
|
+
TelemetryEvent["MessageSent"] = "MessageSent";
|
|
142
|
+
TelemetryEvent["MessageReceived"] = "MessageReceived";
|
|
122
143
|
})(TelemetryEvent || (TelemetryEvent = {}));
|
|
123
144
|
|
|
124
145
|
export class TelemetryConstants {
|
|
@@ -134,6 +155,7 @@ export class TelemetryConstants {
|
|
|
134
155
|
case TelemetryEvent.LCWChatButtonShow:
|
|
135
156
|
case TelemetryEvent.PrechatSurveyLoaded:
|
|
136
157
|
case TelemetryEvent.LoadingPaneLoaded:
|
|
158
|
+
case TelemetryEvent.PostChatSurveyLoadingPaneLoaded:
|
|
137
159
|
case TelemetryEvent.PostChatSurveyLoaded:
|
|
138
160
|
case TelemetryEvent.EmailTranscriptLoaded:
|
|
139
161
|
case TelemetryEvent.OutOfOfficePaneLoaded:
|
|
@@ -163,12 +185,16 @@ export class TelemetryConstants {
|
|
|
163
185
|
return ScenarioType.ACTIONS;
|
|
164
186
|
|
|
165
187
|
case TelemetryEvent.StartChatSDKCall:
|
|
188
|
+
case TelemetryEvent.StartChatEventRecevied:
|
|
166
189
|
case TelemetryEvent.StartChatMethodException:
|
|
167
190
|
case TelemetryEvent.CloseChatMethodException:
|
|
191
|
+
case TelemetryEvent.StartProactiveChatEventReceived:
|
|
168
192
|
case TelemetryEvent.StartProactiveChatMethodFailed:
|
|
169
193
|
case TelemetryEvent.OnNewMessageFailed:
|
|
170
194
|
case TelemetryEvent.OnNewMessageAudioNotificationFailed:
|
|
171
195
|
case TelemetryEvent.GetConversationDetailsCallFailed:
|
|
196
|
+
case TelemetryEvent.EndChatSDKCall:
|
|
197
|
+
case TelemetryEvent.EndChatEventReceived:
|
|
172
198
|
case TelemetryEvent.EndChatSDKCallFailed:
|
|
173
199
|
case TelemetryEvent.PostChatContextCallFailed:
|
|
174
200
|
case TelemetryEvent.PostChatContextCallSucceed:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
2
|
|
|
3
|
-
import { ScenarioType } from "./TelemetryConstants";
|
|
3
|
+
import { ScenarioType, TelemetryEvent } from "./TelemetryConstants";
|
|
4
4
|
import { newGuid } from "../utils";
|
|
5
5
|
import { TelemetryManager } from "./TelemetryManager";
|
|
6
6
|
import { BroadcastService } from "@microsoft/omnichannel-chat-components";
|
|
@@ -259,4 +259,16 @@ _defineProperty(TelemetryHelper, "logConfigDataEvent", (logLevel, payload) => {
|
|
|
259
259
|
}
|
|
260
260
|
};
|
|
261
261
|
BroadcastService.postMessage(telemetryEvent);
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
_defineProperty(TelemetryHelper, "logWebChatEvent", (logLevel, payload) => {
|
|
265
|
+
const telemetryEvent = {
|
|
266
|
+
eventName: TelemetryEvent.WebChatEvent,
|
|
267
|
+
logLevel: logLevel,
|
|
268
|
+
payload: { ...payload,
|
|
269
|
+
type: TelemetryEvent.WebChatEvent,
|
|
270
|
+
scenarioType: ScenarioType.WEBCHAT
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
BroadcastService.postMessage(telemetryEvent);
|
|
262
274
|
});
|
|
@@ -4,6 +4,7 @@ import { LogLevel, ScenarioType, TelemetryConstants, TelemetryEvent } from "./Te
|
|
|
4
4
|
import { BroadcastService } from "@microsoft/omnichannel-chat-components";
|
|
5
5
|
import { ariaTelemetryLogger } from "./loggers/ariaTelemetryLogger";
|
|
6
6
|
import { consoleLogger } from "./loggers/consoleLogger";
|
|
7
|
+
import { defaultAriaConfig } from "./defaultConfigs/defaultAriaConfig";
|
|
7
8
|
export class TelemetryTimers {}
|
|
8
9
|
|
|
9
10
|
_defineProperty(TelemetryTimers, "LcwLoadToChatButtonTimer", void 0);
|
|
@@ -26,25 +27,25 @@ export const RegisterLoggers = () => {
|
|
|
26
27
|
const registerLoggers = () => {
|
|
27
28
|
var _TelemetryManager$Int, _TelemetryManager$Int2, _TelemetryManager$Int3, _TelemetryManager$Int4, _TelemetryManager$Int5, _TelemetryManager$Int6, _TelemetryManager$Int7, _TelemetryManager$Int8;
|
|
28
29
|
|
|
29
|
-
if (
|
|
30
|
+
if (((_TelemetryManager$Int = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int === void 0 ? void 0 : (_TelemetryManager$Int2 = _TelemetryManager$Int.telemetryConfig) === null || _TelemetryManager$Int2 === void 0 ? void 0 : _TelemetryManager$Int2.disableConsoleLog) === false || ((_TelemetryManager$Int3 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int3 === void 0 ? void 0 : (_TelemetryManager$Int4 = _TelemetryManager$Int3.telemetryConfig) === null || _TelemetryManager$Int4 === void 0 ? void 0 : _TelemetryManager$Int4.telemetryDisabled) === false) {
|
|
30
31
|
BroadcastService.getAnyMessage().subscribe(event => {
|
|
31
|
-
if (event.payload && event.eventName
|
|
32
|
+
if (event.payload && event.eventName in TelemetryEvent) {
|
|
32
33
|
logTelemetry(event);
|
|
33
34
|
}
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
37
|
|
|
37
|
-
if (
|
|
38
|
+
if (((_TelemetryManager$Int5 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int5 === void 0 ? void 0 : (_TelemetryManager$Int6 = _TelemetryManager$Int5.telemetryConfig) === null || _TelemetryManager$Int6 === void 0 ? void 0 : _TelemetryManager$Int6.disableConsoleLog) === false) {
|
|
38
39
|
loggers.push(consoleLogger());
|
|
39
40
|
}
|
|
40
41
|
|
|
41
|
-
if (
|
|
42
|
+
if (((_TelemetryManager$Int7 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int7 === void 0 ? void 0 : (_TelemetryManager$Int8 = _TelemetryManager$Int7.telemetryConfig) === null || _TelemetryManager$Int8 === void 0 ? void 0 : _TelemetryManager$Int8.telemetryDisabled) === false) {
|
|
42
43
|
var _TelemetryManager$Int9, _TelemetryManager$Int18, _TelemetryManager$Int19;
|
|
43
44
|
|
|
44
45
|
if ((_TelemetryManager$Int9 = TelemetryManager.InternalTelemetryData) !== null && _TelemetryManager$Int9 !== void 0 && _TelemetryManager$Int9.ariaConfig) {
|
|
45
46
|
var _TelemetryManager$Int10, _TelemetryManager$Int11, _TelemetryManager$Int12, _TelemetryManager$Int13, _TelemetryManager$Int14, _TelemetryManager$Int15, _TelemetryManager$Int16, _TelemetryManager$Int17;
|
|
46
47
|
|
|
47
|
-
loggers.push(ariaTelemetryLogger(((_TelemetryManager$Int10 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int10 === void 0 ? void 0 : (_TelemetryManager$Int11 = _TelemetryManager$Int10.ariaConfig) === null || _TelemetryManager$Int11 === void 0 ? void 0 : _TelemetryManager$Int11.ariaTelemetryKey) ??
|
|
48
|
+
loggers.push(ariaTelemetryLogger(((_TelemetryManager$Int10 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int10 === void 0 ? void 0 : (_TelemetryManager$Int11 = _TelemetryManager$Int10.ariaConfig) === null || _TelemetryManager$Int11 === void 0 ? void 0 : _TelemetryManager$Int11.ariaTelemetryKey) ?? defaultAriaConfig.ariaTelemetryKey, ((_TelemetryManager$Int12 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int12 === void 0 ? void 0 : (_TelemetryManager$Int13 = _TelemetryManager$Int12.ariaConfig) === null || _TelemetryManager$Int13 === void 0 ? void 0 : _TelemetryManager$Int13.disableCookieUsage) ?? defaultAriaConfig.disableCookieUsage, ((_TelemetryManager$Int14 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int14 === void 0 ? void 0 : (_TelemetryManager$Int15 = _TelemetryManager$Int14.ariaConfig) === null || _TelemetryManager$Int15 === void 0 ? void 0 : _TelemetryManager$Int15.collectorUriForTelemetry) ?? defaultAriaConfig.collectorUriForTelemetry, ((_TelemetryManager$Int16 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int16 === void 0 ? void 0 : (_TelemetryManager$Int17 = _TelemetryManager$Int16.ariaConfig) === null || _TelemetryManager$Int17 === void 0 ? void 0 : _TelemetryManager$Int17.ariaTelemetryApplicationName) ?? defaultAriaConfig.ariaTelemetryApplicationName));
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
const customLoggers = (_TelemetryManager$Int18 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int18 === void 0 ? void 0 : (_TelemetryManager$Int19 = _TelemetryManager$Int18.telemetryConfig) === null || _TelemetryManager$Int19 === void 0 ? void 0 : _TelemetryManager$Int19.telemetryLoggers;
|
|
@@ -67,8 +68,11 @@ export const RegisterLoggers = () => {
|
|
|
67
68
|
|
|
68
69
|
const logTelemetry = telemetryEvent => {
|
|
69
70
|
loggers.map(logger => {
|
|
71
|
+
var _payload;
|
|
72
|
+
|
|
70
73
|
const logLevel = telemetryEvent.logLevel ?? LogLevel.INFO;
|
|
71
|
-
|
|
74
|
+
const scenarioType = ((_payload = telemetryEvent.payload) === null || _payload === void 0 ? void 0 : _payload.scenarioType) ?? ScenarioType.UNDEFINED;
|
|
75
|
+
logger.log(logLevel, parseInput(telemetryEvent === null || telemetryEvent === void 0 ? void 0 : telemetryEvent.payload, scenarioType));
|
|
72
76
|
});
|
|
73
77
|
};
|
|
74
78
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const defaultAriaConfig = {
|
|
2
2
|
collectorUriForTelemetry: "",
|
|
3
3
|
ariaTelemetryKey: "c7655518acf1403f93ff6b9f77942f0a-d01a02fd-6b50-4de3-a566-62eda11f93bc-7083",
|
|
4
|
-
ariaTelemetryApplicationName: "",
|
|
4
|
+
ariaTelemetryApplicationName: "D365_Omnichannel_Client_Public_Prod",
|
|
5
5
|
disableCookieUsage: true
|
|
6
6
|
};
|