@microsoft/omnichannel-chat-widget 1.8.3-main.ec1328d → 1.8.4-main.1bfa518
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -0
- package/lib/cjs/common/Constants.js +9 -0
- package/lib/cjs/common/facades/FacadeChatSDK.js +6 -0
- package/lib/cjs/common/telemetry/AppInsightsEvents.js +14 -9
- package/lib/cjs/common/telemetry/TelemetryConstants.js +49 -2
- package/lib/cjs/common/telemetry/TelemetryManager.js +10 -7
- package/lib/cjs/common/telemetry/loggers/appInsightsLogger.js +29 -13
- package/lib/cjs/common/utils/SecureEventBus.js +307 -0
- package/lib/cjs/common/utils/dispatchCustomEvent.js +25 -0
- package/lib/cjs/common/utils.js +14 -1
- package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +16 -4
- package/lib/cjs/components/citationpanestateful/CitationDim.js +29 -0
- package/lib/cjs/components/citationpanestateful/CitationPaneStateful.js +218 -0
- package/lib/cjs/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.js +70 -0
- package/lib/cjs/components/confirmationpanestateful/interfaces/IConfirmationPaneLocalizedTexts.js +1 -0
- package/lib/cjs/components/headerstateful/HeaderStateful.js +8 -2
- package/lib/cjs/components/livechatwidget/LiveChatWidget.js +4 -4
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/AddActivitySubscriber.js +127 -0
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +4 -5
- package/lib/cjs/components/livechatwidget/common/ChatWidgetEvents.js +15 -0
- package/lib/cjs/components/livechatwidget/common/PersistentConversationHandler.js +290 -0
- package/lib/cjs/components/livechatwidget/common/createAdapter.js +2 -0
- package/lib/cjs/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.js +17 -0
- package/lib/cjs/components/livechatwidget/common/endChat.js +54 -12
- package/lib/cjs/components/livechatwidget/common/getMockChatSDKIfApplicable.js +4 -3
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +16 -7
- package/lib/cjs/components/livechatwidget/common/liveChatConfigUtils.js +36 -4
- package/lib/cjs/components/livechatwidget/common/overridePropsOnMockIfApplicable.js +2 -1
- package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +3 -0
- package/lib/cjs/components/livechatwidget/common/renderSurveyHelpers.js +2 -2
- package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +3 -3
- package/lib/cjs/components/livechatwidget/common/startChat.js +10 -5
- package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.js +24 -4
- package/lib/cjs/components/livechatwidget/interfaces/IMockProps.js +8 -2
- package/lib/cjs/components/livechatwidget/interfaces/IPersistentChatHistoryProps.js +1 -0
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +152 -33
- package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +37 -8
- package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +12 -3
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +135 -26
- package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatAdapter.js +43 -14
- package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatSDK.js +6 -1
- package/lib/cjs/components/webchatcontainerstateful/common/activities/botActivity.js +14 -0
- package/lib/cjs/components/webchatcontainerstateful/common/activities/conversationDividerActivity.js +17 -0
- package/lib/cjs/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +103 -0
- package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +3 -1
- package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +36 -2
- package/lib/cjs/components/webchatcontainerstateful/common/utils/fontUtils.js +28 -0
- package/lib/cjs/components/webchatcontainerstateful/hooks/usePersistentChatHistory.js +57 -0
- package/lib/cjs/components/webchatcontainerstateful/interfaces/ICitation.js +1 -0
- package/lib/cjs/components/webchatcontainerstateful/interfaces/IExtendedChatConffig.js +1 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +121 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/Constants.js +10 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.js +47 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +1058 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LoadInlineBannerActivity.js +34 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +50 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +16 -2
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultInLineBannerStyle.js +20 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +2 -2
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/HistoryMessageTimestamp.js +59 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +5 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +2 -2
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +102 -30
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +29 -7
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.js +2 -2
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +47 -45
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +9 -1
- package/lib/cjs/contexts/createReducer.js +30 -0
- package/lib/cjs/firstresponselatency/FirstMessageTrackerFromBot.js +3 -2
- package/lib/cjs/firstresponselatency/FirstResponseLatencyTracker.js +6 -2
- package/lib/cjs/index.js +9 -1
- package/lib/cjs/plugins/newMessageEventHandler.js +4 -1
- package/lib/esm/common/Constants.js +9 -0
- package/lib/esm/common/facades/FacadeChatSDK.js +6 -0
- package/lib/esm/common/telemetry/AppInsightsEvents.js +14 -9
- package/lib/esm/common/telemetry/TelemetryConstants.js +47 -1
- package/lib/esm/common/telemetry/TelemetryManager.js +10 -7
- package/lib/esm/common/telemetry/loggers/appInsightsLogger.js +30 -14
- package/lib/esm/common/utils/SecureEventBus.js +328 -0
- package/lib/esm/common/utils/dispatchCustomEvent.js +18 -0
- package/lib/esm/common/utils.js +11 -0
- package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +17 -5
- package/lib/esm/components/citationpanestateful/CitationDim.js +20 -0
- package/lib/esm/components/citationpanestateful/CitationPaneStateful.js +207 -0
- package/lib/esm/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.js +61 -0
- package/lib/esm/components/confirmationpanestateful/interfaces/IConfirmationPaneLocalizedTexts.js +1 -0
- package/lib/esm/components/headerstateful/HeaderStateful.js +9 -3
- package/lib/esm/components/livechatwidget/LiveChatWidget.js +4 -4
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/AddActivitySubscriber.js +120 -0
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +4 -5
- package/lib/esm/components/livechatwidget/common/ChatWidgetEvents.js +8 -0
- package/lib/esm/components/livechatwidget/common/PersistentConversationHandler.js +283 -0
- package/lib/esm/components/livechatwidget/common/createAdapter.js +2 -0
- package/lib/esm/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.js +10 -0
- package/lib/esm/components/livechatwidget/common/endChat.js +55 -13
- package/lib/esm/components/livechatwidget/common/getMockChatSDKIfApplicable.js +4 -3
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +16 -7
- package/lib/esm/components/livechatwidget/common/liveChatConfigUtils.js +33 -2
- package/lib/esm/components/livechatwidget/common/overridePropsOnMockIfApplicable.js +2 -1
- package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +3 -0
- package/lib/esm/components/livechatwidget/common/renderSurveyHelpers.js +2 -2
- package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +3 -3
- package/lib/esm/components/livechatwidget/common/startChat.js +12 -7
- package/lib/esm/components/livechatwidget/common/startChatErrorHandler.js +23 -4
- package/lib/esm/components/livechatwidget/interfaces/IMockProps.js +3 -3
- package/lib/esm/components/livechatwidget/interfaces/IPersistentChatHistoryProps.js +1 -0
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +153 -34
- package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +39 -10
- package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +13 -4
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +135 -27
- package/lib/esm/components/webchatcontainerstateful/common/DesignerChatAdapter.js +43 -14
- package/lib/esm/components/webchatcontainerstateful/common/DesignerChatSDK.js +6 -1
- package/lib/esm/components/webchatcontainerstateful/common/activities/botActivity.js +7 -0
- package/lib/esm/components/webchatcontainerstateful/common/activities/conversationDividerActivity.js +9 -0
- package/lib/esm/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +96 -0
- package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +3 -1
- package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +2 -2
- package/lib/esm/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +32 -0
- package/lib/esm/components/webchatcontainerstateful/common/utils/fontUtils.js +21 -0
- package/lib/esm/components/webchatcontainerstateful/hooks/usePersistentChatHistory.js +49 -0
- package/lib/esm/components/webchatcontainerstateful/interfaces/ICitation.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/interfaces/IExtendedChatConffig.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +114 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/Constants.js +3 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.js +39 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +1080 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LoadInlineBannerActivity.js +25 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +48 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +13 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultInLineBannerStyle.js +13 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/HistoryMessageTimestamp.js +52 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +3 -2
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +103 -30
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +29 -7
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.js +2 -2
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +47 -45
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +9 -1
- package/lib/esm/contexts/createReducer.js +30 -0
- package/lib/esm/firstresponselatency/FirstMessageTrackerFromBot.js +3 -2
- package/lib/esm/firstresponselatency/FirstResponseLatencyTracker.js +6 -2
- package/lib/esm/index.js +1 -0
- package/lib/esm/plugins/newMessageEventHandler.js +4 -1
- package/lib/types/common/Constants.d.ts +8 -0
- package/lib/types/common/facades/FacadeChatSDK.d.ts +3 -1
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +44 -2
- package/lib/types/common/telemetry/interfaces/IInternalTelemetryData.d.ts +1 -0
- package/lib/types/common/utils/SecureEventBus.d.ts +159 -0
- package/lib/types/common/utils/dispatchCustomEvent.d.ts +2 -0
- package/lib/types/common/utils.d.ts +9 -1
- package/lib/types/components/citationpanestateful/CitationDim.d.ts +5 -0
- package/lib/types/components/citationpanestateful/CitationPaneStateful.d.ts +4 -0
- package/lib/types/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.d.ts +11 -0
- package/lib/types/components/citationpanestateful/interfaces/ICitationPaneStatefulProps.d.ts +19 -0
- package/lib/types/components/confirmationpanestateful/common/defaultProps/defaultConfirmationPaneLocalizedTexts.d.ts +1 -1
- package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulProps.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/AddActivitySubscriber.d.ts +45 -0
- package/lib/types/components/livechatwidget/common/ChatWidgetEvents.d.ts +7 -0
- package/lib/types/components/livechatwidget/common/PersistentConversationHandler.d.ts +28 -0
- package/lib/types/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.d.ts +2 -0
- package/lib/types/components/livechatwidget/common/getMockChatSDKIfApplicable.d.ts +2 -1
- package/lib/types/components/livechatwidget/common/liveChatConfigUtils.d.ts +11 -0
- package/lib/types/components/livechatwidget/common/startChatErrorHandler.d.ts +1 -0
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +5 -1
- package/lib/types/components/livechatwidget/interfaces/IMockProps.d.ts +5 -3
- package/lib/types/components/livechatwidget/interfaces/IPersistentChatHistoryProps.d.ts +11 -0
- package/lib/types/components/webchatcontainerstateful/common/DesignerChatAdapter.d.ts +4 -2
- package/lib/types/components/webchatcontainerstateful/common/DesignerChatSDK.d.ts +5 -0
- package/lib/types/components/webchatcontainerstateful/common/activities/botActivity.d.ts +7 -0
- package/lib/types/components/webchatcontainerstateful/common/activities/conversationDividerActivity.d.ts +10 -0
- package/lib/types/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/common/utils/chatAdapterUtils.d.ts +6 -1
- package/lib/types/components/webchatcontainerstateful/common/utils/fontUtils.d.ts +10 -0
- package/lib/types/components/webchatcontainerstateful/hooks/usePersistentChatHistory.d.ts +4 -0
- package/lib/types/components/webchatcontainerstateful/interfaces/ICitation.d.ts +12 -0
- package/lib/types/components/webchatcontainerstateful/interfaces/IExtendedChatConffig.d.ts +15 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.d.ts +6 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/Constants.d.ts +3 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.d.ts +4 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.d.ts +326 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LoadInlineBannerActivity.d.ts +8 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.d.ts +1 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultInLineBannerStyle.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/HistoryMessageTimestamp.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.d.ts +3 -4
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.d.ts +2 -2
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +2 -0
- package/lib/types/contexts/common/ILiveChatWidgetLocalizedTexts.d.ts +6 -0
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +47 -45
- package/lib/types/index.d.ts +1 -0
- package/package.json +3 -3
- /package/lib/cjs/components/{confirmationpanestateful/interfaces/IConfirmationPaneLocalizedText.js → citationpanestateful/interfaces/ICitationPaneStatefulProps.js} +0 -0
- /package/lib/esm/components/{confirmationpanestateful/interfaces/IConfirmationPaneLocalizedText.js → citationpanestateful/interfaces/ICitationPaneStatefulProps.js} +0 -0
- /package/lib/types/components/confirmationpanestateful/interfaces/{IConfirmationPaneLocalizedText.d.ts → IConfirmationPaneLocalizedTexts.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -268,6 +268,33 @@ const customizedFooterProp: IFooterProps = {
|
|
|
268
268
|
setOnCustomEvent((event) => console.log(event));
|
|
269
269
|
```
|
|
270
270
|
|
|
271
|
+
#### Trigger initiateEndChat event
|
|
272
|
+
Customer can trigger the initiateEndChat event via BroadcastService to end a chat session.
|
|
273
|
+
When needed, the payload below could be triggered:
|
|
274
|
+
```js
|
|
275
|
+
const endChatEvent = {
|
|
276
|
+
eventName: "InitiateEndChat",
|
|
277
|
+
payload: {
|
|
278
|
+
skipSessionCloseForPersistentChat: true
|
|
279
|
+
} //optional payload
|
|
280
|
+
};
|
|
281
|
+
BroadcastService.postMessage(endChatEvent);
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
The payload of the event is optional, only needed when force closing of a persistent chat session is not required.
|
|
285
|
+
When chat widget receives the event without any payload, it will:
|
|
286
|
+
1. set the widget to closed state, the widget panel will be minimized. Post chat survey will not be displayed.
|
|
287
|
+
2. trigger a sessionclose service network request to OmniChannel services.
|
|
288
|
+
|
|
289
|
+
If skipSessionCloseForPersistentChat is set to true. The session close network request will not be triggered, instead, if postChat survey is available, post chat survey will be displayed.
|
|
290
|
+
|
|
291
|
+
After successfully processed initiateEndChat event. The CloseChat event is broadcasted.
|
|
292
|
+
```js
|
|
293
|
+
BroadcastService.getMessageByEventName("CloseChat").subscribe(async (msg) => {
|
|
294
|
+
console.log("close chat received: ", msg);
|
|
295
|
+
//more actions to unmount component and resources
|
|
296
|
+
})
|
|
297
|
+
```
|
|
271
298
|
## See Also
|
|
272
299
|
|
|
273
300
|
[Customizations Dev Guide](https://github.com/microsoft/omnichannel-chat-widget/blob/main/docs/customizations/getstarted.md)\
|
|
@@ -45,6 +45,10 @@ _defineProperty(Constants, "botParticipantTypeTag", "Bot");
|
|
|
45
45
|
_defineProperty(Constants, "channelIdKey", "ChannelId-");
|
|
46
46
|
_defineProperty(Constants, "ChannelId", "lcw");
|
|
47
47
|
_defineProperty(Constants, "CustomerTag", "FromCustomer");
|
|
48
|
+
// LCW only tags (Only applicable on client-side for additional processing, not recognized by service)
|
|
49
|
+
_defineProperty(Constants, "persistentChatHistoryMessageTag", "PersistentChatHistory");
|
|
50
|
+
_defineProperty(Constants, "persistentChatHistoryMessagePullTriggerTag", "PersistentChatHistoryMessagePullTrigger");
|
|
51
|
+
_defineProperty(Constants, "conversationDividerTag", "ConversationDivider");
|
|
48
52
|
// gifUploadMiddleware
|
|
49
53
|
_defineProperty(Constants, "GifContentType", "image/gif");
|
|
50
54
|
// htmlPlayerMiddleware
|
|
@@ -64,6 +68,7 @@ _defineProperty(Constants, "queuePositionMessageTag", "queueposition");
|
|
|
64
68
|
_defineProperty(Constants, "averageWaitTimeMessageTag", "averagewaittime");
|
|
65
69
|
_defineProperty(Constants, "message", "message");
|
|
66
70
|
_defineProperty(Constants, "hiddenTag", "Hidden");
|
|
71
|
+
_defineProperty(Constants, "typing", "typing");
|
|
67
72
|
// messageTimestampMiddleware
|
|
68
73
|
_defineProperty(Constants, "prefixTimestampTag", "ServerMessageTimestamp_");
|
|
69
74
|
_defineProperty(Constants, "acsChannel", "ACS_CHANNEL");
|
|
@@ -138,6 +143,7 @@ _defineProperty(Constants, "customEventName", "customEventName");
|
|
|
138
143
|
_defineProperty(Constants, "customEventValue", "customEventValue");
|
|
139
144
|
_defineProperty(Constants, "Hidden", "Hidden");
|
|
140
145
|
_defineProperty(Constants, "EndConversationDueToOverflow", "endconversationduetooverflow");
|
|
146
|
+
_defineProperty(Constants, "SkipSessionCloseForPersistentChatFlag", "skipSessionCloseForPersistentChat");
|
|
141
147
|
const Regex = (_class = /*#__PURE__*/_createClass(function Regex() {
|
|
142
148
|
_classCallCheck(this, Regex);
|
|
143
149
|
}), _defineProperty(_class, "EmailRegex", "^(?:[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\")@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?)*|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\])$"), _class);
|
|
@@ -196,6 +202,8 @@ _defineProperty(HtmlAttributeNames, "adaptiveCardClassName", "ac-adaptiveCard");
|
|
|
196
202
|
_defineProperty(HtmlAttributeNames, "adaptiveCardTextBlockClassName", "ac-textBlock");
|
|
197
203
|
_defineProperty(HtmlAttributeNames, "adaptiveCardToggleInputClassName", "ac-toggleInput");
|
|
198
204
|
_defineProperty(HtmlAttributeNames, "adaptiveCardActionSetClassName", "ac-actionSet");
|
|
205
|
+
_defineProperty(HtmlAttributeNames, "ocwCitationPaneClassName", "ocw-citation-pane");
|
|
206
|
+
_defineProperty(HtmlAttributeNames, "ocwCitationPaneTitle", "Citation");
|
|
199
207
|
let WebChatMiddlewareConstants = /*#__PURE__*/_createClass(function WebChatMiddlewareConstants() {
|
|
200
208
|
_classCallCheck(this, WebChatMiddlewareConstants);
|
|
201
209
|
});
|
|
@@ -371,6 +379,7 @@ _defineProperty(PrepareEndChatDescriptionConstants, "ConversationEndedBy", "Conv
|
|
|
371
379
|
_defineProperty(PrepareEndChatDescriptionConstants, "PrepareEndChatError", "There's an error while preparing to end chat. Closing chat widget.");
|
|
372
380
|
_defineProperty(PrepareEndChatDescriptionConstants, "WidgetLoadFailedAfterSessionInit", "SessionInit was successful, but widget load failed. Ending chat to avoid ghost chats in OC.");
|
|
373
381
|
_defineProperty(PrepareEndChatDescriptionConstants, "InitiateEndChatReceived", "Received InitiateEndChat BroadcastEvent while conversation state is not Active. Ending chat.");
|
|
382
|
+
_defineProperty(PrepareEndChatDescriptionConstants, "InitiateEndChatReceivedActiveChat", "Received InitiateEndChat BroadcastEvent while conversation state is Active. Updating conversation states.");
|
|
374
383
|
_defineProperty(PrepareEndChatDescriptionConstants, "EndChatReceivedFromOtherTabs", "Received EndChat BroadcastEvent from other tabs. Closing this chat.");
|
|
375
384
|
_defineProperty(PrepareEndChatDescriptionConstants, "CustomerCloseChatOnFailureOrPostChat", "Customer is trying to close chat widget on start chat failure or post chat pane.");
|
|
376
385
|
_defineProperty(PrepareEndChatDescriptionConstants, "CustomerCloseInactiveChat", "Chat was Inactive and customer is trying to close chat widget or refreshing the page.");
|
|
@@ -487,6 +487,12 @@ let FacadeChatSDK = /*#__PURE__*/function () {
|
|
|
487
487
|
reconnectableChatsParams.authenticatedUserToken = this.token;
|
|
488
488
|
return this.validateAndExecuteCall("getReconnectableChats", () => this.chatSDK.OCClient.getReconnectableChats(reconnectableChatsParams));
|
|
489
489
|
}
|
|
490
|
+
}, {
|
|
491
|
+
key: "fetchPersistentConversationHistory",
|
|
492
|
+
value: async function fetchPersistentConversationHistory() {
|
|
493
|
+
let getPersistentChatHistoryOptionalParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
494
|
+
return this.validateAndExecuteCall("getPersistentChatHistory", () => this.chatSDK.getPersistentChatHistory(getPersistentChatHistoryOptionalParams));
|
|
495
|
+
}
|
|
490
496
|
}]);
|
|
491
497
|
return FacadeChatSDK;
|
|
492
498
|
}();
|
|
@@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.AppInsightsEventMapping = void 0;
|
|
7
7
|
const AppInsightsEventMapping = {
|
|
8
8
|
"LCWChatButtonClicked": "LCWChatButtonActionStarted",
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
9
|
+
"UXLCWChatButtonLoadingStart": "LiveChatWidgetChatButtonLoadingStarted",
|
|
10
|
+
"UXLCWChatButtonLoadingCompleted": "LiveChatWidgetChatButtonLoadingCompleted",
|
|
11
|
+
"UXPrechatPaneStart": "PrechatSurveyStarted",
|
|
12
|
+
"UXPrechatPaneCompleted": "PrechatSurveyCompleted",
|
|
13
|
+
"PrechatSubmitted": "PrechatSurveySubmitCompleted",
|
|
14
14
|
"EndChatEventReceived": "EndChatEventReceivedCompleted",
|
|
15
15
|
"EmailTranscriptSent": "EmailTranscriptActionCompleted",
|
|
16
16
|
"EmailTranscriptFailed": "EmailTranscriptActionFailed",
|
|
@@ -18,14 +18,19 @@ const AppInsightsEventMapping = {
|
|
|
18
18
|
"HeaderMinimizeButtonClicked": "MinimizeChatActionStarted",
|
|
19
19
|
"DownloadTranscriptButtonClicked": "DownloadTranscriptActionStarted",
|
|
20
20
|
"EmailTranscriptButtonClicked": "EmailTranscriptButtonActionStarted",
|
|
21
|
-
"CustomerVoiceFormResponseSubmitted": "CustomerVoiceFormResponseSubmitCompleted",
|
|
22
|
-
"StartProactiveChatEventReceived": "StartProactiveChatEventReceivedCompleted",
|
|
23
21
|
"ProactiveChatRejected": "ProactiveChatTimeOutCompleted",
|
|
24
22
|
"MessageSent": "MessageSentCompleted",
|
|
25
23
|
"MessageReceived": "MessageReceivedCompleted",
|
|
26
24
|
"SystemMessageReceived": "SystemMessageReceivedCompleted",
|
|
27
|
-
"RehydrateMessageReceived": "
|
|
25
|
+
"RehydrateMessageReceived": "ChatHistoryMessageReceivedCompleted",
|
|
28
26
|
"CustomContextReceived": "CustomContextReceivedCompleted",
|
|
29
|
-
"
|
|
27
|
+
"NewTokenValidationStarted": "AuthTokenValidationStarted",
|
|
28
|
+
"NewTokenValidationCompleted": "AuthTokenValidationCompleted",
|
|
29
|
+
"NewTokenValidationFailed": "AuthTokenValidationFailed",
|
|
30
|
+
"UXPostChatPaneStarted": "PostChatSurveyStarted",
|
|
31
|
+
"UXPostChatPaneCompleted": "PostChatSurveyCompleted",
|
|
32
|
+
"WidgetLoadStarted": "ChatSessionInitializationStarted",
|
|
33
|
+
"WidgetLoadComplete": "ChatSessionInitializationCompleted",
|
|
34
|
+
"WidgetLoadFailed": "ChatSessionInitializationFailed"
|
|
30
35
|
};
|
|
31
36
|
exports.AppInsightsEventMapping = AppInsightsEventMapping;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.TelemetryEvent = exports.TelemetryConstants = exports.ScenarioType = exports.LogLevel = exports.BroadcastEvent = void 0;
|
|
6
|
+
exports.TelemetryEvent = exports.TelemetryConstants = exports.ScenarioType = exports.LogLevel = exports.ConversationStage = exports.BroadcastEvent = void 0;
|
|
7
7
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
8
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
9
9
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
@@ -73,10 +73,12 @@ exports.BroadcastEvent = BroadcastEvent;
|
|
|
73
73
|
BroadcastEvent["OnWidgetError"] = "OnWidgetError";
|
|
74
74
|
BroadcastEvent["FMLTrackingCompletedAck"] = "FMLTrackingCompletedAck";
|
|
75
75
|
BroadcastEvent["FMLTrackingCompleted"] = "FMLTrackingCompleted";
|
|
76
|
+
BroadcastEvent["PersistentConversationReset"] = "PersistentConversationReset";
|
|
76
77
|
})(BroadcastEvent || (exports.BroadcastEvent = BroadcastEvent = {}));
|
|
77
78
|
let TelemetryEvent;
|
|
78
79
|
exports.TelemetryEvent = TelemetryEvent;
|
|
79
80
|
(function (TelemetryEvent) {
|
|
81
|
+
TelemetryEvent["FetchPersistentChatHistoryFailed"] = "FetchPersistentChatHistoryFailed";
|
|
80
82
|
TelemetryEvent["CallAdded"] = "CallAdded";
|
|
81
83
|
TelemetryEvent["LocalVideoStreamAdded"] = "LocalVideoStreamAdded";
|
|
82
84
|
TelemetryEvent["LocalVideoStreamRemoved"] = "LocalVideoStreamRemoved";
|
|
@@ -122,6 +124,7 @@ exports.TelemetryEvent = TelemetryEvent;
|
|
|
122
124
|
TelemetryEvent["EndChatFailed"] = "EndChatFailed";
|
|
123
125
|
TelemetryEvent["SettingCustomContext"] = "SettingCustomContext";
|
|
124
126
|
TelemetryEvent["WebChatLoaded"] = "WebChatLoaded";
|
|
127
|
+
TelemetryEvent["PersistentChatHistoryEnabled"] = "PersistentChatHistoryEnabled";
|
|
125
128
|
TelemetryEvent["LCWChatButtonActionCompleted"] = "LCWChatButtonActionCompleted";
|
|
126
129
|
TelemetryEvent["LCWChatButtonClicked"] = "LCWChatButtonClicked";
|
|
127
130
|
TelemetryEvent["LCWChatButtonShow"] = "LCWChatButtonShow";
|
|
@@ -154,6 +157,7 @@ exports.TelemetryEvent = TelemetryEvent;
|
|
|
154
157
|
TelemetryEvent["EmailTranscriptLoaded"] = "EmailTranscriptLoaded";
|
|
155
158
|
TelemetryEvent["OutOfOfficePaneLoaded"] = "OutOfOfficePaneLoaded";
|
|
156
159
|
TelemetryEvent["ConfirmationPaneLoaded"] = "ConfirmationPaneLoaded";
|
|
160
|
+
TelemetryEvent["CitationPaneLoaded"] = "CitationPaneLoaded";
|
|
157
161
|
TelemetryEvent["ProactiveChatPaneLoaded"] = "ProactiveChatPaneLoaded";
|
|
158
162
|
TelemetryEvent["ReconnectChatPaneLoaded"] = "ReconnectChatPaneLoaded";
|
|
159
163
|
TelemetryEvent["HeaderCloseButtonClicked"] = "HeaderCloseButtonClicked";
|
|
@@ -280,11 +284,44 @@ exports.TelemetryEvent = TelemetryEvent;
|
|
|
280
284
|
TelemetryEvent["UXLCWChatButtonLoadingStart"] = "UXLCWChatButtonLoadingStart";
|
|
281
285
|
TelemetryEvent["UXLCWChatButtonLoadingCompleted"] = "UXLCWChatButtonLoadingCompleted";
|
|
282
286
|
TelemetryEvent["UXConfirmationPaneStart"] = "UXConfirmationPaneStart";
|
|
287
|
+
TelemetryEvent["UXCitationPaneStart"] = "UXCitationPaneStart";
|
|
283
288
|
TelemetryEvent["UXConfirmationPaneCompleted"] = "UXConfirmationPaneCompleted";
|
|
289
|
+
TelemetryEvent["UXCitationPaneCompleted"] = "UXCitationPaneCompleted";
|
|
284
290
|
TelemetryEvent["UXLiveChatWidgetStart"] = "UXLiveChatWidgetStart";
|
|
285
291
|
TelemetryEvent["UXLiveChatWidgetCompleted"] = "UXLiveChatWidgetCompleted";
|
|
292
|
+
TelemetryEvent["UXPostChatPaneStarted"] = "UXPostChatPaneStarted";
|
|
293
|
+
TelemetryEvent["UXPostChatPaneCompleted"] = "UXPostChatPaneCompleted";
|
|
286
294
|
TelemetryEvent["AppInsightsInitialized"] = "AppInsightsInitialized";
|
|
287
295
|
TelemetryEvent["AppInsightsInitFailed"] = "AppInsightsInitFailed";
|
|
296
|
+
TelemetryEvent["ConvertPersistentChatHistoryMessageToActivityFailed"] = "ConvertPersistentChatHistoryMessageToActivityFailed";
|
|
297
|
+
TelemetryEvent["UXLCWPersistentChatHistoryInitialized"] = "UXLCWPersistentChatHistoryInitialized";
|
|
298
|
+
TelemetryEvent["LCWPersistentChatHistoryFetchStarted"] = "LCWPersistentChatHistoryFetchStarted";
|
|
299
|
+
TelemetryEvent["LCWPersistentChatHistoryFetchCompleted"] = "LCWPersistentChatHistoryFetchCompleted";
|
|
300
|
+
TelemetryEvent["LCWPersistentChatHistoryFetchFailed"] = "LCWPersistentChatHistoryFetchFailed";
|
|
301
|
+
TelemetryEvent["LCWWebChatStorePollingStarted"] = "LCWWebChatStorePollingStarted";
|
|
302
|
+
TelemetryEvent["LCWWebChatStoreReady"] = "LCWWebChatStoreReady";
|
|
303
|
+
TelemetryEvent["LCWWebChatConnected"] = "LCWWebChatConnected";
|
|
304
|
+
TelemetryEvent["LCWWebChatDisconnected"] = "LCWWebChatDisconnected";
|
|
305
|
+
TelemetryEvent["LCWWebChatConnectionCheckFailed"] = "LCWWebChatConnectionCheckFailed";
|
|
306
|
+
TelemetryEvent["LCWPersistentConversationHandlerInitialized"] = "LCWPersistentConversationHandlerInitialized";
|
|
307
|
+
TelemetryEvent["LCWPersistentHistoryPullBlocked"] = "LCWPersistentHistoryPullBlocked";
|
|
308
|
+
TelemetryEvent["LCWPersistentHistoryPullCompleted"] = "LCWPersistentHistoryPullCompleted";
|
|
309
|
+
TelemetryEvent["LCWPersistentHistoryReturnedNull"] = "LCWPersistentHistoryReturnedNull";
|
|
310
|
+
TelemetryEvent["LCWLazyLoadInitializationStarted"] = "LCWLazyLoadInitializationStarted";
|
|
311
|
+
TelemetryEvent["LCWLazyLoadContainerNotFound"] = "LCWLazyLoadContainerNotFound";
|
|
312
|
+
TelemetryEvent["LCWLazyLoadInitializationCompleted"] = "LCWLazyLoadInitializationCompleted";
|
|
313
|
+
TelemetryEvent["LCWLazyLoadSessionMetrics"] = "LCWLazyLoadSessionMetrics";
|
|
314
|
+
TelemetryEvent["LCWLazyLoadTargetElementNotFound"] = "LCWLazyLoadTargetElementNotFound";
|
|
315
|
+
TelemetryEvent["LCWLazyLoadScrollFailed"] = "LCWLazyLoadScrollFailed";
|
|
316
|
+
TelemetryEvent["LCWLazyLoadActivityMounted"] = "LCWLazyLoadActivityMounted";
|
|
317
|
+
TelemetryEvent["LCWLazyLoadReset"] = "LCWLazyLoadReset";
|
|
318
|
+
TelemetryEvent["LCWLazyLoadNoMoreHistory"] = "LCWLazyLoadNoMoreHistory";
|
|
319
|
+
TelemetryEvent["LCWLazyLoadHistoryError"] = "LCWLazyLoadHistoryError";
|
|
320
|
+
TelemetryEvent["LCWLazyLoadDestroyed"] = "LCWLazyLoadDestroyed";
|
|
321
|
+
TelemetryEvent["SecureEventBusUnauthorizedDispatch"] = "SecureEventBusUnauthorizedDispatch";
|
|
322
|
+
TelemetryEvent["SecureEventBusListenerError"] = "SecureEventBusListenerError";
|
|
323
|
+
TelemetryEvent["SecureEventBusDispatchError"] = "SecureEventBusDispatchError";
|
|
324
|
+
TelemetryEvent["StartChatComplete"] = "StartChatComplete";
|
|
288
325
|
})(TelemetryEvent || (exports.TelemetryEvent = TelemetryEvent = {}));
|
|
289
326
|
let TelemetryConstants = /*#__PURE__*/function () {
|
|
290
327
|
function TelemetryConstants() {
|
|
@@ -352,6 +389,9 @@ let TelemetryConstants = /*#__PURE__*/function () {
|
|
|
352
389
|
case TelemetryEvent.PostChatWorkflowFromAgent:
|
|
353
390
|
case TelemetryEvent.PostChatWorkflowFromBot:
|
|
354
391
|
case TelemetryEvent.AppStatesException:
|
|
392
|
+
case TelemetryEvent.SecureEventBusUnauthorizedDispatch:
|
|
393
|
+
case TelemetryEvent.SecureEventBusListenerError:
|
|
394
|
+
case TelemetryEvent.SecureEventBusDispatchError:
|
|
355
395
|
return ScenarioType.ACTIONS;
|
|
356
396
|
case TelemetryEvent.StartChatSDKCall:
|
|
357
397
|
case TelemetryEvent.StartChatEventReceived:
|
|
@@ -412,4 +452,11 @@ let TelemetryConstants = /*#__PURE__*/function () {
|
|
|
412
452
|
}]);
|
|
413
453
|
return TelemetryConstants;
|
|
414
454
|
}();
|
|
415
|
-
exports.TelemetryConstants = TelemetryConstants;
|
|
455
|
+
exports.TelemetryConstants = TelemetryConstants;
|
|
456
|
+
let ConversationStage;
|
|
457
|
+
exports.ConversationStage = ConversationStage;
|
|
458
|
+
(function (ConversationStage) {
|
|
459
|
+
ConversationStage["Initialization"] = "Initialization";
|
|
460
|
+
ConversationStage["CSREngagement"] = "CSR Engagement";
|
|
461
|
+
ConversationStage["ConversationEnd"] = "Conversation End";
|
|
462
|
+
})(ConversationStage || (exports.ConversationStage = ConversationStage = {}));
|
|
@@ -50,7 +50,7 @@ const RegisterLoggers = () => {
|
|
|
50
50
|
loggers.push((0, _consoleLogger.consoleLogger)());
|
|
51
51
|
}
|
|
52
52
|
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) {
|
|
53
|
-
var _TelemetryManager$Int11, _TelemetryManager$Int20, _TelemetryManager$Int21, _TelemetryManager$Int22, _TelemetryManager$Int23;
|
|
53
|
+
var _TelemetryManager$Int11, _TelemetryManager$Int20, _TelemetryManager$Int21, _TelemetryManager$Int22, _TelemetryManager$Int23, _TelemetryManager$Int24, _TelemetryManager$Int25, _TelemetryManager$Int26;
|
|
54
54
|
if ((_TelemetryManager$Int11 = TelemetryManager.InternalTelemetryData) !== null && _TelemetryManager$Int11 !== void 0 && _TelemetryManager$Int11.ariaConfig) {
|
|
55
55
|
var _TelemetryManager$Int12, _TelemetryManager$Int13, _TelemetryManager$Int14, _TelemetryManager$Int15, _TelemetryManager$Int16, _TelemetryManager$Int17, _TelemetryManager$Int18, _TelemetryManager$Int19;
|
|
56
56
|
loggers.push((0, _ariaTelemetryLogger.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.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.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.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.defaultAriaConfig.ariaTelemetryApplicationName));
|
|
@@ -61,12 +61,15 @@ const RegisterLoggers = () => {
|
|
|
61
61
|
loggers.push(logger);
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
const chatConfigAppInsightsKey = (_TelemetryManager$Int22 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int22 === void 0 ? void 0 : _TelemetryManager$Int22.chatConfigAppInsightsKey;
|
|
65
|
+
const appInsightsKeyFromUser = (_TelemetryManager$Int23 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int23 === void 0 ? void 0 : (_TelemetryManager$Int24 = _TelemetryManager$Int23.appInsightsConfig) === null || _TelemetryManager$Int24 === void 0 ? void 0 : _TelemetryManager$Int24.appInsightsKey;
|
|
66
|
+
// when chatConfig has AppInsightsInstrumentationKey
|
|
67
|
+
if (chatConfigAppInsightsKey) {
|
|
68
|
+
loggers.push((0, _appInsightsLogger.appInsightsLogger)(chatConfigAppInsightsKey));
|
|
69
|
+
}
|
|
70
|
+
// when key set through appInsightsConfig
|
|
71
|
+
else if (appInsightsKeyFromUser && ((_TelemetryManager$Int25 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int25 === void 0 ? void 0 : (_TelemetryManager$Int26 = _TelemetryManager$Int25.appInsightsConfig) === null || _TelemetryManager$Int26 === void 0 ? void 0 : _TelemetryManager$Int26.appInsightsDisabled) === false) {
|
|
72
|
+
loggers.push((0, _appInsightsLogger.appInsightsLogger)(appInsightsKeyFromUser));
|
|
70
73
|
}
|
|
71
74
|
}
|
|
72
75
|
};
|
|
@@ -14,15 +14,12 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
14
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
15
|
var AllowedKeys;
|
|
16
16
|
(function (AllowedKeys) {
|
|
17
|
-
AllowedKeys["
|
|
18
|
-
AllowedKeys["
|
|
19
|
-
AllowedKeys["
|
|
20
|
-
AllowedKeys["
|
|
17
|
+
AllowedKeys["OrganizationId"] = "powerplatform.analytics.resource.organization.id";
|
|
18
|
+
AllowedKeys["ConversationId"] = "powerplatform.analytics.resource.id";
|
|
19
|
+
AllowedKeys["ElapsedTimeInMilliseconds"] = "Duration";
|
|
20
|
+
AllowedKeys["Description"] = "omnichannel.description";
|
|
21
|
+
AllowedKeys["ChannelId"] = "omnichannel.channel.type";
|
|
21
22
|
AllowedKeys["LCWRuntimeId"] = "ClientSessionId";
|
|
22
|
-
AllowedKeys["ConversationId"] = "LiveWorkItemId";
|
|
23
|
-
AllowedKeys["ChatId"] = "ChatThreadId";
|
|
24
|
-
AllowedKeys["OrganizationId"] = "OrganizationId";
|
|
25
|
-
AllowedKeys["ElapsedTimeInMilliseconds"] = "DurationInMilliseconds";
|
|
26
23
|
})(AllowedKeys || (AllowedKeys = {}));
|
|
27
24
|
let initializationPromise = null;
|
|
28
25
|
const appInsightsLogger = appInsightsKey => {
|
|
@@ -95,11 +92,11 @@ const appInsightsLogger = appInsightsKey => {
|
|
|
95
92
|
if (!_logger) return;
|
|
96
93
|
const eventName = telemetryInput === null || telemetryInput === void 0 ? void 0 : (_telemetryInput$paylo = telemetryInput.payload) === null || _telemetryInput$paylo === void 0 ? void 0 : _telemetryInput$paylo.Event;
|
|
97
94
|
const telemetryInfo = telemetryInput === null || telemetryInput === void 0 ? void 0 : (_telemetryInput$telem = telemetryInput.telemetryInfo) === null || _telemetryInput$telem === void 0 ? void 0 : _telemetryInput$telem.telemetryInfo;
|
|
98
|
-
const eventProperties = setEventProperties(telemetryInfo);
|
|
99
95
|
if (eventName) {
|
|
100
96
|
const trackingEventName = getTrackingEventName(logLevel, eventName);
|
|
101
|
-
|
|
102
|
-
|
|
97
|
+
const eventProperties = setEventProperties(trackingEventName, telemetryInfo);
|
|
98
|
+
_logger.trackTrace({
|
|
99
|
+
message: trackingEventName,
|
|
103
100
|
properties: eventProperties
|
|
104
101
|
});
|
|
105
102
|
}
|
|
@@ -116,17 +113,36 @@ const appInsightsLogger = appInsightsKey => {
|
|
|
116
113
|
};
|
|
117
114
|
|
|
118
115
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
119
|
-
function setEventProperties(telemetryInfo) {
|
|
116
|
+
function setEventProperties(eventName, telemetryInfo) {
|
|
120
117
|
const eventProperties = {};
|
|
121
118
|
if (telemetryInfo) {
|
|
122
119
|
for (const key in AllowedKeys) {
|
|
123
|
-
const finalKey = AllowedKeys[key]; // get renamed keys for LCWRuntimeId, ConversationId
|
|
120
|
+
const finalKey = AllowedKeys[key]; // get renamed keys for LCWRuntimeId, ConversationId
|
|
124
121
|
const value = telemetryInfo[key];
|
|
125
122
|
if (value !== undefined && value !== null && value !== "") {
|
|
126
123
|
eventProperties[finalKey] = value;
|
|
127
124
|
}
|
|
128
125
|
}
|
|
129
126
|
}
|
|
127
|
+
// Include exception details in description for error events
|
|
128
|
+
if (telemetryInfo !== null && telemetryInfo !== void 0 && telemetryInfo.ExceptionDetails) {
|
|
129
|
+
eventProperties[AllowedKeys.Description] = JSON.stringify(telemetryInfo.ExceptionDetails);
|
|
130
|
+
}
|
|
131
|
+
const customProperties = (() => {
|
|
132
|
+
if (!(telemetryInfo !== null && telemetryInfo !== void 0 && telemetryInfo.CustomProperties)) {
|
|
133
|
+
return {};
|
|
134
|
+
}
|
|
135
|
+
try {
|
|
136
|
+
return typeof telemetryInfo.CustomProperties === "string" ? JSON.parse(telemetryInfo.CustomProperties) : telemetryInfo.CustomProperties;
|
|
137
|
+
} catch (error) {
|
|
138
|
+
console.warn("Failed to parse CustomProperties:", error);
|
|
139
|
+
return {};
|
|
140
|
+
}
|
|
141
|
+
})();
|
|
142
|
+
// Additional properties
|
|
143
|
+
eventProperties["ConversationStage"] = customProperties.ConversationStage ?? _TelemetryConstants.ConversationStage.CSREngagement;
|
|
144
|
+
eventProperties["Scenario"] = "Conversation Diagnostics";
|
|
145
|
+
eventProperties["powerplatform.analytics.subscenario"] = eventName.includes(": ") ? eventName.split(": ")[1] : eventName;
|
|
130
146
|
return eventProperties;
|
|
131
147
|
}
|
|
132
148
|
function getTrackingEventName(logLevel, eventName) {
|