@microsoft/omnichannel-chat-widget 0.1.0-main.ae27766 → 0.1.0-main.ae3aa42
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.
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.ariaTelemetryLogger = void 0;
|
|
7
7
|
|
|
8
|
-
var _Constants = require("../../../../src/common/Constants");
|
|
9
|
-
|
|
10
8
|
var _utils = require("../../utils");
|
|
11
9
|
|
|
12
10
|
var _AWTEventProperties = _interopRequireDefault(require("@microsoft/omnichannel-chat-sdk/lib/external/aria/webjs/AWTEventProperties"));
|
|
@@ -15,7 +13,7 @@ var _AWTLogManager = _interopRequireDefault(require("@microsoft/omnichannel-chat
|
|
|
15
13
|
|
|
16
14
|
var _Enums = require("@microsoft/omnichannel-chat-sdk/lib/external/aria/common/Enums");
|
|
17
15
|
|
|
18
|
-
var
|
|
16
|
+
var _Constants = require("../../Constants");
|
|
19
17
|
|
|
20
18
|
var _TelemetryHelper = require("../TelemetryHelper");
|
|
21
19
|
|
|
@@ -67,20 +65,24 @@ const ariaTelemetryLogger = (ariaTelemetryKey, disabledCookieUsage, collectiorUr
|
|
|
67
65
|
|
|
68
66
|
const ariaLogger = {
|
|
69
67
|
log: (logLevel, telemetryInput) => {
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
try {
|
|
69
|
+
let property;
|
|
70
|
+
const eventProperties = new _AWTEventProperties.default();
|
|
72
71
|
|
|
73
|
-
|
|
72
|
+
const event = _TelemetryHelper.TelemetryHelper.buildTelemetryEvent(logLevel, telemetryInput);
|
|
74
73
|
|
|
75
|
-
|
|
74
|
+
eventProperties.setName(telemetryInput.scenarioType);
|
|
76
75
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
76
|
+
for (const key of Object.keys(event)) {
|
|
77
|
+
property = typeof event[key] === "object" ? JSON.stringify(event[key]) : event[key];
|
|
78
|
+
eventProperties.setProperty(key, property);
|
|
79
|
+
}
|
|
81
80
|
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
eventProperties.setPropertyWithPii(ariaTelemetryApplicationName, _Constants.Constants.LiveChatWidget, _Enums.AWTPiiKind.GenericData);
|
|
82
|
+
logger() ? logger().logEvent(eventProperties) : console.log("Unable to initialize aria logger");
|
|
83
|
+
} catch (error) {
|
|
84
|
+
console.error("Error in logging telemetry to Aria logger:" + error);
|
|
85
|
+
}
|
|
84
86
|
},
|
|
85
87
|
dispose: () => {
|
|
86
88
|
_AWTLogManager.default.flush(function () {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { AriaTelemetryConstants, EnvironmentVersion } from "../../../../src/common/Constants";
|
|
2
1
|
import { getDomain, isNullOrEmptyString, isNullOrUndefined } from "../../utils";
|
|
3
2
|
import AWTEventProperties from "@microsoft/omnichannel-chat-sdk/lib/external/aria/webjs/AWTEventProperties";
|
|
4
3
|
import AWTLogManager from "@microsoft/omnichannel-chat-sdk/lib/external/aria/webjs/AWTLogManager";
|
|
5
4
|
import { AWTPiiKind } from "@microsoft/omnichannel-chat-sdk/lib/external/aria/common/Enums";
|
|
6
|
-
import { Constants } from "../../Constants";
|
|
5
|
+
import { Constants, AriaTelemetryConstants, EnvironmentVersion } from "../../Constants";
|
|
7
6
|
import { TelemetryHelper } from "../TelemetryHelper";
|
|
8
7
|
import { TelemetryManager } from "../TelemetryManager";
|
|
9
8
|
export const ariaTelemetryLogger = (ariaTelemetryKey, disabledCookieUsage, collectiorUriForTelemetry, ariaTelemetryApplicationName) => {
|
|
@@ -50,18 +49,22 @@ export const ariaTelemetryLogger = (ariaTelemetryKey, disabledCookieUsage, colle
|
|
|
50
49
|
|
|
51
50
|
const ariaLogger = {
|
|
52
51
|
log: (logLevel, telemetryInput) => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
try {
|
|
53
|
+
let property;
|
|
54
|
+
const eventProperties = new AWTEventProperties();
|
|
55
|
+
const event = TelemetryHelper.buildTelemetryEvent(logLevel, telemetryInput);
|
|
56
|
+
eventProperties.setName(telemetryInput.scenarioType);
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
for (const key of Object.keys(event)) {
|
|
59
|
+
property = typeof event[key] === "object" ? JSON.stringify(event[key]) : event[key];
|
|
60
|
+
eventProperties.setProperty(key, property);
|
|
61
|
+
}
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
eventProperties.setPropertyWithPii(ariaTelemetryApplicationName, Constants.LiveChatWidget, AWTPiiKind.GenericData);
|
|
64
|
+
logger() ? logger().logEvent(eventProperties) : console.log("Unable to initialize aria logger");
|
|
65
|
+
} catch (error) {
|
|
66
|
+
console.error("Error in logging telemetry to Aria logger:" + error);
|
|
67
|
+
}
|
|
65
68
|
},
|
|
66
69
|
dispose: () => {
|
|
67
70
|
AWTLogManager.flush(function () {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/omnichannel-chat-widget",
|
|
3
|
-
"version": "0.1.0-main.
|
|
3
|
+
"version": "0.1.0-main.ae3aa42",
|
|
4
4
|
"description": "Microsoft Omnichannel Chat Widget",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"types": "lib/types/index.d.ts",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
76
|
"@fluentui/react": "^8.49.1",
|
|
77
|
-
"@microsoft/omnichannel-chat-components": "0.1.0-main.
|
|
77
|
+
"@microsoft/omnichannel-chat-components": "^0.1.0-main.099196c",
|
|
78
78
|
"@microsoft/omnichannel-chat-sdk": "1.0.1-main.077d17c",
|
|
79
79
|
"abort-controller-es5": "^2.0.1",
|
|
80
80
|
"dompurify": "^2.3.4",
|