@microsoft/omnichannel-chat-sdk 1.9.5-main.fd99e0f → 1.9.6
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 +128 -114
- package/lib/OmnichannelChatSDK.js +2609 -2394
- package/lib/OmnichannelChatSDK.js.map +1 -1
- package/lib/api/createVoiceVideoCalling.d.ts +53 -53
- package/lib/api/createVoiceVideoCalling.js +462 -462
- package/lib/commands/throwUnsupportedLiveChatVersionFailureIfApplicable.d.ts +3 -0
- package/lib/commands/throwUnsupportedLiveChatVersionFailureIfApplicable.js +14 -0
- package/lib/commands/throwUnsupportedLiveChatVersionFailureIfApplicable.js.map +1 -0
- package/lib/config/ocSDKConfiguration.d.ts +7 -7
- package/lib/config/ocSDKConfiguration.js +9 -9
- package/lib/config/settings.d.ts +6 -6
- package/lib/config/settings.js +13 -13
- package/lib/core/AuthSettings.d.ts +5 -5
- package/lib/core/AuthSettings.js +2 -2
- package/lib/core/AxiosErrorCodes.d.ts +4 -4
- package/lib/core/AxiosErrorCodes.js +7 -7
- package/lib/core/CallingOptionsOptionSetNumber.d.ts +6 -6
- package/lib/core/CallingOptionsOptionSetNumber.js +9 -9
- package/lib/core/ChatConfig.d.ts +10 -10
- package/lib/core/ChatConfig.js +2 -2
- package/lib/core/ChatReconnectContext.d.ts +4 -4
- package/lib/core/ChatReconnectContext.js +2 -2
- package/lib/core/ChatReconnectOptionalParams.d.ts +3 -3
- package/lib/core/ChatReconnectOptionalParams.js +2 -2
- package/lib/core/ChatSDKConfig.d.ts +38 -38
- package/lib/core/ChatSDKConfig.js +2 -2
- package/lib/core/ChatSDKError.d.ts +64 -63
- package/lib/core/ChatSDKError.js +73 -72
- package/lib/core/ChatSDKError.js.map +1 -1
- package/lib/core/ChatSDKExceptionDetails.d.ts +13 -13
- package/lib/core/ChatSDKExceptionDetails.js +2 -2
- package/lib/core/ChatTranscriptBody.d.ts +5 -5
- package/lib/core/ChatTranscriptBody.js +2 -2
- package/lib/core/ConversationMode.d.ts +5 -5
- package/lib/core/ConversationMode.js +8 -8
- package/lib/core/EmailLiveChatTranscriptOptionalParams.d.ts +4 -4
- package/lib/core/EmailLiveChatTranscriptOptionalParams.js +2 -2
- package/lib/core/GetAgentAvailabilityOptionalParams.d.ts +13 -13
- package/lib/core/GetAgentAvailabilityOptionalParams.js +2 -2
- package/lib/core/GetChatTokenOptionalParams.d.ts +3 -3
- package/lib/core/GetChatTokenOptionalParams.js +2 -2
- package/lib/core/GetConversationDetailsOptionalParams.d.ts +4 -4
- package/lib/core/GetConversationDetailsOptionalParams.js +2 -2
- package/lib/core/GetLiveChatConfigOptionalParams.d.ts +5 -5
- package/lib/core/GetLiveChatConfigOptionalParams.js +2 -2
- package/lib/core/GetLiveChatTranscriptOptionalParams.d.ts +4 -4
- package/lib/core/GetLiveChatTranscriptOptionalParams.js +2 -2
- package/lib/core/InitializeOptionalParams.d.ts +6 -5
- package/lib/core/InitializeOptionalParams.js +2 -2
- package/lib/core/LiveChatContext.d.ts +14 -14
- package/lib/core/LiveChatContext.js +2 -2
- package/lib/core/LiveChatVersion.d.ts +5 -5
- package/lib/core/LiveChatVersion.js +8 -8
- package/lib/core/LiveWorkItemDetails.d.ts +8 -8
- package/lib/core/LiveWorkItemDetails.js +2 -2
- package/lib/core/LiveWorkItemState.d.ts +8 -8
- package/lib/core/LiveWorkItemState.js +11 -11
- package/lib/core/OmnichannelConfig.d.ts +5 -5
- package/lib/core/OmnichannelConfig.js +2 -2
- package/lib/core/OmnichannelErrorCodes.d.ts +4 -4
- package/lib/core/OmnichannelErrorCodes.js +7 -7
- package/lib/core/PostChatContext.d.ts +8 -8
- package/lib/core/PostChatContext.js +2 -2
- package/lib/core/SetAuthTokenProviderOptionalParams.d.ts +3 -3
- package/lib/core/SetAuthTokenProviderOptionalParams.js +2 -2
- package/lib/core/StartChatOptionalParams.d.ts +18 -18
- package/lib/core/StartChatOptionalParams.js +2 -2
- package/lib/core/messaging/ACSChatMessageType.d.ts +7 -7
- package/lib/core/messaging/ACSChatMessageType.js +10 -10
- package/lib/core/messaging/ACSClient.d.ts +45 -45
- package/lib/core/messaging/ACSClient.js +612 -612
- package/lib/core/messaging/ACSClientConfig.d.ts +5 -5
- package/lib/core/messaging/ACSClientConfig.js +2 -2
- package/lib/core/messaging/ACSParticipantDisplayName.d.ts +6 -6
- package/lib/core/messaging/ACSParticipantDisplayName.js +9 -9
- package/lib/core/messaging/ACSSessionInfo.d.ts +5 -5
- package/lib/core/messaging/ACSSessionInfo.js +2 -2
- package/lib/core/messaging/ChatAdapterConfig.d.ts +8 -8
- package/lib/core/messaging/ChatAdapterConfig.js +2 -2
- package/lib/core/messaging/ChatAdapterOptionalParams.d.ts +24 -24
- package/lib/core/messaging/ChatAdapterOptionalParams.js +2 -2
- package/lib/core/messaging/ChatAdapterProtocols.d.ts +6 -6
- package/lib/core/messaging/ChatAdapterProtocols.js +10 -10
- package/lib/core/messaging/ChatSDKMessage.d.ts +6 -6
- package/lib/core/messaging/ChatSDKMessage.js +2 -2
- package/lib/core/messaging/IC3Config.d.ts +4 -4
- package/lib/core/messaging/IC3Config.js +2 -2
- package/lib/core/messaging/MessageTags.d.ts +3 -3
- package/lib/core/messaging/MessageTags.js +6 -6
- package/lib/core/messaging/OmnichannelMessage.d.ts +64 -64
- package/lib/core/messaging/OmnichannelMessage.js +51 -51
- package/lib/core/messaging/OnNewMessageOptionalParams.d.ts +3 -3
- package/lib/core/messaging/OnNewMessageOptionalParams.js +2 -2
- package/lib/external/ACSAdapter/AMSFileManager.d.ts +76 -76
- package/lib/external/ACSAdapter/AMSFileManager.js +394 -394
- package/lib/external/ACSAdapter/AMSFileScanner.d.ts +36 -36
- package/lib/external/ACSAdapter/AMSFileScanner.js +275 -275
- package/lib/external/ACSAdapter/activityUtils.d.ts +9 -9
- package/lib/external/ACSAdapter/activityUtils.js +79 -79
- package/lib/external/ACSAdapter/createChannelDataEgressMiddleware.d.ts +5 -5
- package/lib/external/ACSAdapter/createChannelDataEgressMiddleware.js +33 -33
- package/lib/external/ACSAdapter/createFileScanIngressMiddleware.d.ts +2 -2
- package/lib/external/ACSAdapter/createFileScanIngressMiddleware.js +95 -95
- package/lib/external/ACSAdapter/createFormatEgressTagsMiddleware.d.ts +2 -2
- package/lib/external/ACSAdapter/createFormatEgressTagsMiddleware.js +30 -30
- package/lib/external/ACSAdapter/createFormatIngressTagsMiddleware.d.ts +2 -2
- package/lib/external/ACSAdapter/createFormatIngressTagsMiddleware.js +24 -24
- package/lib/external/CallingSDK/ICallingSDKLogData.d.ts +7 -7
- package/lib/external/CallingSDK/ICallingSDKLogData.js +2 -2
- package/lib/external/IC3Adapter/IChatToken.d.ts +11 -11
- package/lib/external/IC3Adapter/IChatToken.js +3 -3
- package/lib/external/IC3Adapter/IIC3AdapterOptions.d.ts +22 -22
- package/lib/external/IC3Adapter/IIC3AdapterOptions.js +2 -2
- package/lib/external/IC3Adapter/INotification.d.ts +6 -6
- package/lib/external/IC3Adapter/INotification.js +2 -2
- package/lib/external/IC3Adapter/Notification.d.ts +7 -7
- package/lib/external/IC3Adapter/Notification.js +14 -14
- package/lib/external/IC3Client/IIC3SDKLogData.d.ts +9 -9
- package/lib/external/IC3Client/IIC3SDKLogData.js +2 -2
- package/lib/external/OCSDK/IOCSDKLogData.d.ts +14 -14
- package/lib/external/OCSDK/IOCSDKLogData.js +2 -2
- package/lib/index.d.ts +25 -25
- package/lib/index.js +34 -34
- package/lib/telemetry/AriaTelemetry.d.ts +40 -40
- package/lib/telemetry/AriaTelemetry.js +539 -539
- package/lib/telemetry/EUDomainNames.d.ts +2 -2
- package/lib/telemetry/EUDomainNames.js +16 -16
- package/lib/telemetry/EventMarker.d.ts +3 -3
- package/lib/telemetry/EventMarker.js +12 -12
- package/lib/telemetry/GCCDomainPatterns.d.ts +2 -2
- package/lib/telemetry/GCCDomainPatterns.js +7 -7
- package/lib/telemetry/LogLevel.d.ts +8 -8
- package/lib/telemetry/LogLevel.js +11 -11
- package/lib/telemetry/ScenarioMarker.d.ts +21 -21
- package/lib/telemetry/ScenarioMarker.js +82 -82
- package/lib/telemetry/ScenarioType.d.ts +11 -11
- package/lib/telemetry/ScenarioType.js +14 -14
- package/lib/telemetry/StopWatch.d.ts +6 -6
- package/lib/telemetry/StopWatch.js +14 -14
- package/lib/telemetry/TelemetryEvent.d.ts +46 -42
- package/lib/telemetry/TelemetryEvent.js +49 -45
- package/lib/telemetry/TelemetryEvent.js.map +1 -1
- package/lib/telemetry/retrieveCollectorUri.d.ts +2 -2
- package/lib/telemetry/retrieveCollectorUri.js +25 -25
- package/lib/tsconfig.tsbuildinfo +1977 -1912
- package/lib/utils/AMSClientLoadStates.d.ts +6 -0
- package/lib/utils/AMSClientLoadStates.js +12 -0
- package/lib/utils/AMSClientLoadStates.js.map +1 -0
- package/lib/utils/CoreServicesUtils.d.ts +7 -7
- package/lib/utils/CoreServicesUtils.js +39 -39
- package/lib/utils/CoreServicesUtils.js.map +1 -1
- package/lib/utils/WebUtils.d.ts +10 -10
- package/lib/utils/WebUtils.js +128 -128
- package/lib/utils/chatAdapterCreators.d.ts +20 -20
- package/lib/utils/chatAdapterCreators.js +208 -208
- package/lib/utils/createOcSDKConfiguration.d.ts +4 -4
- package/lib/utils/createOcSDKConfiguration.js +22 -22
- package/lib/utils/createOmnichannelMessage.d.ts +11 -11
- package/lib/utils/createOmnichannelMessage.js +77 -77
- package/lib/utils/createTelemetry.d.ts +3 -3
- package/lib/utils/createTelemetry.js +9 -9
- package/lib/utils/exceptionSuppressors.d.ts +29 -29
- package/lib/utils/exceptionSuppressors.js +49 -49
- package/lib/utils/exceptionThrowers.d.ts +119 -119
- package/lib/utils/exceptionThrowers.js +137 -137
- package/lib/utils/fillMobilePlatformData.d.ts +2 -0
- package/lib/utils/fillMobilePlatformData.js +44 -0
- package/lib/utils/fillMobilePlatformData.js.map +1 -0
- package/lib/utils/fillPlatformData.browser.d.ts +2 -0
- package/lib/utils/fillPlatformData.browser.js +8 -0
- package/lib/utils/fillPlatformData.browser.js.map +1 -0
- package/lib/utils/fillPlatformData.d.ts +2 -0
- package/lib/utils/fillPlatformData.js +8 -0
- package/lib/utils/fillPlatformData.js.map +1 -0
- package/lib/utils/fillWebPlatformData.d.ts +2 -0
- package/lib/utils/fillWebPlatformData.js +21 -0
- package/lib/utils/fillWebPlatformData.js.map +1 -0
- package/lib/utils/internalUtils.d.ts +4 -4
- package/lib/utils/internalUtils.js +16 -16
- package/lib/utils/libraries.d.ts +12 -12
- package/lib/utils/libraries.js +34 -34
- package/lib/utils/locale.d.ts +4 -4
- package/lib/utils/locale.js +60 -60
- package/lib/utils/location.d.ts +7 -7
- package/lib/utils/location.js +95 -95
- package/lib/utils/loggerUtils.d.ts +15 -15
- package/lib/utils/loggerUtils.js +55 -55
- package/lib/utils/loggers.d.ts +111 -111
- package/lib/utils/loggers.js +501 -501
- package/lib/utils/parsers.d.ts +6 -6
- package/lib/utils/parsers.js +10 -10
- package/lib/utils/platform.d.ts +9 -9
- package/lib/utils/platform.js +11 -11
- package/lib/utils/setOcUserAgent.d.ts +2 -2
- package/lib/utils/setOcUserAgent.js +21 -21
- package/lib/utils/sleep.d.ts +2 -2
- package/lib/utils/sleep.js +4 -4
- package/lib/utils/urlResolvers.d.ts +10 -10
- package/lib/utils/urlResolvers.js +64 -64
- package/lib/utils/utilities.d.ts +5 -5
- package/lib/utils/utilities.js +36 -36
- package/lib/validators/OmnichannelConfigValidator.d.ts +3 -3
- package/lib/validators/OmnichannelConfigValidator.js +28 -28
- package/lib/validators/SDKConfigValidators.d.ts +5 -5
- package/lib/validators/SDKConfigValidators.js +48 -48
- package/package.json +2 -2
- package/CHANGELOG.md +0 -432
package/lib/utils/loggers.js
CHANGED
@@ -1,502 +1,502 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
3
|
-
__assign = Object.assign || function(t) {
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
5
|
-
s = arguments[i];
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
7
|
-
t[p] = s[p];
|
8
|
-
}
|
9
|
-
return t;
|
10
|
-
};
|
11
|
-
return __assign.apply(this, arguments);
|
12
|
-
};
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
14
|
-
exports.createAMSClientLogger = exports.createCallingSDKLogger = exports.createACSAdapterLogger = exports.createACSClientLogger = exports.createOCSDKLogger = exports.createIC3ClientLogger = exports.AMSClientLogger = exports.CallingSDKLogger = exports.ACSAdapterLogger = exports.ACSClientLogger = exports.OCSDKLogger = exports.IC3ClientLogger = void 0;
|
15
|
-
var LogLevel_1 = require("../telemetry/LogLevel");
|
16
|
-
var ScenarioType_1 = require("../telemetry/ScenarioType");
|
17
|
-
var ScenarioMarker_1 = require("../telemetry/ScenarioMarker");
|
18
|
-
var IC3ClientLogger = /** @class */ (function () {
|
19
|
-
function IC3ClientLogger(omnichannelConfig) {
|
20
|
-
this.omnichannelConfig = omnichannelConfig;
|
21
|
-
this.debug = false;
|
22
|
-
this.runtimeId = '';
|
23
|
-
this.requestId = '';
|
24
|
-
this.chatId = '';
|
25
|
-
this.telemetry = null;
|
26
|
-
this.debug = false;
|
27
|
-
}
|
28
|
-
/* istanbul ignore next */
|
29
|
-
IC3ClientLogger.prototype.setDebug = function (flag) {
|
30
|
-
this.debug = flag;
|
31
|
-
};
|
32
|
-
IC3ClientLogger.prototype.setRuntimeId = function (runtimeId) {
|
33
|
-
this.runtimeId = runtimeId;
|
34
|
-
};
|
35
|
-
IC3ClientLogger.prototype.setRequestId = function (requestId) {
|
36
|
-
this.requestId = requestId;
|
37
|
-
};
|
38
|
-
IC3ClientLogger.prototype.setChatId = function (chatId) {
|
39
|
-
this.chatId = chatId;
|
40
|
-
};
|
41
|
-
IC3ClientLogger.prototype.useTelemetry = function (telemetry) {
|
42
|
-
/* istanbul ignore next */
|
43
|
-
this.debug && console.log("[IC3ClientLogger][useTelemetry]");
|
44
|
-
this.telemetry = telemetry;
|
45
|
-
};
|
46
|
-
IC3ClientLogger.prototype.logClientSdkTelemetryEvent = function (logLevel, event) {
|
47
|
-
var _a, _b, _c, _d;
|
48
|
-
/* istanbul ignore next */
|
49
|
-
this.debug && console.log("[IC3ClientLogger][logClientSdkTelemetryEvent][" + logLevel + "]");
|
50
|
-
/* istanbul ignore next */
|
51
|
-
this.debug && console.log(event);
|
52
|
-
var baseProperties = {
|
53
|
-
ChatSDKRuntimeId: this.runtimeId,
|
54
|
-
OrgId: this.omnichannelConfig.orgId,
|
55
|
-
OrgUrl: this.omnichannelConfig.orgUrl,
|
56
|
-
WidgetId: this.omnichannelConfig.widgetId,
|
57
|
-
RequestId: this.requestId,
|
58
|
-
ChatId: this.chatId
|
59
|
-
};
|
60
|
-
var additionalProperties = __assign(__assign({}, event), { ExceptionDetails: event.ExceptionDetails ? JSON.stringify(event.ExceptionDetails) : '' });
|
61
|
-
switch (logLevel) {
|
62
|
-
case LogLevel_1.default.DEBUG:
|
63
|
-
(_a = this.telemetry) === null || _a === void 0 ? void 0 : _a.debug(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.IC3CLIENT);
|
64
|
-
break;
|
65
|
-
case LogLevel_1.default.WARN:
|
66
|
-
(_b = this.telemetry) === null || _b === void 0 ? void 0 : _b.warn(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.IC3CLIENT);
|
67
|
-
break;
|
68
|
-
case LogLevel_1.default.ERROR:
|
69
|
-
(_c = this.telemetry) === null || _c === void 0 ? void 0 : _c.error(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.IC3CLIENT);
|
70
|
-
break;
|
71
|
-
case LogLevel_1.default.INFO:
|
72
|
-
default:
|
73
|
-
(_d = this.telemetry) === null || _d === void 0 ? void 0 : _d.info(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.IC3CLIENT);
|
74
|
-
break;
|
75
|
-
}
|
76
|
-
};
|
77
|
-
return IC3ClientLogger;
|
78
|
-
}());
|
79
|
-
exports.IC3ClientLogger = IC3ClientLogger;
|
80
|
-
var OCSDKLogger = /** @class */ (function () {
|
81
|
-
function OCSDKLogger(omnichannelConfig) {
|
82
|
-
this.omnichannelConfig = omnichannelConfig;
|
83
|
-
this.debug = false;
|
84
|
-
this.runtimeId = '';
|
85
|
-
this.requestId = '';
|
86
|
-
this.chatId = '';
|
87
|
-
this.telemetry = null;
|
88
|
-
this.debug = false;
|
89
|
-
}
|
90
|
-
/* istanbul ignore next */
|
91
|
-
OCSDKLogger.prototype.setDebug = function (flag) {
|
92
|
-
this.debug = flag;
|
93
|
-
};
|
94
|
-
OCSDKLogger.prototype.setRuntimeId = function (runtimeId) {
|
95
|
-
this.runtimeId = runtimeId;
|
96
|
-
};
|
97
|
-
OCSDKLogger.prototype.setRequestId = function (requestId) {
|
98
|
-
this.requestId = requestId;
|
99
|
-
};
|
100
|
-
OCSDKLogger.prototype.setChatId = function (chatId) {
|
101
|
-
this.chatId = chatId;
|
102
|
-
};
|
103
|
-
OCSDKLogger.prototype.useTelemetry = function (telemetry) {
|
104
|
-
/* istanbul ignore next */
|
105
|
-
this.debug && console.log("[OCSDKLogger][useTelemetry]");
|
106
|
-
this.telemetry = telemetry;
|
107
|
-
};
|
108
|
-
OCSDKLogger.prototype.logClientSdkTelemetryEvent = function (logLevel, event) {
|
109
|
-
var _a, _b, _c, _d;
|
110
|
-
/* istanbul ignore next */
|
111
|
-
this.debug && console.log("[OCSDKLogger][logClientSdkTelemetryEvent][" + logLevel + "]");
|
112
|
-
/* istanbul ignore next */
|
113
|
-
this.debug && console.log(event);
|
114
|
-
var baseProperties = {
|
115
|
-
ChatSDKRuntimeId: this.runtimeId,
|
116
|
-
OrgId: this.omnichannelConfig.orgId,
|
117
|
-
OrgUrl: this.omnichannelConfig.orgUrl,
|
118
|
-
WidgetId: this.omnichannelConfig.widgetId,
|
119
|
-
RequestId: this.requestId,
|
120
|
-
ChatId: this.chatId
|
121
|
-
};
|
122
|
-
var additionalProperties = __assign(__assign({}, event), { RequestHeaders: event.RequestHeaders ? JSON.stringify(event.RequestHeaders) : '', RequestPayload: event.RequestPayload ? JSON.stringify(event.RequestPayload) : '', ExceptionDetails: event.ExceptionDetails ? JSON.stringify(event.ExceptionDetails) : '' });
|
123
|
-
switch (logLevel) {
|
124
|
-
case LogLevel_1.default.DEBUG:
|
125
|
-
(_a = this.telemetry) === null || _a === void 0 ? void 0 : _a.debug(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.OCSDK);
|
126
|
-
break;
|
127
|
-
case LogLevel_1.default.WARN:
|
128
|
-
(_b = this.telemetry) === null || _b === void 0 ? void 0 : _b.warn(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.OCSDK);
|
129
|
-
break;
|
130
|
-
case LogLevel_1.default.ERROR:
|
131
|
-
(_c = this.telemetry) === null || _c === void 0 ? void 0 : _c.error(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.OCSDK);
|
132
|
-
break;
|
133
|
-
case LogLevel_1.default.INFO:
|
134
|
-
default:
|
135
|
-
(_d = this.telemetry) === null || _d === void 0 ? void 0 : _d.info(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.OCSDK);
|
136
|
-
break;
|
137
|
-
}
|
138
|
-
};
|
139
|
-
return OCSDKLogger;
|
140
|
-
}());
|
141
|
-
exports.OCSDKLogger = OCSDKLogger;
|
142
|
-
var ACSClientLogger = /** @class */ (function () {
|
143
|
-
function ACSClientLogger(omnichannelConfig) {
|
144
|
-
this.omnichannelConfig = omnichannelConfig;
|
145
|
-
this.debug = false;
|
146
|
-
this.runtimeId = '';
|
147
|
-
this.requestId = '';
|
148
|
-
this.chatId = '';
|
149
|
-
this.telemetry = null;
|
150
|
-
this.scenarioMarker = null;
|
151
|
-
this.debug = false;
|
152
|
-
this.scenarioMarker = new ScenarioMarker_1.default(omnichannelConfig);
|
153
|
-
this.scenarioMarker.setScenarioType(ScenarioType_1.default.ACSCLIENT);
|
154
|
-
}
|
155
|
-
/* istanbul ignore next */
|
156
|
-
ACSClientLogger.prototype.setDebug = function (flag) {
|
157
|
-
var _a;
|
158
|
-
this.debug = flag;
|
159
|
-
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.setDebug(flag);
|
160
|
-
};
|
161
|
-
ACSClientLogger.prototype.setRuntimeId = function (runtimeId) {
|
162
|
-
var _a;
|
163
|
-
this.runtimeId = runtimeId;
|
164
|
-
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.setRuntimeId(runtimeId);
|
165
|
-
};
|
166
|
-
ACSClientLogger.prototype.setRequestId = function (requestId) {
|
167
|
-
this.requestId = requestId;
|
168
|
-
};
|
169
|
-
ACSClientLogger.prototype.setChatId = function (chatId) {
|
170
|
-
this.chatId = chatId;
|
171
|
-
};
|
172
|
-
ACSClientLogger.prototype.useTelemetry = function (telemetry) {
|
173
|
-
var _a;
|
174
|
-
/* istanbul ignore next */
|
175
|
-
this.debug && console.log("[ACSClientLogger][useTelemetry]");
|
176
|
-
this.telemetry = telemetry;
|
177
|
-
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.useTelemetry(this.telemetry);
|
178
|
-
};
|
179
|
-
ACSClientLogger.prototype.logClientSdkTelemetryEvent = function (logLevel, event) {
|
180
|
-
var _a, _b, _c, _d;
|
181
|
-
/* istanbul ignore next */
|
182
|
-
this.debug && console.log("[ACSClientLogger][logClientSdkTelemetryEvent][" + logLevel + "]");
|
183
|
-
/* istanbul ignore next */
|
184
|
-
this.debug && console.log(event);
|
185
|
-
var baseProperties = {
|
186
|
-
ChatSDKRuntimeId: this.runtimeId,
|
187
|
-
OrgId: this.omnichannelConfig.orgId,
|
188
|
-
OrgUrl: this.omnichannelConfig.orgUrl,
|
189
|
-
WidgetId: this.omnichannelConfig.widgetId,
|
190
|
-
RequestId: this.requestId,
|
191
|
-
ChatId: this.chatId
|
192
|
-
};
|
193
|
-
var additionalProperties = __assign(__assign({}, event), { ExceptionDetails: event.ExceptionDetails ? JSON.stringify(event.ExceptionDetails) : '' });
|
194
|
-
switch (logLevel) {
|
195
|
-
case LogLevel_1.default.DEBUG:
|
196
|
-
(_a = this.telemetry) === null || _a === void 0 ? void 0 : _a.debug(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.ACSCLIENT);
|
197
|
-
break;
|
198
|
-
case LogLevel_1.default.WARN:
|
199
|
-
(_b = this.telemetry) === null || _b === void 0 ? void 0 : _b.warn(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.ACSCLIENT);
|
200
|
-
break;
|
201
|
-
case LogLevel_1.default.ERROR:
|
202
|
-
(_c = this.telemetry) === null || _c === void 0 ? void 0 : _c.error(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.ACSCLIENT);
|
203
|
-
break;
|
204
|
-
case LogLevel_1.default.INFO:
|
205
|
-
default:
|
206
|
-
(_d = this.telemetry) === null || _d === void 0 ? void 0 : _d.info(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.ACSCLIENT);
|
207
|
-
break;
|
208
|
-
}
|
209
|
-
};
|
210
|
-
ACSClientLogger.prototype.startScenario = function (event, additionalProperties) {
|
211
|
-
var _a;
|
212
|
-
if (additionalProperties === void 0) { additionalProperties = {}; }
|
213
|
-
var baseProperties = {
|
214
|
-
RequestId: this.requestId,
|
215
|
-
ChatId: this.chatId
|
216
|
-
};
|
217
|
-
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.startScenario(event, __assign(__assign({}, baseProperties), additionalProperties));
|
218
|
-
};
|
219
|
-
ACSClientLogger.prototype.failScenario = function (event, additionalProperties) {
|
220
|
-
var _a;
|
221
|
-
if (additionalProperties === void 0) { additionalProperties = {}; }
|
222
|
-
var baseProperties = {
|
223
|
-
RequestId: this.requestId,
|
224
|
-
ChatId: this.chatId
|
225
|
-
};
|
226
|
-
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.failScenario(event, __assign(__assign({}, baseProperties), additionalProperties));
|
227
|
-
};
|
228
|
-
ACSClientLogger.prototype.completeScenario = function (event, additionalProperties) {
|
229
|
-
var _a;
|
230
|
-
if (additionalProperties === void 0) { additionalProperties = {}; }
|
231
|
-
var baseProperties = {
|
232
|
-
RequestId: this.requestId,
|
233
|
-
ChatId: this.chatId
|
234
|
-
};
|
235
|
-
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.completeScenario(event, __assign(__assign({}, baseProperties), additionalProperties));
|
236
|
-
};
|
237
|
-
return ACSClientLogger;
|
238
|
-
}());
|
239
|
-
exports.ACSClientLogger = ACSClientLogger;
|
240
|
-
var ACSAdapterLogger = /** @class */ (function () {
|
241
|
-
function ACSAdapterLogger(omnichannelConfig) {
|
242
|
-
this.omnichannelConfig = omnichannelConfig;
|
243
|
-
this.debug = false;
|
244
|
-
this.runtimeId = '';
|
245
|
-
this.requestId = '';
|
246
|
-
this.chatId = '';
|
247
|
-
this.telemetry = null;
|
248
|
-
this.scenarioMarker = null;
|
249
|
-
this.debug = false;
|
250
|
-
this.scenarioMarker = new ScenarioMarker_1.default(omnichannelConfig);
|
251
|
-
this.scenarioMarker.setScenarioType(ScenarioType_1.default.ACSADAPTER);
|
252
|
-
}
|
253
|
-
/* istanbul ignore next */
|
254
|
-
ACSAdapterLogger.prototype.setDebug = function (flag) {
|
255
|
-
var _a;
|
256
|
-
this.debug = flag;
|
257
|
-
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.setDebug(flag);
|
258
|
-
};
|
259
|
-
ACSAdapterLogger.prototype.setRuntimeId = function (runtimeId) {
|
260
|
-
var _a;
|
261
|
-
this.runtimeId = runtimeId;
|
262
|
-
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.setRuntimeId(this.runtimeId);
|
263
|
-
};
|
264
|
-
ACSAdapterLogger.prototype.setRequestId = function (requestId) {
|
265
|
-
this.requestId = requestId;
|
266
|
-
};
|
267
|
-
ACSAdapterLogger.prototype.setChatId = function (chatId) {
|
268
|
-
this.chatId = chatId;
|
269
|
-
};
|
270
|
-
ACSAdapterLogger.prototype.useTelemetry = function (telemetry) {
|
271
|
-
var _a;
|
272
|
-
/* istanbul ignore next */
|
273
|
-
this.debug && console.log("[ACSAdapterLogger][useTelemetry]");
|
274
|
-
this.telemetry = telemetry;
|
275
|
-
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.useTelemetry(this.telemetry);
|
276
|
-
};
|
277
|
-
ACSAdapterLogger.prototype.logEvent = function (logLevel, event) {
|
278
|
-
var _a, _b, _c, _d;
|
279
|
-
/* istanbul ignore next */
|
280
|
-
this.debug && console.log("[ACSAdapterLogger][logClientSdkTelemetryEvent][" + logLevel + "]");
|
281
|
-
/* istanbul ignore next */
|
282
|
-
this.debug && console.log(event);
|
283
|
-
var baseProperties = {
|
284
|
-
ChatSDKRuntimeId: this.runtimeId,
|
285
|
-
OrgId: this.omnichannelConfig.orgId,
|
286
|
-
OrgUrl: this.omnichannelConfig.orgUrl,
|
287
|
-
WidgetId: this.omnichannelConfig.widgetId,
|
288
|
-
RequestId: this.requestId,
|
289
|
-
ChatId: this.chatId
|
290
|
-
};
|
291
|
-
var additionalProperties = __assign(__assign({}, event), { ExceptionDetails: event.ExceptionDetails ? JSON.stringify(event.ExceptionDetails) : '' });
|
292
|
-
switch (logLevel) {
|
293
|
-
case LogLevel_1.default.DEBUG:
|
294
|
-
(_a = this.telemetry) === null || _a === void 0 ? void 0 : _a.debug(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.ACSADAPTER);
|
295
|
-
break;
|
296
|
-
case LogLevel_1.default.WARN:
|
297
|
-
(_b = this.telemetry) === null || _b === void 0 ? void 0 : _b.warn(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.ACSADAPTER);
|
298
|
-
break;
|
299
|
-
case LogLevel_1.default.ERROR:
|
300
|
-
(_c = this.telemetry) === null || _c === void 0 ? void 0 : _c.error(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.ACSADAPTER);
|
301
|
-
break;
|
302
|
-
case LogLevel_1.default.INFO:
|
303
|
-
default:
|
304
|
-
(_d = this.telemetry) === null || _d === void 0 ? void 0 : _d.info(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.ACSADAPTER);
|
305
|
-
break;
|
306
|
-
}
|
307
|
-
};
|
308
|
-
ACSAdapterLogger.prototype.startScenario = function (event, additionalProperties) {
|
309
|
-
var _a;
|
310
|
-
if (additionalProperties === void 0) { additionalProperties = {}; }
|
311
|
-
var baseProperties = {
|
312
|
-
RequestId: this.requestId,
|
313
|
-
ChatId: this.chatId
|
314
|
-
};
|
315
|
-
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.startScenario(event, __assign(__assign({}, baseProperties), additionalProperties));
|
316
|
-
};
|
317
|
-
ACSAdapterLogger.prototype.failScenario = function (event, additionalProperties) {
|
318
|
-
var _a;
|
319
|
-
if (additionalProperties === void 0) { additionalProperties = {}; }
|
320
|
-
var baseProperties = {
|
321
|
-
RequestId: this.requestId,
|
322
|
-
ChatId: this.chatId
|
323
|
-
};
|
324
|
-
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.failScenario(event, __assign(__assign({}, baseProperties), additionalProperties));
|
325
|
-
};
|
326
|
-
ACSAdapterLogger.prototype.completeScenario = function (event, additionalProperties) {
|
327
|
-
var _a;
|
328
|
-
if (additionalProperties === void 0) { additionalProperties = {}; }
|
329
|
-
var baseProperties = {
|
330
|
-
RequestId: this.requestId,
|
331
|
-
ChatId: this.chatId
|
332
|
-
};
|
333
|
-
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.completeScenario(event, __assign(__assign({}, baseProperties), additionalProperties));
|
334
|
-
};
|
335
|
-
return ACSAdapterLogger;
|
336
|
-
}());
|
337
|
-
exports.ACSAdapterLogger = ACSAdapterLogger;
|
338
|
-
var CallingSDKLogger = /** @class */ (function () {
|
339
|
-
function CallingSDKLogger(omnichannelConfig) {
|
340
|
-
this.omnichannelConfig = omnichannelConfig;
|
341
|
-
this.debug = false;
|
342
|
-
this.runtimeId = '';
|
343
|
-
this.requestId = '';
|
344
|
-
this.chatId = '';
|
345
|
-
this.telemetry = null;
|
346
|
-
this.debug = false;
|
347
|
-
}
|
348
|
-
/* istanbul ignore next */
|
349
|
-
CallingSDKLogger.prototype.setDebug = function (flag) {
|
350
|
-
this.debug = flag;
|
351
|
-
};
|
352
|
-
CallingSDKLogger.prototype.setRuntimeId = function (runtimeId) {
|
353
|
-
this.runtimeId = runtimeId;
|
354
|
-
};
|
355
|
-
CallingSDKLogger.prototype.setRequestId = function (requestId) {
|
356
|
-
this.requestId = requestId;
|
357
|
-
};
|
358
|
-
CallingSDKLogger.prototype.setChatId = function (chatId) {
|
359
|
-
this.chatId = chatId;
|
360
|
-
};
|
361
|
-
CallingSDKLogger.prototype.useTelemetry = function (telemetry) {
|
362
|
-
/* istanbul ignore next */
|
363
|
-
this.debug && console.log("[CallingSDKLogger][useTelemetry]");
|
364
|
-
this.telemetry = telemetry;
|
365
|
-
};
|
366
|
-
CallingSDKLogger.prototype.logScenarioOperation = function (operationName, startTime, endTime, isSuccess, retryCount, data) {
|
367
|
-
// empty on purpose.
|
368
|
-
return;
|
369
|
-
};
|
370
|
-
CallingSDKLogger.prototype.logCallingSdkTelemetryEvent = function (logLevel, event) {
|
371
|
-
var _a, _b, _c, _d;
|
372
|
-
/* istanbul ignore next */
|
373
|
-
this.debug && console.log("[CallingSDKLogger][logClientSdkTelemetryEvent][" + logLevel + "]");
|
374
|
-
/* istanbul ignore next */
|
375
|
-
this.debug && console.log(event);
|
376
|
-
var baseProperties = {
|
377
|
-
ChatSDKRuntimeId: this.runtimeId,
|
378
|
-
OrgId: this.omnichannelConfig.orgId,
|
379
|
-
OrgUrl: this.omnichannelConfig.orgUrl,
|
380
|
-
WidgetId: this.omnichannelConfig.widgetId,
|
381
|
-
RequestId: this.requestId,
|
382
|
-
ChatId: this.chatId
|
383
|
-
};
|
384
|
-
var additionalProperties = __assign(__assign({}, event), { ExceptionDetails: event.ExceptionDetails ? JSON.stringify(event.ExceptionDetails) : '' });
|
385
|
-
switch (logLevel) {
|
386
|
-
case LogLevel_1.default.DEBUG:
|
387
|
-
(_a = this.telemetry) === null || _a === void 0 ? void 0 : _a.debug(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.CALLINGSDK);
|
388
|
-
break;
|
389
|
-
case LogLevel_1.default.WARN:
|
390
|
-
(_b = this.telemetry) === null || _b === void 0 ? void 0 : _b.warn(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.CALLINGSDK);
|
391
|
-
break;
|
392
|
-
case LogLevel_1.default.ERROR:
|
393
|
-
(_c = this.telemetry) === null || _c === void 0 ? void 0 : _c.error(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.CALLINGSDK);
|
394
|
-
break;
|
395
|
-
case LogLevel_1.default.INFO:
|
396
|
-
default:
|
397
|
-
(_d = this.telemetry) === null || _d === void 0 ? void 0 : _d.info(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.CALLINGSDK);
|
398
|
-
break;
|
399
|
-
}
|
400
|
-
};
|
401
|
-
return CallingSDKLogger;
|
402
|
-
}());
|
403
|
-
exports.CallingSDKLogger = CallingSDKLogger;
|
404
|
-
var AMSClientLogger = /** @class */ (function () {
|
405
|
-
function AMSClientLogger(omnichannelConfig) {
|
406
|
-
this.omnichannelConfig = omnichannelConfig;
|
407
|
-
this.debug = false;
|
408
|
-
this.runtimeId = '';
|
409
|
-
this.requestId = '';
|
410
|
-
this.chatId = '';
|
411
|
-
this.telemetry = null;
|
412
|
-
this.debug = false;
|
413
|
-
}
|
414
|
-
/* istanbul ignore next */
|
415
|
-
AMSClientLogger.prototype.setDebug = function (flag) {
|
416
|
-
this.debug = flag;
|
417
|
-
};
|
418
|
-
AMSClientLogger.prototype.setRuntimeId = function (runtimeId) {
|
419
|
-
this.runtimeId = runtimeId;
|
420
|
-
};
|
421
|
-
AMSClientLogger.prototype.setRequestId = function (requestId) {
|
422
|
-
this.requestId = requestId;
|
423
|
-
};
|
424
|
-
AMSClientLogger.prototype.setChatId = function (chatId) {
|
425
|
-
this.chatId = chatId;
|
426
|
-
};
|
427
|
-
AMSClientLogger.prototype.useTelemetry = function (telemetry) {
|
428
|
-
/* istanbul ignore next */
|
429
|
-
this.debug && console.log("[AMSClientLogger][useTelemetry]");
|
430
|
-
this.telemetry = telemetry;
|
431
|
-
};
|
432
|
-
AMSClientLogger.prototype.logClientSdkTelemetryEvent = function (logLevel, event) {
|
433
|
-
var _a, _b, _c, _d;
|
434
|
-
/* istanbul ignore next */
|
435
|
-
this.debug && console.log("[AMSClientLogger][logClientSdkTelemetryEvent][" + logLevel + "]");
|
436
|
-
/* istanbul ignore next */
|
437
|
-
this.debug && console.log(event);
|
438
|
-
var baseProperties = {
|
439
|
-
ChatSDKRuntimeId: this.runtimeId,
|
440
|
-
OrgId: this.omnichannelConfig.orgId,
|
441
|
-
OrgUrl: this.omnichannelConfig.orgUrl,
|
442
|
-
WidgetId: this.omnichannelConfig.widgetId,
|
443
|
-
RequestId: this.requestId,
|
444
|
-
ChatId: this.chatId
|
445
|
-
};
|
446
|
-
var additionalProperties = __assign(__assign({}, event), { ExceptionDetails: event.ExceptionDetails ? JSON.stringify(event.ExceptionDetails) : '' });
|
447
|
-
switch (logLevel) {
|
448
|
-
case LogLevel_1.default.DEBUG:
|
449
|
-
(_a = this.telemetry) === null || _a === void 0 ? void 0 : _a.debug(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.AMSCLIENT);
|
450
|
-
break;
|
451
|
-
case LogLevel_1.default.WARN:
|
452
|
-
(_b = this.telemetry) === null || _b === void 0 ? void 0 : _b.warn(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.AMSCLIENT);
|
453
|
-
break;
|
454
|
-
case LogLevel_1.default.ERROR:
|
455
|
-
(_c = this.telemetry) === null || _c === void 0 ? void 0 : _c.error(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.AMSCLIENT);
|
456
|
-
break;
|
457
|
-
case LogLevel_1.default.INFO:
|
458
|
-
default:
|
459
|
-
(_d = this.telemetry) === null || _d === void 0 ? void 0 : _d.info(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.AMSCLIENT);
|
460
|
-
break;
|
461
|
-
}
|
462
|
-
};
|
463
|
-
return AMSClientLogger;
|
464
|
-
}());
|
465
|
-
exports.AMSClientLogger = AMSClientLogger;
|
466
|
-
exports.createIC3ClientLogger = function (omnichannelConfig, debug) {
|
467
|
-
if (debug === void 0) { debug = false; }
|
468
|
-
var logger = new IC3ClientLogger(omnichannelConfig);
|
469
|
-
logger.setDebug(debug);
|
470
|
-
return logger;
|
471
|
-
};
|
472
|
-
exports.createOCSDKLogger = function (omnichannelConfig, debug) {
|
473
|
-
if (debug === void 0) { debug = false; }
|
474
|
-
var logger = new OCSDKLogger(omnichannelConfig);
|
475
|
-
logger.setDebug(debug);
|
476
|
-
return logger;
|
477
|
-
};
|
478
|
-
exports.createACSClientLogger = function (omnichannelConfig, debug) {
|
479
|
-
if (debug === void 0) { debug = false; }
|
480
|
-
var logger = new ACSClientLogger(omnichannelConfig);
|
481
|
-
logger.setDebug(debug);
|
482
|
-
return logger;
|
483
|
-
};
|
484
|
-
exports.createACSAdapterLogger = function (omnichannelConfig, debug) {
|
485
|
-
if (debug === void 0) { debug = false; }
|
486
|
-
var logger = new ACSAdapterLogger(omnichannelConfig);
|
487
|
-
logger.setDebug(debug);
|
488
|
-
return logger;
|
489
|
-
};
|
490
|
-
exports.createCallingSDKLogger = function (omnichannelConfig, debug) {
|
491
|
-
if (debug === void 0) { debug = false; }
|
492
|
-
var logger = new CallingSDKLogger(omnichannelConfig);
|
493
|
-
logger.setDebug(debug);
|
494
|
-
return logger;
|
495
|
-
};
|
496
|
-
exports.createAMSClientLogger = function (omnichannelConfig, debug) {
|
497
|
-
if (debug === void 0) { debug = false; }
|
498
|
-
var logger = new AMSClientLogger(omnichannelConfig);
|
499
|
-
logger.setDebug(debug);
|
500
|
-
return logger;
|
501
|
-
};
|
1
|
+
"use strict";
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
3
|
+
__assign = Object.assign || function(t) {
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
5
|
+
s = arguments[i];
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
7
|
+
t[p] = s[p];
|
8
|
+
}
|
9
|
+
return t;
|
10
|
+
};
|
11
|
+
return __assign.apply(this, arguments);
|
12
|
+
};
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
14
|
+
exports.createAMSClientLogger = exports.createCallingSDKLogger = exports.createACSAdapterLogger = exports.createACSClientLogger = exports.createOCSDKLogger = exports.createIC3ClientLogger = exports.AMSClientLogger = exports.CallingSDKLogger = exports.ACSAdapterLogger = exports.ACSClientLogger = exports.OCSDKLogger = exports.IC3ClientLogger = void 0;
|
15
|
+
var LogLevel_1 = require("../telemetry/LogLevel");
|
16
|
+
var ScenarioType_1 = require("../telemetry/ScenarioType");
|
17
|
+
var ScenarioMarker_1 = require("../telemetry/ScenarioMarker");
|
18
|
+
var IC3ClientLogger = /** @class */ (function () {
|
19
|
+
function IC3ClientLogger(omnichannelConfig) {
|
20
|
+
this.omnichannelConfig = omnichannelConfig;
|
21
|
+
this.debug = false;
|
22
|
+
this.runtimeId = '';
|
23
|
+
this.requestId = '';
|
24
|
+
this.chatId = '';
|
25
|
+
this.telemetry = null;
|
26
|
+
this.debug = false;
|
27
|
+
}
|
28
|
+
/* istanbul ignore next */
|
29
|
+
IC3ClientLogger.prototype.setDebug = function (flag) {
|
30
|
+
this.debug = flag;
|
31
|
+
};
|
32
|
+
IC3ClientLogger.prototype.setRuntimeId = function (runtimeId) {
|
33
|
+
this.runtimeId = runtimeId;
|
34
|
+
};
|
35
|
+
IC3ClientLogger.prototype.setRequestId = function (requestId) {
|
36
|
+
this.requestId = requestId;
|
37
|
+
};
|
38
|
+
IC3ClientLogger.prototype.setChatId = function (chatId) {
|
39
|
+
this.chatId = chatId;
|
40
|
+
};
|
41
|
+
IC3ClientLogger.prototype.useTelemetry = function (telemetry) {
|
42
|
+
/* istanbul ignore next */
|
43
|
+
this.debug && console.log("[IC3ClientLogger][useTelemetry]");
|
44
|
+
this.telemetry = telemetry;
|
45
|
+
};
|
46
|
+
IC3ClientLogger.prototype.logClientSdkTelemetryEvent = function (logLevel, event) {
|
47
|
+
var _a, _b, _c, _d;
|
48
|
+
/* istanbul ignore next */
|
49
|
+
this.debug && console.log("[IC3ClientLogger][logClientSdkTelemetryEvent][" + logLevel + "]");
|
50
|
+
/* istanbul ignore next */
|
51
|
+
this.debug && console.log(event);
|
52
|
+
var baseProperties = {
|
53
|
+
ChatSDKRuntimeId: this.runtimeId,
|
54
|
+
OrgId: this.omnichannelConfig.orgId,
|
55
|
+
OrgUrl: this.omnichannelConfig.orgUrl,
|
56
|
+
WidgetId: this.omnichannelConfig.widgetId,
|
57
|
+
RequestId: this.requestId,
|
58
|
+
ChatId: this.chatId
|
59
|
+
};
|
60
|
+
var additionalProperties = __assign(__assign({}, event), { ExceptionDetails: event.ExceptionDetails ? JSON.stringify(event.ExceptionDetails) : '' });
|
61
|
+
switch (logLevel) {
|
62
|
+
case LogLevel_1.default.DEBUG:
|
63
|
+
(_a = this.telemetry) === null || _a === void 0 ? void 0 : _a.debug(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.IC3CLIENT);
|
64
|
+
break;
|
65
|
+
case LogLevel_1.default.WARN:
|
66
|
+
(_b = this.telemetry) === null || _b === void 0 ? void 0 : _b.warn(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.IC3CLIENT);
|
67
|
+
break;
|
68
|
+
case LogLevel_1.default.ERROR:
|
69
|
+
(_c = this.telemetry) === null || _c === void 0 ? void 0 : _c.error(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.IC3CLIENT);
|
70
|
+
break;
|
71
|
+
case LogLevel_1.default.INFO:
|
72
|
+
default:
|
73
|
+
(_d = this.telemetry) === null || _d === void 0 ? void 0 : _d.info(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.IC3CLIENT);
|
74
|
+
break;
|
75
|
+
}
|
76
|
+
};
|
77
|
+
return IC3ClientLogger;
|
78
|
+
}());
|
79
|
+
exports.IC3ClientLogger = IC3ClientLogger;
|
80
|
+
var OCSDKLogger = /** @class */ (function () {
|
81
|
+
function OCSDKLogger(omnichannelConfig) {
|
82
|
+
this.omnichannelConfig = omnichannelConfig;
|
83
|
+
this.debug = false;
|
84
|
+
this.runtimeId = '';
|
85
|
+
this.requestId = '';
|
86
|
+
this.chatId = '';
|
87
|
+
this.telemetry = null;
|
88
|
+
this.debug = false;
|
89
|
+
}
|
90
|
+
/* istanbul ignore next */
|
91
|
+
OCSDKLogger.prototype.setDebug = function (flag) {
|
92
|
+
this.debug = flag;
|
93
|
+
};
|
94
|
+
OCSDKLogger.prototype.setRuntimeId = function (runtimeId) {
|
95
|
+
this.runtimeId = runtimeId;
|
96
|
+
};
|
97
|
+
OCSDKLogger.prototype.setRequestId = function (requestId) {
|
98
|
+
this.requestId = requestId;
|
99
|
+
};
|
100
|
+
OCSDKLogger.prototype.setChatId = function (chatId) {
|
101
|
+
this.chatId = chatId;
|
102
|
+
};
|
103
|
+
OCSDKLogger.prototype.useTelemetry = function (telemetry) {
|
104
|
+
/* istanbul ignore next */
|
105
|
+
this.debug && console.log("[OCSDKLogger][useTelemetry]");
|
106
|
+
this.telemetry = telemetry;
|
107
|
+
};
|
108
|
+
OCSDKLogger.prototype.logClientSdkTelemetryEvent = function (logLevel, event) {
|
109
|
+
var _a, _b, _c, _d;
|
110
|
+
/* istanbul ignore next */
|
111
|
+
this.debug && console.log("[OCSDKLogger][logClientSdkTelemetryEvent][" + logLevel + "]");
|
112
|
+
/* istanbul ignore next */
|
113
|
+
this.debug && console.log(event);
|
114
|
+
var baseProperties = {
|
115
|
+
ChatSDKRuntimeId: this.runtimeId,
|
116
|
+
OrgId: this.omnichannelConfig.orgId,
|
117
|
+
OrgUrl: this.omnichannelConfig.orgUrl,
|
118
|
+
WidgetId: this.omnichannelConfig.widgetId,
|
119
|
+
RequestId: this.requestId,
|
120
|
+
ChatId: this.chatId
|
121
|
+
};
|
122
|
+
var additionalProperties = __assign(__assign({}, event), { RequestHeaders: event.RequestHeaders ? JSON.stringify(event.RequestHeaders) : '', RequestPayload: event.RequestPayload ? JSON.stringify(event.RequestPayload) : '', ExceptionDetails: event.ExceptionDetails ? JSON.stringify(event.ExceptionDetails) : '' });
|
123
|
+
switch (logLevel) {
|
124
|
+
case LogLevel_1.default.DEBUG:
|
125
|
+
(_a = this.telemetry) === null || _a === void 0 ? void 0 : _a.debug(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.OCSDK);
|
126
|
+
break;
|
127
|
+
case LogLevel_1.default.WARN:
|
128
|
+
(_b = this.telemetry) === null || _b === void 0 ? void 0 : _b.warn(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.OCSDK);
|
129
|
+
break;
|
130
|
+
case LogLevel_1.default.ERROR:
|
131
|
+
(_c = this.telemetry) === null || _c === void 0 ? void 0 : _c.error(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.OCSDK);
|
132
|
+
break;
|
133
|
+
case LogLevel_1.default.INFO:
|
134
|
+
default:
|
135
|
+
(_d = this.telemetry) === null || _d === void 0 ? void 0 : _d.info(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.OCSDK);
|
136
|
+
break;
|
137
|
+
}
|
138
|
+
};
|
139
|
+
return OCSDKLogger;
|
140
|
+
}());
|
141
|
+
exports.OCSDKLogger = OCSDKLogger;
|
142
|
+
var ACSClientLogger = /** @class */ (function () {
|
143
|
+
function ACSClientLogger(omnichannelConfig) {
|
144
|
+
this.omnichannelConfig = omnichannelConfig;
|
145
|
+
this.debug = false;
|
146
|
+
this.runtimeId = '';
|
147
|
+
this.requestId = '';
|
148
|
+
this.chatId = '';
|
149
|
+
this.telemetry = null;
|
150
|
+
this.scenarioMarker = null;
|
151
|
+
this.debug = false;
|
152
|
+
this.scenarioMarker = new ScenarioMarker_1.default(omnichannelConfig);
|
153
|
+
this.scenarioMarker.setScenarioType(ScenarioType_1.default.ACSCLIENT);
|
154
|
+
}
|
155
|
+
/* istanbul ignore next */
|
156
|
+
ACSClientLogger.prototype.setDebug = function (flag) {
|
157
|
+
var _a;
|
158
|
+
this.debug = flag;
|
159
|
+
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.setDebug(flag);
|
160
|
+
};
|
161
|
+
ACSClientLogger.prototype.setRuntimeId = function (runtimeId) {
|
162
|
+
var _a;
|
163
|
+
this.runtimeId = runtimeId;
|
164
|
+
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.setRuntimeId(runtimeId);
|
165
|
+
};
|
166
|
+
ACSClientLogger.prototype.setRequestId = function (requestId) {
|
167
|
+
this.requestId = requestId;
|
168
|
+
};
|
169
|
+
ACSClientLogger.prototype.setChatId = function (chatId) {
|
170
|
+
this.chatId = chatId;
|
171
|
+
};
|
172
|
+
ACSClientLogger.prototype.useTelemetry = function (telemetry) {
|
173
|
+
var _a;
|
174
|
+
/* istanbul ignore next */
|
175
|
+
this.debug && console.log("[ACSClientLogger][useTelemetry]");
|
176
|
+
this.telemetry = telemetry;
|
177
|
+
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.useTelemetry(this.telemetry);
|
178
|
+
};
|
179
|
+
ACSClientLogger.prototype.logClientSdkTelemetryEvent = function (logLevel, event) {
|
180
|
+
var _a, _b, _c, _d;
|
181
|
+
/* istanbul ignore next */
|
182
|
+
this.debug && console.log("[ACSClientLogger][logClientSdkTelemetryEvent][" + logLevel + "]");
|
183
|
+
/* istanbul ignore next */
|
184
|
+
this.debug && console.log(event);
|
185
|
+
var baseProperties = {
|
186
|
+
ChatSDKRuntimeId: this.runtimeId,
|
187
|
+
OrgId: this.omnichannelConfig.orgId,
|
188
|
+
OrgUrl: this.omnichannelConfig.orgUrl,
|
189
|
+
WidgetId: this.omnichannelConfig.widgetId,
|
190
|
+
RequestId: this.requestId,
|
191
|
+
ChatId: this.chatId
|
192
|
+
};
|
193
|
+
var additionalProperties = __assign(__assign({}, event), { ExceptionDetails: event.ExceptionDetails ? JSON.stringify(event.ExceptionDetails) : '' });
|
194
|
+
switch (logLevel) {
|
195
|
+
case LogLevel_1.default.DEBUG:
|
196
|
+
(_a = this.telemetry) === null || _a === void 0 ? void 0 : _a.debug(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.ACSCLIENT);
|
197
|
+
break;
|
198
|
+
case LogLevel_1.default.WARN:
|
199
|
+
(_b = this.telemetry) === null || _b === void 0 ? void 0 : _b.warn(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.ACSCLIENT);
|
200
|
+
break;
|
201
|
+
case LogLevel_1.default.ERROR:
|
202
|
+
(_c = this.telemetry) === null || _c === void 0 ? void 0 : _c.error(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.ACSCLIENT);
|
203
|
+
break;
|
204
|
+
case LogLevel_1.default.INFO:
|
205
|
+
default:
|
206
|
+
(_d = this.telemetry) === null || _d === void 0 ? void 0 : _d.info(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.ACSCLIENT);
|
207
|
+
break;
|
208
|
+
}
|
209
|
+
};
|
210
|
+
ACSClientLogger.prototype.startScenario = function (event, additionalProperties) {
|
211
|
+
var _a;
|
212
|
+
if (additionalProperties === void 0) { additionalProperties = {}; }
|
213
|
+
var baseProperties = {
|
214
|
+
RequestId: this.requestId,
|
215
|
+
ChatId: this.chatId
|
216
|
+
};
|
217
|
+
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.startScenario(event, __assign(__assign({}, baseProperties), additionalProperties));
|
218
|
+
};
|
219
|
+
ACSClientLogger.prototype.failScenario = function (event, additionalProperties) {
|
220
|
+
var _a;
|
221
|
+
if (additionalProperties === void 0) { additionalProperties = {}; }
|
222
|
+
var baseProperties = {
|
223
|
+
RequestId: this.requestId,
|
224
|
+
ChatId: this.chatId
|
225
|
+
};
|
226
|
+
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.failScenario(event, __assign(__assign({}, baseProperties), additionalProperties));
|
227
|
+
};
|
228
|
+
ACSClientLogger.prototype.completeScenario = function (event, additionalProperties) {
|
229
|
+
var _a;
|
230
|
+
if (additionalProperties === void 0) { additionalProperties = {}; }
|
231
|
+
var baseProperties = {
|
232
|
+
RequestId: this.requestId,
|
233
|
+
ChatId: this.chatId
|
234
|
+
};
|
235
|
+
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.completeScenario(event, __assign(__assign({}, baseProperties), additionalProperties));
|
236
|
+
};
|
237
|
+
return ACSClientLogger;
|
238
|
+
}());
|
239
|
+
exports.ACSClientLogger = ACSClientLogger;
|
240
|
+
var ACSAdapterLogger = /** @class */ (function () {
|
241
|
+
function ACSAdapterLogger(omnichannelConfig) {
|
242
|
+
this.omnichannelConfig = omnichannelConfig;
|
243
|
+
this.debug = false;
|
244
|
+
this.runtimeId = '';
|
245
|
+
this.requestId = '';
|
246
|
+
this.chatId = '';
|
247
|
+
this.telemetry = null;
|
248
|
+
this.scenarioMarker = null;
|
249
|
+
this.debug = false;
|
250
|
+
this.scenarioMarker = new ScenarioMarker_1.default(omnichannelConfig);
|
251
|
+
this.scenarioMarker.setScenarioType(ScenarioType_1.default.ACSADAPTER);
|
252
|
+
}
|
253
|
+
/* istanbul ignore next */
|
254
|
+
ACSAdapterLogger.prototype.setDebug = function (flag) {
|
255
|
+
var _a;
|
256
|
+
this.debug = flag;
|
257
|
+
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.setDebug(flag);
|
258
|
+
};
|
259
|
+
ACSAdapterLogger.prototype.setRuntimeId = function (runtimeId) {
|
260
|
+
var _a;
|
261
|
+
this.runtimeId = runtimeId;
|
262
|
+
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.setRuntimeId(this.runtimeId);
|
263
|
+
};
|
264
|
+
ACSAdapterLogger.prototype.setRequestId = function (requestId) {
|
265
|
+
this.requestId = requestId;
|
266
|
+
};
|
267
|
+
ACSAdapterLogger.prototype.setChatId = function (chatId) {
|
268
|
+
this.chatId = chatId;
|
269
|
+
};
|
270
|
+
ACSAdapterLogger.prototype.useTelemetry = function (telemetry) {
|
271
|
+
var _a;
|
272
|
+
/* istanbul ignore next */
|
273
|
+
this.debug && console.log("[ACSAdapterLogger][useTelemetry]");
|
274
|
+
this.telemetry = telemetry;
|
275
|
+
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.useTelemetry(this.telemetry);
|
276
|
+
};
|
277
|
+
ACSAdapterLogger.prototype.logEvent = function (logLevel, event) {
|
278
|
+
var _a, _b, _c, _d;
|
279
|
+
/* istanbul ignore next */
|
280
|
+
this.debug && console.log("[ACSAdapterLogger][logClientSdkTelemetryEvent][" + logLevel + "]");
|
281
|
+
/* istanbul ignore next */
|
282
|
+
this.debug && console.log(event);
|
283
|
+
var baseProperties = {
|
284
|
+
ChatSDKRuntimeId: this.runtimeId,
|
285
|
+
OrgId: this.omnichannelConfig.orgId,
|
286
|
+
OrgUrl: this.omnichannelConfig.orgUrl,
|
287
|
+
WidgetId: this.omnichannelConfig.widgetId,
|
288
|
+
RequestId: this.requestId,
|
289
|
+
ChatId: this.chatId
|
290
|
+
};
|
291
|
+
var additionalProperties = __assign(__assign({}, event), { ExceptionDetails: event.ExceptionDetails ? JSON.stringify(event.ExceptionDetails) : '' });
|
292
|
+
switch (logLevel) {
|
293
|
+
case LogLevel_1.default.DEBUG:
|
294
|
+
(_a = this.telemetry) === null || _a === void 0 ? void 0 : _a.debug(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.ACSADAPTER);
|
295
|
+
break;
|
296
|
+
case LogLevel_1.default.WARN:
|
297
|
+
(_b = this.telemetry) === null || _b === void 0 ? void 0 : _b.warn(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.ACSADAPTER);
|
298
|
+
break;
|
299
|
+
case LogLevel_1.default.ERROR:
|
300
|
+
(_c = this.telemetry) === null || _c === void 0 ? void 0 : _c.error(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.ACSADAPTER);
|
301
|
+
break;
|
302
|
+
case LogLevel_1.default.INFO:
|
303
|
+
default:
|
304
|
+
(_d = this.telemetry) === null || _d === void 0 ? void 0 : _d.info(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.ACSADAPTER);
|
305
|
+
break;
|
306
|
+
}
|
307
|
+
};
|
308
|
+
ACSAdapterLogger.prototype.startScenario = function (event, additionalProperties) {
|
309
|
+
var _a;
|
310
|
+
if (additionalProperties === void 0) { additionalProperties = {}; }
|
311
|
+
var baseProperties = {
|
312
|
+
RequestId: this.requestId,
|
313
|
+
ChatId: this.chatId
|
314
|
+
};
|
315
|
+
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.startScenario(event, __assign(__assign({}, baseProperties), additionalProperties));
|
316
|
+
};
|
317
|
+
ACSAdapterLogger.prototype.failScenario = function (event, additionalProperties) {
|
318
|
+
var _a;
|
319
|
+
if (additionalProperties === void 0) { additionalProperties = {}; }
|
320
|
+
var baseProperties = {
|
321
|
+
RequestId: this.requestId,
|
322
|
+
ChatId: this.chatId
|
323
|
+
};
|
324
|
+
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.failScenario(event, __assign(__assign({}, baseProperties), additionalProperties));
|
325
|
+
};
|
326
|
+
ACSAdapterLogger.prototype.completeScenario = function (event, additionalProperties) {
|
327
|
+
var _a;
|
328
|
+
if (additionalProperties === void 0) { additionalProperties = {}; }
|
329
|
+
var baseProperties = {
|
330
|
+
RequestId: this.requestId,
|
331
|
+
ChatId: this.chatId
|
332
|
+
};
|
333
|
+
(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.completeScenario(event, __assign(__assign({}, baseProperties), additionalProperties));
|
334
|
+
};
|
335
|
+
return ACSAdapterLogger;
|
336
|
+
}());
|
337
|
+
exports.ACSAdapterLogger = ACSAdapterLogger;
|
338
|
+
var CallingSDKLogger = /** @class */ (function () {
|
339
|
+
function CallingSDKLogger(omnichannelConfig) {
|
340
|
+
this.omnichannelConfig = omnichannelConfig;
|
341
|
+
this.debug = false;
|
342
|
+
this.runtimeId = '';
|
343
|
+
this.requestId = '';
|
344
|
+
this.chatId = '';
|
345
|
+
this.telemetry = null;
|
346
|
+
this.debug = false;
|
347
|
+
}
|
348
|
+
/* istanbul ignore next */
|
349
|
+
CallingSDKLogger.prototype.setDebug = function (flag) {
|
350
|
+
this.debug = flag;
|
351
|
+
};
|
352
|
+
CallingSDKLogger.prototype.setRuntimeId = function (runtimeId) {
|
353
|
+
this.runtimeId = runtimeId;
|
354
|
+
};
|
355
|
+
CallingSDKLogger.prototype.setRequestId = function (requestId) {
|
356
|
+
this.requestId = requestId;
|
357
|
+
};
|
358
|
+
CallingSDKLogger.prototype.setChatId = function (chatId) {
|
359
|
+
this.chatId = chatId;
|
360
|
+
};
|
361
|
+
CallingSDKLogger.prototype.useTelemetry = function (telemetry) {
|
362
|
+
/* istanbul ignore next */
|
363
|
+
this.debug && console.log("[CallingSDKLogger][useTelemetry]");
|
364
|
+
this.telemetry = telemetry;
|
365
|
+
};
|
366
|
+
CallingSDKLogger.prototype.logScenarioOperation = function (operationName, startTime, endTime, isSuccess, retryCount, data) {
|
367
|
+
// empty on purpose.
|
368
|
+
return;
|
369
|
+
};
|
370
|
+
CallingSDKLogger.prototype.logCallingSdkTelemetryEvent = function (logLevel, event) {
|
371
|
+
var _a, _b, _c, _d;
|
372
|
+
/* istanbul ignore next */
|
373
|
+
this.debug && console.log("[CallingSDKLogger][logClientSdkTelemetryEvent][" + logLevel + "]");
|
374
|
+
/* istanbul ignore next */
|
375
|
+
this.debug && console.log(event);
|
376
|
+
var baseProperties = {
|
377
|
+
ChatSDKRuntimeId: this.runtimeId,
|
378
|
+
OrgId: this.omnichannelConfig.orgId,
|
379
|
+
OrgUrl: this.omnichannelConfig.orgUrl,
|
380
|
+
WidgetId: this.omnichannelConfig.widgetId,
|
381
|
+
RequestId: this.requestId,
|
382
|
+
ChatId: this.chatId
|
383
|
+
};
|
384
|
+
var additionalProperties = __assign(__assign({}, event), { ExceptionDetails: event.ExceptionDetails ? JSON.stringify(event.ExceptionDetails) : '' });
|
385
|
+
switch (logLevel) {
|
386
|
+
case LogLevel_1.default.DEBUG:
|
387
|
+
(_a = this.telemetry) === null || _a === void 0 ? void 0 : _a.debug(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.CALLINGSDK);
|
388
|
+
break;
|
389
|
+
case LogLevel_1.default.WARN:
|
390
|
+
(_b = this.telemetry) === null || _b === void 0 ? void 0 : _b.warn(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.CALLINGSDK);
|
391
|
+
break;
|
392
|
+
case LogLevel_1.default.ERROR:
|
393
|
+
(_c = this.telemetry) === null || _c === void 0 ? void 0 : _c.error(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.CALLINGSDK);
|
394
|
+
break;
|
395
|
+
case LogLevel_1.default.INFO:
|
396
|
+
default:
|
397
|
+
(_d = this.telemetry) === null || _d === void 0 ? void 0 : _d.info(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.CALLINGSDK);
|
398
|
+
break;
|
399
|
+
}
|
400
|
+
};
|
401
|
+
return CallingSDKLogger;
|
402
|
+
}());
|
403
|
+
exports.CallingSDKLogger = CallingSDKLogger;
|
404
|
+
var AMSClientLogger = /** @class */ (function () {
|
405
|
+
function AMSClientLogger(omnichannelConfig) {
|
406
|
+
this.omnichannelConfig = omnichannelConfig;
|
407
|
+
this.debug = false;
|
408
|
+
this.runtimeId = '';
|
409
|
+
this.requestId = '';
|
410
|
+
this.chatId = '';
|
411
|
+
this.telemetry = null;
|
412
|
+
this.debug = false;
|
413
|
+
}
|
414
|
+
/* istanbul ignore next */
|
415
|
+
AMSClientLogger.prototype.setDebug = function (flag) {
|
416
|
+
this.debug = flag;
|
417
|
+
};
|
418
|
+
AMSClientLogger.prototype.setRuntimeId = function (runtimeId) {
|
419
|
+
this.runtimeId = runtimeId;
|
420
|
+
};
|
421
|
+
AMSClientLogger.prototype.setRequestId = function (requestId) {
|
422
|
+
this.requestId = requestId;
|
423
|
+
};
|
424
|
+
AMSClientLogger.prototype.setChatId = function (chatId) {
|
425
|
+
this.chatId = chatId;
|
426
|
+
};
|
427
|
+
AMSClientLogger.prototype.useTelemetry = function (telemetry) {
|
428
|
+
/* istanbul ignore next */
|
429
|
+
this.debug && console.log("[AMSClientLogger][useTelemetry]");
|
430
|
+
this.telemetry = telemetry;
|
431
|
+
};
|
432
|
+
AMSClientLogger.prototype.logClientSdkTelemetryEvent = function (logLevel, event) {
|
433
|
+
var _a, _b, _c, _d;
|
434
|
+
/* istanbul ignore next */
|
435
|
+
this.debug && console.log("[AMSClientLogger][logClientSdkTelemetryEvent][" + logLevel + "]");
|
436
|
+
/* istanbul ignore next */
|
437
|
+
this.debug && console.log(event);
|
438
|
+
var baseProperties = {
|
439
|
+
ChatSDKRuntimeId: this.runtimeId,
|
440
|
+
OrgId: this.omnichannelConfig.orgId,
|
441
|
+
OrgUrl: this.omnichannelConfig.orgUrl,
|
442
|
+
WidgetId: this.omnichannelConfig.widgetId,
|
443
|
+
RequestId: this.requestId,
|
444
|
+
ChatId: this.chatId
|
445
|
+
};
|
446
|
+
var additionalProperties = __assign(__assign({}, event), { ExceptionDetails: event.ExceptionDetails ? JSON.stringify(event.ExceptionDetails) : '' });
|
447
|
+
switch (logLevel) {
|
448
|
+
case LogLevel_1.default.DEBUG:
|
449
|
+
(_a = this.telemetry) === null || _a === void 0 ? void 0 : _a.debug(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.AMSCLIENT);
|
450
|
+
break;
|
451
|
+
case LogLevel_1.default.WARN:
|
452
|
+
(_b = this.telemetry) === null || _b === void 0 ? void 0 : _b.warn(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.AMSCLIENT);
|
453
|
+
break;
|
454
|
+
case LogLevel_1.default.ERROR:
|
455
|
+
(_c = this.telemetry) === null || _c === void 0 ? void 0 : _c.error(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.AMSCLIENT);
|
456
|
+
break;
|
457
|
+
case LogLevel_1.default.INFO:
|
458
|
+
default:
|
459
|
+
(_d = this.telemetry) === null || _d === void 0 ? void 0 : _d.info(__assign(__assign({}, baseProperties), additionalProperties), ScenarioType_1.default.AMSCLIENT);
|
460
|
+
break;
|
461
|
+
}
|
462
|
+
};
|
463
|
+
return AMSClientLogger;
|
464
|
+
}());
|
465
|
+
exports.AMSClientLogger = AMSClientLogger;
|
466
|
+
exports.createIC3ClientLogger = function (omnichannelConfig, debug) {
|
467
|
+
if (debug === void 0) { debug = false; }
|
468
|
+
var logger = new IC3ClientLogger(omnichannelConfig);
|
469
|
+
logger.setDebug(debug);
|
470
|
+
return logger;
|
471
|
+
};
|
472
|
+
exports.createOCSDKLogger = function (omnichannelConfig, debug) {
|
473
|
+
if (debug === void 0) { debug = false; }
|
474
|
+
var logger = new OCSDKLogger(omnichannelConfig);
|
475
|
+
logger.setDebug(debug);
|
476
|
+
return logger;
|
477
|
+
};
|
478
|
+
exports.createACSClientLogger = function (omnichannelConfig, debug) {
|
479
|
+
if (debug === void 0) { debug = false; }
|
480
|
+
var logger = new ACSClientLogger(omnichannelConfig);
|
481
|
+
logger.setDebug(debug);
|
482
|
+
return logger;
|
483
|
+
};
|
484
|
+
exports.createACSAdapterLogger = function (omnichannelConfig, debug) {
|
485
|
+
if (debug === void 0) { debug = false; }
|
486
|
+
var logger = new ACSAdapterLogger(omnichannelConfig);
|
487
|
+
logger.setDebug(debug);
|
488
|
+
return logger;
|
489
|
+
};
|
490
|
+
exports.createCallingSDKLogger = function (omnichannelConfig, debug) {
|
491
|
+
if (debug === void 0) { debug = false; }
|
492
|
+
var logger = new CallingSDKLogger(omnichannelConfig);
|
493
|
+
logger.setDebug(debug);
|
494
|
+
return logger;
|
495
|
+
};
|
496
|
+
exports.createAMSClientLogger = function (omnichannelConfig, debug) {
|
497
|
+
if (debug === void 0) { debug = false; }
|
498
|
+
var logger = new AMSClientLogger(omnichannelConfig);
|
499
|
+
logger.setDebug(debug);
|
500
|
+
return logger;
|
501
|
+
};
|
502
502
|
//# sourceMappingURL=loggers.js.map
|