@microsoft/omnichannel-chat-widget 1.7.8-main.50111af → 1.7.8-main.8428c08
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/lib/cjs/common/Constants.js +9 -2
- package/lib/cjs/common/facades/FacadeChatSDK.js +21 -17
- package/lib/cjs/common/telemetry/ScenarioMarker.js +66 -0
- package/lib/cjs/common/telemetry/TelemetryConstants.js +53 -45
- package/lib/cjs/common/telemetry/TelemetryHelper.js +62 -69
- package/lib/cjs/common/telemetry/TelemetryManager.js +22 -9
- package/lib/cjs/common/telemetry/defaultConfigs/defaultAppInsightsConfig.js +11 -0
- package/lib/cjs/common/telemetry/interfaces/IAppInsightsConfig.js +1 -0
- package/lib/cjs/common/telemetry/loggers/appInsightsLogger.js +119 -0
- package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +13 -9
- package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +5 -4
- package/lib/cjs/components/footerstateful/FooterStateful.js +13 -8
- package/lib/cjs/components/headerstateful/HeaderStateful.js +21 -9
- package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +3 -1
- package/lib/cjs/components/livechatwidget/common/renderSurveyHelpers.js +7 -4
- package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +7 -3
- package/lib/cjs/components/livechatwidget/common/startChat.js +3 -3
- package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.js +7 -6
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +11 -9
- package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +6 -4
- package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +9 -4
- package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +9 -6
- package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +9 -7
- package/lib/cjs/firstresponselatency/FirstMessageTrackerFromBot.js +2 -2
- package/lib/cjs/firstresponselatency/FirstResponseLatencyTracker.js +1 -1
- package/lib/cjs/plugins/newMessageEventHandler.js +8 -8
- package/lib/esm/common/Constants.js +7 -1
- package/lib/esm/common/facades/FacadeChatSDK.js +21 -17
- package/lib/esm/common/telemetry/ScenarioMarker.js +59 -0
- package/lib/esm/common/telemetry/TelemetryConstants.js +53 -45
- package/lib/esm/common/telemetry/TelemetryHelper.js +62 -69
- package/lib/esm/common/telemetry/TelemetryManager.js +22 -9
- package/lib/esm/common/telemetry/defaultConfigs/defaultAppInsightsConfig.js +4 -0
- package/lib/esm/common/telemetry/interfaces/IAppInsightsConfig.js +1 -0
- package/lib/esm/common/telemetry/loggers/appInsightsLogger.js +111 -0
- package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +13 -9
- package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +5 -4
- package/lib/esm/components/footerstateful/FooterStateful.js +13 -8
- package/lib/esm/components/headerstateful/HeaderStateful.js +21 -9
- package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +3 -1
- package/lib/esm/components/livechatwidget/common/renderSurveyHelpers.js +7 -4
- package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +7 -3
- package/lib/esm/components/livechatwidget/common/startChat.js +3 -3
- package/lib/esm/components/livechatwidget/common/startChatErrorHandler.js +7 -6
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +11 -9
- package/lib/esm/components/ooohpanestateful/OOOHPaneStateful.js +6 -4
- package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +9 -4
- package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +9 -6
- package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +9 -7
- package/lib/esm/firstresponselatency/FirstMessageTrackerFromBot.js +2 -2
- package/lib/esm/firstresponselatency/FirstResponseLatencyTracker.js +1 -1
- package/lib/esm/plugins/newMessageEventHandler.js +8 -8
- package/lib/types/common/Constants.d.ts +5 -0
- package/lib/types/common/telemetry/ScenarioMarker.d.ts +19 -0
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +40 -32
- package/lib/types/common/telemetry/TelemetryHelper.d.ts +5 -0
- package/lib/types/common/telemetry/defaultConfigs/defaultAppInsightsConfig.d.ts +2 -0
- package/lib/types/common/telemetry/interfaces/IAppInsightsConfig.d.ts +4 -0
- package/lib/types/common/telemetry/interfaces/IChatSDKLogger.d.ts +1 -0
- package/lib/types/common/telemetry/interfaces/IInternalTelemetryData.d.ts +2 -0
- package/lib/types/common/telemetry/loggers/appInsightsLogger.d.ts +5 -0
- package/lib/types/components/callingcontainerstateful/CallingContainerStateful.d.ts +2 -1
- package/lib/types/components/chatbuttonstateful/ChatButtonStateful.d.ts +2 -1
- package/lib/types/components/confirmationpanestateful/ConfirmationPaneStateful.d.ts +2 -1
- package/lib/types/components/dimlayer/DimLayer.d.ts +2 -1
- package/lib/types/components/draggable/DraggableChatWidget.d.ts +2 -2
- package/lib/types/components/draggable/DraggableEventEmitter.d.ts +2 -2
- package/lib/types/components/draggable/DraggableEventReceiver.d.ts +2 -2
- package/lib/types/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.d.ts +2 -1
- package/lib/types/components/footerstateful/FooterStateful.d.ts +2 -1
- package/lib/types/components/footerstateful/audionotificationstateful/AudioNotificationStateful.d.ts +2 -1
- package/lib/types/components/headerstateful/HeaderStateful.d.ts +2 -1
- package/lib/types/components/livechatwidget/LiveChatWidget.d.ts +2 -1
- package/lib/types/components/livechatwidget/common/createFooter.d.ts +2 -1
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +2 -0
- package/lib/types/components/loadingpanestateful/LoadingPaneStateful.d.ts +2 -1
- package/lib/types/components/notificationpanestateful/NotificationPaneStateful.d.ts +2 -1
- package/lib/types/components/ooohpanestateful/OOOHPaneStateful.d.ts +2 -1
- package/lib/types/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.d.ts +2 -1
- package/lib/types/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.d.ts +2 -1
- package/lib/types/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.d.ts +2 -1
- package/lib/types/components/proactivechatpanestateful/ProactiveChatPaneStateful.d.ts +2 -1
- package/lib/types/components/reconnectchatpanestateful/ReconnectChatPaneStateful.d.ts +2 -1
- package/lib/types/components/startchaterrorpanestateful/StartChatErrorPaneStateful.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/WebChatContainerStateful.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Attachment.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AttachmentContent.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AttachmentIcon.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/DownloadBlockedAttachment.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/MaliciousAttachment.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/ScanInProgressAttachment.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Spinner.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.d.ts +2 -1
- package/package.json +10 -8
|
@@ -225,94 +225,87 @@ export let TelemetryHelper = /*#__PURE__*/function () {
|
|
|
225
225
|
telemetryDataLocal.conversationId = liveWorkItem.conversationId;
|
|
226
226
|
return telemetryDataLocal;
|
|
227
227
|
}
|
|
228
|
+
|
|
229
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
230
|
+
}, {
|
|
231
|
+
key: "postTelemetryEvent",
|
|
232
|
+
value: function postTelemetryEvent(eventName, logLevel, payload) {
|
|
233
|
+
const telemetryEvent = {
|
|
234
|
+
eventName,
|
|
235
|
+
logLevel,
|
|
236
|
+
payload: {
|
|
237
|
+
...payload
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
BroadcastService.postMessage(telemetryEvent);
|
|
241
|
+
}
|
|
228
242
|
}]);
|
|
229
243
|
return TelemetryHelper;
|
|
230
244
|
}();
|
|
231
245
|
_defineProperty(TelemetryHelper, "callId", void 0);
|
|
232
246
|
_defineProperty(TelemetryHelper, "elapsedTime", void 0);
|
|
233
247
|
_defineProperty(TelemetryHelper, "logCallingEvent", (logLevel, payload, callId) => {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
...payload,
|
|
239
|
-
CallId: callId
|
|
240
|
-
}
|
|
241
|
-
};
|
|
242
|
-
BroadcastService.postMessage(telemetryEvent);
|
|
248
|
+
TelemetryHelper.postTelemetryEvent((payload === null || payload === void 0 ? void 0 : payload.Event) ?? "", logLevel, {
|
|
249
|
+
...payload,
|
|
250
|
+
CallId: callId
|
|
251
|
+
});
|
|
243
252
|
});
|
|
244
253
|
_defineProperty(TelemetryHelper, "logLoadingEvent", (logLevel, payload) => {
|
|
245
|
-
|
|
246
|
-
eventName: (payload === null || payload === void 0 ? void 0 : payload.Event) ?? "",
|
|
247
|
-
logLevel: logLevel,
|
|
248
|
-
payload: {
|
|
249
|
-
...payload
|
|
250
|
-
}
|
|
251
|
-
};
|
|
252
|
-
BroadcastService.postMessage(telemetryEvent);
|
|
254
|
+
TelemetryHelper.postTelemetryEvent((payload === null || payload === void 0 ? void 0 : payload.Event) ?? "", logLevel, payload);
|
|
253
255
|
});
|
|
254
256
|
_defineProperty(TelemetryHelper, "logUIEvent", (logLevel, payload) => {
|
|
255
|
-
|
|
256
|
-
eventName: (payload === null || payload === void 0 ? void 0 : payload.Event) ?? "",
|
|
257
|
-
logLevel: logLevel,
|
|
258
|
-
payload: {
|
|
259
|
-
...payload
|
|
260
|
-
}
|
|
261
|
-
};
|
|
262
|
-
BroadcastService.postMessage(telemetryEvent);
|
|
257
|
+
TelemetryHelper.postTelemetryEvent((payload === null || payload === void 0 ? void 0 : payload.Event) ?? "", logLevel, payload);
|
|
263
258
|
});
|
|
264
259
|
_defineProperty(TelemetryHelper, "logActionEvent", (logLevel, payload) => {
|
|
265
|
-
|
|
266
|
-
eventName: (payload === null || payload === void 0 ? void 0 : payload.Event) ?? "",
|
|
267
|
-
logLevel: logLevel,
|
|
268
|
-
payload: {
|
|
269
|
-
...payload
|
|
270
|
-
}
|
|
271
|
-
};
|
|
272
|
-
BroadcastService.postMessage(telemetryEvent);
|
|
260
|
+
TelemetryHelper.postTelemetryEvent((payload === null || payload === void 0 ? void 0 : payload.Event) ?? "", logLevel, payload);
|
|
273
261
|
});
|
|
274
262
|
_defineProperty(TelemetryHelper, "logSDKEvent", (logLevel, payload) => {
|
|
275
263
|
var _TelemetryManager$Int16;
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
TransactionId: newGuid(),
|
|
282
|
-
RequestId: (_TelemetryManager$Int16 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int16 === void 0 ? void 0 : _TelemetryManager$Int16.currentRequestId
|
|
283
|
-
}
|
|
284
|
-
};
|
|
285
|
-
BroadcastService.postMessage(telemetryEvent);
|
|
264
|
+
TelemetryHelper.postTelemetryEvent((payload === null || payload === void 0 ? void 0 : payload.Event) ?? "", logLevel, {
|
|
265
|
+
...payload,
|
|
266
|
+
TransactionId: newGuid(),
|
|
267
|
+
RequestId: (_TelemetryManager$Int16 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int16 === void 0 ? void 0 : _TelemetryManager$Int16.currentRequestId
|
|
268
|
+
});
|
|
286
269
|
});
|
|
287
270
|
_defineProperty(TelemetryHelper, "logConfigDataEvent", (logLevel, payload) => {
|
|
288
|
-
|
|
289
|
-
eventName: (payload === null || payload === void 0 ? void 0 : payload.Event) ?? "",
|
|
290
|
-
logLevel: logLevel,
|
|
291
|
-
payload: {
|
|
292
|
-
...payload
|
|
293
|
-
}
|
|
294
|
-
};
|
|
295
|
-
BroadcastService.postMessage(telemetryEvent);
|
|
271
|
+
TelemetryHelper.postTelemetryEvent((payload === null || payload === void 0 ? void 0 : payload.Event) ?? "", logLevel, payload);
|
|
296
272
|
});
|
|
297
273
|
_defineProperty(TelemetryHelper, "logWebChatEvent", (logLevel, payload) => {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
type: TelemetryEvent.WebChatEvent,
|
|
304
|
-
scenarioType: ScenarioType.WEBCHAT
|
|
305
|
-
}
|
|
306
|
-
};
|
|
307
|
-
BroadcastService.postMessage(telemetryEvent);
|
|
274
|
+
TelemetryHelper.postTelemetryEvent(TelemetryEvent.WebChatEvent, logLevel, {
|
|
275
|
+
...payload,
|
|
276
|
+
type: TelemetryEvent.WebChatEvent,
|
|
277
|
+
scenarioType: ScenarioType.WEBCHAT
|
|
278
|
+
});
|
|
308
279
|
});
|
|
309
280
|
_defineProperty(TelemetryHelper, "logFacadeChatSDKEvent", (logLevel, payload) => {
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
};
|
|
317
|
-
|
|
281
|
+
TelemetryHelper.postTelemetryEvent((payload === null || payload === void 0 ? void 0 : payload.Event) ?? TelemetryEvent.FacadeChatSDKEvent, logLevel, payload);
|
|
282
|
+
});
|
|
283
|
+
_defineProperty(TelemetryHelper, "logLoadingEventToAllTelemetry", (logLevel, payload) => {
|
|
284
|
+
TelemetryHelper.postTelemetryEvent((payload === null || payload === void 0 ? void 0 : payload.Event) ?? "", logLevel, {
|
|
285
|
+
...payload,
|
|
286
|
+
LogToAll: true
|
|
287
|
+
});
|
|
288
|
+
});
|
|
289
|
+
_defineProperty(TelemetryHelper, "logActionEventToAllTelemetry", (logLevel, payload) => {
|
|
290
|
+
TelemetryHelper.postTelemetryEvent((payload === null || payload === void 0 ? void 0 : payload.Event) ?? "", logLevel, {
|
|
291
|
+
...payload,
|
|
292
|
+
LogToAll: true
|
|
293
|
+
});
|
|
294
|
+
});
|
|
295
|
+
_defineProperty(TelemetryHelper, "logFacadeChatSDKEventToAllTelemetry", (logLevel, payload) => {
|
|
296
|
+
TelemetryHelper.postTelemetryEvent((payload === null || payload === void 0 ? void 0 : payload.Event) ?? TelemetryEvent.FacadeChatSDKEvent, logLevel, {
|
|
297
|
+
...payload,
|
|
298
|
+
LogToAll: true
|
|
299
|
+
});
|
|
300
|
+
});
|
|
301
|
+
_defineProperty(TelemetryHelper, "logSDKEventToAllTelemetry", (logLevel, payload) => {
|
|
302
|
+
var _TelemetryManager$Int17;
|
|
303
|
+
TelemetryHelper.postTelemetryEvent((payload === null || payload === void 0 ? void 0 : payload.Event) ?? "", logLevel, {
|
|
304
|
+
...{
|
|
305
|
+
...payload,
|
|
306
|
+
TransactionId: newGuid(),
|
|
307
|
+
RequestId: (_TelemetryManager$Int17 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int17 === void 0 ? void 0 : _TelemetryManager$Int17.currentRequestId
|
|
308
|
+
},
|
|
309
|
+
LogToAll: true
|
|
310
|
+
});
|
|
318
311
|
});
|
|
@@ -10,6 +10,7 @@ import { ariaTelemetryLogger } from "./loggers/ariaTelemetryLogger";
|
|
|
10
10
|
import { consoleLogger } from "./loggers/consoleLogger";
|
|
11
11
|
import { defaultAriaConfig } from "./defaultConfigs/defaultAriaConfig";
|
|
12
12
|
import { TelemetryHelper } from "./TelemetryHelper";
|
|
13
|
+
import { appInsightsLogger } from "./loggers/appInsightsLogger";
|
|
13
14
|
export let TelemetryTimers = /*#__PURE__*/_createClass(function TelemetryTimers() {
|
|
14
15
|
_classCallCheck(this, TelemetryTimers);
|
|
15
16
|
});
|
|
@@ -28,29 +29,36 @@ export const disposeLoggers = () => {
|
|
|
28
29
|
};
|
|
29
30
|
export const RegisterLoggers = () => {
|
|
30
31
|
const registerLoggers = () => {
|
|
31
|
-
var _TelemetryManager$Int, _TelemetryManager$Int2, _TelemetryManager$Int3, _TelemetryManager$Int4, _TelemetryManager$Int5, _TelemetryManager$Int6, _TelemetryManager$Int7, _TelemetryManager$Int8;
|
|
32
|
-
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) {
|
|
32
|
+
var _TelemetryManager$Int, _TelemetryManager$Int2, _TelemetryManager$Int3, _TelemetryManager$Int4, _TelemetryManager$Int5, _TelemetryManager$Int6, _TelemetryManager$Int7, _TelemetryManager$Int8, _TelemetryManager$Int9, _TelemetryManager$Int10;
|
|
33
|
+
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 || ((_TelemetryManager$Int5 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int5 === void 0 ? void 0 : (_TelemetryManager$Int6 = _TelemetryManager$Int5.appInsightsConfig) === null || _TelemetryManager$Int6 === void 0 ? void 0 : _TelemetryManager$Int6.appInsightsDisabled) === false) {
|
|
33
34
|
BroadcastService.getAnyMessage().subscribe(event => {
|
|
34
35
|
if (event.payload && event.eventName in TelemetryEvent) {
|
|
35
36
|
logTelemetry(event);
|
|
36
37
|
}
|
|
37
38
|
});
|
|
38
39
|
}
|
|
39
|
-
if (((_TelemetryManager$
|
|
40
|
+
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.disableConsoleLog) === false) {
|
|
40
41
|
loggers.push(consoleLogger());
|
|
41
42
|
}
|
|
42
|
-
if (((_TelemetryManager$
|
|
43
|
-
var _TelemetryManager$
|
|
44
|
-
if ((_TelemetryManager$
|
|
45
|
-
var _TelemetryManager$
|
|
46
|
-
loggers.push(ariaTelemetryLogger(((_TelemetryManager$
|
|
43
|
+
if (((_TelemetryManager$Int9 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int9 === void 0 ? void 0 : (_TelemetryManager$Int10 = _TelemetryManager$Int9.telemetryConfig) === null || _TelemetryManager$Int10 === void 0 ? void 0 : _TelemetryManager$Int10.telemetryDisabled) === false) {
|
|
44
|
+
var _TelemetryManager$Int11, _TelemetryManager$Int20, _TelemetryManager$Int21, _TelemetryManager$Int22, _TelemetryManager$Int23;
|
|
45
|
+
if ((_TelemetryManager$Int11 = TelemetryManager.InternalTelemetryData) !== null && _TelemetryManager$Int11 !== void 0 && _TelemetryManager$Int11.ariaConfig) {
|
|
46
|
+
var _TelemetryManager$Int12, _TelemetryManager$Int13, _TelemetryManager$Int14, _TelemetryManager$Int15, _TelemetryManager$Int16, _TelemetryManager$Int17, _TelemetryManager$Int18, _TelemetryManager$Int19;
|
|
47
|
+
loggers.push(ariaTelemetryLogger(((_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.ariaTelemetryKey) ?? defaultAriaConfig.ariaTelemetryKey, ((_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.disableCookieUsage) ?? defaultAriaConfig.disableCookieUsage, ((_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.collectorUriForTelemetry) ?? defaultAriaConfig.collectorUriForTelemetry, ((_TelemetryManager$Int18 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int18 === void 0 ? void 0 : (_TelemetryManager$Int19 = _TelemetryManager$Int18.ariaConfig) === null || _TelemetryManager$Int19 === void 0 ? void 0 : _TelemetryManager$Int19.ariaTelemetryApplicationName) ?? defaultAriaConfig.ariaTelemetryApplicationName));
|
|
47
48
|
}
|
|
48
|
-
const customLoggers = (_TelemetryManager$
|
|
49
|
+
const customLoggers = (_TelemetryManager$Int20 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int20 === void 0 ? void 0 : (_TelemetryManager$Int21 = _TelemetryManager$Int20.telemetryConfig) === null || _TelemetryManager$Int21 === void 0 ? void 0 : _TelemetryManager$Int21.telemetryLoggers;
|
|
49
50
|
if (customLoggers) {
|
|
50
51
|
customLoggers.map(logger => {
|
|
51
52
|
loggers.push(logger);
|
|
52
53
|
});
|
|
53
54
|
}
|
|
55
|
+
if (((_TelemetryManager$Int22 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int22 === void 0 ? void 0 : (_TelemetryManager$Int23 = _TelemetryManager$Int22.appInsightsConfig) === null || _TelemetryManager$Int23 === void 0 ? void 0 : _TelemetryManager$Int23.appInsightsDisabled) === false) {
|
|
56
|
+
var _TelemetryManager$Int24;
|
|
57
|
+
if ((_TelemetryManager$Int24 = TelemetryManager.InternalTelemetryData) !== null && _TelemetryManager$Int24 !== void 0 && _TelemetryManager$Int24.appInsightsConfig.appInsightsKey) {
|
|
58
|
+
var _TelemetryManager$Int25, _TelemetryManager$Int26, _TelemetryManager$Int27;
|
|
59
|
+
loggers.push(appInsightsLogger((_TelemetryManager$Int25 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int25 === void 0 ? void 0 : _TelemetryManager$Int25.appInsightsConfig.appInsightsKey, ((_TelemetryManager$Int26 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int26 === void 0 ? void 0 : (_TelemetryManager$Int27 = _TelemetryManager$Int26.ariaConfig) === null || _TelemetryManager$Int27 === void 0 ? void 0 : _TelemetryManager$Int27.disableCookieUsage) ?? defaultAriaConfig.disableCookieUsage));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
54
62
|
}
|
|
55
63
|
};
|
|
56
64
|
const parseInput = function (payload) {
|
|
@@ -71,6 +79,11 @@ export const RegisterLoggers = () => {
|
|
|
71
79
|
};
|
|
72
80
|
//Do not log events without an Event Name
|
|
73
81
|
if (telemetryInput !== null && telemetryInput !== void 0 && (_telemetryInput$paylo = telemetryInput.payload) !== null && _telemetryInput$paylo !== void 0 && _telemetryInput$paylo.Event) {
|
|
82
|
+
var _telemetryEvent$paylo;
|
|
83
|
+
if (logger.type === "appInsightsLogger" && (telemetryEvent === null || telemetryEvent === void 0 ? void 0 : (_telemetryEvent$paylo = telemetryEvent.payload) === null || _telemetryEvent$paylo === void 0 ? void 0 : _telemetryEvent$paylo.LogToAll) !== true) {
|
|
84
|
+
return; // skip logging to AppInsights
|
|
85
|
+
}
|
|
86
|
+
|
|
74
87
|
logger.log(logLevel, telemetryInput);
|
|
75
88
|
}
|
|
76
89
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { ApplicationInsights } from "@microsoft/applicationinsights-web";
|
|
2
|
+
import { LogLevel, TelemetryEvent } from "../TelemetryConstants";
|
|
3
|
+
import ScenarioMarker from "../ScenarioMarker";
|
|
4
|
+
import { TelemetryHelper } from "../TelemetryHelper";
|
|
5
|
+
import { AppInsightsTelemetryMessage } from "../../Constants";
|
|
6
|
+
var AllowedKeys;
|
|
7
|
+
(function (AllowedKeys) {
|
|
8
|
+
AllowedKeys["LogLevel"] = "LogLevel";
|
|
9
|
+
AllowedKeys["Description"] = "Description";
|
|
10
|
+
AllowedKeys["ExceptionDetails"] = "ExceptionDetails";
|
|
11
|
+
AllowedKeys["ChannelId"] = "ChannelId";
|
|
12
|
+
AllowedKeys["LCWRuntimeId"] = "ClientSessionId";
|
|
13
|
+
AllowedKeys["ConversationId"] = "LiveWorkItemId";
|
|
14
|
+
AllowedKeys["ChatId"] = "ChatThreadId";
|
|
15
|
+
})(AllowedKeys || (AllowedKeys = {}));
|
|
16
|
+
export const appInsightsLogger = (appInsightsKey, disableCookiesUsage) => {
|
|
17
|
+
let appInsights = null;
|
|
18
|
+
const logger = () => {
|
|
19
|
+
if (!appInsights && appInsightsKey) {
|
|
20
|
+
try {
|
|
21
|
+
const config = {
|
|
22
|
+
...(appInsightsKey.includes("IngestionEndpoint") ? {
|
|
23
|
+
connectionString: appInsightsKey
|
|
24
|
+
} : {
|
|
25
|
+
instrumentationKey: appInsightsKey
|
|
26
|
+
}),
|
|
27
|
+
disableCookiesUsage: disableCookiesUsage
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// Initialize Application Insights
|
|
31
|
+
appInsights = new ApplicationInsights({
|
|
32
|
+
config
|
|
33
|
+
});
|
|
34
|
+
appInsights.loadAppInsights();
|
|
35
|
+
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
36
|
+
Event: TelemetryEvent.AppInsightsInitialized,
|
|
37
|
+
Description: AppInsightsTelemetryMessage.AppInsightsInitialized
|
|
38
|
+
});
|
|
39
|
+
} catch (error) {
|
|
40
|
+
console.error(AppInsightsTelemetryMessage.AppInsightsInitError, error);
|
|
41
|
+
TelemetryHelper.logActionEvent(LogLevel.ERROR, {
|
|
42
|
+
Event: TelemetryEvent.AppInsightsInitFailed,
|
|
43
|
+
Description: AppInsightsTelemetryMessage.AppInsightsInitError,
|
|
44
|
+
ExceptionDetails: {
|
|
45
|
+
message: `${AppInsightsTelemetryMessage.AppInsightsInitError} with key ending: ${appInsightsKey.slice(-3)}`,
|
|
46
|
+
exception: error
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return appInsights;
|
|
53
|
+
};
|
|
54
|
+
const aiLogger = {
|
|
55
|
+
type: "appInsightsLogger",
|
|
56
|
+
log: (logLevel, telemetryInput) => {
|
|
57
|
+
try {
|
|
58
|
+
var _telemetryInput$paylo, _telemetryInput$telem;
|
|
59
|
+
const _logger = logger();
|
|
60
|
+
if (!_logger) return;
|
|
61
|
+
const eventName = telemetryInput === null || telemetryInput === void 0 ? void 0 : (_telemetryInput$paylo = telemetryInput.payload) === null || _telemetryInput$paylo === void 0 ? void 0 : _telemetryInput$paylo.Event;
|
|
62
|
+
const telemetryInfo = telemetryInput === null || telemetryInput === void 0 ? void 0 : (_telemetryInput$telem = telemetryInput.telemetryInfo) === null || _telemetryInput$telem === void 0 ? void 0 : _telemetryInput$telem.telemetryInfo;
|
|
63
|
+
const eventProperties = setEventProperties(telemetryInfo);
|
|
64
|
+
if (eventName) {
|
|
65
|
+
const trackingEventName = getTrackingEventName(logLevel, eventName);
|
|
66
|
+
_logger.trackEvent({
|
|
67
|
+
name: trackingEventName,
|
|
68
|
+
properties: eventProperties
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
} catch (error) {
|
|
72
|
+
console.error("Error in logging telemetry to Application Insights:", error);
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
dispose: () => {
|
|
76
|
+
if (appInsights) {
|
|
77
|
+
appInsights.unload(); //flush and unload
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
83
|
+
function setEventProperties(telemetryInfo) {
|
|
84
|
+
const eventProperties = {};
|
|
85
|
+
if (telemetryInfo) {
|
|
86
|
+
for (const key in AllowedKeys) {
|
|
87
|
+
const finalKey = AllowedKeys[key]; // get renamed keys for LCWRuntimeId, ConversationId, ChatId
|
|
88
|
+
const value = telemetryInfo[key];
|
|
89
|
+
if (value !== undefined && value !== null && value !== "") {
|
|
90
|
+
eventProperties[finalKey] = value;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return eventProperties;
|
|
95
|
+
}
|
|
96
|
+
function getTrackingEventName(logLevel, eventName) {
|
|
97
|
+
// Remove "UX" or "LCW" prefix if present
|
|
98
|
+
const event = eventName.replace(/^(UX|LCW)/, "");
|
|
99
|
+
if (logLevel === LogLevel.ERROR) {
|
|
100
|
+
return ScenarioMarker.failScenario(event);
|
|
101
|
+
}
|
|
102
|
+
if (logLevel === LogLevel.WARN) {
|
|
103
|
+
return ScenarioMarker.warnScenario(event);
|
|
104
|
+
}
|
|
105
|
+
if (event.toLowerCase().includes("complete")) {
|
|
106
|
+
return ScenarioMarker.completeScenario(event);
|
|
107
|
+
}
|
|
108
|
+
return ScenarioMarker.startScenario(event);
|
|
109
|
+
}
|
|
110
|
+
return aiLogger;
|
|
111
|
+
};
|
|
@@ -15,8 +15,9 @@ export const ChatButtonStateful = props => {
|
|
|
15
15
|
// this is to ensure the telemetry is set only once and start the load timer
|
|
16
16
|
useEffect(() => {
|
|
17
17
|
uiTimer = createTimer();
|
|
18
|
-
TelemetryHelper.
|
|
19
|
-
Event: TelemetryEvent.
|
|
18
|
+
TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
|
|
19
|
+
Event: TelemetryEvent.UXLCWChatButtonLoadingStart,
|
|
20
|
+
Description: "Chat button loading started"
|
|
20
21
|
});
|
|
21
22
|
}, []);
|
|
22
23
|
|
|
@@ -34,8 +35,9 @@ export const ChatButtonStateful = props => {
|
|
|
34
35
|
return;
|
|
35
36
|
});
|
|
36
37
|
ref.current = async () => {
|
|
37
|
-
TelemetryHelper.
|
|
38
|
-
Event: TelemetryEvent.
|
|
38
|
+
TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
|
|
39
|
+
Event: TelemetryEvent.LCWChatButtonActionStarted,
|
|
40
|
+
Description: "Chat button click action started"
|
|
39
41
|
});
|
|
40
42
|
if (state.appStates.isMinimized) {
|
|
41
43
|
dispatch({
|
|
@@ -53,6 +55,10 @@ export const ChatButtonStateful = props => {
|
|
|
53
55
|
} else {
|
|
54
56
|
await startChat();
|
|
55
57
|
}
|
|
58
|
+
TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
|
|
59
|
+
Event: TelemetryEvent.LCWChatButtonActionCompleted,
|
|
60
|
+
Description: "Chat button action completed"
|
|
61
|
+
});
|
|
56
62
|
};
|
|
57
63
|
const outOfOfficeStyleProps = Object.assign({}, defaultOutOfOfficeChatButtonStyleProps, outOfOfficeButtonProps === null || outOfOfficeButtonProps === void 0 ? void 0 : outOfOfficeButtonProps.styleProps);
|
|
58
64
|
const controlProps = {
|
|
@@ -72,9 +78,6 @@ export const ChatButtonStateful = props => {
|
|
|
72
78
|
titleText: "We're Offline",
|
|
73
79
|
subtitleText: "No agents available",
|
|
74
80
|
onClick: async () => {
|
|
75
|
-
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
76
|
-
Event: TelemetryEvent.LCWChatButtonClicked
|
|
77
|
-
});
|
|
78
81
|
state.appStates.isMinimized && dispatch({
|
|
79
82
|
type: LiveChatWidgetActionType.SET_MINIMIZED,
|
|
80
83
|
payload: false
|
|
@@ -101,8 +104,9 @@ export const ChatButtonStateful = props => {
|
|
|
101
104
|
payload: true
|
|
102
105
|
});
|
|
103
106
|
}
|
|
104
|
-
TelemetryHelper.
|
|
105
|
-
Event: TelemetryEvent.
|
|
107
|
+
TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
|
|
108
|
+
Event: TelemetryEvent.UXLCWChatButtonLoadingCompleted,
|
|
109
|
+
Description: "Chat button loading completed",
|
|
106
110
|
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
|
|
107
111
|
});
|
|
108
112
|
}, []);
|
|
@@ -57,14 +57,15 @@ export const EmailTranscriptPaneStateful = props => {
|
|
|
57
57
|
liveChatContext
|
|
58
58
|
}));
|
|
59
59
|
NotificationHandler.notifySuccess(NotificationScenarios.EmailAddressSaved, (state === null || state === void 0 ? void 0 : (_state$domainStates2 = state.domainStates) === null || _state$domainStates2 === void 0 ? void 0 : (_state$domainStates2$ = _state$domainStates2.middlewareLocalizedTexts) === null || _state$domainStates2$ === void 0 ? void 0 : _state$domainStates2$.MIDDLEWARE_BANNER_FILE_EMAIL_ADDRESS_RECORDED_SUCCESS) ?? (defaultMiddlewareLocalizedTexts === null || defaultMiddlewareLocalizedTexts === void 0 ? void 0 : defaultMiddlewareLocalizedTexts.MIDDLEWARE_BANNER_FILE_EMAIL_ADDRESS_RECORDED_SUCCESS));
|
|
60
|
-
TelemetryHelper.
|
|
61
|
-
Event: TelemetryEvent.
|
|
60
|
+
TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
|
|
61
|
+
Event: TelemetryEvent.EmailTranscriptActionCompleted,
|
|
62
62
|
Description: "Transcript sent to email successfully."
|
|
63
63
|
});
|
|
64
64
|
} catch (ex) {
|
|
65
65
|
var _state$domainStates3, _state$domainStates3$;
|
|
66
|
-
TelemetryHelper.
|
|
67
|
-
Event: TelemetryEvent.
|
|
66
|
+
TelemetryHelper.logActionEventToAllTelemetry(LogLevel.ERROR, {
|
|
67
|
+
Event: TelemetryEvent.EmailTranscriptActionFailed,
|
|
68
|
+
Description: "Email transcript failed.",
|
|
68
69
|
ExceptionDetails: {
|
|
69
70
|
exception: ex
|
|
70
71
|
}
|
|
@@ -40,14 +40,19 @@ export const FooterStateful = props => {
|
|
|
40
40
|
dir: state.domainStates.globalDir,
|
|
41
41
|
onDownloadTranscriptClick: async () => {
|
|
42
42
|
try {
|
|
43
|
-
TelemetryHelper.
|
|
44
|
-
Event: TelemetryEvent.
|
|
45
|
-
Description: "Download
|
|
43
|
+
TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
|
|
44
|
+
Event: TelemetryEvent.DownloadTranscriptActionStarted,
|
|
45
|
+
Description: "Download transcript action started."
|
|
46
46
|
});
|
|
47
47
|
await downloadTranscript(facadeChatSDK, downloadTranscriptProps, state);
|
|
48
|
+
TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
|
|
49
|
+
Event: TelemetryEvent.DownloadTranscriptActionCompleted,
|
|
50
|
+
Description: "Download transcript action completed."
|
|
51
|
+
});
|
|
48
52
|
} catch (ex) {
|
|
49
|
-
TelemetryHelper.
|
|
50
|
-
Event: TelemetryEvent.
|
|
53
|
+
TelemetryHelper.logActionEventToAllTelemetry(LogLevel.ERROR, {
|
|
54
|
+
Event: TelemetryEvent.DownloadTranscriptActionFailed,
|
|
55
|
+
Description: "Download transcript action failed.",
|
|
51
56
|
ExceptionDetails: {
|
|
52
57
|
exception: ex
|
|
53
58
|
}
|
|
@@ -57,9 +62,9 @@ export const FooterStateful = props => {
|
|
|
57
62
|
},
|
|
58
63
|
onEmailTranscriptClick: () => {
|
|
59
64
|
var _footerProps$controlP, _footerProps$controlP2;
|
|
60
|
-
TelemetryHelper.
|
|
61
|
-
Event: TelemetryEvent.
|
|
62
|
-
Description: "Email Transcript
|
|
65
|
+
TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
|
|
66
|
+
Event: TelemetryEvent.EmailTranscriptActionStarted,
|
|
67
|
+
Description: "Email Transcript action started."
|
|
63
68
|
});
|
|
64
69
|
const emailTranscriptButtonId = (footerProps === null || footerProps === void 0 ? void 0 : (_footerProps$controlP = footerProps.controlProps) === null || _footerProps$controlP === void 0 ? void 0 : (_footerProps$controlP2 = _footerProps$controlP.emailTranscriptButtonProps) === null || _footerProps$controlP2 === void 0 ? void 0 : _footerProps$controlP2.id) ?? `${controlProps.id}-emailtranscript-button`;
|
|
65
70
|
if (emailTranscriptButtonId) {
|
|
@@ -37,9 +37,9 @@ export const HeaderStateful = props => {
|
|
|
37
37
|
id: "oc-lcw-header",
|
|
38
38
|
dir: state.domainStates.globalDir,
|
|
39
39
|
onMinimizeClick: () => {
|
|
40
|
-
TelemetryHelper.
|
|
41
|
-
Event: TelemetryEvent.
|
|
42
|
-
Description: "Header Minimize
|
|
40
|
+
TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
|
|
41
|
+
Event: TelemetryEvent.MinimizeChatActionStarted,
|
|
42
|
+
Description: "Header Minimize action started."
|
|
43
43
|
});
|
|
44
44
|
dispatch({
|
|
45
45
|
type: LiveChatWidgetActionType.SET_MINIMIZED,
|
|
@@ -49,12 +49,16 @@ export const HeaderStateful = props => {
|
|
|
49
49
|
type: LiveChatWidgetActionType.SET_UNREAD_MESSAGE_COUNT,
|
|
50
50
|
payload: 0
|
|
51
51
|
});
|
|
52
|
+
TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
|
|
53
|
+
Event: TelemetryEvent.MinimizeChatActionCompleted,
|
|
54
|
+
Description: "Header Minimize action completed."
|
|
55
|
+
});
|
|
52
56
|
},
|
|
53
57
|
onCloseClick: async () => {
|
|
54
58
|
var _props$headerProps, _props$headerProps$co, _props$headerProps$co2;
|
|
55
|
-
TelemetryHelper.
|
|
56
|
-
Event: TelemetryEvent.
|
|
57
|
-
Description: "Header Close
|
|
59
|
+
TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
|
|
60
|
+
Event: TelemetryEvent.CloseChatActionStarted,
|
|
61
|
+
Description: "Header Close action started."
|
|
58
62
|
});
|
|
59
63
|
if (localConfirmationPaneState.current !== ConfirmationState.Ok) {
|
|
60
64
|
dispatch({
|
|
@@ -67,6 +71,10 @@ export const HeaderStateful = props => {
|
|
|
67
71
|
const postMessageToOtherTabs = true;
|
|
68
72
|
await endChat(adapter, skipEndChatSDK, skipCloseChat, postMessageToOtherTabs);
|
|
69
73
|
}
|
|
74
|
+
TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
|
|
75
|
+
Event: TelemetryEvent.CloseChatActionCompleted,
|
|
76
|
+
Description: "Header Close action completed."
|
|
77
|
+
});
|
|
70
78
|
const closeButtonId = ((_props$headerProps = props.headerProps) === null || _props$headerProps === void 0 ? void 0 : (_props$headerProps$co = _props$headerProps.controlProps) === null || _props$headerProps$co === void 0 ? void 0 : (_props$headerProps$co2 = _props$headerProps$co.closeButtonProps) === null || _props$headerProps$co2 === void 0 ? void 0 : _props$headerProps$co2.id) ?? `${controlProps.id}-close-button`;
|
|
71
79
|
if (closeButtonId) {
|
|
72
80
|
dispatch({
|
|
@@ -87,14 +95,18 @@ export const HeaderStateful = props => {
|
|
|
87
95
|
text: "We're Offline"
|
|
88
96
|
},
|
|
89
97
|
onMinimizeClick: () => {
|
|
90
|
-
TelemetryHelper.
|
|
91
|
-
Event: TelemetryEvent.
|
|
92
|
-
Description: "Header Minimize
|
|
98
|
+
TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
|
|
99
|
+
Event: TelemetryEvent.MinimizeChatActionStarted,
|
|
100
|
+
Description: "Header Minimize action started."
|
|
93
101
|
});
|
|
94
102
|
dispatch({
|
|
95
103
|
type: LiveChatWidgetActionType.SET_MINIMIZED,
|
|
96
104
|
payload: true
|
|
97
105
|
});
|
|
106
|
+
TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
|
|
107
|
+
Event: TelemetryEvent.MinimizeChatActionCompleted,
|
|
108
|
+
Description: "Header Minimize action completed."
|
|
109
|
+
});
|
|
98
110
|
},
|
|
99
111
|
...(outOfOfficeHeaderProps === null || outOfOfficeHeaderProps === void 0 ? void 0 : outOfOfficeHeaderProps.controlProps),
|
|
100
112
|
hideCloseButton: state.appStates.conversationState === ConversationState.OutOfOffice || (outOfOfficeHeaderProps === null || outOfOfficeHeaderProps === void 0 ? void 0 : (_outOfOfficeHeaderPro = outOfOfficeHeaderProps.controlProps) === null || _outOfOfficeHeaderPro === void 0 ? void 0 : _outOfOfficeHeaderPro.hideCloseButton)
|
|
@@ -5,6 +5,7 @@ import { defaultAriaConfig } from "../../../common/telemetry/defaultConfigs/defa
|
|
|
5
5
|
import { defaultInternalTelemetryData } from "../../../common/telemetry/defaultConfigs/defaultTelemetryInternalData";
|
|
6
6
|
import { defaultTelemetryConfiguration } from "../../../common/telemetry/defaultConfigs/defaultTelemetryConfiguration";
|
|
7
7
|
import { newGuid } from "../../../common/utils";
|
|
8
|
+
import { defaultAppInsightsConfig } from "../../../common/telemetry/defaultConfigs/defaultAppInsightsConfig";
|
|
8
9
|
export const registerTelemetryLoggers = (props, dispatch) => {
|
|
9
10
|
var _props$liveChatContex, _props$liveChatContex2;
|
|
10
11
|
const telemetryConfig = {
|
|
@@ -19,7 +20,8 @@ export const registerTelemetryLoggers = (props, dispatch) => {
|
|
|
19
20
|
let telemetryData = {
|
|
20
21
|
...defaultInternalTelemetryData,
|
|
21
22
|
telemetryConfig: Object.assign({}, defaultTelemetryConfiguration, telemetryConfig),
|
|
22
|
-
ariaConfig: Object.assign({}, defaultAriaConfig, telemetryConfig === null || telemetryConfig === void 0 ? void 0 : telemetryConfig.ariaConfigurations)
|
|
23
|
+
ariaConfig: Object.assign({}, defaultAriaConfig, telemetryConfig === null || telemetryConfig === void 0 ? void 0 : telemetryConfig.ariaConfigurations),
|
|
24
|
+
appInsightsConfig: Object.assign({}, defaultAppInsightsConfig, props.appInsightsConfig)
|
|
23
25
|
};
|
|
24
26
|
if (props.chatConfig) {
|
|
25
27
|
telemetryData = TelemetryHelper.addChatConfigDataToTelemetry(props === null || props === void 0 ? void 0 : props.chatConfig, telemetryData);
|
|
@@ -108,8 +108,8 @@ const getPostChatContext = async (facadeChatSDK, state, dispatch) => {
|
|
|
108
108
|
if ((state === null || state === void 0 ? void 0 : (_state$domainStates2 = state.domainStates) === null || _state$domainStates2 === void 0 ? void 0 : _state$domainStates2.postChatContext) === undefined) {
|
|
109
109
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
110
110
|
const context = await facadeChatSDK.getPostChatSurveyContext();
|
|
111
|
-
TelemetryHelper.
|
|
112
|
-
Event: TelemetryEvent.
|
|
111
|
+
TelemetryHelper.logSDKEventToAllTelemetry(LogLevel.INFO, {
|
|
112
|
+
Event: TelemetryEvent.PostChatContextCallCompleted,
|
|
113
113
|
Description: PostChatSurveyTelemetryMessage.PostChatContextCallSucceed
|
|
114
114
|
});
|
|
115
115
|
dispatch({
|
|
@@ -120,9 +120,12 @@ const getPostChatContext = async (facadeChatSDK, state, dispatch) => {
|
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
} catch (error) {
|
|
123
|
-
TelemetryHelper.
|
|
123
|
+
TelemetryHelper.logSDKEventToAllTelemetry(LogLevel.ERROR, {
|
|
124
124
|
Event: TelemetryEvent.PostChatContextCallFailed,
|
|
125
|
-
Description: PostChatSurveyTelemetryMessage.PostChatContextCallFailed
|
|
125
|
+
Description: PostChatSurveyTelemetryMessage.PostChatContextCallFailed,
|
|
126
|
+
ExceptionDetails: {
|
|
127
|
+
exception: error
|
|
128
|
+
}
|
|
126
129
|
});
|
|
127
130
|
}
|
|
128
131
|
};
|
|
@@ -12,10 +12,14 @@ export const setPostChatContextAndLoadSurvey = async (facadeChatSDK, dispatch, p
|
|
|
12
12
|
const postChatEnabled = await isPostChatSurveyEnabled(facadeChatSDK);
|
|
13
13
|
if (postChatEnabled) {
|
|
14
14
|
if (!persistedChat) {
|
|
15
|
+
TelemetryHelper.logSDKEventToAllTelemetry(LogLevel.INFO, {
|
|
16
|
+
Event: TelemetryEvent.PostChatContextCallStarted,
|
|
17
|
+
Description: PostChatSurveyTelemetryMessage.PostChatContextCallStarted
|
|
18
|
+
});
|
|
15
19
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
20
|
const context = await facadeChatSDK.getPostChatSurveyContext();
|
|
17
|
-
TelemetryHelper.
|
|
18
|
-
Event: TelemetryEvent.
|
|
21
|
+
TelemetryHelper.logSDKEventToAllTelemetry(LogLevel.INFO, {
|
|
22
|
+
Event: TelemetryEvent.PostChatContextCallCompleted,
|
|
19
23
|
Description: PostChatSurveyTelemetryMessage.PostChatContextCallSucceed
|
|
20
24
|
});
|
|
21
25
|
dispatch({
|
|
@@ -25,7 +29,7 @@ export const setPostChatContextAndLoadSurvey = async (facadeChatSDK, dispatch, p
|
|
|
25
29
|
}
|
|
26
30
|
}
|
|
27
31
|
} catch (ex) {
|
|
28
|
-
TelemetryHelper.
|
|
32
|
+
TelemetryHelper.logSDKEventToAllTelemetry(LogLevel.ERROR, {
|
|
29
33
|
Event: TelemetryEvent.PostChatContextCallFailed,
|
|
30
34
|
ExceptionDetails: {
|
|
31
35
|
exception: ex
|
|
@@ -149,9 +149,9 @@ const initStartChat = async (facadeChatSDK, dispatch, setAdapter, state, props,
|
|
|
149
149
|
|
|
150
150
|
//Start widget load timer
|
|
151
151
|
TelemetryTimers.WidgetLoadTimer = createTimer();
|
|
152
|
-
TelemetryHelper.
|
|
153
|
-
Event: TelemetryEvent.
|
|
154
|
-
Description: "Widget
|
|
152
|
+
TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
|
|
153
|
+
Event: TelemetryEvent.WidgetStartChatStarted,
|
|
154
|
+
Description: "Widget start chat started."
|
|
155
155
|
});
|
|
156
156
|
|
|
157
157
|
//Check if chat retrieved from cache
|