@microsoft/omnichannel-chat-widget 1.7.4-main.f0f5d34 → 1.7.4

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 (99) 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 +7 -0
  4. package/lib/cjs/common/telemetry/TelemetryHelper.js +12 -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 +15 -13
  9. package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +8 -10
  10. package/lib/cjs/components/headerstateful/HeaderStateful.js +4 -0
  11. package/lib/cjs/components/livechatwidget/LiveChatWidget.js +26 -3
  12. package/lib/cjs/components/livechatwidget/common/authHelper.js +14 -5
  13. package/lib/cjs/components/livechatwidget/common/createAdapter.js +9 -9
  14. package/lib/cjs/components/livechatwidget/common/endChat.js +40 -30
  15. package/lib/cjs/components/livechatwidget/common/initCallingSdk.js +3 -3
  16. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +10 -6
  17. package/lib/cjs/components/livechatwidget/common/liveChatConfigUtils.js +2 -3
  18. package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +11 -12
  19. package/lib/cjs/components/livechatwidget/common/renderSurveyHelpers.js +5 -5
  20. package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +4 -4
  21. package/lib/cjs/components/livechatwidget/common/startChat.js +54 -39
  22. package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.js +7 -7
  23. package/lib/cjs/components/livechatwidget/common/updateSessionDataForTelemetry.js +8 -8
  24. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +63 -40
  25. package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +3 -0
  26. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +1 -1
  27. package/lib/cjs/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +4 -2
  28. package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +11 -6
  29. package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +4 -1
  30. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +2 -1
  31. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +4 -4
  32. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +8 -0
  33. package/lib/cjs/contexts/FacadeChatSDKStore.js +10 -0
  34. package/lib/cjs/hooks/useFacadeChatSDKStore.js +17 -0
  35. package/lib/cjs/index.js +9 -2
  36. package/lib/cjs/plugins/createChatTranscript.js +2 -2
  37. package/lib/esm/common/facades/FacadeChatSDK.js +291 -0
  38. package/lib/esm/common/facades/types/IFacadeChatSDKInput.js +1 -0
  39. package/lib/esm/common/telemetry/TelemetryConstants.js +7 -0
  40. package/lib/esm/common/telemetry/TelemetryHelper.js +12 -0
  41. package/lib/esm/common/utils.js +2 -2
  42. package/lib/esm/components/callingcontainerstateful/CallingContainerStateful.js +4 -8
  43. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +5 -6
  44. package/lib/esm/components/footerstateful/FooterStateful.js +15 -13
  45. package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +8 -10
  46. package/lib/esm/components/headerstateful/HeaderStateful.js +4 -0
  47. package/lib/esm/components/livechatwidget/LiveChatWidget.js +26 -3
  48. package/lib/esm/components/livechatwidget/common/authHelper.js +14 -5
  49. package/lib/esm/components/livechatwidget/common/createAdapter.js +9 -9
  50. package/lib/esm/components/livechatwidget/common/endChat.js +40 -30
  51. package/lib/esm/components/livechatwidget/common/initCallingSdk.js +3 -3
  52. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +10 -6
  53. package/lib/esm/components/livechatwidget/common/liveChatConfigUtils.js +2 -4
  54. package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +11 -12
  55. package/lib/esm/components/livechatwidget/common/renderSurveyHelpers.js +5 -5
  56. package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +4 -4
  57. package/lib/esm/components/livechatwidget/common/startChat.js +55 -40
  58. package/lib/esm/components/livechatwidget/common/startChatErrorHandler.js +7 -7
  59. package/lib/esm/components/livechatwidget/common/updateSessionDataForTelemetry.js +8 -8
  60. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +63 -40
  61. package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +3 -0
  62. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +1 -1
  63. package/lib/esm/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +4 -2
  64. package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +11 -6
  65. package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +4 -1
  66. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +2 -1
  67. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +4 -4
  68. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +8 -0
  69. package/lib/esm/contexts/FacadeChatSDKStore.js +4 -0
  70. package/lib/esm/hooks/useFacadeChatSDKStore.js +10 -0
  71. package/lib/esm/index.js +5 -4
  72. package/lib/esm/plugins/createChatTranscript.js +2 -2
  73. package/lib/types/common/facades/FacadeChatSDK.d.ts +71 -0
  74. package/lib/types/common/facades/types/IFacadeChatSDKInput.d.ts +13 -0
  75. package/lib/types/common/telemetry/TelemetryConstants.d.ts +9 -2
  76. package/lib/types/common/telemetry/TelemetryHelper.d.ts +1 -0
  77. package/lib/types/common/telemetry/definitions/Payload.d.ts +7 -0
  78. package/lib/types/common/utils.d.ts +2 -1
  79. package/lib/types/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.d.ts +3 -2
  80. package/lib/types/components/livechatwidget/common/authHelper.d.ts +14 -1
  81. package/lib/types/components/livechatwidget/common/createAdapter.d.ts +2 -1
  82. package/lib/types/components/livechatwidget/common/endChat.d.ts +4 -3
  83. package/lib/types/components/livechatwidget/common/initCallingSdk.d.ts +2 -1
  84. package/lib/types/components/livechatwidget/common/initWebChatComposer.d.ts +2 -1
  85. package/lib/types/components/livechatwidget/common/liveChatConfigUtils.d.ts +2 -1
  86. package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +3 -2
  87. package/lib/types/components/livechatwidget/common/renderSurveyHelpers.d.ts +2 -1
  88. package/lib/types/components/livechatwidget/common/setPostChatContextAndLoadSurvey.d.ts +2 -1
  89. package/lib/types/components/livechatwidget/common/startChat.d.ts +5 -4
  90. package/lib/types/components/livechatwidget/common/startChatErrorHandler.d.ts +2 -1
  91. package/lib/types/components/livechatwidget/common/updateSessionDataForTelemetry.d.ts +2 -1
  92. package/lib/types/components/postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps.d.ts +1 -0
  93. package/lib/types/components/webchatcontainerstateful/common/mockchatsdk.d.ts +2 -1
  94. package/lib/types/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.d.ts +1 -0
  95. package/lib/types/contexts/FacadeChatSDKStore.d.ts +1 -0
  96. package/lib/types/hooks/useFacadeChatSDKStore.d.ts +3 -0
  97. package/lib/types/index.d.ts +4 -3
  98. package/lib/types/plugins/createChatTranscript.d.ts +2 -1
  99. package/package.json +4 -2
@@ -0,0 +1,71 @@
1
+ import { ChatAdapter, ChatSDKMessage, GetAgentAvailabilityResponse, GetLiveChatTranscriptResponse, GetVoiceVideoCallingResponse, IFileInfo, IRawMessage, MaskingRules, OmnichannelChatSDK, VoiceVideoCallingOptionalParams } from "@microsoft/omnichannel-chat-sdk";
2
+ import { IFacadeChatSDKInput } from "./types/IFacadeChatSDKInput";
3
+ import ChatAdapterOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/messaging/ChatAdapterOptionalParams";
4
+ import ChatConfig from "@microsoft/omnichannel-chat-sdk/lib/core/ChatConfig";
5
+ import ChatReconnectContext from "@microsoft/omnichannel-chat-sdk/lib/core/ChatReconnectContext";
6
+ import ChatReconnectOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/ChatReconnectOptionalParams";
7
+ import ChatTranscriptBody from "@microsoft/omnichannel-chat-sdk/lib/core/ChatTranscriptBody";
8
+ import EmailLiveChatTranscriptOptionaParams from "@microsoft/omnichannel-chat-sdk/lib/core/EmailLiveChatTranscriptOptionalParams";
9
+ import EndChatOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/EndChatOptionalParams";
10
+ import FileMetadata from "@microsoft/omnichannel-amsclient/lib/FileMetadata";
11
+ import GetAgentAvailabilityOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/GetAgentAvailabilityOptionalParams";
12
+ import GetChatTokenOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/GetChatTokenOptionalParams";
13
+ import GetConversationDetailsOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/GetConversationDetailsOptionalParams";
14
+ import GetLiveChatConfigOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/GetLiveChatConfigOptionalParams";
15
+ import GetLiveChatTranscriptOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/GetLiveChatTranscriptOptionalParams";
16
+ import IChatToken from "@microsoft/omnichannel-chat-sdk/lib/external/IC3Adapter/IChatToken";
17
+ import IFileMetadata from "@microsoft/omnichannel-ic3core/lib/model/IFileMetadata";
18
+ import IMessage from "@microsoft/omnichannel-ic3core/lib/model/IMessage";
19
+ import IRawThread from "@microsoft/omnichannel-ic3core/lib/interfaces/IRawThread";
20
+ import InitializeOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/InitializeOptionalParams";
21
+ import LiveWorkItemDetails from "@microsoft/omnichannel-chat-sdk/lib/core/LiveWorkItemDetails";
22
+ import OmnichannelMessage from "@microsoft/omnichannel-chat-sdk/lib/core/messaging/OmnichannelMessage";
23
+ import OnNewMessageOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/messaging/OnNewMessageOptionalParams";
24
+ import { ParticipantsRemovedEvent } from "@azure/communication-signaling";
25
+ import PostChatContext from "@microsoft/omnichannel-chat-sdk/lib/core/PostChatContext";
26
+ import StartChatOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/StartChatOptionalParams";
27
+ export declare class FacadeChatSDK {
28
+ private chatSDK;
29
+ private chatConfig;
30
+ private token;
31
+ private expiration;
32
+ private isAuthenticated;
33
+ private getAuthToken?;
34
+ private sdkMocked;
35
+ isSDKMocked(): boolean;
36
+ getChatSDK(): OmnichannelChatSDK;
37
+ destroy(): void;
38
+ isTokenSet(): boolean;
39
+ constructor(input: IFacadeChatSDKInput);
40
+ private convertExpiration;
41
+ private isTokenExpired;
42
+ private setToken;
43
+ private tokenRing;
44
+ private validateAndExecuteCall;
45
+ initialize(optionalParams?: InitializeOptionalParams): Promise<ChatConfig>;
46
+ getChatReconnectContext(optionalParams?: ChatReconnectOptionalParams): Promise<ChatReconnectContext>;
47
+ startChat(optionalParams?: StartChatOptionalParams): Promise<void>;
48
+ endChat(optionalParams?: EndChatOptionalParams): Promise<void>;
49
+ getCurrentLiveChatContext(): Promise<object>;
50
+ getConversationDetails(optionalParams?: GetConversationDetailsOptionalParams): Promise<LiveWorkItemDetails>;
51
+ getPreChatSurvey(parse?: boolean): Promise<any>;
52
+ getLiveChatConfig(optionalParams?: GetLiveChatConfigOptionalParams): Promise<ChatConfig>;
53
+ getChatToken(cached?: boolean, optionalParams?: GetChatTokenOptionalParams): Promise<IChatToken>;
54
+ getCallingToken(): Promise<string>;
55
+ getMessages(): Promise<IMessage[] | OmnichannelMessage[] | undefined>;
56
+ getDataMaskingRules(): Promise<MaskingRules>;
57
+ sendMessage(message: ChatSDKMessage): Promise<void>;
58
+ onNewMessage(onNewMessageCallback: CallableFunction, optionalParams?: OnNewMessageOptionalParams | unknown): Promise<void>;
59
+ sendTypingEvent(): Promise<void>;
60
+ onTypingEvent(onTypingEventCallback: CallableFunction): Promise<void>;
61
+ onAgentEndSession(onAgentEndSessionCallback: (message: IRawThread | ParticipantsRemovedEvent) => void): Promise<void>;
62
+ uploadFileAttachment(fileInfo: IFileInfo | File): Promise<IRawMessage | OmnichannelMessage>;
63
+ downloadFileAttachment(fileMetadata: FileMetadata | IFileMetadata): Promise<Blob>;
64
+ emailLiveChatTranscript(body: ChatTranscriptBody, optionalParams?: EmailLiveChatTranscriptOptionaParams): Promise<void>;
65
+ getLiveChatTranscript(optionalParams?: GetLiveChatTranscriptOptionalParams): Promise<GetLiveChatTranscriptResponse>;
66
+ createChatAdapter(optionalParams?: ChatAdapterOptionalParams): Promise<ChatAdapter>;
67
+ isVoiceVideoCallingEnabled(): Promise<boolean>;
68
+ getVoiceVideoCalling(params?: VoiceVideoCallingOptionalParams): Promise<GetVoiceVideoCallingResponse>;
69
+ getPostChatSurveyContext(): Promise<PostChatContext>;
70
+ getAgentAvailability(optionalParams?: GetAgentAvailabilityOptionalParams): Promise<GetAgentAvailabilityResponse>;
71
+ }
@@ -0,0 +1,13 @@
1
+ import ChatConfig from "@microsoft/omnichannel-chat-sdk/lib/core/ChatConfig";
2
+ import { OmnichannelChatSDK } from "@microsoft/omnichannel-chat-sdk";
3
+ export interface IFacadeChatSDKInput {
4
+ chatSDK: OmnichannelChatSDK;
5
+ chatConfig: ChatConfig;
6
+ isAuthenticated: boolean;
7
+ isSDKMocked: boolean;
8
+ getAuthToken?: (authClientFunction?: string) => Promise<string | null>;
9
+ }
10
+ export interface PingResponse {
11
+ result: boolean;
12
+ message: string;
13
+ }
@@ -53,7 +53,8 @@ export declare enum BroadcastEvent {
53
53
  UpdateSessionDataForTelemetry = "UpdateSessionDataForTelemetry",
54
54
  UpdateConversationDataForTelemetry = "UpdateConversationDataForTelemetry",
55
55
  ContactIdNotFound = "ContactIdNotFound",
56
- SyncMinimize = "SyncMinimize"
56
+ SyncMinimize = "SyncMinimize",
57
+ OnWidgetError = "OnWidgetError"
57
58
  }
58
59
  export declare enum TelemetryEvent {
59
60
  CallAdded = "CallAdded",
@@ -108,6 +109,7 @@ export declare enum TelemetryEvent {
108
109
  CloseChatCall = "CloseChatCall",
109
110
  CloseChatMethodException = "CloseChatMethodException",
110
111
  PrechatSurveyLoaded = "PrechatSurveyLoaded",
112
+ PrechatSurveyExpected = "PrechatSurveyExpected",
111
113
  PrechatSubmitted = "PrechatSubmitted",
112
114
  StartChatSDKCall = "StartChatCall",
113
115
  StartChatEventRecevied = "StartChatEventReceived",
@@ -174,6 +176,7 @@ export declare enum TelemetryEvent {
174
176
  SendTypingIndicatorSucceeded = "SendTypingIndicatorSucceeded",
175
177
  SendTypingIndicatorFailed = "SendTypingIndicatorFailed",
176
178
  WebChatEvent = "WebChatEvent",
179
+ FacadeChatSDKEvent = "FacadeChatSDKEvent",
177
180
  PreChatSurveyStartChatMethodFailed = "PreChatSurveyStartChatMethodFailed",
178
181
  ChatAlreadyTriggered = "ChatAlreadyTriggered",
179
182
  StartProactiveChatEventReceived = "StartProactiveChatEventReceived",
@@ -203,7 +206,11 @@ export declare enum TelemetryEvent {
203
206
  PostChatSurveyLoaded = "PostChatSurveyLoaded",
204
207
  ChatDisconnectThreadEventReceived = "ChatDisconnectThreadEventReceived",
205
208
  HiddenAdaptiveCardMessageReceived = "HiddenAdaptiveCardMessageReceived",
206
- EndingAdapterAfterDisconnectionError = "EndingAdapterAfterDisconnectionError"
209
+ EndingAdapterAfterDisconnectionError = "EndingAdapterAfterDisconnectionError",
210
+ NewTokenSuccess = "NewTokenSuccess",
211
+ NewTokenFailed = "NewTokenFailed",
212
+ NewTokenExpired = "NewTokenExpired",
213
+ TokenEmptyOrSame = "TokenEmptyOrSame"
207
214
  }
208
215
  export interface TelemetryInput {
209
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
  }
@@ -34,6 +34,7 @@ export interface OCChatSDKTelemetryData extends BaseTelemetryData {
34
34
  ElapsedTimeInMilliseconds?: number;
35
35
  TransactionId: string;
36
36
  ExceptionDetails?: object;
37
+ Description?: string;
37
38
  }
38
39
  export interface IC3ClientTelemetryData extends BaseTelemetryData {
39
40
  SubscriptionId?: string;
@@ -82,4 +83,10 @@ export interface CallingTelemetryData extends BaseTelemetryData {
82
83
  ExceptionDetails?: object;
83
84
  Description?: string;
84
85
  }
86
+ export interface FacadeChatSDKTelemetryData extends BaseTelemetryData {
87
+ Event?: string;
88
+ ElapsedTimeInMilliseconds?: number;
89
+ ExceptionDetails?: object;
90
+ Description?: string;
91
+ }
85
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;
@@ -4,4 +4,5 @@ export interface IAdaptiveCardStyles {
4
4
  anchorColor?: string;
5
5
  buttonWhiteSpace?: string;
6
6
  textWhiteSpace?: string;
7
+ choiceInputPadding?: string;
7
8
  }
@@ -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.f0f5d34",
3
+ "version": "1.7.4",
4
4
  "description": "Microsoft Omnichannel Chat Widget",
5
5
  "main": "lib/cjs/index.js",
6
6
  "types": "lib/types/index.d.ts",
@@ -74,8 +74,10 @@
74
74
  "webpack-cli": "^4.9.2"
75
75
  },
76
76
  "dependencies": {
77
+ "@azure/core-tracing": "^1.2.0",
77
78
  "@microsoft/omnichannel-chat-components": "1.1.5",
78
- "@microsoft/omnichannel-chat-sdk": "^1.10.1",
79
+ "@microsoft/omnichannel-chat-sdk": "^1.10.6",
80
+ "@opentelemetry/api": "^1.9.0",
79
81
  "abort-controller-es5": "^2.0.1",
80
82
  "dompurify": "^2.5.4",
81
83
  "markdown-it": "^12.3.2",