@microsoft/omnichannel-chat-widget 1.7.3-main.7a38853 → 1.7.3-main.aa696dc
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/TelemetryConstants.js +1 -0
- package/lib/cjs/components/livechatwidget/LiveChatWidget.js +6 -1
- package/lib/cjs/components/livechatwidget/common/endChat.js +20 -5
- package/lib/cjs/components/livechatwidget/common/getMockChatSDKIfApplicable.js +26 -0
- package/lib/cjs/components/livechatwidget/common/overridePropsOnMockIfApplicable.js +41 -0
- package/lib/cjs/components/livechatwidget/common/startChat.js +52 -37
- package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.js +6 -6
- package/lib/cjs/components/livechatwidget/common/updateSessionDataForTelemetry.js +8 -3
- package/lib/cjs/components/livechatwidget/interfaces/IMockProps.js +7 -0
- package/lib/cjs/components/webchatcontainerstateful/common/DemoChatAdapter.js +87 -0
- package/lib/cjs/components/webchatcontainerstateful/common/DemoChatSDK.js +17 -0
- package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatAdapter.js +41 -0
- package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatSDK.js +17 -0
- package/lib/cjs/components/webchatcontainerstateful/common/MockBotCardCommandType.js +14 -0
- package/lib/cjs/components/webchatcontainerstateful/common/MockBotCommand.js +19 -0
- package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +3 -0
- package/lib/cjs/components/webchatcontainerstateful/common/utils/attachmentActivityUtils.js +71 -0
- package/lib/cjs/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +90 -0
- package/lib/cjs/plugins/newMessageEventHandler.js +4 -2
- package/lib/esm/common/telemetry/TelemetryConstants.js +1 -0
- package/lib/esm/components/livechatwidget/LiveChatWidget.js +6 -1
- package/lib/esm/components/livechatwidget/common/endChat.js +20 -5
- package/lib/esm/components/livechatwidget/common/getMockChatSDKIfApplicable.js +20 -0
- package/lib/esm/components/livechatwidget/common/overridePropsOnMockIfApplicable.js +34 -0
- package/lib/esm/components/livechatwidget/common/startChat.js +52 -37
- package/lib/esm/components/livechatwidget/common/startChatErrorHandler.js +7 -7
- package/lib/esm/components/livechatwidget/common/updateSessionDataForTelemetry.js +7 -2
- package/lib/esm/components/livechatwidget/interfaces/IMockProps.js +6 -0
- package/lib/esm/components/webchatcontainerstateful/common/DemoChatAdapter.js +79 -0
- package/lib/esm/components/webchatcontainerstateful/common/DemoChatSDK.js +10 -0
- package/lib/esm/components/webchatcontainerstateful/common/DesignerChatAdapter.js +33 -0
- package/lib/esm/components/webchatcontainerstateful/common/DesignerChatSDK.js +10 -0
- package/lib/esm/components/webchatcontainerstateful/common/MockBotCardCommandType.js +7 -0
- package/lib/esm/components/webchatcontainerstateful/common/MockBotCommand.js +12 -0
- package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +3 -0
- package/lib/esm/components/webchatcontainerstateful/common/utils/attachmentActivityUtils.js +61 -0
- package/lib/esm/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +77 -0
- package/lib/esm/plugins/newMessageEventHandler.js +4 -2
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +1 -0
- package/lib/types/components/livechatwidget/common/getMockChatSDKIfApplicable.d.ts +1 -0
- package/lib/types/components/livechatwidget/common/overridePropsOnMockIfApplicable.d.ts +3 -0
- package/lib/types/components/livechatwidget/common/updateSessionDataForTelemetry.d.ts +1 -1
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +2 -0
- package/lib/types/components/livechatwidget/interfaces/IMockProps.d.ts +8 -0
- package/lib/types/components/webchatcontainerstateful/common/DemoChatAdapter.d.ts +10 -0
- package/lib/types/components/webchatcontainerstateful/common/DemoChatSDK.d.ts +6 -0
- package/lib/types/components/webchatcontainerstateful/common/DesignerChatAdapter.d.ts +8 -0
- package/lib/types/components/webchatcontainerstateful/common/DesignerChatSDK.d.ts +6 -0
- package/lib/types/components/webchatcontainerstateful/common/MockBotCardCommandType.d.ts +6 -0
- package/lib/types/components/webchatcontainerstateful/common/MockBotCommand.d.ts +11 -0
- package/lib/types/components/webchatcontainerstateful/common/mockadapter.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/common/mockchatsdk.d.ts +6 -0
- package/lib/types/components/webchatcontainerstateful/common/utils/attachmentActivityUtils.d.ts +9 -0
- package/lib/types/components/webchatcontainerstateful/common/utils/chatAdapterUtils.d.ts +9 -0
- package/package.json +3 -3
|
@@ -101,6 +101,7 @@ exports.TelemetryEvent = TelemetryEvent;
|
|
|
101
101
|
TelemetryEvent["GetConversationDetailsCallStarted"] = "GetConversationDetailsCallStarted";
|
|
102
102
|
TelemetryEvent["GetConversationDetailsCallFailed"] = "GetConversationDetailsCallFailed";
|
|
103
103
|
TelemetryEvent["EndChatSDKCallFailed"] = "EndChatSDKCallFailed";
|
|
104
|
+
TelemetryEvent["DisconnectEndChatSDKCallFailed"] = "DisconnectEndChatSDKCallFailed";
|
|
104
105
|
TelemetryEvent["GetChatReconnectContextSDKCallStarted"] = "GetChatReconnectContextSDKCallStarted";
|
|
105
106
|
TelemetryEvent["GetChatReconnectContextSDKCallFailed"] = "GetChatReconnectContextSDKCallFailed";
|
|
106
107
|
TelemetryEvent["ParseAdaptiveCardFailed"] = "ParseAdaptiveCardFailed";
|
|
@@ -11,16 +11,21 @@ var _ChatSDKStore = require("../../contexts/ChatSDKStore");
|
|
|
11
11
|
var _LiveChatWidgetStateful = _interopRequireDefault(require("./livechatwidgetstateful/LiveChatWidgetStateful"));
|
|
12
12
|
var _createReducer = require("../../contexts/createReducer");
|
|
13
13
|
var _LiveChatWidgetContextInitialState = require("../../contexts/common/LiveChatWidgetContextInitialState");
|
|
14
|
+
var _getMockChatSDKIfApplicable = require("./common/getMockChatSDKIfApplicable");
|
|
15
|
+
var _overridePropsOnMockIfApplicable = _interopRequireDefault(require("./common/overridePropsOnMockIfApplicable"));
|
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
17
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
19
|
const LiveChatWidget = props => {
|
|
20
|
+
var _props$mock;
|
|
18
21
|
const reducer = (0, _createReducer.createReducer)();
|
|
19
22
|
const [state, dispatch] = (0, _react.useReducer)(reducer, (0, _LiveChatWidgetContextInitialState.getLiveChatWidgetContextInitialState)(props));
|
|
20
23
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
24
|
const [adapter, setAdapter] = (0, _react.useState)(undefined);
|
|
25
|
+
const chatSDK = (0, _getMockChatSDKIfApplicable.getMockChatSDKIfApplicable)(props.chatSDK, props === null || props === void 0 ? void 0 : (_props$mock = props.mock) === null || _props$mock === void 0 ? void 0 : _props$mock.type);
|
|
26
|
+
(0, _overridePropsOnMockIfApplicable.default)(props);
|
|
22
27
|
return /*#__PURE__*/_react.default.createElement(_ChatSDKStore.ChatSDKStore.Provider, {
|
|
23
|
-
value:
|
|
28
|
+
value: chatSDK
|
|
24
29
|
}, /*#__PURE__*/_react.default.createElement(_ChatAdapterStore.ChatAdapterStore.Provider, {
|
|
25
30
|
value: [adapter, setAdapter]
|
|
26
31
|
}, /*#__PURE__*/_react.default.createElement(_ChatContextStore.ChatContextStore.Provider, {
|
|
@@ -141,12 +141,27 @@ const endChat = async (props, chatSDK, state, dispatch, setAdapter, setWebChatSt
|
|
|
141
141
|
await (0, _authHelper.handleAuthentication)(chatSDK, props.chatConfig, props.getAuthToken);
|
|
142
142
|
await (chatSDK === null || chatSDK === void 0 ? void 0 : chatSDK.endChat());
|
|
143
143
|
} catch (ex) {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
144
|
+
var _inMemoryState$appSta;
|
|
145
|
+
const inMemoryState = (0, _createReducer.executeReducer)(state, {
|
|
146
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.GET_IN_MEMORY_STATE,
|
|
147
|
+
payload: null
|
|
149
148
|
});
|
|
149
|
+
// if the chat was disconnected or ended by the agent, we don't want to log the error
|
|
150
|
+
if (!(inMemoryState !== null && inMemoryState !== void 0 && (_inMemoryState$appSta = inMemoryState.appStates) !== null && _inMemoryState$appSta !== void 0 && _inMemoryState$appSta.chatDisconnectEventReceived)) {
|
|
151
|
+
_TelemetryHelper.TelemetryHelper.logSDKEvent(_TelemetryConstants.LogLevel.ERROR, {
|
|
152
|
+
Event: _TelemetryConstants.TelemetryEvent.EndChatSDKCallFailed,
|
|
153
|
+
ExceptionDetails: {
|
|
154
|
+
exception: ex
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
} else {
|
|
158
|
+
_TelemetryHelper.TelemetryHelper.logSDKEvent(_TelemetryConstants.LogLevel.WARN, {
|
|
159
|
+
Event: _TelemetryConstants.TelemetryEvent.DisconnectEndChatSDKCallFailed,
|
|
160
|
+
ExceptionDetails: {
|
|
161
|
+
exception: ex
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
}
|
|
150
165
|
postMessageToOtherTab = false;
|
|
151
166
|
} finally {
|
|
152
167
|
await endChatStateCleanUp(dispatch);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getMockChatSDKIfApplicable = void 0;
|
|
7
|
+
var _DemoChatSDK = require("../../webchatcontainerstateful/common/DemoChatSDK");
|
|
8
|
+
var _DesignerChatSDK = require("../../webchatcontainerstateful/common/DesignerChatSDK");
|
|
9
|
+
var _mockchatsdk = require("../../webchatcontainerstateful/common/mockchatsdk");
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
|
+
const getMockChatSDKIfApplicable = (chatSDK, type) => {
|
|
12
|
+
if (type) {
|
|
13
|
+
switch (type.toLowerCase()) {
|
|
14
|
+
case "demo":
|
|
15
|
+
chatSDK = new _DemoChatSDK.DemoChatSDK();
|
|
16
|
+
break;
|
|
17
|
+
case "designer":
|
|
18
|
+
chatSDK = new _DesignerChatSDK.DesignerChatSDK();
|
|
19
|
+
break;
|
|
20
|
+
default:
|
|
21
|
+
chatSDK = new _mockchatsdk.MockChatSDK();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return chatSDK;
|
|
25
|
+
};
|
|
26
|
+
exports.getMockChatSDKIfApplicable = getMockChatSDKIfApplicable;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
const overridePropsOnMockIfApplicable = props => {
|
|
8
|
+
var _props$mock, _props$mock2;
|
|
9
|
+
if (props !== null && props !== void 0 && (_props$mock = props.mock) !== null && _props$mock !== void 0 && _props$mock.type && (props === null || props === void 0 ? void 0 : (_props$mock2 = props.mock) === null || _props$mock2 === void 0 ? void 0 : _props$mock2.type.toLowerCase()) === "designer") {
|
|
10
|
+
if (!props.webChatContainerProps) {
|
|
11
|
+
props.webChatContainerProps = {};
|
|
12
|
+
}
|
|
13
|
+
if (!props.webChatContainerProps.webChatProps) {
|
|
14
|
+
props.webChatContainerProps.webChatProps = {};
|
|
15
|
+
}
|
|
16
|
+
if (!props.webChatContainerProps.webChatStyles) {
|
|
17
|
+
props.webChatContainerProps.webChatStyles = {};
|
|
18
|
+
}
|
|
19
|
+
if (!props.webChatContainerProps.webChatProps.overrideLocalizedStrings) {
|
|
20
|
+
props.webChatContainerProps.webChatProps.overrideLocalizedStrings = {};
|
|
21
|
+
}
|
|
22
|
+
props.webChatContainerProps = {
|
|
23
|
+
...props.webChatContainerProps,
|
|
24
|
+
webChatProps: {
|
|
25
|
+
disabled: true,
|
|
26
|
+
...props.webChatContainerProps.webChatProps,
|
|
27
|
+
overrideLocalizedStrings: {
|
|
28
|
+
TEXT_INPUT_PLACEHOLDER: "Send a message . . .",
|
|
29
|
+
...props.webChatContainerProps.webChatProps.overrideLocalizedStrings
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
webChatStyles: {
|
|
33
|
+
hideUploadButton: false,
|
|
34
|
+
sendBoxBackground: "rgb(243, 242, 241)",
|
|
35
|
+
...props.webChatContainerProps.webChatStyles
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
var _default = overridePropsOnMockIfApplicable;
|
|
41
|
+
exports.default = _default;
|
|
@@ -8,21 +8,21 @@ var _TelemetryConstants = require("../../../common/telemetry/TelemetryConstants"
|
|
|
8
8
|
var _Constants = require("../../../common/Constants");
|
|
9
9
|
var _utils = require("../../../common/utils");
|
|
10
10
|
var _authHelper = require("./authHelper");
|
|
11
|
+
var _reconnectChatHelper = require("./reconnectChatHelper");
|
|
12
|
+
var _startChatErrorHandler = require("./startChatErrorHandler");
|
|
11
13
|
var _ActivityStreamHandler = require("./ActivityStreamHandler");
|
|
12
14
|
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
13
15
|
var _ConversationState = require("../../../contexts/common/ConversationState");
|
|
14
16
|
var _LiveChatWidgetActionType = require("../../../contexts/common/LiveChatWidgetActionType");
|
|
15
17
|
var _TelemetryHelper = require("../../../common/telemetry/TelemetryHelper");
|
|
16
18
|
var _TelemetryManager = require("../../../common/telemetry/TelemetryManager");
|
|
19
|
+
var _endChat = require("./endChat");
|
|
17
20
|
var _createAdapter = require("./createAdapter");
|
|
18
21
|
var _newMessageEventHandler = require("../../../plugins/newMessageEventHandler");
|
|
19
|
-
var _reconnectChatHelper = require("./reconnectChatHelper");
|
|
20
|
-
var _setPostChatContextAndLoadSurvey = require("./setPostChatContextAndLoadSurvey");
|
|
21
|
-
var _updateSessionDataForTelemetry = require("./updateSessionDataForTelemetry");
|
|
22
|
-
var _startChatErrorHandler = require("./startChatErrorHandler");
|
|
23
|
-
var _endChat = require("./endChat");
|
|
24
22
|
var _liveChatConfigUtils = require("./liveChatConfigUtils");
|
|
23
|
+
var _setPostChatContextAndLoadSurvey = require("./setPostChatContextAndLoadSurvey");
|
|
25
24
|
var _persistentChatHelper = require("./persistentChatHelper");
|
|
25
|
+
var _updateSessionDataForTelemetry = require("./updateSessionDataForTelemetry");
|
|
26
26
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
27
|
let optionalParams = {};
|
|
28
28
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -30,10 +30,25 @@ let widgetInstanceId;
|
|
|
30
30
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
31
31
|
let popoutWidgetInstanceId;
|
|
32
32
|
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
34
|
+
const setAuthenticationIfApplicable = async (props, chatSDK) => {
|
|
35
|
+
const chatConfig = props === null || props === void 0 ? void 0 : props.chatConfig;
|
|
36
|
+
const getAuthToken = props === null || props === void 0 ? void 0 : props.getAuthToken;
|
|
37
|
+
const authClientFunction = (0, _authHelper.getAuthClientFunction)(chatConfig);
|
|
38
|
+
if (getAuthToken && authClientFunction) {
|
|
39
|
+
// set auth token to chat sdk before start chat
|
|
40
|
+
const authSuccess = await (0, _authHelper.handleAuthentication)(chatSDK, chatConfig, getAuthToken);
|
|
41
|
+
if (!authSuccess) {
|
|
42
|
+
throw new Error(_Constants.WidgetLoadCustomErrorString.AuthenticationFailedErrorString);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
33
47
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
34
48
|
const prepareStartChat = async (props, chatSDK, state, dispatch, setAdapter) => {
|
|
35
49
|
optionalParams = {}; //Resetting to ensure no stale values
|
|
36
50
|
widgetInstanceId = (0, _utils.getWidgetCacheIdfromProps)(props);
|
|
51
|
+
|
|
37
52
|
// reconnect > chat from cache
|
|
38
53
|
if ((0, _reconnectChatHelper.isReconnectEnabled)(props.chatConfig) === true && !(0, _reconnectChatHelper.isPersistentEnabled)(props.chatConfig)) {
|
|
39
54
|
const shouldStartChatNormally = await (0, _reconnectChatHelper.handleChatReconnect)(chatSDK, props, dispatch, setAdapter, initStartChat, state);
|
|
@@ -56,6 +71,11 @@ const prepareStartChat = async (props, chatSDK, state, dispatch, setAdapter) =>
|
|
|
56
71
|
const isProactiveChat = state.appStates.conversationState === _ConversationState.ConversationState.ProactiveChat;
|
|
57
72
|
const isPreChatEnabledInProactiveChat = state.appStates.proactiveChatStates.proactiveChatEnablePrechat;
|
|
58
73
|
|
|
74
|
+
// Setting auth settings to OC API to retrieve existing persistent chat session before start chat if any
|
|
75
|
+
if ((0, _reconnectChatHelper.isPersistentEnabled)(props.chatConfig)) {
|
|
76
|
+
await setAuthenticationIfApplicable(props, chatSDK);
|
|
77
|
+
}
|
|
78
|
+
|
|
59
79
|
//Setting PreChat and intiate chat
|
|
60
80
|
await setPreChatAndInitiateChat(chatSDK, dispatch, setAdapter, isProactiveChat, isPreChatEnabledInProactiveChat, state, props);
|
|
61
81
|
};
|
|
@@ -132,15 +152,13 @@ exports.setPreChatAndInitiateChat = setPreChatAndInitiateChat;
|
|
|
132
152
|
const initStartChat = async (chatSDK, dispatch, setAdapter, state, props, params, persistedState) => {
|
|
133
153
|
var _state$domainStates5, _state$domainStates5$, _state$domainStates5$2;
|
|
134
154
|
let isStartChatSuccessful = false;
|
|
135
|
-
const chatConfig = props === null || props === void 0 ? void 0 : props.chatConfig;
|
|
136
|
-
const getAuthToken = props === null || props === void 0 ? void 0 : props.getAuthToken;
|
|
137
155
|
const persistentChatEnabled = await (0, _liveChatConfigUtils.isPersistentChatEnabled)(state === null || state === void 0 ? void 0 : (_state$domainStates5 = state.domainStates) === null || _state$domainStates5 === void 0 ? void 0 : (_state$domainStates5$ = _state$domainStates5.liveChatConfig) === null || _state$domainStates5$ === void 0 ? void 0 : (_state$domainStates5$2 = _state$domainStates5$.LiveWSAndLiveChatEngJoin) === null || _state$domainStates5$2 === void 0 ? void 0 : _state$domainStates5$2.msdyn_conversationmode);
|
|
138
156
|
if ((state === null || state === void 0 ? void 0 : state.appStates.conversationState) === _ConversationState.ConversationState.Closed) {
|
|
139
157
|
// Preventive reset to avoid starting chat with previous requestId which could potentially cause problems
|
|
140
158
|
(0, _endChat.chatSDKStateCleanUp)(chatSDK);
|
|
141
159
|
}
|
|
142
160
|
try {
|
|
143
|
-
var _state$appStates2
|
|
161
|
+
var _state$appStates2;
|
|
144
162
|
// Clear disconnect state on start chat
|
|
145
163
|
(state === null || state === void 0 ? void 0 : (_state$appStates2 = state.appStates) === null || _state$appStates2 === void 0 ? void 0 : _state$appStates2.chatDisconnectEventReceived) && dispatch({
|
|
146
164
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CHAT_DISCONNECT_EVENT_RECEIVED,
|
|
@@ -153,14 +171,9 @@ const initStartChat = async (chatSDK, dispatch, setAdapter, state, props, params
|
|
|
153
171
|
Event: _TelemetryConstants.TelemetryEvent.WidgetLoadStarted,
|
|
154
172
|
Description: "Widget loading started"
|
|
155
173
|
});
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
const authSuccess = await (0, _authHelper.handleAuthentication)(chatSDK, chatConfig, getAuthToken);
|
|
160
|
-
if (!authSuccess) {
|
|
161
|
-
throw new Error(_Constants.WidgetLoadCustomErrorString.AuthenticationFailedErrorString);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
174
|
+
|
|
175
|
+
// Auth token retrieval needs to happen during start chat to support pop-out chat
|
|
176
|
+
await setAuthenticationIfApplicable(props, chatSDK);
|
|
164
177
|
|
|
165
178
|
//Check if chat retrieved from cache
|
|
166
179
|
if (persistedState || params !== null && params !== void 0 && params.liveChatContext) {
|
|
@@ -197,16 +210,6 @@ const initStartChat = async (chatSDK, dispatch, setAdapter, state, props, params
|
|
|
197
210
|
throw error;
|
|
198
211
|
}
|
|
199
212
|
|
|
200
|
-
// New adapter creation
|
|
201
|
-
const newAdapter = await (0, _createAdapter.createAdapter)(chatSDK);
|
|
202
|
-
setAdapter(newAdapter);
|
|
203
|
-
const chatToken = await chatSDK.getChatToken();
|
|
204
|
-
dispatch({
|
|
205
|
-
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CHAT_TOKEN,
|
|
206
|
-
payload: chatToken
|
|
207
|
-
});
|
|
208
|
-
newAdapter === null || newAdapter === void 0 ? void 0 : (_newAdapter$activity$ = newAdapter.activity$) === null || _newAdapter$activity$ === void 0 ? void 0 : _newAdapter$activity$.subscribe((0, _newMessageEventHandler.createOnNewAdapterActivityHandler)(chatToken === null || chatToken === void 0 ? void 0 : chatToken.chatId, chatToken === null || chatToken === void 0 ? void 0 : chatToken.visitorId));
|
|
209
|
-
|
|
210
213
|
// Set app state to Active
|
|
211
214
|
if (isStartChatSuccessful) {
|
|
212
215
|
_ActivityStreamHandler.ActivityStreamHandler.uncork();
|
|
@@ -226,27 +229,26 @@ const initStartChat = async (chatSDK, dispatch, setAdapter, state, props, params
|
|
|
226
229
|
payload: persistedState
|
|
227
230
|
});
|
|
228
231
|
(0, _startChatErrorHandler.logWidgetLoadComplete)(_Constants.WidgetLoadTelemetryMessage.PersistedStateRetrievedMessage);
|
|
229
|
-
|
|
232
|
+
// Set post chat context in state, load in background to do not block the load
|
|
233
|
+
(0, _setPostChatContextAndLoadSurvey.setPostChatContextAndLoadSurvey)(chatSDK, dispatch, true);
|
|
230
234
|
return;
|
|
231
235
|
}
|
|
232
|
-
|
|
233
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
234
|
-
const liveChatContext = await (chatSDK === null || chatSDK === void 0 ? void 0 : chatSDK.getCurrentLiveChatContext());
|
|
236
|
+
await createAdapterAndSubscribe(chatSDK, dispatch, setAdapter);
|
|
235
237
|
|
|
236
238
|
// Persistent Chat relies on the `reconnectId` retrieved from reconnectablechats API to reconnect upon start chat and not `liveChatContext`
|
|
237
239
|
if (!persistentChatEnabled) {
|
|
240
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
241
|
+
const liveChatContext = await (chatSDK === null || chatSDK === void 0 ? void 0 : chatSDK.getCurrentLiveChatContext());
|
|
238
242
|
dispatch({
|
|
239
243
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_LIVE_CHAT_CONTEXT,
|
|
240
244
|
payload: liveChatContext
|
|
241
245
|
});
|
|
242
246
|
}
|
|
243
247
|
(0, _startChatErrorHandler.logWidgetLoadComplete)();
|
|
244
|
-
// Set post chat context in state
|
|
245
|
-
|
|
246
|
-
await (0, _setPostChatContextAndLoadSurvey.setPostChatContextAndLoadSurvey)(chatSDK, dispatch);
|
|
247
|
-
|
|
248
|
+
// Set post chat context in state, load in background to do not block the load
|
|
249
|
+
(0, _setPostChatContextAndLoadSurvey.setPostChatContextAndLoadSurvey)(chatSDK, dispatch);
|
|
248
250
|
// Updating chat session detail for telemetry
|
|
249
|
-
await (0, _updateSessionDataForTelemetry.
|
|
251
|
+
await (0, _updateSessionDataForTelemetry.updateTelemetryData)(chatSDK, dispatch);
|
|
250
252
|
} catch (ex) {
|
|
251
253
|
(0, _startChatErrorHandler.handleStartChatError)(dispatch, chatSDK, props, ex, isStartChatSuccessful);
|
|
252
254
|
} finally {
|
|
@@ -257,6 +259,21 @@ const initStartChat = async (chatSDK, dispatch, setAdapter, state, props, params
|
|
|
257
259
|
|
|
258
260
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
259
261
|
exports.initStartChat = initStartChat;
|
|
262
|
+
const createAdapterAndSubscribe = async (chatSDK, dispatch, setAdapter) => {
|
|
263
|
+
var _newAdapter$activity$;
|
|
264
|
+
// New adapter creation
|
|
265
|
+
const newAdapter = await (0, _createAdapter.createAdapter)(chatSDK);
|
|
266
|
+
setAdapter(newAdapter);
|
|
267
|
+
|
|
268
|
+
//start chat is already seeding the chat token, so no need to get it again
|
|
269
|
+
const chatToken = await chatSDK.getChatToken(true);
|
|
270
|
+
dispatch({
|
|
271
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CHAT_TOKEN,
|
|
272
|
+
payload: chatToken
|
|
273
|
+
});
|
|
274
|
+
newAdapter === null || newAdapter === void 0 ? void 0 : (_newAdapter$activity$ = newAdapter.activity$) === null || _newAdapter$activity$ === void 0 ? void 0 : _newAdapter$activity$.subscribe((0, _newMessageEventHandler.createOnNewAdapterActivityHandler)(chatToken === null || chatToken === void 0 ? void 0 : chatToken.chatId, chatToken === null || chatToken === void 0 ? void 0 : chatToken.visitorId));
|
|
275
|
+
};
|
|
276
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
260
277
|
const canConnectToExistingChat = async (props, chatSDK, state, dispatch, setAdapter) => {
|
|
261
278
|
var _state$appStates3, _persistedState$domai6, _persistedState$appSt;
|
|
262
279
|
// By pass this function in case of popout chat
|
|
@@ -344,10 +361,8 @@ const checkIfConversationStillValid = async (chatSDK, dispatch, state) => {
|
|
|
344
361
|
var _state$domainStates8, _state$domainStates8$, _state$domainStates9;
|
|
345
362
|
const requestIdFromCache = (_state$domainStates8 = state.domainStates) === null || _state$domainStates8 === void 0 ? void 0 : (_state$domainStates8$ = _state$domainStates8.liveChatContext) === null || _state$domainStates8$ === void 0 ? void 0 : _state$domainStates8$.requestId;
|
|
346
363
|
const liveChatContext = state === null || state === void 0 ? void 0 : (_state$domainStates9 = state.domainStates) === null || _state$domainStates9 === void 0 ? void 0 : _state$domainStates9.liveChatContext;
|
|
347
|
-
|
|
348
364
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
349
365
|
let conversationDetails = undefined;
|
|
350
|
-
|
|
351
366
|
// Preserve current requestId
|
|
352
367
|
const currentRequestId = chatSDK.requestId ?? "";
|
|
353
368
|
dispatch({
|
|
@@ -6,15 +6,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.logWidgetLoadComplete = exports.handleStartChatError = void 0;
|
|
7
7
|
var _omnichannelChatSdk = require("@microsoft/omnichannel-chat-sdk");
|
|
8
8
|
var _TelemetryConstants = require("../../../common/telemetry/TelemetryConstants");
|
|
9
|
-
var
|
|
10
|
-
var _TelemetryManager = require("../../../common/telemetry/TelemetryManager");
|
|
11
|
-
var _ConversationState = require("../../../contexts/common/ConversationState");
|
|
12
|
-
var _LiveChatWidgetActionType = require("../../../contexts/common/LiveChatWidgetActionType");
|
|
9
|
+
var _Constants = require("../../../common/Constants");
|
|
13
10
|
var _endChat = require("./endChat");
|
|
11
|
+
var _ConversationState = require("../../../contexts/common/ConversationState");
|
|
14
12
|
var _DataStoreManager = require("../../../common/contextDataStore/DataStoreManager");
|
|
15
|
-
var
|
|
16
|
-
var _Constants = require("../../../common/Constants");
|
|
13
|
+
var _LiveChatWidgetActionType = require("../../../contexts/common/LiveChatWidgetActionType");
|
|
17
14
|
var _StartChatFailureType = require("../../../contexts/common/StartChatFailureType");
|
|
15
|
+
var _TelemetryHelper = require("../../../common/telemetry/TelemetryHelper");
|
|
16
|
+
var _TelemetryManager = require("../../../common/telemetry/TelemetryManager");
|
|
17
|
+
var _utils = require("../../../common/utils");
|
|
18
18
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
19
|
const handleStartChatError = (dispatch, chatSDK, props, ex, isStartChatSuccessful) => {
|
|
20
20
|
var _props$controlProps;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.updateTelemetryData = void 0;
|
|
7
7
|
var _TelemetryConstants = require("../../../common/telemetry/TelemetryConstants");
|
|
8
8
|
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
9
9
|
var _LiveChatWidgetActionType = require("../../../contexts/common/LiveChatWidgetActionType");
|
|
@@ -11,6 +11,13 @@ var _TelemetryHelper = require("../../../common/telemetry/TelemetryHelper");
|
|
|
11
11
|
var _TelemetryManager = require("../../../common/telemetry/TelemetryManager");
|
|
12
12
|
var _utils = require("../../../common/utils");
|
|
13
13
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
|
+
const updateTelemetryData = async (chatSDK, dispatch) => {
|
|
15
|
+
// load it concurrently, this will reduce the load time
|
|
16
|
+
await Promise.all([updateSessionDataForTelemetry(chatSDK, dispatch), updateConversationDataForTelemetry(chatSDK, dispatch)]);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
|
+
exports.updateTelemetryData = updateTelemetryData;
|
|
14
21
|
const updateSessionDataForTelemetry = async (chatSDK, dispatch) => {
|
|
15
22
|
if (chatSDK) {
|
|
16
23
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -26,12 +33,10 @@ const updateSessionDataForTelemetry = async (chatSDK, dispatch) => {
|
|
|
26
33
|
chatSession
|
|
27
34
|
}
|
|
28
35
|
});
|
|
29
|
-
await updateConversationDataForTelemetry(chatSDK, dispatch);
|
|
30
36
|
}
|
|
31
37
|
};
|
|
32
38
|
|
|
33
39
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
34
|
-
exports.updateSessionDataForTelemetry = updateSessionDataForTelemetry;
|
|
35
40
|
const updateConversationDataForTelemetry = async (chatSDK, dispatch) => {
|
|
36
41
|
if (chatSDK) {
|
|
37
42
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DemoChatAdapter = void 0;
|
|
7
|
+
require("rxjs/add/operator/share");
|
|
8
|
+
require("rxjs/add/observable/of");
|
|
9
|
+
var _Observable = require("rxjs/Observable");
|
|
10
|
+
var _mockadapter = _interopRequireDefault(require("./mockadapter"));
|
|
11
|
+
var _chatAdapterUtils = require("./utils/chatAdapterUtils");
|
|
12
|
+
var _attachmentActivityUtils = require("./utils/attachmentActivityUtils");
|
|
13
|
+
var _MockBotCommand = _interopRequireDefault(require("./MockBotCommand"));
|
|
14
|
+
var _MockBotCardCommandType = _interopRequireDefault(require("./MockBotCardCommandType"));
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
+
class DemoChatAdapter extends _mockadapter.default {
|
|
17
|
+
constructor() {
|
|
18
|
+
super();
|
|
19
|
+
setTimeout(() => {
|
|
20
|
+
(0, _chatAdapterUtils.postSystemMessageActivity)(this.activityObserver, "You're currently using a demo.", 0);
|
|
21
|
+
(0, _chatAdapterUtils.postBotMessageActivity)(this.activityObserver, "Type `/help` to learn more", undefined, 0); // send init message from bot
|
|
22
|
+
}, 1000);
|
|
23
|
+
}
|
|
24
|
+
postBotCommandsActivity() {
|
|
25
|
+
let delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1000;
|
|
26
|
+
(0, _chatAdapterUtils.postBotAttachmentActivity)(this.activityObserver, [{
|
|
27
|
+
contentType: "application/vnd.microsoft.card.thumbnail",
|
|
28
|
+
content: {
|
|
29
|
+
buttons: [{
|
|
30
|
+
title: "Send system message",
|
|
31
|
+
type: "imBack",
|
|
32
|
+
value: "send system message"
|
|
33
|
+
}, {
|
|
34
|
+
title: "Send typing",
|
|
35
|
+
type: "imBack",
|
|
36
|
+
value: "send typing"
|
|
37
|
+
}, {
|
|
38
|
+
title: "Send bot message",
|
|
39
|
+
type: "imBack",
|
|
40
|
+
value: "send bot message"
|
|
41
|
+
}],
|
|
42
|
+
title: "Commands"
|
|
43
|
+
}
|
|
44
|
+
}], delay);
|
|
45
|
+
}
|
|
46
|
+
postActivity(activity) {
|
|
47
|
+
if (activity) {
|
|
48
|
+
(0, _chatAdapterUtils.postEchoActivity)(this.activityObserver, activity, _chatAdapterUtils.customerUser);
|
|
49
|
+
if (activity.text) {
|
|
50
|
+
switch (true) {
|
|
51
|
+
case activity.text === _MockBotCommand.default.Help:
|
|
52
|
+
this.postBotCommandsActivity();
|
|
53
|
+
break;
|
|
54
|
+
case activity.text === _MockBotCommand.default.SendSystemMessage:
|
|
55
|
+
(0, _chatAdapterUtils.postSystemMessageActivity)(this.activityObserver, "Contoso has joined the chat.");
|
|
56
|
+
break;
|
|
57
|
+
case activity.text === _MockBotCommand.default.SendTyping:
|
|
58
|
+
(0, _chatAdapterUtils.postBotTypingActivity)(this.activityObserver);
|
|
59
|
+
break;
|
|
60
|
+
case activity.text === _MockBotCommand.default.SendAttachment:
|
|
61
|
+
(0, _chatAdapterUtils.postBotAttachmentActivity)(this.activityObserver, [(0, _attachmentActivityUtils.createJpgFileAttachment)()]);
|
|
62
|
+
break;
|
|
63
|
+
case activity.text === _MockBotCommand.default.SendBotMessage:
|
|
64
|
+
(0, _chatAdapterUtils.postBotMessageActivity)(this.activityObserver, "Hi, how can I help you?");
|
|
65
|
+
break;
|
|
66
|
+
case activity.text === `${_MockBotCommand.default.Card} ${_MockBotCardCommandType.default.Signin}`:
|
|
67
|
+
(0, _chatAdapterUtils.postBotAttachmentActivity)(this.activityObserver, [(0, _attachmentActivityUtils.createSigninCardAttachment)()]);
|
|
68
|
+
break;
|
|
69
|
+
case activity.text === `${_MockBotCommand.default.Card} ${_MockBotCardCommandType.default.Hero}`:
|
|
70
|
+
(0, _chatAdapterUtils.postBotAttachmentActivity)(this.activityObserver, [(0, _attachmentActivityUtils.createHeroCardAttachment)()]);
|
|
71
|
+
break;
|
|
72
|
+
case activity.text === `${_MockBotCommand.default.Card} ${_MockBotCardCommandType.default.Thumbnail}`:
|
|
73
|
+
(0, _chatAdapterUtils.postBotAttachmentActivity)(this.activityObserver, [(0, _attachmentActivityUtils.createThumbnailCardAttachment)()]);
|
|
74
|
+
break;
|
|
75
|
+
case activity.text.startsWith(`${_MockBotCommand.default.Bot} `):
|
|
76
|
+
(0, _chatAdapterUtils.postBotMessageActivity)(this.activityObserver, activity.text.substring(5));
|
|
77
|
+
break;
|
|
78
|
+
case activity.text.startsWith(`${_MockBotCommand.default.System} `):
|
|
79
|
+
(0, _chatAdapterUtils.postSystemMessageActivity)(this.activityObserver, activity.text.substring(8));
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return _Observable.Observable.of(activity.id || "");
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
exports.DemoChatAdapter = DemoChatAdapter;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DemoChatSDK = void 0;
|
|
7
|
+
var _DemoChatAdapter = require("./DemoChatAdapter");
|
|
8
|
+
var _mockchatsdk = require("./mockchatsdk");
|
|
9
|
+
class DemoChatSDK extends _mockchatsdk.MockChatSDK {
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
}
|
|
13
|
+
createChatAdapter() {
|
|
14
|
+
return new _DemoChatAdapter.DemoChatAdapter();
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.DemoChatSDK = DemoChatSDK;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DesignerChatAdapter = void 0;
|
|
7
|
+
var _Observable = require("rxjs/Observable");
|
|
8
|
+
var _mockadapter = _interopRequireDefault(require("./mockadapter"));
|
|
9
|
+
var _chatAdapterUtils = require("./utils/chatAdapterUtils");
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
class DesignerChatAdapter extends _mockadapter.default {
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
setTimeout(() => {
|
|
15
|
+
(0, _chatAdapterUtils.postBotMessageActivity)(this.activityObserver, "Id venenatis a condimentum vitae?", undefined, 0);
|
|
16
|
+
this.postUserActivity("Diam donec adipiscing tristique risus nec feugiat in fermentum", 0);
|
|
17
|
+
(0, _chatAdapterUtils.postSystemMessageActivity)(this.activityObserver, "We are finding the best agent for your inquiry, please hold ...", 100);
|
|
18
|
+
(0, _chatAdapterUtils.postSystemMessageActivity)(this.activityObserver, "John has joined the chat", 100);
|
|
19
|
+
(0, _chatAdapterUtils.postBotMessageActivity)(this.activityObserver, "Neque viverra justo nec ultrices dui sapien eget mi proin", undefined, 100);
|
|
20
|
+
}, 1000);
|
|
21
|
+
}
|
|
22
|
+
postUserActivity(text) {
|
|
23
|
+
let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
|
|
24
|
+
setTimeout(() => {
|
|
25
|
+
(0, _chatAdapterUtils.postEchoActivity)(this.activityObserver, {
|
|
26
|
+
text,
|
|
27
|
+
from: {
|
|
28
|
+
..._chatAdapterUtils.customerUser
|
|
29
|
+
},
|
|
30
|
+
type: "message"
|
|
31
|
+
}, _chatAdapterUtils.customerUser, 0);
|
|
32
|
+
}, delay);
|
|
33
|
+
}
|
|
34
|
+
postActivity(activity) {
|
|
35
|
+
if (activity) {
|
|
36
|
+
(0, _chatAdapterUtils.postEchoActivity)(this.activityObserver, activity, _chatAdapterUtils.customerUser);
|
|
37
|
+
}
|
|
38
|
+
return _Observable.Observable.of(activity.id || "");
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.DesignerChatAdapter = DesignerChatAdapter;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DesignerChatSDK = void 0;
|
|
7
|
+
var _DesignerChatAdapter = require("./DesignerChatAdapter");
|
|
8
|
+
var _mockchatsdk = require("./mockchatsdk");
|
|
9
|
+
class DesignerChatSDK extends _mockchatsdk.MockChatSDK {
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
}
|
|
13
|
+
createChatAdapter() {
|
|
14
|
+
return new _DesignerChatAdapter.DesignerChatAdapter();
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.DesignerChatSDK = DesignerChatSDK;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var MockBotCardCommandType;
|
|
8
|
+
(function (MockBotCardCommandType) {
|
|
9
|
+
MockBotCardCommandType["Hero"] = "hero";
|
|
10
|
+
MockBotCardCommandType["Signin"] = "signin";
|
|
11
|
+
MockBotCardCommandType["Thumbnail"] = "thumbnail";
|
|
12
|
+
})(MockBotCardCommandType || (MockBotCardCommandType = {}));
|
|
13
|
+
var _default = MockBotCardCommandType;
|
|
14
|
+
exports.default = _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var MockBotCommand;
|
|
8
|
+
(function (MockBotCommand) {
|
|
9
|
+
MockBotCommand["Bot"] = "/bot";
|
|
10
|
+
MockBotCommand["Card"] = "/card";
|
|
11
|
+
MockBotCommand["Help"] = "/help";
|
|
12
|
+
MockBotCommand["SendAttachment"] = "send attachment";
|
|
13
|
+
MockBotCommand["SendBotMessage"] = "send bot message";
|
|
14
|
+
MockBotCommand["SendSystemMessage"] = "send system message";
|
|
15
|
+
MockBotCommand["SendTyping"] = "send typing";
|
|
16
|
+
MockBotCommand["System"] = "/system";
|
|
17
|
+
})(MockBotCommand || (MockBotCommand = {}));
|
|
18
|
+
var _default = MockBotCommand;
|
|
19
|
+
exports.default = _default;
|