@microsoft/omnichannel-chat-widget 0.1.0-main.50fdaaa → 0.1.0-main.52fa2fc

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 (51) hide show
  1. package/lib/cjs/common/Constants.js +8 -1
  2. package/lib/cjs/common/telemetry/TelemetryConstants.js +22 -4
  3. package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +11 -18
  4. package/lib/cjs/components/headerstateful/HeaderStateful.js +4 -3
  5. package/lib/cjs/components/livechatwidget/common/agentEndConversationHelper.js +36 -0
  6. package/lib/cjs/components/livechatwidget/common/endChat.js +38 -64
  7. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +10 -61
  8. package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +6 -2
  9. package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +255 -2
  10. package/lib/cjs/components/livechatwidget/common/startChat.js +14 -6
  11. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +65 -25
  12. package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +3 -1
  13. package/lib/cjs/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +2 -0
  14. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +1 -0
  15. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +75 -11
  16. package/lib/cjs/contexts/common/ConversationEndEntity.js +12 -0
  17. package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +11 -7
  18. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +6 -2
  19. package/lib/cjs/contexts/createReducer.js +36 -2
  20. package/lib/esm/common/Constants.js +6 -0
  21. package/lib/esm/common/telemetry/TelemetryConstants.js +22 -4
  22. package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +11 -18
  23. package/lib/esm/components/headerstateful/HeaderStateful.js +4 -3
  24. package/lib/esm/components/livechatwidget/common/agentEndConversationHelper.js +30 -0
  25. package/lib/esm/components/livechatwidget/common/endChat.js +40 -66
  26. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +12 -63
  27. package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +6 -2
  28. package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +255 -3
  29. package/lib/esm/components/livechatwidget/common/startChat.js +14 -6
  30. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +65 -25
  31. package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +3 -1
  32. package/lib/esm/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +2 -0
  33. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +2 -0
  34. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +75 -11
  35. package/lib/esm/contexts/common/ConversationEndEntity.js +5 -0
  36. package/lib/esm/contexts/common/LiveChatWidgetActionType.js +11 -7
  37. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +6 -2
  38. package/lib/esm/contexts/createReducer.js +36 -2
  39. package/lib/types/common/Constants.d.ts +7 -0
  40. package/lib/types/common/telemetry/TelemetryConstants.d.ts +18 -6
  41. package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulParams.d.ts +0 -7
  42. package/lib/types/components/livechatwidget/common/agentEndConversationHelper.d.ts +6 -0
  43. package/lib/types/components/livechatwidget/common/initWebChatComposer.d.ts +1 -1
  44. package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +1 -1
  45. package/lib/types/components/livechatwidget/common/setPostChatContextAndLoadSurvey.d.ts +6 -1
  46. package/lib/types/components/livechatwidget/common/startChat.d.ts +1 -1
  47. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.d.ts +1 -1
  48. package/lib/types/contexts/common/ConversationEndEntity.d.ts +4 -0
  49. package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +6 -1
  50. package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +11 -7
  51. package/package.json +1 -1
@@ -47,7 +47,8 @@ export declare enum BroadcastEvent {
47
47
  NetworkReconnected = "NetworkReconnected",
48
48
  SigninCardReceived = "SignInCardReceived",
49
49
  BotAuthConfigRequest = "BotAuthConfigRequest",
50
- BotAuthConfigResponse = "BotAuthConfigResponse"
50
+ BotAuthConfigResponse = "BotAuthConfigResponse",
51
+ HideChatVisibilityChangeEvent = "hideChatVisibilityChangeEvent"
51
52
  }
52
53
  export declare enum TelemetryEvent {
53
54
  CallAdded = "CallAdded",
@@ -82,11 +83,10 @@ export declare enum TelemetryEvent {
82
83
  GetConversationDetailsCallFailed = "GetConversationDetailsCallFailed",
83
84
  EndChatSDKCallFailed = "EndChatSDKCallFailed",
84
85
  GetChatReconnectContextSDKCallFailed = "GetChatReconnectContextSDKCallFailed",
85
- PostChatContextCallSucceed = "PostChatContextCallSucceed",
86
- PostChatContextCallFailed = "PostChatContextCallFailed",
87
86
  ParseAdaptiveCardFailed = "ParseAdaptiveCardFailed",
88
87
  ClientDataStoreProviderFailed = "ClientDataStoreProviderFailed",
89
88
  InMemoryDataStoreFailed = "InMemoryDataStoreFailed",
89
+ ChatVisibilityChanged = "ChatVisibilityChanged",
90
90
  WebChatLoaded = "WebChatLoaded",
91
91
  LCWChatButtonClicked = "LCWChatButtonClicked",
92
92
  LCWChatButtonShow = "LCWChatButtonShow",
@@ -94,6 +94,7 @@ export declare enum TelemetryEvent {
94
94
  WidgetLoadComplete = "WidgetLoadComplete",
95
95
  WidgetLoadFailed = "WidgetLoadFailed",
96
96
  StartChatMethodException = "StartChatMethodException",
97
+ CloseChatCall = "CloseChatCall",
97
98
  CloseChatMethodException = "CloseChatMethodException",
98
99
  PrechatSurveyLoaded = "PrechatSurveyLoaded",
99
100
  PrechatSubmitted = "PrechatSubmitted",
@@ -116,8 +117,6 @@ export declare enum TelemetryEvent {
116
117
  LoadingPaneLoaded = "LoadingPaneLoaded",
117
118
  EmailTranscriptLoaded = "EmailTranscriptLoaded",
118
119
  OutOfOfficePaneLoaded = "OutOfOfficePaneLoaded",
119
- PostChatSurveyLoadingPaneLoaded = "PostChatSurveyLoadingPaneLoaded",
120
- PostChatSurveyLoaded = "PostChatSurveyLoaded",
121
120
  ConfirmationPaneLoaded = "ConfirmationPaneLoaded",
122
121
  ProactiveChatPaneLoaded = "ProactiveChatPaneLoaded",
123
122
  ReconnectChatPaneLoaded = "ReconnectChatPaneLoaded",
@@ -130,6 +129,7 @@ export declare enum TelemetryEvent {
130
129
  SuppressBotMagicCodeSucceeded = "SuppressBotMagicCodeSucceeded",
131
130
  SuppressBotMagicCodeFailed = "SuppressBotMagicCodeFailed",
132
131
  GetConversationDetailsException = "GetConversationDetailsException",
132
+ AppStatesException = "AppStatesException",
133
133
  BrowserUnloadEventStarted = "BrowserUnloadEventStarted",
134
134
  GetAuthTokenCalled = "GetAuthTokenCalled",
135
135
  GetAuthTokenFailed = "GetAuthTokenFailed",
@@ -145,12 +145,15 @@ export declare enum TelemetryEvent {
145
145
  ProcessingHTMLTextMiddlewareFailed = "ProcessingHTMLTextMiddlewareFailed",
146
146
  ProcessingSanitizationMiddlewareFailed = "ProcessingSanitizationMiddlewareFailed",
147
147
  FormatTagsMiddlewareJSONStringifyFailed = "FormatTagsMiddlewareJSONStringifyFailed",
148
+ AttachmentUploadValidatorMiddlewareFailed = "AttachmentUploadValidatorMiddlewareFailed",
148
149
  QueuePositionMessageRecieved = "QueuePositionMessageRecieved",
149
150
  AverageWaitTimeMessageRecieved = "AverageWaitTimeMessageRecieved",
150
151
  DataMaskingRuleApplied = "DataMaskingRuleApplied",
151
152
  DataMaskingRuleApplyFailed = "DataMaskingRuleApplyFailed",
152
153
  IC3ClientEvent = "IC3ClientEvent",
153
154
  ConversationEndedThreadEventReceived = "ConversationEndedThreadEventReceived",
155
+ ConversationEndedByCustomer = "ConversationEndedByCustomer",
156
+ ConversationEndedByAgent = "ConversationEndedByAgent",
154
157
  InvalidConfiguration = "InvalidConfiguration",
155
158
  SendTypingIndicatorSucceeded = "SendTypingIndicatorSucceeded",
156
159
  SendTypingIndicatorFailed = "SendTypingIndicatorFailed",
@@ -172,7 +175,16 @@ export declare enum TelemetryEvent {
172
175
  HistoryMessageReceived = "HistoryMessageReceived",
173
176
  CustomContextReceived = "CustomContextReceived",
174
177
  NetworkDisconnected = "NetworkDisconnected",
175
- NetworkReconnected = "NetworkReconnected"
178
+ NetworkReconnected = "NetworkReconnected",
179
+ LinkModePostChatWorkflowStarted = "LinkModePostChatWorkflowStarted",
180
+ EmbedModePostChatWorkflowStarted = "EmbedModePostChatWorkflowStarted",
181
+ PostChatWorkflowFromCustomer = "PostChatWorkflowFromCustomer",
182
+ PostChatWorkflowFromAgent = "PostChatWorkflowFromAgent",
183
+ PostChatWorkflowFromBot = "PostChatWorkflowFromBot",
184
+ PostChatContextCallSucceed = "PostChatContextCallSucceed",
185
+ PostChatContextCallFailed = "PostChatContextCallFailed",
186
+ PostChatSurveyLoadingPaneLoaded = "PostChatSurveyLoadingPaneLoaded",
187
+ PostChatSurveyLoaded = "PostChatSurveyLoaded"
176
188
  }
177
189
  export interface TelemetryInput {
178
190
  scenarioType: ScenarioType;
@@ -1,14 +1,7 @@
1
- import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
2
1
  import { IConfirmationPaneStatefulProps } from "./IConfirmationPaneStatefulProps";
3
2
  export interface IConfirmationPaneStatefulParams extends IConfirmationPaneStatefulProps {
4
3
  /**
5
4
  * setPostChatContext: Internal Prop injected for setting Post Chat Context
6
5
  */
7
6
  setPostChatContext: () => Promise<void>;
8
- /**
9
- * prepareEndChat: Internal Prop injected for checking PostChat contexts and trigerring end of chat
10
- * @param adapter : The chat adapter for the live chat session
11
- * @param state : The chat state where the conversation is currently in
12
- */
13
- prepareEndChat: (adapter: any, state: ILiveChatWidgetContext) => Promise<void>;
14
7
  }
@@ -0,0 +1,6 @@
1
+ import { Dispatch } from "react";
2
+ import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
3
+ import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
4
+ import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
5
+ declare const handleAgentEndConversation: (props: ILiveChatWidgetProps, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>) => void;
6
+ export { handleAgentEndConversation };
@@ -3,4 +3,4 @@ import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetA
3
3
  import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
4
4
  import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
5
5
  import { IWebChatProps } from "../../webchatcontainerstateful/interfaces/IWebChatProps";
6
- export declare const initWebChatComposer: (props: ILiveChatWidgetProps, chatSDK: any, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, setWebChatStyles: any) => IWebChatProps;
6
+ export declare const initWebChatComposer: (props: ILiveChatWidgetProps, chatSDK: any, setAdapter: any, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, adapter: any, setWebChatStyles: any) => IWebChatProps;
@@ -5,5 +5,5 @@ import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetA
5
5
  import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
6
6
  declare const handleChatReconnect: (chatSDK: any, props: any, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, initStartChat: any, state: ILiveChatWidgetContext) => Promise<void>;
7
7
  declare const getChatReconnectContext: (chatSDK: any, chatConfig: ChatConfig, props: any, isAuthenticatedChat: boolean) => Promise<any>;
8
- declare const isReconnectEnabled: (chatConfig: ChatConfig) => any;
8
+ declare const isReconnectEnabled: (chatConfig?: ChatConfig | undefined) => boolean;
9
9
  export { handleChatReconnect, isReconnectEnabled, getChatReconnectContext };
@@ -1,3 +1,8 @@
1
1
  import { Dispatch } from "react";
2
2
  import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
3
- export declare const setPostChatContextAndLoadSurvey: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, persistedChat?: boolean | undefined) => Promise<void>;
3
+ import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
4
+ import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
5
+ declare const setPostChatContextAndLoadSurvey: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, persistedChat?: boolean | undefined) => Promise<void>;
6
+ declare const checkPostChatEnabled: (props: ILiveChatWidgetProps, state: ILiveChatWidgetContext) => boolean;
7
+ declare const initiatePostChat: (props: ILiveChatWidgetProps, chatSDK: any, setAdapter: any, setWebChatStyles: any, dispatch: Dispatch<ILiveChatWidgetAction>, adapter: any, state: ILiveChatWidgetContext) => Promise<void>;
8
+ export { setPostChatContextAndLoadSurvey, checkPostChatEnabled, initiatePostChat };
@@ -6,5 +6,5 @@ import StartChatOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/St
6
6
  declare const prepareStartChat: (props: ILiveChatWidgetProps, chatSDK: any, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any) => Promise<void>;
7
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
8
  declare const initStartChat: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, props?: ILiveChatWidgetProps | undefined, params?: StartChatOptionalParams | undefined, persistedState?: any) => Promise<void>;
9
- declare const checkIfConversationStillValid: (chatSDK: any, props: ILiveChatWidgetProps, requestId: any, dispatch: Dispatch<ILiveChatWidgetAction>) => Promise<boolean>;
9
+ declare const checkIfConversationStillValid: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, state: ILiveChatWidgetContext) => Promise<boolean>;
10
10
  export { prepareStartChat, initStartChat, setPreChatAndInitiateChat, checkIfConversationStillValid };
@@ -5,7 +5,7 @@
5
5
  ******/
6
6
  import { IWebChatAction } from "../../../interfaces/IWebChatAction";
7
7
  import { ILiveChatWidgetLocalizedTexts } from "../../../../../contexts/common/ILiveChatWidgetLocalizedTexts";
8
- declare const createAttachmentUploadValidatorMiddleware: (allowedFileExtensions: string, maxUploadFileSize: string, localizedTexts: ILiveChatWidgetLocalizedTexts) => ({ dispatch }: {
8
+ declare const createAttachmentUploadValidatorMiddleware: (allowedFileExtensions: string, maxFileSizeSupportedByDynamics: string, localizedTexts: ILiveChatWidgetLocalizedTexts) => ({ dispatch }: {
9
9
  dispatch: any;
10
10
  }) => (next: any) => (action: IWebChatAction) => any;
11
11
  export default createAttachmentUploadValidatorMiddleware;
@@ -0,0 +1,4 @@
1
+ export declare enum ConversationEndEntity {
2
+ Customer = 0,
3
+ Agent = 1
4
+ }
@@ -3,6 +3,7 @@ import { ConversationState } from "./ConversationState";
3
3
  import { IInternalTelemetryData } from "../../common/telemetry/interfaces/IInternalTelemetryData";
4
4
  import { ILiveChatWidgetLocalizedTexts } from "./ILiveChatWidgetLocalizedTexts";
5
5
  import { IRenderingMiddlewareProps } from "../../components/webchatcontainerstateful/interfaces/IRenderingMiddlewareProps";
6
+ import { ConversationEndEntity } from "./ConversationEndEntity";
6
7
  export interface ILiveChatWidgetContext {
7
8
  domainStates: {
8
9
  liveChatConfig: ChatConfig | undefined;
@@ -18,6 +19,7 @@ export interface ILiveChatWidgetContext {
18
19
  customContext: any;
19
20
  widgetSize: any;
20
21
  widgetInstanceId: string;
22
+ initialChatSdkRequestId: string;
21
23
  };
22
24
  appStates: {
23
25
  conversationState: ConversationState;
@@ -37,7 +39,10 @@ export interface ILiveChatWidgetContext {
37
39
  };
38
40
  e2vvEnabled: boolean;
39
41
  unreadMessageCount: number;
40
- conversationEndedByAgent: boolean;
42
+ conversationEndedByAgentEventReceived: boolean;
43
+ conversationEndedBy: ConversationEndEntity | undefined;
44
+ postChatWorkflowInProgress: boolean;
45
+ shouldUseBotSurvey: boolean;
41
46
  };
42
47
  uiStates: {
43
48
  showConfirmationPane: boolean;
@@ -28,11 +28,15 @@ export declare enum LiveChatWidgetActionType {
28
28
  SET_RECONNECT_ID = 26,
29
29
  SET_UNREAD_MESSAGE_COUNT = 27,
30
30
  SET_FOCUS_CHAT_BUTTON = 28,
31
- SET_CONVERSATION_ENDED_BY_AGENT = 29,
32
- SET_WIDGET_STATE = 30,
33
- SET_LIVE_CHAT_CONTEXT = 31,
34
- SET_BOT_OAUTH_SIGNIN_ID = 32,
35
- SET_WIDGET_SIZE = 33,
36
- SET_WIDGET_INSTANCE_ID = 34,
37
- SET_LIVE_CHAT_CONFIG = 35
31
+ SET_CONVERSATION_ENDED_BY_AGENT_EVENT_RECEIVED = 29,
32
+ SET_CONVERSATION_ENDED_BY = 30,
33
+ SET_WIDGET_STATE = 31,
34
+ SET_LIVE_CHAT_CONTEXT = 32,
35
+ SET_BOT_OAUTH_SIGNIN_ID = 33,
36
+ SET_WIDGET_SIZE = 34,
37
+ SET_WIDGET_INSTANCE_ID = 35,
38
+ SET_LIVE_CHAT_CONFIG = 36,
39
+ SET_POST_CHAT_WORKFLOW_IN_PROGRESS = 37,
40
+ SET_INITIAL_CHAT_SDK_REQUEST_ID = 38,
41
+ SET_SHOULD_USE_BOT_SURVEY = 39
38
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/omnichannel-chat-widget",
3
- "version": "0.1.0-main.50fdaaa",
3
+ "version": "0.1.0-main.52fa2fc",
4
4
  "description": "Microsoft Omnichannel Chat Widget",
5
5
  "main": "lib/cjs/index.js",
6
6
  "types": "lib/types/index.d.ts",