@microsoft/omnichannel-chat-widget 0.1.0-main.63cfb47 → 0.1.0-main.745305b
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/Constants.js +32 -2
- package/lib/cjs/common/telemetry/TelemetryConstants.js +5 -0
- package/lib/cjs/common/telemetry/TelemetryManager.js +7 -1
- package/lib/cjs/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.js +4 -1
- package/lib/cjs/common/telemetry/loggers/ariaTelemetryLogger.js +33 -13
- package/lib/cjs/common/telemetry/loggers/consoleLogger.js +6 -5
- package/lib/cjs/common/utils.js +16 -2
- package/lib/cjs/components/callingcontainerstateful/CallingContainerStateful.js +14 -0
- package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +1 -1
- package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +0 -12
- package/lib/cjs/components/livechatwidget/common/endChat.js +10 -9
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +4 -0
- package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +3 -15
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +21 -5
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +1 -0
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +22 -21
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +2 -1
- package/lib/cjs/contexts/createReducer.js +7 -0
- package/lib/esm/common/Constants.js +28 -1
- package/lib/esm/common/telemetry/TelemetryConstants.js +5 -0
- package/lib/esm/common/telemetry/TelemetryManager.js +6 -1
- package/lib/esm/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.js +4 -1
- package/lib/esm/common/telemetry/loggers/ariaTelemetryLogger.js +36 -14
- package/lib/esm/common/telemetry/loggers/consoleLogger.js +6 -5
- package/lib/esm/common/utils.js +12 -1
- package/lib/esm/components/callingcontainerstateful/CallingContainerStateful.js +14 -0
- package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +1 -1
- package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +0 -12
- package/lib/esm/components/livechatwidget/common/endChat.js +10 -9
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +4 -0
- package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +3 -13
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +19 -5
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +1 -0
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +22 -21
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +2 -1
- package/lib/esm/contexts/createReducer.js +7 -0
- package/lib/types/common/Constants.d.ts +16 -0
- package/lib/types/common/interfaces/IContextDataStore.d.ts +1 -1
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +5 -2
- package/lib/types/common/telemetry/interfaces/ITelemetryConfig.d.ts +3 -3
- package/lib/types/common/utils.d.ts +1 -0
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +1 -1
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +1 -0
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +22 -21
- package/package.json +4 -7
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.WebChatMiddlewareConstants = exports.TranscriptConstants = exports.Regex = exports.MimeTypes = exports.LocaleConstants = exports.HtmlIdNames = exports.HtmlElementSelectors = exports.HtmlClassNames = exports.HtmlAttributeNames = exports.ElementType = exports.Constants = exports.ChatSDKError = void 0;
|
|
6
|
+
exports.WebChatMiddlewareConstants = exports.TranscriptConstants = exports.Regex = exports.MimeTypes = exports.LocaleConstants = exports.HtmlIdNames = exports.HtmlElementSelectors = exports.HtmlClassNames = exports.HtmlAttributeNames = exports.EnvironmentVersion = exports.ElementType = exports.Constants = exports.ChatSDKError = exports.AriaTelemetryConstants = void 0;
|
|
7
7
|
|
|
8
8
|
var _class;
|
|
9
9
|
|
|
@@ -282,6 +282,16 @@ exports.ChatSDKError = ChatSDKError;
|
|
|
282
282
|
ChatSDKError["WidgetUseOutsideOperatingHour"] = "WidgetUseOutsideOperatingHour";
|
|
283
283
|
})(ChatSDKError || (exports.ChatSDKError = ChatSDKError = {}));
|
|
284
284
|
|
|
285
|
+
let EnvironmentVersion;
|
|
286
|
+
exports.EnvironmentVersion = EnvironmentVersion;
|
|
287
|
+
|
|
288
|
+
(function (EnvironmentVersion) {
|
|
289
|
+
EnvironmentVersion["prod"] = "prod";
|
|
290
|
+
EnvironmentVersion["dogfood"] = "df";
|
|
291
|
+
EnvironmentVersion["int"] = "int";
|
|
292
|
+
EnvironmentVersion["test"] = "test";
|
|
293
|
+
})(EnvironmentVersion || (exports.EnvironmentVersion = EnvironmentVersion = {}));
|
|
294
|
+
|
|
285
295
|
class TranscriptConstants {}
|
|
286
296
|
|
|
287
297
|
exports.TranscriptConstants = TranscriptConstants;
|
|
@@ -304,4 +314,24 @@ _defineProperty(TranscriptConstants, "InternalMode", "internal");
|
|
|
304
314
|
|
|
305
315
|
_defineProperty(TranscriptConstants, "AgentDialogColor", "#2266E3");
|
|
306
316
|
|
|
307
|
-
_defineProperty(TranscriptConstants, "AgentFontColor", "white");
|
|
317
|
+
_defineProperty(TranscriptConstants, "AgentFontColor", "white");
|
|
318
|
+
|
|
319
|
+
class AriaTelemetryConstants {}
|
|
320
|
+
|
|
321
|
+
exports.AriaTelemetryConstants = AriaTelemetryConstants;
|
|
322
|
+
|
|
323
|
+
_defineProperty(AriaTelemetryConstants, "GERMANY_ENDPOINT", "https://de.pipe.aria.microsoft.com/Collector/3.0/");
|
|
324
|
+
|
|
325
|
+
_defineProperty(AriaTelemetryConstants, "GCCH_ENDPOINT", "https://tb.pipe.aria.microsoft.com/Collector/3.0/");
|
|
326
|
+
|
|
327
|
+
_defineProperty(AriaTelemetryConstants, "DOD_ENDPOINT", "https://pf.pipe.aria.microsoft.com/Collector/3.0");
|
|
328
|
+
|
|
329
|
+
_defineProperty(AriaTelemetryConstants, "EUROPE_ENDPOINT", "https://eu-mobile.events.data.microsoft.com/Collector/3.0/");
|
|
330
|
+
|
|
331
|
+
_defineProperty(AriaTelemetryConstants, "MOONCAKE_ENDPOINT", "");
|
|
332
|
+
|
|
333
|
+
_defineProperty(AriaTelemetryConstants, "Public", "Public");
|
|
334
|
+
|
|
335
|
+
_defineProperty(AriaTelemetryConstants, "EU", "Europe");
|
|
336
|
+
|
|
337
|
+
_defineProperty(AriaTelemetryConstants, "lcwEUDomainNames", ["crm4.omnichannelengagementhub.com", "crm12.omnichannelengagementhub.com", "crm16.omnichannelengagementhub.com", "crm17.omnichannelengagementhub.com", "crm19.omnichannelengagementhub.com"]);
|
|
@@ -49,6 +49,7 @@ exports.BroadcastEvent = BroadcastEvent;
|
|
|
49
49
|
BroadcastEvent["RedirectPageRequest"] = "RedirectPageRequest";
|
|
50
50
|
BroadcastEvent["StartChatSkippingChatButtonRendering"] = "StartChatSkippingChatButtonRendering";
|
|
51
51
|
BroadcastEvent["StartUnauthenticatedReconnectChat"] = "StartUnauthenticatedReconnectChat";
|
|
52
|
+
BroadcastEvent["SetCustomContext"] = "SetCustomContext";
|
|
52
53
|
})(BroadcastEvent || (exports.BroadcastEvent = BroadcastEvent = {}));
|
|
53
54
|
|
|
54
55
|
let TelemetryEvent;
|
|
@@ -152,6 +153,7 @@ exports.TelemetryEvent = TelemetryEvent;
|
|
|
152
153
|
TelemetryEvent["ReconnectChatMinimize"] = "ReconnectChatMinimize";
|
|
153
154
|
TelemetryEvent["MessageSent"] = "MessageSent";
|
|
154
155
|
TelemetryEvent["MessageReceived"] = "MessageReceived";
|
|
156
|
+
TelemetryEvent["CustomContextReceived"] = "CustomContextReceived";
|
|
155
157
|
})(TelemetryEvent || (exports.TelemetryEvent = TelemetryEvent = {}));
|
|
156
158
|
|
|
157
159
|
class TelemetryConstants {
|
|
@@ -194,6 +196,9 @@ class TelemetryConstants {
|
|
|
194
196
|
case TelemetryEvent.PreChatSurveyStartChatMethodFailed:
|
|
195
197
|
case TelemetryEvent.HeaderCloseButtonClicked:
|
|
196
198
|
case TelemetryEvent.HeaderMinimizeButtonClicked:
|
|
199
|
+
case TelemetryEvent.MessageSent:
|
|
200
|
+
case TelemetryEvent.MessageReceived:
|
|
201
|
+
case TelemetryEvent.CustomContextReceived:
|
|
197
202
|
return ScenarioType.ACTIONS;
|
|
198
203
|
|
|
199
204
|
case TelemetryEvent.StartChatSDKCall:
|
|
@@ -15,6 +15,8 @@ var _consoleLogger = require("./loggers/consoleLogger");
|
|
|
15
15
|
|
|
16
16
|
var _defaultAriaConfig = require("./defaultConfigs/defaultAriaConfig");
|
|
17
17
|
|
|
18
|
+
var _TelemetryHelper = require("./TelemetryHelper");
|
|
19
|
+
|
|
18
20
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
21
|
|
|
20
22
|
class TelemetryTimers {}
|
|
@@ -92,7 +94,11 @@ const RegisterLoggers = () => {
|
|
|
92
94
|
|
|
93
95
|
const logLevel = telemetryEvent.logLevel ?? _TelemetryConstants.LogLevel.INFO;
|
|
94
96
|
const scenarioType = ((_payload = telemetryEvent.payload) === null || _payload === void 0 ? void 0 : _payload.scenarioType) ?? _TelemetryConstants.ScenarioType.UNDEFINED;
|
|
95
|
-
|
|
97
|
+
const telemetryInput = parseInput(telemetryEvent === null || telemetryEvent === void 0 ? void 0 : telemetryEvent.payload, scenarioType);
|
|
98
|
+
telemetryInput.telemetryInfo = {
|
|
99
|
+
telemetryInfo: _TelemetryHelper.TelemetryHelper.buildTelemetryEvent(logLevel, telemetryInput)
|
|
100
|
+
};
|
|
101
|
+
logger.log(logLevel, telemetryInput);
|
|
96
102
|
});
|
|
97
103
|
};
|
|
98
104
|
|
|
@@ -11,6 +11,9 @@ const defaultTelemetryConfiguration = {
|
|
|
11
11
|
telemetryDisabled: false,
|
|
12
12
|
disableConsoleLog: false,
|
|
13
13
|
telemetryLoggers: [],
|
|
14
|
-
ariaConfigurations: _defaultAriaConfig.defaultAriaConfig
|
|
14
|
+
ariaConfigurations: _defaultAriaConfig.defaultAriaConfig,
|
|
15
|
+
chatWidgetVersion: "0.0.0-0",
|
|
16
|
+
chatComponentVersion: "0.0.0-0",
|
|
17
|
+
OCChatSDKVersion: "0.0.0-0"
|
|
15
18
|
};
|
|
16
19
|
exports.defaultTelemetryConfiguration = defaultTelemetryConfiguration;
|
|
@@ -15,7 +15,7 @@ var _Enums = require("@microsoft/omnichannel-chat-sdk/lib/external/aria/common/E
|
|
|
15
15
|
|
|
16
16
|
var _Constants = require("../../Constants");
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _TelemetryManager = require("../TelemetryManager");
|
|
19
19
|
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
21
|
|
|
@@ -30,6 +30,21 @@ const ariaTelemetryLogger = (ariaTelemetryKey, disabledCookieUsage, collectiorUr
|
|
|
30
30
|
|
|
31
31
|
if (!(0, _utils.isNullOrEmptyString)(collectiorUriForTelemetry)) {
|
|
32
32
|
configuration.collectorUri = collectiorUriForTelemetry;
|
|
33
|
+
} else {
|
|
34
|
+
if (_TelemetryManager.TelemetryManager.InternalTelemetryData.environmentVersion == _Constants.EnvironmentVersion.prod) {
|
|
35
|
+
var _TelemetryManager$Int;
|
|
36
|
+
|
|
37
|
+
const orgUrl = (_TelemetryManager$Int = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int === void 0 ? void 0 : _TelemetryManager$Int.orgUrl;
|
|
38
|
+
|
|
39
|
+
if (!(0, _utils.isNullOrUndefined)(orgUrl)) {
|
|
40
|
+
// If the given org is a Production EU org, modify the Aria collector uri
|
|
41
|
+
const region = (0, _utils.getDomain)(orgUrl);
|
|
42
|
+
|
|
43
|
+
if (region === _Constants.AriaTelemetryConstants.EU) {
|
|
44
|
+
configuration.collectorUri = _Constants.AriaTelemetryConstants.EUROPE_ENDPOINT;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
33
48
|
}
|
|
34
49
|
|
|
35
50
|
try {
|
|
@@ -48,20 +63,25 @@ const ariaTelemetryLogger = (ariaTelemetryKey, disabledCookieUsage, collectiorUr
|
|
|
48
63
|
|
|
49
64
|
const ariaLogger = {
|
|
50
65
|
log: (logLevel, telemetryInput) => {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
66
|
+
try {
|
|
67
|
+
let property;
|
|
68
|
+
const telemetryInfo = telemetryInput === null || telemetryInput === void 0 ? void 0 : telemetryInput.telemetryInfo;
|
|
69
|
+
const eventProperties = new _AWTEventProperties.default();
|
|
70
|
+
eventProperties.setName(telemetryInput.scenarioType);
|
|
71
|
+
|
|
72
|
+
if (telemetryInfo) {
|
|
73
|
+
for (const key of Object.keys(telemetryInfo)) {
|
|
74
|
+
property = typeof telemetryInfo[key] === "object" ? JSON.stringify(telemetryInfo[key]) : telemetryInfo[key];
|
|
75
|
+
eventProperties.setProperty(key, property);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
eventProperties.setPropertyWithPii(ariaTelemetryApplicationName, _Constants.Constants.LiveChatWidget, _Enums.AWTPiiKind.GenericData);
|
|
79
|
+
}
|
|
57
80
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
81
|
+
logger() ? logger().logEvent(eventProperties) : console.log("Unable to initialize aria logger");
|
|
82
|
+
} catch (error) {
|
|
83
|
+
console.error("Error in logging telemetry to Aria logger:" + error);
|
|
61
84
|
}
|
|
62
|
-
|
|
63
|
-
eventProperties.setPropertyWithPii(ariaTelemetryApplicationName, _Constants.Constants.LiveChatWidget, _Enums.AWTPiiKind.GenericData);
|
|
64
|
-
logger() ? logger().logEvent(eventProperties) : console.log("Unable to initialize aria logger");
|
|
65
85
|
},
|
|
66
86
|
dispose: () => {
|
|
67
87
|
_AWTLogManager.default.flush(function () {
|
|
@@ -13,27 +13,28 @@ const consoleLogger = () => {
|
|
|
13
13
|
const consoleLogger = {
|
|
14
14
|
log: (logLevel, telemetryInput) => {
|
|
15
15
|
const payload = telemetryInput !== null && telemetryInput !== void 0 && telemetryInput.payload && Object.keys(telemetryInput === null || telemetryInput === void 0 ? void 0 : telemetryInput.payload).length > 0 ? telemetryInput === null || telemetryInput === void 0 ? void 0 : telemetryInput.payload : "";
|
|
16
|
+
const telemetryInfo = telemetryInput !== null && telemetryInput !== void 0 && telemetryInput.telemetryInfo && Object.keys(telemetryInput === null || telemetryInput === void 0 ? void 0 : telemetryInput.telemetryInfo).length > 0 ? telemetryInput === null || telemetryInput === void 0 ? void 0 : telemetryInput.telemetryInfo : "";
|
|
16
17
|
|
|
17
18
|
try {
|
|
18
19
|
switch (logLevel) {
|
|
19
20
|
case _TelemetryConstants.LogLevel.INFO:
|
|
20
|
-
console.info(_Constants.Constants.LiveChatWidget, payload);
|
|
21
|
+
console.info(_Constants.Constants.LiveChatWidget, payload, telemetryInfo);
|
|
21
22
|
break;
|
|
22
23
|
|
|
23
24
|
case _TelemetryConstants.LogLevel.DEBUG:
|
|
24
|
-
console.debug(_Constants.Constants.LiveChatWidget, payload);
|
|
25
|
+
console.debug(_Constants.Constants.LiveChatWidget, payload, telemetryInfo);
|
|
25
26
|
break;
|
|
26
27
|
|
|
27
28
|
case _TelemetryConstants.LogLevel.WARN:
|
|
28
|
-
console.warn(_Constants.Constants.LiveChatWidget, payload);
|
|
29
|
+
console.warn(_Constants.Constants.LiveChatWidget, payload, telemetryInfo);
|
|
29
30
|
break;
|
|
30
31
|
|
|
31
32
|
case _TelemetryConstants.LogLevel.ERROR:
|
|
32
|
-
console.error(_Constants.Constants.LiveChatWidget, payload);
|
|
33
|
+
console.error(_Constants.Constants.LiveChatWidget, payload, telemetryInfo);
|
|
33
34
|
break;
|
|
34
35
|
|
|
35
36
|
default:
|
|
36
|
-
console.debug(_Constants.Constants.LiveChatWidget, payload);
|
|
37
|
+
console.debug(_Constants.Constants.LiveChatWidget, payload, telemetryInfo);
|
|
37
38
|
break;
|
|
38
39
|
}
|
|
39
40
|
} catch (ex) {
|
package/lib/cjs/common/utils.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.setTabIndices = exports.setFocusOnSendBox = exports.setFocusOnElement = exports.preventFocusToMoveOutOfElement = exports.parseAdaptiveCardPayload = exports.newGuid = exports.isNullOrUndefined = exports.isNullOrEmptyString = exports.getTimestampHourMinute = exports.getLocaleDirection = exports.getIconText = exports.findParentFocusableElementsWithoutChildContainer = exports.findAllFocusableElement = exports.extractPreChatSurveyResponseValues = exports.escapeHtml = exports.createTimer = exports.changeLanguageCodeFormatForWebChat = void 0;
|
|
6
|
+
exports.setTabIndices = exports.setFocusOnSendBox = exports.setFocusOnElement = exports.preventFocusToMoveOutOfElement = exports.parseAdaptiveCardPayload = exports.newGuid = exports.isNullOrUndefined = exports.isNullOrEmptyString = exports.getTimestampHourMinute = exports.getLocaleDirection = exports.getIconText = exports.getDomain = exports.findParentFocusableElementsWithoutChildContainer = exports.findAllFocusableElement = exports.extractPreChatSurveyResponseValues = exports.escapeHtml = exports.createTimer = exports.changeLanguageCodeFormatForWebChat = void 0;
|
|
7
7
|
|
|
8
8
|
var _Constants = require("./Constants");
|
|
9
9
|
|
|
@@ -332,6 +332,20 @@ const createTimer = () => {
|
|
|
332
332
|
}
|
|
333
333
|
|
|
334
334
|
};
|
|
335
|
+
}; // Returns the domain of the org
|
|
336
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
exports.createTimer = createTimer;
|
|
340
|
+
|
|
341
|
+
const getDomain = hostValue => {
|
|
342
|
+
for (let i = 0; i < _Constants.AriaTelemetryConstants.lcwEUDomainNames.length; i++) {
|
|
343
|
+
if (hostValue.endsWith(_Constants.AriaTelemetryConstants.lcwEUDomainNames[i])) {
|
|
344
|
+
return _Constants.AriaTelemetryConstants.EU;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
return _Constants.AriaTelemetryConstants.Public;
|
|
335
349
|
};
|
|
336
350
|
|
|
337
|
-
exports.
|
|
351
|
+
exports.getDomain = getDomain;
|
|
@@ -206,6 +206,20 @@ const CallingContainerStateful = props => {
|
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
208
|
});
|
|
209
|
+
window.addEventListener("beforeunload", () => {
|
|
210
|
+
if (state.uiStates.isIncomingCall) {
|
|
211
|
+
voiceVideoCallingSdk === null || voiceVideoCallingSdk === void 0 ? void 0 : voiceVideoCallingSdk.rejectCall();
|
|
212
|
+
} else {
|
|
213
|
+
voiceVideoCallingSdk === null || voiceVideoCallingSdk === void 0 ? void 0 : voiceVideoCallingSdk.stopCall();
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
voiceVideoCallingSdk === null || voiceVideoCallingSdk === void 0 ? void 0 : voiceVideoCallingSdk.close();
|
|
217
|
+
dispatch({
|
|
218
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_E2VV_ENABLED,
|
|
219
|
+
payload: false
|
|
220
|
+
});
|
|
221
|
+
resetCallingStates(true);
|
|
222
|
+
});
|
|
209
223
|
}, []);
|
|
210
224
|
const controlProps = {
|
|
211
225
|
id: "oc-lcw-callingcontainer",
|
|
@@ -50,7 +50,7 @@ const ChatButtonStateful = props => {
|
|
|
50
50
|
dir: state.domainStates.globalDir,
|
|
51
51
|
titleText: "Let's Chat!",
|
|
52
52
|
subtitleText: "We're online.",
|
|
53
|
-
hideNotificationBubble:
|
|
53
|
+
hideNotificationBubble: (buttonProps === null || buttonProps === void 0 ? void 0 : (_buttonProps$controlP = buttonProps.controlProps) === null || _buttonProps$controlP === void 0 ? void 0 : _buttonProps$controlP.hideNotificationBubble) === true || state.appStates.isMinimized === false,
|
|
54
54
|
unreadMessageCount: state.appStates.unreadMessageCount ? state.appStates.unreadMessageCount > _Constants.Constants.maximumUnreadMessageCount ? _Constants.Constants.maximumUnreadMessageCount.toString() + "+" : state.appStates.unreadMessageCount.toString() : "0",
|
|
55
55
|
onClick: async () => {
|
|
56
56
|
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
@@ -274,18 +274,6 @@ const dummyDefaultProps = {
|
|
|
274
274
|
width: "50px",
|
|
275
275
|
fontSize: "18px"
|
|
276
276
|
},
|
|
277
|
-
currentCallTimerStyleProps: {
|
|
278
|
-
borderRadius: "2px",
|
|
279
|
-
margin: "1px",
|
|
280
|
-
color: "#FFFFFF",
|
|
281
|
-
paddingTop: "18px",
|
|
282
|
-
fontSize: 12,
|
|
283
|
-
fontFamily: "Segoe UI, Arial, sans-serif",
|
|
284
|
-
backgroundColor: "darkgrey",
|
|
285
|
-
height: "45px",
|
|
286
|
-
width: "50px",
|
|
287
|
-
textAlign: "center"
|
|
288
|
-
},
|
|
289
277
|
videoTileStyleProps: {
|
|
290
278
|
width: "100%",
|
|
291
279
|
marginLeft: "auto",
|
|
@@ -63,7 +63,16 @@ const endChat = async (props, chatSDK, setAdapter, setWebChatStyles, dispatch, a
|
|
|
63
63
|
Event: _TelemetryConstants.TelemetryEvent.EndChatSDKCall
|
|
64
64
|
});
|
|
65
65
|
|
|
66
|
-
await (chatSDK === null || chatSDK === void 0 ? void 0 : chatSDK.endChat());
|
|
66
|
+
await (chatSDK === null || chatSDK === void 0 ? void 0 : chatSDK.endChat()); // Need to clear these states immediately when chat ended from OC.
|
|
67
|
+
|
|
68
|
+
dispatch({
|
|
69
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CHAT_TOKEN,
|
|
70
|
+
payload: undefined
|
|
71
|
+
});
|
|
72
|
+
dispatch({
|
|
73
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_LIVE_CHAT_CONTEXT,
|
|
74
|
+
payload: undefined
|
|
75
|
+
});
|
|
67
76
|
} catch (ex) {
|
|
68
77
|
_TelemetryHelper.TelemetryHelper.logSDKEvent(_TelemetryConstants.LogLevel.ERROR, {
|
|
69
78
|
Event: _TelemetryConstants.TelemetryEvent.EndChatSDKCallFailed,
|
|
@@ -100,14 +109,6 @@ const endChat = async (props, chatSDK, setAdapter, setWebChatStyles, dispatch, a
|
|
|
100
109
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_AUDIO_NOTIFICATION,
|
|
101
110
|
payload: null
|
|
102
111
|
});
|
|
103
|
-
dispatch({
|
|
104
|
-
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CHAT_TOKEN,
|
|
105
|
-
payload: undefined
|
|
106
|
-
});
|
|
107
|
-
dispatch({
|
|
108
|
-
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_LIVE_CHAT_CONTEXT,
|
|
109
|
-
payload: undefined
|
|
110
|
-
});
|
|
111
112
|
|
|
112
113
|
_omnichannelChatComponents.BroadcastService.postMessage({
|
|
113
114
|
eventName: _TelemetryConstants.BroadcastEvent.EndChat
|
|
@@ -123,6 +123,10 @@ const initWebChatComposer = (props, chatSDK, state, dispatch, setWebChatStyles)
|
|
|
123
123
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CHAT_TOKEN,
|
|
124
124
|
payload: undefined
|
|
125
125
|
});
|
|
126
|
+
dispatch({
|
|
127
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_LIVE_CHAT_CONTEXT,
|
|
128
|
+
payload: undefined
|
|
129
|
+
});
|
|
126
130
|
};
|
|
127
131
|
|
|
128
132
|
webChatStore = (0, _botframeworkWebchat.createStore)({}, //initial state
|
|
@@ -11,10 +11,6 @@ var _LiveChatWidgetActionType = require("../../../contexts/common/LiveChatWidget
|
|
|
11
11
|
|
|
12
12
|
var _TelemetryHelper = require("../../../common/telemetry/TelemetryHelper");
|
|
13
13
|
|
|
14
|
-
var _package = require("@microsoft/omnichannel-chat-components/package.json");
|
|
15
|
-
|
|
16
|
-
var _package2 = require("@microsoft/omnichannel-chat-sdk/package.json");
|
|
17
|
-
|
|
18
14
|
var _defaultAriaConfig = require("../../../common/telemetry/defaultConfigs/defaultAriaConfig");
|
|
19
15
|
|
|
20
16
|
var _defaultTelemetryInternalData = require("../../../common/telemetry/defaultConfigs/defaultTelemetryInternalData");
|
|
@@ -24,14 +20,6 @@ var _defaultTelemetryConfiguration = require("../../../common/telemetry/defaultC
|
|
|
24
20
|
const registerTelemetryLoggers = (props, dispatch) => {
|
|
25
21
|
var _props$liveChatContex, _props$liveChatContex2;
|
|
26
22
|
|
|
27
|
-
let widgetPackageInfo;
|
|
28
|
-
|
|
29
|
-
try {
|
|
30
|
-
widgetPackageInfo = require("@microsoft/omnichannel-chat-widget/package.json");
|
|
31
|
-
} catch (error) {
|
|
32
|
-
widgetPackageInfo = "0.0.0-0";
|
|
33
|
-
}
|
|
34
|
-
|
|
35
23
|
const telemetryConfig = { ..._defaultTelemetryConfiguration.defaultTelemetryConfiguration,
|
|
36
24
|
...props.telemetryConfig
|
|
37
25
|
};
|
|
@@ -53,9 +41,9 @@ const registerTelemetryLoggers = (props, dispatch) => {
|
|
|
53
41
|
}
|
|
54
42
|
|
|
55
43
|
telemetryData = _TelemetryHelper.TelemetryHelper.addWidgetDataToTelemetry(telemetryConfig, telemetryData);
|
|
56
|
-
telemetryData.OCChatSDKVersion =
|
|
57
|
-
telemetryData.chatComponentVersion =
|
|
58
|
-
telemetryData.chatWidgetVersion =
|
|
44
|
+
telemetryData.OCChatSDKVersion = telemetryConfig.OCChatSDKVersion ?? "0.0.0-0";
|
|
45
|
+
telemetryData.chatComponentVersion = telemetryConfig.chatComponentVersion ?? "0.0.0-0";
|
|
46
|
+
telemetryData.chatWidgetVersion = telemetryConfig.chatWidgetVersion ?? "0.0.0-0";
|
|
59
47
|
telemetryData.orgId = (_props$chatSDK = props.chatSDK) === null || _props$chatSDK === void 0 ? void 0 : (_props$chatSDK$omnich = _props$chatSDK.omnichannelConfig) === null || _props$chatSDK$omnich === void 0 ? void 0 : _props$chatSDK$omnich.orgId;
|
|
60
48
|
telemetryData.widgetId = (_props$chatSDK2 = props.chatSDK) === null || _props$chatSDK2 === void 0 ? void 0 : (_props$chatSDK2$omnic = _props$chatSDK2.omnichannelConfig) === null || _props$chatSDK2$omnic === void 0 ? void 0 : _props$chatSDK2$omnic.widgetId;
|
|
61
49
|
telemetryData.orgUrl = (_props$chatSDK3 = props.chatSDK) === null || _props$chatSDK3 === void 0 ? void 0 : (_props$chatSDK3$omnic = _props$chatSDK3.omnichannelConfig) === null || _props$chatSDK3$omnic === void 0 ? void 0 : _props$chatSDK3$omnic.orgUrl;
|
|
@@ -107,7 +107,8 @@ const LiveChatWidgetStateful = props => {
|
|
|
107
107
|
...((_props$webChatContain = props.webChatContainerProps) === null || _props$webChatContain === void 0 ? void 0 : _props$webChatContain.webChatStyles)
|
|
108
108
|
}); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
109
109
|
|
|
110
|
-
const chatSDK = (0, _useChatSDKStore.default)();
|
|
110
|
+
const chatSDK = (0, _useChatSDKStore.default)(); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
111
|
+
|
|
111
112
|
const [voiceVideoCallingSDK, setVoiceVideoCallingSDK] = (0, _react2.useState)(undefined);
|
|
112
113
|
const {
|
|
113
114
|
Composer
|
|
@@ -135,6 +136,10 @@ const LiveChatWidgetStateful = props => {
|
|
|
135
136
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_SKIP_CHAT_BUTTON_RENDERING,
|
|
136
137
|
payload: ((_props$controlProps2 = props.controlProps) === null || _props$controlProps2 === void 0 ? void 0 : _props$controlProps2.skipChatButtonRendering) || false
|
|
137
138
|
});
|
|
139
|
+
dispatch({
|
|
140
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_E2VV_ENABLED,
|
|
141
|
+
payload: false
|
|
142
|
+
});
|
|
138
143
|
(0, _initCallingSdk.initCallingSdk)(chatSDK, setVoiceVideoCallingSDK).then(sdkCreated => {
|
|
139
144
|
sdkCreated && dispatch({
|
|
140
145
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_E2VV_ENABLED,
|
|
@@ -155,13 +160,11 @@ const LiveChatWidgetStateful = props => {
|
|
|
155
160
|
payload: globalDir
|
|
156
161
|
});
|
|
157
162
|
|
|
158
|
-
if ((_state$domainStates = state.domainStates) !== null && _state$domainStates !== void 0 && _state$domainStates.
|
|
163
|
+
if ((_state$domainStates = state.domainStates) !== null && _state$domainStates !== void 0 && _state$domainStates.liveChatContext) {
|
|
159
164
|
var _state$domainStates2;
|
|
160
165
|
|
|
161
166
|
const optionalParams = {
|
|
162
|
-
liveChatContext:
|
|
163
|
-
chatToken: (_state$domainStates2 = state.domainStates) === null || _state$domainStates2 === void 0 ? void 0 : _state$domainStates2.chatToken
|
|
164
|
-
}
|
|
167
|
+
liveChatContext: (_state$domainStates2 = state.domainStates) === null || _state$domainStates2 === void 0 ? void 0 : _state$domainStates2.liveChatContext
|
|
165
168
|
};
|
|
166
169
|
(0, _startChat.initStartChat)(chatSDK, dispatch, setAdapter, optionalParams);
|
|
167
170
|
}
|
|
@@ -203,6 +206,19 @@ const LiveChatWidgetStateful = props => {
|
|
|
203
206
|
}
|
|
204
207
|
}, [state.appStates.skipChatButtonRendering]);
|
|
205
208
|
(0, _react2.useEffect)(() => {
|
|
209
|
+
// Add the custom context on receiving the SetCustomContext event
|
|
210
|
+
_omnichannelChatComponents.BroadcastService.getMessageByEventName(_TelemetryConstants.BroadcastEvent.SetCustomContext).subscribe(msg => {
|
|
211
|
+
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
212
|
+
Event: _TelemetryConstants.TelemetryEvent.CustomContextReceived,
|
|
213
|
+
Description: "CustomContext received."
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
dispatch({
|
|
217
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CUSTOM_CONTEXT,
|
|
218
|
+
payload: msg === null || msg === void 0 ? void 0 : msg.payload
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
|
|
206
222
|
_omnichannelChatComponents.BroadcastService.getMessageByEventName("StartProactiveChat").subscribe(msg => {
|
|
207
223
|
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
208
224
|
Event: _TelemetryConstants.TelemetryEvent.StartProactiveChatEventReceived,
|
|
@@ -10,6 +10,7 @@ var _TelemetryConstants = require("../../../../common/telemetry/TelemetryConstan
|
|
|
10
10
|
var _TelemetryHelper = require("../../../../common/telemetry/TelemetryHelper");
|
|
11
11
|
|
|
12
12
|
function createWebChatTelemetry() {
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
14
|
const handleTelemetry = event => {
|
|
14
15
|
const {
|
|
15
16
|
level
|
|
@@ -17,25 +17,26 @@ exports.LiveChatWidgetActionType = LiveChatWidgetActionType;
|
|
|
17
17
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PREVIOUS_FOCUSED_ELEMENT"] = 6] = "SET_PREVIOUS_FOCUSED_ELEMENT";
|
|
18
18
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_OUTSIDE_OPERATING_HOURS"] = 7] = "SET_OUTSIDE_OPERATING_HOURS";
|
|
19
19
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PRE_CHAT_SURVEY_RESPONSE"] = 8] = "SET_PRE_CHAT_SURVEY_RESPONSE";
|
|
20
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
21
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
22
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
23
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
24
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
25
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
26
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
27
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
28
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
29
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
30
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
31
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
32
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
33
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
34
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
35
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
36
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
37
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
38
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
39
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
40
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
20
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CUSTOM_CONTEXT"] = 9] = "SET_CUSTOM_CONTEXT";
|
|
21
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOW_CONFIRMATION"] = 10] = "SET_SHOW_CONFIRMATION";
|
|
22
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOW_EMAIL_TRANSCRIPT_PANE"] = 11] = "SET_SHOW_EMAIL_TRANSCRIPT_PANE";
|
|
23
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PRECHAT_RESPONSE_EMAIL"] = 12] = "SET_PRECHAT_RESPONSE_EMAIL";
|
|
24
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_AUDIO_NOTIFICATION"] = 13] = "SET_AUDIO_NOTIFICATION";
|
|
25
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_E2VV_ENABLED"] = 14] = "SET_E2VV_ENABLED";
|
|
26
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_CONTEXT"] = 15] = "SET_POST_CHAT_CONTEXT";
|
|
27
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SHOW_CALLING_CONTAINER"] = 16] = "SHOW_CALLING_CONTAINER";
|
|
28
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_INCOMING_CALL"] = 17] = "SET_INCOMING_CALL";
|
|
29
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_VIDEO_CALL"] = 18] = "DISABLE_VIDEO_CALL";
|
|
30
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_LOCAL_VIDEO"] = 19] = "DISABLE_LOCAL_VIDEO";
|
|
31
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_REMOTE_VIDEO"] = 20] = "DISABLE_REMOTE_VIDEO";
|
|
32
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CHAT_TOKEN"] = 21] = "SET_CHAT_TOKEN";
|
|
33
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SKIP_CHAT_BUTTON_RENDERING"] = 22] = "SET_SKIP_CHAT_BUTTON_RENDERING";
|
|
34
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PROACTIVE_CHAT_PARAMS"] = 23] = "SET_PROACTIVE_CHAT_PARAMS";
|
|
35
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_TELEMETRY_DATA"] = 24] = "SET_TELEMETRY_DATA";
|
|
36
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_RECONNECT_ID"] = 25] = "SET_RECONNECT_ID";
|
|
37
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_UNREAD_MESSAGE_COUNT"] = 26] = "SET_UNREAD_MESSAGE_COUNT";
|
|
38
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_FOCUS_CHAT_BUTTON"] = 27] = "SET_FOCUS_CHAT_BUTTON";
|
|
39
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_ENDED_BY_AGENT"] = 28] = "SET_CONVERSATION_ENDED_BY_AGENT";
|
|
40
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_STATE"] = 29] = "SET_WIDGET_STATE";
|
|
41
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONTEXT"] = 30] = "SET_LIVE_CHAT_CONTEXT";
|
|
41
42
|
})(LiveChatWidgetActionType || (exports.LiveChatWidgetActionType = LiveChatWidgetActionType = {}));
|
|
@@ -27,7 +27,8 @@ const getLiveChatWidgetContextInitialState = props => {
|
|
|
27
27
|
postChatContext: undefined,
|
|
28
28
|
telemetryInternalData: {},
|
|
29
29
|
globalDir: "ltr",
|
|
30
|
-
liveChatContext: undefined
|
|
30
|
+
liveChatContext: undefined,
|
|
31
|
+
customContext: undefined
|
|
31
32
|
},
|
|
32
33
|
appStates: {
|
|
33
34
|
conversationState: _ConversationState.ConversationState.Closed,
|
|
@@ -69,6 +69,13 @@ const createReducer = () => {
|
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
71
|
|
|
72
|
+
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CUSTOM_CONTEXT:
|
|
73
|
+
return { ...state,
|
|
74
|
+
domainStates: { ...state.domainStates,
|
|
75
|
+
customContext: action.payload
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
72
79
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_PREVIOUS_FOCUSED_ELEMENT:
|
|
73
80
|
return { ...state,
|
|
74
81
|
appStates: { ...state.appStates,
|
|
@@ -255,6 +255,15 @@ export let ChatSDKError;
|
|
|
255
255
|
ChatSDKError["WidgetUseOutsideOperatingHour"] = "WidgetUseOutsideOperatingHour";
|
|
256
256
|
})(ChatSDKError || (ChatSDKError = {}));
|
|
257
257
|
|
|
258
|
+
export let EnvironmentVersion;
|
|
259
|
+
|
|
260
|
+
(function (EnvironmentVersion) {
|
|
261
|
+
EnvironmentVersion["prod"] = "prod";
|
|
262
|
+
EnvironmentVersion["dogfood"] = "df";
|
|
263
|
+
EnvironmentVersion["int"] = "int";
|
|
264
|
+
EnvironmentVersion["test"] = "test";
|
|
265
|
+
})(EnvironmentVersion || (EnvironmentVersion = {}));
|
|
266
|
+
|
|
258
267
|
export class TranscriptConstants {}
|
|
259
268
|
|
|
260
269
|
_defineProperty(TranscriptConstants, "ChatTranscriptsBodyColor", "#F5F5F5");
|
|
@@ -275,4 +284,22 @@ _defineProperty(TranscriptConstants, "InternalMode", "internal");
|
|
|
275
284
|
|
|
276
285
|
_defineProperty(TranscriptConstants, "AgentDialogColor", "#2266E3");
|
|
277
286
|
|
|
278
|
-
_defineProperty(TranscriptConstants, "AgentFontColor", "white");
|
|
287
|
+
_defineProperty(TranscriptConstants, "AgentFontColor", "white");
|
|
288
|
+
|
|
289
|
+
export class AriaTelemetryConstants {}
|
|
290
|
+
|
|
291
|
+
_defineProperty(AriaTelemetryConstants, "GERMANY_ENDPOINT", "https://de.pipe.aria.microsoft.com/Collector/3.0/");
|
|
292
|
+
|
|
293
|
+
_defineProperty(AriaTelemetryConstants, "GCCH_ENDPOINT", "https://tb.pipe.aria.microsoft.com/Collector/3.0/");
|
|
294
|
+
|
|
295
|
+
_defineProperty(AriaTelemetryConstants, "DOD_ENDPOINT", "https://pf.pipe.aria.microsoft.com/Collector/3.0");
|
|
296
|
+
|
|
297
|
+
_defineProperty(AriaTelemetryConstants, "EUROPE_ENDPOINT", "https://eu-mobile.events.data.microsoft.com/Collector/3.0/");
|
|
298
|
+
|
|
299
|
+
_defineProperty(AriaTelemetryConstants, "MOONCAKE_ENDPOINT", "");
|
|
300
|
+
|
|
301
|
+
_defineProperty(AriaTelemetryConstants, "Public", "Public");
|
|
302
|
+
|
|
303
|
+
_defineProperty(AriaTelemetryConstants, "EU", "Europe");
|
|
304
|
+
|
|
305
|
+
_defineProperty(AriaTelemetryConstants, "lcwEUDomainNames", ["crm4.omnichannelengagementhub.com", "crm12.omnichannelengagementhub.com", "crm16.omnichannelengagementhub.com", "crm17.omnichannelengagementhub.com", "crm19.omnichannelengagementhub.com"]);
|
|
@@ -38,6 +38,7 @@ export let BroadcastEvent; // Events being logged
|
|
|
38
38
|
BroadcastEvent["RedirectPageRequest"] = "RedirectPageRequest";
|
|
39
39
|
BroadcastEvent["StartChatSkippingChatButtonRendering"] = "StartChatSkippingChatButtonRendering";
|
|
40
40
|
BroadcastEvent["StartUnauthenticatedReconnectChat"] = "StartUnauthenticatedReconnectChat";
|
|
41
|
+
BroadcastEvent["SetCustomContext"] = "SetCustomContext";
|
|
41
42
|
})(BroadcastEvent || (BroadcastEvent = {}));
|
|
42
43
|
|
|
43
44
|
export let TelemetryEvent;
|
|
@@ -140,6 +141,7 @@ export let TelemetryEvent;
|
|
|
140
141
|
TelemetryEvent["ReconnectChatMinimize"] = "ReconnectChatMinimize";
|
|
141
142
|
TelemetryEvent["MessageSent"] = "MessageSent";
|
|
142
143
|
TelemetryEvent["MessageReceived"] = "MessageReceived";
|
|
144
|
+
TelemetryEvent["CustomContextReceived"] = "CustomContextReceived";
|
|
143
145
|
})(TelemetryEvent || (TelemetryEvent = {}));
|
|
144
146
|
|
|
145
147
|
export class TelemetryConstants {
|
|
@@ -182,6 +184,9 @@ export class TelemetryConstants {
|
|
|
182
184
|
case TelemetryEvent.PreChatSurveyStartChatMethodFailed:
|
|
183
185
|
case TelemetryEvent.HeaderCloseButtonClicked:
|
|
184
186
|
case TelemetryEvent.HeaderMinimizeButtonClicked:
|
|
187
|
+
case TelemetryEvent.MessageSent:
|
|
188
|
+
case TelemetryEvent.MessageReceived:
|
|
189
|
+
case TelemetryEvent.CustomContextReceived:
|
|
185
190
|
return ScenarioType.ACTIONS;
|
|
186
191
|
|
|
187
192
|
case TelemetryEvent.StartChatSDKCall:
|
|
@@ -5,6 +5,7 @@ import { BroadcastService } from "@microsoft/omnichannel-chat-components";
|
|
|
5
5
|
import { ariaTelemetryLogger } from "./loggers/ariaTelemetryLogger";
|
|
6
6
|
import { consoleLogger } from "./loggers/consoleLogger";
|
|
7
7
|
import { defaultAriaConfig } from "./defaultConfigs/defaultAriaConfig";
|
|
8
|
+
import { TelemetryHelper } from "./TelemetryHelper";
|
|
8
9
|
export class TelemetryTimers {}
|
|
9
10
|
|
|
10
11
|
_defineProperty(TelemetryTimers, "LcwLoadToChatButtonTimer", void 0);
|
|
@@ -72,7 +73,11 @@ export const RegisterLoggers = () => {
|
|
|
72
73
|
|
|
73
74
|
const logLevel = telemetryEvent.logLevel ?? LogLevel.INFO;
|
|
74
75
|
const scenarioType = ((_payload = telemetryEvent.payload) === null || _payload === void 0 ? void 0 : _payload.scenarioType) ?? ScenarioType.UNDEFINED;
|
|
75
|
-
|
|
76
|
+
const telemetryInput = parseInput(telemetryEvent === null || telemetryEvent === void 0 ? void 0 : telemetryEvent.payload, scenarioType);
|
|
77
|
+
telemetryInput.telemetryInfo = {
|
|
78
|
+
telemetryInfo: TelemetryHelper.buildTelemetryEvent(logLevel, telemetryInput)
|
|
79
|
+
};
|
|
80
|
+
logger.log(logLevel, telemetryInput);
|
|
76
81
|
});
|
|
77
82
|
};
|
|
78
83
|
|
|
@@ -3,5 +3,8 @@ export const defaultTelemetryConfiguration = {
|
|
|
3
3
|
telemetryDisabled: false,
|
|
4
4
|
disableConsoleLog: false,
|
|
5
5
|
telemetryLoggers: [],
|
|
6
|
-
ariaConfigurations: defaultAriaConfig
|
|
6
|
+
ariaConfigurations: defaultAriaConfig,
|
|
7
|
+
chatWidgetVersion: "0.0.0-0",
|
|
8
|
+
chatComponentVersion: "0.0.0-0",
|
|
9
|
+
OCChatSDKVersion: "0.0.0-0"
|
|
7
10
|
};
|