@microsoft/omnichannel-chat-sdk 1.9.5 → 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.
Files changed (206) hide show
  1. package/lib/OmnichannelChatSDK.d.ts +128 -114
  2. package/lib/OmnichannelChatSDK.js +2609 -2394
  3. package/lib/OmnichannelChatSDK.js.map +1 -1
  4. package/lib/api/createVoiceVideoCalling.d.ts +53 -53
  5. package/lib/api/createVoiceVideoCalling.js +462 -462
  6. package/lib/commands/throwUnsupportedLiveChatVersionFailureIfApplicable.d.ts +3 -0
  7. package/lib/commands/throwUnsupportedLiveChatVersionFailureIfApplicable.js +14 -0
  8. package/lib/commands/throwUnsupportedLiveChatVersionFailureIfApplicable.js.map +1 -0
  9. package/lib/config/ocSDKConfiguration.d.ts +7 -7
  10. package/lib/config/ocSDKConfiguration.js +9 -9
  11. package/lib/config/settings.d.ts +6 -6
  12. package/lib/config/settings.js +13 -13
  13. package/lib/core/AuthSettings.d.ts +5 -5
  14. package/lib/core/AuthSettings.js +2 -2
  15. package/lib/core/AxiosErrorCodes.d.ts +4 -4
  16. package/lib/core/AxiosErrorCodes.js +7 -7
  17. package/lib/core/CallingOptionsOptionSetNumber.d.ts +6 -6
  18. package/lib/core/CallingOptionsOptionSetNumber.js +9 -9
  19. package/lib/core/ChatConfig.d.ts +10 -10
  20. package/lib/core/ChatConfig.js +2 -2
  21. package/lib/core/ChatReconnectContext.d.ts +4 -4
  22. package/lib/core/ChatReconnectContext.js +2 -2
  23. package/lib/core/ChatReconnectOptionalParams.d.ts +3 -3
  24. package/lib/core/ChatReconnectOptionalParams.js +2 -2
  25. package/lib/core/ChatSDKConfig.d.ts +38 -38
  26. package/lib/core/ChatSDKConfig.js +2 -2
  27. package/lib/core/ChatSDKError.d.ts +64 -63
  28. package/lib/core/ChatSDKError.js +73 -72
  29. package/lib/core/ChatSDKError.js.map +1 -1
  30. package/lib/core/ChatSDKExceptionDetails.d.ts +13 -13
  31. package/lib/core/ChatSDKExceptionDetails.js +2 -2
  32. package/lib/core/ChatTranscriptBody.d.ts +5 -5
  33. package/lib/core/ChatTranscriptBody.js +2 -2
  34. package/lib/core/ConversationMode.d.ts +5 -5
  35. package/lib/core/ConversationMode.js +8 -8
  36. package/lib/core/EmailLiveChatTranscriptOptionalParams.d.ts +4 -4
  37. package/lib/core/EmailLiveChatTranscriptOptionalParams.js +2 -2
  38. package/lib/core/GetAgentAvailabilityOptionalParams.d.ts +13 -13
  39. package/lib/core/GetAgentAvailabilityOptionalParams.js +2 -2
  40. package/lib/core/GetChatTokenOptionalParams.d.ts +3 -3
  41. package/lib/core/GetChatTokenOptionalParams.js +2 -2
  42. package/lib/core/GetConversationDetailsOptionalParams.d.ts +4 -4
  43. package/lib/core/GetConversationDetailsOptionalParams.js +2 -2
  44. package/lib/core/GetLiveChatConfigOptionalParams.d.ts +5 -5
  45. package/lib/core/GetLiveChatConfigOptionalParams.js +2 -2
  46. package/lib/core/GetLiveChatTranscriptOptionalParams.d.ts +4 -4
  47. package/lib/core/GetLiveChatTranscriptOptionalParams.js +2 -2
  48. package/lib/core/InitializeOptionalParams.d.ts +6 -5
  49. package/lib/core/InitializeOptionalParams.js +2 -2
  50. package/lib/core/LiveChatContext.d.ts +14 -14
  51. package/lib/core/LiveChatContext.js +2 -2
  52. package/lib/core/LiveChatVersion.d.ts +5 -5
  53. package/lib/core/LiveChatVersion.js +8 -8
  54. package/lib/core/LiveWorkItemDetails.d.ts +8 -8
  55. package/lib/core/LiveWorkItemDetails.js +2 -2
  56. package/lib/core/LiveWorkItemState.d.ts +8 -8
  57. package/lib/core/LiveWorkItemState.js +11 -11
  58. package/lib/core/OmnichannelConfig.d.ts +5 -5
  59. package/lib/core/OmnichannelConfig.js +2 -2
  60. package/lib/core/OmnichannelErrorCodes.d.ts +4 -4
  61. package/lib/core/OmnichannelErrorCodes.js +7 -7
  62. package/lib/core/PostChatContext.d.ts +8 -8
  63. package/lib/core/PostChatContext.js +2 -2
  64. package/lib/core/SetAuthTokenProviderOptionalParams.d.ts +3 -3
  65. package/lib/core/SetAuthTokenProviderOptionalParams.js +2 -2
  66. package/lib/core/StartChatOptionalParams.d.ts +18 -18
  67. package/lib/core/StartChatOptionalParams.js +2 -2
  68. package/lib/core/messaging/ACSChatMessageType.d.ts +7 -7
  69. package/lib/core/messaging/ACSChatMessageType.js +10 -10
  70. package/lib/core/messaging/ACSClient.d.ts +45 -45
  71. package/lib/core/messaging/ACSClient.js +612 -612
  72. package/lib/core/messaging/ACSClientConfig.d.ts +5 -5
  73. package/lib/core/messaging/ACSClientConfig.js +2 -2
  74. package/lib/core/messaging/ACSParticipantDisplayName.d.ts +6 -6
  75. package/lib/core/messaging/ACSParticipantDisplayName.js +9 -9
  76. package/lib/core/messaging/ACSSessionInfo.d.ts +5 -5
  77. package/lib/core/messaging/ACSSessionInfo.js +2 -2
  78. package/lib/core/messaging/ChatAdapterConfig.d.ts +8 -8
  79. package/lib/core/messaging/ChatAdapterConfig.js +2 -2
  80. package/lib/core/messaging/ChatAdapterOptionalParams.d.ts +24 -24
  81. package/lib/core/messaging/ChatAdapterOptionalParams.js +2 -2
  82. package/lib/core/messaging/ChatAdapterProtocols.d.ts +6 -6
  83. package/lib/core/messaging/ChatAdapterProtocols.js +10 -10
  84. package/lib/core/messaging/ChatSDKMessage.d.ts +6 -6
  85. package/lib/core/messaging/ChatSDKMessage.js +2 -2
  86. package/lib/core/messaging/IC3Config.d.ts +4 -4
  87. package/lib/core/messaging/IC3Config.js +2 -2
  88. package/lib/core/messaging/MessageTags.d.ts +3 -3
  89. package/lib/core/messaging/MessageTags.js +6 -6
  90. package/lib/core/messaging/OmnichannelMessage.d.ts +64 -64
  91. package/lib/core/messaging/OmnichannelMessage.js +51 -51
  92. package/lib/core/messaging/OnNewMessageOptionalParams.d.ts +3 -3
  93. package/lib/core/messaging/OnNewMessageOptionalParams.js +2 -2
  94. package/lib/external/ACSAdapter/AMSFileManager.d.ts +76 -76
  95. package/lib/external/ACSAdapter/AMSFileManager.js +394 -394
  96. package/lib/external/ACSAdapter/AMSFileScanner.d.ts +36 -36
  97. package/lib/external/ACSAdapter/AMSFileScanner.js +275 -275
  98. package/lib/external/ACSAdapter/activityUtils.d.ts +9 -9
  99. package/lib/external/ACSAdapter/activityUtils.js +79 -79
  100. package/lib/external/ACSAdapter/createChannelDataEgressMiddleware.d.ts +5 -5
  101. package/lib/external/ACSAdapter/createChannelDataEgressMiddleware.js +33 -33
  102. package/lib/external/ACSAdapter/createFileScanIngressMiddleware.d.ts +2 -2
  103. package/lib/external/ACSAdapter/createFileScanIngressMiddleware.js +95 -95
  104. package/lib/external/ACSAdapter/createFormatEgressTagsMiddleware.d.ts +2 -2
  105. package/lib/external/ACSAdapter/createFormatEgressTagsMiddleware.js +30 -30
  106. package/lib/external/ACSAdapter/createFormatIngressTagsMiddleware.d.ts +2 -2
  107. package/lib/external/ACSAdapter/createFormatIngressTagsMiddleware.js +24 -24
  108. package/lib/external/CallingSDK/ICallingSDKLogData.d.ts +7 -7
  109. package/lib/external/CallingSDK/ICallingSDKLogData.js +2 -2
  110. package/lib/external/IC3Adapter/IChatToken.d.ts +11 -11
  111. package/lib/external/IC3Adapter/IChatToken.js +3 -3
  112. package/lib/external/IC3Adapter/IIC3AdapterOptions.d.ts +22 -22
  113. package/lib/external/IC3Adapter/IIC3AdapterOptions.js +2 -2
  114. package/lib/external/IC3Adapter/INotification.d.ts +6 -6
  115. package/lib/external/IC3Adapter/INotification.js +2 -2
  116. package/lib/external/IC3Adapter/Notification.d.ts +7 -7
  117. package/lib/external/IC3Adapter/Notification.js +14 -14
  118. package/lib/external/IC3Client/IIC3SDKLogData.d.ts +9 -9
  119. package/lib/external/IC3Client/IIC3SDKLogData.js +2 -2
  120. package/lib/external/OCSDK/IOCSDKLogData.d.ts +14 -14
  121. package/lib/external/OCSDK/IOCSDKLogData.js +2 -2
  122. package/lib/index.d.ts +25 -25
  123. package/lib/index.js +34 -34
  124. package/lib/telemetry/AriaTelemetry.d.ts +40 -40
  125. package/lib/telemetry/AriaTelemetry.js +539 -539
  126. package/lib/telemetry/EUDomainNames.d.ts +2 -2
  127. package/lib/telemetry/EUDomainNames.js +16 -16
  128. package/lib/telemetry/EventMarker.d.ts +3 -3
  129. package/lib/telemetry/EventMarker.js +12 -12
  130. package/lib/telemetry/GCCDomainPatterns.d.ts +2 -2
  131. package/lib/telemetry/GCCDomainPatterns.js +7 -7
  132. package/lib/telemetry/LogLevel.d.ts +8 -8
  133. package/lib/telemetry/LogLevel.js +11 -11
  134. package/lib/telemetry/ScenarioMarker.d.ts +21 -21
  135. package/lib/telemetry/ScenarioMarker.js +82 -82
  136. package/lib/telemetry/ScenarioType.d.ts +11 -11
  137. package/lib/telemetry/ScenarioType.js +14 -14
  138. package/lib/telemetry/StopWatch.d.ts +6 -6
  139. package/lib/telemetry/StopWatch.js +14 -14
  140. package/lib/telemetry/TelemetryEvent.d.ts +46 -42
  141. package/lib/telemetry/TelemetryEvent.js +49 -45
  142. package/lib/telemetry/TelemetryEvent.js.map +1 -1
  143. package/lib/telemetry/retrieveCollectorUri.d.ts +2 -2
  144. package/lib/telemetry/retrieveCollectorUri.js +25 -25
  145. package/lib/tsconfig.tsbuildinfo +1976 -1911
  146. package/lib/utils/AMSClientLoadStates.d.ts +6 -0
  147. package/lib/utils/AMSClientLoadStates.js +12 -0
  148. package/lib/utils/AMSClientLoadStates.js.map +1 -0
  149. package/lib/utils/CoreServicesUtils.d.ts +7 -7
  150. package/lib/utils/CoreServicesUtils.js +39 -39
  151. package/lib/utils/WebUtils.d.ts +10 -10
  152. package/lib/utils/WebUtils.js +128 -128
  153. package/lib/utils/chatAdapterCreators.d.ts +20 -20
  154. package/lib/utils/chatAdapterCreators.js +208 -208
  155. package/lib/utils/createOcSDKConfiguration.d.ts +4 -4
  156. package/lib/utils/createOcSDKConfiguration.js +22 -22
  157. package/lib/utils/createOmnichannelMessage.d.ts +11 -11
  158. package/lib/utils/createOmnichannelMessage.js +77 -77
  159. package/lib/utils/createTelemetry.d.ts +3 -3
  160. package/lib/utils/createTelemetry.js +9 -9
  161. package/lib/utils/exceptionSuppressors.d.ts +29 -29
  162. package/lib/utils/exceptionSuppressors.js +49 -49
  163. package/lib/utils/exceptionThrowers.d.ts +119 -119
  164. package/lib/utils/exceptionThrowers.js +137 -137
  165. package/lib/utils/fillMobilePlatformData.d.ts +2 -0
  166. package/lib/utils/fillMobilePlatformData.js +44 -0
  167. package/lib/utils/fillMobilePlatformData.js.map +1 -0
  168. package/lib/utils/fillPlatformData.browser.d.ts +2 -0
  169. package/lib/utils/fillPlatformData.browser.js +8 -0
  170. package/lib/utils/fillPlatformData.browser.js.map +1 -0
  171. package/lib/utils/fillPlatformData.d.ts +2 -0
  172. package/lib/utils/fillPlatformData.js +8 -0
  173. package/lib/utils/fillPlatformData.js.map +1 -0
  174. package/lib/utils/fillWebPlatformData.d.ts +2 -0
  175. package/lib/utils/fillWebPlatformData.js +21 -0
  176. package/lib/utils/fillWebPlatformData.js.map +1 -0
  177. package/lib/utils/internalUtils.d.ts +4 -4
  178. package/lib/utils/internalUtils.js +16 -16
  179. package/lib/utils/libraries.d.ts +12 -12
  180. package/lib/utils/libraries.js +34 -34
  181. package/lib/utils/locale.d.ts +4 -4
  182. package/lib/utils/locale.js +60 -60
  183. package/lib/utils/location.d.ts +7 -7
  184. package/lib/utils/location.js +95 -95
  185. package/lib/utils/loggerUtils.d.ts +15 -15
  186. package/lib/utils/loggerUtils.js +55 -55
  187. package/lib/utils/loggers.d.ts +111 -111
  188. package/lib/utils/loggers.js +501 -501
  189. package/lib/utils/parsers.d.ts +6 -6
  190. package/lib/utils/parsers.js +10 -10
  191. package/lib/utils/platform.d.ts +9 -9
  192. package/lib/utils/platform.js +11 -11
  193. package/lib/utils/setOcUserAgent.d.ts +2 -2
  194. package/lib/utils/setOcUserAgent.js +21 -21
  195. package/lib/utils/sleep.d.ts +2 -2
  196. package/lib/utils/sleep.js +4 -4
  197. package/lib/utils/urlResolvers.d.ts +10 -10
  198. package/lib/utils/urlResolvers.js +64 -64
  199. package/lib/utils/utilities.d.ts +5 -5
  200. package/lib/utils/utilities.js +36 -36
  201. package/lib/validators/OmnichannelConfigValidator.d.ts +3 -3
  202. package/lib/validators/OmnichannelConfigValidator.js +28 -28
  203. package/lib/validators/SDKConfigValidators.d.ts +5 -5
  204. package/lib/validators/SDKConfigValidators.js +48 -48
  205. package/package.json +1 -1
  206. package/CHANGELOG.md +0 -435
@@ -1,540 +1,540 @@
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
- var settings_1 = require("../config/settings");
15
- var Enums_1 = require("../external/aria/common/Enums");
16
- var AriaSDK_1 = require("../external/aria/webjs/AriaSDK");
17
- var LogLevel_1 = require("../telemetry/LogLevel");
18
- var ScenarioType_1 = require("../telemetry/ScenarioType");
19
- var settings_2 = require("../config/settings");
20
- var platform_1 = require("../utils/platform");
21
- var Renderer;
22
- (function (Renderer) {
23
- Renderer["ReactNative"] = "ReactNative";
24
- })(Renderer || (Renderer = {}));
25
- var defaultAriaconfig = {
26
- collectorUri: 'https://browser.pipe.aria.microsoft.com/Collector/3.0/',
27
- cacheMemorySizeLimitInNumberOfEvents: 10000,
28
- disableCookiesUsage: false,
29
- canSendStatEvent: function (eventName) { return true; },
30
- clockSkewRefreshDurationInMins: 0
31
- };
32
- var AriaTelemetry = /** @class */ (function () {
33
- function AriaTelemetry() {
34
- }
35
- AriaTelemetry.initialize = function (key, configuration) {
36
- if (configuration === void 0) { configuration = defaultAriaconfig; }
37
- /* istanbul ignore next */
38
- this._debug && console.log("[AriaTelemetry][logger][initialize][custom]");
39
- AriaTelemetry._key = key;
40
- AriaTelemetry._configuration = __assign(__assign(__assign({}, defaultAriaconfig), configuration), { collectorUri: AriaTelemetry._collectorUri });
41
- AriaTelemetry._logger = AriaSDK_1.AWTLogManager.initialize(key, AriaTelemetry._configuration);
42
- };
43
- /* istanbul ignore next */
44
- AriaTelemetry.setDebug = function (flag) {
45
- AriaTelemetry._debug = flag;
46
- };
47
- AriaTelemetry.disable = function () {
48
- /* istanbul ignore next */
49
- this._debug && console.log("[AriaTelemetry][disable]");
50
- AriaTelemetry._disable = true;
51
- };
52
- AriaTelemetry.setCollectorUri = function (collectorUri) {
53
- AriaTelemetry._collectorUri = collectorUri;
54
- AriaTelemetry._configuration = __assign(__assign(__assign({}, defaultAriaconfig), AriaTelemetry._configuration), { collectorUri: AriaTelemetry._collectorUri });
55
- };
56
- AriaTelemetry.setCDNPackages = function (packages) {
57
- AriaTelemetry._CDNPackagesInfo = __assign(__assign({}, AriaTelemetry._CDNPackagesInfo), packages);
58
- };
59
- AriaTelemetry.info = function (properties, scenarioType) {
60
- var _a;
61
- if (scenarioType === void 0) { scenarioType = ScenarioType_1.default.EVENTS; }
62
- var event = {
63
- name: ScenarioType_1.default.EVENTS,
64
- properties: __assign(__assign(__assign(__assign(__assign({}, AriaTelemetry.populateBaseProperties()), AriaTelemetry.fillWebPlatformData()), AriaTelemetry.fillMobilePlatformData()), properties), { LogLevel: LogLevel_1.default.INFO }),
65
- priority: Enums_1.AWTEventPriority.High
66
- };
67
- if (scenarioType == ScenarioType_1.default.IC3CLIENT) {
68
- event = {
69
- name: ScenarioType_1.default.IC3CLIENT,
70
- properties: __assign(__assign(__assign({}, AriaTelemetry.populateIC3ClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.INFO }),
71
- priority: Enums_1.AWTEventPriority.High
72
- };
73
- }
74
- if (scenarioType == ScenarioType_1.default.OCSDK) {
75
- event = {
76
- name: ScenarioType_1.default.OCSDK,
77
- properties: __assign(__assign(__assign({}, AriaTelemetry.populateOCSDKBaseProperties()), properties), { LogLevel: LogLevel_1.default.INFO }),
78
- priority: Enums_1.AWTEventPriority.High
79
- };
80
- }
81
- if (scenarioType == ScenarioType_1.default.ACSCLIENT) {
82
- event = {
83
- name: ScenarioType_1.default.ACSCLIENT,
84
- properties: __assign(__assign(__assign({}, AriaTelemetry.populateACSClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.INFO }),
85
- priority: Enums_1.AWTEventPriority.High
86
- };
87
- }
88
- if (scenarioType == ScenarioType_1.default.ACSADAPTER) {
89
- event = {
90
- name: ScenarioType_1.default.ACSADAPTER,
91
- properties: __assign(__assign(__assign({}, AriaTelemetry.populateACSAdapterBaseProperties()), properties), { LogLevel: LogLevel_1.default.INFO }),
92
- priority: Enums_1.AWTEventPriority.High
93
- };
94
- }
95
- if (scenarioType == ScenarioType_1.default.CALLINGSDK) {
96
- event = {
97
- name: ScenarioType_1.default.CALLINGSDK,
98
- properties: __assign(__assign(__assign({}, AriaTelemetry.populateCallingSDKBaseProperties()), properties), { LogLevel: LogLevel_1.default.INFO }),
99
- priority: Enums_1.AWTEventPriority.High
100
- };
101
- }
102
- if (scenarioType == ScenarioType_1.default.AMSCLIENT) {
103
- event = {
104
- name: ScenarioType_1.default.AMSCLIENT,
105
- properties: __assign(__assign(__assign({}, AriaTelemetry.populateAMSClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.INFO }),
106
- priority: Enums_1.AWTEventPriority.High
107
- };
108
- }
109
- /* istanbul ignore next */
110
- this._debug && console.log("[AriaTelemetry][info] " + scenarioType);
111
- /* istanbul ignore next */
112
- this._debug && console.log(event);
113
- /* istanbul ignore next */
114
- this._debug && console.log(event.properties.Event);
115
- !AriaTelemetry._disable && ((_a = AriaTelemetry.logger) === null || _a === void 0 ? void 0 : _a.logEvent(event));
116
- };
117
- AriaTelemetry.debug = function (properties, scenarioType) {
118
- var _a;
119
- if (scenarioType === void 0) { scenarioType = ScenarioType_1.default.EVENTS; }
120
- var event = {
121
- name: ScenarioType_1.default.EVENTS,
122
- properties: __assign(__assign(__assign(__assign(__assign({}, AriaTelemetry.populateBaseProperties()), AriaTelemetry.fillWebPlatformData()), AriaTelemetry.fillMobilePlatformData()), properties), { LogLevel: LogLevel_1.default.DEBUG }),
123
- priority: Enums_1.AWTEventPriority.High
124
- };
125
- if (scenarioType == ScenarioType_1.default.IC3CLIENT) {
126
- event = {
127
- name: ScenarioType_1.default.IC3CLIENT,
128
- properties: __assign(__assign(__assign({}, AriaTelemetry.populateIC3ClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.DEBUG }),
129
- priority: Enums_1.AWTEventPriority.High
130
- };
131
- }
132
- if (scenarioType == ScenarioType_1.default.OCSDK) {
133
- event = {
134
- name: ScenarioType_1.default.OCSDK,
135
- properties: __assign(__assign(__assign({}, AriaTelemetry.populateOCSDKBaseProperties()), properties), { LogLevel: LogLevel_1.default.DEBUG }),
136
- priority: Enums_1.AWTEventPriority.High
137
- };
138
- }
139
- if (scenarioType == ScenarioType_1.default.ACSCLIENT) {
140
- event = {
141
- name: ScenarioType_1.default.ACSCLIENT,
142
- properties: __assign(__assign(__assign({}, AriaTelemetry.populateACSClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.DEBUG }),
143
- priority: Enums_1.AWTEventPriority.High
144
- };
145
- }
146
- if (scenarioType == ScenarioType_1.default.ACSADAPTER) {
147
- event = {
148
- name: ScenarioType_1.default.ACSADAPTER,
149
- properties: __assign(__assign(__assign({}, AriaTelemetry.populateACSAdapterBaseProperties()), properties), { LogLevel: LogLevel_1.default.DEBUG }),
150
- priority: Enums_1.AWTEventPriority.High
151
- };
152
- }
153
- if (scenarioType == ScenarioType_1.default.CALLINGSDK) {
154
- event = {
155
- name: ScenarioType_1.default.CALLINGSDK,
156
- properties: __assign(__assign(__assign({}, AriaTelemetry.populateCallingSDKBaseProperties()), properties), { LogLevel: LogLevel_1.default.DEBUG }),
157
- priority: Enums_1.AWTEventPriority.High
158
- };
159
- }
160
- if (scenarioType == ScenarioType_1.default.AMSCLIENT) {
161
- event = {
162
- name: ScenarioType_1.default.AMSCLIENT,
163
- properties: __assign(__assign(__assign({}, AriaTelemetry.populateAMSClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.DEBUG }),
164
- priority: Enums_1.AWTEventPriority.High
165
- };
166
- }
167
- /* istanbul ignore next */
168
- this._debug && console.log("[AriaTelemetry][debug] " + scenarioType);
169
- /* istanbul ignore next */
170
- this._debug && console.log(event);
171
- /* istanbul ignore next */
172
- this._debug && console.log(event.properties.Event);
173
- !AriaTelemetry._disable && ((_a = AriaTelemetry.logger) === null || _a === void 0 ? void 0 : _a.logEvent(event));
174
- };
175
- AriaTelemetry.warn = function (properties, scenarioType) {
176
- var _a;
177
- if (scenarioType === void 0) { scenarioType = ScenarioType_1.default.EVENTS; }
178
- var event = {
179
- name: ScenarioType_1.default.EVENTS,
180
- properties: __assign(__assign(__assign(__assign(__assign({}, AriaTelemetry.populateBaseProperties()), AriaTelemetry.fillWebPlatformData()), AriaTelemetry.fillMobilePlatformData()), properties), { LogLevel: LogLevel_1.default.WARN }),
181
- priority: Enums_1.AWTEventPriority.High
182
- };
183
- if (scenarioType == ScenarioType_1.default.IC3CLIENT) {
184
- event = {
185
- name: ScenarioType_1.default.IC3CLIENT,
186
- properties: __assign(__assign(__assign({}, AriaTelemetry.populateIC3ClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.WARN }),
187
- priority: Enums_1.AWTEventPriority.High
188
- };
189
- }
190
- if (scenarioType == ScenarioType_1.default.OCSDK) {
191
- event = {
192
- name: ScenarioType_1.default.OCSDK,
193
- properties: __assign(__assign(__assign({}, AriaTelemetry.populateOCSDKBaseProperties()), properties), { LogLevel: LogLevel_1.default.WARN }),
194
- priority: Enums_1.AWTEventPriority.High
195
- };
196
- }
197
- if (scenarioType == ScenarioType_1.default.ACSCLIENT) {
198
- event = {
199
- name: ScenarioType_1.default.ACSCLIENT,
200
- properties: __assign(__assign(__assign({}, AriaTelemetry.populateACSClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.WARN }),
201
- priority: Enums_1.AWTEventPriority.High
202
- };
203
- }
204
- if (scenarioType == ScenarioType_1.default.ACSADAPTER) {
205
- event = {
206
- name: ScenarioType_1.default.ACSADAPTER,
207
- properties: __assign(__assign(__assign({}, AriaTelemetry.populateACSAdapterBaseProperties()), properties), { LogLevel: LogLevel_1.default.WARN }),
208
- priority: Enums_1.AWTEventPriority.High
209
- };
210
- }
211
- if (scenarioType == ScenarioType_1.default.CALLINGSDK) {
212
- event = {
213
- name: ScenarioType_1.default.CALLINGSDK,
214
- properties: __assign(__assign(__assign({}, AriaTelemetry.populateCallingSDKBaseProperties()), properties), { LogLevel: LogLevel_1.default.WARN }),
215
- priority: Enums_1.AWTEventPriority.High
216
- };
217
- }
218
- if (scenarioType == ScenarioType_1.default.AMSCLIENT) {
219
- event = {
220
- name: ScenarioType_1.default.AMSCLIENT,
221
- properties: __assign(__assign(__assign({}, AriaTelemetry.populateAMSClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.WARN }),
222
- priority: Enums_1.AWTEventPriority.High
223
- };
224
- }
225
- /* istanbul ignore next */
226
- this._debug && console.log("[AriaTelemetry][warn] " + scenarioType);
227
- /* istanbul ignore next */
228
- this._debug && console.log(event);
229
- /* istanbul ignore next */
230
- this._debug && console.log(event.properties.Event);
231
- !AriaTelemetry._disable && ((_a = AriaTelemetry.logger) === null || _a === void 0 ? void 0 : _a.logEvent(event));
232
- };
233
- AriaTelemetry.error = function (properties, scenarioType) {
234
- var _a;
235
- if (scenarioType === void 0) { scenarioType = ScenarioType_1.default.EVENTS; }
236
- var event = {
237
- name: ScenarioType_1.default.EVENTS,
238
- properties: __assign(__assign(__assign(__assign(__assign({}, AriaTelemetry.populateBaseProperties()), AriaTelemetry.fillWebPlatformData()), AriaTelemetry.fillMobilePlatformData()), properties), { LogLevel: LogLevel_1.default.ERROR }),
239
- priority: Enums_1.AWTEventPriority.High
240
- };
241
- if (scenarioType == ScenarioType_1.default.IC3CLIENT) {
242
- event = {
243
- name: ScenarioType_1.default.IC3CLIENT,
244
- properties: __assign(__assign(__assign({}, AriaTelemetry.populateIC3ClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.ERROR }),
245
- priority: Enums_1.AWTEventPriority.High
246
- };
247
- }
248
- if (scenarioType == ScenarioType_1.default.OCSDK) {
249
- event = {
250
- name: ScenarioType_1.default.OCSDK,
251
- properties: __assign(__assign(__assign({}, AriaTelemetry.populateOCSDKBaseProperties()), properties), { LogLevel: LogLevel_1.default.ERROR }),
252
- priority: Enums_1.AWTEventPriority.High
253
- };
254
- }
255
- if (scenarioType == ScenarioType_1.default.ACSCLIENT) {
256
- event = {
257
- name: ScenarioType_1.default.ACSCLIENT,
258
- properties: __assign(__assign(__assign({}, AriaTelemetry.populateACSClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.ERROR }),
259
- priority: Enums_1.AWTEventPriority.High
260
- };
261
- }
262
- if (scenarioType == ScenarioType_1.default.ACSADAPTER) {
263
- event = {
264
- name: ScenarioType_1.default.ACSADAPTER,
265
- properties: __assign(__assign(__assign({}, AriaTelemetry.populateACSAdapterBaseProperties()), properties), { LogLevel: LogLevel_1.default.ERROR }),
266
- priority: Enums_1.AWTEventPriority.High
267
- };
268
- }
269
- if (scenarioType == ScenarioType_1.default.CALLINGSDK) {
270
- event = {
271
- name: ScenarioType_1.default.CALLINGSDK,
272
- properties: __assign(__assign(__assign({}, AriaTelemetry.populateCallingSDKBaseProperties()), properties), { LogLevel: LogLevel_1.default.ERROR }),
273
- priority: Enums_1.AWTEventPriority.High
274
- };
275
- }
276
- if (scenarioType == ScenarioType_1.default.AMSCLIENT) {
277
- event = {
278
- name: ScenarioType_1.default.AMSCLIENT,
279
- properties: __assign(__assign(__assign({}, AriaTelemetry.populateAMSClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.ERROR }),
280
- priority: Enums_1.AWTEventPriority.High
281
- };
282
- }
283
- /* istanbul ignore next */
284
- this._debug && console.log("[AriaTelemetry][error] " + scenarioType);
285
- /* istanbul ignore next */
286
- this._debug && console.log(event);
287
- /* istanbul ignore next */
288
- this._debug && console.log(event.properties.Event);
289
- !AriaTelemetry._disable && ((_a = AriaTelemetry.logger) === null || _a === void 0 ? void 0 : _a.logEvent(event));
290
- };
291
- AriaTelemetry.log = function (properties, scenarioType) {
292
- var _a;
293
- if (scenarioType === void 0) { scenarioType = ScenarioType_1.default.EVENTS; }
294
- var event = {
295
- name: ScenarioType_1.default.EVENTS,
296
- properties: __assign(__assign(__assign(__assign(__assign({}, AriaTelemetry.populateBaseProperties()), AriaTelemetry.fillWebPlatformData()), AriaTelemetry.fillMobilePlatformData()), properties), { LogLevel: LogLevel_1.default.LOG }),
297
- priority: Enums_1.AWTEventPriority.High
298
- };
299
- if (scenarioType == ScenarioType_1.default.IC3CLIENT) {
300
- event = {
301
- name: ScenarioType_1.default.IC3CLIENT,
302
- properties: __assign(__assign(__assign({}, AriaTelemetry.populateIC3ClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.LOG }),
303
- priority: Enums_1.AWTEventPriority.High
304
- };
305
- }
306
- if (scenarioType == ScenarioType_1.default.OCSDK) {
307
- event = {
308
- name: ScenarioType_1.default.OCSDK,
309
- properties: __assign(__assign(__assign({}, AriaTelemetry.populateOCSDKBaseProperties()), properties), { LogLevel: LogLevel_1.default.LOG }),
310
- priority: Enums_1.AWTEventPriority.High
311
- };
312
- }
313
- if (scenarioType == ScenarioType_1.default.ACSCLIENT) {
314
- event = {
315
- name: ScenarioType_1.default.ACSCLIENT,
316
- properties: __assign(__assign(__assign({}, AriaTelemetry.populateACSClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.LOG }),
317
- priority: Enums_1.AWTEventPriority.High
318
- };
319
- }
320
- if (scenarioType == ScenarioType_1.default.ACSADAPTER) {
321
- event = {
322
- name: ScenarioType_1.default.ACSADAPTER,
323
- properties: __assign(__assign(__assign({}, AriaTelemetry.populateACSAdapterBaseProperties()), properties), { LogLevel: LogLevel_1.default.LOG }),
324
- priority: Enums_1.AWTEventPriority.High
325
- };
326
- }
327
- if (scenarioType == ScenarioType_1.default.CALLINGSDK) {
328
- event = {
329
- name: ScenarioType_1.default.CALLINGSDK,
330
- properties: __assign(__assign(__assign({}, AriaTelemetry.populateCallingSDKBaseProperties()), properties), { LogLevel: LogLevel_1.default.LOG }),
331
- priority: Enums_1.AWTEventPriority.High
332
- };
333
- }
334
- if (scenarioType == ScenarioType_1.default.AMSCLIENT) {
335
- event = {
336
- name: ScenarioType_1.default.AMSCLIENT,
337
- properties: __assign(__assign(__assign({}, AriaTelemetry.populateAMSClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.LOG }),
338
- priority: Enums_1.AWTEventPriority.High
339
- };
340
- }
341
- /* istanbul ignore next */
342
- this._debug && console.log("[AriaTelemetry][log]");
343
- /* istanbul ignore next */
344
- this._debug && console.log(event);
345
- /* istanbul ignore next */
346
- this._debug && console.log(event.properties.Event);
347
- !AriaTelemetry._disable && ((_a = AriaTelemetry.logger) === null || _a === void 0 ? void 0 : _a.logEvent(event));
348
- };
349
- Object.defineProperty(AriaTelemetry, "logger", {
350
- get: function () {
351
- if (!AriaTelemetry._logger) {
352
- /* istanbul ignore next */
353
- this._debug && console.log("[AriaTelemetry][logger][initialize]");
354
- AriaTelemetry._logger = AriaSDK_1.AWTLogManager.initialize(settings_1.ariaTelemetryKey, AriaTelemetry._configuration);
355
- }
356
- return AriaTelemetry._logger;
357
- },
358
- enumerable: false,
359
- configurable: true
360
- });
361
- AriaTelemetry.populateBaseProperties = function () {
362
- var packagesInfo = {
363
- OCSDK: require('@microsoft/ocsdk/package.json').version,
364
- IC3Core: require('@microsoft/omnichannel-ic3core/package.json').version,
365
- ACSChat: require('@azure/communication-chat/package.json').version,
366
- ACSCommon: require('@azure/communication-common/package.json').version,
367
- AMSClient: require('@microsoft/omnichannel-amsclient/package.json').version,
368
- };
369
- return {
370
- ChatSDKRuntimeId: '',
371
- OrgId: '',
372
- OrgUrl: '',
373
- WidgetId: '',
374
- RequestId: '',
375
- ChatId: '',
376
- CallId: '',
377
- Domain: '',
378
- ExceptionDetails: '',
379
- ElapsedTimeInMilliseconds: '',
380
- ChatSDKVersion: require('../../package.json').version,
381
- NPMPackagesInfo: JSON.stringify(packagesInfo),
382
- CDNPackagesInfo: JSON.stringify(AriaTelemetry._CDNPackagesInfo),
383
- PlatformDetails: ''
384
- };
385
- };
386
- AriaTelemetry.fillMobilePlatformData = function () {
387
- var platformData = {}; // eslint-disable-line @typescript-eslint/no-explicit-any
388
- var platformDetails = {}; // eslint-disable-line @typescript-eslint/no-explicit-any
389
- if (!platform_1.isReactNative()) {
390
- return platformData;
391
- }
392
- try {
393
- var ReactNative = require('react-native'); // eslint-disable-line @typescript-eslint/no-var-requires
394
- var Platform = ReactNative.Platform;
395
- platformDetails.Renderer = Renderer.ReactNative;
396
- platformData.DeviceInfo_OsVersion = Platform.Version;
397
- platformDetails.DeviceInfo_OsVersion = Platform.Version;
398
- if (Platform.OS.toLowerCase() === 'android') {
399
- platformData.DeviceInfo_OsName = 'Android';
400
- platformDetails.DeviceInfo_OsName = 'Android';
401
- }
402
- else if (Platform.OS.toLowerCase() === 'ios') {
403
- platformData.DeviceInfo_OsName = 'iOS';
404
- platformDetails.DeviceInfo_OsName = 'iOS';
405
- }
406
- else {
407
- platformData.DeviceInfo_OsName = "" + Platform.OS;
408
- platformDetails.DeviceInfo_OsName = "" + Platform.OS;
409
- }
410
- /* istanbul ignore next */
411
- this._debug && console.log("[AriaTelemetry][fillMobilePlatformData][" + platformData.DeviceInfo_OsName + "]");
412
- }
413
- catch (_a) {
414
- /* istanbul ignore next */
415
- this._debug && console.log("[AriaTelemetry][fillMobilePlatformData][Web]");
416
- }
417
- platformData.PlatformDetails = JSON.stringify(platformDetails); // Fallback if unable to overwrite Aria's default properties
418
- return platformData;
419
- };
420
- AriaTelemetry.fillWebPlatformData = function () {
421
- var platformData = {}; // eslint-disable-line @typescript-eslint/no-explicit-any
422
- if (!platform_1.isBrowser()) {
423
- return platformData;
424
- }
425
- try {
426
- platformData.Domain = window.location.origin || '';
427
- /* istanbul ignore next */
428
- this._debug && console.log("[AriaTelemetry][fillWebPlatformData]");
429
- }
430
- catch (_a) {
431
- /* istanbul ignore next */
432
- this._debug && console.log("[AriaTelemetry][fillWebPlatformData][Error]");
433
- }
434
- return platformData;
435
- };
436
- AriaTelemetry.populateIC3ClientBaseProperties = function () {
437
- return {
438
- ChatSDKRuntimeId: '',
439
- OrgId: '',
440
- OrgUrl: '',
441
- WidgetId: '',
442
- RequestId: '',
443
- ChatId: '',
444
- Event: '',
445
- Description: '',
446
- SubscriptionId: '',
447
- EndpointId: '',
448
- EndpointUrl: '',
449
- ErrorCode: '',
450
- ExceptionDetails: '',
451
- ElapsedTimeInMilliseconds: '',
452
- IC3ClientVersion: settings_2.ic3ClientVersion
453
- };
454
- };
455
- AriaTelemetry.populateOCSDKBaseProperties = function () {
456
- return {
457
- ChatSDKRuntimeId: '',
458
- OrgId: '',
459
- OrgUrl: '',
460
- WidgetId: '',
461
- RequestId: '',
462
- ChatId: '',
463
- TransactionId: '',
464
- Event: '',
465
- ExceptionDetails: '',
466
- ElapsedTimeInMilliseconds: '',
467
- RequestHeaders: '',
468
- RequestPayload: '',
469
- RequestPath: '',
470
- RequestMethod: '',
471
- ResponseStatusCode: '',
472
- OCSDKVersion: require('@microsoft/ocsdk/package.json').version // eslint-disable-line @typescript-eslint/no-var-requires
473
- };
474
- };
475
- AriaTelemetry.populateACSClientBaseProperties = function () {
476
- return {
477
- ChatSDKRuntimeId: '',
478
- OrgId: '',
479
- OrgUrl: '',
480
- WidgetId: '',
481
- RequestId: '',
482
- ChatId: '',
483
- Event: '',
484
- ExceptionDetails: '',
485
- ElapsedTimeInMilliseconds: '',
486
- ACSChatVersion: require('@azure/communication-chat/package.json').version // eslint-disable-line @typescript-eslint/no-var-requires
487
- };
488
- };
489
- AriaTelemetry.populateACSAdapterBaseProperties = function () {
490
- return {
491
- ChatSDKRuntimeId: '',
492
- OrgId: '',
493
- OrgUrl: '',
494
- WidgetId: '',
495
- RequestId: '',
496
- ChatId: '',
497
- Event: '',
498
- ExceptionDetails: '',
499
- ElapsedTimeInMilliseconds: '',
500
- ACSAdapterVersion: settings_2.webChatACSAdapterVersion
501
- };
502
- };
503
- AriaTelemetry.populateCallingSDKBaseProperties = function () {
504
- return {
505
- ChatSDKRuntimeId: '',
506
- OrgId: '',
507
- OrgUrl: '',
508
- WidgetId: '',
509
- RequestId: '',
510
- ChatId: '',
511
- CallId: '',
512
- Event: '',
513
- Description: '',
514
- ExceptionDetails: '',
515
- ElapsedTimeInMilliseconds: ''
516
- };
517
- };
518
- AriaTelemetry.populateAMSClientBaseProperties = function () {
519
- return {
520
- ChatSDKRuntimeId: '',
521
- OrgId: '',
522
- OrgUrl: '',
523
- WidgetId: '',
524
- RequestId: '',
525
- ChatId: '',
526
- Event: '',
527
- ExceptionDetails: '',
528
- ElapsedTimeInMilliseconds: '',
529
- AMSClientVersion: require('@microsoft/omnichannel-amsclient/package.json').version // eslint-disable-line @typescript-eslint/no-var-requires
530
- };
531
- };
532
- AriaTelemetry._debug = false;
533
- AriaTelemetry._disable = false;
534
- AriaTelemetry._key = settings_1.ariaTelemetryKey;
535
- AriaTelemetry._collectorUri = defaultAriaconfig.collectorUri;
536
- AriaTelemetry._configuration = {};
537
- return AriaTelemetry;
538
- }());
539
- exports.default = AriaTelemetry;
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
+ var settings_1 = require("../config/settings");
15
+ var Enums_1 = require("../external/aria/common/Enums");
16
+ var AriaSDK_1 = require("../external/aria/webjs/AriaSDK");
17
+ var LogLevel_1 = require("../telemetry/LogLevel");
18
+ var ScenarioType_1 = require("../telemetry/ScenarioType");
19
+ var settings_2 = require("../config/settings");
20
+ var platform_1 = require("../utils/platform");
21
+ var Renderer;
22
+ (function (Renderer) {
23
+ Renderer["ReactNative"] = "ReactNative";
24
+ })(Renderer || (Renderer = {}));
25
+ var defaultAriaconfig = {
26
+ collectorUri: 'https://browser.pipe.aria.microsoft.com/Collector/3.0/',
27
+ cacheMemorySizeLimitInNumberOfEvents: 10000,
28
+ disableCookiesUsage: false,
29
+ canSendStatEvent: function (eventName) { return true; },
30
+ clockSkewRefreshDurationInMins: 0
31
+ };
32
+ var AriaTelemetry = /** @class */ (function () {
33
+ function AriaTelemetry() {
34
+ }
35
+ AriaTelemetry.initialize = function (key, configuration) {
36
+ if (configuration === void 0) { configuration = defaultAriaconfig; }
37
+ /* istanbul ignore next */
38
+ this._debug && console.log("[AriaTelemetry][logger][initialize][custom]");
39
+ AriaTelemetry._key = key;
40
+ AriaTelemetry._configuration = __assign(__assign(__assign({}, defaultAriaconfig), configuration), { collectorUri: AriaTelemetry._collectorUri });
41
+ AriaTelemetry._logger = AriaSDK_1.AWTLogManager.initialize(key, AriaTelemetry._configuration);
42
+ };
43
+ /* istanbul ignore next */
44
+ AriaTelemetry.setDebug = function (flag) {
45
+ AriaTelemetry._debug = flag;
46
+ };
47
+ AriaTelemetry.disable = function () {
48
+ /* istanbul ignore next */
49
+ this._debug && console.log("[AriaTelemetry][disable]");
50
+ AriaTelemetry._disable = true;
51
+ };
52
+ AriaTelemetry.setCollectorUri = function (collectorUri) {
53
+ AriaTelemetry._collectorUri = collectorUri;
54
+ AriaTelemetry._configuration = __assign(__assign(__assign({}, defaultAriaconfig), AriaTelemetry._configuration), { collectorUri: AriaTelemetry._collectorUri });
55
+ };
56
+ AriaTelemetry.setCDNPackages = function (packages) {
57
+ AriaTelemetry._CDNPackagesInfo = __assign(__assign({}, AriaTelemetry._CDNPackagesInfo), packages);
58
+ };
59
+ AriaTelemetry.info = function (properties, scenarioType) {
60
+ var _a;
61
+ if (scenarioType === void 0) { scenarioType = ScenarioType_1.default.EVENTS; }
62
+ var event = {
63
+ name: ScenarioType_1.default.EVENTS,
64
+ properties: __assign(__assign(__assign(__assign(__assign({}, AriaTelemetry.populateBaseProperties()), AriaTelemetry.fillWebPlatformData()), AriaTelemetry.fillMobilePlatformData()), properties), { LogLevel: LogLevel_1.default.INFO }),
65
+ priority: Enums_1.AWTEventPriority.High
66
+ };
67
+ if (scenarioType == ScenarioType_1.default.IC3CLIENT) {
68
+ event = {
69
+ name: ScenarioType_1.default.IC3CLIENT,
70
+ properties: __assign(__assign(__assign({}, AriaTelemetry.populateIC3ClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.INFO }),
71
+ priority: Enums_1.AWTEventPriority.High
72
+ };
73
+ }
74
+ if (scenarioType == ScenarioType_1.default.OCSDK) {
75
+ event = {
76
+ name: ScenarioType_1.default.OCSDK,
77
+ properties: __assign(__assign(__assign({}, AriaTelemetry.populateOCSDKBaseProperties()), properties), { LogLevel: LogLevel_1.default.INFO }),
78
+ priority: Enums_1.AWTEventPriority.High
79
+ };
80
+ }
81
+ if (scenarioType == ScenarioType_1.default.ACSCLIENT) {
82
+ event = {
83
+ name: ScenarioType_1.default.ACSCLIENT,
84
+ properties: __assign(__assign(__assign({}, AriaTelemetry.populateACSClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.INFO }),
85
+ priority: Enums_1.AWTEventPriority.High
86
+ };
87
+ }
88
+ if (scenarioType == ScenarioType_1.default.ACSADAPTER) {
89
+ event = {
90
+ name: ScenarioType_1.default.ACSADAPTER,
91
+ properties: __assign(__assign(__assign({}, AriaTelemetry.populateACSAdapterBaseProperties()), properties), { LogLevel: LogLevel_1.default.INFO }),
92
+ priority: Enums_1.AWTEventPriority.High
93
+ };
94
+ }
95
+ if (scenarioType == ScenarioType_1.default.CALLINGSDK) {
96
+ event = {
97
+ name: ScenarioType_1.default.CALLINGSDK,
98
+ properties: __assign(__assign(__assign({}, AriaTelemetry.populateCallingSDKBaseProperties()), properties), { LogLevel: LogLevel_1.default.INFO }),
99
+ priority: Enums_1.AWTEventPriority.High
100
+ };
101
+ }
102
+ if (scenarioType == ScenarioType_1.default.AMSCLIENT) {
103
+ event = {
104
+ name: ScenarioType_1.default.AMSCLIENT,
105
+ properties: __assign(__assign(__assign({}, AriaTelemetry.populateAMSClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.INFO }),
106
+ priority: Enums_1.AWTEventPriority.High
107
+ };
108
+ }
109
+ /* istanbul ignore next */
110
+ this._debug && console.log("[AriaTelemetry][info] " + scenarioType);
111
+ /* istanbul ignore next */
112
+ this._debug && console.log(event);
113
+ /* istanbul ignore next */
114
+ this._debug && console.log(event.properties.Event);
115
+ !AriaTelemetry._disable && ((_a = AriaTelemetry.logger) === null || _a === void 0 ? void 0 : _a.logEvent(event));
116
+ };
117
+ AriaTelemetry.debug = function (properties, scenarioType) {
118
+ var _a;
119
+ if (scenarioType === void 0) { scenarioType = ScenarioType_1.default.EVENTS; }
120
+ var event = {
121
+ name: ScenarioType_1.default.EVENTS,
122
+ properties: __assign(__assign(__assign(__assign(__assign({}, AriaTelemetry.populateBaseProperties()), AriaTelemetry.fillWebPlatformData()), AriaTelemetry.fillMobilePlatformData()), properties), { LogLevel: LogLevel_1.default.DEBUG }),
123
+ priority: Enums_1.AWTEventPriority.High
124
+ };
125
+ if (scenarioType == ScenarioType_1.default.IC3CLIENT) {
126
+ event = {
127
+ name: ScenarioType_1.default.IC3CLIENT,
128
+ properties: __assign(__assign(__assign({}, AriaTelemetry.populateIC3ClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.DEBUG }),
129
+ priority: Enums_1.AWTEventPriority.High
130
+ };
131
+ }
132
+ if (scenarioType == ScenarioType_1.default.OCSDK) {
133
+ event = {
134
+ name: ScenarioType_1.default.OCSDK,
135
+ properties: __assign(__assign(__assign({}, AriaTelemetry.populateOCSDKBaseProperties()), properties), { LogLevel: LogLevel_1.default.DEBUG }),
136
+ priority: Enums_1.AWTEventPriority.High
137
+ };
138
+ }
139
+ if (scenarioType == ScenarioType_1.default.ACSCLIENT) {
140
+ event = {
141
+ name: ScenarioType_1.default.ACSCLIENT,
142
+ properties: __assign(__assign(__assign({}, AriaTelemetry.populateACSClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.DEBUG }),
143
+ priority: Enums_1.AWTEventPriority.High
144
+ };
145
+ }
146
+ if (scenarioType == ScenarioType_1.default.ACSADAPTER) {
147
+ event = {
148
+ name: ScenarioType_1.default.ACSADAPTER,
149
+ properties: __assign(__assign(__assign({}, AriaTelemetry.populateACSAdapterBaseProperties()), properties), { LogLevel: LogLevel_1.default.DEBUG }),
150
+ priority: Enums_1.AWTEventPriority.High
151
+ };
152
+ }
153
+ if (scenarioType == ScenarioType_1.default.CALLINGSDK) {
154
+ event = {
155
+ name: ScenarioType_1.default.CALLINGSDK,
156
+ properties: __assign(__assign(__assign({}, AriaTelemetry.populateCallingSDKBaseProperties()), properties), { LogLevel: LogLevel_1.default.DEBUG }),
157
+ priority: Enums_1.AWTEventPriority.High
158
+ };
159
+ }
160
+ if (scenarioType == ScenarioType_1.default.AMSCLIENT) {
161
+ event = {
162
+ name: ScenarioType_1.default.AMSCLIENT,
163
+ properties: __assign(__assign(__assign({}, AriaTelemetry.populateAMSClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.DEBUG }),
164
+ priority: Enums_1.AWTEventPriority.High
165
+ };
166
+ }
167
+ /* istanbul ignore next */
168
+ this._debug && console.log("[AriaTelemetry][debug] " + scenarioType);
169
+ /* istanbul ignore next */
170
+ this._debug && console.log(event);
171
+ /* istanbul ignore next */
172
+ this._debug && console.log(event.properties.Event);
173
+ !AriaTelemetry._disable && ((_a = AriaTelemetry.logger) === null || _a === void 0 ? void 0 : _a.logEvent(event));
174
+ };
175
+ AriaTelemetry.warn = function (properties, scenarioType) {
176
+ var _a;
177
+ if (scenarioType === void 0) { scenarioType = ScenarioType_1.default.EVENTS; }
178
+ var event = {
179
+ name: ScenarioType_1.default.EVENTS,
180
+ properties: __assign(__assign(__assign(__assign(__assign({}, AriaTelemetry.populateBaseProperties()), AriaTelemetry.fillWebPlatformData()), AriaTelemetry.fillMobilePlatformData()), properties), { LogLevel: LogLevel_1.default.WARN }),
181
+ priority: Enums_1.AWTEventPriority.High
182
+ };
183
+ if (scenarioType == ScenarioType_1.default.IC3CLIENT) {
184
+ event = {
185
+ name: ScenarioType_1.default.IC3CLIENT,
186
+ properties: __assign(__assign(__assign({}, AriaTelemetry.populateIC3ClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.WARN }),
187
+ priority: Enums_1.AWTEventPriority.High
188
+ };
189
+ }
190
+ if (scenarioType == ScenarioType_1.default.OCSDK) {
191
+ event = {
192
+ name: ScenarioType_1.default.OCSDK,
193
+ properties: __assign(__assign(__assign({}, AriaTelemetry.populateOCSDKBaseProperties()), properties), { LogLevel: LogLevel_1.default.WARN }),
194
+ priority: Enums_1.AWTEventPriority.High
195
+ };
196
+ }
197
+ if (scenarioType == ScenarioType_1.default.ACSCLIENT) {
198
+ event = {
199
+ name: ScenarioType_1.default.ACSCLIENT,
200
+ properties: __assign(__assign(__assign({}, AriaTelemetry.populateACSClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.WARN }),
201
+ priority: Enums_1.AWTEventPriority.High
202
+ };
203
+ }
204
+ if (scenarioType == ScenarioType_1.default.ACSADAPTER) {
205
+ event = {
206
+ name: ScenarioType_1.default.ACSADAPTER,
207
+ properties: __assign(__assign(__assign({}, AriaTelemetry.populateACSAdapterBaseProperties()), properties), { LogLevel: LogLevel_1.default.WARN }),
208
+ priority: Enums_1.AWTEventPriority.High
209
+ };
210
+ }
211
+ if (scenarioType == ScenarioType_1.default.CALLINGSDK) {
212
+ event = {
213
+ name: ScenarioType_1.default.CALLINGSDK,
214
+ properties: __assign(__assign(__assign({}, AriaTelemetry.populateCallingSDKBaseProperties()), properties), { LogLevel: LogLevel_1.default.WARN }),
215
+ priority: Enums_1.AWTEventPriority.High
216
+ };
217
+ }
218
+ if (scenarioType == ScenarioType_1.default.AMSCLIENT) {
219
+ event = {
220
+ name: ScenarioType_1.default.AMSCLIENT,
221
+ properties: __assign(__assign(__assign({}, AriaTelemetry.populateAMSClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.WARN }),
222
+ priority: Enums_1.AWTEventPriority.High
223
+ };
224
+ }
225
+ /* istanbul ignore next */
226
+ this._debug && console.log("[AriaTelemetry][warn] " + scenarioType);
227
+ /* istanbul ignore next */
228
+ this._debug && console.log(event);
229
+ /* istanbul ignore next */
230
+ this._debug && console.log(event.properties.Event);
231
+ !AriaTelemetry._disable && ((_a = AriaTelemetry.logger) === null || _a === void 0 ? void 0 : _a.logEvent(event));
232
+ };
233
+ AriaTelemetry.error = function (properties, scenarioType) {
234
+ var _a;
235
+ if (scenarioType === void 0) { scenarioType = ScenarioType_1.default.EVENTS; }
236
+ var event = {
237
+ name: ScenarioType_1.default.EVENTS,
238
+ properties: __assign(__assign(__assign(__assign(__assign({}, AriaTelemetry.populateBaseProperties()), AriaTelemetry.fillWebPlatformData()), AriaTelemetry.fillMobilePlatformData()), properties), { LogLevel: LogLevel_1.default.ERROR }),
239
+ priority: Enums_1.AWTEventPriority.High
240
+ };
241
+ if (scenarioType == ScenarioType_1.default.IC3CLIENT) {
242
+ event = {
243
+ name: ScenarioType_1.default.IC3CLIENT,
244
+ properties: __assign(__assign(__assign({}, AriaTelemetry.populateIC3ClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.ERROR }),
245
+ priority: Enums_1.AWTEventPriority.High
246
+ };
247
+ }
248
+ if (scenarioType == ScenarioType_1.default.OCSDK) {
249
+ event = {
250
+ name: ScenarioType_1.default.OCSDK,
251
+ properties: __assign(__assign(__assign({}, AriaTelemetry.populateOCSDKBaseProperties()), properties), { LogLevel: LogLevel_1.default.ERROR }),
252
+ priority: Enums_1.AWTEventPriority.High
253
+ };
254
+ }
255
+ if (scenarioType == ScenarioType_1.default.ACSCLIENT) {
256
+ event = {
257
+ name: ScenarioType_1.default.ACSCLIENT,
258
+ properties: __assign(__assign(__assign({}, AriaTelemetry.populateACSClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.ERROR }),
259
+ priority: Enums_1.AWTEventPriority.High
260
+ };
261
+ }
262
+ if (scenarioType == ScenarioType_1.default.ACSADAPTER) {
263
+ event = {
264
+ name: ScenarioType_1.default.ACSADAPTER,
265
+ properties: __assign(__assign(__assign({}, AriaTelemetry.populateACSAdapterBaseProperties()), properties), { LogLevel: LogLevel_1.default.ERROR }),
266
+ priority: Enums_1.AWTEventPriority.High
267
+ };
268
+ }
269
+ if (scenarioType == ScenarioType_1.default.CALLINGSDK) {
270
+ event = {
271
+ name: ScenarioType_1.default.CALLINGSDK,
272
+ properties: __assign(__assign(__assign({}, AriaTelemetry.populateCallingSDKBaseProperties()), properties), { LogLevel: LogLevel_1.default.ERROR }),
273
+ priority: Enums_1.AWTEventPriority.High
274
+ };
275
+ }
276
+ if (scenarioType == ScenarioType_1.default.AMSCLIENT) {
277
+ event = {
278
+ name: ScenarioType_1.default.AMSCLIENT,
279
+ properties: __assign(__assign(__assign({}, AriaTelemetry.populateAMSClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.ERROR }),
280
+ priority: Enums_1.AWTEventPriority.High
281
+ };
282
+ }
283
+ /* istanbul ignore next */
284
+ this._debug && console.log("[AriaTelemetry][error] " + scenarioType);
285
+ /* istanbul ignore next */
286
+ this._debug && console.log(event);
287
+ /* istanbul ignore next */
288
+ this._debug && console.log(event.properties.Event);
289
+ !AriaTelemetry._disable && ((_a = AriaTelemetry.logger) === null || _a === void 0 ? void 0 : _a.logEvent(event));
290
+ };
291
+ AriaTelemetry.log = function (properties, scenarioType) {
292
+ var _a;
293
+ if (scenarioType === void 0) { scenarioType = ScenarioType_1.default.EVENTS; }
294
+ var event = {
295
+ name: ScenarioType_1.default.EVENTS,
296
+ properties: __assign(__assign(__assign(__assign(__assign({}, AriaTelemetry.populateBaseProperties()), AriaTelemetry.fillWebPlatformData()), AriaTelemetry.fillMobilePlatformData()), properties), { LogLevel: LogLevel_1.default.LOG }),
297
+ priority: Enums_1.AWTEventPriority.High
298
+ };
299
+ if (scenarioType == ScenarioType_1.default.IC3CLIENT) {
300
+ event = {
301
+ name: ScenarioType_1.default.IC3CLIENT,
302
+ properties: __assign(__assign(__assign({}, AriaTelemetry.populateIC3ClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.LOG }),
303
+ priority: Enums_1.AWTEventPriority.High
304
+ };
305
+ }
306
+ if (scenarioType == ScenarioType_1.default.OCSDK) {
307
+ event = {
308
+ name: ScenarioType_1.default.OCSDK,
309
+ properties: __assign(__assign(__assign({}, AriaTelemetry.populateOCSDKBaseProperties()), properties), { LogLevel: LogLevel_1.default.LOG }),
310
+ priority: Enums_1.AWTEventPriority.High
311
+ };
312
+ }
313
+ if (scenarioType == ScenarioType_1.default.ACSCLIENT) {
314
+ event = {
315
+ name: ScenarioType_1.default.ACSCLIENT,
316
+ properties: __assign(__assign(__assign({}, AriaTelemetry.populateACSClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.LOG }),
317
+ priority: Enums_1.AWTEventPriority.High
318
+ };
319
+ }
320
+ if (scenarioType == ScenarioType_1.default.ACSADAPTER) {
321
+ event = {
322
+ name: ScenarioType_1.default.ACSADAPTER,
323
+ properties: __assign(__assign(__assign({}, AriaTelemetry.populateACSAdapterBaseProperties()), properties), { LogLevel: LogLevel_1.default.LOG }),
324
+ priority: Enums_1.AWTEventPriority.High
325
+ };
326
+ }
327
+ if (scenarioType == ScenarioType_1.default.CALLINGSDK) {
328
+ event = {
329
+ name: ScenarioType_1.default.CALLINGSDK,
330
+ properties: __assign(__assign(__assign({}, AriaTelemetry.populateCallingSDKBaseProperties()), properties), { LogLevel: LogLevel_1.default.LOG }),
331
+ priority: Enums_1.AWTEventPriority.High
332
+ };
333
+ }
334
+ if (scenarioType == ScenarioType_1.default.AMSCLIENT) {
335
+ event = {
336
+ name: ScenarioType_1.default.AMSCLIENT,
337
+ properties: __assign(__assign(__assign({}, AriaTelemetry.populateAMSClientBaseProperties()), properties), { LogLevel: LogLevel_1.default.LOG }),
338
+ priority: Enums_1.AWTEventPriority.High
339
+ };
340
+ }
341
+ /* istanbul ignore next */
342
+ this._debug && console.log("[AriaTelemetry][log]");
343
+ /* istanbul ignore next */
344
+ this._debug && console.log(event);
345
+ /* istanbul ignore next */
346
+ this._debug && console.log(event.properties.Event);
347
+ !AriaTelemetry._disable && ((_a = AriaTelemetry.logger) === null || _a === void 0 ? void 0 : _a.logEvent(event));
348
+ };
349
+ Object.defineProperty(AriaTelemetry, "logger", {
350
+ get: function () {
351
+ if (!AriaTelemetry._logger) {
352
+ /* istanbul ignore next */
353
+ this._debug && console.log("[AriaTelemetry][logger][initialize]");
354
+ AriaTelemetry._logger = AriaSDK_1.AWTLogManager.initialize(settings_1.ariaTelemetryKey, AriaTelemetry._configuration);
355
+ }
356
+ return AriaTelemetry._logger;
357
+ },
358
+ enumerable: false,
359
+ configurable: true
360
+ });
361
+ AriaTelemetry.populateBaseProperties = function () {
362
+ var packagesInfo = {
363
+ OCSDK: require('@microsoft/ocsdk/package.json').version,
364
+ IC3Core: require('@microsoft/omnichannel-ic3core/package.json').version,
365
+ ACSChat: require('@azure/communication-chat/package.json').version,
366
+ ACSCommon: require('@azure/communication-common/package.json').version,
367
+ AMSClient: require('@microsoft/omnichannel-amsclient/package.json').version,
368
+ };
369
+ return {
370
+ ChatSDKRuntimeId: '',
371
+ OrgId: '',
372
+ OrgUrl: '',
373
+ WidgetId: '',
374
+ RequestId: '',
375
+ ChatId: '',
376
+ CallId: '',
377
+ Domain: '',
378
+ ExceptionDetails: '',
379
+ ElapsedTimeInMilliseconds: '',
380
+ ChatSDKVersion: require('../../package.json').version,
381
+ NPMPackagesInfo: JSON.stringify(packagesInfo),
382
+ CDNPackagesInfo: JSON.stringify(AriaTelemetry._CDNPackagesInfo),
383
+ PlatformDetails: ''
384
+ };
385
+ };
386
+ AriaTelemetry.fillMobilePlatformData = function () {
387
+ var platformData = {}; // eslint-disable-line @typescript-eslint/no-explicit-any
388
+ var platformDetails = {}; // eslint-disable-line @typescript-eslint/no-explicit-any
389
+ if (!platform_1.isReactNative()) {
390
+ return platformData;
391
+ }
392
+ try {
393
+ var ReactNative = require('react-native'); // eslint-disable-line @typescript-eslint/no-var-requires
394
+ var Platform = ReactNative.Platform;
395
+ platformDetails.Renderer = Renderer.ReactNative;
396
+ platformData.DeviceInfo_OsVersion = Platform.Version;
397
+ platformDetails.DeviceInfo_OsVersion = Platform.Version;
398
+ if (Platform.OS.toLowerCase() === 'android') {
399
+ platformData.DeviceInfo_OsName = 'Android';
400
+ platformDetails.DeviceInfo_OsName = 'Android';
401
+ }
402
+ else if (Platform.OS.toLowerCase() === 'ios') {
403
+ platformData.DeviceInfo_OsName = 'iOS';
404
+ platformDetails.DeviceInfo_OsName = 'iOS';
405
+ }
406
+ else {
407
+ platformData.DeviceInfo_OsName = "" + Platform.OS;
408
+ platformDetails.DeviceInfo_OsName = "" + Platform.OS;
409
+ }
410
+ /* istanbul ignore next */
411
+ this._debug && console.log("[AriaTelemetry][fillMobilePlatformData][" + platformData.DeviceInfo_OsName + "]");
412
+ }
413
+ catch (_a) {
414
+ /* istanbul ignore next */
415
+ this._debug && console.log("[AriaTelemetry][fillMobilePlatformData][Web]");
416
+ }
417
+ platformData.PlatformDetails = JSON.stringify(platformDetails); // Fallback if unable to overwrite Aria's default properties
418
+ return platformData;
419
+ };
420
+ AriaTelemetry.fillWebPlatformData = function () {
421
+ var platformData = {}; // eslint-disable-line @typescript-eslint/no-explicit-any
422
+ if (!platform_1.isBrowser()) {
423
+ return platformData;
424
+ }
425
+ try {
426
+ platformData.Domain = window.location.origin || '';
427
+ /* istanbul ignore next */
428
+ this._debug && console.log("[AriaTelemetry][fillWebPlatformData]");
429
+ }
430
+ catch (_a) {
431
+ /* istanbul ignore next */
432
+ this._debug && console.log("[AriaTelemetry][fillWebPlatformData][Error]");
433
+ }
434
+ return platformData;
435
+ };
436
+ AriaTelemetry.populateIC3ClientBaseProperties = function () {
437
+ return {
438
+ ChatSDKRuntimeId: '',
439
+ OrgId: '',
440
+ OrgUrl: '',
441
+ WidgetId: '',
442
+ RequestId: '',
443
+ ChatId: '',
444
+ Event: '',
445
+ Description: '',
446
+ SubscriptionId: '',
447
+ EndpointId: '',
448
+ EndpointUrl: '',
449
+ ErrorCode: '',
450
+ ExceptionDetails: '',
451
+ ElapsedTimeInMilliseconds: '',
452
+ IC3ClientVersion: settings_2.ic3ClientVersion
453
+ };
454
+ };
455
+ AriaTelemetry.populateOCSDKBaseProperties = function () {
456
+ return {
457
+ ChatSDKRuntimeId: '',
458
+ OrgId: '',
459
+ OrgUrl: '',
460
+ WidgetId: '',
461
+ RequestId: '',
462
+ ChatId: '',
463
+ TransactionId: '',
464
+ Event: '',
465
+ ExceptionDetails: '',
466
+ ElapsedTimeInMilliseconds: '',
467
+ RequestHeaders: '',
468
+ RequestPayload: '',
469
+ RequestPath: '',
470
+ RequestMethod: '',
471
+ ResponseStatusCode: '',
472
+ OCSDKVersion: require('@microsoft/ocsdk/package.json').version // eslint-disable-line @typescript-eslint/no-var-requires
473
+ };
474
+ };
475
+ AriaTelemetry.populateACSClientBaseProperties = function () {
476
+ return {
477
+ ChatSDKRuntimeId: '',
478
+ OrgId: '',
479
+ OrgUrl: '',
480
+ WidgetId: '',
481
+ RequestId: '',
482
+ ChatId: '',
483
+ Event: '',
484
+ ExceptionDetails: '',
485
+ ElapsedTimeInMilliseconds: '',
486
+ ACSChatVersion: require('@azure/communication-chat/package.json').version // eslint-disable-line @typescript-eslint/no-var-requires
487
+ };
488
+ };
489
+ AriaTelemetry.populateACSAdapterBaseProperties = function () {
490
+ return {
491
+ ChatSDKRuntimeId: '',
492
+ OrgId: '',
493
+ OrgUrl: '',
494
+ WidgetId: '',
495
+ RequestId: '',
496
+ ChatId: '',
497
+ Event: '',
498
+ ExceptionDetails: '',
499
+ ElapsedTimeInMilliseconds: '',
500
+ ACSAdapterVersion: settings_2.webChatACSAdapterVersion
501
+ };
502
+ };
503
+ AriaTelemetry.populateCallingSDKBaseProperties = function () {
504
+ return {
505
+ ChatSDKRuntimeId: '',
506
+ OrgId: '',
507
+ OrgUrl: '',
508
+ WidgetId: '',
509
+ RequestId: '',
510
+ ChatId: '',
511
+ CallId: '',
512
+ Event: '',
513
+ Description: '',
514
+ ExceptionDetails: '',
515
+ ElapsedTimeInMilliseconds: ''
516
+ };
517
+ };
518
+ AriaTelemetry.populateAMSClientBaseProperties = function () {
519
+ return {
520
+ ChatSDKRuntimeId: '',
521
+ OrgId: '',
522
+ OrgUrl: '',
523
+ WidgetId: '',
524
+ RequestId: '',
525
+ ChatId: '',
526
+ Event: '',
527
+ ExceptionDetails: '',
528
+ ElapsedTimeInMilliseconds: '',
529
+ AMSClientVersion: require('@microsoft/omnichannel-amsclient/package.json').version // eslint-disable-line @typescript-eslint/no-var-requires
530
+ };
531
+ };
532
+ AriaTelemetry._debug = false;
533
+ AriaTelemetry._disable = false;
534
+ AriaTelemetry._key = settings_1.ariaTelemetryKey;
535
+ AriaTelemetry._collectorUri = defaultAriaconfig.collectorUri;
536
+ AriaTelemetry._configuration = {};
537
+ return AriaTelemetry;
538
+ }());
539
+ exports.default = AriaTelemetry;
540
540
  //# sourceMappingURL=AriaTelemetry.js.map