@microsoft/omnichannel-chat-widget 1.7.4-main.120159a → 1.7.4-main.1f61ac6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/lib/cjs/common/facades/FacadeChatSDK.js +298 -0
  2. package/lib/cjs/common/facades/types/IFacadeChatSDKInput.js +1 -0
  3. package/lib/cjs/common/telemetry/TelemetryConstants.js +6 -0
  4. package/lib/cjs/common/telemetry/TelemetryHelper.js +10 -0
  5. package/lib/cjs/common/utils.js +2 -2
  6. package/lib/cjs/components/callingcontainerstateful/CallingContainerStateful.js +4 -8
  7. package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +5 -6
  8. package/lib/cjs/components/footerstateful/FooterStateful.js +4 -5
  9. package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +8 -10
  10. package/lib/cjs/components/livechatwidget/LiveChatWidget.js +26 -3
  11. package/lib/cjs/components/livechatwidget/common/authHelper.js +14 -5
  12. package/lib/cjs/components/livechatwidget/common/createAdapter.js +9 -9
  13. package/lib/cjs/components/livechatwidget/common/endChat.js +21 -22
  14. package/lib/cjs/components/livechatwidget/common/initCallingSdk.js +3 -3
  15. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +2 -2
  16. package/lib/cjs/components/livechatwidget/common/liveChatConfigUtils.js +2 -3
  17. package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +11 -12
  18. package/lib/cjs/components/livechatwidget/common/renderSurveyHelpers.js +5 -5
  19. package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +4 -4
  20. package/lib/cjs/components/livechatwidget/common/startChat.js +45 -36
  21. package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.js +7 -7
  22. package/lib/cjs/components/livechatwidget/common/updateSessionDataForTelemetry.js +8 -8
  23. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +43 -39
  24. package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +3 -0
  25. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +1 -1
  26. package/lib/cjs/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +4 -2
  27. package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +4 -1
  28. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +4 -4
  29. package/lib/cjs/contexts/FacadeChatSDKStore.js +10 -0
  30. package/lib/cjs/hooks/useFacadeChatSDKStore.js +17 -0
  31. package/lib/cjs/index.js +9 -2
  32. package/lib/cjs/plugins/createChatTranscript.js +2 -2
  33. package/lib/esm/common/facades/FacadeChatSDK.js +291 -0
  34. package/lib/esm/common/facades/types/IFacadeChatSDKInput.js +1 -0
  35. package/lib/esm/common/telemetry/TelemetryConstants.js +6 -0
  36. package/lib/esm/common/telemetry/TelemetryHelper.js +10 -0
  37. package/lib/esm/common/utils.js +2 -2
  38. package/lib/esm/components/callingcontainerstateful/CallingContainerStateful.js +4 -8
  39. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +5 -6
  40. package/lib/esm/components/footerstateful/FooterStateful.js +4 -5
  41. package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +8 -10
  42. package/lib/esm/components/livechatwidget/LiveChatWidget.js +26 -3
  43. package/lib/esm/components/livechatwidget/common/authHelper.js +14 -5
  44. package/lib/esm/components/livechatwidget/common/createAdapter.js +9 -9
  45. package/lib/esm/components/livechatwidget/common/endChat.js +21 -22
  46. package/lib/esm/components/livechatwidget/common/initCallingSdk.js +3 -3
  47. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +2 -2
  48. package/lib/esm/components/livechatwidget/common/liveChatConfigUtils.js +2 -4
  49. package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +11 -12
  50. package/lib/esm/components/livechatwidget/common/renderSurveyHelpers.js +5 -5
  51. package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +4 -4
  52. package/lib/esm/components/livechatwidget/common/startChat.js +45 -36
  53. package/lib/esm/components/livechatwidget/common/startChatErrorHandler.js +7 -7
  54. package/lib/esm/components/livechatwidget/common/updateSessionDataForTelemetry.js +8 -8
  55. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +43 -39
  56. package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +3 -0
  57. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +1 -1
  58. package/lib/esm/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +4 -2
  59. package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +4 -1
  60. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +4 -4
  61. package/lib/esm/contexts/FacadeChatSDKStore.js +4 -0
  62. package/lib/esm/hooks/useFacadeChatSDKStore.js +10 -0
  63. package/lib/esm/index.js +5 -4
  64. package/lib/esm/plugins/createChatTranscript.js +2 -2
  65. package/lib/types/common/facades/FacadeChatSDK.d.ts +71 -0
  66. package/lib/types/common/facades/types/IFacadeChatSDKInput.d.ts +13 -0
  67. package/lib/types/common/telemetry/TelemetryConstants.d.ts +7 -1
  68. package/lib/types/common/telemetry/TelemetryHelper.d.ts +1 -0
  69. package/lib/types/common/telemetry/definitions/Payload.d.ts +6 -0
  70. package/lib/types/common/utils.d.ts +2 -1
  71. package/lib/types/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.d.ts +3 -2
  72. package/lib/types/components/livechatwidget/common/authHelper.d.ts +14 -1
  73. package/lib/types/components/livechatwidget/common/createAdapter.d.ts +2 -1
  74. package/lib/types/components/livechatwidget/common/endChat.d.ts +4 -3
  75. package/lib/types/components/livechatwidget/common/initCallingSdk.d.ts +2 -1
  76. package/lib/types/components/livechatwidget/common/initWebChatComposer.d.ts +2 -1
  77. package/lib/types/components/livechatwidget/common/liveChatConfigUtils.d.ts +2 -1
  78. package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +3 -2
  79. package/lib/types/components/livechatwidget/common/renderSurveyHelpers.d.ts +2 -1
  80. package/lib/types/components/livechatwidget/common/setPostChatContextAndLoadSurvey.d.ts +2 -1
  81. package/lib/types/components/livechatwidget/common/startChat.d.ts +5 -4
  82. package/lib/types/components/livechatwidget/common/startChatErrorHandler.d.ts +2 -1
  83. package/lib/types/components/livechatwidget/common/updateSessionDataForTelemetry.d.ts +2 -1
  84. package/lib/types/components/postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps.d.ts +1 -0
  85. package/lib/types/components/webchatcontainerstateful/common/mockchatsdk.d.ts +2 -1
  86. package/lib/types/contexts/FacadeChatSDKStore.d.ts +1 -0
  87. package/lib/types/hooks/useFacadeChatSDKStore.d.ts +3 -0
  88. package/lib/types/index.d.ts +4 -3
  89. package/lib/types/plugins/createChatTranscript.d.ts +2 -1
  90. package/package.json +2 -2
@@ -109,6 +109,7 @@ export declare enum TelemetryEvent {
109
109
  CloseChatCall = "CloseChatCall",
110
110
  CloseChatMethodException = "CloseChatMethodException",
111
111
  PrechatSurveyLoaded = "PrechatSurveyLoaded",
112
+ PrechatSurveyExpected = "PrechatSurveyExpected",
112
113
  PrechatSubmitted = "PrechatSubmitted",
113
114
  StartChatSDKCall = "StartChatCall",
114
115
  StartChatEventRecevied = "StartChatEventReceived",
@@ -175,6 +176,7 @@ export declare enum TelemetryEvent {
175
176
  SendTypingIndicatorSucceeded = "SendTypingIndicatorSucceeded",
176
177
  SendTypingIndicatorFailed = "SendTypingIndicatorFailed",
177
178
  WebChatEvent = "WebChatEvent",
179
+ FacadeChatSDKEvent = "FacadeChatSDKEvent",
178
180
  PreChatSurveyStartChatMethodFailed = "PreChatSurveyStartChatMethodFailed",
179
181
  ChatAlreadyTriggered = "ChatAlreadyTriggered",
180
182
  StartProactiveChatEventReceived = "StartProactiveChatEventReceived",
@@ -204,7 +206,11 @@ export declare enum TelemetryEvent {
204
206
  PostChatSurveyLoaded = "PostChatSurveyLoaded",
205
207
  ChatDisconnectThreadEventReceived = "ChatDisconnectThreadEventReceived",
206
208
  HiddenAdaptiveCardMessageReceived = "HiddenAdaptiveCardMessageReceived",
207
- EndingAdapterAfterDisconnectionError = "EndingAdapterAfterDisconnectionError"
209
+ EndingAdapterAfterDisconnectionError = "EndingAdapterAfterDisconnectionError",
210
+ NewTokenSuccess = "NewTokenSuccess",
211
+ NewTokenFailed = "NewTokenFailed",
212
+ NewTokenExpired = "NewTokenExpired",
213
+ TokenEmptyOrSame = "TokenEmptyOrSame"
208
214
  }
209
215
  export interface TelemetryInput {
210
216
  scenarioType: ScenarioType;
@@ -37,4 +37,5 @@ export declare class TelemetryHelper {
37
37
  static logSDKEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
38
38
  static logConfigDataEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
39
39
  static logWebChatEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
40
+ static logFacadeChatSDKEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
40
41
  }
@@ -83,4 +83,10 @@ export interface CallingTelemetryData extends BaseTelemetryData {
83
83
  ExceptionDetails?: object;
84
84
  Description?: string;
85
85
  }
86
+ export interface FacadeChatSDKTelemetryData extends BaseTelemetryData {
87
+ Event?: string;
88
+ ElapsedTimeInMilliseconds?: number;
89
+ ExceptionDetails?: object;
90
+ Description?: string;
91
+ }
86
92
  export declare type TelemetryData = ConfigValidationTelemetryData | OCChatSDKTelemetryData | IC3ClientTelemetryData | LoadTelemetryData | ActionTelemetryData | WebChatTelemetryData | CallingTelemetryData | MessageProcessingErrorData;
@@ -1,3 +1,4 @@
1
+ import { FacadeChatSDK } from "./facades/FacadeChatSDK";
1
2
  import { ITimer } from "./interfaces/ITimer";
2
3
  export declare const setTabIndices: (elements: HTMLElement[] | null, tabIndexMap: Map<string, number>, shouldBeFocusable: boolean) => void;
3
4
  export declare const findParentFocusableElementsWithoutChildContainer: (elementId: string) => HTMLElement[] | null;
@@ -31,7 +32,7 @@ export declare const getBroadcastChannelName: (widgetId: string, widgetInstanceI
31
32
  export declare const getWidgetCacheIdfromProps: (props: any, popoutChat?: boolean) => string;
32
33
  export declare const debounceLeading: (fn: any, ms?: number) => (...args: any[]) => void;
33
34
  export declare const isThisSessionPopout: (href: string) => boolean;
34
- export declare const getConversationDetailsCall: (chatSDK: any, liveChatContext?: any) => Promise<any>;
35
+ export declare const getConversationDetailsCall: (facadeChatSDK: FacadeChatSDK, liveChatContext?: any) => Promise<any>;
35
36
  export declare const checkContactIdError: (e: any) => void;
36
37
  export declare const createFileAndDownload: (fileName: string, blobData: string, mimeType: string) => void;
37
38
  /**
@@ -1,3 +1,4 @@
1
- import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
1
+ import { FacadeChatSDK } from "../../../common/facades/FacadeChatSDK";
2
2
  import { IDownloadTranscriptProps } from "./interfaces/IDownloadTranscriptProps";
3
- export declare const downloadTranscript: (chatSDK: any, downloadTranscriptProps: IDownloadTranscriptProps, state?: ILiveChatWidgetContext | undefined) => Promise<void>;
3
+ import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
4
+ export declare const downloadTranscript: (facadeChatSDK: FacadeChatSDK, downloadTranscriptProps: IDownloadTranscriptProps, state?: ILiveChatWidgetContext | undefined) => Promise<void>;
@@ -1,5 +1,18 @@
1
1
  import ChatConfig from "@microsoft/omnichannel-chat-sdk/lib/core/ChatConfig";
2
+ import { OmnichannelChatSDK } from "@microsoft/omnichannel-chat-sdk";
2
3
  declare const getAuthClientFunction: (chatConfig: ChatConfig | undefined) => string | undefined;
3
- declare const handleAuthentication: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string | undefined) => Promise<string | null>) | undefined) => Promise<boolean>;
4
+ declare const handleAuthentication: (chatSDK: OmnichannelChatSDK, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string | undefined) => Promise<string | null>) | undefined) => Promise<{
5
+ result: boolean;
6
+ token: string | null;
7
+ error?: undefined;
8
+ } | {
9
+ result: boolean;
10
+ token: null;
11
+ error: {
12
+ message: string;
13
+ getAuthTokenPresent: boolean;
14
+ authClientFunctionPresent: boolean;
15
+ };
16
+ }>;
4
17
  declare const removeAuthTokenProvider: (chatSDK: any) => void;
5
18
  export { getAuthClientFunction, handleAuthentication, removeAuthTokenProvider };
@@ -1,2 +1,3 @@
1
+ import { FacadeChatSDK } from "../../../common/facades/FacadeChatSDK";
1
2
  import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
2
- export declare const createAdapter: (chatSDK: any, props?: ILiveChatWidgetProps | undefined) => Promise<any>;
3
+ export declare const createAdapter: (facadeChatSDK: FacadeChatSDK, props?: ILiveChatWidgetProps | undefined) => Promise<any>;
@@ -1,12 +1,13 @@
1
1
  import { Dispatch } from "react";
2
+ import { FacadeChatSDK } from "../../../common/facades/FacadeChatSDK";
2
3
  import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
3
4
  import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
4
5
  import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
5
- declare const prepareEndChat: (props: ILiveChatWidgetProps, chatSDK: any, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, setWebChatStyles: any, adapter: any) => Promise<void>;
6
- declare const endChat: (props: ILiveChatWidgetProps, chatSDK: any, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, setWebChatStyles: any, adapter: any, skipEndChatSDK?: boolean | undefined, skipCloseChat?: boolean | undefined, postMessageToOtherTab?: boolean | undefined) => Promise<void>;
6
+ declare const prepareEndChat: (props: ILiveChatWidgetProps, facadeChatSDK: FacadeChatSDK, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, setWebChatStyles: any, adapter: any) => Promise<void>;
7
+ declare const endChat: (props: ILiveChatWidgetProps, facadeChatSDK: any, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, setWebChatStyles: any, adapter: any, skipEndChatSDK?: boolean | undefined, skipCloseChat?: boolean | undefined, postMessageToOtherTab?: boolean | undefined) => Promise<void>;
7
8
  export declare const callingStateCleanUp: (dispatch: Dispatch<ILiveChatWidgetAction>) => void;
8
9
  export declare const endChatStateCleanUp: (dispatch: Dispatch<ILiveChatWidgetAction>) => void;
9
10
  export declare const closeChatStateCleanUp: (dispatch: Dispatch<ILiveChatWidgetAction>) => void;
10
11
  export declare const chatSDKStateCleanUp: (chatSDK: any) => void;
11
- export declare const endVoiceVideoCallIfOngoing: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>) => Promise<void>;
12
+ export declare const endVoiceVideoCallIfOngoing: (facadeChatSDK: FacadeChatSDK, dispatch: Dispatch<ILiveChatWidgetAction>) => Promise<void>;
12
13
  export { prepareEndChat, endChat };
@@ -1 +1,2 @@
1
- export declare const initCallingSdk: (chatSDK: any, setVoiceVideoCallingSDK: any) => Promise<boolean>;
1
+ import { FacadeChatSDK } from "../../../common/facades/FacadeChatSDK";
2
+ export declare const initCallingSdk: (facadeChatSDK: FacadeChatSDK, setVoiceVideoCallingSDK: any) => Promise<boolean>;
@@ -1,6 +1,7 @@
1
1
  import { Dispatch } from "react";
2
+ import { FacadeChatSDK } from "../../../common/facades/FacadeChatSDK";
2
3
  import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
3
4
  import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
4
5
  import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
5
6
  import { IWebChatProps } from "../../webchatcontainerstateful/interfaces/IWebChatProps";
6
- export declare const initWebChatComposer: (props: ILiveChatWidgetProps, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, chatSDK: any, endChat: any) => IWebChatProps;
7
+ export declare const initWebChatComposer: (props: ILiveChatWidgetProps, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, facadeChatSDK: FacadeChatSDK, endChat: any) => IWebChatProps;
@@ -1,2 +1,3 @@
1
- export declare const isPostChatSurveyEnabled: (chatSDK: any) => Promise<boolean>;
1
+ import { FacadeChatSDK } from "../../../common/facades/FacadeChatSDK";
2
+ export declare const isPostChatSurveyEnabled: (facadeChatSDK: FacadeChatSDK) => Promise<boolean>;
2
3
  export declare const isPersistentChatEnabled: (conversationMode: string | undefined) => Promise<boolean>;
@@ -1,11 +1,12 @@
1
1
  import "regenerator-runtime/runtime";
2
2
  import ChatConfig from "@microsoft/omnichannel-chat-sdk/lib/core/ChatConfig";
3
3
  import { Dispatch } from "react";
4
+ import { FacadeChatSDK } from "../../../common/facades/FacadeChatSDK";
4
5
  import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
5
6
  import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
6
7
  import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
7
- declare const handleChatReconnect: (chatSDK: any, props: ILiveChatWidgetProps, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, initStartChat: any, state: ILiveChatWidgetContext) => Promise<boolean>;
8
- declare const getChatReconnectContext: (chatSDK: any, chatConfig: ChatConfig, props: any, isAuthenticatedChat: boolean, dispatch: Dispatch<ILiveChatWidgetAction>) => Promise<any>;
8
+ declare const handleChatReconnect: (facadeChatSDK: FacadeChatSDK, props: ILiveChatWidgetProps, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, initStartChat: any, state: ILiveChatWidgetContext) => Promise<boolean>;
9
+ declare const getChatReconnectContext: (facadeChatSDK: FacadeChatSDK, chatConfig: ChatConfig, props: any, isAuthenticatedChat: boolean, dispatch: Dispatch<ILiveChatWidgetAction>) => Promise<import("@microsoft/omnichannel-chat-sdk/lib/core/ChatReconnectContext").default | undefined>;
9
10
  declare const isReconnectEnabled: (chatConfig?: ChatConfig | undefined) => boolean;
10
11
  declare const isPersistentEnabled: (chatConfig?: ChatConfig | undefined) => boolean;
11
12
  export { handleChatReconnect, isReconnectEnabled, isPersistentEnabled, getChatReconnectContext };
@@ -1,9 +1,10 @@
1
1
  import { Dispatch } from "react";
2
+ import { FacadeChatSDK } from "../../../common/facades/FacadeChatSDK";
2
3
  import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
3
4
  import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
4
5
  import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
5
6
  declare const initiatePostChat: (props: ILiveChatWidgetProps, conversationDetailsParam: any, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, postchatContext: any) => Promise<void>;
6
7
  declare const isPostChatEnabled: (props: ILiveChatWidgetProps, state: ILiveChatWidgetContext) => boolean;
7
- declare const getPostChatContext: (chatSDK: any, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>) => Promise<any>;
8
+ declare const getPostChatContext: (facadeChatSDK: FacadeChatSDK, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>) => Promise<any>;
8
9
  declare const setWidgetStateToInactive: (dispatch: Dispatch<ILiveChatWidgetAction>) => Promise<void>;
9
10
  export { initiatePostChat, setWidgetStateToInactive, getPostChatContext, isPostChatEnabled as checkPostChatEnabled };
@@ -1,3 +1,4 @@
1
1
  import { Dispatch } from "react";
2
+ import { FacadeChatSDK } from "../../../common/facades/FacadeChatSDK";
2
3
  import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
3
- export declare const setPostChatContextAndLoadSurvey: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, persistedChat?: boolean | undefined) => Promise<void>;
4
+ export declare const setPostChatContextAndLoadSurvey: (facadeChatSDK: FacadeChatSDK, dispatch: Dispatch<ILiveChatWidgetAction>, persistedChat?: boolean | undefined) => Promise<void>;
@@ -1,10 +1,11 @@
1
1
  import { Dispatch } from "react";
2
+ import { FacadeChatSDK } from "../../../common/facades/FacadeChatSDK";
2
3
  import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
3
4
  import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
4
5
  import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
5
6
  import StartChatOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/StartChatOptionalParams";
6
- declare const prepareStartChat: (props: ILiveChatWidgetProps, chatSDK: any, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any) => Promise<void>;
7
- declare const setPreChatAndInitiateChat: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, isProactiveChat?: boolean | undefined, proactiveChatEnablePrechatState?: boolean | undefined, state?: ILiveChatWidgetContext | undefined, props?: ILiveChatWidgetProps | undefined) => Promise<void>;
8
- declare const initStartChat: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, state: ILiveChatWidgetContext | undefined, props?: ILiveChatWidgetProps | undefined, params?: StartChatOptionalParams | undefined, persistedState?: any) => Promise<void>;
9
- declare const checkIfConversationStillValid: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, state: ILiveChatWidgetContext) => Promise<boolean>;
7
+ declare const prepareStartChat: (props: ILiveChatWidgetProps, facadeChatSDK: FacadeChatSDK, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any) => Promise<void>;
8
+ declare const setPreChatAndInitiateChat: (facadeChatSDK: FacadeChatSDK, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, isProactiveChat?: boolean | undefined, proactiveChatEnablePrechatState?: boolean | undefined, state?: ILiveChatWidgetContext | undefined, props?: ILiveChatWidgetProps | undefined) => Promise<void>;
9
+ declare const initStartChat: (facadeChatSDK: FacadeChatSDK, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, state: ILiveChatWidgetContext | undefined, props?: ILiveChatWidgetProps | undefined, params?: StartChatOptionalParams | undefined, persistedState?: any) => Promise<void>;
10
+ declare const checkIfConversationStillValid: (facadeChatSDK: FacadeChatSDK, dispatch: Dispatch<ILiveChatWidgetAction>, state: ILiveChatWidgetContext) => Promise<boolean>;
10
11
  export { prepareStartChat, initStartChat, setPreChatAndInitiateChat, checkIfConversationStillValid };
@@ -1,5 +1,6 @@
1
1
  import { Dispatch } from "react";
2
+ import { FacadeChatSDK } from "../../../common/facades/FacadeChatSDK";
2
3
  import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
3
4
  import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
4
- export declare const handleStartChatError: (dispatch: Dispatch<ILiveChatWidgetAction>, chatSDK: any, props: ILiveChatWidgetProps | undefined, ex: any, isStartChatSuccessful: boolean) => void;
5
+ export declare const handleStartChatError: (dispatch: Dispatch<ILiveChatWidgetAction>, facadeChatSDK: FacadeChatSDK, props: ILiveChatWidgetProps | undefined, ex: any, isStartChatSuccessful: boolean) => void;
5
6
  export declare const logWidgetLoadComplete: (additionalMessage?: string | undefined) => void;
@@ -1,3 +1,4 @@
1
1
  import { Dispatch } from "react";
2
+ import { FacadeChatSDK } from "../../../common/facades/FacadeChatSDK";
2
3
  import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
3
- export declare const updateTelemetryData: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>) => Promise<void>;
4
+ export declare const updateTelemetryData: (facadeChatSDK: FacadeChatSDK, dispatch: Dispatch<ILiveChatWidgetAction>) => Promise<void>;
@@ -1,4 +1,5 @@
1
1
  import { IPostChatSurveyPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/postchatsurveypane/interfaces/IPostChatSurveyPaneProps";
2
2
  export interface IPostChatSurveyPaneStatefulProps extends IPostChatSurveyPaneProps {
3
3
  isCustomerVoiceSurveyCompact?: boolean;
4
+ copilotSurveyContext?: Record<string, string>;
4
5
  }
@@ -1,5 +1,5 @@
1
- import { ParticipantType } from "../../../common/Constants";
2
1
  import MockAdapter from "./mockadapter";
2
+ import { ParticipantType } from "../../../common/Constants";
3
3
  export declare class MockChatSDK {
4
4
  protected sleep: (ms: any) => Promise<unknown>;
5
5
  isMockModeOn: boolean;
@@ -34,6 +34,7 @@ export declare class MockChatSDK {
34
34
  reconnectId: string;
35
35
  };
36
36
  getVoiceVideoCalling(): null;
37
+ setAuthTokenProvider(): null;
37
38
  getLiveChatConfig(): {
38
39
  LiveWSAndLiveChatEngJoin: {
39
40
  msdyn_postconversationsurveyenable: string;
@@ -0,0 +1 @@
1
+ export declare const FacadeChatSDKStore: any;
@@ -0,0 +1,3 @@
1
+ import { FacadeChatSDK } from "../common/facades/FacadeChatSDK";
2
+ declare const useFacadeChatSDKStore: () => [FacadeChatSDK, (facadeChatSDK: FacadeChatSDK) => void];
3
+ export default useFacadeChatSDKStore;
@@ -1,9 +1,10 @@
1
1
  import { BroadcastService, decodeComponentString, encodeComponentString } from "@microsoft/omnichannel-chat-components";
2
- import useChatContextStore from "./hooks/useChatContextStore";
3
- import useChatSDKStore from "./hooks/useChatSDKStore";
4
2
  import { getWidgetCacheId, getWidgetEndChatEventName } from "./common/utils";
5
3
  import { ConversationState } from "./contexts/common/ConversationState";
4
+ import useChatContextStore from "./hooks/useChatContextStore";
5
+ import useChatSDKStore from "./hooks/useChatSDKStore";
6
+ import useFacadeChatSDKStore from "./hooks/useFacadeChatSDKStore";
6
7
  export { default as LiveChatWidget } from "./components/livechatwidget/LiveChatWidget";
7
8
  export { getMockChatSDKIfApplicable } from "./components/livechatwidget/common/getMockChatSDKIfApplicable";
8
- export { encodeComponentString, decodeComponentString, BroadcastService, useChatSDKStore, useChatContextStore };
9
9
  export { getWidgetCacheId, getWidgetEndChatEventName, ConversationState };
10
+ export { encodeComponentString, decodeComponentString, BroadcastService, useChatSDKStore, useChatContextStore, useFacadeChatSDKStore };
@@ -1,2 +1,3 @@
1
- declare const createChatTranscript: (transcript: string, chatSDK: any, renderAttachments?: boolean, transcriptOptions?: any) => Promise<void>;
1
+ import { FacadeChatSDK } from "../common/facades/FacadeChatSDK";
2
+ declare const createChatTranscript: (transcript: string, facadeChatSDK: FacadeChatSDK, renderAttachments?: boolean, transcriptOptions?: any) => Promise<void>;
2
3
  export default createChatTranscript;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/omnichannel-chat-widget",
3
- "version": "1.7.4-main.120159a",
3
+ "version": "1.7.4-main.1f61ac6",
4
4
  "description": "Microsoft Omnichannel Chat Widget",
5
5
  "main": "lib/cjs/index.js",
6
6
  "types": "lib/types/index.d.ts",
@@ -76,7 +76,7 @@
76
76
  "dependencies": {
77
77
  "@azure/core-tracing": "^1.2.0",
78
78
  "@microsoft/omnichannel-chat-components": "1.1.5",
79
- "@microsoft/omnichannel-chat-sdk": "^1.10.4",
79
+ "@microsoft/omnichannel-chat-sdk": "^1.10.5",
80
80
  "@opentelemetry/api": "^1.9.0",
81
81
  "abort-controller-es5": "^2.0.1",
82
82
  "dompurify": "^2.5.4",