@microsoft/omnichannel-chat-widget 1.7.8-main.29ce174 → 1.7.8-main.2bcb0b6
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 +158 -129
- 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 +17 -14
- 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 +21 -11
- package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +32 -19
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +71 -56
- 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/chatDisconnectHelper.js +3 -1
- package/lib/cjs/components/livechatwidget/common/endChat.js +4 -18
- 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 +8 -25
- package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.js +5 -4
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +14 -12
- package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +12 -8
- package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +16 -10
- 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 +11 -4
- 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/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +4 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +88 -60
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +18 -6
- package/lib/cjs/firstresponselatency/Constants.js +13 -0
- package/lib/cjs/firstresponselatency/FirstMessageTrackerFromBot.js +118 -0
- package/lib/cjs/firstresponselatency/FirstResponseLatencyTracker.js +201 -0
- package/lib/cjs/firstresponselatency/util.js +98 -0
- package/lib/cjs/plugins/createChatTranscript.js +88 -58
- package/lib/cjs/plugins/newMessageEventHandler.js +102 -88
- 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 +158 -129
- 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 +17 -14
- 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 +21 -11
- package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +32 -19
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +71 -56
- 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/chatDisconnectHelper.js +3 -1
- package/lib/esm/components/livechatwidget/common/endChat.js +4 -18
- 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 +9 -26
- package/lib/esm/components/livechatwidget/common/startChatErrorHandler.js +5 -4
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +14 -12
- package/lib/esm/components/ooohpanestateful/OOOHPaneStateful.js +12 -8
- package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +16 -10
- 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 +11 -4
- 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/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +4 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +88 -60
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +18 -6
- package/lib/esm/firstresponselatency/Constants.js +6 -0
- package/lib/esm/firstresponselatency/FirstMessageTrackerFromBot.js +112 -0
- package/lib/esm/firstresponselatency/FirstResponseLatencyTracker.js +194 -0
- package/lib/esm/firstresponselatency/util.js +87 -0
- package/lib/esm/plugins/createChatTranscript.js +88 -58
- package/lib/esm/plugins/newMessageEventHandler.js +100 -86
- 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 -257
- 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 -0
- package/lib/types/firstresponselatency/FirstMessageTrackerFromBot.d.ts +1 -0
- package/lib/types/firstresponselatency/FirstResponseLatencyTracker.d.ts +22 -0
- package/lib/types/firstresponselatency/util.d.ts +7 -0
- 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 +41 -16
|
@@ -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); }
|
|
@@ -6,21 +9,9 @@ import { getAuthClientFunction, handleAuthentication } from "../../components/li
|
|
|
6
9
|
import { BroadcastService } from "@microsoft/omnichannel-chat-components";
|
|
7
10
|
import { TelemetryHelper } from "../telemetry/TelemetryHelper";
|
|
8
11
|
import { isNullOrEmptyString } from "../utils";
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
getChatSDK() {
|
|
14
|
-
return this.chatSDK;
|
|
15
|
-
}
|
|
16
|
-
destroy() {
|
|
17
|
-
this.token = null;
|
|
18
|
-
this.expiration = 0;
|
|
19
|
-
}
|
|
20
|
-
isTokenSet() {
|
|
21
|
-
return !isNullOrEmptyString(this.token);
|
|
22
|
-
}
|
|
23
|
-
constructor(input, disableReauthentication) {
|
|
12
|
+
export let FacadeChatSDK = /*#__PURE__*/function () {
|
|
13
|
+
function FacadeChatSDK(input, disableReauthentication) {
|
|
14
|
+
_classCallCheck(this, FacadeChatSDK);
|
|
24
15
|
_defineProperty(this, "chatSDK", void 0);
|
|
25
16
|
_defineProperty(this, "chatConfig", void 0);
|
|
26
17
|
_defineProperty(this, "token", "");
|
|
@@ -38,310 +29,416 @@ export class FacadeChatSDK {
|
|
|
38
29
|
}
|
|
39
30
|
|
|
40
31
|
//set default expiration to zero, for undefined or missed exp in jwt
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
32
|
+
_createClass(FacadeChatSDK, [{
|
|
33
|
+
key: "isSDKMocked",
|
|
34
|
+
value: function isSDKMocked() {
|
|
35
|
+
return this.sdkMocked;
|
|
36
|
+
}
|
|
37
|
+
}, {
|
|
38
|
+
key: "getChatSDK",
|
|
39
|
+
value: function getChatSDK() {
|
|
40
|
+
return this.chatSDK;
|
|
41
|
+
}
|
|
42
|
+
}, {
|
|
43
|
+
key: "destroy",
|
|
44
|
+
value: function destroy() {
|
|
45
|
+
this.token = null;
|
|
46
|
+
this.expiration = 0;
|
|
47
|
+
}
|
|
48
|
+
}, {
|
|
49
|
+
key: "isTokenSet",
|
|
50
|
+
value: function isTokenSet() {
|
|
51
|
+
return !isNullOrEmptyString(this.token);
|
|
54
52
|
}
|
|
53
|
+
}, {
|
|
54
|
+
key: "convertExpiration",
|
|
55
|
+
value: function convertExpiration() {
|
|
56
|
+
let expiration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
57
|
+
// Converting expiration to seconds, if contains decimals or is identified as milliseconds
|
|
58
|
+
if (expiration.toString().length === 13) {
|
|
59
|
+
return Math.floor(expiration / 1000);
|
|
60
|
+
}
|
|
61
|
+
// If the epoch value is already in seconds, return it as is
|
|
62
|
+
return expiration;
|
|
63
|
+
}
|
|
64
|
+
}, {
|
|
65
|
+
key: "isTokenExpired",
|
|
66
|
+
value: function isTokenExpired() {
|
|
67
|
+
// if expiration is 0, token is not going to be validated ( this is to cover the case of token with no expiration)
|
|
68
|
+
if (this.expiration === 0) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
55
71
|
|
|
56
|
-
|
|
57
|
-
|
|
72
|
+
// obtain current time in seconds
|
|
73
|
+
const now = Math.floor(Date.now() / 1000);
|
|
58
74
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
75
|
+
// compare expiration time with current time
|
|
76
|
+
if (now > this.expiration) {
|
|
77
|
+
console.error("Token is expired", now, this.expiration, now > this.expiration);
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
return false;
|
|
63
81
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
82
|
+
}, {
|
|
83
|
+
key: "enforceBase64Encoding",
|
|
84
|
+
value: function enforceBase64Encoding(payload) {
|
|
85
|
+
//base64url when present, switches the "-" and "_" characters with "+" and "/"
|
|
86
|
+
const base64Payload = payload.replace(/-/g, "+").replace(/_/g, "/");
|
|
87
|
+
// since base64 encoding requires padding, we need to add padding to the payload
|
|
88
|
+
return base64Payload.padEnd(base64Payload.length + (4 - base64Payload.length % 4) % 4, "=");
|
|
89
|
+
}
|
|
90
|
+
}, {
|
|
91
|
+
key: "extractExpFromToken",
|
|
92
|
+
value: function extractExpFromToken(token) {
|
|
93
|
+
const tokenParts = token.split(".");
|
|
94
|
+
const last3digits = token.slice(-3);
|
|
75
95
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
try {
|
|
89
|
-
const payload = this.enforceBase64Encoding(tokenParts[1]);
|
|
90
|
-
// decode payload
|
|
91
|
-
const decodedPayload = atob(payload);
|
|
92
|
-
const jsonPayload = JSON.parse(decodedPayload);
|
|
93
|
-
// check if exp is present in payload
|
|
94
|
-
if (jsonPayload) {
|
|
95
|
-
if (jsonPayload.exp) {
|
|
96
|
-
return jsonPayload.exp;
|
|
97
|
-
}
|
|
98
|
-
return 0;
|
|
96
|
+
// token must have 3 parts as JWT format
|
|
97
|
+
if (tokenParts.length !== 3) {
|
|
98
|
+
TelemetryHelper.logFacadeChatSDKEventToAllTelemetry(LogLevel.ERROR, {
|
|
99
|
+
Event: TelemetryEvent.NewTokenValidationFailed,
|
|
100
|
+
Description: "Invalid token format",
|
|
101
|
+
ExceptionDetails: {
|
|
102
|
+
message: "Invalid token format, must be in JWT format",
|
|
103
|
+
token: last3digits
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
throw new Error("Invalid token format, must be in JWT format");
|
|
99
107
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
TelemetryHelper.logFacadeChatSDKEvent(LogLevel.ERROR, {
|
|
112
|
-
Event: TelemetryEvent.NewTokenFailed,
|
|
113
|
-
Description: "Failed to decode token",
|
|
114
|
-
ExceptionDetails: {
|
|
115
|
-
message: "Failed to decode token",
|
|
116
|
-
token: last3digits
|
|
108
|
+
try {
|
|
109
|
+
const payload = this.enforceBase64Encoding(tokenParts[1]);
|
|
110
|
+
// decode payload
|
|
111
|
+
const decodedPayload = atob(payload);
|
|
112
|
+
const jsonPayload = JSON.parse(decodedPayload);
|
|
113
|
+
// check if exp is present in payload
|
|
114
|
+
if (jsonPayload) {
|
|
115
|
+
if (jsonPayload.exp) {
|
|
116
|
+
return jsonPayload.exp;
|
|
117
|
+
}
|
|
118
|
+
return 0;
|
|
117
119
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
TelemetryHelper.logFacadeChatSDKEvent(LogLevel.ERROR, {
|
|
133
|
-
Event: TelemetryEvent.NewTokenExpired,
|
|
134
|
-
Description: "New token is already expired",
|
|
120
|
+
TelemetryHelper.logFacadeChatSDKEventToAllTelemetry(LogLevel.ERROR, {
|
|
121
|
+
Event: TelemetryEvent.NewTokenValidationFailed,
|
|
122
|
+
Description: "Invalid token payload",
|
|
123
|
+
ExceptionDetails: {
|
|
124
|
+
message: "Token payload is not valid JSON",
|
|
125
|
+
token: last3digits
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
throw new Error("Invalid token payload, payload is not valid JSON");
|
|
129
|
+
} catch (e) {
|
|
130
|
+
console.error("Failed to decode token", e);
|
|
131
|
+
TelemetryHelper.logFacadeChatSDKEventToAllTelemetry(LogLevel.ERROR, {
|
|
132
|
+
Event: TelemetryEvent.NewTokenValidationFailed,
|
|
133
|
+
Description: "Failed to decode token",
|
|
135
134
|
ExceptionDetails: {
|
|
136
|
-
"
|
|
137
|
-
|
|
138
|
-
"Token": last3digits
|
|
135
|
+
message: "Failed to decode token",
|
|
136
|
+
token: last3digits
|
|
139
137
|
}
|
|
140
138
|
});
|
|
141
|
-
throw new Error(
|
|
139
|
+
throw new Error("Failed to decode token");
|
|
142
140
|
}
|
|
143
141
|
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
if (this.isTokenSet() && !this.isTokenExpired()) {
|
|
169
|
-
return {
|
|
170
|
-
result: true,
|
|
171
|
-
message: "Token is valid"
|
|
172
|
-
};
|
|
142
|
+
}, {
|
|
143
|
+
key: "setToken",
|
|
144
|
+
value: async function setToken(token) {
|
|
145
|
+
// token must be not null, and must be new
|
|
146
|
+
if (!isNullOrEmptyString(token) && token !== this.token) {
|
|
147
|
+
const last3digits = token.slice(-3);
|
|
148
|
+
const instant = Math.floor(Date.now() / 1000);
|
|
149
|
+
this.token = token;
|
|
150
|
+
// calculate expiration time
|
|
151
|
+
this.expiration = this.convertExpiration(this.extractExpFromToken(token) || 0);
|
|
152
|
+
// this is a control , in case the getAuthToken function returns same token
|
|
153
|
+
if (this.expiration > 0 && this.expiration < instant) {
|
|
154
|
+
TelemetryHelper.logFacadeChatSDKEventToAllTelemetry(LogLevel.ERROR, {
|
|
155
|
+
Event: TelemetryEvent.NewTokenValidationFailed,
|
|
156
|
+
Description: "New token is already expired",
|
|
157
|
+
ExceptionDetails: {
|
|
158
|
+
"Instant": instant,
|
|
159
|
+
"Expiration": this.expiration,
|
|
160
|
+
"Token": last3digits
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
throw new Error(`New token is already expired, with epoch time ${this.expiration} , last 3 digits of token: ${last3digits}`);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
173
166
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
};
|
|
167
|
+
}, {
|
|
168
|
+
key: "corroborateTokenIsSet",
|
|
169
|
+
value: async function corroborateTokenIsSet(chatSDK) {
|
|
170
|
+
var _chatSDK$chatSDKConfi;
|
|
171
|
+
// if getAuthToken is not set, it's because handleAuthentication hasnt being called
|
|
172
|
+
// so we need to call it
|
|
173
|
+
if (this.isAuthenticated && (chatSDK === null || chatSDK === void 0 ? void 0 : (_chatSDK$chatSDKConfi = chatSDK.chatSDKConfig) === null || _chatSDK$chatSDKConfi === void 0 ? void 0 : _chatSDK$chatSDKConfi.getAuthToken) === undefined) {
|
|
174
|
+
handleAuthentication(this.chatSDK, this.chatConfig, this.getAuthToken);
|
|
175
|
+
}
|
|
184
176
|
}
|
|
177
|
+
}, {
|
|
178
|
+
key: "tokenRing",
|
|
179
|
+
value: async function tokenRing() {
|
|
180
|
+
var _this$chatSDK$chatSDK;
|
|
181
|
+
if (this.disableReauthentication === true) {
|
|
182
|
+
// Since we are not validating the token anymore, we at least need to check if the token is set
|
|
183
|
+
// no need to validate anything other that the token is set
|
|
184
|
+
await this.corroborateTokenIsSet(this.chatSDK);
|
|
185
|
+
// facade feature is disabled, so we are bypassing the re authentication and let it fail.
|
|
186
|
+
return {
|
|
187
|
+
result: true,
|
|
188
|
+
message: "Facade is disabled"
|
|
189
|
+
};
|
|
190
|
+
}
|
|
185
191
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
Event: TelemetryEvent.NewTokenSuccess,
|
|
195
|
-
Description: "New Token obtained",
|
|
196
|
-
Data: {
|
|
197
|
-
"Token_Expiration": this.expiration
|
|
198
|
-
}
|
|
199
|
-
});
|
|
192
|
+
// this is needed for storybooks, specifically for reconnect pane which requires authentication bypass
|
|
193
|
+
if (this.sdkMocked === true) {
|
|
194
|
+
return {
|
|
195
|
+
result: true,
|
|
196
|
+
message: "Authentication not needed"
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
if (!this.isAuthenticated) {
|
|
200
200
|
return {
|
|
201
201
|
result: true,
|
|
202
|
-
message: "
|
|
202
|
+
message: "Authentication not needed"
|
|
203
203
|
};
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
204
|
+
}
|
|
205
|
+
if (this.isTokenSet() && !this.isTokenExpired()) {
|
|
206
|
+
return {
|
|
207
|
+
result: true,
|
|
208
|
+
message: "Token is valid"
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
TelemetryHelper.logFacadeChatSDKEventToAllTelemetry(LogLevel.INFO, {
|
|
212
|
+
Event: TelemetryEvent.NewTokenValidationStarted,
|
|
213
|
+
Description: "Token validation started."
|
|
214
|
+
});
|
|
215
|
+
if (this.getAuthToken === undefined && ((_this$chatSDK$chatSDK = this.chatSDK.chatSDKConfig) === null || _this$chatSDK$chatSDK === void 0 ? void 0 : _this$chatSDK$chatSDK.getAuthToken) === undefined) {
|
|
216
|
+
TelemetryHelper.logFacadeChatSDKEventToAllTelemetry(LogLevel.ERROR, {
|
|
217
|
+
Event: TelemetryEvent.NewTokenValidationFailed,
|
|
218
|
+
Description: "GetAuthToken function is not present",
|
|
219
|
+
ExceptionDetails: "Missing function : " + getAuthClientFunction(this.chatConfig)
|
|
210
220
|
});
|
|
211
221
|
return {
|
|
212
222
|
result: false,
|
|
213
|
-
message:
|
|
223
|
+
message: "GetAuthToken function is not present"
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// if token is not set, or token is already expired , then go to grab a token
|
|
228
|
+
this.token = "";
|
|
229
|
+
this.expiration = 0;
|
|
230
|
+
try {
|
|
231
|
+
const ring = await handleAuthentication(this.chatSDK, this.chatConfig, this.getAuthToken);
|
|
232
|
+
if ((ring === null || ring === void 0 ? void 0 : ring.result) === true && ring !== null && ring !== void 0 && ring.token) {
|
|
233
|
+
await this.setToken(ring.token);
|
|
234
|
+
TelemetryHelper.logFacadeChatSDKEventToAllTelemetry(LogLevel.INFO, {
|
|
235
|
+
Event: TelemetryEvent.NewTokenValidationCompleted,
|
|
236
|
+
Description: "New Token obtained",
|
|
237
|
+
Data: {
|
|
238
|
+
"Token_Expiration": this.expiration
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
return {
|
|
242
|
+
result: true,
|
|
243
|
+
message: "New Token obtained"
|
|
244
|
+
};
|
|
245
|
+
} else {
|
|
246
|
+
var _ring$error, _ring$error2;
|
|
247
|
+
TelemetryHelper.logFacadeChatSDKEventToAllTelemetry(LogLevel.ERROR, {
|
|
248
|
+
Event: TelemetryEvent.NewTokenValidationFailed,
|
|
249
|
+
Description: (_ring$error = ring.error) === null || _ring$error === void 0 ? void 0 : _ring$error.message,
|
|
250
|
+
ExceptionDetails: ring === null || ring === void 0 ? void 0 : ring.error
|
|
251
|
+
});
|
|
252
|
+
return {
|
|
253
|
+
result: false,
|
|
254
|
+
message: (ring === null || ring === void 0 ? void 0 : (_ring$error2 = ring.error) === null || _ring$error2 === void 0 ? void 0 : _ring$error2.message) || "Failed to get token"
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
} catch (e) {
|
|
258
|
+
console.error("Unexpected error while getting token", e);
|
|
259
|
+
TelemetryHelper.logFacadeChatSDKEventToAllTelemetry(LogLevel.ERROR, {
|
|
260
|
+
Event: TelemetryEvent.NewTokenValidationFailed,
|
|
261
|
+
Description: "Unexpected error while getting token",
|
|
262
|
+
ExceptionDetails: e
|
|
263
|
+
});
|
|
264
|
+
return {
|
|
265
|
+
result: false,
|
|
266
|
+
message: "Unexpected error while getting token"
|
|
214
267
|
};
|
|
215
268
|
}
|
|
216
|
-
} catch (e) {
|
|
217
|
-
console.error("Unexpected error while getting token", e);
|
|
218
|
-
TelemetryHelper.logFacadeChatSDKEvent(LogLevel.ERROR, {
|
|
219
|
-
Event: TelemetryEvent.NewTokenFailed,
|
|
220
|
-
Description: "Unexpected error while getting token",
|
|
221
|
-
ExceptionDetails: e
|
|
222
|
-
});
|
|
223
|
-
return {
|
|
224
|
-
result: false,
|
|
225
|
-
message: "Unexpected error while getting token"
|
|
226
|
-
};
|
|
227
269
|
}
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
const executionErrorMessage = `Authentication failed: Process to get a token failed for ${functionName}, ${pingResponse.message}`;
|
|
235
|
-
//telemetry is already logged in tokenRing, so no need to log again, just return the error and communicate to the console
|
|
236
|
-
console.error(executionErrorMessage);
|
|
237
|
-
BroadcastService.postMessage({
|
|
238
|
-
eventName: BroadcastEvent.OnWidgetError,
|
|
239
|
-
payload: {
|
|
240
|
-
errorMessage: executionErrorMessage
|
|
270
|
+
}, {
|
|
271
|
+
key: "validateAndExecuteCall",
|
|
272
|
+
value: async function validateAndExecuteCall(functionName, fn) {
|
|
273
|
+
const pingResponse = await this.tokenRing();
|
|
274
|
+
if (pingResponse.result === true) {
|
|
275
|
+
return fn();
|
|
241
276
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
277
|
+
const executionErrorMessage = `Authentication failed: Process to get a token failed for ${functionName}, ${pingResponse.message}`;
|
|
278
|
+
//telemetry is already logged in tokenRing, so no need to log again, just return the error and communicate to the console
|
|
279
|
+
console.error(executionErrorMessage);
|
|
280
|
+
BroadcastService.postMessage({
|
|
281
|
+
eventName: BroadcastEvent.OnWidgetError,
|
|
282
|
+
payload: {
|
|
283
|
+
errorMessage: executionErrorMessage
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
throw new Error(executionErrorMessage);
|
|
287
|
+
}
|
|
288
|
+
}, {
|
|
289
|
+
key: "initialize",
|
|
290
|
+
value: async function initialize() {
|
|
291
|
+
let optionalParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
292
|
+
return this.validateAndExecuteCall("initialize", () => this.chatSDK.initialize(optionalParams));
|
|
293
|
+
}
|
|
294
|
+
}, {
|
|
295
|
+
key: "getChatReconnectContext",
|
|
296
|
+
value: async function getChatReconnectContext() {
|
|
297
|
+
let optionalParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
298
|
+
return this.validateAndExecuteCall("getChatReconnectContext", () => this.chatSDK.getChatReconnectContext(optionalParams));
|
|
299
|
+
}
|
|
300
|
+
}, {
|
|
301
|
+
key: "startChat",
|
|
302
|
+
value: async function startChat() {
|
|
303
|
+
let optionalParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
304
|
+
return this.validateAndExecuteCall("startChat", () => this.chatSDK.startChat(optionalParams));
|
|
305
|
+
}
|
|
306
|
+
}, {
|
|
307
|
+
key: "endChat",
|
|
308
|
+
value: async function endChat() {
|
|
309
|
+
let optionalParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
310
|
+
return this.validateAndExecuteCall("endChat", () => this.chatSDK.endChat(optionalParams));
|
|
311
|
+
}
|
|
312
|
+
}, {
|
|
313
|
+
key: "getCurrentLiveChatContext",
|
|
314
|
+
value: async function getCurrentLiveChatContext() {
|
|
315
|
+
return this.validateAndExecuteCall("getCurrentLiveChatContext", () => this.chatSDK.getCurrentLiveChatContext());
|
|
316
|
+
}
|
|
317
|
+
}, {
|
|
318
|
+
key: "getConversationDetails",
|
|
319
|
+
value: async function getConversationDetails() {
|
|
320
|
+
let optionalParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
321
|
+
return this.validateAndExecuteCall("getConversationDetails", () => this.chatSDK.getConversationDetails(optionalParams));
|
|
322
|
+
}
|
|
268
323
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
324
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
325
|
+
}, {
|
|
326
|
+
key: "getPreChatSurvey",
|
|
327
|
+
value: async function getPreChatSurvey() {
|
|
328
|
+
let parse = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
329
|
+
//prechat survey is obtained from config object, which is not required to be authenticated
|
|
330
|
+
// removing the tokenRing function from this call for backward compatibility
|
|
331
|
+
// TODO :: wrap this function around authentication
|
|
332
|
+
return this.chatSDK.getPreChatSurvey(parse);
|
|
333
|
+
}
|
|
334
|
+
}, {
|
|
335
|
+
key: "getLiveChatConfig",
|
|
336
|
+
value: async function getLiveChatConfig(optionalParams) {
|
|
337
|
+
return this.validateAndExecuteCall("getLiveChatConfig", () => this.chatSDK.getLiveChatConfig(optionalParams));
|
|
338
|
+
}
|
|
339
|
+
}, {
|
|
340
|
+
key: "getChatToken",
|
|
341
|
+
value: async function getChatToken() {
|
|
342
|
+
let cached = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
343
|
+
let optionalParams = arguments.length > 1 ? arguments[1] : undefined;
|
|
344
|
+
return this.validateAndExecuteCall("getChatToken", () => this.chatSDK.getChatToken(cached, optionalParams));
|
|
345
|
+
}
|
|
346
|
+
}, {
|
|
347
|
+
key: "getCallingToken",
|
|
348
|
+
value: async function getCallingToken() {
|
|
349
|
+
return this.validateAndExecuteCall("getCallingToken", () => this.chatSDK.getCallingToken());
|
|
350
|
+
}
|
|
351
|
+
}, {
|
|
352
|
+
key: "getMessages",
|
|
353
|
+
value: async function getMessages() {
|
|
354
|
+
return this.validateAndExecuteCall("getMessages", () => this.chatSDK.getMessages());
|
|
355
|
+
}
|
|
356
|
+
}, {
|
|
357
|
+
key: "getDataMaskingRules",
|
|
358
|
+
value: async function getDataMaskingRules() {
|
|
359
|
+
return this.validateAndExecuteCall("getDataMaskingRules", () => this.chatSDK.getDataMaskingRules());
|
|
360
|
+
}
|
|
361
|
+
}, {
|
|
362
|
+
key: "sendMessage",
|
|
363
|
+
value: async function sendMessage(message) {
|
|
364
|
+
return this.validateAndExecuteCall("sendMessage", () => this.chatSDK.sendMessage(message));
|
|
365
|
+
}
|
|
366
|
+
}, {
|
|
367
|
+
key: "onNewMessage",
|
|
368
|
+
value: async function onNewMessage(onNewMessageCallback) {
|
|
369
|
+
let optionalParams = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
370
|
+
disablePolling: false
|
|
371
|
+
};
|
|
372
|
+
return this.validateAndExecuteCall("onNewMessage", () => this.chatSDK.onNewMessage(onNewMessageCallback, optionalParams));
|
|
373
|
+
}
|
|
374
|
+
}, {
|
|
375
|
+
key: "sendTypingEvent",
|
|
376
|
+
value: async function sendTypingEvent() {
|
|
377
|
+
return this.validateAndExecuteCall("sendTypingEvent", () => this.chatSDK.sendTypingEvent());
|
|
378
|
+
}
|
|
379
|
+
}, {
|
|
380
|
+
key: "onTypingEvent",
|
|
381
|
+
value: async function onTypingEvent(onTypingEventCallback) {
|
|
382
|
+
return this.validateAndExecuteCall("onTypingEvent", () => this.chatSDK.onTypingEvent(onTypingEventCallback));
|
|
383
|
+
}
|
|
384
|
+
}, {
|
|
385
|
+
key: "onAgentEndSession",
|
|
386
|
+
value: async function onAgentEndSession(onAgentEndSessionCallback) {
|
|
387
|
+
return this.validateAndExecuteCall("onAgentEndSession", () => this.chatSDK.onAgentEndSession(onAgentEndSessionCallback));
|
|
388
|
+
}
|
|
389
|
+
}, {
|
|
390
|
+
key: "uploadFileAttachment",
|
|
391
|
+
value: async function uploadFileAttachment(fileInfo) {
|
|
392
|
+
return this.validateAndExecuteCall("uploadFileAttachment", () => this.chatSDK.uploadFileAttachment(fileInfo));
|
|
393
|
+
}
|
|
394
|
+
}, {
|
|
395
|
+
key: "downloadFileAttachment",
|
|
396
|
+
value: async function downloadFileAttachment(fileMetadata) {
|
|
397
|
+
return this.validateAndExecuteCall("downloadFileAttachment", () => this.chatSDK.downloadFileAttachment(fileMetadata));
|
|
398
|
+
}
|
|
399
|
+
}, {
|
|
400
|
+
key: "emailLiveChatTranscript",
|
|
401
|
+
value: async function emailLiveChatTranscript(body) {
|
|
402
|
+
let optionalParams = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
403
|
+
return this.validateAndExecuteCall("emailLiveChatTranscript", () => this.chatSDK.emailLiveChatTranscript(body, optionalParams));
|
|
404
|
+
}
|
|
405
|
+
}, {
|
|
406
|
+
key: "getLiveChatTranscript",
|
|
407
|
+
value: async function getLiveChatTranscript() {
|
|
408
|
+
let optionalParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
409
|
+
return this.validateAndExecuteCall("getLiveChatTranscript", () => this.chatSDK.getLiveChatTranscript(optionalParams));
|
|
410
|
+
}
|
|
326
411
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
}
|
|
347
|
-
|
|
412
|
+
// response from origin is unknown, but this definition breaks create adapter for shimAdapter, switching to any until type is returned from origin
|
|
413
|
+
}, {
|
|
414
|
+
key: "createChatAdapter",
|
|
415
|
+
value: async function createChatAdapter() {
|
|
416
|
+
let optionalParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
417
|
+
return this.validateAndExecuteCall("createChatAdapter", () => this.chatSDK.createChatAdapter(optionalParams));
|
|
418
|
+
}
|
|
419
|
+
}, {
|
|
420
|
+
key: "isVoiceVideoCallingEnabled",
|
|
421
|
+
value: async function isVoiceVideoCallingEnabled() {
|
|
422
|
+
this.tokenRing();
|
|
423
|
+
return this.chatSDK.isVoiceVideoCallingEnabled();
|
|
424
|
+
}
|
|
425
|
+
}, {
|
|
426
|
+
key: "getVoiceVideoCalling",
|
|
427
|
+
value: async function getVoiceVideoCalling() {
|
|
428
|
+
let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
429
|
+
return this.validateAndExecuteCall("getVoiceVideoCalling", () => this.chatSDK.getVoiceVideoCalling(params));
|
|
430
|
+
}
|
|
431
|
+
}, {
|
|
432
|
+
key: "getPostChatSurveyContext",
|
|
433
|
+
value: async function getPostChatSurveyContext() {
|
|
434
|
+
return this.validateAndExecuteCall("getPostChatSurveyContext", () => this.chatSDK.getPostChatSurveyContext());
|
|
435
|
+
}
|
|
436
|
+
}, {
|
|
437
|
+
key: "getAgentAvailability",
|
|
438
|
+
value: async function getAgentAvailability() {
|
|
439
|
+
let optionalParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
440
|
+
return this.validateAndExecuteCall("getAgentAvailability", () => this.chatSDK.getAgentAvailability(optionalParams));
|
|
441
|
+
}
|
|
442
|
+
}]);
|
|
443
|
+
return FacadeChatSDK;
|
|
444
|
+
}();
|