@microsoft/omnichannel-chat-sdk 1.11.6 → 1.11.7-main.14ece7b
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/OmnichannelChatSDK.d.ts +9 -1
- package/lib/OmnichannelChatSDK.js +181 -154
- package/lib/OmnichannelChatSDK.js.map +1 -1
- package/lib/config/settings.d.ts +3 -2
- package/lib/config/settings.js +4 -2
- package/lib/config/settings.js.map +1 -1
- package/lib/core/ChatSDKError.d.ts +3 -1
- package/lib/core/ChatSDKError.js +2 -0
- package/lib/core/ChatSDKError.js.map +1 -1
- package/lib/core/GetPersistentChatHistoryOptionalParams.d.ts +10 -0
- package/lib/core/GetPersistentChatHistoryOptionalParams.js +3 -0
- package/lib/core/GetPersistentChatHistoryOptionalParams.js.map +1 -0
- package/lib/core/messaging/OmnichannelMessage.d.ts +6 -0
- package/lib/index.d.ts +2 -2
- package/lib/index.js.map +1 -1
- package/lib/telemetry/TelemetryEvent.d.ts +2 -1
- package/lib/telemetry/TelemetryEvent.js +1 -0
- package/lib/telemetry/TelemetryEvent.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/createOcSDKConfiguration.d.ts +2 -2
- package/lib/utils/createOcSDKConfiguration.js +16 -2
- package/lib/utils/createOcSDKConfiguration.js.map +1 -1
- package/lib/utils/createOmnichannelMessage.js +9 -0
- package/lib/utils/createOmnichannelMessage.js.map +1 -1
- package/lib/utils/exceptionThrowers.d.ts +6 -0
- package/lib/utils/exceptionThrowers.js +8 -2
- package/lib/utils/exceptionThrowers.js.map +1 -1
- package/lib/utils/setOcUserAgent.js +2 -1
- package/lib/utils/setOcUserAgent.js.map +1 -1
- package/lib/utils/version.d.ts +9 -0
- package/lib/utils/version.js +28 -0
- package/lib/utils/version.js.map +1 -0
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ACSClient from "./core/messaging/ACSClient";
|
|
2
2
|
import { VoiceVideoCallingOptionalParams } from "./types/config";
|
|
3
|
-
import { ChatAdapter, GetAgentAvailabilityResponse, GetCurrentLiveChatContextResponse, GetLiveChatTranscriptResponse, GetMessagesResponse, GetPreChatSurveyResponse, GetVoiceVideoCallingResponse, MaskingRules, UploadFileAttachmentResponse } from "./types/response";
|
|
3
|
+
import { ChatAdapter, GetAgentAvailabilityResponse, GetCurrentLiveChatContextResponse, GetLiveChatTranscriptResponse, GetMessagesResponse, GetPersistentChatHistoryResponse, GetPreChatSurveyResponse, GetVoiceVideoCallingResponse, MaskingRules, UploadFileAttachmentResponse } from "./types/response";
|
|
4
4
|
import { ParticipantsRemovedEvent } from '@azure/communication-signaling';
|
|
5
5
|
import ChatAdapterOptionalParams from "./core/messaging/ChatAdapterOptionalParams";
|
|
6
6
|
import ChatConfig from "./core/ChatConfig";
|
|
@@ -21,6 +21,7 @@ import GetChatTokenOptionalParams from "./core/GetChatTokenOptionalParams";
|
|
|
21
21
|
import GetConversationDetailsOptionalParams from "./core/GetConversationDetailsOptionalParams";
|
|
22
22
|
import GetLiveChatConfigOptionalParams from "./core/GetLiveChatConfigOptionalParams";
|
|
23
23
|
import GetLiveChatTranscriptOptionalParams from "./core/GetLiveChatTranscriptOptionalParams";
|
|
24
|
+
import GetPersistentChatHistoryOptionalParams from "./core/GetPersistentChatHistoryOptionalParams";
|
|
24
25
|
import IChatToken from "./external/IC3Adapter/IChatToken";
|
|
25
26
|
import IFileInfo from "@microsoft/omnichannel-ic3core/lib/interfaces/IFileInfo";
|
|
26
27
|
import IFileMetadata from "@microsoft/omnichannel-ic3core/lib/model/IFileMetadata";
|
|
@@ -83,6 +84,7 @@ declare class OmnichannelChatSDK {
|
|
|
83
84
|
private debugAMS;
|
|
84
85
|
private debugACS;
|
|
85
86
|
private detailedDebugEnabled;
|
|
87
|
+
private regexCompiledForDataMasking;
|
|
86
88
|
constructor(omnichannelConfig: OmnichannelConfig, chatSDKConfig?: ChatSDKConfig);
|
|
87
89
|
/**
|
|
88
90
|
* Executes an operation with mutual exclusion to prevent race conditions
|
|
@@ -164,6 +166,7 @@ declare class OmnichannelChatSDK {
|
|
|
164
166
|
private getIC3Client;
|
|
165
167
|
private setPrechatConfigurations;
|
|
166
168
|
private setDataMaskingConfiguration;
|
|
169
|
+
private compileDataMaskingRegex;
|
|
167
170
|
private setAuthSettingConfig;
|
|
168
171
|
private setPersistentChatConfiguration;
|
|
169
172
|
private setLocaleIdConfiguration;
|
|
@@ -186,5 +189,10 @@ declare class OmnichannelChatSDK {
|
|
|
186
189
|
* @private
|
|
187
190
|
*/
|
|
188
191
|
private handleConversationJoinFailure;
|
|
192
|
+
/**
|
|
193
|
+
* Get persistent chat history for authenticated users.
|
|
194
|
+
* @param getPersistentChatHistoryOptionalParams Optional parameters for persistent chat history retrieval.
|
|
195
|
+
*/
|
|
196
|
+
getPersistentChatHistory(getPersistentChatHistoryOptionalParams?: GetPersistentChatHistoryOptionalParams): Promise<GetPersistentChatHistoryResponse | undefined>;
|
|
189
197
|
}
|
|
190
198
|
export default OmnichannelChatSDK;
|
|
@@ -105,7 +105,6 @@ var loggerUtils_1 = require("./utils/loggerUtils");
|
|
|
105
105
|
var parsers_1 = require("./utils/parsers");
|
|
106
106
|
var platform_1 = require("./utils/platform");
|
|
107
107
|
var retrieveCollectorUri_1 = require("./telemetry/retrieveCollectorUri");
|
|
108
|
-
var setOcUserAgent_1 = require("./utils/setOcUserAgent");
|
|
109
108
|
var startPolling_1 = require("./commands/startPolling");
|
|
110
109
|
var stopPolling_1 = require("./commands/stopPolling");
|
|
111
110
|
var urlResolvers_1 = require("./utils/urlResolvers");
|
|
@@ -150,6 +149,7 @@ var OmnichannelChatSDK = /** @class */ (function () {
|
|
|
150
149
|
this.debugAMS = false;
|
|
151
150
|
this.debugACS = false;
|
|
152
151
|
this.detailedDebugEnabled = false;
|
|
152
|
+
this.regexCompiledForDataMasking = [];
|
|
153
153
|
this.populateInitChatOptionalParam = function (requestOptionalParams, optionalParams, telemetryEvent) {
|
|
154
154
|
requestOptionalParams.initContext.locale = (0, locale_1.getLocaleStringFromId)(_this.localeId);
|
|
155
155
|
if (optionalParams === null || optionalParams === void 0 ? void 0 : optionalParams.customContext) {
|
|
@@ -551,10 +551,9 @@ var OmnichannelChatSDK = /** @class */ (function () {
|
|
|
551
551
|
_j.trys.push([1, 3, , 4]);
|
|
552
552
|
this.OCSDKProvider = ocsdk_1.SDKProvider;
|
|
553
553
|
_a = this;
|
|
554
|
-
return [4 /*yield*/, ocsdk_1.SDKProvider.getSDK(this.omnichannelConfig, (0, createOcSDKConfiguration_1.default)(useCoreServices), this.ocSdkLogger)];
|
|
554
|
+
return [4 /*yield*/, ocsdk_1.SDKProvider.getSDK(this.omnichannelConfig, (0, createOcSDKConfiguration_1.default)(useCoreServices, (_d = this.chatSDKConfig) === null || _d === void 0 ? void 0 : _d.ocUserAgent), this.ocSdkLogger)];
|
|
555
555
|
case 2:
|
|
556
556
|
_a.OCClient = _j.sent();
|
|
557
|
-
(0, setOcUserAgent_1.default)(this.OCClient, (_d = this.chatSDKConfig) === null || _d === void 0 ? void 0 : _d.ocUserAgent);
|
|
558
557
|
return [3 /*break*/, 4];
|
|
559
558
|
case 3:
|
|
560
559
|
e_2 = _j.sent();
|
|
@@ -657,8 +656,7 @@ var OmnichannelChatSDK = /** @class */ (function () {
|
|
|
657
656
|
useCoreServices = (0, CoreServicesUtils_1.isCoreServicesOrgUrl)(this.omnichannelConfig.orgUrl);
|
|
658
657
|
try {
|
|
659
658
|
this.OCSDKProvider = ocsdk_1.SDKProvider;
|
|
660
|
-
this.OCClient = ocsdk_1.SDKProvider.getSDK(this.omnichannelConfig, (0, createOcSDKConfiguration_1.default)(useCoreServices), this.ocSdkLogger);
|
|
661
|
-
(0, setOcUserAgent_1.default)(this.OCClient, (_a = this.chatSDKConfig) === null || _a === void 0 ? void 0 : _a.ocUserAgent);
|
|
659
|
+
this.OCClient = ocsdk_1.SDKProvider.getSDK(this.omnichannelConfig, (0, createOcSDKConfiguration_1.default)(useCoreServices, (_a = this.chatSDKConfig) === null || _a === void 0 ? void 0 : _a.ocUserAgent), this.ocSdkLogger);
|
|
662
660
|
}
|
|
663
661
|
catch (e) {
|
|
664
662
|
exceptionThrowers_1.default.throwOmnichannelClientInitializationFailure(e, this.scenarioMarker, TelemetryEvent_1.default.InitializeLoadChatConfig);
|
|
@@ -1204,13 +1202,24 @@ var OmnichannelChatSDK = /** @class */ (function () {
|
|
|
1204
1202
|
case 26:
|
|
1205
1203
|
if (this.isPersistentChat && !((_l = this.chatSDKConfig.persistentChat) === null || _l === void 0 ? void 0 : _l.disable)) {
|
|
1206
1204
|
this.refreshTokenTimer = setInterval(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
1205
|
+
var error_13;
|
|
1207
1206
|
return __generator(this, function (_a) {
|
|
1208
1207
|
switch (_a.label) {
|
|
1209
|
-
case 0:
|
|
1208
|
+
case 0:
|
|
1209
|
+
_a.trys.push([0, 2, , 3]);
|
|
1210
|
+
return [4 /*yield*/, this.getChatToken(false)];
|
|
1210
1211
|
case 1:
|
|
1211
1212
|
_a.sent();
|
|
1212
1213
|
this.updateChatToken(this.chatToken.token, this.chatToken.regionGTMS);
|
|
1213
|
-
return [
|
|
1214
|
+
return [3 /*break*/, 3];
|
|
1215
|
+
case 2:
|
|
1216
|
+
error_13 = _a.sent();
|
|
1217
|
+
if (this.refreshTokenTimer !== null) {
|
|
1218
|
+
clearInterval(this.refreshTokenTimer);
|
|
1219
|
+
this.refreshTokenTimer = null;
|
|
1220
|
+
}
|
|
1221
|
+
return [3 /*break*/, 3];
|
|
1222
|
+
case 3: return [2 /*return*/];
|
|
1214
1223
|
}
|
|
1215
1224
|
});
|
|
1216
1225
|
}); }, (_m = this.chatSDKConfig.persistentChat) === null || _m === void 0 ? void 0 : _m.tokenUpdateTime);
|
|
@@ -1222,7 +1231,7 @@ var OmnichannelChatSDK = /** @class */ (function () {
|
|
|
1222
1231
|
};
|
|
1223
1232
|
OmnichannelChatSDK.prototype.closeChat = function (endChatOptionalParams) {
|
|
1224
1233
|
return __awaiter(this, void 0, void 0, function () {
|
|
1225
|
-
var cleanupMetadata, sessionCloseOptionalParams, isReconnectChat, isChatReconnect,
|
|
1234
|
+
var cleanupMetadata, sessionCloseOptionalParams, isReconnectChat, isChatReconnect, error_14;
|
|
1226
1235
|
var _a, _b;
|
|
1227
1236
|
return __generator(this, function (_c) {
|
|
1228
1237
|
switch (_c.label) {
|
|
@@ -1257,8 +1266,8 @@ var OmnichannelChatSDK = /** @class */ (function () {
|
|
|
1257
1266
|
_c.sent();
|
|
1258
1267
|
return [3 /*break*/, 4];
|
|
1259
1268
|
case 3:
|
|
1260
|
-
|
|
1261
|
-
exceptionThrowers_1.default.throwConversationClosureFailure(
|
|
1269
|
+
error_14 = _c.sent();
|
|
1270
|
+
exceptionThrowers_1.default.throwConversationClosureFailure(error_14, this.scenarioMarker, TelemetryEvent_1.default.CloseChatSession, __assign(__assign({}, cleanupMetadata), { isSessionEnded: String(!(endChatOptionalParams === null || endChatOptionalParams === void 0 ? void 0 : endChatOptionalParams.isSessionEnded)) }));
|
|
1262
1271
|
return [3 /*break*/, 4];
|
|
1263
1272
|
case 4:
|
|
1264
1273
|
this.scenarioMarker.completeScenario(TelemetryEvent_1.default.CloseChatSession, cleanupMetadata);
|
|
@@ -1279,7 +1288,7 @@ var OmnichannelChatSDK = /** @class */ (function () {
|
|
|
1279
1288
|
};
|
|
1280
1289
|
OmnichannelChatSDK.prototype.internalEndChat = function () {
|
|
1281
1290
|
return __awaiter(this, arguments, void 0, function (endChatOptionalParams) {
|
|
1282
|
-
var cleanupMetadata,
|
|
1291
|
+
var cleanupMetadata, error_15, telemetryData;
|
|
1283
1292
|
var _a;
|
|
1284
1293
|
if (endChatOptionalParams === void 0) { endChatOptionalParams = {}; }
|
|
1285
1294
|
return __generator(this, function (_b) {
|
|
@@ -1329,15 +1338,15 @@ var OmnichannelChatSDK = /** @class */ (function () {
|
|
|
1329
1338
|
this.scenarioMarker.completeScenario(TelemetryEvent_1.default.EndChat, cleanupMetadata);
|
|
1330
1339
|
return [3 /*break*/, 7];
|
|
1331
1340
|
case 6:
|
|
1332
|
-
|
|
1341
|
+
error_15 = _b.sent();
|
|
1333
1342
|
telemetryData = {
|
|
1334
1343
|
RequestId: this.requestId,
|
|
1335
1344
|
ChatId: this.chatToken.chatId
|
|
1336
1345
|
};
|
|
1337
|
-
if (
|
|
1338
|
-
exceptionThrowers_1.default.throwConversationClosureFailure(new Error(JSON.stringify(
|
|
1346
|
+
if (error_15 instanceof ChatSDKError_1.ChatSDKError) {
|
|
1347
|
+
exceptionThrowers_1.default.throwConversationClosureFailure(new Error(JSON.stringify(error_15.exceptionDetails)), this.scenarioMarker, TelemetryEvent_1.default.EndChat, telemetryData);
|
|
1339
1348
|
}
|
|
1340
|
-
exceptionThrowers_1.default.throwConversationClosureFailure(
|
|
1349
|
+
exceptionThrowers_1.default.throwConversationClosureFailure(error_15, this.scenarioMarker, TelemetryEvent_1.default.EndChat, telemetryData);
|
|
1341
1350
|
return [3 /*break*/, 7];
|
|
1342
1351
|
case 7: return [2 /*return*/];
|
|
1343
1352
|
}
|
|
@@ -1384,7 +1393,7 @@ var OmnichannelChatSDK = /** @class */ (function () {
|
|
|
1384
1393
|
};
|
|
1385
1394
|
OmnichannelChatSDK.prototype.getConversationDetails = function () {
|
|
1386
1395
|
return __awaiter(this, arguments, void 0, function (optionalParams) {
|
|
1387
|
-
var requestId, chatToken, chatId, reconnectId, sessionId, getLWIDetailsOptionalParams, lwiDetails, state, conversationId, agentAcceptedOn, canRenderPostChat, participantType, liveWorkItemDetails,
|
|
1396
|
+
var requestId, chatToken, chatId, reconnectId, sessionId, getLWIDetailsOptionalParams, lwiDetails, state, conversationId, agentAcceptedOn, canRenderPostChat, participantType, liveWorkItemDetails, error_16, telemetryData;
|
|
1388
1397
|
var _a, _b, _c, _d;
|
|
1389
1398
|
if (optionalParams === void 0) { optionalParams = {}; }
|
|
1390
1399
|
return __generator(this, function (_e) {
|
|
@@ -1457,15 +1466,15 @@ var OmnichannelChatSDK = /** @class */ (function () {
|
|
|
1457
1466
|
});
|
|
1458
1467
|
return [2 /*return*/, liveWorkItemDetails];
|
|
1459
1468
|
case 3:
|
|
1460
|
-
|
|
1469
|
+
error_16 = _e.sent();
|
|
1461
1470
|
telemetryData = {
|
|
1462
1471
|
RequestId: requestId,
|
|
1463
1472
|
ChatId: chatId
|
|
1464
1473
|
};
|
|
1465
|
-
if ((0, utilities_1.isClientIdNotFoundErrorMessage)(
|
|
1466
|
-
exceptionThrowers_1.default.throwAuthContactIdNotFoundFailure(
|
|
1474
|
+
if ((0, utilities_1.isClientIdNotFoundErrorMessage)(error_16)) {
|
|
1475
|
+
exceptionThrowers_1.default.throwAuthContactIdNotFoundFailure(error_16, this.scenarioMarker, TelemetryEvent_1.default.GetConversationDetails, telemetryData);
|
|
1467
1476
|
}
|
|
1468
|
-
exceptionSuppressors_1.default.suppressConversationDetailsRetrievalFailure(
|
|
1477
|
+
exceptionSuppressors_1.default.suppressConversationDetailsRetrievalFailure(error_16, this.scenarioMarker, TelemetryEvent_1.default.GetConversationDetails, telemetryData);
|
|
1469
1478
|
return [3 /*break*/, 4];
|
|
1470
1479
|
case 4: return [2 /*return*/, {}];
|
|
1471
1480
|
}
|
|
@@ -1506,7 +1515,7 @@ var OmnichannelChatSDK = /** @class */ (function () {
|
|
|
1506
1515
|
};
|
|
1507
1516
|
OmnichannelChatSDK.prototype.getChatToken = function () {
|
|
1508
1517
|
return __awaiter(this, arguments, void 0, function (cached, optionalParams) {
|
|
1509
|
-
var getChatTokenOptionalParams, chatToken,
|
|
1518
|
+
var getChatTokenOptionalParams, chatToken, error_17, telemetryData;
|
|
1510
1519
|
var _a, _b, _c;
|
|
1511
1520
|
if (cached === void 0) { cached = true; }
|
|
1512
1521
|
return __generator(this, function (_d) {
|
|
@@ -1548,16 +1557,16 @@ var OmnichannelChatSDK = /** @class */ (function () {
|
|
|
1548
1557
|
});
|
|
1549
1558
|
return [3 /*break*/, 4];
|
|
1550
1559
|
case 3:
|
|
1551
|
-
|
|
1560
|
+
error_17 = _d.sent();
|
|
1552
1561
|
telemetryData = {
|
|
1553
1562
|
RequestId: this.requestId,
|
|
1554
1563
|
ChatId: (_c = this.chatToken) === null || _c === void 0 ? void 0 : _c.chatId,
|
|
1555
1564
|
};
|
|
1556
|
-
if ((0, utilities_1.isClientIdNotFoundErrorMessage)(
|
|
1557
|
-
exceptionThrowers_1.default.throwAuthContactIdNotFoundFailure(
|
|
1565
|
+
if ((0, utilities_1.isClientIdNotFoundErrorMessage)(error_17)) {
|
|
1566
|
+
exceptionThrowers_1.default.throwAuthContactIdNotFoundFailure(error_17, this.scenarioMarker, TelemetryEvent_1.default.GetChatToken, telemetryData);
|
|
1558
1567
|
}
|
|
1559
1568
|
else {
|
|
1560
|
-
exceptionThrowers_1.default.throwChatTokenRetrievalFailure(
|
|
1569
|
+
exceptionThrowers_1.default.throwChatTokenRetrievalFailure(error_17, this.scenarioMarker, TelemetryEvent_1.default.GetChatToken, telemetryData);
|
|
1561
1570
|
}
|
|
1562
1571
|
return [3 /*break*/, 4];
|
|
1563
1572
|
case 4: return [3 /*break*/, 6];
|
|
@@ -1687,21 +1696,36 @@ var OmnichannelChatSDK = /** @class */ (function () {
|
|
|
1687
1696
|
}
|
|
1688
1697
|
var content = message.content;
|
|
1689
1698
|
var match;
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1699
|
+
if (this.regexCompiledForDataMasking.length === 0) {
|
|
1700
|
+
return message;
|
|
1701
|
+
}
|
|
1702
|
+
for (var _i = 0, _a = this.regexCompiledForDataMasking; _i < _a.length; _i++) {
|
|
1703
|
+
var regex = _a[_i];
|
|
1704
|
+
try {
|
|
1705
|
+
var lastIndex = -1;
|
|
1706
|
+
while ((match = regex.exec(content)) !== null) {
|
|
1707
|
+
// Prevent infinite loop from zero-width matches
|
|
1708
|
+
if (regex.lastIndex === lastIndex) {
|
|
1709
|
+
this.debug && console.warn("[OmnichannelChatSDK][transformMessage] Data masking regex caused zero-width match, skipping rule ".concat(regex));
|
|
1710
|
+
break;
|
|
1711
|
+
}
|
|
1712
|
+
lastIndex = regex.lastIndex;
|
|
1713
|
+
var replaceStr = match[0].replace(/./g, this.maskingCharacter);
|
|
1714
|
+
content = content.replace(match[0], replaceStr);
|
|
1715
|
+
}
|
|
1716
|
+
match = null;
|
|
1717
|
+
}
|
|
1718
|
+
catch (error) {
|
|
1719
|
+
// Log error for invalid regex but continue processing other rules
|
|
1720
|
+
this.debug && console.error("[OmnichannelChatSDK][transformMessage] Data masking regex failed for rule ".concat(regex, ": ").concat(error));
|
|
1696
1721
|
}
|
|
1697
|
-
match = null;
|
|
1698
1722
|
}
|
|
1699
1723
|
message.content = content;
|
|
1700
1724
|
return message;
|
|
1701
1725
|
};
|
|
1702
1726
|
OmnichannelChatSDK.prototype.sendMessage = function (message) {
|
|
1703
1727
|
return __awaiter(this, void 0, void 0, function () {
|
|
1704
|
-
var sendMessageRequest, chatMessage,
|
|
1728
|
+
var sendMessageRequest, chatMessage, error_18, exceptionDetails;
|
|
1705
1729
|
var _a;
|
|
1706
1730
|
return __generator(this, function (_b) {
|
|
1707
1731
|
switch (_b.label) {
|
|
@@ -1714,7 +1738,6 @@ var OmnichannelChatSDK = /** @class */ (function () {
|
|
|
1714
1738
|
exceptionThrowers_1.default.throwUninitializedChatSDK(this.scenarioMarker, TelemetryEvent_1.default.SendMessages);
|
|
1715
1739
|
}
|
|
1716
1740
|
this.transformMessage(message);
|
|
1717
|
-
if (!(this.liveChatVersion === LiveChatVersion_1.default.V2)) return [3 /*break*/, 5];
|
|
1718
1741
|
sendMessageRequest = {
|
|
1719
1742
|
content: message.content,
|
|
1720
1743
|
};
|
|
@@ -1737,10 +1760,10 @@ var OmnichannelChatSDK = /** @class */ (function () {
|
|
|
1737
1760
|
});
|
|
1738
1761
|
return [2 /*return*/, chatMessage];
|
|
1739
1762
|
case 3:
|
|
1740
|
-
|
|
1763
|
+
error_18 = _b.sent();
|
|
1741
1764
|
exceptionDetails = {
|
|
1742
1765
|
response: ChatSDKError_1.ChatSDKErrorName.ChatSDKSendMessageFailed,
|
|
1743
|
-
errorObject: "".concat(
|
|
1766
|
+
errorObject: "".concat(error_18)
|
|
1744
1767
|
};
|
|
1745
1768
|
this.scenarioMarker.failScenario(TelemetryEvent_1.default.SendMessages, {
|
|
1746
1769
|
RequestId: this.requestId,
|
|
@@ -1748,55 +1771,10 @@ var OmnichannelChatSDK = /** @class */ (function () {
|
|
|
1748
1771
|
ExceptionDetails: JSON.stringify(exceptionDetails)
|
|
1749
1772
|
});
|
|
1750
1773
|
throw new ChatSDKError_1.ChatSDKError(ChatSDKError_1.ChatSDKErrorName.ChatSDKSendMessageFailed, undefined, {
|
|
1751
|
-
response: ChatSDKError_1.ChatSDKErrorName.ChatSDKSendMessageFailed,
|
|
1752
|
-
errorObject: "".concat(error_17)
|
|
1753
|
-
});
|
|
1754
|
-
case 4: return [3 /*break*/, 9];
|
|
1755
|
-
case 5:
|
|
1756
|
-
messageToSend = {
|
|
1757
|
-
content: message.content,
|
|
1758
|
-
timestamp: new Date(),
|
|
1759
|
-
contentType: MessageContentType_1.default.Text,
|
|
1760
|
-
deliveryMode: DeliveryMode_1.default.Bridged,
|
|
1761
|
-
messageType: MessageType_1.default.UserMessage,
|
|
1762
|
-
properties: undefined,
|
|
1763
|
-
tags: __spreadArray([], MessageTags_1.defaultMessageTags, true),
|
|
1764
|
-
sender: {
|
|
1765
|
-
displayName: "Customer",
|
|
1766
|
-
id: "customer",
|
|
1767
|
-
type: PersonType_1.default.User
|
|
1768
|
-
}
|
|
1769
|
-
};
|
|
1770
|
-
if (message.tags) {
|
|
1771
|
-
messageToSend.tags = message.tags;
|
|
1772
|
-
}
|
|
1773
|
-
if (message.timestamp) {
|
|
1774
|
-
messageToSend.timestamp = message.timestamp;
|
|
1775
|
-
}
|
|
1776
|
-
_b.label = 6;
|
|
1777
|
-
case 6:
|
|
1778
|
-
_b.trys.push([6, 8, , 9]);
|
|
1779
|
-
return [4 /*yield*/, this.conversation.sendMessage(messageToSend)];
|
|
1780
|
-
case 7:
|
|
1781
|
-
_b.sent();
|
|
1782
|
-
this.scenarioMarker.completeScenario(TelemetryEvent_1.default.SendMessages, {
|
|
1783
|
-
RequestId: this.requestId,
|
|
1784
|
-
ChatId: this.chatToken.chatId
|
|
1785
|
-
});
|
|
1786
|
-
return [3 /*break*/, 9];
|
|
1787
|
-
case 8:
|
|
1788
|
-
error_18 = _b.sent();
|
|
1789
|
-
exceptionDetails = {
|
|
1790
1774
|
response: ChatSDKError_1.ChatSDKErrorName.ChatSDKSendMessageFailed,
|
|
1791
1775
|
errorObject: "".concat(error_18)
|
|
1792
|
-
};
|
|
1793
|
-
this.scenarioMarker.failScenario(TelemetryEvent_1.default.SendMessages, {
|
|
1794
|
-
RequestId: this.requestId,
|
|
1795
|
-
ChatId: this.chatToken.chatId,
|
|
1796
|
-
ExceptionDetails: JSON.stringify(exceptionDetails)
|
|
1797
1776
|
});
|
|
1798
|
-
|
|
1799
|
-
case 9: return [2 /*return*/];
|
|
1777
|
+
case 4: return [2 /*return*/];
|
|
1800
1778
|
}
|
|
1801
1779
|
});
|
|
1802
1780
|
});
|
|
@@ -1847,12 +1825,17 @@ var OmnichannelChatSDK = /** @class */ (function () {
|
|
|
1847
1825
|
}
|
|
1848
1826
|
(_b = this.conversation) === null || _b === void 0 ? void 0 : _b.registerOnNewMessage(function (event) {
|
|
1849
1827
|
var id = event.id;
|
|
1828
|
+
var isChatMessageEditedEvent = Object.keys(event).includes("editedOn");
|
|
1829
|
+
console.log("[OmnichannelChatSDK][onNewMessage] New message received", event);
|
|
1830
|
+
console.log("[OmnichannelChatSDK][onNewMessage] isChatMessageEditedEvent=>", isChatMessageEditedEvent);
|
|
1850
1831
|
var omnichannelMessage = (0, createOmnichannelMessage_1.default)(event, {
|
|
1851
1832
|
liveChatVersion: _this.liveChatVersion,
|
|
1852
1833
|
debug: (_this.detailedDebugEnabled ? _this.debugACS : _this.debug),
|
|
1853
1834
|
});
|
|
1854
|
-
|
|
1835
|
+
// send callback for new messages or edited existent messages
|
|
1836
|
+
if (!postedMessages_1.has(id) || isChatMessageEditedEvent) {
|
|
1855
1837
|
onNewMessageCallback(omnichannelMessage);
|
|
1838
|
+
console.log("[OmnichannelChatSDK][onNewMessage] Message posted");
|
|
1856
1839
|
postedMessages_1.add(id);
|
|
1857
1840
|
}
|
|
1858
1841
|
}, registerOnNewMessageOptionalParams);
|
|
@@ -1972,8 +1955,7 @@ var OmnichannelChatSDK = /** @class */ (function () {
|
|
|
1972
1955
|
OmnichannelChatSDK.prototype.onAgentEndSession = function (onAgentEndSessionCallback) {
|
|
1973
1956
|
return __awaiter(this, void 0, void 0, function () {
|
|
1974
1957
|
var _this = this;
|
|
1975
|
-
|
|
1976
|
-
return __generator(this, function (_b) {
|
|
1958
|
+
return __generator(this, function (_a) {
|
|
1977
1959
|
this.scenarioMarker.startScenario(TelemetryEvent_1.default.OnAgentEndSession, {
|
|
1978
1960
|
RequestId: this.requestId,
|
|
1979
1961
|
ChatId: this.chatToken.chatId
|
|
@@ -1981,59 +1963,32 @@ var OmnichannelChatSDK = /** @class */ (function () {
|
|
|
1981
1963
|
if (!this.isInitialized) {
|
|
1982
1964
|
exceptionThrowers_1.default.throwUninitializedChatSDK(this.scenarioMarker, TelemetryEvent_1.default.OnAgentEndSession);
|
|
1983
1965
|
}
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
return [2 /*return*/];
|
|
1998
|
-
}
|
|
1999
|
-
});
|
|
2000
|
-
}); });
|
|
2001
|
-
this.scenarioMarker.completeScenario(TelemetryEvent_1.default.OnAgentEndSession, {
|
|
2002
|
-
RequestId: this.requestId,
|
|
2003
|
-
ChatId: this.chatToken.chatId
|
|
2004
|
-
});
|
|
2005
|
-
}
|
|
2006
|
-
catch (error) {
|
|
2007
|
-
this.scenarioMarker.failScenario(TelemetryEvent_1.default.OnAgentEndSession, {
|
|
2008
|
-
RequestId: this.requestId,
|
|
2009
|
-
ChatId: this.chatToken.chatId
|
|
2010
|
-
});
|
|
2011
|
-
}
|
|
2012
|
-
}
|
|
2013
|
-
else {
|
|
2014
|
-
try {
|
|
2015
|
-
(_a = this.conversation) === null || _a === void 0 ? void 0 : _a.registerOnThreadUpdate(function (message) {
|
|
2016
|
-
var members = message.members;
|
|
2017
|
-
// Agent ending conversation would have 1 member left in the chat thread
|
|
2018
|
-
if (members.length === 1) {
|
|
2019
|
-
onAgentEndSessionCallback(message);
|
|
2020
|
-
if (_this.refreshTokenTimer !== null) {
|
|
2021
|
-
clearInterval(_this.refreshTokenTimer);
|
|
2022
|
-
_this.refreshTokenTimer = null;
|
|
2023
|
-
}
|
|
1966
|
+
try {
|
|
1967
|
+
this.conversation.registerOnThreadUpdate(function (event) { return __awaiter(_this, void 0, void 0, function () {
|
|
1968
|
+
var liveWorkItemDetails;
|
|
1969
|
+
return __generator(this, function (_a) {
|
|
1970
|
+
switch (_a.label) {
|
|
1971
|
+
case 0: return [4 /*yield*/, this.getConversationDetails()];
|
|
1972
|
+
case 1:
|
|
1973
|
+
liveWorkItemDetails = _a.sent();
|
|
1974
|
+
if (Object.keys(liveWorkItemDetails).length === 0 || liveWorkItemDetails.state == LiveWorkItemState_1.default.WrapUp || liveWorkItemDetails.state == LiveWorkItemState_1.default.Closed) {
|
|
1975
|
+
onAgentEndSessionCallback(event);
|
|
1976
|
+
this.stopPolling();
|
|
1977
|
+
}
|
|
1978
|
+
return [2 /*return*/];
|
|
2024
1979
|
}
|
|
2025
1980
|
});
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
}
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
}
|
|
1981
|
+
}); });
|
|
1982
|
+
this.scenarioMarker.completeScenario(TelemetryEvent_1.default.OnAgentEndSession, {
|
|
1983
|
+
RequestId: this.requestId,
|
|
1984
|
+
ChatId: this.chatToken.chatId
|
|
1985
|
+
});
|
|
1986
|
+
}
|
|
1987
|
+
catch (error) {
|
|
1988
|
+
this.scenarioMarker.failScenario(TelemetryEvent_1.default.OnAgentEndSession, {
|
|
1989
|
+
RequestId: this.requestId,
|
|
1990
|
+
ChatId: this.chatToken.chatId
|
|
1991
|
+
});
|
|
2037
1992
|
}
|
|
2038
1993
|
return [2 /*return*/];
|
|
2039
1994
|
});
|
|
@@ -2486,7 +2441,7 @@ var OmnichannelChatSDK = /** @class */ (function () {
|
|
|
2486
2441
|
};
|
|
2487
2442
|
OmnichannelChatSDK.prototype.getPostChatSurveyContext = function () {
|
|
2488
2443
|
return __awaiter(this, void 0, void 0, function () {
|
|
2489
|
-
var conversationId, chatConfig, liveWSAndLiveChatEngJoin, msdyn_postconversationsurveyenable, msfp_sourcesurveyidentifier, msfp_botsourcesurveyidentifier, postConversationSurveyOwnerId, postConversationBotSurveyOwnerId, msdyn_surveyprovider, surveyProvider, liveWorkItemDetails, participantJoined, participantType, agentSurveyInviteLinkRequest, botSurveyInviteLinkRequest, optionalParams, agentSurveyInviteLinkResponse, botSurveyInviteLinkResponse,
|
|
2444
|
+
var conversationId, chatConfig, liveWSAndLiveChatEngJoin, msdyn_postconversationsurveyenable, msfp_sourcesurveyidentifier, msfp_botsourcesurveyidentifier, postConversationSurveyOwnerId, postConversationBotSurveyOwnerId, msdyn_surveyprovider, surveyProvider, liveWorkItemDetails, participantJoined, participantType, agentSurveyInviteLinkRequest, botSurveyInviteLinkRequest, optionalParams, _a, agentSurveyInviteLinkResponse, botSurveyInviteLinkResponse, agentSurveyInviteLink, agentFormsProLocale, botSurveyInviteLink, botFormsProLocale, postChatContext, ex_1;
|
|
2490
2445
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
2491
2446
|
return __generator(this, function (_o) {
|
|
2492
2447
|
switch (_o.label) {
|
|
@@ -2500,7 +2455,7 @@ var OmnichannelChatSDK = /** @class */ (function () {
|
|
|
2500
2455
|
}
|
|
2501
2456
|
_o.label = 1;
|
|
2502
2457
|
case 1:
|
|
2503
|
-
_o.trys.push([1,
|
|
2458
|
+
_o.trys.push([1, 6, , 7]);
|
|
2504
2459
|
chatConfig = this.liveChatConfig;
|
|
2505
2460
|
liveWSAndLiveChatEngJoin = chatConfig.LiveWSAndLiveChatEngJoin;
|
|
2506
2461
|
msdyn_postconversationsurveyenable = liveWSAndLiveChatEngJoin.msdyn_postconversationsurveyenable, msfp_sourcesurveyidentifier = liveWSAndLiveChatEngJoin.msfp_sourcesurveyidentifier, msfp_botsourcesurveyidentifier = liveWSAndLiveChatEngJoin.msfp_botsourcesurveyidentifier, postConversationSurveyOwnerId = liveWSAndLiveChatEngJoin.postConversationSurveyOwnerId, postConversationBotSurveyOwnerId = liveWSAndLiveChatEngJoin.postConversationBotSurveyOwnerId, msdyn_surveyprovider = liveWSAndLiveChatEngJoin.msdyn_surveyprovider;
|
|
@@ -2513,7 +2468,7 @@ var OmnichannelChatSDK = /** @class */ (function () {
|
|
|
2513
2468
|
});
|
|
2514
2469
|
return [2 /*return*/, Promise.reject("GetPostChatSurveyContext : msfp_sourcesurveyidentifier is mandatory for survey provider ".concat(SurveyProvider_1.SurveyProvider.CustomerVoice, "."))];
|
|
2515
2470
|
}
|
|
2516
|
-
if (!((0, parsers_1.parseLowerCaseString)(msdyn_postconversationsurveyenable) === "true")) return [3 /*break*/,
|
|
2471
|
+
if (!((0, parsers_1.parseLowerCaseString)(msdyn_postconversationsurveyenable) === "true")) return [3 /*break*/, 4];
|
|
2517
2472
|
return [4 /*yield*/, this.getConversationDetails()];
|
|
2518
2473
|
case 2:
|
|
2519
2474
|
liveWorkItemDetails = _o.sent();
|
|
@@ -2556,17 +2511,14 @@ var OmnichannelChatSDK = /** @class */ (function () {
|
|
|
2556
2511
|
if (this.authenticatedUserToken) {
|
|
2557
2512
|
optionalParams.authenticatedUserToken = this.authenticatedUserToken;
|
|
2558
2513
|
}
|
|
2559
|
-
return [4 /*yield*/,
|
|
2514
|
+
return [4 /*yield*/, Promise.all([
|
|
2515
|
+
this.OCClient.getSurveyInviteLink(postConversationSurveyOwnerId, agentSurveyInviteLinkRequest, optionalParams),
|
|
2516
|
+
(postConversationBotSurveyOwnerId && msfp_botsourcesurveyidentifier)
|
|
2517
|
+
? this.OCClient.getSurveyInviteLink(postConversationBotSurveyOwnerId, botSurveyInviteLinkRequest, optionalParams)
|
|
2518
|
+
: Promise.resolve(null)
|
|
2519
|
+
])];
|
|
2560
2520
|
case 3:
|
|
2561
|
-
|
|
2562
|
-
_a = postConversationBotSurveyOwnerId && msfp_botsourcesurveyidentifier;
|
|
2563
|
-
if (!_a) return [3 /*break*/, 5];
|
|
2564
|
-
return [4 /*yield*/, this.OCClient.getSurveyInviteLink(postConversationBotSurveyOwnerId, botSurveyInviteLinkRequest, optionalParams)];
|
|
2565
|
-
case 4:
|
|
2566
|
-
_a = (_o.sent());
|
|
2567
|
-
_o.label = 5;
|
|
2568
|
-
case 5:
|
|
2569
|
-
botSurveyInviteLinkResponse = _a;
|
|
2521
|
+
_a = _o.sent(), agentSurveyInviteLinkResponse = _a[0], botSurveyInviteLinkResponse = _a[1];
|
|
2570
2522
|
agentSurveyInviteLink = void 0, agentFormsProLocale = void 0, botSurveyInviteLink = void 0, botFormsProLocale = void 0;
|
|
2571
2523
|
if (agentSurveyInviteLinkResponse != null) {
|
|
2572
2524
|
if (agentSurveyInviteLinkResponse.inviteList != null && agentSurveyInviteLinkResponse.inviteList.length == 1) {
|
|
@@ -2615,16 +2567,16 @@ var OmnichannelChatSDK = /** @class */ (function () {
|
|
|
2615
2567
|
});
|
|
2616
2568
|
return [2 /*return*/, Promise.reject("surveyInviteLinkResponse is null.")];
|
|
2617
2569
|
}
|
|
2618
|
-
return [3 /*break*/,
|
|
2619
|
-
case
|
|
2570
|
+
return [3 /*break*/, 5];
|
|
2571
|
+
case 4:
|
|
2620
2572
|
this.scenarioMarker.failScenario(TelemetryEvent_1.default.GetPostChatSurveyContext, {
|
|
2621
2573
|
RequestId: this.requestId,
|
|
2622
2574
|
ChatId: (_l = this.chatToken) === null || _l === void 0 ? void 0 : _l.chatId,
|
|
2623
2575
|
ExceptionDetails: "Post Chat Survey is disabled. Please check the Omnichannel Administration Portal."
|
|
2624
2576
|
});
|
|
2625
2577
|
return [2 /*return*/, Promise.reject("Post Chat is disabled from admin side, or chat doesnt have a survey as part of their configuration.")];
|
|
2626
|
-
case
|
|
2627
|
-
case
|
|
2578
|
+
case 5: return [3 /*break*/, 7];
|
|
2579
|
+
case 6:
|
|
2628
2580
|
ex_1 = _o.sent();
|
|
2629
2581
|
this.scenarioMarker.failScenario(TelemetryEvent_1.default.GetPostChatSurveyContext, {
|
|
2630
2582
|
ConversationId: conversationId !== null && conversationId !== void 0 ? conversationId : "",
|
|
@@ -2633,7 +2585,7 @@ var OmnichannelChatSDK = /** @class */ (function () {
|
|
|
2633
2585
|
ExceptionDetails: JSON.stringify(ex_1)
|
|
2634
2586
|
});
|
|
2635
2587
|
return [2 /*return*/, Promise.reject("Retrieving post chat context failed " + JSON.stringify(ex_1))];
|
|
2636
|
-
case
|
|
2588
|
+
case 7: return [2 /*return*/];
|
|
2637
2589
|
}
|
|
2638
2590
|
});
|
|
2639
2591
|
});
|
|
@@ -2826,12 +2778,26 @@ var OmnichannelChatSDK = /** @class */ (function () {
|
|
|
2826
2778
|
regex: value
|
|
2827
2779
|
});
|
|
2828
2780
|
}
|
|
2781
|
+
this.compileDataMaskingRegex();
|
|
2829
2782
|
}
|
|
2830
2783
|
}
|
|
2831
2784
|
return [2 /*return*/];
|
|
2832
2785
|
});
|
|
2833
2786
|
});
|
|
2834
2787
|
};
|
|
2788
|
+
OmnichannelChatSDK.prototype.compileDataMaskingRegex = function () {
|
|
2789
|
+
this.regexCompiledForDataMasking = [];
|
|
2790
|
+
for (var _i = 0, _a = this.dataMaskingRules.rules; _i < _a.length; _i++) {
|
|
2791
|
+
var rule = _a[_i];
|
|
2792
|
+
try {
|
|
2793
|
+
var regex = new RegExp(rule.regex, 'g');
|
|
2794
|
+
this.regexCompiledForDataMasking.push(regex);
|
|
2795
|
+
}
|
|
2796
|
+
catch (e) {
|
|
2797
|
+
console.error("Error compiling regex for data masking rule id ".concat(rule.id, ": ").concat(e));
|
|
2798
|
+
}
|
|
2799
|
+
}
|
|
2800
|
+
};
|
|
2835
2801
|
OmnichannelChatSDK.prototype.setAuthSettingConfig = function (authSettings) {
|
|
2836
2802
|
return __awaiter(this, void 0, void 0, function () {
|
|
2837
2803
|
return __generator(this, function (_a) {
|
|
@@ -3157,6 +3123,67 @@ var OmnichannelChatSDK = /** @class */ (function () {
|
|
|
3157
3123
|
});
|
|
3158
3124
|
});
|
|
3159
3125
|
};
|
|
3126
|
+
/**
|
|
3127
|
+
* Get persistent chat history for authenticated users.
|
|
3128
|
+
* @param getPersistentChatHistoryOptionalParams Optional parameters for persistent chat history retrieval.
|
|
3129
|
+
*/
|
|
3130
|
+
OmnichannelChatSDK.prototype.getPersistentChatHistory = function () {
|
|
3131
|
+
return __awaiter(this, arguments, void 0, function (getPersistentChatHistoryOptionalParams) {
|
|
3132
|
+
var params, result, error_28, telemetryData;
|
|
3133
|
+
var _a, _b, _c, _d, _e;
|
|
3134
|
+
if (getPersistentChatHistoryOptionalParams === void 0) { getPersistentChatHistoryOptionalParams = {}; }
|
|
3135
|
+
return __generator(this, function (_f) {
|
|
3136
|
+
switch (_f.label) {
|
|
3137
|
+
case 0:
|
|
3138
|
+
if (!this.requestId) {
|
|
3139
|
+
this.requestId = (0, ocsdk_1.uuidv4)();
|
|
3140
|
+
}
|
|
3141
|
+
this.scenarioMarker.startScenario(TelemetryEvent_1.default.GetPersistentChatHistory, {
|
|
3142
|
+
RequestId: this.requestId
|
|
3143
|
+
});
|
|
3144
|
+
if (!this.isInitialized) {
|
|
3145
|
+
exceptionThrowers_1.default.throwUninitializedChatSDK(this.scenarioMarker, TelemetryEvent_1.default.GetPersistentChatHistory);
|
|
3146
|
+
}
|
|
3147
|
+
if (!this.isPersistentChat || ((_a = this.chatSDKConfig.persistentChat) === null || _a === void 0 ? void 0 : _a.disable) === true) {
|
|
3148
|
+
exceptionThrowers_1.default.throwNotPersistentChatEnabled(this.scenarioMarker, TelemetryEvent_1.default.GetPersistentChatHistory, {
|
|
3149
|
+
RequestId: this.requestId,
|
|
3150
|
+
ChatId: (_b = this.chatToken) === null || _b === void 0 ? void 0 : _b.chatId
|
|
3151
|
+
});
|
|
3152
|
+
}
|
|
3153
|
+
if (!this.authenticatedUserToken) {
|
|
3154
|
+
exceptionThrowers_1.default.throwChatSDKError(ChatSDKError_1.ChatSDKErrorName.AuthenticatedUserTokenNotFound, new Error('Authenticated user token not found'), this.scenarioMarker, TelemetryEvent_1.default.GetPersistentChatHistory, {
|
|
3155
|
+
RequestId: this.requestId,
|
|
3156
|
+
ChatId: (_c = this.chatToken) === null || _c === void 0 ? void 0 : _c.chatId
|
|
3157
|
+
});
|
|
3158
|
+
}
|
|
3159
|
+
_f.label = 1;
|
|
3160
|
+
case 1:
|
|
3161
|
+
_f.trys.push([1, 3, , 4]);
|
|
3162
|
+
params = {};
|
|
3163
|
+
params.pageSize = getPersistentChatHistoryOptionalParams.pageSize || undefined;
|
|
3164
|
+
params.pageToken = getPersistentChatHistoryOptionalParams.pageToken || undefined;
|
|
3165
|
+
return [4 /*yield*/, this.OCClient.getPersistentChatHistory(this.requestId, __assign(__assign({}, params), { authenticatedUserToken: this.authenticatedUserToken }))];
|
|
3166
|
+
case 2:
|
|
3167
|
+
result = _f.sent();
|
|
3168
|
+
this.scenarioMarker.completeScenario(TelemetryEvent_1.default.GetPersistentChatHistory, {
|
|
3169
|
+
RequestId: this.requestId,
|
|
3170
|
+
ChatId: (_d = this.chatToken) === null || _d === void 0 ? void 0 : _d.chatId
|
|
3171
|
+
});
|
|
3172
|
+
return [2 /*return*/, result];
|
|
3173
|
+
case 3:
|
|
3174
|
+
error_28 = _f.sent();
|
|
3175
|
+
telemetryData = {
|
|
3176
|
+
RequestId: this.requestId,
|
|
3177
|
+
ChatId: (_e = this.chatToken) === null || _e === void 0 ? void 0 : _e.chatId,
|
|
3178
|
+
ErrorMessage: (error_28 === null || error_28 === void 0 ? void 0 : error_28.message) || 'Unknown error' // Added error message for better debugging
|
|
3179
|
+
};
|
|
3180
|
+
exceptionThrowers_1.default.throwPersistentChatConversationRetrievalFailure(error_28, this.scenarioMarker, TelemetryEvent_1.default.GetPersistentChatHistory, telemetryData);
|
|
3181
|
+
return [3 /*break*/, 4];
|
|
3182
|
+
case 4: return [2 /*return*/];
|
|
3183
|
+
}
|
|
3184
|
+
});
|
|
3185
|
+
});
|
|
3186
|
+
};
|
|
3160
3187
|
return OmnichannelChatSDK;
|
|
3161
3188
|
}());
|
|
3162
3189
|
exports.default = OmnichannelChatSDK;
|