@microsoft/omnichannel-chat-widget 1.0.5-main.d908c85 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/common/telemetry/TelemetryHelper.js +3 -2
- package/lib/cjs/components/livechatwidget/common/startChat.js +27 -12
- package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +5 -1
- package/lib/esm/common/telemetry/TelemetryHelper.js +3 -2
- package/lib/esm/components/livechatwidget/common/startChat.js +27 -12
- package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +5 -1
- package/lib/types/common/telemetry/TelemetryHelper.d.ts +3 -3
- package/lib/types/common/telemetry/definitions/Payload.d.ts +1 -0
- package/package.json +2 -2
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.TelemetryHelper = void 0;
|
|
7
7
|
var _TelemetryConstants = require("./TelemetryConstants");
|
|
8
|
-
var _utils = require("../utils");
|
|
9
|
-
var _TelemetryManager = require("./TelemetryManager");
|
|
10
8
|
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
9
|
+
var _TelemetryManager = require("./TelemetryManager");
|
|
10
|
+
var _utils = require("../utils");
|
|
11
11
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
12
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
13
13
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
@@ -96,6 +96,7 @@ class TelemetryHelper {
|
|
|
96
96
|
return TelemetryHelper.populate(level, payload, event => {
|
|
97
97
|
var _TelemetryManager$Int11, _TelemetryManager$Int12, _TelemetryManager$Int13;
|
|
98
98
|
event.Event = payload.Event;
|
|
99
|
+
event.Description = payload.Description;
|
|
99
100
|
event.ResourcePath = payload.ResourcePath;
|
|
100
101
|
event.WidgetState = payload.WidgetState;
|
|
101
102
|
event.ChatState = payload.ChatState;
|
|
@@ -61,12 +61,13 @@ const prepareStartChat = async (props, chatSDK, state, dispatch, setAdapter) =>
|
|
|
61
61
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
62
62
|
exports.prepareStartChat = prepareStartChat;
|
|
63
63
|
const setPreChatAndInitiateChat = async (chatSDK, dispatch, setAdapter, isProactiveChat, proactiveChatEnablePrechatState, state, props) => {
|
|
64
|
+
var _props$controlProps;
|
|
64
65
|
//Handle reconnect scenario
|
|
65
66
|
|
|
66
67
|
// Getting prechat Survey Context
|
|
67
68
|
const parseToJson = false;
|
|
68
69
|
const preChatSurveyResponse = await chatSDK.getPreChatSurvey(parseToJson);
|
|
69
|
-
const showPrechat = isProactiveChat ? preChatSurveyResponse && proactiveChatEnablePrechatState : preChatSurveyResponse;
|
|
70
|
+
const showPrechat = isProactiveChat ? preChatSurveyResponse && proactiveChatEnablePrechatState : preChatSurveyResponse && !(props !== null && props !== void 0 && (_props$controlProps = props.controlProps) !== null && _props$controlProps !== void 0 && _props$controlProps.hidePreChatSurveyPane);
|
|
70
71
|
if (showPrechat) {
|
|
71
72
|
dispatch({
|
|
72
73
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_PRE_CHAT_SURVEY_RESPONSE,
|
|
@@ -93,13 +94,13 @@ const setPreChatAndInitiateChat = async (chatSDK, dispatch, setAdapter, isProact
|
|
|
93
94
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
94
95
|
exports.setPreChatAndInitiateChat = setPreChatAndInitiateChat;
|
|
95
96
|
const initStartChat = async (chatSDK, dispatch, setAdapter, props, params, persistedState) => {
|
|
96
|
-
var _props$
|
|
97
|
+
var _props$controlProps2;
|
|
97
98
|
let isStartChatSuccessful = false;
|
|
98
99
|
const chatConfig = props === null || props === void 0 ? void 0 : props.chatConfig;
|
|
99
100
|
const getAuthToken = props === null || props === void 0 ? void 0 : props.getAuthToken;
|
|
100
|
-
const hideErrorUIPane = props === null || props === void 0 ? void 0 : (_props$
|
|
101
|
+
const hideErrorUIPane = props === null || props === void 0 ? void 0 : (_props$controlProps2 = props.controlProps) === null || _props$controlProps2 === void 0 ? void 0 : _props$controlProps2.hideErrorUIPane;
|
|
101
102
|
try {
|
|
102
|
-
var _newAdapter$activity$, _TelemetryTimers$
|
|
103
|
+
var _newAdapter$activity$, _TelemetryTimers$Widg2;
|
|
103
104
|
//Start widget load timer
|
|
104
105
|
_TelemetryManager.TelemetryTimers.WidgetLoadTimer = (0, _utils.createTimer)();
|
|
105
106
|
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
@@ -175,10 +176,16 @@ const initStartChat = async (chatSDK, dispatch, setAdapter, props, params, persi
|
|
|
175
176
|
});
|
|
176
177
|
}
|
|
177
178
|
if (persistedState) {
|
|
179
|
+
var _TelemetryTimers$Widg;
|
|
178
180
|
dispatch({
|
|
179
181
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_WIDGET_STATE,
|
|
180
182
|
payload: persistedState
|
|
181
183
|
});
|
|
184
|
+
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
185
|
+
Event: _TelemetryConstants.TelemetryEvent.WidgetLoadComplete,
|
|
186
|
+
Description: "Widget load complete. Persisted state retrieved",
|
|
187
|
+
ElapsedTimeInMilliseconds: _TelemetryManager.TelemetryTimers === null || _TelemetryManager.TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg = _TelemetryManager.TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg === void 0 ? void 0 : _TelemetryTimers$Widg.milliSecondsElapsed
|
|
188
|
+
});
|
|
182
189
|
await (0, _setPostChatContextAndLoadSurvey.setPostChatContextAndLoadSurvey)(chatSDK, dispatch, true);
|
|
183
190
|
return;
|
|
184
191
|
}
|
|
@@ -192,7 +199,7 @@ const initStartChat = async (chatSDK, dispatch, setAdapter, props, params, persi
|
|
|
192
199
|
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
193
200
|
Event: _TelemetryConstants.TelemetryEvent.WidgetLoadComplete,
|
|
194
201
|
Description: "Widget load complete",
|
|
195
|
-
ElapsedTimeInMilliseconds: _TelemetryManager.TelemetryTimers === null || _TelemetryManager.TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$
|
|
202
|
+
ElapsedTimeInMilliseconds: _TelemetryManager.TelemetryTimers === null || _TelemetryManager.TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg2 = _TelemetryManager.TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg2 === void 0 ? void 0 : _TelemetryTimers$Widg2.milliSecondsElapsed
|
|
196
203
|
});
|
|
197
204
|
|
|
198
205
|
// Set post chat context in state
|
|
@@ -202,15 +209,10 @@ const initStartChat = async (chatSDK, dispatch, setAdapter, props, params, persi
|
|
|
202
209
|
// Updating chat session detail for telemetry
|
|
203
210
|
await (0, _updateSessionDataForTelemetry.updateSessionDataForTelemetry)(chatSDK, dispatch);
|
|
204
211
|
} catch (ex) {
|
|
205
|
-
|
|
206
|
-
Event: _TelemetryConstants.TelemetryEvent.WidgetLoadFailed,
|
|
207
|
-
ExceptionDetails: {
|
|
208
|
-
Exception: `Widget load Failed: ${ex}`
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
_NotificationHandler.NotificationHandler.notifyError(_NotificationScenarios.NotificationScenarios.Connection, "Start Chat Failed: " + ex);
|
|
212
|
+
var _TelemetryTimers$Widg4;
|
|
212
213
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
213
214
|
if (ex.message === _Constants.ChatSDKError.WidgetUseOutsideOperatingHour) {
|
|
215
|
+
var _TelemetryTimers$Widg3;
|
|
214
216
|
dispatch({
|
|
215
217
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_OUTSIDE_OPERATING_HOURS,
|
|
216
218
|
payload: true
|
|
@@ -219,8 +221,21 @@ const initStartChat = async (chatSDK, dispatch, setAdapter, props, params, persi
|
|
|
219
221
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
220
222
|
payload: _ConversationState.ConversationState.OutOfOffice
|
|
221
223
|
});
|
|
224
|
+
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
225
|
+
Event: _TelemetryConstants.TelemetryEvent.WidgetLoadComplete,
|
|
226
|
+
Description: "Widget load complete. Widget is OOOH.",
|
|
227
|
+
ElapsedTimeInMilliseconds: _TelemetryManager.TelemetryTimers === null || _TelemetryManager.TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg3 = _TelemetryManager.TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg3 === void 0 ? void 0 : _TelemetryTimers$Widg3.milliSecondsElapsed
|
|
228
|
+
});
|
|
222
229
|
return;
|
|
223
230
|
}
|
|
231
|
+
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.ERROR, {
|
|
232
|
+
Event: _TelemetryConstants.TelemetryEvent.WidgetLoadFailed,
|
|
233
|
+
ExceptionDetails: {
|
|
234
|
+
Exception: `Widget load Failed: ${ex}`
|
|
235
|
+
},
|
|
236
|
+
ElapsedTimeInMilliseconds: _TelemetryManager.TelemetryTimers === null || _TelemetryManager.TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg4 = _TelemetryManager.TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg4 === void 0 ? void 0 : _TelemetryTimers$Widg4.milliSecondsElapsed
|
|
237
|
+
});
|
|
238
|
+
_NotificationHandler.NotificationHandler.notifyError(_NotificationScenarios.NotificationScenarios.Connection, "Start Chat Failed: " + ex);
|
|
224
239
|
dispatch({
|
|
225
240
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_START_CHAT_FAILING,
|
|
226
241
|
payload: true
|
|
@@ -60,9 +60,13 @@ const ProactiveChatPaneStateful = props => {
|
|
|
60
60
|
Description: "Proactive chat accepted."
|
|
61
61
|
});
|
|
62
62
|
if (state.appStates.proactiveChatStates.proactiveChatInNewWindow) {
|
|
63
|
+
var _state$appStates, _state$appStates$proa;
|
|
63
64
|
// TODO: BroadcastService: replace with the sdk broadcast service, when in place
|
|
64
65
|
const startPopoutChatEvent = {
|
|
65
|
-
eventName: _TelemetryConstants.BroadcastEvent.ProactiveChatStartPopoutChat
|
|
66
|
+
eventName: _TelemetryConstants.BroadcastEvent.ProactiveChatStartPopoutChat,
|
|
67
|
+
payload: {
|
|
68
|
+
enablePrechat: (state === null || state === void 0 ? void 0 : (_state$appStates = state.appStates) === null || _state$appStates === void 0 ? void 0 : (_state$appStates$proa = _state$appStates.proactiveChatStates) === null || _state$appStates$proa === void 0 ? void 0 : _state$appStates$proa.proactiveChatEnablePrechat) === true
|
|
69
|
+
}
|
|
66
70
|
};
|
|
67
71
|
_omnichannelChatComponents.BroadcastService.postMessage(startPopoutChatEvent);
|
|
68
72
|
dispatch({
|
|
@@ -2,9 +2,9 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
2
2
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
3
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
4
|
import { ScenarioType, TelemetryEvent } from "./TelemetryConstants";
|
|
5
|
-
import { newGuid } from "../utils";
|
|
6
|
-
import { TelemetryManager } from "./TelemetryManager";
|
|
7
5
|
import { BroadcastService } from "@microsoft/omnichannel-chat-components";
|
|
6
|
+
import { TelemetryManager } from "./TelemetryManager";
|
|
7
|
+
import { newGuid } from "../utils";
|
|
8
8
|
export class TelemetryHelper {
|
|
9
9
|
static buildTelemetryEvent(level, input) {
|
|
10
10
|
switch (input.scenarioType) {
|
|
@@ -90,6 +90,7 @@ export class TelemetryHelper {
|
|
|
90
90
|
return TelemetryHelper.populate(level, payload, event => {
|
|
91
91
|
var _TelemetryManager$Int11, _TelemetryManager$Int12, _TelemetryManager$Int13;
|
|
92
92
|
event.Event = payload.Event;
|
|
93
|
+
event.Description = payload.Description;
|
|
93
94
|
event.ResourcePath = payload.ResourcePath;
|
|
94
95
|
event.WidgetState = payload.WidgetState;
|
|
95
96
|
event.ChatState = payload.ChatState;
|
|
@@ -55,12 +55,13 @@ const prepareStartChat = async (props, chatSDK, state, dispatch, setAdapter) =>
|
|
|
55
55
|
|
|
56
56
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
57
57
|
const setPreChatAndInitiateChat = async (chatSDK, dispatch, setAdapter, isProactiveChat, proactiveChatEnablePrechatState, state, props) => {
|
|
58
|
+
var _props$controlProps;
|
|
58
59
|
//Handle reconnect scenario
|
|
59
60
|
|
|
60
61
|
// Getting prechat Survey Context
|
|
61
62
|
const parseToJson = false;
|
|
62
63
|
const preChatSurveyResponse = await chatSDK.getPreChatSurvey(parseToJson);
|
|
63
|
-
const showPrechat = isProactiveChat ? preChatSurveyResponse && proactiveChatEnablePrechatState : preChatSurveyResponse;
|
|
64
|
+
const showPrechat = isProactiveChat ? preChatSurveyResponse && proactiveChatEnablePrechatState : preChatSurveyResponse && !(props !== null && props !== void 0 && (_props$controlProps = props.controlProps) !== null && _props$controlProps !== void 0 && _props$controlProps.hidePreChatSurveyPane);
|
|
64
65
|
if (showPrechat) {
|
|
65
66
|
dispatch({
|
|
66
67
|
type: LiveChatWidgetActionType.SET_PRE_CHAT_SURVEY_RESPONSE,
|
|
@@ -86,13 +87,13 @@ const setPreChatAndInitiateChat = async (chatSDK, dispatch, setAdapter, isProact
|
|
|
86
87
|
|
|
87
88
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
88
89
|
const initStartChat = async (chatSDK, dispatch, setAdapter, props, params, persistedState) => {
|
|
89
|
-
var _props$
|
|
90
|
+
var _props$controlProps2;
|
|
90
91
|
let isStartChatSuccessful = false;
|
|
91
92
|
const chatConfig = props === null || props === void 0 ? void 0 : props.chatConfig;
|
|
92
93
|
const getAuthToken = props === null || props === void 0 ? void 0 : props.getAuthToken;
|
|
93
|
-
const hideErrorUIPane = props === null || props === void 0 ? void 0 : (_props$
|
|
94
|
+
const hideErrorUIPane = props === null || props === void 0 ? void 0 : (_props$controlProps2 = props.controlProps) === null || _props$controlProps2 === void 0 ? void 0 : _props$controlProps2.hideErrorUIPane;
|
|
94
95
|
try {
|
|
95
|
-
var _newAdapter$activity$, _TelemetryTimers$
|
|
96
|
+
var _newAdapter$activity$, _TelemetryTimers$Widg2;
|
|
96
97
|
//Start widget load timer
|
|
97
98
|
TelemetryTimers.WidgetLoadTimer = createTimer();
|
|
98
99
|
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
@@ -168,10 +169,16 @@ const initStartChat = async (chatSDK, dispatch, setAdapter, props, params, persi
|
|
|
168
169
|
});
|
|
169
170
|
}
|
|
170
171
|
if (persistedState) {
|
|
172
|
+
var _TelemetryTimers$Widg;
|
|
171
173
|
dispatch({
|
|
172
174
|
type: LiveChatWidgetActionType.SET_WIDGET_STATE,
|
|
173
175
|
payload: persistedState
|
|
174
176
|
});
|
|
177
|
+
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
178
|
+
Event: TelemetryEvent.WidgetLoadComplete,
|
|
179
|
+
Description: "Widget load complete. Persisted state retrieved",
|
|
180
|
+
ElapsedTimeInMilliseconds: TelemetryTimers === null || TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg = TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg === void 0 ? void 0 : _TelemetryTimers$Widg.milliSecondsElapsed
|
|
181
|
+
});
|
|
175
182
|
await setPostChatContextAndLoadSurvey(chatSDK, dispatch, true);
|
|
176
183
|
return;
|
|
177
184
|
}
|
|
@@ -185,7 +192,7 @@ const initStartChat = async (chatSDK, dispatch, setAdapter, props, params, persi
|
|
|
185
192
|
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
186
193
|
Event: TelemetryEvent.WidgetLoadComplete,
|
|
187
194
|
Description: "Widget load complete",
|
|
188
|
-
ElapsedTimeInMilliseconds: TelemetryTimers === null || TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$
|
|
195
|
+
ElapsedTimeInMilliseconds: TelemetryTimers === null || TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg2 = TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg2 === void 0 ? void 0 : _TelemetryTimers$Widg2.milliSecondsElapsed
|
|
189
196
|
});
|
|
190
197
|
|
|
191
198
|
// Set post chat context in state
|
|
@@ -195,15 +202,10 @@ const initStartChat = async (chatSDK, dispatch, setAdapter, props, params, persi
|
|
|
195
202
|
// Updating chat session detail for telemetry
|
|
196
203
|
await updateSessionDataForTelemetry(chatSDK, dispatch);
|
|
197
204
|
} catch (ex) {
|
|
198
|
-
|
|
199
|
-
Event: TelemetryEvent.WidgetLoadFailed,
|
|
200
|
-
ExceptionDetails: {
|
|
201
|
-
Exception: `Widget load Failed: ${ex}`
|
|
202
|
-
}
|
|
203
|
-
});
|
|
204
|
-
NotificationHandler.notifyError(NotificationScenarios.Connection, "Start Chat Failed: " + ex);
|
|
205
|
+
var _TelemetryTimers$Widg4;
|
|
205
206
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
206
207
|
if (ex.message === ChatSDKError.WidgetUseOutsideOperatingHour) {
|
|
208
|
+
var _TelemetryTimers$Widg3;
|
|
207
209
|
dispatch({
|
|
208
210
|
type: LiveChatWidgetActionType.SET_OUTSIDE_OPERATING_HOURS,
|
|
209
211
|
payload: true
|
|
@@ -212,8 +214,21 @@ const initStartChat = async (chatSDK, dispatch, setAdapter, props, params, persi
|
|
|
212
214
|
type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
213
215
|
payload: ConversationState.OutOfOffice
|
|
214
216
|
});
|
|
217
|
+
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
218
|
+
Event: TelemetryEvent.WidgetLoadComplete,
|
|
219
|
+
Description: "Widget load complete. Widget is OOOH.",
|
|
220
|
+
ElapsedTimeInMilliseconds: TelemetryTimers === null || TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg3 = TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg3 === void 0 ? void 0 : _TelemetryTimers$Widg3.milliSecondsElapsed
|
|
221
|
+
});
|
|
215
222
|
return;
|
|
216
223
|
}
|
|
224
|
+
TelemetryHelper.logLoadingEvent(LogLevel.ERROR, {
|
|
225
|
+
Event: TelemetryEvent.WidgetLoadFailed,
|
|
226
|
+
ExceptionDetails: {
|
|
227
|
+
Exception: `Widget load Failed: ${ex}`
|
|
228
|
+
},
|
|
229
|
+
ElapsedTimeInMilliseconds: TelemetryTimers === null || TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg4 = TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg4 === void 0 ? void 0 : _TelemetryTimers$Widg4.milliSecondsElapsed
|
|
230
|
+
});
|
|
231
|
+
NotificationHandler.notifyError(NotificationScenarios.Connection, "Start Chat Failed: " + ex);
|
|
217
232
|
dispatch({
|
|
218
233
|
type: LiveChatWidgetActionType.SET_START_CHAT_FAILING,
|
|
219
234
|
payload: true
|
|
@@ -53,9 +53,13 @@ export const ProactiveChatPaneStateful = props => {
|
|
|
53
53
|
Description: "Proactive chat accepted."
|
|
54
54
|
});
|
|
55
55
|
if (state.appStates.proactiveChatStates.proactiveChatInNewWindow) {
|
|
56
|
+
var _state$appStates, _state$appStates$proa;
|
|
56
57
|
// TODO: BroadcastService: replace with the sdk broadcast service, when in place
|
|
57
58
|
const startPopoutChatEvent = {
|
|
58
|
-
eventName: BroadcastEvent.ProactiveChatStartPopoutChat
|
|
59
|
+
eventName: BroadcastEvent.ProactiveChatStartPopoutChat,
|
|
60
|
+
payload: {
|
|
61
|
+
enablePrechat: (state === null || state === void 0 ? void 0 : (_state$appStates = state.appStates) === null || _state$appStates === void 0 ? void 0 : (_state$appStates$proa = _state$appStates.proactiveChatStates) === null || _state$appStates$proa === void 0 ? void 0 : _state$appStates$proa.proactiveChatEnablePrechat) === true
|
|
62
|
+
}
|
|
59
63
|
};
|
|
60
64
|
BroadcastService.postMessage(startPopoutChatEvent);
|
|
61
65
|
dispatch({
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { LogLevel, TelemetryEvent, TelemetryInput } from "./TelemetryConstants";
|
|
2
1
|
import { BaseContract, TelemetryContract } from "./definitions/Contracts";
|
|
3
2
|
import { TelemetryData } from "./definitions/Payload";
|
|
3
|
+
import { LogLevel, TelemetryEvent, TelemetryInput } from "./TelemetryConstants";
|
|
4
4
|
import ChatConfig from "@microsoft/omnichannel-chat-sdk/lib/core/ChatConfig";
|
|
5
|
-
import LiveChatContext from "@microsoft/omnichannel-chat-sdk/lib/core/LiveChatContext";
|
|
6
|
-
import LiveWorkItemDetails from "@microsoft/omnichannel-chat-sdk/lib/core/LiveWorkItemDetails";
|
|
7
5
|
import { IInternalTelemetryData } from "./interfaces/IInternalTelemetryData";
|
|
8
6
|
import { ITelemetryConfig } from "./interfaces/ITelemetryConfig";
|
|
7
|
+
import LiveChatContext from "@microsoft/omnichannel-chat-sdk/lib/core/LiveChatContext";
|
|
8
|
+
import LiveWorkItemDetails from "@microsoft/omnichannel-chat-sdk/lib/core/LiveWorkItemDetails";
|
|
9
9
|
export interface TelemetryEventWrapper {
|
|
10
10
|
Event: TelemetryEvent;
|
|
11
11
|
Description?: string;
|
|
@@ -22,6 +22,7 @@ export interface LoadTelemetryData extends BaseTelemetryData {
|
|
|
22
22
|
OCChatSDKVersion?: string;
|
|
23
23
|
OCChatWidgetVersion?: string;
|
|
24
24
|
OCChatComponentsVersion?: string;
|
|
25
|
+
Description?: string;
|
|
25
26
|
}
|
|
26
27
|
export interface MessageProcessingErrorData extends BaseTelemetryData {
|
|
27
28
|
Event: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/omnichannel-chat-widget",
|
|
3
|
-
"version": "1.0.5
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Microsoft Omnichannel Chat Widget",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"types": "lib/types/index.d.ts",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"@microsoft/omnichannel-chat-components": "^1.0.1",
|
|
78
|
-
"@microsoft/omnichannel-chat-sdk": "1.4.
|
|
78
|
+
"@microsoft/omnichannel-chat-sdk": "1.4.2",
|
|
79
79
|
"abort-controller-es5": "^2.0.1",
|
|
80
80
|
"dompurify": "^2.3.4",
|
|
81
81
|
"markdown-it": "^12.3.2",
|