@microsoft/omnichannel-chat-widget 1.7.8-main.ab4d3b4 → 1.7.8-main.cf04c1c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/common/Constants.js +67 -20
- package/lib/cjs/common/KeyCodes.js +6 -1
- package/lib/cjs/common/contextDataStore/DataStoreManager.js +6 -1
- package/lib/cjs/common/facades/FacadeChatSDK.js +392 -295
- package/lib/cjs/common/storage/default/defaultCacheManager.js +6 -3
- package/lib/cjs/common/telemetry/AppInsightsEvents.js +31 -0
- package/lib/cjs/common/telemetry/ScenarioMarker.js +66 -0
- package/lib/cjs/common/telemetry/TelemetryConstants.js +153 -131
- package/lib/cjs/common/telemetry/TelemetryHelper.js +281 -250
- package/lib/cjs/common/telemetry/TelemetryManager.js +32 -12
- package/lib/cjs/common/telemetry/defaultConfigs/defaultAppInsightsConfig.js +11 -0
- package/lib/cjs/common/telemetry/interfaces/IAppInsightsConfig.js +1 -0
- package/lib/cjs/common/telemetry/loggers/appInsightsLogger.js +149 -0
- package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +13 -9
- package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +3 -2
- package/lib/cjs/components/footerstateful/FooterStateful.js +11 -6
- package/lib/cjs/components/headerstateful/HeaderStateful.js +18 -6
- package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +32 -19
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +70 -58
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +17 -8
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.js +65 -52
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +31 -18
- package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +14 -6
- package/lib/cjs/components/livechatwidget/common/Deferred.js +14 -6
- package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +0 -5
- package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +3 -1
- package/lib/cjs/components/livechatwidget/common/renderSurveyHelpers.js +6 -3
- package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +7 -2
- package/lib/cjs/components/livechatwidget/common/startChat.js +43 -40
- package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.js +5 -4
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +25 -20
- package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +6 -4
- package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +9 -4
- package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +9 -6
- package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +8 -6
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +7 -1
- package/lib/cjs/components/webchatcontainerstateful/common/DemoChatAdapter.js +88 -65
- package/lib/cjs/components/webchatcontainerstateful/common/DemoChatSDK.js +26 -7
- package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatAdapter.js +49 -26
- package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatSDK.js +57 -35
- package/lib/cjs/components/webchatcontainerstateful/common/mockadapter.js +62 -52
- package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +95 -61
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +6 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +6 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.js +53 -39
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +88 -60
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +5 -6
- package/lib/cjs/controller/componentController.js +3 -2
- package/lib/cjs/firstresponselatency/FirstResponseLatencyTracker.js +138 -116
- package/lib/cjs/plugins/createChatTranscript.js +88 -58
- package/lib/cjs/plugins/newMessageEventHandler.js +4 -4
- package/lib/esm/common/Constants.js +65 -19
- package/lib/esm/common/KeyCodes.js +6 -1
- package/lib/esm/common/contextDataStore/DataStoreManager.js +6 -1
- package/lib/esm/common/facades/FacadeChatSDK.js +392 -295
- package/lib/esm/common/storage/default/defaultCacheManager.js +6 -1
- package/lib/esm/common/telemetry/AppInsightsEvents.js +24 -0
- package/lib/esm/common/telemetry/ScenarioMarker.js +59 -0
- package/lib/esm/common/telemetry/TelemetryConstants.js +153 -131
- package/lib/esm/common/telemetry/TelemetryHelper.js +281 -250
- package/lib/esm/common/telemetry/TelemetryManager.js +32 -12
- package/lib/esm/common/telemetry/defaultConfigs/defaultAppInsightsConfig.js +4 -0
- package/lib/esm/common/telemetry/interfaces/IAppInsightsConfig.js +1 -0
- package/lib/esm/common/telemetry/loggers/appInsightsLogger.js +139 -0
- package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +13 -9
- package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +3 -2
- package/lib/esm/components/footerstateful/FooterStateful.js +11 -6
- package/lib/esm/components/headerstateful/HeaderStateful.js +18 -6
- package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +32 -19
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +70 -58
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +17 -8
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.js +65 -52
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +31 -18
- package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +14 -6
- package/lib/esm/components/livechatwidget/common/Deferred.js +14 -6
- package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +1 -6
- package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +3 -1
- package/lib/esm/components/livechatwidget/common/renderSurveyHelpers.js +6 -3
- package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +7 -2
- package/lib/esm/components/livechatwidget/common/startChat.js +44 -41
- package/lib/esm/components/livechatwidget/common/startChatErrorHandler.js +5 -4
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +25 -20
- package/lib/esm/components/ooohpanestateful/OOOHPaneStateful.js +6 -4
- package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +9 -4
- package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +9 -6
- package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +8 -6
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +7 -1
- package/lib/esm/components/webchatcontainerstateful/common/DemoChatAdapter.js +88 -65
- package/lib/esm/components/webchatcontainerstateful/common/DemoChatSDK.js +26 -7
- package/lib/esm/components/webchatcontainerstateful/common/DesignerChatAdapter.js +49 -26
- package/lib/esm/components/webchatcontainerstateful/common/DesignerChatSDK.js +57 -35
- package/lib/esm/components/webchatcontainerstateful/common/mockadapter.js +63 -52
- package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +95 -61
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +6 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +6 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.js +53 -39
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +88 -60
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +5 -6
- package/lib/esm/controller/componentController.js +3 -2
- package/lib/esm/firstresponselatency/FirstResponseLatencyTracker.js +138 -116
- package/lib/esm/plugins/createChatTranscript.js +88 -58
- package/lib/esm/plugins/newMessageEventHandler.js +4 -4
- package/lib/types/assets/Audios.d.ts +1 -1
- package/lib/types/assets/Icons.d.ts +16 -16
- package/lib/types/common/Constants.d.ts +283 -277
- package/lib/types/common/KeyCodes.d.ts +5 -5
- package/lib/types/common/contextDataStore/DataStoreManager.d.ts +4 -4
- package/lib/types/common/facades/FacadeChatSDK.d.ts +75 -74
- package/lib/types/common/facades/types/IFacadeChatSDKInput.d.ts +13 -13
- package/lib/types/common/interfaces/IContextDataStore.d.ts +14 -14
- package/lib/types/common/interfaces/ITimer.d.ts +3 -3
- package/lib/types/common/storage/default/defaultCacheManager.d.ts +5 -5
- package/lib/types/common/storage/default/defaultClientDataStoreProvider.d.ts +4 -4
- package/lib/types/common/storage/default/defaultInMemoryDataStore.d.ts +6 -6
- package/lib/types/common/telemetry/AppInsightsEvents.d.ts +1 -0
- package/lib/types/common/telemetry/ScenarioMarker.d.ts +19 -0
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +272 -264
- package/lib/types/common/telemetry/TelemetryHelper.d.ts +48 -43
- package/lib/types/common/telemetry/TelemetryManager.d.ts +12 -12
- package/lib/types/common/telemetry/defaultConfigs/defaultAppInsightsConfig.d.ts +2 -0
- package/lib/types/common/telemetry/defaultConfigs/defaultAriaConfig.d.ts +2 -2
- package/lib/types/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.d.ts +2 -2
- package/lib/types/common/telemetry/defaultConfigs/defaultTelemetryInternalData.d.ts +2 -2
- package/lib/types/common/telemetry/definitions/Contracts.d.ts +77 -77
- package/lib/types/common/telemetry/definitions/Payload.d.ts +105 -105
- package/lib/types/common/telemetry/interfaces/IAppInsightsConfig.d.ts +4 -0
- package/lib/types/common/telemetry/interfaces/IAriaConfigurations.d.ts +18 -18
- package/lib/types/common/telemetry/interfaces/IChatSDKLogger.d.ts +6 -5
- package/lib/types/common/telemetry/interfaces/IInternalTelemetryData.d.ts +23 -21
- package/lib/types/common/telemetry/interfaces/ITelemetryConfig.d.ts +48 -48
- package/lib/types/common/telemetry/interfaces/ITelemetryEvents.d.ts +7 -7
- package/lib/types/common/telemetry/loggers/appInsightsLogger.d.ts +10 -0
- package/lib/types/common/telemetry/loggers/ariaTelemetryLogger.d.ts +2 -2
- package/lib/types/common/telemetry/loggers/consoleLogger.d.ts +2 -2
- package/lib/types/common/utils.d.ts +49 -49
- package/lib/types/components/callingcontainerstateful/CallingContainerStateful.d.ts +4 -3
- package/lib/types/components/callingcontainerstateful/ICallingContainerStatefulProps.d.ts +4 -4
- package/lib/types/components/chatbuttonstateful/ChatButtonStateful.d.ts +4 -3
- package/lib/types/components/chatbuttonstateful/common/styleProps/defaultOutOfOfficeChatButtonStyleProps.d.ts +2 -2
- package/lib/types/components/chatbuttonstateful/interfaces/IChatButtonStatefulParams.d.ts +17 -17
- package/lib/types/components/confirmationpanestateful/ConfirmationPaneStateful.d.ts +4 -3
- package/lib/types/components/confirmationpanestateful/common/defaultProps/defaultConfirmationPaneLocalizedTexts.d.ts +2 -2
- package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneInputs.d.ts +4 -4
- package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneLocalizedText.d.ts +10 -10
- package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulParams.d.ts +13 -13
- package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulProps.d.ts +8 -8
- package/lib/types/components/dimlayer/DimLayer.d.ts +6 -5
- package/lib/types/components/draggable/DraggableChatWidget.d.ts +9 -9
- package/lib/types/components/draggable/DraggableEventEmitter.d.ts +27 -27
- package/lib/types/components/draggable/DraggableEventNames.d.ts +6 -6
- package/lib/types/components/draggable/DraggableEventReceiver.d.ts +27 -27
- package/lib/types/components/draggable/IDraggableElementPosition.d.ts +5 -5
- package/lib/types/components/draggable/IDraggableElementPositionDelta.d.ts +5 -5
- package/lib/types/components/draggable/IDraggableEvent.d.ts +12 -12
- package/lib/types/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.d.ts +4 -3
- package/lib/types/components/emailtranscriptpanestateful/interfaces/IChatTranscriptBody.d.ts +5 -5
- package/lib/types/components/emailtranscriptpanestateful/interfaces/IEmailTranscriptPaneProps.d.ts +11 -11
- package/lib/types/components/footerstateful/FooterStateful.d.ts +3 -2
- package/lib/types/components/footerstateful/audionotificationstateful/AudioNotificationStateful.d.ts +4 -3
- package/lib/types/components/footerstateful/audionotificationstateful/interfaces/IAudioNotificationProps.d.ts +3 -3
- package/lib/types/components/footerstateful/audionotificationstateful/interfaces/IAudioNotificationStatefulParams.d.ts +4 -4
- package/lib/types/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.d.ts +4 -4
- package/lib/types/components/footerstateful/downloadtranscriptstateful/common/defaultLibraryScripts.d.ts +23 -23
- package/lib/types/components/footerstateful/downloadtranscriptstateful/interfaces/IDownloadTranscriptProps.d.ts +19 -19
- package/lib/types/components/footerstateful/downloadtranscriptstateful/interfaces/IWebChatTranscriptConfig.d.ts +14 -14
- package/lib/types/components/footerstateful/downloadtranscriptstateful/interfaces/TranscriptHtmlScripts.d.ts +33 -33
- package/lib/types/components/headerstateful/HeaderStateful.d.ts +4 -3
- package/lib/types/components/headerstateful/common/styleProps/defaultOutOfOfficeHeaderStyleProps.d.ts +2 -2
- package/lib/types/components/headerstateful/interfaces/IHeaderStatefulParams.d.ts +33 -33
- package/lib/types/components/livechatwidget/LiveChatWidget.d.ts +4 -3
- package/lib/types/components/livechatwidget/common/ActivityStreamHandler.d.ts +14 -14
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.d.ts +12 -12
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.d.ts +5 -5
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.d.ts +7 -7
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.d.ts +6 -6
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.d.ts +7 -7
- package/lib/types/components/livechatwidget/common/ChatAdapterShim.d.ts +7 -7
- package/lib/types/components/livechatwidget/common/Deferred.d.ts +9 -9
- package/lib/types/components/livechatwidget/common/authHelper.d.ts +18 -18
- package/lib/types/components/livechatwidget/common/chatDisconnectHelper.d.ts +4 -4
- package/lib/types/components/livechatwidget/common/createAdapter.d.ts +3 -3
- package/lib/types/components/livechatwidget/common/createDownloadTranscriptProps.d.ts +25 -25
- package/lib/types/components/livechatwidget/common/createFooter.d.ts +4 -3
- package/lib/types/components/livechatwidget/common/createInternetConnectionChangeHandler.d.ts +2 -2
- package/lib/types/components/livechatwidget/common/createMarkdown.d.ts +2 -2
- package/lib/types/components/livechatwidget/common/defaultProps/defaultScrollBarProps.d.ts +2 -2
- package/lib/types/components/livechatwidget/common/defaultStyles/defaultLiveChatWidgetGeneralStyles.d.ts +2 -2
- package/lib/types/components/livechatwidget/common/disposeTelemetryLoggers.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/endChat.d.ts +13 -13
- package/lib/types/components/livechatwidget/common/getGeneralStylesForButton.d.ts +3 -3
- package/lib/types/components/livechatwidget/common/getMockChatSDKIfApplicable.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/helpers/markdownHelper.d.ts +2 -2
- package/lib/types/components/livechatwidget/common/initCallingSdk.d.ts +2 -2
- package/lib/types/components/livechatwidget/common/initConfirmationPropsComposer.d.ts +3 -3
- package/lib/types/components/livechatwidget/common/initWebChatComposer.d.ts +7 -7
- package/lib/types/components/livechatwidget/common/liveChatConfigUtils.d.ts +3 -3
- package/lib/types/components/livechatwidget/common/overridePropsOnMockIfApplicable.d.ts +3 -3
- package/lib/types/components/livechatwidget/common/persistentChatHelper.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +12 -12
- package/lib/types/components/livechatwidget/common/registerTelemetryLoggers.d.ts +4 -4
- package/lib/types/components/livechatwidget/common/renderSurveyHelpers.d.ts +10 -10
- package/lib/types/components/livechatwidget/common/setPostChatContextAndLoadSurvey.d.ts +4 -4
- package/lib/types/components/livechatwidget/common/shareObservable.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/startChat.d.ts +11 -11
- package/lib/types/components/livechatwidget/common/startChatErrorHandler.d.ts +6 -6
- package/lib/types/components/livechatwidget/common/startProactiveChat.d.ts +4 -4
- package/lib/types/components/livechatwidget/common/updateSessionDataForTelemetry.d.ts +4 -4
- package/lib/types/components/livechatwidget/interfaces/IBotAuthActivitySubscriberOptionalParams.d.ts +4 -4
- package/lib/types/components/livechatwidget/interfaces/IDraggableChatWidgetProps.d.ts +10 -10
- package/lib/types/components/livechatwidget/interfaces/IFeatureConfigProps.d.ts +3 -3
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetComponentOverrides.d.ts +17 -17
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetControlProps.d.ts +21 -21
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +70 -68
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetStyleProps.d.ts +5 -5
- package/lib/types/components/livechatwidget/interfaces/IMockProps.d.ts +8 -8
- package/lib/types/components/livechatwidget/interfaces/IScrollBarProps.d.ts +22 -22
- package/lib/types/components/livechatwidget/interfaces/ISendBox.d.ts +12 -12
- package/lib/types/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.d.ts +3 -3
- package/lib/types/components/loadingpanestateful/LoadingPaneStateful.d.ts +3 -2
- package/lib/types/components/loadingpanestateful/common/defaultStyleProps/defaultgeneralLoadingPaneStyleProps.d.ts +2 -2
- package/lib/types/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.d.ts +2 -2
- package/lib/types/components/notificationpanestateful/NotificationPaneStateful.d.ts +4 -3
- package/lib/types/components/notificationpanestateful/defaultProps/defaultChatDisconnectControlProps.d.ts +2 -2
- package/lib/types/components/notificationpanestateful/defaultProps/defaultChatDisconnectStyleProps.d.ts +2 -2
- package/lib/types/components/notificationpanestateful/interfaces/INotificationPaneStatefulProps.d.ts +13 -13
- package/lib/types/components/ooohpanestateful/OOOHPaneStateful.d.ts +4 -3
- package/lib/types/components/ooohpanestateful/common/defaultStyleProps/defaultgeneralOOOHPaneStyleProps.d.ts +2 -2
- package/lib/types/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.d.ts +4 -3
- package/lib/types/components/postchatloadingpanestateful/common/defaultgeneralPostChatLoadingPaneStyleProps.d.ts +2 -2
- package/lib/types/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.d.ts +4 -3
- package/lib/types/components/postchatsurveypanestateful/common/defaultStyleProps/defaultgeneralPostChatSurveyPaneStyleProps.d.ts +2 -2
- package/lib/types/components/postchatsurveypanestateful/common/isValidSurveyUrl.d.ts +2 -2
- package/lib/types/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.d.ts +5 -5
- package/lib/types/components/postchatsurveypanestateful/enums/PostChatSurveyMode.d.ts +4 -4
- package/lib/types/components/postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps.d.ts +5 -5
- package/lib/types/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.d.ts +4 -3
- package/lib/types/components/prechatsurveypanestateful/common/defaultProps/defaultPreChatSurveyLocalizedTexts.d.ts +2 -2
- package/lib/types/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.d.ts +2 -2
- package/lib/types/components/prechatsurveypanestateful/interfaces/IPreChatSurveyPaneStatefulParams.d.ts +5 -5
- package/lib/types/components/proactivechatpanestateful/ProactiveChatPaneStateful.d.ts +3 -2
- package/lib/types/components/proactivechatpanestateful/interfaces/IProactiveChatNotificationConfig.d.ts +3 -3
- package/lib/types/components/proactivechatpanestateful/interfaces/IProactiveChatPaneStatefulProps.d.ts +4 -4
- package/lib/types/components/reconnectchatpanestateful/ReconnectChatPaneStateful.d.ts +4 -3
- package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatContext.d.ts +4 -4
- package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatOptionalParams.d.ts +3 -3
- package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulParams.d.ts +5 -5
- package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulProps.d.ts +5 -5
- package/lib/types/components/startchaterrorpanestateful/StartChatErrorPaneStateful.d.ts +4 -3
- package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneGeneralStyleProps.d.ts +2 -2
- package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconImageProps.d.ts +2 -2
- package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconStyleProps.d.ts +2 -2
- package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneSubtitleStyleProps.d.ts +2 -2
- package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneTitleStyleProps.d.ts +2 -2
- package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneClassNames.d.ts +5 -5
- package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneComponentOverrides.d.ts +6 -6
- package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneControlProps.d.ts +14 -14
- package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneProps.d.ts +8 -8
- package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneStyleProps.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/WebChatContainerStateful.d.ts +4 -3
- package/lib/types/components/webchatcontainerstateful/common/DemoChatAdapter.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/common/DemoChatSDK.d.ts +6 -6
- package/lib/types/components/webchatcontainerstateful/common/DesignerChatAdapter.d.ts +8 -8
- package/lib/types/components/webchatcontainerstateful/common/DesignerChatSDK.d.ts +31 -31
- package/lib/types/components/webchatcontainerstateful/common/MockBotCardCommandType.d.ts +6 -6
- package/lib/types/components/webchatcontainerstateful/common/MockBotCommand.d.ts +11 -11
- package/lib/types/components/webchatcontainerstateful/common/defaultProps/defaultAttachmentProps.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/defaultProps/defaultMarkdownLocalizedTexts.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStatefulContainerStyles.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/mockadapter.d.ts +14 -14
- package/lib/types/components/webchatcontainerstateful/common/mockchatsdk.d.ts +45 -45
- package/lib/types/components/webchatcontainerstateful/common/utils/BrowserInfo.d.ts +5 -5
- package/lib/types/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.d.ts +7 -7
- package/lib/types/components/webchatcontainerstateful/common/utils/attachmentActivityUtils.d.ts +9 -9
- package/lib/types/components/webchatcontainerstateful/common/utils/chatAdapterUtils.d.ts +9 -9
- package/lib/types/components/webchatcontainerstateful/common/utils/isMaskingFromCustomer.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.d.ts +8 -8
- package/lib/types/components/webchatcontainerstateful/interfaces/IAttachmentProps.d.ts +5 -5
- package/lib/types/components/webchatcontainerstateful/interfaces/IBotAuthConfig.d.ts +4 -4
- package/lib/types/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.d.ts +4 -4
- package/lib/types/components/webchatcontainerstateful/interfaces/IDataMaskingInfo.d.ts +6 -6
- package/lib/types/components/webchatcontainerstateful/interfaces/IDataMaskingRule.d.ts +3 -3
- package/lib/types/components/webchatcontainerstateful/interfaces/IDataMaskingSetting.d.ts +4 -4
- package/lib/types/components/webchatcontainerstateful/interfaces/IRenderingMiddlewareProps.d.ts +37 -37
- package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatAction.d.ts +4 -4
- package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps.d.ts +28 -28
- package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatProps.d.ts +39 -39
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.d.ts +3 -3
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.d.ts +3 -3
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/BrowserVendor.d.ts +9 -9
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineActivityType.d.ts +4 -4
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineSenderRole.d.ts +5 -5
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/MessageType.d.ts +11 -11
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/NotificationLevel.d.ts +6 -6
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.d.ts +11 -11
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/SendStatus.d.ts +5 -5
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/WebChatActionType.d.ts +24 -24
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.d.ts +9 -9
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsEgressMiddleware.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsIngressMiddleware.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.d.ts +6 -6
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Attachment.d.ts +3 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AttachmentContent.d.ts +3 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AttachmentIcon.d.ts +3 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/DownloadBlockedAttachment.d.ts +3 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/FileScanStatus.d.ts +6 -6
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/MaliciousAttachment.d.ts +3 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/ScanInProgressAttachment.d.ts +3 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Spinner.d.ts +3 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.d.ts +8 -8
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentContentStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentDividerStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentDownloadIconStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentFileNameStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentSizeStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAtttachmentAdaptiveCardStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAtttachmentIconStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAtttachmentStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSentMessageAnchorStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.d.ts +3 -3
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.d.ts +11 -11
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampContentStyles.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampFailedStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampRetryStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTypingIndicatorBubbleStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTypingIndicatorContainerStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTypingIndicatorMessageStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.d.ts +3 -3
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageStyles.d.ts +3 -3
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/groupActivitiesMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/index.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageSequenceIdOverrideMiddleware.d.ts +4 -4
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.d.ts +4 -4
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/toastMiddleware.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.d.ts +7 -6
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.d.ts +11 -11
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.d.ts +11 -11
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.d.ts +11 -11
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator.d.ts +11 -11
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.d.ts +12 -12
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.d.ts +1 -1
- package/lib/types/contexts/ChatAdapterStore.d.ts +1 -2
- package/lib/types/contexts/ChatContextStore.d.ts +1 -1
- package/lib/types/contexts/ChatSDKStore.d.ts +1 -1
- package/lib/types/contexts/FacadeChatSDKStore.d.ts +1 -1
- package/lib/types/contexts/common/ConversationState.d.ts +13 -13
- package/lib/types/contexts/common/ILiveChatWidgetAction.d.ts +5 -5
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +63 -63
- package/lib/types/contexts/common/ILiveChatWidgetLocalizedTexts.d.ts +40 -40
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +48 -48
- package/lib/types/contexts/common/LiveChatWidgetContextInitialState.d.ts +3 -3
- package/lib/types/contexts/common/StartChatFailureType.d.ts +5 -5
- package/lib/types/contexts/createReducer.d.ts +4 -4
- package/lib/types/controller/componentController.d.ts +16 -16
- package/lib/types/firstresponselatency/Constants.d.ts +30 -30
- package/lib/types/firstresponselatency/FirstMessageTrackerFromBot.d.ts +1 -1
- package/lib/types/firstresponselatency/FirstResponseLatencyTracker.d.ts +22 -22
- package/lib/types/firstresponselatency/util.d.ts +7 -7
- package/lib/types/hooks/useChatAdapterStore.d.ts +2 -2
- package/lib/types/hooks/useChatContextStore.d.ts +5 -5
- package/lib/types/hooks/useChatSDKStore.d.ts +2 -2
- package/lib/types/hooks/useDebounce.d.ts +3 -3
- package/lib/types/hooks/useFacadeChatSDKStore.d.ts +3 -3
- package/lib/types/hooks/useWindowDimensions.d.ts +4 -4
- package/lib/types/index.d.ts +11 -11
- package/lib/types/plugins/createChatTranscript.d.ts +3 -3
- package/lib/types/plugins/newMessageEventHandler.d.ts +2 -2
- package/package.json +31 -16
package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2
|
+
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); } }
|
|
3
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
1
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
5
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
6
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
|
-
export
|
|
5
|
-
|
|
7
|
+
export let DefaultActivitySubscriber = /*#__PURE__*/function () {
|
|
8
|
+
function DefaultActivitySubscriber() {
|
|
9
|
+
_classCallCheck(this, DefaultActivitySubscriber);
|
|
6
10
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
11
|
_defineProperty(this, "observer", void 0);
|
|
8
12
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
_createClass(DefaultActivitySubscriber, [{
|
|
14
|
+
key: "next",
|
|
15
|
+
value:
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
|
+
async function next(activity) {
|
|
18
|
+
this.observer.next(activity);
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
}]);
|
|
22
|
+
return DefaultActivitySubscriber;
|
|
23
|
+
}();
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2
|
+
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); } }
|
|
3
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
1
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
5
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
6
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
@@ -5,66 +8,76 @@ import { Constants } from "../../../../common/Constants";
|
|
|
5
8
|
import { BroadcastEvent, LogLevel, TelemetryEvent } from "../../../../common/telemetry/TelemetryConstants";
|
|
6
9
|
import { TelemetryHelper } from "../../../../common/telemetry/TelemetryHelper";
|
|
7
10
|
import { BroadcastService } from "@microsoft/omnichannel-chat-components";
|
|
8
|
-
export
|
|
9
|
-
|
|
11
|
+
export let HiddenAdaptiveCardActivitySubscriber = /*#__PURE__*/function () {
|
|
12
|
+
function HiddenAdaptiveCardActivitySubscriber() {
|
|
13
|
+
_classCallCheck(this, HiddenAdaptiveCardActivitySubscriber);
|
|
10
14
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
15
|
_defineProperty(this, "observer", void 0);
|
|
12
16
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
_createClass(HiddenAdaptiveCardActivitySubscriber, [{
|
|
18
|
+
key: "apply",
|
|
19
|
+
value:
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
|
+
async function apply(activity) {
|
|
22
|
+
const {
|
|
23
|
+
attachments,
|
|
24
|
+
attachment
|
|
25
|
+
} = activity;
|
|
26
|
+
this.observer.next(false);
|
|
27
|
+
BroadcastService.postMessage({
|
|
28
|
+
eventName: BroadcastEvent.NewMessageReceived,
|
|
29
|
+
payload: {
|
|
30
|
+
attachments: attachments || [attachment],
|
|
31
|
+
text: "Custom Event"
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
29
36
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
|
|
38
|
+
}, {
|
|
39
|
+
key: "applicable",
|
|
40
|
+
value: function applicable(activity) {
|
|
41
|
+
const {
|
|
42
|
+
attachments,
|
|
43
|
+
attachment
|
|
44
|
+
} = activity;
|
|
36
45
|
|
|
37
|
-
|
|
38
|
-
|
|
46
|
+
// Use `attachments` or `attachment` (whichever exists)
|
|
47
|
+
const cards = attachments || [attachment];
|
|
39
48
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
49
|
+
// Check if contentType is "AdaptiveCard"
|
|
50
|
+
const adaptiveCard = cards === null || cards === void 0 ? void 0 : cards.find(
|
|
51
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
52
|
+
item => Constants.supportedAdaptiveCardContentTypes.indexOf(item === null || item === void 0 ? void 0 : item.contentType) >= 0);
|
|
53
|
+
if (adaptiveCard && adaptiveCard.content) {
|
|
54
|
+
const {
|
|
55
|
+
body
|
|
56
|
+
} = adaptiveCard.content;
|
|
57
|
+
if (Array.isArray(body)) {
|
|
58
|
+
// Check if all elements in `body` have `isVisible: false`
|
|
59
|
+
const allInvisible = body.every(item => item.isVisible === false);
|
|
60
|
+
if (allInvisible) {
|
|
61
|
+
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
62
|
+
Event: TelemetryEvent.HiddenAdaptiveCardMessageReceived,
|
|
63
|
+
Description: "All elements in AdaptiveCard are invisible"
|
|
64
|
+
});
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
57
67
|
}
|
|
58
68
|
}
|
|
69
|
+
return false;
|
|
59
70
|
}
|
|
60
|
-
return false;
|
|
61
|
-
}
|
|
62
71
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
72
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
73
|
+
}, {
|
|
74
|
+
key: "next",
|
|
75
|
+
value: async function next(activity) {
|
|
76
|
+
if (this.applicable(activity)) {
|
|
77
|
+
return await this.apply(activity);
|
|
78
|
+
}
|
|
79
|
+
return activity;
|
|
67
80
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
81
|
+
}]);
|
|
82
|
+
return HiddenAdaptiveCardActivitySubscriber;
|
|
83
|
+
}();
|
package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js
CHANGED
|
@@ -1,28 +1,41 @@
|
|
|
1
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2
|
+
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); } }
|
|
3
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
1
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
5
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
6
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
7
|
import { ActivityStreamHandler } from "../ActivityStreamHandler";
|
|
5
|
-
export
|
|
6
|
-
|
|
8
|
+
export let PauseActivitySubscriber = /*#__PURE__*/function () {
|
|
9
|
+
function PauseActivitySubscriber() {
|
|
10
|
+
_classCallCheck(this, PauseActivitySubscriber);
|
|
7
11
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8
12
|
_defineProperty(this, "observer", void 0);
|
|
9
13
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
_createClass(PauseActivitySubscriber, [{
|
|
15
|
+
key: "apply",
|
|
16
|
+
value:
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
|
+
async function apply(activity) {
|
|
19
|
+
await ActivityStreamHandler.restorePromise;
|
|
20
|
+
return activity;
|
|
21
|
+
}
|
|
15
22
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
|
|
24
|
+
}, {
|
|
25
|
+
key: "applicable",
|
|
26
|
+
value: function applicable(activity) {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
20
29
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
31
|
+
}, {
|
|
32
|
+
key: "next",
|
|
33
|
+
value: async function next(activity) {
|
|
34
|
+
if (this.applicable(activity)) {
|
|
35
|
+
return await this.apply(activity);
|
|
36
|
+
}
|
|
37
|
+
return activity;
|
|
25
38
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
39
|
+
}]);
|
|
40
|
+
return PauseActivitySubscriber;
|
|
41
|
+
}();
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2
|
+
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); } }
|
|
3
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
1
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
5
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
6
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
7
|
import { DefaultActivitySubscriber } from "./ActivitySubscriber/DefaultActivitySubscriber";
|
|
5
8
|
import { shareObservable } from "./shareObservable";
|
|
6
|
-
export
|
|
9
|
+
export let ChatAdapterShim = /*#__PURE__*/function () {
|
|
7
10
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8
11
|
|
|
9
12
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -11,7 +14,8 @@ export class ChatAdapterShim {
|
|
|
11
14
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
15
|
|
|
13
16
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
|
-
|
|
17
|
+
function ChatAdapterShim(chatAdapter) {
|
|
18
|
+
_classCallCheck(this, ChatAdapterShim);
|
|
15
19
|
_defineProperty(this, "chatAdapter", void 0);
|
|
16
20
|
_defineProperty(this, "activityObserver", void 0);
|
|
17
21
|
_defineProperty(this, "subscribers", void 0);
|
|
@@ -51,7 +55,11 @@ export class ChatAdapterShim {
|
|
|
51
55
|
}
|
|
52
56
|
|
|
53
57
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
+
_createClass(ChatAdapterShim, [{
|
|
59
|
+
key: "addSubscriber",
|
|
60
|
+
value: function addSubscriber(subscriber) {
|
|
61
|
+
this.subscribers.push(subscriber);
|
|
62
|
+
}
|
|
63
|
+
}]);
|
|
64
|
+
return ChatAdapterShim;
|
|
65
|
+
}();
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2
|
+
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); } }
|
|
3
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
1
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
5
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
6
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
|
-
export
|
|
7
|
+
export let Deferred = /*#__PURE__*/function () {
|
|
5
8
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
9
|
|
|
7
|
-
|
|
10
|
+
function Deferred() {
|
|
11
|
+
_classCallCheck(this, Deferred);
|
|
8
12
|
_defineProperty(this, "_promise", void 0);
|
|
9
13
|
_defineProperty(this, "_resolve", void 0);
|
|
10
14
|
_defineProperty(this, "_reject", () => {
|
|
@@ -23,7 +27,11 @@ export class Deferred {
|
|
|
23
27
|
this._reject = reject;
|
|
24
28
|
});
|
|
25
29
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
_createClass(Deferred, [{
|
|
31
|
+
key: "promise",
|
|
32
|
+
get: function () {
|
|
33
|
+
return this._promise;
|
|
34
|
+
}
|
|
35
|
+
}]);
|
|
36
|
+
return Deferred;
|
|
37
|
+
}();
|
|
@@ -2,7 +2,7 @@ import "regenerator-runtime/runtime";
|
|
|
2
2
|
import { BroadcastEvent, LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryConstants";
|
|
3
3
|
import { ConversationMode, WidgetLoadCustomErrorString } from "../../../common/Constants";
|
|
4
4
|
import { checkContactIdError, isNullOrEmptyString, isNullOrUndefined } from "../../../common/utils";
|
|
5
|
-
import {
|
|
5
|
+
import { removeAuthTokenProvider } from "./authHelper";
|
|
6
6
|
import { BroadcastService } from "@microsoft/omnichannel-chat-components";
|
|
7
7
|
import { ConversationState } from "../../../contexts/common/ConversationState";
|
|
8
8
|
import { LiveChatWidgetActionType } from "../../../contexts/common/LiveChatWidgetActionType";
|
|
@@ -61,11 +61,6 @@ const getChatReconnectContext = async (facadeChatSDK, chatConfig, props, isAuthe
|
|
|
61
61
|
const chatReconnectOptionalParams = {
|
|
62
62
|
reconnectId: (_props$reconnectChatP4 = props.reconnectChatPaneProps) === null || _props$reconnectChatP4 === void 0 ? void 0 : _props$reconnectChatP4.reconnectId
|
|
63
63
|
};
|
|
64
|
-
// Get auth token for getting chat reconnect context
|
|
65
|
-
if (isAuthenticatedChat) {
|
|
66
|
-
// handle authentication will throw error if auth token is not available, so no need to check for response
|
|
67
|
-
await handleAuthentication(facadeChatSDK.getChatSDK(), chatConfig, props.getAuthToken);
|
|
68
|
-
}
|
|
69
64
|
const reconnectChatContext = await (facadeChatSDK === null || facadeChatSDK === void 0 ? void 0 : facadeChatSDK.getChatReconnectContext(chatReconnectOptionalParams));
|
|
70
65
|
if (isAuthenticatedChat) {
|
|
71
66
|
// remove auth token after reconnectId is fetched
|
|
@@ -5,6 +5,7 @@ import { defaultAriaConfig } from "../../../common/telemetry/defaultConfigs/defa
|
|
|
5
5
|
import { defaultInternalTelemetryData } from "../../../common/telemetry/defaultConfigs/defaultTelemetryInternalData";
|
|
6
6
|
import { defaultTelemetryConfiguration } from "../../../common/telemetry/defaultConfigs/defaultTelemetryConfiguration";
|
|
7
7
|
import { newGuid } from "../../../common/utils";
|
|
8
|
+
import { defaultAppInsightsConfig } from "../../../common/telemetry/defaultConfigs/defaultAppInsightsConfig";
|
|
8
9
|
export const registerTelemetryLoggers = (props, dispatch) => {
|
|
9
10
|
var _props$liveChatContex, _props$liveChatContex2;
|
|
10
11
|
const telemetryConfig = {
|
|
@@ -19,7 +20,8 @@ export const registerTelemetryLoggers = (props, dispatch) => {
|
|
|
19
20
|
let telemetryData = {
|
|
20
21
|
...defaultInternalTelemetryData,
|
|
21
22
|
telemetryConfig: Object.assign({}, defaultTelemetryConfiguration, telemetryConfig),
|
|
22
|
-
ariaConfig: Object.assign({}, defaultAriaConfig, telemetryConfig === null || telemetryConfig === void 0 ? void 0 : telemetryConfig.ariaConfigurations)
|
|
23
|
+
ariaConfig: Object.assign({}, defaultAriaConfig, telemetryConfig === null || telemetryConfig === void 0 ? void 0 : telemetryConfig.ariaConfigurations),
|
|
24
|
+
appInsightsConfig: Object.assign({}, defaultAppInsightsConfig, props.appInsightsConfig)
|
|
23
25
|
};
|
|
24
26
|
if (props.chatConfig) {
|
|
25
27
|
telemetryData = TelemetryHelper.addChatConfigDataToTelemetry(props === null || props === void 0 ? void 0 : props.chatConfig, telemetryData);
|
|
@@ -108,7 +108,7 @@ const getPostChatContext = async (facadeChatSDK, state, dispatch) => {
|
|
|
108
108
|
if ((state === null || state === void 0 ? void 0 : (_state$domainStates2 = state.domainStates) === null || _state$domainStates2 === void 0 ? void 0 : _state$domainStates2.postChatContext) === undefined) {
|
|
109
109
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
110
110
|
const context = await facadeChatSDK.getPostChatSurveyContext();
|
|
111
|
-
TelemetryHelper.
|
|
111
|
+
TelemetryHelper.logSDKEventToAllTelemetry(LogLevel.INFO, {
|
|
112
112
|
Event: TelemetryEvent.PostChatContextCallSucceed,
|
|
113
113
|
Description: PostChatSurveyTelemetryMessage.PostChatContextCallSucceed
|
|
114
114
|
});
|
|
@@ -120,9 +120,12 @@ const getPostChatContext = async (facadeChatSDK, state, dispatch) => {
|
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
} catch (error) {
|
|
123
|
-
TelemetryHelper.
|
|
123
|
+
TelemetryHelper.logSDKEventToAllTelemetry(LogLevel.ERROR, {
|
|
124
124
|
Event: TelemetryEvent.PostChatContextCallFailed,
|
|
125
|
-
Description: PostChatSurveyTelemetryMessage.PostChatContextCallFailed
|
|
125
|
+
Description: PostChatSurveyTelemetryMessage.PostChatContextCallFailed,
|
|
126
|
+
ExceptionDetails: {
|
|
127
|
+
exception: error
|
|
128
|
+
}
|
|
126
129
|
});
|
|
127
130
|
}
|
|
128
131
|
};
|
|
@@ -12,9 +12,13 @@ export const setPostChatContextAndLoadSurvey = async (facadeChatSDK, dispatch, p
|
|
|
12
12
|
const postChatEnabled = await isPostChatSurveyEnabled(facadeChatSDK);
|
|
13
13
|
if (postChatEnabled) {
|
|
14
14
|
if (!persistedChat) {
|
|
15
|
+
TelemetryHelper.logSDKEventToAllTelemetry(LogLevel.INFO, {
|
|
16
|
+
Event: TelemetryEvent.PostChatContextCallStarted,
|
|
17
|
+
Description: PostChatSurveyTelemetryMessage.PostChatContextCallStarted
|
|
18
|
+
});
|
|
15
19
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
20
|
const context = await facadeChatSDK.getPostChatSurveyContext();
|
|
17
|
-
TelemetryHelper.
|
|
21
|
+
TelemetryHelper.logSDKEventToAllTelemetry(LogLevel.INFO, {
|
|
18
22
|
Event: TelemetryEvent.PostChatContextCallSucceed,
|
|
19
23
|
Description: PostChatSurveyTelemetryMessage.PostChatContextCallSucceed
|
|
20
24
|
});
|
|
@@ -25,8 +29,9 @@ export const setPostChatContextAndLoadSurvey = async (facadeChatSDK, dispatch, p
|
|
|
25
29
|
}
|
|
26
30
|
}
|
|
27
31
|
} catch (ex) {
|
|
28
|
-
TelemetryHelper.
|
|
32
|
+
TelemetryHelper.logSDKEventToAllTelemetry(LogLevel.ERROR, {
|
|
29
33
|
Event: TelemetryEvent.PostChatContextCallFailed,
|
|
34
|
+
Description: PostChatSurveyTelemetryMessage.PostChatContextCallFailed,
|
|
30
35
|
ExceptionDetails: {
|
|
31
36
|
exception: ex
|
|
32
37
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BroadcastEvent, LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryConstants";
|
|
2
|
-
import { Constants, LiveWorkItemState,
|
|
2
|
+
import { Constants, LiveWorkItemState, WidgetLoadTelemetryMessage } from "../../../common/Constants";
|
|
3
3
|
import { checkContactIdError, createTimer, getConversationDetailsCall, getStateFromCache, getWidgetCacheIdfromProps, isNullOrEmptyString, isNullOrUndefined, isUndefinedOrEmpty } from "../../../common/utils";
|
|
4
|
-
import { getAuthClientFunction, handleAuthentication } from "./authHelper";
|
|
5
4
|
import { handleChatReconnect, isPersistentEnabled, isReconnectEnabled } from "./reconnectChatHelper";
|
|
6
5
|
import { handleStartChatError, logWidgetLoadComplete } from "./startChatErrorHandler";
|
|
7
6
|
import { ActivityStreamHandler } from "./ActivityStreamHandler";
|
|
@@ -26,20 +25,6 @@ let widgetInstanceId;
|
|
|
26
25
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
26
|
let popoutWidgetInstanceId;
|
|
28
27
|
|
|
29
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30
|
-
const setAuthenticationIfApplicable = async (props, facadeChatSDK) => {
|
|
31
|
-
const chatConfig = props === null || props === void 0 ? void 0 : props.chatConfig;
|
|
32
|
-
const getAuthToken = props === null || props === void 0 ? void 0 : props.getAuthToken;
|
|
33
|
-
const authClientFunction = getAuthClientFunction(chatConfig);
|
|
34
|
-
if (getAuthToken && authClientFunction) {
|
|
35
|
-
// set auth token to chat sdk before start chat
|
|
36
|
-
const authSuccess = await handleAuthentication(facadeChatSDK.getChatSDK(), chatConfig, getAuthToken);
|
|
37
|
-
if (!authSuccess.result) {
|
|
38
|
-
throw new Error(WidgetLoadCustomErrorString.AuthenticationFailedErrorString);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
|
|
43
28
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
44
29
|
const prepareStartChat = async (props, facadeChatSDK, state, dispatch, setAdapter) => {
|
|
45
30
|
optionalParams = {}; //Resetting to ensure no stale values
|
|
@@ -67,18 +52,13 @@ const prepareStartChat = async (props, facadeChatSDK, state, dispatch, setAdapte
|
|
|
67
52
|
const isProactiveChat = state.appStates.conversationState === ConversationState.ProactiveChat;
|
|
68
53
|
const isPreChatEnabledInProactiveChat = state.appStates.proactiveChatStates.proactiveChatEnablePrechat;
|
|
69
54
|
|
|
70
|
-
// Setting auth settings to OC API to retrieve existing persistent chat session before start chat if any
|
|
71
|
-
if (isPersistentEnabled(props.chatConfig)) {
|
|
72
|
-
await setAuthenticationIfApplicable(props, facadeChatSDK);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
55
|
//Setting PreChat and intiate chat
|
|
76
56
|
await setPreChatAndInitiateChat(facadeChatSDK, dispatch, setAdapter, isProactiveChat, isPreChatEnabledInProactiveChat, state, props);
|
|
77
57
|
};
|
|
78
58
|
|
|
79
59
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
80
60
|
const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, isProactiveChat, proactiveChatEnablePrechatState, state, props) => {
|
|
81
|
-
var _props$preChatSurveyP, _props$preChatSurveyP2, _props$controlProps, _state$domainStates, _state$domainStates$l, _state$domainStates$l2;
|
|
61
|
+
var _props$preChatSurveyP, _props$preChatSurveyP2, _props$controlProps, _state$domainStates, _state$domainStates$l, _state$domainStates$l2, _state$appStates2;
|
|
82
62
|
// This reset needs to be done before to load prechat, because the conversation state changes from close to prechat
|
|
83
63
|
if ((state === null || state === void 0 ? void 0 : state.appStates.conversationState) === ConversationState.Closed) {
|
|
84
64
|
// Preventive reset to avoid starting chat with previous requestId which could potentially cause problems
|
|
@@ -118,7 +98,7 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
|
|
|
118
98
|
});
|
|
119
99
|
|
|
120
100
|
// If minimized, maximize the chat, if the state is missing, consider it as minimized
|
|
121
|
-
if ((state === null || state === void 0 ? void 0 : state.appStates.isMinimized)
|
|
101
|
+
if ((state === null || state === void 0 ? void 0 : state.appStates.isMinimized) === undefined || (state === null || state === void 0 ? void 0 : (_state$appStates = state.appStates) === null || _state$appStates === void 0 ? void 0 : _state$appStates.isMinimized) === true) {
|
|
122
102
|
var _state$domainStates3, _state$domainStates3$, _state$domainStates4, _state$domainStates4$;
|
|
123
103
|
dispatch({
|
|
124
104
|
type: LiveChatWidgetActionType.SET_MINIMIZED,
|
|
@@ -143,6 +123,28 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
|
|
|
143
123
|
type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
144
124
|
payload: ConversationState.Loading
|
|
145
125
|
});
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Send max event, since there is a path coming from hide button + LCW SDK that intialize the components
|
|
129
|
+
* but dont maximize it.
|
|
130
|
+
*
|
|
131
|
+
* This is because a new change to control OOH as closed event when a widget is coming from chat.
|
|
132
|
+
*/
|
|
133
|
+
if ((state === null || state === void 0 ? void 0 : state.appStates.isMinimized) === undefined || (state === null || state === void 0 ? void 0 : (_state$appStates2 = state.appStates) === null || _state$appStates2 === void 0 ? void 0 : _state$appStates2.isMinimized) === true) {
|
|
134
|
+
var _state$domainStates5, _state$domainStates5$, _state$domainStates6, _state$domainStates6$;
|
|
135
|
+
dispatch({
|
|
136
|
+
type: LiveChatWidgetActionType.SET_MINIMIZED,
|
|
137
|
+
payload: false
|
|
138
|
+
});
|
|
139
|
+
// this event will notify the upper layer to maximize the widget, an event missing during multi-tab scenario.
|
|
140
|
+
BroadcastService.postMessage({
|
|
141
|
+
eventName: BroadcastEvent.MaximizeChat,
|
|
142
|
+
payload: {
|
|
143
|
+
height: state === null || state === void 0 ? void 0 : (_state$domainStates5 = state.domainStates) === null || _state$domainStates5 === void 0 ? void 0 : (_state$domainStates5$ = _state$domainStates5.widgetSize) === null || _state$domainStates5$ === void 0 ? void 0 : _state$domainStates5$.height,
|
|
144
|
+
width: state === null || state === void 0 ? void 0 : (_state$domainStates6 = state.domainStates) === null || _state$domainStates6 === void 0 ? void 0 : (_state$domainStates6$ = _state$domainStates6.widgetSize) === null || _state$domainStates6$ === void 0 ? void 0 : _state$domainStates6$.width
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
}
|
|
146
148
|
const optionalParams = {
|
|
147
149
|
isProactiveChat
|
|
148
150
|
};
|
|
@@ -152,31 +154,28 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
|
|
|
152
154
|
|
|
153
155
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
154
156
|
const initStartChat = async (facadeChatSDK, dispatch, setAdapter, state, props, params, persistedState) => {
|
|
155
|
-
var _state$
|
|
157
|
+
var _state$domainStates7, _state$domainStates7$, _state$domainStates7$2;
|
|
156
158
|
let isStartChatSuccessful = false;
|
|
157
|
-
const persistentChatEnabled = await isPersistentChatEnabled(state === null || state === void 0 ? void 0 : (_state$
|
|
159
|
+
const persistentChatEnabled = await isPersistentChatEnabled(state === null || state === void 0 ? void 0 : (_state$domainStates7 = state.domainStates) === null || _state$domainStates7 === void 0 ? void 0 : (_state$domainStates7$ = _state$domainStates7.liveChatConfig) === null || _state$domainStates7$ === void 0 ? void 0 : (_state$domainStates7$2 = _state$domainStates7$.LiveWSAndLiveChatEngJoin) === null || _state$domainStates7$2 === void 0 ? void 0 : _state$domainStates7$2.msdyn_conversationmode);
|
|
158
160
|
if ((state === null || state === void 0 ? void 0 : state.appStates.conversationState) === ConversationState.Closed) {
|
|
159
161
|
// Preventive reset to avoid starting chat with previous requestId which could potentially cause problems
|
|
160
162
|
chatSDKStateCleanUp(facadeChatSDK.getChatSDK());
|
|
161
163
|
}
|
|
162
164
|
try {
|
|
163
|
-
var _state$
|
|
165
|
+
var _state$appStates3;
|
|
164
166
|
// Clear disconnect state on start chat
|
|
165
|
-
(state === null || state === void 0 ? void 0 : (_state$
|
|
167
|
+
(state === null || state === void 0 ? void 0 : (_state$appStates3 = state.appStates) === null || _state$appStates3 === void 0 ? void 0 : _state$appStates3.chatDisconnectEventReceived) && dispatch({
|
|
166
168
|
type: LiveChatWidgetActionType.SET_CHAT_DISCONNECT_EVENT_RECEIVED,
|
|
167
169
|
payload: false
|
|
168
170
|
});
|
|
169
171
|
|
|
170
172
|
//Start widget load timer
|
|
171
173
|
TelemetryTimers.WidgetLoadTimer = createTimer();
|
|
172
|
-
TelemetryHelper.
|
|
174
|
+
TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
|
|
173
175
|
Event: TelemetryEvent.WidgetLoadStarted,
|
|
174
|
-
Description: "Widget
|
|
176
|
+
Description: "Widget start chat started."
|
|
175
177
|
});
|
|
176
178
|
|
|
177
|
-
// Auth token retrieval needs to happen during start chat to support pop-out chat
|
|
178
|
-
await setAuthenticationIfApplicable(props, facadeChatSDK);
|
|
179
|
-
|
|
180
179
|
//Check if chat retrieved from cache
|
|
181
180
|
if (persistedState || params !== null && params !== void 0 && params.liveChatContext) {
|
|
182
181
|
var _persistedState$domai, _persistedState$domai2, _persistedState$domai3, _persistedState$domai4, _persistedState$domai5;
|
|
@@ -283,9 +282,9 @@ const createAdapterAndSubscribe = async (facadeChatSDK, dispatch, setAdapter, pr
|
|
|
283
282
|
};
|
|
284
283
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
285
284
|
const canConnectToExistingChat = async (props, facadeChatSDK, state, dispatch, setAdapter) => {
|
|
286
|
-
var _state$
|
|
285
|
+
var _state$appStates4, _persistedState$domai6, _persistedState$appSt;
|
|
287
286
|
// By pass this function in case of popout chat
|
|
288
|
-
if ((state === null || state === void 0 ? void 0 : (_state$
|
|
287
|
+
if ((state === null || state === void 0 ? void 0 : (_state$appStates4 = state.appStates) === null || _state$appStates4 === void 0 ? void 0 : _state$appStates4.hideStartChatButton) === true) {
|
|
289
288
|
return false;
|
|
290
289
|
}
|
|
291
290
|
const persistedState = getStateFromCache(getWidgetCacheIdfromProps(props));
|
|
@@ -308,17 +307,17 @@ const canConnectToExistingChat = async (props, facadeChatSDK, state, dispatch, s
|
|
|
308
307
|
|
|
309
308
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
310
309
|
const setCustomContextParams = async (state, props) => {
|
|
311
|
-
var _props$chatConfig, _props$chatConfig$Liv, _state$
|
|
310
|
+
var _props$chatConfig, _props$chatConfig$Liv, _state$domainStates8, _persistedState$domai8;
|
|
312
311
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
313
312
|
const isAuthenticatedChat = props !== null && props !== void 0 && (_props$chatConfig = props.chatConfig) !== null && _props$chatConfig !== void 0 && (_props$chatConfig$Liv = _props$chatConfig.LiveChatConfigAuthSettings) !== null && _props$chatConfig$Liv !== void 0 && _props$chatConfig$Liv.msdyn_javascriptclientfunction ? true : false;
|
|
314
313
|
//Should not set custom context for auth chat
|
|
315
314
|
if (isAuthenticatedChat) {
|
|
316
315
|
return;
|
|
317
316
|
}
|
|
318
|
-
if (state !== null && state !== void 0 && (_state$
|
|
319
|
-
var _state$
|
|
317
|
+
if (state !== null && state !== void 0 && (_state$domainStates8 = state.domainStates) !== null && _state$domainStates8 !== void 0 && _state$domainStates8.customContext) {
|
|
318
|
+
var _state$domainStates9;
|
|
320
319
|
optionalParams = Object.assign({}, optionalParams, {
|
|
321
|
-
customContext: JSON.parse(JSON.stringify(state === null || state === void 0 ? void 0 : (_state$
|
|
320
|
+
customContext: JSON.parse(JSON.stringify(state === null || state === void 0 ? void 0 : (_state$domainStates9 = state.domainStates) === null || _state$domainStates9 === void 0 ? void 0 : _state$domainStates9.customContext))
|
|
322
321
|
});
|
|
323
322
|
return;
|
|
324
323
|
}
|
|
@@ -366,9 +365,9 @@ const canStartPopoutChat = async props => {
|
|
|
366
365
|
|
|
367
366
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
368
367
|
const checkIfConversationStillValid = async (facadeChatSDK, dispatch, state) => {
|
|
369
|
-
var _state$
|
|
370
|
-
const requestIdFromCache = (_state$
|
|
371
|
-
const liveChatContext = state === null || state === void 0 ? void 0 : (_state$
|
|
368
|
+
var _state$domainStates10, _state$domainStates11, _state$domainStates12;
|
|
369
|
+
const requestIdFromCache = (_state$domainStates10 = state.domainStates) === null || _state$domainStates10 === void 0 ? void 0 : (_state$domainStates11 = _state$domainStates10.liveChatContext) === null || _state$domainStates11 === void 0 ? void 0 : _state$domainStates11.requestId;
|
|
370
|
+
const liveChatContext = state === null || state === void 0 ? void 0 : (_state$domainStates12 = state.domainStates) === null || _state$domainStates12 === void 0 ? void 0 : _state$domainStates12.liveChatContext;
|
|
372
371
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
373
372
|
let conversationDetails = undefined;
|
|
374
373
|
// Preserve current requestId
|
|
@@ -385,6 +384,10 @@ const checkIfConversationStillValid = async (facadeChatSDK, dispatch, state) =>
|
|
|
385
384
|
type: LiveChatWidgetActionType.SET_LIVE_CHAT_CONTEXT,
|
|
386
385
|
payload: undefined
|
|
387
386
|
});
|
|
387
|
+
dispatch({
|
|
388
|
+
type: LiveChatWidgetActionType.SET_UNREAD_MESSAGE_COUNT,
|
|
389
|
+
payload: 0
|
|
390
|
+
});
|
|
388
391
|
if (currentRequestId) {
|
|
389
392
|
facadeChatSDK.getChatSDK().requestId = currentRequestId;
|
|
390
393
|
}
|
|
@@ -106,8 +106,9 @@ const logWidgetLoadFailed = ex => {
|
|
|
106
106
|
if (ex !== null && ex !== void 0 && ex.httpResponseStatusCode) {
|
|
107
107
|
exDetails.HttpResponseStatusCode = ex.httpResponseStatusCode;
|
|
108
108
|
}
|
|
109
|
-
TelemetryHelper.
|
|
109
|
+
TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.ERROR, {
|
|
110
110
|
Event: TelemetryEvent.WidgetLoadFailed,
|
|
111
|
+
Description: "Widget load complete with error",
|
|
111
112
|
ExceptionDetails: exDetails,
|
|
112
113
|
ElapsedTimeInMilliseconds: TelemetryTimers === null || TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg = TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg === void 0 ? void 0 : _TelemetryTimers$Widg.milliSecondsElapsed
|
|
113
114
|
});
|
|
@@ -118,7 +119,7 @@ export const logWidgetLoadComplete = additionalMessage => {
|
|
|
118
119
|
if (additionalMessage) {
|
|
119
120
|
descriptionString += `. ${additionalMessage}`;
|
|
120
121
|
}
|
|
121
|
-
TelemetryHelper.
|
|
122
|
+
TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
|
|
122
123
|
Event: TelemetryEvent.WidgetLoadComplete,
|
|
123
124
|
Description: descriptionString,
|
|
124
125
|
ElapsedTimeInMilliseconds: TelemetryTimers === null || TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg2 = TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg2 === void 0 ? void 0 : _TelemetryTimers$Widg2.milliSecondsElapsed
|
|
@@ -133,8 +134,8 @@ const logWidgetLoadCompleteWithError = ex => {
|
|
|
133
134
|
if (ex !== null && ex !== void 0 && ex.httpResponseStatusCode) {
|
|
134
135
|
exDetails.HttpResponseStatusCode = ex.httpResponseStatusCode;
|
|
135
136
|
}
|
|
136
|
-
TelemetryHelper.
|
|
137
|
-
Event: TelemetryEvent.
|
|
137
|
+
TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.ERROR, {
|
|
138
|
+
Event: TelemetryEvent.WidgetLoadFailed,
|
|
138
139
|
Description: "Widget load complete with error",
|
|
139
140
|
ExceptionDetails: exDetails,
|
|
140
141
|
ElapsedTimeInMilliseconds: TelemetryTimers === null || TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg3 = TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg3 === void 0 ? void 0 : _TelemetryTimers$Widg3.milliSecondsElapsed
|