@microsoft/omnichannel-chat-widget 0.1.0-main.20562ae → 0.1.0-main.4188c11

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 (63) hide show
  1. package/lib/cjs/common/Constants.js +32 -4
  2. package/lib/cjs/common/telemetry/TelemetryConstants.js +9 -0
  3. package/lib/cjs/common/telemetry/TelemetryHelper.js +13 -0
  4. package/lib/cjs/common/telemetry/TelemetryManager.js +10 -1
  5. package/lib/cjs/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.js +4 -1
  6. package/lib/cjs/common/telemetry/loggers/ariaTelemetryLogger.js +33 -13
  7. package/lib/cjs/common/telemetry/loggers/consoleLogger.js +6 -5
  8. package/lib/cjs/common/utils.js +16 -2
  9. package/lib/cjs/components/callingcontainerstateful/CallingContainerStateful.js +14 -0
  10. package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +1 -1
  11. package/lib/cjs/components/footerstateful/FooterStateful.js +1 -2
  12. package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +1 -1
  13. package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +5 -14
  14. package/lib/cjs/components/livechatwidget/common/endChat.js +10 -9
  15. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +7 -0
  16. package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +105 -20
  17. package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +3 -15
  18. package/lib/cjs/components/livechatwidget/common/startChat.js +38 -29
  19. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +30 -8
  20. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +45 -0
  21. package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +22 -21
  22. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +2 -1
  23. package/lib/cjs/contexts/createReducer.js +8 -0
  24. package/lib/cjs/plugins/newMessageEventHandler.js +10 -13
  25. package/lib/esm/common/Constants.js +28 -3
  26. package/lib/esm/common/telemetry/TelemetryConstants.js +9 -0
  27. package/lib/esm/common/telemetry/TelemetryHelper.js +13 -1
  28. package/lib/esm/common/telemetry/TelemetryManager.js +9 -1
  29. package/lib/esm/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.js +4 -1
  30. package/lib/esm/common/telemetry/loggers/ariaTelemetryLogger.js +36 -14
  31. package/lib/esm/common/telemetry/loggers/consoleLogger.js +6 -5
  32. package/lib/esm/common/utils.js +12 -1
  33. package/lib/esm/components/callingcontainerstateful/CallingContainerStateful.js +14 -0
  34. package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +1 -1
  35. package/lib/esm/components/footerstateful/FooterStateful.js +1 -2
  36. package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +1 -1
  37. package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +5 -15
  38. package/lib/esm/components/livechatwidget/common/endChat.js +10 -9
  39. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +6 -0
  40. package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +94 -20
  41. package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +3 -13
  42. package/lib/esm/components/livechatwidget/common/startChat.js +39 -30
  43. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +27 -9
  44. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +32 -0
  45. package/lib/esm/contexts/common/LiveChatWidgetActionType.js +22 -21
  46. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +2 -1
  47. package/lib/esm/contexts/createReducer.js +8 -0
  48. package/lib/esm/plugins/newMessageEventHandler.js +10 -12
  49. package/lib/types/common/Constants.d.ts +16 -1
  50. package/lib/types/common/interfaces/IContextDataStore.d.ts +1 -1
  51. package/lib/types/common/telemetry/TelemetryConstants.d.ts +9 -2
  52. package/lib/types/common/telemetry/TelemetryHelper.d.ts +2 -0
  53. package/lib/types/common/telemetry/definitions/Payload.d.ts +12 -9
  54. package/lib/types/common/telemetry/interfaces/ITelemetryConfig.d.ts +3 -3
  55. package/lib/types/common/utils.d.ts +1 -0
  56. package/lib/types/components/footerstateful/audionotificationstateful/interfaces/IAudioNotificationStatefulParams.d.ts +0 -1
  57. package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +5 -2
  58. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +1 -1
  59. package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulProps.d.ts +1 -0
  60. package/lib/types/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.d.ts +1 -0
  61. package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +1 -0
  62. package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +22 -21
  63. package/package.json +6 -7
@@ -10,25 +10,26 @@ export let LiveChatWidgetActionType;
10
10
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PREVIOUS_FOCUSED_ELEMENT"] = 6] = "SET_PREVIOUS_FOCUSED_ELEMENT";
11
11
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_OUTSIDE_OPERATING_HOURS"] = 7] = "SET_OUTSIDE_OPERATING_HOURS";
12
12
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PRE_CHAT_SURVEY_RESPONSE"] = 8] = "SET_PRE_CHAT_SURVEY_RESPONSE";
13
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOW_CONFIRMATION"] = 9] = "SET_SHOW_CONFIRMATION";
14
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOW_EMAIL_TRANSCRIPT_PANE"] = 10] = "SET_SHOW_EMAIL_TRANSCRIPT_PANE";
15
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PRECHAT_RESPONSE_EMAIL"] = 11] = "SET_PRECHAT_RESPONSE_EMAIL";
16
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_AUDIO_NOTIFICATION"] = 12] = "SET_AUDIO_NOTIFICATION";
17
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_E2VV_ENABLED"] = 13] = "SET_E2VV_ENABLED";
18
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_CONTEXT"] = 14] = "SET_POST_CHAT_CONTEXT";
19
- LiveChatWidgetActionType[LiveChatWidgetActionType["SHOW_CALLING_CONTAINER"] = 15] = "SHOW_CALLING_CONTAINER";
20
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_INCOMING_CALL"] = 16] = "SET_INCOMING_CALL";
21
- LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_VIDEO_CALL"] = 17] = "DISABLE_VIDEO_CALL";
22
- LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_LOCAL_VIDEO"] = 18] = "DISABLE_LOCAL_VIDEO";
23
- LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_REMOTE_VIDEO"] = 19] = "DISABLE_REMOTE_VIDEO";
24
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CHAT_TOKEN"] = 20] = "SET_CHAT_TOKEN";
25
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SKIP_CHAT_BUTTON_RENDERING"] = 21] = "SET_SKIP_CHAT_BUTTON_RENDERING";
26
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PROACTIVE_CHAT_PARAMS"] = 22] = "SET_PROACTIVE_CHAT_PARAMS";
27
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_TELEMETRY_DATA"] = 23] = "SET_TELEMETRY_DATA";
28
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_RECONNECT_ID"] = 24] = "SET_RECONNECT_ID";
29
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_UNREAD_MESSAGE_COUNT"] = 25] = "SET_UNREAD_MESSAGE_COUNT";
30
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_FOCUS_CHAT_BUTTON"] = 26] = "SET_FOCUS_CHAT_BUTTON";
31
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_ENDED_BY_AGENT"] = 27] = "SET_CONVERSATION_ENDED_BY_AGENT";
32
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_STATE"] = 28] = "SET_WIDGET_STATE";
33
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONTEXT"] = 29] = "SET_LIVE_CHAT_CONTEXT";
13
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CUSTOM_CONTEXT"] = 9] = "SET_CUSTOM_CONTEXT";
14
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOW_CONFIRMATION"] = 10] = "SET_SHOW_CONFIRMATION";
15
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOW_EMAIL_TRANSCRIPT_PANE"] = 11] = "SET_SHOW_EMAIL_TRANSCRIPT_PANE";
16
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PRECHAT_RESPONSE_EMAIL"] = 12] = "SET_PRECHAT_RESPONSE_EMAIL";
17
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_AUDIO_NOTIFICATION"] = 13] = "SET_AUDIO_NOTIFICATION";
18
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_E2VV_ENABLED"] = 14] = "SET_E2VV_ENABLED";
19
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_CONTEXT"] = 15] = "SET_POST_CHAT_CONTEXT";
20
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SHOW_CALLING_CONTAINER"] = 16] = "SHOW_CALLING_CONTAINER";
21
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_INCOMING_CALL"] = 17] = "SET_INCOMING_CALL";
22
+ LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_VIDEO_CALL"] = 18] = "DISABLE_VIDEO_CALL";
23
+ LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_LOCAL_VIDEO"] = 19] = "DISABLE_LOCAL_VIDEO";
24
+ LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_REMOTE_VIDEO"] = 20] = "DISABLE_REMOTE_VIDEO";
25
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CHAT_TOKEN"] = 21] = "SET_CHAT_TOKEN";
26
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SKIP_CHAT_BUTTON_RENDERING"] = 22] = "SET_SKIP_CHAT_BUTTON_RENDERING";
27
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PROACTIVE_CHAT_PARAMS"] = 23] = "SET_PROACTIVE_CHAT_PARAMS";
28
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_TELEMETRY_DATA"] = 24] = "SET_TELEMETRY_DATA";
29
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_RECONNECT_ID"] = 25] = "SET_RECONNECT_ID";
30
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_UNREAD_MESSAGE_COUNT"] = 26] = "SET_UNREAD_MESSAGE_COUNT";
31
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_FOCUS_CHAT_BUTTON"] = 27] = "SET_FOCUS_CHAT_BUTTON";
32
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_ENDED_BY_AGENT"] = 28] = "SET_CONVERSATION_ENDED_BY_AGENT";
33
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_STATE"] = 29] = "SET_WIDGET_STATE";
34
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONTEXT"] = 30] = "SET_LIVE_CHAT_CONTEXT";
34
35
  })(LiveChatWidgetActionType || (LiveChatWidgetActionType = {}));
@@ -18,7 +18,8 @@ export const getLiveChatWidgetContextInitialState = props => {
18
18
  postChatContext: undefined,
19
19
  telemetryInternalData: {},
20
20
  globalDir: "ltr",
21
- liveChatContext: undefined
21
+ liveChatContext: undefined,
22
+ customContext: undefined
22
23
  },
23
24
  appStates: {
24
25
  conversationState: ConversationState.Closed,
@@ -61,6 +61,14 @@ export const createReducer = () => {
61
61
  }
62
62
  };
63
63
 
64
+ case LiveChatWidgetActionType.SET_CUSTOM_CONTEXT:
65
+ return { ...state,
66
+ domainStates: { ...state.domainStates,
67
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
68
+ customContext: action.payload
69
+ }
70
+ };
71
+
64
72
  case LiveChatWidgetActionType.SET_PREVIOUS_FOCUSED_ELEMENT:
65
73
  return { ...state,
66
74
  appStates: { ...state.appStates,
@@ -2,7 +2,6 @@ import { BroadcastEvent, LogLevel, TelemetryEvent } from "../common/telemetry/Te
2
2
  import { BroadcastService } from "@microsoft/omnichannel-chat-components";
3
3
  import { Constants } from "../common/Constants";
4
4
  import { TelemetryHelper } from "../common/telemetry/TelemetryHelper";
5
- import { TelemetryManager } from "../common/telemetry/TelemetryManager";
6
5
  export const createOnNewAdapterActivityHandler = (chatId, userId) => {
7
6
  const onNewAdapterActivityHandler = activity => {
8
7
  var _activity$channelData, _activity$channelData2, _activity$channelData3;
@@ -17,18 +16,16 @@ export const createOnNewAdapterActivityHandler = (chatId, userId) => {
17
16
 
18
17
  const raiseMessageEvent = activity => {
19
18
  if ((activity === null || activity === void 0 ? void 0 : activity.type) === Constants.message) {
20
- var _TelemetryManager$Int, _activity$from;
19
+ var _text, _text2, _activity$channelData4, _activity$from;
21
20
 
22
21
  const payload = {
22
+ // To identify hidden contents vs empty content
23
23
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
24
- text: activity === null || activity === void 0 ? void 0 : activity.text,
25
- id: activity === null || activity === void 0 ? void 0 : activity.id,
24
+ text: (activity === null || activity === void 0 ? void 0 : (_text = activity.text) === null || _text === void 0 ? void 0 : _text.length) >= 1 ? `*contents hidden (${activity === null || activity === void 0 ? void 0 : (_text2 = activity.text) === null || _text2 === void 0 ? void 0 : _text2.length} chars)*` : "",
26
25
  type: activity === null || activity === void 0 ? void 0 : activity.type,
27
26
  timestamp: activity === null || activity === void 0 ? void 0 : activity.timestamp,
28
- chatId: chatId,
29
27
  userId: userId,
30
- conversationId: ((_TelemetryManager$Int = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int === void 0 ? void 0 : _TelemetryManager$Int.conversationId) ?? "",
31
- channelData: activity === null || activity === void 0 ? void 0 : activity.channelData,
28
+ tags: activity === null || activity === void 0 ? void 0 : (_activity$channelData4 = activity.channelData) === null || _activity$channelData4 === void 0 ? void 0 : _activity$channelData4.tags,
32
29
  messageType: ""
33
30
  };
34
31
 
@@ -45,18 +42,18 @@ export const createOnNewAdapterActivityHandler = (chatId, userId) => {
45
42
  Description: "New message sent"
46
43
  });
47
44
  } else {
48
- var _activity$channelData4, _activity$channelData5;
45
+ var _activity$channelData5, _activity$channelData6;
49
46
 
50
- if (activity !== null && activity !== void 0 && (_activity$channelData4 = activity.channelData) !== null && _activity$channelData4 !== void 0 && (_activity$channelData5 = _activity$channelData4.tags) !== null && _activity$channelData5 !== void 0 && _activity$channelData5.includes(Constants.systemMessageTag)) {
47
+ if (activity !== null && activity !== void 0 && (_activity$channelData5 = activity.channelData) !== null && _activity$channelData5 !== void 0 && (_activity$channelData6 = _activity$channelData5.tags) !== null && _activity$channelData6 !== void 0 && _activity$channelData6.includes(Constants.systemMessageTag)) {
51
48
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
52
49
  payload.messageType = Constants.systemMessageTag;
53
50
  } else {
54
- var _activity$channelData6, _activity$channelData7, _activity$channelData8;
51
+ var _activity$channelData7, _activity$channelData8, _activity$channelData9;
55
52
 
56
53
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
57
54
  const messageHasNoText = !(activity !== null && activity !== void 0 && activity.text); // eslint-disable-next-line @typescript-eslint/no-explicit-any
58
55
 
59
- const messageHasNoTags = !(activity !== null && activity !== void 0 && activity.channelData) || !(activity !== null && activity !== void 0 && (_activity$channelData6 = activity.channelData) !== null && _activity$channelData6 !== void 0 && _activity$channelData6.tags) || (activity === null || activity === void 0 ? void 0 : (_activity$channelData7 = activity.channelData) === null || _activity$channelData7 === void 0 ? void 0 : (_activity$channelData8 = _activity$channelData7.tags) === null || _activity$channelData8 === void 0 ? void 0 : _activity$channelData8.length) === 0; // eslint-disable-next-line @typescript-eslint/no-explicit-any
56
+ const messageHasNoTags = !(activity !== null && activity !== void 0 && activity.channelData) || !(activity !== null && activity !== void 0 && (_activity$channelData7 = activity.channelData) !== null && _activity$channelData7 !== void 0 && _activity$channelData7.tags) || (activity === null || activity === void 0 ? void 0 : (_activity$channelData8 = activity.channelData) === null || _activity$channelData8 === void 0 ? void 0 : (_activity$channelData9 = _activity$channelData8.tags) === null || _activity$channelData9 === void 0 ? void 0 : _activity$channelData9.length) === 0; // eslint-disable-next-line @typescript-eslint/no-explicit-any
60
57
 
61
58
  const messageHasNoAttachments = !(activity !== null && activity !== void 0 && activity.attachments) || (activity === null || activity === void 0 ? void 0 : activity.attachments.length) === 0;
62
59
 
@@ -74,7 +71,8 @@ export const createOnNewAdapterActivityHandler = (chatId, userId) => {
74
71
  BroadcastService.postMessage(newMessageReceivedEvent);
75
72
  TelemetryHelper.logActionEvent(LogLevel.INFO, {
76
73
  Event: TelemetryEvent.MessageReceived,
77
- Description: "New message received"
74
+ Description: "New message received",
75
+ Data: payload
78
76
  });
79
77
  }
80
78
  }
@@ -58,7 +58,6 @@ export declare class Constants {
58
58
  static readonly ProactiveChatInviteTimeoutInMs = 60000;
59
59
  static readonly InputSubmit = "InputSubmit";
60
60
  static readonly ReconnectIdAttributeName = "oc.reconnectid";
61
- static readonly redirectPageRequest = "redirectPageRequest";
62
61
  static readonly LiveChatWidget = "LiveChatWidgetNew";
63
62
  static readonly GuidPattern = "xx-x-4m-ym-xxx";
64
63
  static readonly Default = "default";
@@ -137,6 +136,12 @@ export declare enum ElementType {
137
136
  export declare enum ChatSDKError {
138
137
  WidgetUseOutsideOperatingHour = "WidgetUseOutsideOperatingHour"
139
138
  }
139
+ export declare enum EnvironmentVersion {
140
+ prod = "prod",
141
+ dogfood = "df",
142
+ int = "int",
143
+ test = "test"
144
+ }
140
145
  export declare class TranscriptConstants {
141
146
  static readonly ChatTranscriptsBodyColor = "#F5F5F5";
142
147
  static readonly TranscriptMessageEmojiMessageType = "http://schema.skype.com/emoji";
@@ -149,3 +154,13 @@ export declare class TranscriptConstants {
149
154
  static readonly AgentDialogColor = "#2266E3";
150
155
  static readonly AgentFontColor = "white";
151
156
  }
157
+ export declare class AriaTelemetryConstants {
158
+ static readonly GERMANY_ENDPOINT: string;
159
+ static readonly GCCH_ENDPOINT: string;
160
+ static readonly DOD_ENDPOINT: string;
161
+ static readonly EUROPE_ENDPOINT: string;
162
+ static readonly MOONCAKE_ENDPOINT: string;
163
+ static readonly Public: string;
164
+ static readonly EU: string;
165
+ static readonly lcwEUDomainNames: Array<string>;
166
+ }
@@ -6,7 +6,7 @@ export interface IContextDataStore {
6
6
  /**
7
7
  * setData: Set data to data store
8
8
  */
9
- setData: (key: string, value: string) => void;
9
+ setData: (key: string, value: any, type: string) => void;
10
10
  /**
11
11
  * removeData: Remove data from data store by key
12
12
  */
@@ -27,7 +27,11 @@ export declare enum BroadcastEvent {
27
27
  ProactiveChatStartPopoutChat = "ProactiveChatStartPopoutChat",
28
28
  InvalidAdaptiveCardFormat = "InvalidAdaptiveCardFormat",
29
29
  NewMessageSent = "NewMessageSent",
30
- NewMessageReceived = "NewMessageReceived"
30
+ NewMessageReceived = "NewMessageReceived",
31
+ RedirectPageRequest = "RedirectPageRequest",
32
+ StartChatSkippingChatButtonRendering = "StartChatSkippingChatButtonRendering",
33
+ StartUnauthenticatedReconnectChat = "StartUnauthenticatedReconnectChat",
34
+ SetCustomContext = "SetCustomContext"
31
35
  }
32
36
  export declare enum TelemetryEvent {
33
37
  CallAdded = "CallAdded",
@@ -113,6 +117,7 @@ export declare enum TelemetryEvent {
113
117
  InvalidConfiguration = "InvalidConfiguration",
114
118
  SendTypingIndicatorSucceeded = "SendTypingIndicatorSucceeded",
115
119
  SendTypingIndicatorFailed = "SendTypingIndicatorFailed",
120
+ WebChatEvent = "WebChatEvent",
116
121
  PreChatSurveyStartChatMethodFailed = "PreChatSurveyStartChatMethodFailed",
117
122
  ChatAlreadyTriggered = "ChatAlreadyTriggered",
118
123
  StartProactiveChatEventReceived = "StartProactiveChatEventReceived",
@@ -125,11 +130,13 @@ export declare enum TelemetryEvent {
125
130
  ReconnectChatStartNewConversation = "ReconnectChatStartNewConversation",
126
131
  ReconnectChatMinimize = "ReconnectChatMinimize",
127
132
  MessageSent = "MessageSent",
128
- MessageReceived = "MessageReceived"
133
+ MessageReceived = "MessageReceived",
134
+ CustomContextReceived = "CustomContextReceived"
129
135
  }
130
136
  export interface TelemetryInput {
131
137
  scenarioType: ScenarioType;
132
138
  payload: TelemetryData;
139
+ telemetryInfo?: any;
133
140
  }
134
141
  export declare class TelemetryConstants {
135
142
  private static map;
@@ -11,6 +11,7 @@ export interface TelemetryEventWrapper {
11
11
  Description?: string;
12
12
  ExceptionDetails?: any;
13
13
  ElapsedTimeInMilliseconds?: number;
14
+ Data?: any;
14
15
  }
15
16
  export declare class TelemetryHelper {
16
17
  static callId: string;
@@ -35,4 +36,5 @@ export declare class TelemetryHelper {
35
36
  static logActionEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
36
37
  static logSDKEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
37
38
  static logConfigDataEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
39
+ static logWebChatEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
38
40
  }
@@ -1,4 +1,7 @@
1
- export interface ConfigValidationTelemetryData {
1
+ export interface BaseTelemetryData {
2
+ Data?: any;
3
+ }
4
+ export interface ConfigValidationTelemetryData extends BaseTelemetryData {
2
5
  Event?: string;
3
6
  RequestId?: string;
4
7
  LCWVersion?: string;
@@ -8,7 +11,7 @@ export interface ConfigValidationTelemetryData {
8
11
  ExceptionDetails?: object;
9
12
  Domain?: string;
10
13
  }
11
- export interface LoadTelemetryData {
14
+ export interface LoadTelemetryData extends BaseTelemetryData {
12
15
  Event?: string;
13
16
  ResourcePath?: string;
14
17
  ElapsedTimeInMilliseconds?: number;
@@ -20,18 +23,18 @@ export interface LoadTelemetryData {
20
23
  OCChatWidgetVersion?: string;
21
24
  OCChatComponentsVersion?: string;
22
25
  }
23
- export interface MessageProcessingErrorData {
26
+ export interface MessageProcessingErrorData extends BaseTelemetryData {
24
27
  Event: string;
25
28
  ExceptionDetails: object;
26
29
  }
27
- export interface OCChatSDKTelemetryData {
30
+ export interface OCChatSDKTelemetryData extends BaseTelemetryData {
28
31
  RequestId: string;
29
32
  Event?: string;
30
33
  ElapsedTimeInMilliseconds?: number;
31
34
  TransactionId: string;
32
35
  ExceptionDetails?: object;
33
36
  }
34
- export interface IC3ClientTelemetryData {
37
+ export interface IC3ClientTelemetryData extends BaseTelemetryData {
35
38
  SubscriptionId?: string;
36
39
  EndpointUrl?: string;
37
40
  EndpointId?: string;
@@ -42,7 +45,7 @@ export interface IC3ClientTelemetryData {
42
45
  ShouldBubbleToHost?: boolean;
43
46
  Description?: string;
44
47
  }
45
- export interface WebChatTelemetryData {
48
+ export interface WebChatTelemetryData extends BaseTelemetryData {
46
49
  data?: any;
47
50
  dimensions?: any;
48
51
  duration?: number;
@@ -53,7 +56,7 @@ export interface WebChatTelemetryData {
53
56
  name?: string;
54
57
  type?: string;
55
58
  }
56
- export interface ACSAdapterTelemetryData {
59
+ export interface ACSAdapterTelemetryData extends BaseTelemetryData {
57
60
  Description?: string;
58
61
  ACSUserId?: string;
59
62
  ChatThreadId?: string;
@@ -63,14 +66,14 @@ export interface ACSAdapterTelemetryData {
63
66
  ErrorCode?: string;
64
67
  ExceptionDetails?: any;
65
68
  }
66
- export interface ActionTelemetryData {
69
+ export interface ActionTelemetryData extends BaseTelemetryData {
67
70
  Event?: string;
68
71
  ElapsedTimeInMilliseconds?: number;
69
72
  ActionType?: string;
70
73
  ExceptionDetails?: object;
71
74
  Description?: string;
72
75
  }
73
- export interface CallingTelemetryData {
76
+ export interface CallingTelemetryData extends BaseTelemetryData {
74
77
  CallId?: string;
75
78
  Event?: string;
76
79
  ElapsedTimeInMilliseconds?: number;
@@ -32,13 +32,13 @@ export interface ITelemetryConfig {
32
32
  /**
33
33
  * Omnichannel chat widget version
34
34
  */
35
- chatWidgetVersion?: string;
35
+ chatWidgetVersion: string;
36
36
  /**
37
37
  * Omnichannel chat components version
38
38
  */
39
- chatComponentVersion?: string;
39
+ chatComponentVersion: string;
40
40
  /**
41
41
  * Omnichannel Chat SDK Version
42
42
  */
43
- OCChatSDKVersion?: string;
43
+ OCChatSDKVersion: string;
44
44
  }
@@ -21,3 +21,4 @@ export declare const isNullOrUndefined: (obj: any) => boolean;
21
21
  export declare const isNullOrEmptyString: (s: string) => boolean;
22
22
  export declare const newGuid: () => string;
23
23
  export declare const createTimer: () => ITimer;
24
+ export declare const getDomain: (hostValue: any) => string;
@@ -1,5 +1,4 @@
1
1
  export interface IAudioNotificationStatefulParams {
2
2
  audioSrc?: string;
3
- hideAudioNotificationButton?: boolean;
4
3
  isAudioMuted?: boolean;
5
4
  }
@@ -2,6 +2,9 @@ import "regenerator-runtime/runtime";
2
2
  import { Dispatch } from "react";
3
3
  import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
4
4
  import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
5
+ declare const getChatReconnectContext: (chatSDK: any, reconnectId?: string | undefined) => Promise<any>;
5
6
  declare const getReconnectIdForAuthenticatedChat: (props: ILiveChatWidgetProps, chatSDK: any) => Promise<string | undefined>;
6
- declare const handleUnauthenticatedReconnectChat: (dispatch: Dispatch<ILiveChatWidgetAction>, reconnectId: string, initStartChat: any) => Promise<void>;
7
- export { getReconnectIdForAuthenticatedChat, handleUnauthenticatedReconnectChat };
7
+ declare const handleUnauthenticatedReconnectChat: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, reconnectId: string, initStartChat: any, redirectInSameWindow: boolean | undefined) => Promise<void>;
8
+ declare const startUnauthenticatedReconnectChat: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, reconnectId: string, initStartChat: any) => Promise<void>;
9
+ declare const handleRedirectUnauthenticatedReconnectChat: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, initStartChat: any, reconnectId: string, redirectInSameWindow: boolean | undefined) => Promise<void>;
10
+ export { getChatReconnectContext, getReconnectIdForAuthenticatedChat, handleUnauthenticatedReconnectChat, startUnauthenticatedReconnectChat, handleRedirectUnauthenticatedReconnectChat };
@@ -45,7 +45,7 @@ export interface ILiveChatWidgetProps {
45
45
  proactiveChatPaneProps?: IProactiveChatPaneStatefulProps;
46
46
  reconnectChatPaneProps?: IReconnectChatPaneStatefulProps;
47
47
  styleProps?: ILiveChatWidgetStyleProps;
48
- telemetryConfig?: ITelemetryConfig;
48
+ telemetryConfig: ITelemetryConfig;
49
49
  webChatContainerProps?: IWebChatContainerStatefulProps;
50
50
  liveChatContextFromCache?: ILiveChatWidgetContext;
51
51
  contextDataStore?: IContextDataStore;
@@ -3,4 +3,5 @@ export interface IReconnectChatPaneStatefulProps extends IReconnectChatPaneProps
3
3
  authClientFunction?: string;
4
4
  isReconnectEnabled?: boolean;
5
5
  reconnectId?: string;
6
+ redirectInSameWindow?: boolean;
6
7
  }
@@ -0,0 +1 @@
1
+ export declare function createWebChatTelemetry(): (event: any) => void;
@@ -15,6 +15,7 @@ export interface ILiveChatWidgetContext {
15
15
  telemetryInternalData: IInternalTelemetryData;
16
16
  globalDir: "rtl" | "ltr";
17
17
  liveChatContext: any;
18
+ customContext: any;
18
19
  };
19
20
  appStates: {
20
21
  conversationState: ConversationState;
@@ -8,25 +8,26 @@ export declare enum LiveChatWidgetActionType {
8
8
  SET_PREVIOUS_FOCUSED_ELEMENT = 6,
9
9
  SET_OUTSIDE_OPERATING_HOURS = 7,
10
10
  SET_PRE_CHAT_SURVEY_RESPONSE = 8,
11
- SET_SHOW_CONFIRMATION = 9,
12
- SET_SHOW_EMAIL_TRANSCRIPT_PANE = 10,
13
- SET_PRECHAT_RESPONSE_EMAIL = 11,
14
- SET_AUDIO_NOTIFICATION = 12,
15
- SET_E2VV_ENABLED = 13,
16
- SET_POST_CHAT_CONTEXT = 14,
17
- SHOW_CALLING_CONTAINER = 15,
18
- SET_INCOMING_CALL = 16,
19
- DISABLE_VIDEO_CALL = 17,
20
- DISABLE_LOCAL_VIDEO = 18,
21
- DISABLE_REMOTE_VIDEO = 19,
22
- SET_CHAT_TOKEN = 20,
23
- SET_SKIP_CHAT_BUTTON_RENDERING = 21,
24
- SET_PROACTIVE_CHAT_PARAMS = 22,
25
- SET_TELEMETRY_DATA = 23,
26
- SET_RECONNECT_ID = 24,
27
- SET_UNREAD_MESSAGE_COUNT = 25,
28
- SET_FOCUS_CHAT_BUTTON = 26,
29
- SET_CONVERSATION_ENDED_BY_AGENT = 27,
30
- SET_WIDGET_STATE = 28,
31
- SET_LIVE_CHAT_CONTEXT = 29
11
+ SET_CUSTOM_CONTEXT = 9,
12
+ SET_SHOW_CONFIRMATION = 10,
13
+ SET_SHOW_EMAIL_TRANSCRIPT_PANE = 11,
14
+ SET_PRECHAT_RESPONSE_EMAIL = 12,
15
+ SET_AUDIO_NOTIFICATION = 13,
16
+ SET_E2VV_ENABLED = 14,
17
+ SET_POST_CHAT_CONTEXT = 15,
18
+ SHOW_CALLING_CONTAINER = 16,
19
+ SET_INCOMING_CALL = 17,
20
+ DISABLE_VIDEO_CALL = 18,
21
+ DISABLE_LOCAL_VIDEO = 19,
22
+ DISABLE_REMOTE_VIDEO = 20,
23
+ SET_CHAT_TOKEN = 21,
24
+ SET_SKIP_CHAT_BUTTON_RENDERING = 22,
25
+ SET_PROACTIVE_CHAT_PARAMS = 23,
26
+ SET_TELEMETRY_DATA = 24,
27
+ SET_RECONNECT_ID = 25,
28
+ SET_UNREAD_MESSAGE_COUNT = 26,
29
+ SET_FOCUS_CHAT_BUTTON = 27,
30
+ SET_CONVERSATION_ENDED_BY_AGENT = 28,
31
+ SET_WIDGET_STATE = 29,
32
+ SET_LIVE_CHAT_CONTEXT = 30
32
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/omnichannel-chat-widget",
3
- "version": "0.1.0-main.20562ae",
3
+ "version": "0.1.0-main.4188c11",
4
4
  "description": "Microsoft Omnichannel Chat Widget",
5
5
  "main": "lib/cjs/index.js",
6
6
  "types": "lib/types/index.d.ts",
@@ -16,7 +16,8 @@
16
16
  "import": "./lib/esm/index.js",
17
17
  "require": "./lib/cjs/index.js",
18
18
  "types": "./lib/types/index.d.ts"
19
- }
19
+ },
20
+ "./package.json": "./package.json"
20
21
  },
21
22
  "devDependencies": {
22
23
  "@babel/core": "^7.15.8",
@@ -71,13 +72,9 @@
71
72
  "webpack": "^4.44.2",
72
73
  "webpack-cli": "^4.9.2"
73
74
  },
74
- "peerDependencies": {
75
- "react": "^16.14.0",
76
- "react-dom": "^16.14.0"
77
- },
78
75
  "dependencies": {
79
76
  "@fluentui/react": "^8.49.1",
80
- "@microsoft/omnichannel-chat-components": "0.1.0-main.2eda736",
77
+ "@microsoft/omnichannel-chat-components": "^0.1.0-main.91dd060",
81
78
  "@microsoft/omnichannel-chat-sdk": "1.0.1-main.077d17c",
82
79
  "abort-controller-es5": "^2.0.1",
83
80
  "dompurify": "^2.3.4",
@@ -93,6 +90,8 @@
93
90
  "build-storybook": "build-storybook",
94
91
  "build": "yarn lint && yarn build:esm && yarn build:cjs && tsc",
95
92
  "test:unit": "jest -c jest.config.unit.cjs --env=jsdom --runInBand --force-exit",
93
+ "test:e2e": "cd automation_tests && yarn test",
94
+ "test:e2e:build": "yarn build-sample && cd automation_tests && yarn test",
96
95
  "test:visual": "jest -c jest.config.visual.cjs",
97
96
  "test:all": "yarn test:unit && yarn test:visual",
98
97
  "build:esm": "babel ./src --config-file ./babel.esm.config.json --out-dir lib/esm --extensions .ts,.js,.tsx --ignore **/*.test.ts,**/*.stories.tsx,**/*.test.tsx",