@microsoft/omnichannel-chat-widget 1.6.2-main.c7d45e8 → 1.6.2
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 +9 -10
- package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +3 -3
- package/lib/esm/common/telemetry/TelemetryHelper.js +9 -10
- package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +3 -4
- package/lib/types/common/telemetry/definitions/Contracts.d.ts +3 -0
- package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +2 -1
- package/package.json +1 -1
|
@@ -36,7 +36,7 @@ class TelemetryHelper {
|
|
|
36
36
|
static populateBasicProperties(level,
|
|
37
37
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
38
38
|
telemetryData) {
|
|
39
|
-
var _TelemetryManager$Int, _TelemetryManager$Int2, _TelemetryManager$Int3, _TelemetryManager$Int4, _TelemetryManager$Int5, _TelemetryManager$Int6, _TelemetryManager$Int7, _TelemetryManager$Int8;
|
|
39
|
+
var _TelemetryManager$Int, _TelemetryManager$Int2, _TelemetryManager$Int3, _TelemetryManager$Int4, _TelemetryManager$Int5, _TelemetryManager$Int6, _TelemetryManager$Int7, _TelemetryManager$Int8, _TelemetryManager$Int9, _TelemetryManager$Int10, _TelemetryManager$Int11;
|
|
40
40
|
return {
|
|
41
41
|
WidgetId: ((_TelemetryManager$Int = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int === void 0 ? void 0 : _TelemetryManager$Int.widgetId) ?? "",
|
|
42
42
|
ChatId: ((_TelemetryManager$Int2 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int2 === void 0 ? void 0 : _TelemetryManager$Int2.chatId) ?? "",
|
|
@@ -46,7 +46,10 @@ class TelemetryHelper {
|
|
|
46
46
|
OrganizationUrl: ((_TelemetryManager$Int6 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int6 === void 0 ? void 0 : _TelemetryManager$Int6.orgUrl) ?? "",
|
|
47
47
|
LCWRuntimeId: ((_TelemetryManager$Int7 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int7 === void 0 ? void 0 : _TelemetryManager$Int7.lcwRuntimeId) ?? "",
|
|
48
48
|
CurrentRequestId: ((_TelemetryManager$Int8 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int8 === void 0 ? void 0 : _TelemetryManager$Int8.currentRequestId) ?? "",
|
|
49
|
-
LogLevel: level
|
|
49
|
+
LogLevel: level,
|
|
50
|
+
OCChatSDKVersion: ((_TelemetryManager$Int9 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int9 === void 0 ? void 0 : _TelemetryManager$Int9.OCChatSDKVersion) ?? "",
|
|
51
|
+
OCChatWidgetVersion: ((_TelemetryManager$Int10 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int10 === void 0 ? void 0 : _TelemetryManager$Int10.chatWidgetVersion) ?? "",
|
|
52
|
+
OCChatComponentsVersion: ((_TelemetryManager$Int11 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int11 === void 0 ? void 0 : _TelemetryManager$Int11.chatComponentVersion) ?? ""
|
|
50
53
|
};
|
|
51
54
|
}
|
|
52
55
|
static populate(level, telemetryData, configure) {
|
|
@@ -80,22 +83,21 @@ class TelemetryHelper {
|
|
|
80
83
|
static conformToConfigValidationContract(level, input) {
|
|
81
84
|
const payload = input.payload;
|
|
82
85
|
return TelemetryHelper.populate(level, payload, event => {
|
|
83
|
-
var _TelemetryManager$
|
|
86
|
+
var _TelemetryManager$Int12, _TelemetryManager$Int13, _TelemetryManager$Int14;
|
|
84
87
|
event.Event = payload.Event;
|
|
85
88
|
event.RequestId = payload.RequestId;
|
|
86
|
-
event.LCWVersion = (_TelemetryManager$
|
|
89
|
+
event.LCWVersion = (_TelemetryManager$Int12 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int12 === void 0 ? void 0 : _TelemetryManager$Int12.environmentVersion;
|
|
87
90
|
event.CloudType = payload.CloudType;
|
|
88
|
-
event.Domain = (_TelemetryManager$
|
|
91
|
+
event.Domain = (_TelemetryManager$Int13 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int13 === void 0 ? void 0 : _TelemetryManager$Int13.hostName;
|
|
89
92
|
event.ElapsedTimeInMilliseconds = payload.ElapsedTimeInMilliseconds;
|
|
90
93
|
event.ExceptionDetails = JSON.stringify(payload.ExceptionDetails);
|
|
91
|
-
event.Language = ((_TelemetryManager$
|
|
94
|
+
event.Language = ((_TelemetryManager$Int14 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int14 === void 0 ? void 0 : _TelemetryManager$Int14.chatWidgetLocaleLCID) || "";
|
|
92
95
|
event.Description = payload.Data;
|
|
93
96
|
});
|
|
94
97
|
}
|
|
95
98
|
static conformToLoadContract(level, input) {
|
|
96
99
|
const payload = input.payload;
|
|
97
100
|
return TelemetryHelper.populate(level, payload, event => {
|
|
98
|
-
var _TelemetryManager$Int12, _TelemetryManager$Int13, _TelemetryManager$Int14;
|
|
99
101
|
event.Event = payload.Event;
|
|
100
102
|
event.Description = payload.Description;
|
|
101
103
|
event.ResourcePath = payload.ResourcePath;
|
|
@@ -104,9 +106,6 @@ class TelemetryHelper {
|
|
|
104
106
|
event.ChatType = payload.ChatType;
|
|
105
107
|
event.ElapsedTimeInMilliseconds = payload.ElapsedTimeInMilliseconds;
|
|
106
108
|
event.ExceptionDetails = JSON.stringify(payload.ExceptionDetails);
|
|
107
|
-
event.OCChatSDKVersion = ((_TelemetryManager$Int12 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int12 === void 0 ? void 0 : _TelemetryManager$Int12.OCChatSDKVersion) ?? "";
|
|
108
|
-
event.OCChatWidgetVersion = ((_TelemetryManager$Int13 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int13 === void 0 ? void 0 : _TelemetryManager$Int13.chatWidgetVersion) ?? "";
|
|
109
|
-
event.OCChatComponentsVersion = ((_TelemetryManager$Int14 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int14 === void 0 ? void 0 : _TelemetryManager$Int14.chatComponentVersion) ?? "";
|
|
110
109
|
});
|
|
111
110
|
}
|
|
112
111
|
static conformToIC3ClientContract(level, input) {
|
|
@@ -30,9 +30,9 @@ const handleChatReconnect = async (chatSDK, props, dispatch, setAdapter, initSta
|
|
|
30
30
|
return false;
|
|
31
31
|
}
|
|
32
32
|
if (hasReconnectId(reconnectChatContext)) {
|
|
33
|
-
var _props$reconnectChatP2, _props$reconnectChatP3;
|
|
34
|
-
//if reconnect id is provided in props, don't show reconnect pane
|
|
35
|
-
if ((_props$reconnectChatP2 = props.reconnectChatPaneProps) !== null && _props$reconnectChatP2 !== void 0 && _props$reconnectChatP2.reconnectId && !(0, _utils.isNullOrEmptyString)((_props$reconnectChatP3 = props.reconnectChatPaneProps) === null || _props$reconnectChatP3 === void 0 ? void 0 : _props$reconnectChatP3.reconnectId)) {
|
|
33
|
+
var _props$reconnectChatP2, _props$reconnectChatP3, _props$controlProps;
|
|
34
|
+
//if reconnect id is provided in props, or hideReconnectChatPane is true, don't show reconnect pane
|
|
35
|
+
if ((_props$reconnectChatP2 = props.reconnectChatPaneProps) !== null && _props$reconnectChatP2 !== void 0 && _props$reconnectChatP2.reconnectId && !(0, _utils.isNullOrEmptyString)((_props$reconnectChatP3 = props.reconnectChatPaneProps) === null || _props$reconnectChatP3 === void 0 ? void 0 : _props$reconnectChatP3.reconnectId) || (_props$controlProps = props.controlProps) !== null && _props$controlProps !== void 0 && _props$controlProps.hideReconnectChatPane) {
|
|
36
36
|
await setReconnectIdAndStartChat(isAuthenticatedChat, chatSDK, state, props, dispatch, setAdapter, reconnectChatContext.reconnectId ?? "", initStartChat);
|
|
37
37
|
return false;
|
|
38
38
|
}
|
|
@@ -30,7 +30,7 @@ export class TelemetryHelper {
|
|
|
30
30
|
static populateBasicProperties(level,
|
|
31
31
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
32
32
|
telemetryData) {
|
|
33
|
-
var _TelemetryManager$Int, _TelemetryManager$Int2, _TelemetryManager$Int3, _TelemetryManager$Int4, _TelemetryManager$Int5, _TelemetryManager$Int6, _TelemetryManager$Int7, _TelemetryManager$Int8;
|
|
33
|
+
var _TelemetryManager$Int, _TelemetryManager$Int2, _TelemetryManager$Int3, _TelemetryManager$Int4, _TelemetryManager$Int5, _TelemetryManager$Int6, _TelemetryManager$Int7, _TelemetryManager$Int8, _TelemetryManager$Int9, _TelemetryManager$Int10, _TelemetryManager$Int11;
|
|
34
34
|
return {
|
|
35
35
|
WidgetId: ((_TelemetryManager$Int = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int === void 0 ? void 0 : _TelemetryManager$Int.widgetId) ?? "",
|
|
36
36
|
ChatId: ((_TelemetryManager$Int2 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int2 === void 0 ? void 0 : _TelemetryManager$Int2.chatId) ?? "",
|
|
@@ -40,7 +40,10 @@ export class TelemetryHelper {
|
|
|
40
40
|
OrganizationUrl: ((_TelemetryManager$Int6 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int6 === void 0 ? void 0 : _TelemetryManager$Int6.orgUrl) ?? "",
|
|
41
41
|
LCWRuntimeId: ((_TelemetryManager$Int7 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int7 === void 0 ? void 0 : _TelemetryManager$Int7.lcwRuntimeId) ?? "",
|
|
42
42
|
CurrentRequestId: ((_TelemetryManager$Int8 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int8 === void 0 ? void 0 : _TelemetryManager$Int8.currentRequestId) ?? "",
|
|
43
|
-
LogLevel: level
|
|
43
|
+
LogLevel: level,
|
|
44
|
+
OCChatSDKVersion: ((_TelemetryManager$Int9 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int9 === void 0 ? void 0 : _TelemetryManager$Int9.OCChatSDKVersion) ?? "",
|
|
45
|
+
OCChatWidgetVersion: ((_TelemetryManager$Int10 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int10 === void 0 ? void 0 : _TelemetryManager$Int10.chatWidgetVersion) ?? "",
|
|
46
|
+
OCChatComponentsVersion: ((_TelemetryManager$Int11 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int11 === void 0 ? void 0 : _TelemetryManager$Int11.chatComponentVersion) ?? ""
|
|
44
47
|
};
|
|
45
48
|
}
|
|
46
49
|
static populate(level, telemetryData, configure) {
|
|
@@ -74,22 +77,21 @@ export class TelemetryHelper {
|
|
|
74
77
|
static conformToConfigValidationContract(level, input) {
|
|
75
78
|
const payload = input.payload;
|
|
76
79
|
return TelemetryHelper.populate(level, payload, event => {
|
|
77
|
-
var _TelemetryManager$
|
|
80
|
+
var _TelemetryManager$Int12, _TelemetryManager$Int13, _TelemetryManager$Int14;
|
|
78
81
|
event.Event = payload.Event;
|
|
79
82
|
event.RequestId = payload.RequestId;
|
|
80
|
-
event.LCWVersion = (_TelemetryManager$
|
|
83
|
+
event.LCWVersion = (_TelemetryManager$Int12 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int12 === void 0 ? void 0 : _TelemetryManager$Int12.environmentVersion;
|
|
81
84
|
event.CloudType = payload.CloudType;
|
|
82
|
-
event.Domain = (_TelemetryManager$
|
|
85
|
+
event.Domain = (_TelemetryManager$Int13 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int13 === void 0 ? void 0 : _TelemetryManager$Int13.hostName;
|
|
83
86
|
event.ElapsedTimeInMilliseconds = payload.ElapsedTimeInMilliseconds;
|
|
84
87
|
event.ExceptionDetails = JSON.stringify(payload.ExceptionDetails);
|
|
85
|
-
event.Language = ((_TelemetryManager$
|
|
88
|
+
event.Language = ((_TelemetryManager$Int14 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int14 === void 0 ? void 0 : _TelemetryManager$Int14.chatWidgetLocaleLCID) || "";
|
|
86
89
|
event.Description = payload.Data;
|
|
87
90
|
});
|
|
88
91
|
}
|
|
89
92
|
static conformToLoadContract(level, input) {
|
|
90
93
|
const payload = input.payload;
|
|
91
94
|
return TelemetryHelper.populate(level, payload, event => {
|
|
92
|
-
var _TelemetryManager$Int12, _TelemetryManager$Int13, _TelemetryManager$Int14;
|
|
93
95
|
event.Event = payload.Event;
|
|
94
96
|
event.Description = payload.Description;
|
|
95
97
|
event.ResourcePath = payload.ResourcePath;
|
|
@@ -98,9 +100,6 @@ export class TelemetryHelper {
|
|
|
98
100
|
event.ChatType = payload.ChatType;
|
|
99
101
|
event.ElapsedTimeInMilliseconds = payload.ElapsedTimeInMilliseconds;
|
|
100
102
|
event.ExceptionDetails = JSON.stringify(payload.ExceptionDetails);
|
|
101
|
-
event.OCChatSDKVersion = ((_TelemetryManager$Int12 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int12 === void 0 ? void 0 : _TelemetryManager$Int12.OCChatSDKVersion) ?? "";
|
|
102
|
-
event.OCChatWidgetVersion = ((_TelemetryManager$Int13 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int13 === void 0 ? void 0 : _TelemetryManager$Int13.chatWidgetVersion) ?? "";
|
|
103
|
-
event.OCChatComponentsVersion = ((_TelemetryManager$Int14 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int14 === void 0 ? void 0 : _TelemetryManager$Int14.chatComponentVersion) ?? "";
|
|
104
103
|
});
|
|
105
104
|
}
|
|
106
105
|
static conformToIC3ClientContract(level, input) {
|
|
@@ -7,7 +7,6 @@ import { ConversationMode } from "../../../common/Constants";
|
|
|
7
7
|
import { ConversationState } from "../../../contexts/common/ConversationState";
|
|
8
8
|
import { LiveChatWidgetActionType } from "../../../contexts/common/LiveChatWidgetActionType";
|
|
9
9
|
import { TelemetryHelper } from "../../../common/telemetry/TelemetryHelper";
|
|
10
|
-
|
|
11
10
|
// Return value: should start normal chat flow when reconnect is enabled
|
|
12
11
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
12
|
const handleChatReconnect = async (chatSDK, props, dispatch, setAdapter, initStartChat, state) => {
|
|
@@ -25,9 +24,9 @@ const handleChatReconnect = async (chatSDK, props, dispatch, setAdapter, initSta
|
|
|
25
24
|
return false;
|
|
26
25
|
}
|
|
27
26
|
if (hasReconnectId(reconnectChatContext)) {
|
|
28
|
-
var _props$reconnectChatP2, _props$reconnectChatP3;
|
|
29
|
-
//if reconnect id is provided in props, don't show reconnect pane
|
|
30
|
-
if ((_props$reconnectChatP2 = props.reconnectChatPaneProps) !== null && _props$reconnectChatP2 !== void 0 && _props$reconnectChatP2.reconnectId && !isNullOrEmptyString((_props$reconnectChatP3 = props.reconnectChatPaneProps) === null || _props$reconnectChatP3 === void 0 ? void 0 : _props$reconnectChatP3.reconnectId)) {
|
|
27
|
+
var _props$reconnectChatP2, _props$reconnectChatP3, _props$controlProps;
|
|
28
|
+
//if reconnect id is provided in props, or hideReconnectChatPane is true, don't show reconnect pane
|
|
29
|
+
if ((_props$reconnectChatP2 = props.reconnectChatPaneProps) !== null && _props$reconnectChatP2 !== void 0 && _props$reconnectChatP2.reconnectId && !isNullOrEmptyString((_props$reconnectChatP3 = props.reconnectChatPaneProps) === null || _props$reconnectChatP3 === void 0 ? void 0 : _props$reconnectChatP3.reconnectId) || (_props$controlProps = props.controlProps) !== null && _props$controlProps !== void 0 && _props$controlProps.hideReconnectChatPane) {
|
|
31
30
|
await setReconnectIdAndStartChat(isAuthenticatedChat, chatSDK, state, props, dispatch, setAdapter, reconnectChatContext.reconnectId ?? "", initStartChat);
|
|
32
31
|
return false;
|
|
33
32
|
}
|
|
@@ -11,6 +11,9 @@ export interface BaseContract {
|
|
|
11
11
|
ExceptionDetails?: any;
|
|
12
12
|
LogLevel: string;
|
|
13
13
|
Description?: string;
|
|
14
|
+
OCChatSDKVersion?: string;
|
|
15
|
+
OCChatWidgetVersion?: string;
|
|
16
|
+
OCChatComponentsVersion?: string;
|
|
14
17
|
}
|
|
15
18
|
export interface ConfigValidationContract extends BaseContract {
|
|
16
19
|
Event?: string;
|
|
@@ -3,7 +3,8 @@ import ChatConfig from "@microsoft/omnichannel-chat-sdk/lib/core/ChatConfig";
|
|
|
3
3
|
import { Dispatch } from "react";
|
|
4
4
|
import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
|
|
5
5
|
import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
|
|
6
|
-
|
|
6
|
+
import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
|
|
7
|
+
declare const handleChatReconnect: (chatSDK: any, props: ILiveChatWidgetProps, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, initStartChat: any, state: ILiveChatWidgetContext) => Promise<boolean>;
|
|
7
8
|
declare const getChatReconnectContext: (chatSDK: any, chatConfig: ChatConfig, props: any, isAuthenticatedChat: boolean) => Promise<any>;
|
|
8
9
|
declare const isReconnectEnabled: (chatConfig?: ChatConfig | undefined) => boolean;
|
|
9
10
|
declare const isPersistentEnabled: (chatConfig?: ChatConfig | undefined) => boolean;
|