@microsoft/omnichannel-chat-sdk
Advanced tools
Comparing version
@@ -6,2 +6,17 @@ # Changelog | ||
### Added | ||
- Add `GetAuthToken` & `GetPreChatSurvey` telemetry events | ||
- Add `Domain` telemetry base property | ||
- Add `GetCurrentLiveChatContext`, `GetMessages`, `SendMessages`, `OnNewMessage` & `OnTypingEvent ` telemetry events | ||
- Live Chat V2 Support | ||
### Changed | ||
- Uptake [@microsoft/ocsdk@0.3.0](https://www.npmjs.com/package/@microsoft/ocsdk/v/0.3.0) | ||
- Uptake [@microsoft/omnichannel-ic3core@0.1.2](https://www.npmjs.com/package/@microsoft/omnichannel-ic3core/v/0.1.2) | ||
### Fixed | ||
- `onNewMessage` with `rehydrate` flag set to `true` crashing when `getMessages` returns `undefined` | ||
- Fix `AriaTelemetry` unable to read property `logEvent` of undefined on `React Native` | ||
- Fix `Escalation to Voice & Video` library not being imported properly | ||
## [0.3.0] - 2021-09-03 | ||
@@ -31,3 +46,3 @@ ### Added | ||
- React Native sample app using Omnichannel Chat SDK with [react-native-gifted-chat](https://github.com/FaridSafi/react-native-gifted-chat) | ||
- Escalation to Voice & View support (Web Only) | ||
- Escalation to Voice & Video support (Web Only) | ||
- React sample app using Omnichannel Chat SDK with [BotFramework-WebChat](https://github.com/microsoft/BotFramework-WebChat) | ||
@@ -34,0 +49,0 @@ - Expose `sessiontInit`'s `initContext` on `startChat`'s optional paramaters |
@@ -17,2 +17,3 @@ import IChatToken from "../external/IC3Adapter/IChatToken"; | ||
private debug; | ||
private callClientName; | ||
private logger; | ||
@@ -19,0 +20,0 @@ private proxy; |
@@ -54,6 +54,18 @@ "use strict"; | ||
})(SecondaryChannelEvents || (SecondaryChannelEvents = {})); | ||
var CallingEvents; | ||
(function (CallingEvents) { | ||
CallingEvents["CallAdded"] = "callAdded"; | ||
CallingEvents["LocalVideoStreamAdded"] = "localVideoStreamAdded"; | ||
CallingEvents["LocalVideoStreamRemoved"] = "localVideoStreamRemoved"; | ||
CallingEvents["RemoteVideoStreamAdded"] = "remoteVideoStreamAdded"; | ||
CallingEvents["RemoteVideoStreamRemoved"] = "remoteVideoStreamRemoved"; | ||
CallingEvents["CallDisconnected"] = "callDisconnected"; | ||
CallingEvents["ParticipantDisconnected"] = "participantDisconnected"; | ||
CallingEvents["IncomingCallEnded"] = "incomingCallEnded"; | ||
})(CallingEvents || (CallingEvents = {})); | ||
var VoiceVideoCallingProxy = /** @class */ (function () { | ||
function VoiceVideoCallingProxy() { | ||
this.debug = false; | ||
this.proxy = window.Microsoft.OmniChannel.SDK.VoiceVideoCalling; | ||
this.callClientName = 'ElevateToVoiceVideo'; | ||
this.proxy = window["Microsoft.Omnichannel.Calling.SDK"].VoiceVideoCalling; // eslint-disable-line @typescript-eslint/no-explicit-any | ||
this.proxyInstance = this.proxy.getInstance(); | ||
@@ -90,7 +102,7 @@ } | ||
VoiceVideoCallingProxy.prototype.initialize = function (params) { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j; | ||
var _a, _b, _c, _d, _e, _f, _g, _h; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var _k; | ||
return __generator(this, function (_l) { | ||
switch (_l.label) { | ||
var error_1; | ||
return __generator(this, function (_j) { | ||
switch (_j.label) { | ||
case 0: | ||
@@ -100,6 +112,3 @@ /* istanbul ignore next */ | ||
this.callingParams = params; | ||
this.callId = (_a = this.callingParams) === null || _a === void 0 ? void 0 : _a.chatToken.chatId; | ||
(_b = this.scenarioMarker) === null || _b === void 0 ? void 0 : _b.startScenario(TelemetryEvent_1.default.InitializeVoiceVideoCallingSDK, { | ||
CallId: this.callId || '' | ||
}); | ||
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.startScenario(TelemetryEvent_1.default.InitializeVoiceVideoCallingSDK); | ||
/* istanbul ignore next */ | ||
@@ -110,24 +119,20 @@ this.debug && console.debug("[VoiceVideoCallingProxy][initialize] _isLoaded: " + this.proxyInstance._isLoaded); | ||
case 1: | ||
_l.sent(); | ||
_l.label = 2; | ||
_j.sent(); | ||
_j.label = 2; | ||
case 2: | ||
_l.trys.push([2, 4, , 5]); | ||
_j.trys.push([2, 4, , 5]); | ||
return [4 /*yield*/, this.proxyInstance.initialize({ | ||
skypeid: (_c = this.callingParams) === null || _c === void 0 ? void 0 : _c.chatToken.visitorId, | ||
accesstoken: (_d = this.callingParams) === null || _d === void 0 ? void 0 : _d.chatToken.token, | ||
environment: ((_e = this.callingParams) === null || _e === void 0 ? void 0 : _e.environment) || 'prod', | ||
selfVideoHTMLElementId: (_f = this.callingParams) === null || _f === void 0 ? void 0 : _f.selfVideoHTMLElementId, | ||
remoteVideoHTMLElementId: (_g = this.callingParams) === null || _g === void 0 ? void 0 : _g.remoteVideoHTMLElementId | ||
callClientName: this.callClientName, | ||
accesstoken: ((_c = (_b = this.callingParams) === null || _b === void 0 ? void 0 : _b.chatToken.voiceVideoCallToken) === null || _c === void 0 ? void 0 : _c.Token) || ((_d = this.callingParams) === null || _d === void 0 ? void 0 : _d.chatToken.token), | ||
selfVideoHTMLElementId: (_e = this.callingParams) === null || _e === void 0 ? void 0 : _e.selfVideoHTMLElementId, | ||
remoteVideoHTMLElementId: (_f = this.callingParams) === null || _f === void 0 ? void 0 : _f.remoteVideoHTMLElementId | ||
})]; | ||
case 3: | ||
_l.sent(); | ||
(_h = this.scenarioMarker) === null || _h === void 0 ? void 0 : _h.completeScenario(TelemetryEvent_1.default.InitializeVoiceVideoCallingSDK, { | ||
CallId: this.callId || '' | ||
}); | ||
_j.sent(); | ||
(_g = this.scenarioMarker) === null || _g === void 0 ? void 0 : _g.completeScenario(TelemetryEvent_1.default.InitializeVoiceVideoCallingSDK); | ||
return [3 /*break*/, 5]; | ||
case 4: | ||
_k = _l.sent(); | ||
(_j = this.scenarioMarker) === null || _j === void 0 ? void 0 : _j.failScenario(TelemetryEvent_1.default.InitializeVoiceVideoCallingSDK, { | ||
CallId: this.callId || '' | ||
}); | ||
error_1 = _j.sent(); | ||
console.log(error_1); | ||
(_h = this.scenarioMarker) === null || _h === void 0 ? void 0 : _h.failScenario(TelemetryEvent_1.default.InitializeVoiceVideoCallingSDK); | ||
return [3 /*break*/, 5]; | ||
@@ -142,7 +147,9 @@ case 5: return [2 /*return*/]; | ||
this.proxyInstance.registerEvent(eventName, function (params) { | ||
var _a; | ||
var callId = params.callId; | ||
if (eventName === CallingEvents.CallAdded) { | ||
_this.callId = callId; | ||
} | ||
/* istanbul ignore next */ | ||
_this.debug && console.debug("[VoiceVideoCallingProxy][" + eventName + "] callId: " + callId); | ||
if (callId !== ((_a = _this.callingParams) === null || _a === void 0 ? void 0 : _a.chatToken.chatId)) { | ||
if (callId !== _this.callId) { | ||
return; | ||
@@ -154,4 +161,4 @@ } | ||
VoiceVideoCallingProxy.prototype.isMicrophoneMuted = function () { | ||
var callId = this.callId; | ||
return this.proxyInstance.isMicrophoneMuted({ callId: callId }); | ||
var _a = this, callClientName = _a.callClientName, callId = _a.callId; | ||
return this.proxyInstance.isMicrophoneMuted({ callClientName: callClientName, callId: callId }); | ||
}; | ||
@@ -162,7 +169,7 @@ VoiceVideoCallingProxy.prototype.acceptCall = function (params) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var callId, _g, exceptionDetails, body, exceptionDetails; | ||
return __generator(this, function (_h) { | ||
switch (_h.label) { | ||
var _g, callClientName, callId, _h, exceptionDetails, body, exceptionDetails; | ||
return __generator(this, function (_j) { | ||
switch (_j.label) { | ||
case 0: | ||
callId = this.callId; | ||
_g = this, callClientName = _g.callClientName, callId = _g.callId; | ||
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.startScenario(params.withVideo ? TelemetryEvent_1.default.AcceptVideoCall : TelemetryEvent_1.default.AcceptVoiceCall, { | ||
@@ -175,11 +182,11 @@ CallId: callId || '' | ||
this.debug && console.debug(params); | ||
_h.label = 1; | ||
_j.label = 1; | ||
case 1: | ||
_h.trys.push([1, 3, , 4]); | ||
return [4 /*yield*/, this.proxyInstance.acceptCall({ callId: callId, withVideo: params.withVideo || false })]; | ||
_j.trys.push([1, 3, , 4]); | ||
return [4 /*yield*/, this.proxyInstance.acceptCall({ callClientName: callClientName, callId: callId, withVideo: params.withVideo || false })]; | ||
case 2: | ||
_h.sent(); | ||
_j.sent(); | ||
return [3 /*break*/, 4]; | ||
case 3: | ||
_g = _h.sent(); | ||
_h = _j.sent(); | ||
exceptionDetails = { | ||
@@ -224,7 +231,7 @@ response: params.withVideo ? "AcceptVideoCallFailed" : "AcceptVoiceCallFailed" | ||
return __awaiter(this, void 0, void 0, function () { | ||
var callId, _g, exceptionDetails, body, exceptionDetails; | ||
return __generator(this, function (_h) { | ||
switch (_h.label) { | ||
var _g, callClientName, callId, _h, exceptionDetails, body, exceptionDetails; | ||
return __generator(this, function (_j) { | ||
switch (_j.label) { | ||
case 0: | ||
callId = this.callId; | ||
_g = this, callClientName = _g.callClientName, callId = _g.callId; | ||
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.startScenario(TelemetryEvent_1.default.RejectCall, { | ||
@@ -235,8 +242,8 @@ CallId: callId || '' | ||
this.debug && console.debug("[VoiceVideoCallingProxy][rejectCall] callId: " + callId); | ||
_h.label = 1; | ||
_j.label = 1; | ||
case 1: | ||
_h.trys.push([1, 3, , 4]); | ||
return [4 /*yield*/, this.proxyInstance.rejectCall({ callId: callId })]; | ||
_j.trys.push([1, 3, , 4]); | ||
return [4 /*yield*/, this.proxyInstance.rejectCall({ callClientName: callClientName, callId: callId })]; | ||
case 2: | ||
_h.sent(); | ||
_j.sent(); | ||
(_b = this.scenarioMarker) === null || _b === void 0 ? void 0 : _b.completeScenario(TelemetryEvent_1.default.RejectCall, { | ||
@@ -247,3 +254,3 @@ CallId: callId || '' | ||
case 3: | ||
_g = _h.sent(); | ||
_h = _j.sent(); | ||
exceptionDetails = { | ||
@@ -284,9 +291,9 @@ response: "RejectCallFailed" | ||
VoiceVideoCallingProxy.prototype.stopCall = function () { | ||
var _a, _b, _c; | ||
var _a, _b, _c, _d, _e; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var callId, _d; | ||
return __generator(this, function (_e) { | ||
switch (_e.label) { | ||
var _f, callClientName, callId, forEveryone, _g; | ||
return __generator(this, function (_h) { | ||
switch (_h.label) { | ||
case 0: | ||
callId = this.callId; | ||
_f = this, callClientName = _f.callClientName, callId = _f.callId; | ||
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.startScenario(TelemetryEvent_1.default.StopCall, { | ||
@@ -297,9 +304,10 @@ CallId: callId || '' | ||
this.debug && console.debug("[VoiceVideoCallingProxy][stopCall] callId: " + callId); | ||
_e.label = 1; | ||
forEveryone = ((_c = (_b = this.callingParams) === null || _b === void 0 ? void 0 : _b.chatToken.voiceVideoCallToken) === null || _c === void 0 ? void 0 : _c.Token) ? true : false; | ||
_h.label = 1; | ||
case 1: | ||
_e.trys.push([1, 3, , 4]); | ||
return [4 /*yield*/, this.proxyInstance.stopCall({ callId: callId })]; | ||
_h.trys.push([1, 3, , 4]); | ||
return [4 /*yield*/, this.proxyInstance.stopCall({ callClientName: callClientName, callId: callId, forEveryone: forEveryone })]; | ||
case 2: | ||
_e.sent(); | ||
(_b = this.scenarioMarker) === null || _b === void 0 ? void 0 : _b.completeScenario(TelemetryEvent_1.default.StopCall, { | ||
_h.sent(); | ||
(_d = this.scenarioMarker) === null || _d === void 0 ? void 0 : _d.completeScenario(TelemetryEvent_1.default.StopCall, { | ||
CallId: callId || '' | ||
@@ -309,4 +317,4 @@ }); | ||
case 3: | ||
_d = _e.sent(); | ||
(_c = this.scenarioMarker) === null || _c === void 0 ? void 0 : _c.failScenario(TelemetryEvent_1.default.StopCall, { | ||
_g = _h.sent(); | ||
(_e = this.scenarioMarker) === null || _e === void 0 ? void 0 : _e.failScenario(TelemetryEvent_1.default.StopCall, { | ||
CallId: callId || '', | ||
@@ -322,6 +330,6 @@ }); | ||
return __awaiter(this, void 0, void 0, function () { | ||
var callId; | ||
return __generator(this, function (_a) { | ||
callId = this.callId; | ||
return [2 /*return*/, this.proxyInstance.toggleMute({ callId: callId })]; | ||
var _a, callClientName, callId; | ||
return __generator(this, function (_b) { | ||
_a = this, callClientName = _a.callClientName, callId = _a.callId; | ||
return [2 /*return*/, this.proxyInstance.toggleMute({ callClientName: callClientName, callId: callId })]; | ||
}); | ||
@@ -331,15 +339,15 @@ }); | ||
VoiceVideoCallingProxy.prototype.isRemoteVideoEnabled = function () { | ||
var callId = this.callId; | ||
return this.proxyInstance.isRemoteVideoEnabled({ callId: callId }); | ||
var _a = this, callClientName = _a.callClientName, callId = _a.callId; | ||
return this.proxyInstance.isRemoteVideoEnabled({ callClientName: callClientName, callId: callId }); | ||
}; | ||
VoiceVideoCallingProxy.prototype.isLocalVideoEnabled = function () { | ||
var callId = this.callId; | ||
return this.proxyInstance.isLocalVideoEnabled({ callId: callId }); | ||
var _a = this, callClientName = _a.callClientName, callId = _a.callId; | ||
return this.proxyInstance.isLocalVideoEnabled({ callClientName: callClientName, callId: callId }); | ||
}; | ||
VoiceVideoCallingProxy.prototype.toggleLocalVideo = function () { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var callId; | ||
return __generator(this, function (_a) { | ||
callId = this.callId; | ||
return [2 /*return*/, this.proxyInstance.toggleLocalVideo({ callId: callId })]; | ||
var _a, callClientName, callId; | ||
return __generator(this, function (_b) { | ||
_a = this, callClientName = _a.callClientName, callId = _a.callId; | ||
return [2 /*return*/, this.proxyInstance.toggleLocalVideo({ callClientName: callClientName, callId: callId })]; | ||
}); | ||
@@ -349,12 +357,12 @@ }); | ||
VoiceVideoCallingProxy.prototype.isInACall = function () { | ||
var callId = this.callId; | ||
return this.proxyInstance.isInACall({ callId: callId }); | ||
var _a = this, callClientName = _a.callClientName, callId = _a.callId; | ||
return this.proxyInstance.isInACall({ callClientName: callClientName, callId: callId }); | ||
}; | ||
VoiceVideoCallingProxy.prototype.renderVideoStreams = function () { | ||
var callId = this.callId; | ||
return this.proxyInstance.renderVideoStreams({ callId: callId }); | ||
var _a = this, callClientName = _a.callClientName, callId = _a.callId; | ||
return this.proxyInstance.renderVideoStreams({ callClientName: callClientName, callId: callId }); | ||
}; | ||
VoiceVideoCallingProxy.prototype.disposeVideoRenderers = function () { | ||
var callId = this.callId; | ||
return this.proxyInstance.disposeVideoRenderers({ callId: callId }); | ||
var _a = this, callClientName = _a.callClientName, callId = _a.callId; | ||
return this.proxyInstance.disposeVideoRenderers({ callClientName: callClientName, callId: callId }); | ||
}; | ||
@@ -369,3 +377,3 @@ VoiceVideoCallingProxy.prototype.close = function () { | ||
VoiceVideoCallingProxy.prototype.onCallAdded = function (callback) { | ||
var eventName = 'callAdded'; | ||
var eventName = CallingEvents.CallAdded; | ||
/* istanbul ignore next */ | ||
@@ -376,3 +384,3 @@ this.debug && console.debug("[VoiceVideoCallingProxy][" + eventName + "]"); | ||
VoiceVideoCallingProxy.prototype.onLocalVideoStreamAdded = function (callback) { | ||
var eventName = 'localVideoStreamAdded'; | ||
var eventName = CallingEvents.LocalVideoStreamAdded; | ||
/* istanbul ignore next */ | ||
@@ -383,3 +391,3 @@ this.debug && console.debug("[VoiceVideoCallingProxy][" + eventName + "]"); | ||
VoiceVideoCallingProxy.prototype.onLocalVideoStreamRemoved = function (callback) { | ||
var eventName = 'localVideoStreamRemoved'; | ||
var eventName = CallingEvents.LocalVideoStreamRemoved; | ||
/* istanbul ignore next */ | ||
@@ -390,3 +398,3 @@ this.debug && console.debug("[VoiceVideoCallingProxy][" + eventName + "]"); | ||
VoiceVideoCallingProxy.prototype.onRemoteVideoStreamAdded = function (callback) { | ||
var eventName = 'remoteVideoStreamAdded'; | ||
var eventName = CallingEvents.RemoteVideoStreamAdded; | ||
/* istanbul ignore next */ | ||
@@ -397,3 +405,3 @@ this.debug && console.debug("[VoiceVideoCallingProxy][" + eventName + "]"); | ||
VoiceVideoCallingProxy.prototype.onRemoteVideoStreamRemoved = function (callback) { | ||
var eventName = 'remoteVideoStreamRemoved'; | ||
var eventName = CallingEvents.RemoteVideoStreamRemoved; | ||
/* istanbul ignore next */ | ||
@@ -405,3 +413,3 @@ this.debug && console.debug("[VoiceVideoCallingProxy][" + eventName + "]"); | ||
var _this = this; | ||
var eventName = 'callDisconnected'; | ||
var eventName = CallingEvents.CallDisconnected; | ||
/* istanbul ignore next */ | ||
@@ -408,0 +416,0 @@ this.debug && console.debug("[VoiceVideoCallingProxy][" + eventName + "]"); |
declare const ic3ClientVersion = "2021.08.14.1"; | ||
declare const webChatIC3AdapterVersion = "0.1.0-master.2dba07b"; | ||
declare const webChatACSAdapterVersion = "0.0.30"; | ||
declare const ariaTelemetryKey = "c7655518acf1403f93ff6b9f77942f0a-d01a02fd-6b50-4de3-a566-62eda11f93bc-7083"; | ||
export { ic3ClientVersion, webChatIC3AdapterVersion, ariaTelemetryKey }; | ||
export { ic3ClientVersion, webChatIC3AdapterVersion, webChatACSAdapterVersion, ariaTelemetryKey }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ariaTelemetryKey = exports.webChatIC3AdapterVersion = exports.ic3ClientVersion = void 0; | ||
exports.ariaTelemetryKey = exports.webChatACSAdapterVersion = exports.webChatIC3AdapterVersion = exports.ic3ClientVersion = void 0; | ||
var ic3ClientVersion = '2021.08.14.1'; | ||
@@ -8,4 +8,6 @@ exports.ic3ClientVersion = ic3ClientVersion; | ||
exports.webChatIC3AdapterVersion = webChatIC3AdapterVersion; | ||
var webChatACSAdapterVersion = '0.0.30'; | ||
exports.webChatACSAdapterVersion = webChatACSAdapterVersion; | ||
var ariaTelemetryKey = 'c7655518acf1403f93ff6b9f77942f0a-d01a02fd-6b50-4de3-a566-62eda11f93bc-7083'; | ||
exports.ariaTelemetryKey = ariaTelemetryKey; | ||
//# sourceMappingURL=settings.js.map |
@@ -9,2 +9,4 @@ export default interface IChatToken { | ||
voiceVideoCallToken?: any; | ||
acsEndpoint?: string; | ||
amsEndpoint?: string; | ||
} |
import { SDKProvider as OCSDKProvider, uuidv4 } from "@microsoft/ocsdk"; | ||
import { SDKProvider as IC3SDKProvider } from '@microsoft/omnichannel-ic3core'; | ||
import OmnichannelChatSDK from "./OmnichannelChatSDK"; | ||
import IChatSDKMessage from "./core/IChatSDKMessage"; | ||
import ChatSDKMessage from "./core/messaging/ChatSDKMessage"; | ||
import IRawMessage from "@microsoft/omnichannel-ic3core/lib/model/IRawMessage"; | ||
@@ -12,3 +12,3 @@ import MessageContentType from "@microsoft/omnichannel-ic3core/lib/model/MessageContentType"; | ||
import { isSystemMessage, isCustomerMessage } from "./utils/utilities"; | ||
export { OmnichannelChatSDK, IC3SDKProvider, OCSDKProvider, uuidv4, IChatSDKMessage, IRawMessage, MessageContentType, DeliveryMode, MessageType, PersonType, IFileInfo, isSystemMessage, isCustomerMessage }; | ||
export { OmnichannelChatSDK, IC3SDKProvider, OCSDKProvider, uuidv4, ChatSDKMessage, IRawMessage, MessageContentType, DeliveryMode, MessageType, PersonType, IFileInfo, isSystemMessage, isCustomerMessage }; | ||
declare const _default: { | ||
@@ -15,0 +15,0 @@ OmnichannelChatSDK: typeof OmnichannelChatSDK; |
@@ -1,18 +0,24 @@ | ||
import IChatConfig from "./core/IChatConfig"; | ||
import IChatSDKConfig from "./core/IChatSDKConfig"; | ||
import IChatSDKMessage from "./core/IChatSDKMessage"; | ||
import ACSClient from "./core/messaging/ACSClient"; | ||
import ChatConfig from "./core/ChatConfig"; | ||
import ChatReconnectContext from "./core/ChatReconnectContext"; | ||
import ChatReconnectOptionalParams from "./core/ChatReconnectOptionalParams"; | ||
import ChatSDKConfig from "./core/ChatSDKConfig"; | ||
import ChatSDKMessage from "./core/messaging/ChatSDKMessage"; | ||
import ChatTranscriptBody from "./core/ChatTranscriptBody"; | ||
import { ParticipantsRemovedEvent } from '@azure/communication-signaling'; | ||
import FileMetadata from "@microsoft/omnichannel-amsclient/lib/FileMetadata"; | ||
import FramedClient from "@microsoft/omnichannel-amsclient/lib/FramedClient"; | ||
import FramedlessClient from "@microsoft/omnichannel-amsclient/lib/FramedlessClient"; | ||
import IChatToken from "./external/IC3Adapter/IChatToken"; | ||
import IChatTranscriptBody from "./core/IChatTranscriptBody"; | ||
import IFileInfo from "@microsoft/omnichannel-ic3core/lib/interfaces/IFileInfo"; | ||
import IFileMetadata from "@microsoft/omnichannel-ic3core/lib/model/IFileMetadata"; | ||
import ILiveChatContext from "./core/ILiveChatContext"; | ||
import IMessage from "@microsoft/omnichannel-ic3core/lib/model/IMessage"; | ||
import IOmnichannelConfig from "./core/IOmnichannelConfig"; | ||
import OmnichannelConfig from "./core/OmnichannelConfig"; | ||
import IRawMessage from "@microsoft/omnichannel-ic3core/lib/model/IRawMessage"; | ||
import IRawThread from "@microsoft/omnichannel-ic3core/lib/interfaces/IRawThread"; | ||
import IStartChatOptionalParams from "./core/IStartChatOptionalParams"; | ||
import LiveChatContext from "./core/LiveChatContext"; | ||
import LiveWorkItemDetails from "./core/LiveWorkItemDetails"; | ||
import OnNewMessageOptionalParams from "./core/OnNewMessageOptionalParams"; | ||
import ChatReconnectOptionalParams from "./core/ChatReconnectOptionalParams"; | ||
import ChatReconnectContext from "./core/ChatReconnectContext"; | ||
import OnNewMessageOptionalParams from "./core/messaging/OnNewMessageOptionalParams"; | ||
import OmnichannelMessage from "./core/messaging/OmnichannelMessage"; | ||
import StartChatOptionalParams from "./core/StartChatOptionalParams"; | ||
declare class OmnichannelChatSDK { | ||
@@ -24,4 +30,6 @@ private debug; | ||
IC3Client: any; | ||
omnichannelConfig: IOmnichannelConfig; | ||
chatSDKConfig: IChatSDKConfig; | ||
ACSClient: ACSClient | null; | ||
AMSClient: FramedClient | FramedlessClient | null; | ||
omnichannelConfig: OmnichannelConfig; | ||
chatSDKConfig: ChatSDKConfig; | ||
isInitialized: boolean; | ||
@@ -31,2 +39,3 @@ requestId: string; | ||
private liveChatConfig; | ||
private liveChatVersion; | ||
private dataMaskingRules; | ||
@@ -42,2 +51,4 @@ private authSettings; | ||
private ocSdkLogger; | ||
private acsClientLogger; | ||
private acsAdapterLogger; | ||
private isPersistentChat; | ||
@@ -47,9 +58,9 @@ private isChatReconnect; | ||
private refreshTokenTimer; | ||
constructor(omnichannelConfig: IOmnichannelConfig, chatSDKConfig?: IChatSDKConfig); | ||
constructor(omnichannelConfig: OmnichannelConfig, chatSDKConfig?: ChatSDKConfig); | ||
setDebug(flag: boolean): void; | ||
initialize(): Promise<IChatConfig>; | ||
initialize(): Promise<ChatConfig>; | ||
getChatReconnectContext(optionalParams?: ChatReconnectOptionalParams): Promise<ChatReconnectContext>; | ||
startChat(optionalParams?: IStartChatOptionalParams): Promise<void>; | ||
startChat(optionalParams?: StartChatOptionalParams): Promise<void>; | ||
endChat(): Promise<void>; | ||
getCurrentLiveChatContext(): Promise<ILiveChatContext | {}>; | ||
getCurrentLiveChatContext(): Promise<LiveChatContext | {}>; | ||
getConversationDetails(): Promise<LiveWorkItemDetails>; | ||
@@ -61,17 +72,17 @@ /** | ||
getPreChatSurvey(parse?: boolean): Promise<any>; | ||
getLiveChatConfig(cached?: boolean): Promise<IChatConfig>; | ||
getLiveChatConfig(cached?: boolean): Promise<ChatConfig>; | ||
getChatToken(cached?: boolean): Promise<IChatToken>; | ||
getCallingToken(): Promise<string>; | ||
getMessages(): Promise<IMessage[] | undefined>; | ||
getMessages(): Promise<IMessage[] | OmnichannelMessage[] | undefined>; | ||
getDataMaskingRules(): Promise<any>; | ||
sendMessage(message: IChatSDKMessage): Promise<void>; | ||
sendMessage(message: ChatSDKMessage): Promise<void>; | ||
onNewMessage(onNewMessageCallback: CallableFunction, optionalParams?: OnNewMessageOptionalParams | unknown): Promise<void>; | ||
sendTypingEvent(): Promise<void>; | ||
onTypingEvent(onTypingEventCallback: CallableFunction): Promise<void>; | ||
onAgentEndSession(onAgentEndSessionCallback: (message: IRawThread) => void): Promise<void>; | ||
uploadFileAttachment(fileInfo: IFileInfo | File): Promise<IRawMessage>; | ||
downloadFileAttachment(fileMetadata: IFileMetadata): Promise<Blob>; | ||
emailLiveChatTranscript(body: IChatTranscriptBody): Promise<any>; | ||
onAgentEndSession(onAgentEndSessionCallback: (message: IRawThread | ParticipantsRemovedEvent) => void): Promise<void>; | ||
uploadFileAttachment(fileInfo: IFileInfo | File): Promise<IRawMessage | OmnichannelMessage>; | ||
downloadFileAttachment(fileMetadata: FileMetadata | IFileMetadata): Promise<Blob>; | ||
emailLiveChatTranscript(body: ChatTranscriptBody): Promise<any>; | ||
getLiveChatTranscript(): Promise<any>; | ||
createChatAdapter(protocol?: string): Promise<unknown>; | ||
createChatAdapter(protocol?: string | null): Promise<unknown>; | ||
getVoiceVideoCalling(params?: any): Promise<any>; | ||
@@ -78,0 +89,0 @@ private getIC3Client; |
@@ -6,2 +6,3 @@ import { AWTEventData } from '../external/aria/webjs/AriaSDK'; | ||
IC3Adapter?: string; | ||
ACSAdapter?: string; | ||
SpoolSDK?: string; | ||
@@ -27,5 +28,8 @@ VoiceVideoCalling?: string; | ||
private static fillMobilePlatformData; | ||
private static fillWebPlatformData; | ||
private static populateIC3ClientBaseProperties; | ||
private static populateOCSDKBaseProperties; | ||
private static populateACSClientBaseProperties; | ||
private static populateACSAdapterBaseProperties; | ||
} | ||
export default AriaTelemetry; |
@@ -20,2 +20,7 @@ "use strict"; | ||
var settings_2 = require("../config/settings"); | ||
var platform_1 = require("../utils/platform"); | ||
var Renderer; | ||
(function (Renderer) { | ||
Renderer["ReactNative"] = "ReactNative"; | ||
})(Renderer || (Renderer = {})); | ||
var AriaTelemetry = /** @class */ (function () { | ||
@@ -42,6 +47,7 @@ function AriaTelemetry() { | ||
AriaTelemetry.info = function (properties, scenarioType) { | ||
var _a; | ||
if (scenarioType === void 0) { scenarioType = ScenarioType_1.default.EVENTS; } | ||
var event = { | ||
name: ScenarioType_1.default.EVENTS, | ||
properties: __assign(__assign(__assign(__assign({}, AriaTelemetry.populateBaseProperties()), AriaTelemetry.fillMobilePlatformData()), properties), { LogLevel: LogLevel_1.default.INFO }), | ||
properties: __assign(__assign(__assign(__assign(__assign({}, AriaTelemetry.populateBaseProperties()), AriaTelemetry.fillWebPlatformData()), AriaTelemetry.fillMobilePlatformData()), properties), { LogLevel: LogLevel_1.default.INFO }), | ||
priority: Enums_1.AWTEventPriority.High | ||
@@ -63,2 +69,16 @@ }; | ||
} | ||
if (scenarioType == ScenarioType_1.default.ACSCLIENT) { | ||
event = { | ||
name: ScenarioType_1.default.ACSCLIENT, | ||
properties: __assign(__assign(__assign({}, AriaTelemetry.populateACSClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.INFO }), | ||
priority: Enums_1.AWTEventPriority.High | ||
}; | ||
} | ||
if (scenarioType == ScenarioType_1.default.ACSADAPTER) { | ||
event = { | ||
name: ScenarioType_1.default.ACSADAPTER, | ||
properties: __assign(__assign(__assign({}, AriaTelemetry.populateACSAdapterBaseProperties()), properties), { LogLevel: LogLevel_1.default.INFO }), | ||
priority: Enums_1.AWTEventPriority.High | ||
}; | ||
} | ||
/* istanbul ignore next */ | ||
@@ -70,9 +90,10 @@ this._debug && console.log("[AriaTelemetry][info] " + scenarioType); | ||
this._debug && console.log(event.properties.Event); | ||
!AriaTelemetry._disable && AriaTelemetry.logger.logEvent(event); | ||
!AriaTelemetry._disable && ((_a = AriaTelemetry.logger) === null || _a === void 0 ? void 0 : _a.logEvent(event)); | ||
}; | ||
AriaTelemetry.debug = function (properties, scenarioType) { | ||
var _a; | ||
if (scenarioType === void 0) { scenarioType = ScenarioType_1.default.EVENTS; } | ||
var event = { | ||
name: ScenarioType_1.default.EVENTS, | ||
properties: __assign(__assign(__assign(__assign({}, AriaTelemetry.populateBaseProperties()), AriaTelemetry.fillMobilePlatformData()), properties), { LogLevel: LogLevel_1.default.DEBUG }), | ||
properties: __assign(__assign(__assign(__assign(__assign({}, AriaTelemetry.populateBaseProperties()), AriaTelemetry.fillWebPlatformData()), AriaTelemetry.fillMobilePlatformData()), properties), { LogLevel: LogLevel_1.default.DEBUG }), | ||
priority: Enums_1.AWTEventPriority.High | ||
@@ -94,2 +115,16 @@ }; | ||
} | ||
if (scenarioType == ScenarioType_1.default.ACSCLIENT) { | ||
event = { | ||
name: ScenarioType_1.default.ACSCLIENT, | ||
properties: __assign(__assign(__assign({}, AriaTelemetry.populateACSClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.DEBUG }), | ||
priority: Enums_1.AWTEventPriority.High | ||
}; | ||
} | ||
if (scenarioType == ScenarioType_1.default.ACSADAPTER) { | ||
event = { | ||
name: ScenarioType_1.default.ACSADAPTER, | ||
properties: __assign(__assign(__assign({}, AriaTelemetry.populateACSAdapterBaseProperties()), properties), { LogLevel: LogLevel_1.default.DEBUG }), | ||
priority: Enums_1.AWTEventPriority.High | ||
}; | ||
} | ||
/* istanbul ignore next */ | ||
@@ -101,9 +136,10 @@ this._debug && console.log("[AriaTelemetry][debug] " + scenarioType); | ||
this._debug && console.log(event.properties.Event); | ||
!AriaTelemetry._disable && AriaTelemetry.logger.logEvent(event); | ||
!AriaTelemetry._disable && ((_a = AriaTelemetry.logger) === null || _a === void 0 ? void 0 : _a.logEvent(event)); | ||
}; | ||
AriaTelemetry.warn = function (properties, scenarioType) { | ||
var _a; | ||
if (scenarioType === void 0) { scenarioType = ScenarioType_1.default.EVENTS; } | ||
var event = { | ||
name: ScenarioType_1.default.EVENTS, | ||
properties: __assign(__assign(__assign(__assign({}, AriaTelemetry.populateBaseProperties()), AriaTelemetry.fillMobilePlatformData()), properties), { LogLevel: LogLevel_1.default.WARN }), | ||
properties: __assign(__assign(__assign(__assign(__assign({}, AriaTelemetry.populateBaseProperties()), AriaTelemetry.fillWebPlatformData()), AriaTelemetry.fillMobilePlatformData()), properties), { LogLevel: LogLevel_1.default.WARN }), | ||
priority: Enums_1.AWTEventPriority.High | ||
@@ -125,2 +161,16 @@ }; | ||
} | ||
if (scenarioType == ScenarioType_1.default.ACSCLIENT) { | ||
event = { | ||
name: ScenarioType_1.default.ACSCLIENT, | ||
properties: __assign(__assign(__assign({}, AriaTelemetry.populateACSClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.WARN }), | ||
priority: Enums_1.AWTEventPriority.High | ||
}; | ||
} | ||
if (scenarioType == ScenarioType_1.default.ACSADAPTER) { | ||
event = { | ||
name: ScenarioType_1.default.ACSADAPTER, | ||
properties: __assign(__assign(__assign({}, AriaTelemetry.populateACSAdapterBaseProperties()), properties), { LogLevel: LogLevel_1.default.WARN }), | ||
priority: Enums_1.AWTEventPriority.High | ||
}; | ||
} | ||
/* istanbul ignore next */ | ||
@@ -132,9 +182,10 @@ this._debug && console.log("[AriaTelemetry][warn] " + scenarioType); | ||
this._debug && console.log(event.properties.Event); | ||
!AriaTelemetry._disable && AriaTelemetry.logger.logEvent(event); | ||
!AriaTelemetry._disable && ((_a = AriaTelemetry.logger) === null || _a === void 0 ? void 0 : _a.logEvent(event)); | ||
}; | ||
AriaTelemetry.error = function (properties, scenarioType) { | ||
var _a; | ||
if (scenarioType === void 0) { scenarioType = ScenarioType_1.default.EVENTS; } | ||
var event = { | ||
name: ScenarioType_1.default.EVENTS, | ||
properties: __assign(__assign(__assign(__assign({}, AriaTelemetry.populateBaseProperties()), AriaTelemetry.fillMobilePlatformData()), properties), { LogLevel: LogLevel_1.default.ERROR }), | ||
properties: __assign(__assign(__assign(__assign(__assign({}, AriaTelemetry.populateBaseProperties()), AriaTelemetry.fillWebPlatformData()), AriaTelemetry.fillMobilePlatformData()), properties), { LogLevel: LogLevel_1.default.ERROR }), | ||
priority: Enums_1.AWTEventPriority.High | ||
@@ -156,2 +207,16 @@ }; | ||
} | ||
if (scenarioType == ScenarioType_1.default.ACSCLIENT) { | ||
event = { | ||
name: ScenarioType_1.default.ACSCLIENT, | ||
properties: __assign(__assign(__assign({}, AriaTelemetry.populateACSClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.ERROR }), | ||
priority: Enums_1.AWTEventPriority.High | ||
}; | ||
} | ||
if (scenarioType == ScenarioType_1.default.ACSADAPTER) { | ||
event = { | ||
name: ScenarioType_1.default.ACSADAPTER, | ||
properties: __assign(__assign(__assign({}, AriaTelemetry.populateACSAdapterBaseProperties()), properties), { LogLevel: LogLevel_1.default.ERROR }), | ||
priority: Enums_1.AWTEventPriority.High | ||
}; | ||
} | ||
/* istanbul ignore next */ | ||
@@ -163,9 +228,10 @@ this._debug && console.log("[AriaTelemetry][error] " + scenarioType); | ||
this._debug && console.log(event.properties.Event); | ||
!AriaTelemetry._disable && AriaTelemetry.logger.logEvent(event); | ||
!AriaTelemetry._disable && ((_a = AriaTelemetry.logger) === null || _a === void 0 ? void 0 : _a.logEvent(event)); | ||
}; | ||
AriaTelemetry.log = function (properties, scenarioType) { | ||
var _a; | ||
if (scenarioType === void 0) { scenarioType = ScenarioType_1.default.EVENTS; } | ||
var event = { | ||
name: ScenarioType_1.default.EVENTS, | ||
properties: __assign(__assign(__assign(__assign({}, AriaTelemetry.populateBaseProperties()), AriaTelemetry.fillMobilePlatformData()), properties), { LogLevel: LogLevel_1.default.LOG }), | ||
properties: __assign(__assign(__assign(__assign(__assign({}, AriaTelemetry.populateBaseProperties()), AriaTelemetry.fillWebPlatformData()), AriaTelemetry.fillMobilePlatformData()), properties), { LogLevel: LogLevel_1.default.LOG }), | ||
priority: Enums_1.AWTEventPriority.High | ||
@@ -187,2 +253,16 @@ }; | ||
} | ||
if (scenarioType == ScenarioType_1.default.ACSCLIENT) { | ||
event = { | ||
name: ScenarioType_1.default.ACSCLIENT, | ||
properties: __assign(__assign(__assign({}, AriaTelemetry.populateACSClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.LOG }), | ||
priority: Enums_1.AWTEventPriority.High | ||
}; | ||
} | ||
if (scenarioType == ScenarioType_1.default.ACSADAPTER) { | ||
event = { | ||
name: ScenarioType_1.default.ACSADAPTER, | ||
properties: __assign(__assign(__assign({}, AriaTelemetry.populateACSAdapterBaseProperties()), properties), { LogLevel: LogLevel_1.default.LOG }), | ||
priority: Enums_1.AWTEventPriority.High | ||
}; | ||
} | ||
/* istanbul ignore next */ | ||
@@ -194,3 +274,3 @@ this._debug && console.log("[AriaTelemetry][log]"); | ||
this._debug && console.log(event.properties.Event); | ||
!AriaTelemetry._disable && AriaTelemetry.logger.logEvent(event); | ||
!AriaTelemetry._disable && ((_a = AriaTelemetry.logger) === null || _a === void 0 ? void 0 : _a.logEvent(event)); | ||
}; | ||
@@ -213,2 +293,5 @@ Object.defineProperty(AriaTelemetry, "logger", { | ||
IC3Core: require('@microsoft/omnichannel-ic3core/package.json').version, | ||
ACSChat: require('@azure/communication-chat/package.json').version, | ||
ACSCommon: require('@azure/communication-common/package.json').version, | ||
AMSClient: require('@microsoft/omnichannel-amsclient/package.json').version, | ||
}; | ||
@@ -222,2 +305,3 @@ return { | ||
CallId: '', | ||
Domain: '', | ||
ExceptionDetails: '', | ||
@@ -227,3 +311,4 @@ ElapsedTimeInMilliseconds: '', | ||
NPMPackagesInfo: JSON.stringify(packagesInfo), | ||
CDNPackagesInfo: JSON.stringify(AriaTelemetry._CDNPackagesInfo) | ||
CDNPackagesInfo: JSON.stringify(AriaTelemetry._CDNPackagesInfo), | ||
PlatformDetails: '' | ||
}; | ||
@@ -233,14 +318,23 @@ }; | ||
var platformData = {}; // eslint-disable-line @typescript-eslint/no-explicit-any | ||
var platformDetails = {}; // eslint-disable-line @typescript-eslint/no-explicit-any | ||
if (!platform_1.isReactNative()) { | ||
return platformData; | ||
} | ||
try { | ||
var ReactNative = require('react-native'); // eslint-disable-line @typescript-eslint/no-var-requires | ||
var Platform = ReactNative.Platform; | ||
platformDetails.Renderer = Renderer.ReactNative; | ||
platformData.DeviceInfo_OsVersion = Platform.Version; | ||
if (Platform.OS === 'android') { | ||
platformDetails.DeviceInfo_OsVersion = Platform.Version; | ||
if (Platform.OS.toLowerCase() === 'android') { | ||
platformData.DeviceInfo_OsName = 'Android'; | ||
platformDetails.DeviceInfo_OsName = 'Android'; | ||
} | ||
else if (Platform.OS === 'ios') { | ||
else if (Platform.OS.toLowerCase() === 'ios') { | ||
platformData.DeviceInfo_OsName = 'iOS'; | ||
platformDetails.DeviceInfo_OsName = 'iOS'; | ||
} | ||
else { | ||
platformData.DeviceInfo_OsName = "" + Platform.OS; | ||
platformDetails.DeviceInfo_OsName = "" + Platform.OS; | ||
} | ||
@@ -254,4 +348,21 @@ /* istanbul ignore next */ | ||
} | ||
platformData.PlatformDetails = JSON.stringify(platformDetails); // Fallback if unable to overwrite Aria's default properties | ||
return platformData; | ||
}; | ||
AriaTelemetry.fillWebPlatformData = function () { | ||
var platformData = {}; // eslint-disable-line @typescript-eslint/no-explicit-any | ||
if (!platform_1.isBrowser()) { | ||
return platformData; | ||
} | ||
try { | ||
platformData.Domain = window.location.origin || ''; | ||
/* istanbul ignore next */ | ||
this._debug && console.log("[AriaTelemetry][fillWebPlatformData]"); | ||
} | ||
catch (_a) { | ||
/* istanbul ignore next */ | ||
this._debug && console.log("[AriaTelemetry][fillWebPlatformData][Error]"); | ||
} | ||
return platformData; | ||
}; | ||
AriaTelemetry.populateIC3ClientBaseProperties = function () { | ||
@@ -289,2 +400,28 @@ return { | ||
}; | ||
AriaTelemetry.populateACSClientBaseProperties = function () { | ||
return { | ||
OrgId: '', | ||
OrgUrl: '', | ||
WidgetId: '', | ||
RequestId: '', | ||
ChatId: '', | ||
Event: '', | ||
ExceptionDetails: '', | ||
ElapsedTimeInMilliseconds: '', | ||
ACSChatVersion: require('@azure/communication-chat/package.json').version // eslint-disable-line @typescript-eslint/no-var-requires | ||
}; | ||
}; | ||
AriaTelemetry.populateACSAdapterBaseProperties = function () { | ||
return { | ||
OrgId: '', | ||
OrgUrl: '', | ||
WidgetId: '', | ||
RequestId: '', | ||
ChatId: '', | ||
Event: '', | ||
ExceptionDetails: '', | ||
ElapsedTimeInMilliseconds: '', | ||
ACSAdapterVersion: settings_2.webChatACSAdapterVersion | ||
}; | ||
}; | ||
AriaTelemetry._debug = false; | ||
@@ -291,0 +428,0 @@ AriaTelemetry._disable = false; |
@@ -1,5 +0,5 @@ | ||
import IOmnichannelConfig from "../core/IOmnichannelConfig"; | ||
import AriaTelemetry from "./AriaTelemetry"; | ||
import { AWTEventData } from "../external/aria/webjs/AriaSDK"; | ||
import AriaTelemetry from "./AriaTelemetry"; | ||
import TelemetryEvent from "./TelemetryEvent"; | ||
import OmnichannelConfig from "../core/OmnichannelConfig"; | ||
import ScenarioType from "./ScenarioType"; | ||
declare class ScenarioMarker { | ||
@@ -10,9 +10,11 @@ private omnichannelConfig; | ||
private telemetry; | ||
constructor(omnichannelConfig: IOmnichannelConfig); | ||
private scenarioType; | ||
constructor(omnichannelConfig: OmnichannelConfig); | ||
setDebug(flag: boolean): void; | ||
setScenarioType(scenarioType: ScenarioType): void; | ||
useTelemetry(telemetry: typeof AriaTelemetry): void; | ||
startScenario(event: TelemetryEvent, additionalProperties?: AWTEventData["properties"]): void; | ||
failScenario(event: TelemetryEvent, additionalProperties?: AWTEventData["properties"]): void; | ||
completeScenario(event: TelemetryEvent, additionalProperties?: AWTEventData["properties"]): void; | ||
startScenario(event: string, additionalProperties?: AWTEventData["properties"]): void; | ||
failScenario(event: string, additionalProperties?: AWTEventData["properties"]): void; | ||
completeScenario(event: string, additionalProperties?: AWTEventData["properties"]): void; | ||
} | ||
export default ScenarioMarker; |
@@ -14,4 +14,5 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ScenarioType_1 = require("./ScenarioType"); | ||
var StopWatch_1 = require("./StopWatch"); | ||
var TelemetryEvent_1 = require("./TelemetryEvent"); | ||
var EventMarker_1 = require("./EventMarker"); | ||
var ScenarioMarker = /** @class */ (function () { | ||
@@ -23,2 +24,3 @@ function ScenarioMarker(omnichannelConfig) { | ||
this.telemetryEvents = new Map(); | ||
this.scenarioType = ScenarioType_1.default.EVENTS; | ||
} | ||
@@ -31,2 +33,5 @@ /* istanbul ignore next */ | ||
}; | ||
ScenarioMarker.prototype.setScenarioType = function (scenarioType) { | ||
this.scenarioType = scenarioType; | ||
}; | ||
ScenarioMarker.prototype.useTelemetry = function (telemetry) { | ||
@@ -45,4 +50,4 @@ this.debug && console.log("[ScenarioMarker][useTelemetry]"); | ||
} | ||
var properties = __assign({ Event: TelemetryEvent_1.startEvent(event), OrgId: this.omnichannelConfig.orgId, OrgUrl: this.omnichannelConfig.orgUrl, WidgetId: this.omnichannelConfig.widgetId }, additionalProperties); | ||
(_a = this.telemetry) === null || _a === void 0 ? void 0 : _a.info(properties); | ||
var properties = __assign({ Event: EventMarker_1.startEvent(event), OrgId: this.omnichannelConfig.orgId, OrgUrl: this.omnichannelConfig.orgUrl, WidgetId: this.omnichannelConfig.widgetId }, additionalProperties); | ||
(_a = this.telemetry) === null || _a === void 0 ? void 0 : _a.info(properties, this.scenarioType); | ||
}; | ||
@@ -59,4 +64,4 @@ ScenarioMarker.prototype.failScenario = function (event, additionalProperties) { | ||
this.telemetryEvents.delete(event); | ||
var properties = __assign({ Event: TelemetryEvent_1.failEvent(event), OrgId: this.omnichannelConfig.orgId, OrgUrl: this.omnichannelConfig.orgUrl, WidgetId: this.omnichannelConfig.widgetId, ElapsedTimeInMilliseconds: stopWatch.stop() }, additionalProperties); | ||
(_a = this.telemetry) === null || _a === void 0 ? void 0 : _a.error(properties); | ||
var properties = __assign({ Event: EventMarker_1.failEvent(event), OrgId: this.omnichannelConfig.orgId, OrgUrl: this.omnichannelConfig.orgUrl, WidgetId: this.omnichannelConfig.widgetId, ElapsedTimeInMilliseconds: stopWatch.stop() }, additionalProperties); | ||
(_a = this.telemetry) === null || _a === void 0 ? void 0 : _a.error(properties, this.scenarioType); | ||
}; | ||
@@ -73,4 +78,4 @@ ScenarioMarker.prototype.completeScenario = function (event, additionalProperties) { | ||
this.telemetryEvents.delete(event); | ||
var properties = __assign({ Event: TelemetryEvent_1.completeEvent(event), OrgId: this.omnichannelConfig.orgId, OrgUrl: this.omnichannelConfig.orgUrl, WidgetId: this.omnichannelConfig.widgetId, ElapsedTimeInMilliseconds: stopWatch.stop() }, additionalProperties); | ||
(_a = this.telemetry) === null || _a === void 0 ? void 0 : _a.info(properties); | ||
var properties = __assign({ Event: EventMarker_1.completeEvent(event), OrgId: this.omnichannelConfig.orgId, OrgUrl: this.omnichannelConfig.orgUrl, WidgetId: this.omnichannelConfig.widgetId, ElapsedTimeInMilliseconds: stopWatch.stop() }, additionalProperties); | ||
(_a = this.telemetry) === null || _a === void 0 ? void 0 : _a.info(properties, this.scenarioType); | ||
}; | ||
@@ -77,0 +82,0 @@ return ScenarioMarker; |
@@ -5,4 +5,6 @@ declare enum ScenarioType { | ||
OCSDK = "occhatsdk_ocsdkevents", | ||
ACSCLIENT = "occhatsdk_acsclientevents", | ||
ACSADAPTER = "occhatsdk_acsadapterevents", | ||
UNDEFINED = "undefined" | ||
} | ||
export default ScenarioType; |
@@ -8,2 +8,4 @@ "use strict"; | ||
ScenarioType["OCSDK"] = "occhatsdk_ocsdkevents"; | ||
ScenarioType["ACSCLIENT"] = "occhatsdk_acsclientevents"; | ||
ScenarioType["ACSADAPTER"] = "occhatsdk_acsadapterevents"; | ||
ScenarioType["UNDEFINED"] = "undefined"; | ||
@@ -10,0 +12,0 @@ })(ScenarioType || (ScenarioType = {})); |
@@ -8,6 +8,13 @@ declare enum TelemetryEvent { | ||
GetLiveChatConfig = "GetLiveChatConfig", | ||
GetAuthToken = "GetAuthToken", | ||
GetPreChatSurvey = "GetPreChatSurvey", | ||
GetChatToken = "GetChatToken", | ||
GetConversationDetails = "GetConversationDetails", | ||
GetCurrentLiveChatContext = "GetCurrentLiveChatContext", | ||
GetMessages = "GetMessages", | ||
SendMessages = "SendMessages", | ||
SendTypingEvent = "SendTypingEvent", | ||
OnAgentEndSession = "OnAgentEndSession", | ||
OnNewMessage = "OnNewMessage", | ||
OnTypingEvent = "OnTypingEvent", | ||
UploadFileAttachment = "UploadFileAttachment", | ||
@@ -30,5 +37,2 @@ DownloadFileAttachment = "DownloadFileAttachment", | ||
} | ||
export declare const startEvent: (event: TelemetryEvent) => string; | ||
export declare const completeEvent: (event: TelemetryEvent) => string; | ||
export declare const failEvent: (event: TelemetryEvent) => string; | ||
export default TelemetryEvent; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.failEvent = exports.completeEvent = exports.startEvent = void 0; | ||
var TelemetryEvent; | ||
@@ -12,6 +11,13 @@ (function (TelemetryEvent) { | ||
TelemetryEvent["GetLiveChatConfig"] = "GetLiveChatConfig"; | ||
TelemetryEvent["GetAuthToken"] = "GetAuthToken"; | ||
TelemetryEvent["GetPreChatSurvey"] = "GetPreChatSurvey"; | ||
TelemetryEvent["GetChatToken"] = "GetChatToken"; | ||
TelemetryEvent["GetConversationDetails"] = "GetConversationDetails"; | ||
TelemetryEvent["GetCurrentLiveChatContext"] = "GetCurrentLiveChatContext"; | ||
TelemetryEvent["GetMessages"] = "GetMessages"; | ||
TelemetryEvent["SendMessages"] = "SendMessages"; | ||
TelemetryEvent["SendTypingEvent"] = "SendTypingEvent"; | ||
TelemetryEvent["OnAgentEndSession"] = "OnAgentEndSession"; | ||
TelemetryEvent["OnNewMessage"] = "OnNewMessage"; | ||
TelemetryEvent["OnTypingEvent"] = "OnTypingEvent"; | ||
TelemetryEvent["UploadFileAttachment"] = "UploadFileAttachment"; | ||
@@ -34,12 +40,3 @@ TelemetryEvent["DownloadFileAttachment"] = "DownloadFileAttachment"; | ||
})(TelemetryEvent || (TelemetryEvent = {})); | ||
exports.startEvent = function (event) { | ||
return event + "Started"; | ||
}; | ||
exports.completeEvent = function (event) { | ||
return event + "Completed"; | ||
}; | ||
exports.failEvent = function (event) { | ||
return event + "Failed"; | ||
}; | ||
exports.default = TelemetryEvent; | ||
//# sourceMappingURL=TelemetryEvent.js.map |
declare const getIC3ClientCDNUrl: (version?: string) => string; | ||
declare const getIC3AdapterCDNUrl: (version?: string) => string; | ||
declare const getACSAdapterCDNUrl: (version?: string) => string; | ||
declare const _default: { | ||
getIC3ClientCDNUrl: (version?: string) => string; | ||
getIC3AdapterCDNUrl: (version?: string) => string; | ||
getACSAdapterCDNUrl: (version?: string) => string; | ||
}; | ||
export default _default; | ||
export { getIC3ClientCDNUrl, getIC3AdapterCDNUrl }; | ||
export { getIC3ClientCDNUrl, getIC3AdapterCDNUrl, getACSAdapterCDNUrl }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getIC3AdapterCDNUrl = exports.getIC3ClientCDNUrl = void 0; | ||
exports.getACSAdapterCDNUrl = exports.getIC3AdapterCDNUrl = exports.getIC3ClientCDNUrl = void 0; | ||
var settings_1 = require("../config/settings"); | ||
@@ -17,6 +17,13 @@ var getIC3ClientCDNUrl = function (version) { | ||
exports.getIC3AdapterCDNUrl = getIC3AdapterCDNUrl; | ||
var getACSAdapterCDNUrl = function (version) { | ||
if (version === void 0) { version = settings_1.webChatACSAdapterVersion; } | ||
var ACSAdapterCDNUrl = "https://unpkg.com/acs_webchat-chat-adapter@" + version + "/dist/chat-adapter.js"; | ||
return ACSAdapterCDNUrl; | ||
}; | ||
exports.getACSAdapterCDNUrl = getACSAdapterCDNUrl; | ||
exports.default = { | ||
getIC3ClientCDNUrl: getIC3ClientCDNUrl, | ||
getIC3AdapterCDNUrl: getIC3AdapterCDNUrl | ||
getIC3AdapterCDNUrl: getIC3AdapterCDNUrl, | ||
getACSAdapterCDNUrl: getACSAdapterCDNUrl | ||
}; | ||
//# sourceMappingURL=libraries.js.map |
@@ -1,3 +0,3 @@ | ||
import LogLevel from "@microsoft/omnichannel-ic3core/lib/logging/LogLevel"; | ||
import IOmnichannelConfig from "../core/IOmnichannelConfig"; | ||
import LogLevel from "../telemetry/LogLevel"; | ||
import OmnichannelConfig from "../core/OmnichannelConfig"; | ||
import IIC3SDKLogData from "../external/IC3Client/IIC3SDKLogData"; | ||
@@ -12,3 +12,3 @@ import IOCSDKLogData from "../external/OCSDK/IOCSDKLogData"; | ||
private telemetry; | ||
constructor(omnichannelConfig: IOmnichannelConfig); | ||
constructor(omnichannelConfig: OmnichannelConfig); | ||
setDebug(flag: boolean): void; | ||
@@ -26,3 +26,3 @@ setRequestId(requestId: string): void; | ||
private telemetry; | ||
constructor(omnichannelConfig: IOmnichannelConfig); | ||
constructor(omnichannelConfig: OmnichannelConfig); | ||
setDebug(flag: boolean): void; | ||
@@ -34,3 +34,39 @@ setRequestId(requestId: string): void; | ||
} | ||
export declare const createIC3ClientLogger: (omnichannelConfig: IOmnichannelConfig, debug?: boolean) => IC3ClientLogger; | ||
export declare const createOCSDKLogger: (omnichannelConfig: IOmnichannelConfig, debug?: boolean) => OCSDKLogger; | ||
export declare class ACSClientLogger { | ||
private omnichannelConfig; | ||
private debug; | ||
private requestId; | ||
private chatId; | ||
private telemetry; | ||
private scenarioMarker; | ||
constructor(omnichannelConfig: OmnichannelConfig); | ||
setDebug(flag: boolean): void; | ||
setRequestId(requestId: string): void; | ||
setChatId(chatId: string): void; | ||
useTelemetry(telemetry: typeof AriaTelemetry): void; | ||
logClientSdkTelemetryEvent(logLevel: LogLevel, event: any): void; | ||
startScenario(event: string, additionalProperties?: any): void; | ||
failScenario(event: string, additionalProperties?: any): void; | ||
completeScenario(event: string, additionalProperties?: any): void; | ||
} | ||
export declare class ACSAdapterLogger { | ||
private omnichannelConfig; | ||
private debug; | ||
private requestId; | ||
private chatId; | ||
private telemetry; | ||
private scenarioMarker; | ||
constructor(omnichannelConfig: OmnichannelConfig); | ||
setDebug(flag: boolean): void; | ||
setRequestId(requestId: string): void; | ||
setChatId(chatId: string): void; | ||
useTelemetry(telemetry: typeof AriaTelemetry): void; | ||
logClientSdkTelemetryEvent(logLevel: LogLevel, event: any): void; | ||
startScenario(event: string, additionalProperties?: any): void; | ||
failScenario(event: string, additionalProperties?: any): void; | ||
completeScenario(event: string, additionalProperties?: any): void; | ||
} | ||
export declare const createIC3ClientLogger: (omnichannelConfig: OmnichannelConfig, debug?: boolean) => IC3ClientLogger; | ||
export declare const createOCSDKLogger: (omnichannelConfig: OmnichannelConfig, debug?: boolean) => OCSDKLogger; | ||
export declare const createACSClientLogger: (omnichannelConfig: OmnichannelConfig, debug?: boolean) => ACSClientLogger; | ||
export declare const createACSAdapterLogger: (omnichannelConfig: OmnichannelConfig, debug?: boolean) => ACSAdapterLogger; |
@@ -14,5 +14,6 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createOCSDKLogger = exports.createIC3ClientLogger = exports.OCSDKLogger = exports.IC3ClientLogger = void 0; | ||
var LogLevel_1 = require("@microsoft/omnichannel-ic3core/lib/logging/LogLevel"); | ||
exports.createACSAdapterLogger = exports.createACSClientLogger = exports.createOCSDKLogger = exports.createIC3ClientLogger = exports.ACSAdapterLogger = exports.ACSClientLogger = exports.OCSDKLogger = exports.IC3ClientLogger = void 0; | ||
var LogLevel_1 = require("../telemetry/LogLevel"); | ||
var ScenarioType_1 = require("../telemetry/ScenarioType"); | ||
var ScenarioMarker_1 = require("../telemetry/ScenarioMarker"); | ||
var IC3ClientLogger = /** @class */ (function () { | ||
@@ -132,2 +133,184 @@ function IC3ClientLogger(omnichannelConfig) { | ||
exports.OCSDKLogger = OCSDKLogger; | ||
var ACSClientLogger = /** @class */ (function () { | ||
function ACSClientLogger(omnichannelConfig) { | ||
this.omnichannelConfig = omnichannelConfig; | ||
this.debug = false; | ||
this.requestId = ''; | ||
this.chatId = ''; | ||
this.telemetry = null; | ||
this.scenarioMarker = null; | ||
this.debug = false; | ||
this.scenarioMarker = new ScenarioMarker_1.default(omnichannelConfig); | ||
this.scenarioMarker.setScenarioType(ScenarioType_1.default.ACSCLIENT); | ||
} | ||
/* istanbul ignore next */ | ||
ACSClientLogger.prototype.setDebug = function (flag) { | ||
var _a; | ||
this.debug = flag; | ||
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.setDebug(flag); | ||
}; | ||
ACSClientLogger.prototype.setRequestId = function (requestId) { | ||
this.requestId = requestId; | ||
}; | ||
ACSClientLogger.prototype.setChatId = function (chatId) { | ||
this.chatId = chatId; | ||
}; | ||
ACSClientLogger.prototype.useTelemetry = function (telemetry) { | ||
var _a; | ||
/* istanbul ignore next */ | ||
this.debug && console.log("[ACSClientLogger][useTelemetry]"); | ||
this.telemetry = telemetry; | ||
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.useTelemetry(this.telemetry); | ||
}; | ||
ACSClientLogger.prototype.logClientSdkTelemetryEvent = function (logLevel, event) { | ||
var _a, _b, _c, _d; | ||
/* istanbul ignore next */ | ||
this.debug && console.log("[ACSClientLogger][logClientSdkTelemetryEvent][" + logLevel + "]"); | ||
/* istanbul ignore next */ | ||
this.debug && console.log(event); | ||
var baseProperties = { | ||
OrgId: this.omnichannelConfig.orgId, | ||
OrgUrl: this.omnichannelConfig.orgUrl, | ||
WidgetId: this.omnichannelConfig.widgetId, | ||
RequestId: this.requestId, | ||
ChatId: this.chatId | ||
}; | ||
var additionalProperties = __assign(__assign({}, event), { ExceptionDetails: event.ExceptionDetails ? JSON.stringify(event.ExceptionDetails) : '' }); | ||
switch (logLevel) { | ||
case LogLevel_1.default.DEBUG: | ||
(_a = this.telemetry) === null || _a === void 0 ? void 0 : _a.debug(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.ACSCLIENT); | ||
break; | ||
case LogLevel_1.default.WARN: | ||
(_b = this.telemetry) === null || _b === void 0 ? void 0 : _b.warn(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.ACSCLIENT); | ||
break; | ||
case LogLevel_1.default.ERROR: | ||
(_c = this.telemetry) === null || _c === void 0 ? void 0 : _c.error(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.ACSCLIENT); | ||
break; | ||
case LogLevel_1.default.INFO: | ||
default: | ||
(_d = this.telemetry) === null || _d === void 0 ? void 0 : _d.info(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.ACSCLIENT); | ||
break; | ||
} | ||
}; | ||
ACSClientLogger.prototype.startScenario = function (event, additionalProperties) { | ||
var _a; | ||
if (additionalProperties === void 0) { additionalProperties = {}; } | ||
var baseProperties = { | ||
RequestId: this.requestId, | ||
ChatId: this.chatId | ||
}; | ||
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.startScenario(event, __assign(__assign({}, baseProperties), additionalProperties)); | ||
}; | ||
ACSClientLogger.prototype.failScenario = function (event, additionalProperties) { | ||
var _a; | ||
if (additionalProperties === void 0) { additionalProperties = {}; } | ||
var baseProperties = { | ||
RequestId: this.requestId, | ||
ChatId: this.chatId | ||
}; | ||
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.failScenario(event, __assign(__assign({}, baseProperties), additionalProperties)); | ||
}; | ||
ACSClientLogger.prototype.completeScenario = function (event, additionalProperties) { | ||
var _a; | ||
if (additionalProperties === void 0) { additionalProperties = {}; } | ||
var baseProperties = { | ||
RequestId: this.requestId, | ||
ChatId: this.chatId | ||
}; | ||
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.completeScenario(event, __assign(__assign({}, baseProperties), additionalProperties)); | ||
}; | ||
return ACSClientLogger; | ||
}()); | ||
exports.ACSClientLogger = ACSClientLogger; | ||
var ACSAdapterLogger = /** @class */ (function () { | ||
function ACSAdapterLogger(omnichannelConfig) { | ||
this.omnichannelConfig = omnichannelConfig; | ||
this.debug = false; | ||
this.requestId = ''; | ||
this.chatId = ''; | ||
this.telemetry = null; | ||
this.scenarioMarker = null; | ||
this.debug = false; | ||
this.scenarioMarker = new ScenarioMarker_1.default(omnichannelConfig); | ||
this.scenarioMarker.setScenarioType(ScenarioType_1.default.ACSADAPTER); | ||
} | ||
/* istanbul ignore next */ | ||
ACSAdapterLogger.prototype.setDebug = function (flag) { | ||
var _a; | ||
this.debug = flag; | ||
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.setDebug(flag); | ||
}; | ||
ACSAdapterLogger.prototype.setRequestId = function (requestId) { | ||
this.requestId = requestId; | ||
}; | ||
ACSAdapterLogger.prototype.setChatId = function (chatId) { | ||
this.chatId = chatId; | ||
}; | ||
ACSAdapterLogger.prototype.useTelemetry = function (telemetry) { | ||
var _a; | ||
/* istanbul ignore next */ | ||
this.debug && console.log("[ACSAdapterLogger][useTelemetry]"); | ||
this.telemetry = telemetry; | ||
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.useTelemetry(this.telemetry); | ||
}; | ||
ACSAdapterLogger.prototype.logClientSdkTelemetryEvent = function (logLevel, event) { | ||
var _a, _b, _c, _d; | ||
/* istanbul ignore next */ | ||
this.debug && console.log("[ACSAdapterLogger][logClientSdkTelemetryEvent][" + logLevel + "]"); | ||
/* istanbul ignore next */ | ||
this.debug && console.log(event); | ||
var baseProperties = { | ||
OrgId: this.omnichannelConfig.orgId, | ||
OrgUrl: this.omnichannelConfig.orgUrl, | ||
WidgetId: this.omnichannelConfig.widgetId, | ||
RequestId: this.requestId, | ||
ChatId: this.chatId | ||
}; | ||
var additionalProperties = __assign(__assign({}, event), { ExceptionDetails: event.ExceptionDetails ? JSON.stringify(event.ExceptionDetails) : '' }); | ||
switch (logLevel) { | ||
case LogLevel_1.default.DEBUG: | ||
(_a = this.telemetry) === null || _a === void 0 ? void 0 : _a.debug(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.ACSADAPTER); | ||
break; | ||
case LogLevel_1.default.WARN: | ||
(_b = this.telemetry) === null || _b === void 0 ? void 0 : _b.warn(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.ACSADAPTER); | ||
break; | ||
case LogLevel_1.default.ERROR: | ||
(_c = this.telemetry) === null || _c === void 0 ? void 0 : _c.error(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.ACSADAPTER); | ||
break; | ||
case LogLevel_1.default.INFO: | ||
default: | ||
(_d = this.telemetry) === null || _d === void 0 ? void 0 : _d.info(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.ACSADAPTER); | ||
break; | ||
} | ||
}; | ||
ACSAdapterLogger.prototype.startScenario = function (event, additionalProperties) { | ||
var _a; | ||
if (additionalProperties === void 0) { additionalProperties = {}; } | ||
var baseProperties = { | ||
RequestId: this.requestId, | ||
ChatId: this.chatId | ||
}; | ||
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.startScenario(event, __assign(__assign({}, baseProperties), additionalProperties)); | ||
}; | ||
ACSAdapterLogger.prototype.failScenario = function (event, additionalProperties) { | ||
var _a; | ||
if (additionalProperties === void 0) { additionalProperties = {}; } | ||
var baseProperties = { | ||
RequestId: this.requestId, | ||
ChatId: this.chatId | ||
}; | ||
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.failScenario(event, __assign(__assign({}, baseProperties), additionalProperties)); | ||
}; | ||
ACSAdapterLogger.prototype.completeScenario = function (event, additionalProperties) { | ||
var _a; | ||
if (additionalProperties === void 0) { additionalProperties = {}; } | ||
var baseProperties = { | ||
RequestId: this.requestId, | ||
ChatId: this.chatId | ||
}; | ||
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.completeScenario(event, __assign(__assign({}, baseProperties), additionalProperties)); | ||
}; | ||
return ACSAdapterLogger; | ||
}()); | ||
exports.ACSAdapterLogger = ACSAdapterLogger; | ||
exports.createIC3ClientLogger = function (omnichannelConfig, debug) { | ||
@@ -145,2 +328,14 @@ if (debug === void 0) { debug = false; } | ||
}; | ||
exports.createACSClientLogger = function (omnichannelConfig, debug) { | ||
if (debug === void 0) { debug = false; } | ||
var logger = new ACSClientLogger(omnichannelConfig); | ||
logger.setDebug(debug); | ||
return logger; | ||
}; | ||
exports.createACSAdapterLogger = function (omnichannelConfig, debug) { | ||
if (debug === void 0) { debug = false; } | ||
var logger = new ACSAdapterLogger(omnichannelConfig); | ||
logger.setDebug(debug); | ||
return logger; | ||
}; | ||
//# sourceMappingURL=loggers.js.map |
@@ -5,11 +5,18 @@ "use strict"; | ||
var MessageType_1 = require("@microsoft/omnichannel-ic3core/lib/model/MessageType"); | ||
var ACSParticipantDisplayName_1 = require("../core/messaging/ACSParticipantDisplayName"); | ||
exports.isSystemMessage = function (message) { | ||
var messageType = message.messageType, properties = message.properties; | ||
return (messageType === MessageType_1.default.UserMessage) | ||
&& (properties.tags.includes("system")); | ||
var conditionV1 = messageType === MessageType_1.default.UserMessage | ||
&& properties | ||
&& properties.tags | ||
&& properties.tags.includes("system"); | ||
var conditionV2 = message.tags && message.tags.includes("system"); | ||
return conditionV1 || conditionV2 || false; | ||
}; | ||
exports.isCustomerMessage = function (message) { | ||
var sender = message.sender; | ||
return (sender.id.includes('contacts/8:')); | ||
var conditionV1 = sender && sender.id && sender.id.includes('contacts/8:'); | ||
var conditionV2 = sender && sender.displayName && sender.displayName === ACSParticipantDisplayName_1.default.Customer; | ||
return conditionV1 || conditionV2 || false; | ||
}; | ||
//# sourceMappingURL=utilities.js.map |
@@ -1,3 +0,3 @@ | ||
import IOmnichannelConfig from "../core/IOmnichannelConfig"; | ||
declare const validateOmnichannelConfig: (omnichannelConfig: IOmnichannelConfig) => void; | ||
import OmnichannelConfig from "../core/OmnichannelConfig"; | ||
declare const validateOmnichannelConfig: (omnichannelConfig: OmnichannelConfig) => void; | ||
export default validateOmnichannelConfig; |
@@ -1,5 +0,5 @@ | ||
import IChatSDKConfig from "../core/IChatSDKConfig"; | ||
declare const defaultChatSDKConfig: IChatSDKConfig; | ||
declare const validateSDKConfig: (chatSDKConfig: IChatSDKConfig) => void; | ||
import ChatSDKConfig from "../core/ChatSDKConfig"; | ||
declare const defaultChatSDKConfig: ChatSDKConfig; | ||
declare const validateSDKConfig: (chatSDKConfig: ChatSDKConfig) => void; | ||
export { defaultChatSDKConfig }; | ||
export default validateSDKConfig; |
{ | ||
"name": "@microsoft/omnichannel-chat-sdk", | ||
"version": "0.3.0", | ||
"version": "0.3.1-main.7903549", | ||
"description": "Microsoft Omnichannel Chat SDK", | ||
@@ -32,2 +32,3 @@ "files": [ | ||
"devDependencies": { | ||
"@types/core-js": "^2.5.5", | ||
"@types/jest": "^27.0.1", | ||
@@ -42,5 +43,8 @@ "@typescript-eslint/eslint-plugin": "^4.30.0", | ||
"dependencies": { | ||
"@microsoft/ocsdk": "^0.2.0", | ||
"@microsoft/omnichannel-ic3core": "^0.1.1" | ||
"@azure/communication-chat": "1.1.0-beta.2", | ||
"@azure/communication-common": "1.1.0", | ||
"@microsoft/ocsdk": "^0.3.0", | ||
"@microsoft/omnichannel-amsclient": "^0.1.0", | ||
"@microsoft/omnichannel-ic3core": "^0.1.2" | ||
} | ||
} |
@@ -5,2 +5,3 @@ # Omnichannel Chat SDK | ||
 | ||
 | ||
@@ -14,2 +15,3 @@ Headless Chat SDK to build your own chat widget against Dynamics 365 Omnichannel Services. | ||
- [Installation](#installation) | ||
- [Installation on React Native](#installation-on-react-native) | ||
- [API Reference](#api-reference) | ||
@@ -64,2 +66,30 @@ - [API Examples](#api-examples) | ||
## Installation on React Native | ||
The following steps will be required to run Omnichannel Chat SDK on React Native: | ||
1. Run `npm install node-libs-react-native --save-dev` | ||
1. Update *metro.config.js* to use React Native compatible Node Core modules | ||
```ts | ||
module.exports = { | ||
// ... | ||
resolver: { | ||
extraNodeModules: { | ||
...require('node-libs-react-native'), | ||
net: require.resolve('node-libs-react-native/mock/net'), | ||
tls: require.resolve('node-libs-react-native/mock/tls') | ||
} | ||
}; | ||
``` | ||
1. Import 'node-libs-react-native/globals' on top of your entry point file | ||
```ts | ||
import 'node-libs-react-native/globals'; | ||
``` | ||
1. Install `react-native-randomBytes` | ||
``` | ||
npm install react-native-randombytes --save-dev | ||
``` | ||
## API Reference | ||
@@ -66,0 +96,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1213762
62.09%228
15.15%11346
23.84%716
4.37%5
150%8
14.29%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
Updated