@microsoft/omnichannel-chat-widget 1.7.8-main.7a07fc5 → 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.
Files changed (166) hide show
  1. package/lib/cjs/common/Constants.js +66 -20
  2. package/lib/cjs/common/KeyCodes.js +6 -1
  3. package/lib/cjs/common/contextDataStore/DataStoreManager.js +6 -1
  4. package/lib/cjs/common/facades/FacadeChatSDK.js +392 -295
  5. package/lib/cjs/common/storage/default/defaultCacheManager.js +6 -3
  6. package/lib/cjs/common/telemetry/ScenarioMarker.js +66 -0
  7. package/lib/cjs/common/telemetry/TelemetryConstants.js +179 -148
  8. package/lib/cjs/common/telemetry/TelemetryHelper.js +281 -250
  9. package/lib/cjs/common/telemetry/TelemetryManager.js +31 -11
  10. package/lib/cjs/common/telemetry/defaultConfigs/defaultAppInsightsConfig.js +11 -0
  11. package/lib/cjs/common/telemetry/interfaces/IAppInsightsConfig.js +1 -0
  12. package/lib/cjs/common/telemetry/loggers/appInsightsLogger.js +119 -0
  13. package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +17 -14
  14. package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +5 -4
  15. package/lib/cjs/components/footerstateful/FooterStateful.js +13 -8
  16. package/lib/cjs/components/headerstateful/HeaderStateful.js +24 -14
  17. package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +32 -19
  18. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +71 -56
  19. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +17 -8
  20. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.js +65 -52
  21. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +31 -18
  22. package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +14 -6
  23. package/lib/cjs/components/livechatwidget/common/Deferred.js +14 -6
  24. package/lib/cjs/components/livechatwidget/common/chatDisconnectHelper.js +3 -1
  25. package/lib/cjs/components/livechatwidget/common/endChat.js +4 -18
  26. package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +0 -5
  27. package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +3 -1
  28. package/lib/cjs/components/livechatwidget/common/renderSurveyHelpers.js +7 -4
  29. package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +7 -3
  30. package/lib/cjs/components/livechatwidget/common/startChat.js +5 -26
  31. package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.js +7 -6
  32. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +28 -20
  33. package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +12 -8
  34. package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +31 -10
  35. package/lib/cjs/components/postchatsurveypanestateful/common/isValidSurveyUrl.js +28 -0
  36. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +9 -6
  37. package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +9 -7
  38. package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +4 -3
  39. package/lib/cjs/components/webchatcontainerstateful/common/DemoChatAdapter.js +88 -65
  40. package/lib/cjs/components/webchatcontainerstateful/common/DemoChatSDK.js +26 -7
  41. package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatAdapter.js +49 -26
  42. package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatSDK.js +57 -35
  43. package/lib/cjs/components/webchatcontainerstateful/common/mockadapter.js +62 -52
  44. package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +95 -61
  45. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +6 -1
  46. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +6 -1
  47. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.js +53 -39
  48. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +4 -0
  49. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +88 -60
  50. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +18 -6
  51. package/lib/cjs/firstresponselatency/Constants.js +13 -0
  52. package/lib/cjs/firstresponselatency/FirstMessageTrackerFromBot.js +118 -0
  53. package/lib/cjs/firstresponselatency/FirstResponseLatencyTracker.js +201 -0
  54. package/lib/cjs/firstresponselatency/util.js +98 -0
  55. package/lib/cjs/plugins/createChatTranscript.js +92 -62
  56. package/lib/cjs/plugins/newMessageEventHandler.js +102 -88
  57. package/lib/esm/common/Constants.js +64 -19
  58. package/lib/esm/common/KeyCodes.js +6 -1
  59. package/lib/esm/common/contextDataStore/DataStoreManager.js +6 -1
  60. package/lib/esm/common/facades/FacadeChatSDK.js +392 -295
  61. package/lib/esm/common/storage/default/defaultCacheManager.js +6 -1
  62. package/lib/esm/common/telemetry/ScenarioMarker.js +59 -0
  63. package/lib/esm/common/telemetry/TelemetryConstants.js +179 -148
  64. package/lib/esm/common/telemetry/TelemetryHelper.js +281 -250
  65. package/lib/esm/common/telemetry/TelemetryManager.js +31 -11
  66. package/lib/esm/common/telemetry/defaultConfigs/defaultAppInsightsConfig.js +4 -0
  67. package/lib/esm/common/telemetry/interfaces/IAppInsightsConfig.js +1 -0
  68. package/lib/esm/common/telemetry/loggers/appInsightsLogger.js +111 -0
  69. package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +17 -14
  70. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +5 -4
  71. package/lib/esm/components/footerstateful/FooterStateful.js +13 -8
  72. package/lib/esm/components/headerstateful/HeaderStateful.js +24 -14
  73. package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +32 -19
  74. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +71 -56
  75. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +17 -8
  76. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.js +65 -52
  77. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +31 -18
  78. package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +14 -6
  79. package/lib/esm/components/livechatwidget/common/Deferred.js +14 -6
  80. package/lib/esm/components/livechatwidget/common/chatDisconnectHelper.js +3 -1
  81. package/lib/esm/components/livechatwidget/common/endChat.js +4 -18
  82. package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +1 -6
  83. package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +3 -1
  84. package/lib/esm/components/livechatwidget/common/renderSurveyHelpers.js +7 -4
  85. package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +7 -3
  86. package/lib/esm/components/livechatwidget/common/startChat.js +6 -27
  87. package/lib/esm/components/livechatwidget/common/startChatErrorHandler.js +7 -6
  88. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +28 -20
  89. package/lib/esm/components/ooohpanestateful/OOOHPaneStateful.js +12 -8
  90. package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +31 -10
  91. package/lib/esm/components/postchatsurveypanestateful/common/isValidSurveyUrl.js +21 -0
  92. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +9 -6
  93. package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +9 -7
  94. package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +4 -3
  95. package/lib/esm/components/webchatcontainerstateful/common/DemoChatAdapter.js +88 -65
  96. package/lib/esm/components/webchatcontainerstateful/common/DemoChatSDK.js +26 -7
  97. package/lib/esm/components/webchatcontainerstateful/common/DesignerChatAdapter.js +49 -26
  98. package/lib/esm/components/webchatcontainerstateful/common/DesignerChatSDK.js +57 -35
  99. package/lib/esm/components/webchatcontainerstateful/common/mockadapter.js +63 -52
  100. package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +95 -61
  101. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +6 -1
  102. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +6 -1
  103. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.js +53 -39
  104. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +4 -0
  105. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +88 -60
  106. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +18 -6
  107. package/lib/esm/firstresponselatency/Constants.js +6 -0
  108. package/lib/esm/firstresponselatency/FirstMessageTrackerFromBot.js +112 -0
  109. package/lib/esm/firstresponselatency/FirstResponseLatencyTracker.js +194 -0
  110. package/lib/esm/firstresponselatency/util.js +87 -0
  111. package/lib/esm/plugins/createChatTranscript.js +92 -62
  112. package/lib/esm/plugins/newMessageEventHandler.js +100 -86
  113. package/lib/types/common/Constants.d.ts +5 -0
  114. package/lib/types/common/facades/FacadeChatSDK.d.ts +1 -0
  115. package/lib/types/common/telemetry/ScenarioMarker.d.ts +19 -0
  116. package/lib/types/common/telemetry/TelemetryConstants.d.ts +50 -33
  117. package/lib/types/common/telemetry/TelemetryHelper.d.ts +5 -0
  118. package/lib/types/common/telemetry/defaultConfigs/defaultAppInsightsConfig.d.ts +2 -0
  119. package/lib/types/common/telemetry/interfaces/IAppInsightsConfig.d.ts +4 -0
  120. package/lib/types/common/telemetry/interfaces/IChatSDKLogger.d.ts +1 -0
  121. package/lib/types/common/telemetry/interfaces/IInternalTelemetryData.d.ts +2 -0
  122. package/lib/types/common/telemetry/loggers/appInsightsLogger.d.ts +5 -0
  123. package/lib/types/components/callingcontainerstateful/CallingContainerStateful.d.ts +2 -1
  124. package/lib/types/components/chatbuttonstateful/ChatButtonStateful.d.ts +2 -1
  125. package/lib/types/components/confirmationpanestateful/ConfirmationPaneStateful.d.ts +2 -1
  126. package/lib/types/components/dimlayer/DimLayer.d.ts +2 -1
  127. package/lib/types/components/draggable/DraggableChatWidget.d.ts +2 -2
  128. package/lib/types/components/draggable/DraggableEventEmitter.d.ts +2 -2
  129. package/lib/types/components/draggable/DraggableEventReceiver.d.ts +2 -2
  130. package/lib/types/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.d.ts +2 -1
  131. package/lib/types/components/footerstateful/FooterStateful.d.ts +2 -1
  132. package/lib/types/components/footerstateful/audionotificationstateful/AudioNotificationStateful.d.ts +2 -1
  133. package/lib/types/components/headerstateful/HeaderStateful.d.ts +2 -1
  134. package/lib/types/components/livechatwidget/LiveChatWidget.d.ts +2 -1
  135. package/lib/types/components/livechatwidget/common/createFooter.d.ts +2 -1
  136. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +2 -0
  137. package/lib/types/components/loadingpanestateful/LoadingPaneStateful.d.ts +2 -1
  138. package/lib/types/components/notificationpanestateful/NotificationPaneStateful.d.ts +2 -1
  139. package/lib/types/components/ooohpanestateful/OOOHPaneStateful.d.ts +2 -1
  140. package/lib/types/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.d.ts +2 -1
  141. package/lib/types/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.d.ts +2 -1
  142. package/lib/types/components/postchatsurveypanestateful/common/isValidSurveyUrl.d.ts +2 -0
  143. package/lib/types/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.d.ts +2 -1
  144. package/lib/types/components/proactivechatpanestateful/ProactiveChatPaneStateful.d.ts +2 -1
  145. package/lib/types/components/reconnectchatpanestateful/ReconnectChatPaneStateful.d.ts +2 -1
  146. package/lib/types/components/startchaterrorpanestateful/StartChatErrorPaneStateful.d.ts +2 -1
  147. package/lib/types/components/webchatcontainerstateful/WebChatContainerStateful.d.ts +2 -1
  148. package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatProps.d.ts +2 -2
  149. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Attachment.d.ts +2 -1
  150. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AttachmentContent.d.ts +2 -1
  151. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AttachmentIcon.d.ts +2 -1
  152. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/DownloadBlockedAttachment.d.ts +2 -1
  153. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/MaliciousAttachment.d.ts +2 -1
  154. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/ScanInProgressAttachment.d.ts +2 -1
  155. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Spinner.d.ts +2 -1
  156. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.d.ts +1 -1
  157. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.d.ts +2 -1
  158. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.d.ts +2 -1
  159. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.d.ts +2 -1
  160. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.d.ts +2 -1
  161. package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +1 -1
  162. package/lib/types/firstresponselatency/Constants.d.ts +30 -0
  163. package/lib/types/firstresponselatency/FirstMessageTrackerFromBot.d.ts +1 -0
  164. package/lib/types/firstresponselatency/FirstResponseLatencyTracker.d.ts +22 -0
  165. package/lib/types/firstresponselatency/util.d.ts +7 -0
  166. package/package.json +27 -13
@@ -1,100 +1,114 @@
1
1
  import { BroadcastEvent, LogLevel, TelemetryEvent } from "../common/telemetry/TelemetryConstants";
2
+ import { ScenarioType } from "../firstresponselatency/Constants";
3
+ import { buildMessagePayload, getScenarioType, isHistoryMessage, polyfillMessagePayloadForEvent } from "../firstresponselatency/util";
2
4
  import { BroadcastService } from "@microsoft/omnichannel-chat-components";
3
5
  import { Constants } from "../common/Constants";
6
+ import { FirstResponseLatencyTracker } from "../firstresponselatency/FirstResponseLatencyTracker";
4
7
  import { TelemetryHelper } from "../common/telemetry/TelemetryHelper";
5
8
  import { TelemetryManager } from "../common/telemetry/TelemetryManager";
6
9
  export const createOnNewAdapterActivityHandler = (chatId, userId) => {
10
+ // Hooking the message tracker in the listener, a bit invasive but easier to control.
11
+ const firstResponseLatencyTracker = new FirstResponseLatencyTracker();
12
+ // epoch time in utc for when start to listen.
13
+ // We dont longer have a mechanism to know if a message is history or new, so any message older than the time we start listening will be considered a history message.
14
+ // this is a workaround for the fact that we dont have a way to identify if a message is history or new, and it will provide consistency across different scenarios
15
+ const startTime = new Date().getTime();
16
+ let isHistoryMessageReceivedEventRaised = false;
7
17
  const onNewAdapterActivityHandler = activity => {
8
- var _activity$channelData, _activity$channelData2, _activity$channelData3;
9
- const isActivityMessage = (activity === null || activity === void 0 ? void 0 : activity.type) === Constants.message;
10
- const isHistoryMessage = isActivityMessage && ((activity === null || activity === void 0 ? void 0 : (_activity$channelData = activity.channelData) === null || _activity$channelData === void 0 ? void 0 : (_activity$channelData2 = _activity$channelData.tags) === null || _activity$channelData2 === void 0 ? void 0 : _activity$channelData2.includes(Constants.historyMessageTag)) || (activity === null || activity === void 0 ? void 0 : (_activity$channelData3 = activity.channelData) === null || _activity$channelData3 === void 0 ? void 0 : _activity$channelData3.fromList));
11
- raiseMessageEvent(activity, isHistoryMessage);
18
+ raiseMessageEvent(activity);
12
19
  };
13
- let isHistoryMessageReceivedEventRasied = false;
14
- const raiseMessageEvent = (activity, isHistoryMessage) => {
20
+ const userSendMessageStrategy = activity => {
21
+ var _TelemetryManager$Int;
22
+ const payload = buildMessagePayload(activity, userId);
15
23
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
16
- const polyfillMessagePayloadForEvent = payload => {
17
- var _activity$conversatio, _TelemetryManager$Int, _attachments;
18
- return {
19
- ...payload,
20
- channelData: activity === null || activity === void 0 ? void 0 : activity.channelData,
21
- chatId: activity === null || activity === void 0 ? void 0 : (_activity$conversatio = activity.conversation) === null || _activity$conversatio === void 0 ? void 0 : _activity$conversatio.id,
22
- conversationId: (_TelemetryManager$Int = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int === void 0 ? void 0 : _TelemetryManager$Int.conversationId,
23
- id: activity === null || activity === void 0 ? void 0 : activity.id,
24
- isChatComplete: false,
25
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
26
- text: activity === null || activity === void 0 ? void 0 : activity.text,
27
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
28
- attachment: (activity === null || activity === void 0 ? void 0 : (_attachments = activity.attachments) === null || _attachments === void 0 ? void 0 : _attachments.length) >= 1 ? activity === null || activity === void 0 ? void 0 : activity.attachments : []
29
- };
24
+ payload.messageType = Constants.userMessageTag;
25
+ const newMessageSentEvent = {
26
+ eventName: BroadcastEvent.NewMessageSent,
27
+ payload: polyfillMessagePayloadForEvent(activity, payload, (_TelemetryManager$Int = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int === void 0 ? void 0 : _TelemetryManager$Int.conversationId)
30
28
  };
29
+ BroadcastService.postMessage(newMessageSentEvent);
30
+ if (!isHistoryMessage(activity, startTime)) {
31
+ firstResponseLatencyTracker.startClock(payload);
32
+ }
33
+ TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
34
+ Event: TelemetryEvent.MessageSentCompleted,
35
+ Description: "New message sent"
36
+ });
37
+ };
38
+ const systemMessageStrategy = activity => {
39
+ const payload = buildMessagePayload(activity, userId);
40
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
41
+ payload.messageType = Constants.systemMessageTag;
42
+ TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
43
+ Event: TelemetryEvent.SystemMessageReceivedCompleted,
44
+ Description: "System message received"
45
+ });
46
+ };
47
+ const historyMessageStrategy = payload => {
48
+ const newMessageReceivedEvent = {
49
+ eventName: BroadcastEvent.HistoryMessageReceived,
50
+ payload: payload
51
+ };
52
+ BroadcastService.postMessage(newMessageReceivedEvent);
53
+ if (!isHistoryMessageReceivedEventRaised) {
54
+ // this is needed for reload scenarios, it helps to identify the last message received before the reload
55
+ isHistoryMessageReceivedEventRaised = true;
56
+ TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
57
+ Event: TelemetryEvent.RehydrateMessageReceivedCompleted,
58
+ Description: "History message received",
59
+ CustomProperties: payload
60
+ });
61
+ }
62
+ };
63
+ const isValidMessage = activity => {
64
+ var _activity$channelData, _activity$channelData2, _activity$channelData3;
65
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
66
+ const messageHasNoText = !(activity !== null && activity !== void 0 && activity.text);
67
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
68
+ const messageHasNoTags = !(activity !== null && activity !== void 0 && activity.channelData) || !(activity !== null && activity !== void 0 && (_activity$channelData = activity.channelData) !== null && _activity$channelData !== void 0 && _activity$channelData.tags) || (activity === null || activity === void 0 ? void 0 : (_activity$channelData2 = activity.channelData) === null || _activity$channelData2 === void 0 ? void 0 : (_activity$channelData3 = _activity$channelData2.tags) === null || _activity$channelData3 === void 0 ? void 0 : _activity$channelData3.length) === 0;
69
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
70
+ const messageHasNoAttachments = !(activity !== null && activity !== void 0 && activity.attachments) || (activity === null || activity === void 0 ? void 0 : activity.attachments.length) === 0;
71
+ if (messageHasNoTags && messageHasNoText && messageHasNoAttachments) {
72
+ return false;
73
+ }
74
+ return true;
75
+ };
76
+ const receivedMessageStrategy = activity => {
77
+ var _TelemetryManager$Int3;
78
+ if (!isValidMessage(activity)) return;
79
+ const isHistoryMessageReceived = isHistoryMessage(activity, startTime);
80
+ const payload = buildMessagePayload(activity, userId);
81
+ payload.messageType = Constants.userMessageTag;
82
+ if (isHistoryMessageReceived) {
83
+ var _TelemetryManager$Int2;
84
+ historyMessageStrategy(polyfillMessagePayloadForEvent(activity, payload, (_TelemetryManager$Int2 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int2 === void 0 ? void 0 : _TelemetryManager$Int2.conversationId));
85
+ return;
86
+ }
87
+ firstResponseLatencyTracker.stopClock(payload);
88
+ const newMessageReceivedEvent = {
89
+ eventName: BroadcastEvent.NewMessageReceived,
90
+ payload: polyfillMessagePayloadForEvent(activity, payload, (_TelemetryManager$Int3 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int3 === void 0 ? void 0 : _TelemetryManager$Int3.conversationId)
91
+ };
92
+ BroadcastService.postMessage(newMessageReceivedEvent);
93
+ TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
94
+ Event: TelemetryEvent.MessageReceivedCompleted,
95
+ Description: "New message received",
96
+ CustomProperties: payload
97
+ });
98
+ };
99
+ const raiseMessageEvent = activity => {
31
100
  if ((activity === null || activity === void 0 ? void 0 : activity.type) === Constants.message) {
32
- var _text, _text2, _activity$channelData4, _activity$from;
33
- const payload = {
34
- // To identify hidden contents vs empty content
35
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
36
- 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)*` : "",
37
- type: activity === null || activity === void 0 ? void 0 : activity.type,
38
- timestamp: activity === null || activity === void 0 ? void 0 : activity.timestamp,
39
- userId: userId,
40
- tags: activity === null || activity === void 0 ? void 0 : (_activity$channelData4 = activity.channelData) === null || _activity$channelData4 === void 0 ? void 0 : _activity$channelData4.tags,
41
- messageType: ""
42
- };
43
- if ((activity === null || activity === void 0 ? void 0 : (_activity$from = activity.from) === null || _activity$from === void 0 ? void 0 : _activity$from.role) === Constants.userMessageTag) {
44
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
45
- payload.messageType = Constants.userMessageTag;
46
- const newMessageSentEvent = {
47
- eventName: BroadcastEvent.NewMessageSent,
48
- payload: polyfillMessagePayloadForEvent(payload)
49
- };
50
- BroadcastService.postMessage(newMessageSentEvent);
51
- TelemetryHelper.logActionEvent(LogLevel.INFO, {
52
- Event: TelemetryEvent.MessageSent,
53
- Description: "New message sent"
54
- });
55
- } else {
56
- var _activity$channelData5, _activity$channelData6;
57
- 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)) {
58
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
59
- payload.messageType = Constants.systemMessageTag;
60
- TelemetryHelper.logActionEvent(LogLevel.INFO, {
61
- Event: TelemetryEvent.SystemMessageReceived,
62
- Description: "System message received"
63
- });
64
- } else {
65
- var _activity$channelData7, _activity$channelData8, _activity$channelData9;
66
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
67
- const messageHasNoText = !(activity !== null && activity !== void 0 && activity.text);
68
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
69
- 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;
70
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
71
- const messageHasNoAttachments = !(activity !== null && activity !== void 0 && activity.attachments) || (activity === null || activity === void 0 ? void 0 : activity.attachments.length) === 0;
72
- if (messageHasNoTags && messageHasNoText && messageHasNoAttachments) {
73
- return;
74
- }
75
- payload.messageType = Constants.userMessageTag;
76
- }
77
- const newMessageReceivedEvent = {
78
- eventName: isHistoryMessage ? BroadcastEvent.HistoryMessageReceived : BroadcastEvent.NewMessageReceived,
79
- payload: polyfillMessagePayloadForEvent(payload)
80
- };
81
- BroadcastService.postMessage(newMessageReceivedEvent);
82
- if (!isHistoryMessage) {
83
- TelemetryHelper.logActionEvent(LogLevel.INFO, {
84
- Event: TelemetryEvent.MessageReceived,
85
- Description: "New message received",
86
- CustomProperties: payload
87
- });
88
- } else {
89
- if (!isHistoryMessageReceivedEventRasied) {
90
- isHistoryMessageReceivedEventRasied = true;
91
- TelemetryHelper.logActionEvent(LogLevel.INFO, {
92
- Event: TelemetryEvent.RehydrateMessageReceived,
93
- Description: "History message received",
94
- CustomProperties: payload
95
- });
96
- }
97
- }
101
+ const scenarioType = getScenarioType(activity);
102
+ switch (scenarioType) {
103
+ case ScenarioType.UserSendMessageStrategy:
104
+ userSendMessageStrategy(activity);
105
+ break;
106
+ case ScenarioType.SystemMessageStrategy:
107
+ systemMessageStrategy(activity);
108
+ break;
109
+ case ScenarioType.ReceivedMessageStrategy:
110
+ receivedMessageStrategy(activity);
111
+ break;
98
112
  }
99
113
  }
100
114
  };
@@ -274,4 +274,9 @@ export declare class PrepareEndChatDescriptionConstants {
274
274
  export declare class PostChatSurveyTelemetryMessage {
275
275
  static readonly PostChatContextCallFailed = "Failed to get post chat context.";
276
276
  static readonly PostChatContextCallSucceed = "Postchat context call succeed.";
277
+ static readonly PostChatContextCallStarted = "Postchat context call started.";
278
+ }
279
+ export declare class AppInsightsTelemetryMessage {
280
+ static readonly AppInsightsInitialized = "Application Insights initialized successfully.";
281
+ static readonly AppInsightsInitError = "Error initializing Application Insights";
277
282
  }
@@ -43,6 +43,7 @@ export declare class FacadeChatSDK {
43
43
  private enforceBase64Encoding;
44
44
  private extractExpFromToken;
45
45
  private setToken;
46
+ private corroborateTokenIsSet;
46
47
  private tokenRing;
47
48
  private validateAndExecuteCall;
48
49
  initialize(optionalParams?: InitializeOptionalParams): Promise<ChatConfig>;
@@ -0,0 +1,19 @@
1
+ declare class ScenarioMarker {
2
+ /**
3
+ * Formats the event name for the "Started" state of a scenario.
4
+ */
5
+ static startScenario(event: string): string;
6
+ /**
7
+ * Formats the event name for the "Failed" state of a scenario.
8
+ */
9
+ static failScenario(event: string): string;
10
+ /**
11
+ * Formats the event name for the "Completed" state of a scenario.
12
+ */
13
+ static completeScenario(event: string): string;
14
+ /**
15
+ * Formats the event name for the "Warn" state of a scenario.
16
+ */
17
+ static warnScenario(event: string): string;
18
+ }
19
+ export default ScenarioMarker;
@@ -54,7 +54,9 @@ export declare enum BroadcastEvent {
54
54
  UpdateConversationDataForTelemetry = "UpdateConversationDataForTelemetry",
55
55
  ContactIdNotFound = "ContactIdNotFound",
56
56
  SyncMinimize = "SyncMinimize",
57
- OnWidgetError = "OnWidgetError"
57
+ OnWidgetError = "OnWidgetError",
58
+ FMLTrackingCompletedAck = "FMLTrackingCompletedAck",
59
+ FMLTrackingCompleted = "FMLTrackingCompleted"
58
60
  }
59
61
  export declare enum TelemetryEvent {
60
62
  CallAdded = "CallAdded",
@@ -100,28 +102,27 @@ export declare enum TelemetryEvent {
100
102
  EndChatFailed = "EndChatFailed",
101
103
  SettingCustomContext = "SettingCustomContext",
102
104
  WebChatLoaded = "WebChatLoaded",
103
- LCWChatButtonClicked = "LCWChatButtonClicked",
105
+ LCWChatButtonActionCompleted = "LCWChatButtonActionCompleted",
106
+ LCWChatButtonActionStarted = "LCWChatButtonActionStarted",
104
107
  LCWChatButtonShow = "LCWChatButtonShow",
105
- WidgetLoadStarted = "WidgetLoadStarted",
106
- WidgetLoadComplete = "WidgetLoadComplete",
107
- WidgetLoadFailed = "WidgetLoadFailed",
108
+ WidgetStartChatStarted = "WidgetStartChatStarted",
109
+ WidgetStartChatCompleted = "WidgetStartChatCompleted",
110
+ WidgetStartChatFailed = "WidgetStartChatFailed",
108
111
  StartChatMethodException = "StartChatMethodException",
109
112
  CloseChatCall = "CloseChatCall",
110
113
  CloseChatMethodException = "CloseChatMethodException",
111
114
  PrechatSurveyLoaded = "PrechatSurveyLoaded",
112
115
  PrechatSurveyExpected = "PrechatSurveyExpected",
113
- PrechatSubmitted = "PrechatSubmitted",
116
+ PrechatSubmitCompleted = "PrechatSubmitCompleted",
114
117
  StartChatSDKCall = "StartChatCall",
115
- StartChatEventRecevied = "StartChatEventReceived",
118
+ StartChatEventReceived = "StartChatEventReceivedCompleted",
116
119
  EndChatSDKCall = "EndChatSDKCall",
117
120
  PrepareEndChat = "PrepareEndChat",
118
- EndChatEventReceived = "EndChatEventReceived",
121
+ EndChatEventReceived = "EndChatEventReceivedCompleted",
119
122
  WindowClosed = "WindowClosed",
120
123
  OnNewMessageFailed = "OnNewMessageFailed",
121
124
  OnNewMessageAudioNotificationFailed = "OnNewMessageAudioNotificationFailed",
122
125
  DownloadTranscriptResponseNullOrUndefined = "DownloadTranscriptResponseNullOrUndefined",
123
- EmailTranscriptSent = "EmailTranscriptSent",
124
- EmailTranscriptFailed = "EmailTranscriptFailed",
125
126
  ErrorUIPaneLoaded = "ErrorUIPaneLoaded",
126
127
  DownloadTranscriptFailed = "DownloadTranscriptFailed",
127
128
  StartChatFailed = "StartChatFailed",
@@ -135,12 +136,18 @@ export declare enum TelemetryEvent {
135
136
  ConfirmationPaneLoaded = "ConfirmationPaneLoaded",
136
137
  ProactiveChatPaneLoaded = "ProactiveChatPaneLoaded",
137
138
  ReconnectChatPaneLoaded = "ReconnectChatPaneLoaded",
138
- HeaderCloseButtonClicked = "HeaderCloseButtonClicked",
139
- HeaderMinimizeButtonClicked = "HeaderMinimizeButtonClicked",
139
+ CloseChatActionStarted = "CloseChatActionStarted",
140
+ CloseChatActionCompleted = "CloseChatActionCompleted",
141
+ MinimizeChatActionStarted = "MinimizeChatActionStarted",
142
+ MinimizeChatActionCompleted = "MinimizeChatActionCompleted",
140
143
  NotificationCloseChatButtonClicked = "NotificationCloseChatButtonClicked",
141
144
  NotificationDismissButtonClicked = "NotificationDismissButtonClicked",
142
- DownloadTranscriptButtonClicked = "DownloadTranscriptButtonClicked",
143
- EmailTranscriptButtonClicked = "EmailTranscriptButtonClicked",
145
+ DownloadTranscriptActionStarted = "DownloadTranscriptActionStarted",
146
+ DownloadTranscriptActionCompleted = "DownloadTranscriptActionCompleted",
147
+ DownloadTranscriptActionFailed = "DownloadTranscriptActionFailed",
148
+ EmailTranscriptActionStarted = "EmailTranscriptActionStarted",
149
+ EmailTranscriptActionCompleted = "EmailTranscriptActionCompleted",
150
+ EmailTranscriptActionFailed = "EmailTranscriptActionFailed",
144
151
  EmailTranscriptCancelButtonClicked = "EmailTranscriptCancelButtonClicked",
145
152
  AudioToggleButtonClicked = "AudioToggleButtonClicked",
146
153
  SuppressBotMagicCodeSucceeded = "SuppressBotMagicCodeSucceeded",
@@ -152,7 +159,7 @@ export declare enum TelemetryEvent {
152
159
  GetAuthTokenFailed = "GetAuthTokenFailed",
153
160
  ReceivedNullOrEmptyToken = "ReceivedNullOrEmptyToken",
154
161
  CustomerVoiceResponsePageLoaded = "CustomerVoiceResponsePageLoaded",
155
- CustomerVoiceFormResponseSubmitted = "CustomerVoiceFormResponseSubmitted",
162
+ CustomerVoiceFormResponseSubmitted = "CustomerVoiceFormResponseSubmitCompleted",
156
163
  CustomerVoiceFormResponseError = "CustomerVoiceFormResponseError",
157
164
  BotAuthActivityEmptySasUrl = "BotAuthActivityEmptySasUrl",
158
165
  SetBotAuthProviderFetchConfig = "SetBotAuthProviderFetchConfig",
@@ -181,20 +188,25 @@ export declare enum TelemetryEvent {
181
188
  FacadeChatSDKEvent = "FacadeChatSDKEvent",
182
189
  PreChatSurveyStartChatMethodFailed = "PreChatSurveyStartChatMethodFailed",
183
190
  ChatAlreadyTriggered = "ChatAlreadyTriggered",
184
- StartProactiveChatEventReceived = "StartProactiveChatEventReceived",
191
+ StartProactiveChatEventReceived = "StartProactiveChatEventReceivedCompleted",
185
192
  StartProactiveChatMethodFailed = "StartProactiveChatMethodFailed",
186
193
  ProactiveChatAccepted = "ProactiveChatAccepted",
187
- ProactiveChatRejected = "ProactiveChatRejected",
194
+ ProactiveChatTimeOutCompleted = "ProactiveChatTimeOutCompleted",
188
195
  IncomingProactiveChatScreenLoaded = "IncomingProactiveChatScreenLoaded",
189
196
  ProactiveChatClosed = "ProactiveChatClosed",
190
197
  ReconnectChatContinueConversation = "ReconnectChatContinueConversation",
191
198
  ReconnectChatStartNewConversation = "ReconnectChatStartNewConversation",
192
199
  ReconnectChatMinimize = "ReconnectChatMinimize",
193
- MessageSent = "MessageSent",
194
- MessageReceived = "MessageReceived",
195
- SystemMessageReceived = "SystemMessageReceived",
196
- RehydrateMessageReceived = "RehydrateMessageReceived",
197
- CustomContextReceived = "CustomContextReceived",
200
+ MessageSentCompleted = "MessageSentCompleted",
201
+ MessageReceivedCompleted = "MessageReceivedCompleted",
202
+ MessageLapTrack = "MessageLapTrack",
203
+ BotFirstMessageLapTrack = "BotFirstMessageLapTrack",
204
+ BotFirstMessageLapTrackError = "BotFirstMessageLapTrackError",
205
+ MessageStartLapTrackError = "MessageStartLapTrackError",
206
+ MessageStopLapTrackError = "MessageStopLapTrackError",
207
+ SystemMessageReceivedCompleted = "SystemMessageReceivedCompleted",
208
+ RehydrateMessageReceivedCompleted = "RehydrateMessageReceivedCompleted",
209
+ CustomContextReceived = "CustomContextReceivedCompleted",
198
210
  NetworkDisconnected = "NetworkDisconnected",
199
211
  NetworkReconnected = "NetworkReconnected",
200
212
  LinkModePostChatWorkflowStarted = "LinkModePostChatWorkflowStarted",
@@ -202,16 +214,19 @@ export declare enum TelemetryEvent {
202
214
  PostChatWorkflowFromCustomer = "PostChatWorkflowFromCustomer",
203
215
  PostChatWorkflowFromAgent = "PostChatWorkflowFromAgent",
204
216
  PostChatWorkflowFromBot = "PostChatWorkflowFromBot",
205
- PostChatContextCallSucceed = "PostChatContextCallSucceed",
217
+ PostChatContextCallStarted = "PostChatContextCallStarted",
218
+ PostChatContextCallCompleted = "PostChatContextCallCompleted",
206
219
  PostChatContextCallFailed = "PostChatContextCallFailed",
207
220
  PostChatSurveyLoadingPaneLoaded = "PostChatSurveyLoadingPaneLoaded",
208
221
  PostChatSurveyLoaded = "PostChatSurveyLoaded",
222
+ PostChatSurveyUrlValidationCompleted = "PostChatSurveyUrlValidationCompleted",
223
+ PostChatSurveyUrlValidationFailed = "PostChatSurveyUrlValidationFailed",
209
224
  ChatDisconnectThreadEventReceived = "ChatDisconnectThreadEventReceived",
210
225
  HiddenAdaptiveCardMessageReceived = "HiddenAdaptiveCardMessageReceived",
211
226
  EndingAdapterAfterDisconnectionError = "EndingAdapterAfterDisconnectionError",
212
- NewTokenSuccess = "NewTokenSuccess",
213
- NewTokenFailed = "NewTokenFailed",
214
- NewTokenExpired = "NewTokenExpired",
227
+ NewTokenValidationStarted = "NewTokenValidationStarted",
228
+ NewTokenValidationCompleted = "NewTokenValidationCompleted",
229
+ NewTokenValidationFailed = "NewTokenValidationFailed",
215
230
  TokenEmptyOrSame = "TokenEmptyOrSame",
216
231
  UXFooterStart = "UXFooterStart",
217
232
  UXFooterCompleted = "UXFooterCompleted",
@@ -221,14 +236,14 @@ export declare enum TelemetryEvent {
221
236
  UXLoadingPaneCompleted = "UXLoadingPaneCompleted",
222
237
  UXNotificationPaneStart = "UXNotificationPaneStart",
223
238
  UXNotificationPaneCompleted = "UXNotificationPaneCompleted",
224
- UXOOHPaneStart = "UXOOHPaneStart",
225
- UXOOHPaneCompleted = "UXOOHPaneCompleted",
239
+ UXOutOfOfficeHoursPaneStart = "UXOutOfOfficeHoursPaneStart",
240
+ UXOutOfOfficeHoursPaneCompleted = "UXOutOfOfficeHoursPaneCompleted",
226
241
  UXPostChatLoadingPaneStart = "UXPostChatLoadingPaneStart",
227
242
  UXPostChatLoadingPaneCompleted = "UXPostChatLoadingPaneCompleted",
228
243
  UXPrechatPaneStart = "UXPrechatPaneStart",
229
244
  UXPrechatPaneCompleted = "UXPrechatPaneCompleted",
230
245
  UXProactiveChatPaneStart = "UXProactiveChatPaneStart",
231
- UXProactiveChatCompleted = "UXProactiveChatCompleted",
246
+ UXProactiveChatPaneCompleted = "UXProactiveChatPaneCompleted",
232
247
  UXReconnectChatPaneStart = "UXReconnectChatPaneStart",
233
248
  UXReconnectChatCompleted = "UXReconnectChatCompleted",
234
249
  UXStartChatErrorPaneStart = "UXStartChatErrorPaneStart",
@@ -237,12 +252,14 @@ export declare enum TelemetryEvent {
237
252
  UXEmailTranscriptPaneCompleted = "UXEmailTranscriptPaneCompleted",
238
253
  UXWebchatContainerStart = "UXWebchatContainerStart",
239
254
  UXWebchatContainerCompleted = "UXWebchatContainerCompleted",
240
- UXLCWChatButtonStart = "UXLCWChatButtonStart",
241
- UXLCWChatButtonCompleted = "UXLCWChatButtonCompleted",
255
+ UXLCWChatButtonLoadingStart = "UXLCWChatButtonLoadingStart",
256
+ UXLCWChatButtonLoadingCompleted = "UXLCWChatButtonLoadingCompleted",
242
257
  UXConfirmationPaneStart = "UXConfirmationPaneStart",
243
258
  UXConfirmationPaneCompleted = "UXConfirmationPaneCompleted",
244
- UXLivechatwidgetStart = "UXLivechatwidgetStart",
245
- UXLivechatwidgetCompleted = "UXLivechatwidgetCompleted"
259
+ UXLiveChatWidgetStart = "UXLiveChatWidgetStart",
260
+ UXLiveChatWidgetCompleted = "UXLiveChatWidgetCompleted",
261
+ AppInsightsInitialized = "AppInsightsInitialized",
262
+ AppInsightsInitFailed = "AppInsightsInitFailed"
246
263
  }
247
264
  export interface TelemetryInput {
248
265
  scenarioType: ScenarioType;
@@ -32,6 +32,7 @@ export declare class TelemetryHelper {
32
32
  static addWidgetDataToTelemetry(telemetryConfig: ITelemetryConfig, telemetryInternalData: IInternalTelemetryData): IInternalTelemetryData;
33
33
  static addSessionDataToTelemetry(chatSession: LiveChatContext, telemetryInternalData: IInternalTelemetryData): IInternalTelemetryData;
34
34
  static addConversationDataToTelemetry(liveWorkItem: LiveWorkItemDetails, telemetryInternalData: IInternalTelemetryData): IInternalTelemetryData;
35
+ private static postTelemetryEvent;
35
36
  static logCallingEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper, callId?: string) => void;
36
37
  static logLoadingEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
37
38
  static logUIEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
@@ -40,4 +41,8 @@ export declare class TelemetryHelper {
40
41
  static logConfigDataEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
41
42
  static logWebChatEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
42
43
  static logFacadeChatSDKEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
44
+ static logLoadingEventToAllTelemetry: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
45
+ static logActionEventToAllTelemetry: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
46
+ static logFacadeChatSDKEventToAllTelemetry: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
47
+ static logSDKEventToAllTelemetry: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
43
48
  }
@@ -0,0 +1,2 @@
1
+ import { IAppInsightsConfig } from "../interfaces/IAppInsightsConfig";
2
+ export declare const defaultAppInsightsConfig: IAppInsightsConfig;
@@ -0,0 +1,4 @@
1
+ export interface IAppInsightsConfig {
2
+ appInsightsDisabled?: boolean;
3
+ appInsightsKey?: string;
4
+ }
@@ -1,5 +1,6 @@
1
1
  import { LogLevel, TelemetryInput } from "../TelemetryConstants";
2
2
  export interface IChatSDKLogger {
3
+ type?: string;
3
4
  log: (logLevel: LogLevel, telemetryInput: TelemetryInput) => void;
4
5
  dispose: () => void;
5
6
  }
@@ -1,8 +1,10 @@
1
+ import { IAppInsightsConfig } from "./IAppInsightsConfig";
1
2
  import { IAriaConfigurations } from "./IAriaConfigurations";
2
3
  import { ITelemetryConfig } from "./ITelemetryConfig";
3
4
  export interface IInternalTelemetryData {
4
5
  telemetryConfig?: ITelemetryConfig;
5
6
  ariaConfig?: IAriaConfigurations;
7
+ appInsightsConfig?: IAppInsightsConfig;
6
8
  widgetId?: string;
7
9
  chatId?: string;
8
10
  conversationId?: string;
@@ -0,0 +1,5 @@
1
+ import { IChatSDKLogger } from "../interfaces/IChatSDKLogger";
2
+ export declare const appInsightsLogger: (appInsightsKey: string, disableCookiesUsage: boolean) => IChatSDKLogger;
3
+ export interface ICustomProperties {
4
+ [key: string]: any;
5
+ }
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { ICallingContainerStatefulProps } from "./ICallingContainerStatefulProps";
2
- export declare const CallingContainerStateful: (props: ICallingContainerStatefulProps) => JSX.Element;
3
+ export declare const CallingContainerStateful: (props: ICallingContainerStatefulProps) => React.JSX.Element;
3
4
  export default CallingContainerStateful;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { IChatButtonStatefulParams } from "./interfaces/IChatButtonStatefulParams";
2
- export declare const ChatButtonStateful: (props: IChatButtonStatefulParams) => JSX.Element;
3
+ export declare const ChatButtonStateful: (props: IChatButtonStatefulParams) => React.JSX.Element;
3
4
  export default ChatButtonStateful;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { IConfirmationPaneStatefulParams } from "./interfaces/IConfirmationPaneStatefulParams";
2
- export declare const ConfirmationPaneStateful: (props: IConfirmationPaneStatefulParams) => JSX.Element;
3
+ export declare const ConfirmationPaneStateful: (props: IConfirmationPaneStatefulParams) => React.JSX.Element;
3
4
  export default ConfirmationPaneStateful;
@@ -1,5 +1,6 @@
1
+ import React from "react";
1
2
  interface DimLayerInterface {
2
3
  brightness: string;
3
4
  }
4
- export declare const DimLayer: ({ brightness }: DimLayerInterface) => JSX.Element;
5
+ export declare const DimLayer: ({ brightness }: DimLayerInterface) => React.JSX.Element;
5
6
  export {};
@@ -1,9 +1,9 @@
1
- import { ReactNode } from "react";
1
+ import React, { ReactNode } from "react";
2
2
  interface IDraggableChatWidgetInternalProps {
3
3
  disabled?: boolean;
4
4
  channel?: string;
5
5
  elementId: string;
6
6
  children: ReactNode;
7
7
  }
8
- declare const DraggableChatWidget: (props: IDraggableChatWidgetInternalProps) => JSX.Element;
8
+ declare const DraggableChatWidget: (props: IDraggableChatWidgetInternalProps) => React.JSX.Element;
9
9
  export default DraggableChatWidget;
@@ -1,4 +1,4 @@
1
- import { ReactNode } from "react";
1
+ import React, { ReactNode } from "react";
2
2
  interface IDraggableEventEmitterProps {
3
3
  /**
4
4
  * Unique channel name to send/receive draggable events to prevent event collisions
@@ -23,5 +23,5 @@ interface IDraggableEventEmitterProps {
23
23
  * @param props IDraggableEventEmitterProps
24
24
  * @returns
25
25
  */
26
- declare const DraggableEventEmitter: (props: IDraggableEventEmitterProps) => JSX.Element;
26
+ declare const DraggableEventEmitter: (props: IDraggableEventEmitterProps) => React.JSX.Element;
27
27
  export default DraggableEventEmitter;
@@ -1,4 +1,4 @@
1
- import { ReactNode } from "react";
1
+ import React, { ReactNode } from "react";
2
2
  import IDraggableEvent from "./IDraggableEvent";
3
3
  interface IDraggableEventReceiverProps {
4
4
  /**
@@ -23,5 +23,5 @@ interface IDraggableEventReceiverProps {
23
23
  * @param props IDraggableEventReceiverProps
24
24
  * @returns
25
25
  */
26
- declare const DraggableEventReceiver: (props: IDraggableEventReceiverProps) => JSX.Element;
26
+ declare const DraggableEventReceiver: (props: IDraggableEventReceiverProps) => React.JSX.Element;
27
27
  export default DraggableEventReceiver;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { IEmailTranscriptPaneProps } from "./interfaces/IEmailTranscriptPaneProps";
2
- export declare const EmailTranscriptPaneStateful: (props: IEmailTranscriptPaneProps) => JSX.Element;
3
+ export declare const EmailTranscriptPaneStateful: (props: IEmailTranscriptPaneProps) => React.JSX.Element;
3
4
  export default EmailTranscriptPaneStateful;
@@ -1,2 +1,3 @@
1
- export declare const FooterStateful: (props: any) => JSX.Element;
1
+ import React from "react";
2
+ export declare const FooterStateful: (props: any) => React.JSX.Element;
2
3
  export default FooterStateful;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { IAudioNotificationStatefulParams } from "./interfaces/IAudioNotificationStatefulParams";
2
- export declare const AudioNotificationStateful: (props: IAudioNotificationStatefulParams) => JSX.Element;
3
+ export declare const AudioNotificationStateful: (props: IAudioNotificationStatefulParams) => React.JSX.Element;
3
4
  export default AudioNotificationStateful;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { IHeaderStatefulParams } from "./interfaces/IHeaderStatefulParams";
2
- export declare const HeaderStateful: (props: IHeaderStatefulParams) => JSX.Element;
3
+ export declare const HeaderStateful: (props: IHeaderStatefulParams) => React.JSX.Element;
3
4
  export default HeaderStateful;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { ILiveChatWidgetProps } from "./interfaces/ILiveChatWidgetProps";
2
- export declare const LiveChatWidget: (props: ILiveChatWidgetProps) => JSX.Element;
3
+ export declare const LiveChatWidget: (props: ILiveChatWidgetProps) => React.JSX.Element;
3
4
  export default LiveChatWidget;
@@ -1,3 +1,4 @@
1
1
  import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
2
2
  import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
3
- export declare const createFooter: (props: ILiveChatWidgetProps, state: ILiveChatWidgetContext) => {};
3
+ import React from "react";
4
+ export declare const createFooter: (props: ILiveChatWidgetProps, state: ILiveChatWidgetContext) => string | number | true | Iterable<React.ReactNode> | React.JSX.Element;
@@ -27,6 +27,7 @@ import { IStartChatErrorPaneProps } from "../../startchaterrorpanestateful/inter
27
27
  import { ITelemetryConfig } from "../../../common/telemetry/interfaces/ITelemetryConfig";
28
28
  import { IWebChatContainerStatefulProps } from "../../webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps";
29
29
  import { OmnichannelChatSDK } from "@microsoft/omnichannel-chat-sdk";
30
+ import { IAppInsightsConfig } from "../../../common/telemetry/interfaces/IAppInsightsConfig";
30
31
  export interface ILiveChatWidgetProps {
31
32
  audioNotificationProps?: IAudioNotificationProps;
32
33
  callingContainerProps?: ICallingContainerProps;
@@ -65,4 +66,5 @@ export interface ILiveChatWidgetProps {
65
66
  draggableChatWidgetProps?: IDraggableChatWidgetProps;
66
67
  mock?: IMockProps;
67
68
  featureConfigProps?: IFeatureConfigProps;
69
+ appInsightsConfig?: IAppInsightsConfig;
68
70
  }
@@ -1,2 +1,3 @@
1
- export declare const LoadingPaneStateful: (props: any) => JSX.Element;
1
+ import React from "react";
2
+ export declare const LoadingPaneStateful: (props: any) => React.JSX.Element;
2
3
  export default LoadingPaneStateful;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { INotificationPaneStatefulProps } from "./interfaces/INotificationPaneStatefulProps";
2
- export declare const NotificationPaneStateful: (props: INotificationPaneStatefulProps) => JSX.Element;
3
+ export declare const NotificationPaneStateful: (props: INotificationPaneStatefulProps) => React.JSX.Element;
3
4
  export default NotificationPaneStateful;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { IOOOHPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/outofofficehourspane/interfaces/IOOOHPaneProps";
2
- export declare const OutOfOfficeHoursPaneStateful: (props: IOOOHPaneProps) => JSX.Element;
3
+ export declare const OutOfOfficeHoursPaneStateful: (props: IOOOHPaneProps) => React.JSX.Element;
3
4
  export default OutOfOfficeHoursPaneStateful;