@microsoft/applicationinsights-common 2.8.0-nightly.2202-06 → 2.8.0-nightly.2204-04

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 (253) hide show
  1. package/browser/applicationinsights-common.integrity.json +9 -9
  2. package/browser/applicationinsights-common.js +1007 -536
  3. package/browser/applicationinsights-common.js.map +1 -1
  4. package/browser/applicationinsights-common.min.js +2 -2
  5. package/browser/applicationinsights-common.min.js.map +1 -1
  6. package/dist/applicationinsights-common.api.json +2599 -928
  7. package/dist/applicationinsights-common.api.md +99 -43
  8. package/dist/applicationinsights-common.d.ts +515 -282
  9. package/dist/applicationinsights-common.js +1007 -536
  10. package/dist/applicationinsights-common.js.map +1 -1
  11. package/dist/applicationinsights-common.min.js +2 -2
  12. package/dist/applicationinsights-common.min.js.map +1 -1
  13. package/dist/applicationinsights-common.rollup.d.ts +515 -282
  14. package/dist-esm/ConnectionStringParser.js +1 -1
  15. package/dist-esm/Constants.js +1 -1
  16. package/dist-esm/DomHelperFuncs.js +1 -1
  17. package/dist-esm/Enums.js +11 -24
  18. package/dist-esm/Enums.js.map +1 -1
  19. package/dist-esm/HelperFuncs.js +7 -6
  20. package/dist-esm/HelperFuncs.js.map +1 -1
  21. package/dist-esm/Interfaces/ConnectionString.js +1 -1
  22. package/dist-esm/Interfaces/Context/IApplication.js +1 -1
  23. package/dist-esm/Interfaces/Context/IDevice.js +1 -1
  24. package/dist-esm/Interfaces/Context/IInternal.js +1 -1
  25. package/dist-esm/Interfaces/Context/ILocation.js +1 -1
  26. package/dist-esm/Interfaces/Context/IOperatingSystem.js +1 -1
  27. package/dist-esm/Interfaces/Context/ISample.js +1 -1
  28. package/dist-esm/Interfaces/Context/ISession.js +1 -1
  29. package/dist-esm/Interfaces/Context/ITelemetryTrace.js +1 -1
  30. package/dist-esm/Interfaces/Context/IUser.js +1 -1
  31. package/dist-esm/Interfaces/Context/IWeb.js +1 -1
  32. package/dist-esm/Interfaces/Contracts/AvailabilityData.js +52 -0
  33. package/dist-esm/Interfaces/Contracts/AvailabilityData.js.map +1 -0
  34. package/dist-esm/Interfaces/Contracts/{Generated/ContextTagKeys.js → ContextTagKeys.js} +1 -1
  35. package/dist-esm/Interfaces/Contracts/{Generated/ContextTagKeys.js.map → ContextTagKeys.js.map} +0 -0
  36. package/dist-esm/Interfaces/Contracts/DataPointType.js +8 -0
  37. package/dist-esm/Interfaces/Contracts/DataPointType.js.map +1 -0
  38. package/dist-esm/Interfaces/Contracts/DependencyKind.js +8 -0
  39. package/dist-esm/Interfaces/Contracts/DependencyKind.js.map +1 -0
  40. package/dist-esm/Interfaces/Contracts/DependencySourceType.js +8 -0
  41. package/dist-esm/Interfaces/Contracts/DependencySourceType.js.map +1 -0
  42. package/dist-esm/Interfaces/Contracts/{Generated/Domain.js → IBase.js} +2 -2
  43. package/dist-esm/Interfaces/Contracts/IBase.js.map +1 -0
  44. package/dist-esm/Interfaces/Contracts/IData.js +8 -0
  45. package/dist-esm/Interfaces/Contracts/IData.js.map +1 -0
  46. package/dist-esm/Interfaces/Contracts/IDataPoint.js +6 -0
  47. package/dist-esm/Interfaces/Contracts/IDataPoint.js.map +1 -0
  48. package/dist-esm/Interfaces/Contracts/IDomain.js +8 -0
  49. package/dist-esm/Interfaces/Contracts/IDomain.js.map +1 -0
  50. package/dist-esm/Interfaces/Contracts/IEnvelope.js +46 -0
  51. package/dist-esm/Interfaces/Contracts/IEnvelope.js.map +1 -0
  52. package/dist-esm/Interfaces/Contracts/IEventData.js +8 -0
  53. package/dist-esm/Interfaces/Contracts/IEventData.js.map +1 -0
  54. package/dist-esm/Interfaces/Contracts/IExceptionData.js +8 -0
  55. package/dist-esm/Interfaces/Contracts/IExceptionData.js.map +1 -0
  56. package/dist-esm/Interfaces/Contracts/IExceptionDetails.js +8 -0
  57. package/dist-esm/Interfaces/Contracts/IExceptionDetails.js.map +1 -0
  58. package/dist-esm/Interfaces/Contracts/IMessageData.js +8 -0
  59. package/dist-esm/Interfaces/Contracts/IMessageData.js.map +1 -0
  60. package/dist-esm/Interfaces/Contracts/IMetricData.js +8 -0
  61. package/dist-esm/Interfaces/Contracts/IMetricData.js.map +1 -0
  62. package/dist-esm/Interfaces/Contracts/IPageViewData.js +8 -0
  63. package/dist-esm/Interfaces/Contracts/IPageViewData.js.map +1 -0
  64. package/dist-esm/Interfaces/Contracts/IPageViewPerfData.js +8 -0
  65. package/dist-esm/Interfaces/Contracts/IPageViewPerfData.js.map +1 -0
  66. package/dist-esm/Interfaces/Contracts/IRemoteDependencyData.js +8 -0
  67. package/dist-esm/Interfaces/Contracts/IRemoteDependencyData.js.map +1 -0
  68. package/dist-esm/Interfaces/Contracts/IStackFrame.js +8 -0
  69. package/dist-esm/Interfaces/Contracts/IStackFrame.js.map +1 -0
  70. package/dist-esm/Interfaces/Contracts/RequestData.js +46 -0
  71. package/dist-esm/Interfaces/Contracts/RequestData.js.map +1 -0
  72. package/dist-esm/Interfaces/Contracts/{Generated/SeverityLevel.js → SeverityLevel.js} +1 -1
  73. package/dist-esm/Interfaces/Contracts/{Generated/SeverityLevel.js.map → SeverityLevel.js.map} +0 -0
  74. package/dist-esm/Interfaces/IAppInsights.js +1 -1
  75. package/dist-esm/Interfaces/IChannelControlsAI.js +1 -1
  76. package/dist-esm/Interfaces/IConfig.js +1 -1
  77. package/dist-esm/Interfaces/ICorrelationConfig.js +1 -1
  78. package/dist-esm/Interfaces/IDependencyTelemetry.js +1 -1
  79. package/dist-esm/Interfaces/IEventTelemetry.js +1 -1
  80. package/dist-esm/Interfaces/IExceptionTelemetry.js +1 -1
  81. package/dist-esm/Interfaces/IMetricTelemetry.js +1 -1
  82. package/dist-esm/Interfaces/IPageViewPerformanceTelemetry.js +1 -1
  83. package/dist-esm/Interfaces/IPageViewTelemetry.js +1 -1
  84. package/dist-esm/Interfaces/IPartC.js +1 -1
  85. package/dist-esm/Interfaces/IPropertiesPlugin.js +1 -1
  86. package/dist-esm/Interfaces/IRequestContext.js +1 -1
  87. package/dist-esm/Interfaces/ITelemetryContext.js +1 -1
  88. package/dist-esm/Interfaces/ITraceTelemetry.js +1 -1
  89. package/dist-esm/Interfaces/PartAExtensions.js +2 -2
  90. package/dist-esm/Interfaces/PartAExtensions.js.map +1 -1
  91. package/dist-esm/Interfaces/Telemetry/IEnvelope.js +1 -1
  92. package/dist-esm/Interfaces/Telemetry/ISerializable.js +1 -1
  93. package/dist-esm/RequestResponseHeaders.js +1 -1
  94. package/dist-esm/StorageHelperFuncs.js +27 -12
  95. package/dist-esm/StorageHelperFuncs.js.map +1 -1
  96. package/dist-esm/Telemetry/Common/Data.js +6 -11
  97. package/dist-esm/Telemetry/Common/Data.js.map +1 -1
  98. package/dist-esm/Telemetry/Common/DataPoint.js +8 -9
  99. package/dist-esm/Telemetry/Common/DataPoint.js.map +1 -1
  100. package/dist-esm/Telemetry/Common/DataSanitizer.js +8 -8
  101. package/dist-esm/Telemetry/Common/DataSanitizer.js.map +1 -1
  102. package/dist-esm/Telemetry/Common/Envelope.js +12 -12
  103. package/dist-esm/Telemetry/Common/Envelope.js.map +1 -1
  104. package/dist-esm/Telemetry/Event.js +9 -12
  105. package/dist-esm/Telemetry/Event.js.map +1 -1
  106. package/dist-esm/Telemetry/Exception.js +74 -81
  107. package/dist-esm/Telemetry/Exception.js.map +1 -1
  108. package/dist-esm/Telemetry/Metric.js +9 -12
  109. package/dist-esm/Telemetry/Metric.js.map +1 -1
  110. package/dist-esm/Telemetry/PageView.js +12 -15
  111. package/dist-esm/Telemetry/PageView.js.map +1 -1
  112. package/dist-esm/Telemetry/PageViewPerformance.js +16 -19
  113. package/dist-esm/Telemetry/PageViewPerformance.js.map +1 -1
  114. package/dist-esm/Telemetry/RemoteDependencyData.js +17 -20
  115. package/dist-esm/Telemetry/RemoteDependencyData.js.map +1 -1
  116. package/dist-esm/Telemetry/Trace.js +10 -13
  117. package/dist-esm/Telemetry/Trace.js.map +1 -1
  118. package/dist-esm/TelemetryItemCreator.js +1 -1
  119. package/dist-esm/UrlHelperFuncs.js +1 -1
  120. package/dist-esm/Util.js +1 -1
  121. package/dist-esm/applicationinsights-common.js +4 -7
  122. package/dist-esm/applicationinsights-common.js.map +1 -1
  123. package/package.json +3 -3
  124. package/src/Enums.ts +19 -3
  125. package/src/HelperFuncs.ts +7 -5
  126. package/src/Interfaces/Contracts/AvailabilityData.ts +57 -0
  127. package/src/Interfaces/Contracts/{Generated/ContextTagKeys.ts → ContextTagKeys.ts} +0 -0
  128. package/src/Interfaces/Contracts/{Generated/DataPointType.ts → DataPointType.ts} +2 -3
  129. package/src/Interfaces/Contracts/{Generated/DependencyKind.ts → DependencyKind.ts} +2 -3
  130. package/src/Interfaces/Contracts/{Generated/DependencySourceType.ts → DependencySourceType.ts} +2 -3
  131. package/src/Interfaces/Contracts/{Generated/Base.ts → IBase.ts} +2 -7
  132. package/src/Interfaces/Contracts/{Generated/Data.ts → IData.ts} +5 -12
  133. package/src/Interfaces/Contracts/{Generated/DataPoint.ts → IDataPoint.ts} +8 -8
  134. package/src/Interfaces/Contracts/{Generated/Domain.ts → IDomain.ts} +1 -3
  135. package/src/Interfaces/Contracts/IEnvelope.ts +50 -0
  136. package/src/Interfaces/Contracts/{Generated/EventData.ts → IEventData.ts} +7 -10
  137. package/src/Interfaces/Contracts/{Generated/ExceptionData.ts → IExceptionData.ts} +8 -11
  138. package/src/Interfaces/Contracts/{Generated/ExceptionDetails.ts → IExceptionDetails.ts} +9 -10
  139. package/src/Interfaces/Contracts/{Generated/MessageData.ts → IMessageData.ts} +7 -10
  140. package/src/Interfaces/Contracts/{Generated/MetricData.ts → IMetricData.ts} +7 -10
  141. package/{types/Interfaces/Contracts/Generated/PageViewData.d.ts → src/Interfaces/Contracts/IPageViewData.ts} +10 -19
  142. package/src/Interfaces/Contracts/IPageViewPerfData.ts +35 -0
  143. package/src/Interfaces/Contracts/{Generated/RemoteDependencyData.ts → IRemoteDependencyData.ts} +13 -16
  144. package/src/Interfaces/Contracts/{Generated/StackFrame.ts → IStackFrame.ts} +6 -7
  145. package/src/Interfaces/Contracts/RequestData.ts +50 -0
  146. package/src/Interfaces/Contracts/{Generated/SeverityLevel.ts → SeverityLevel.ts} +0 -0
  147. package/src/Interfaces/IExceptionTelemetry.ts +1 -1
  148. package/src/Interfaces/ITraceTelemetry.ts +1 -1
  149. package/src/Interfaces/PartAExtensions.ts +1 -1
  150. package/src/Interfaces/Telemetry/IEnvelope.ts +35 -3
  151. package/src/StorageHelperFuncs.ts +34 -17
  152. package/src/Telemetry/Common/Data.ts +12 -4
  153. package/src/Telemetry/Common/DataPoint.ts +38 -2
  154. package/src/Telemetry/Common/DataSanitizer.ts +13 -13
  155. package/src/Telemetry/Common/Envelope.ts +51 -10
  156. package/src/Telemetry/Event.ts +30 -12
  157. package/src/Telemetry/Exception.ts +179 -80
  158. package/src/Telemetry/Metric.ts +27 -7
  159. package/src/Telemetry/PageView.ts +45 -10
  160. package/src/Telemetry/PageViewPerformance.ts +75 -13
  161. package/src/Telemetry/RemoteDependencyData.ts +70 -15
  162. package/src/Telemetry/Trace.ts +34 -8
  163. package/src/TelemetryItemCreator.ts +1 -1
  164. package/src/applicationinsights-common.ts +7 -7
  165. package/types/Enums.d.ts +13 -2
  166. package/types/Interfaces/Contracts/AvailabilityData.d.ts +0 -0
  167. package/types/Interfaces/Contracts/{Generated/ContextTagKeys.d.ts → ContextTagKeys.d.ts} +0 -0
  168. package/types/Interfaces/Contracts/{Generated/DataPointType.d.ts → DataPointType.d.ts} +1 -1
  169. package/types/Interfaces/Contracts/{Generated/DependencyKind.d.ts → DependencyKind.d.ts} +1 -1
  170. package/types/Interfaces/Contracts/{Generated/DependencySourceType.d.ts → DependencySourceType.d.ts} +1 -1
  171. package/types/Interfaces/Contracts/{Generated/Base.d.ts → IBase.d.ts} +1 -2
  172. package/types/Interfaces/Contracts/{Generated/Data.d.ts → IData.d.ts} +2 -3
  173. package/types/Interfaces/Contracts/{Generated/DataPoint.d.ts → IDataPoint.d.ts} +1 -1
  174. package/types/Interfaces/Contracts/{Generated/Domain.d.ts → IDomain.d.ts} +1 -1
  175. package/types/Interfaces/Contracts/IEnvelope.d.ts +0 -0
  176. package/types/Interfaces/Contracts/{Generated/EventData.d.ts → IEventData.d.ts} +2 -3
  177. package/types/Interfaces/Contracts/{Generated/ExceptionData.d.ts → IExceptionData.d.ts} +4 -5
  178. package/types/Interfaces/Contracts/{Generated/ExceptionDetails.d.ts → IExceptionDetails.d.ts} +3 -3
  179. package/types/Interfaces/Contracts/{Generated/MessageData.d.ts → IMessageData.d.ts} +2 -3
  180. package/types/Interfaces/Contracts/{Generated/MetricData.d.ts → IMetricData.d.ts} +4 -5
  181. package/types/Interfaces/Contracts/IPageViewData.d.ts +18 -0
  182. package/types/Interfaces/Contracts/IPageViewPerfData.d.ts +26 -0
  183. package/types/Interfaces/Contracts/{Generated/RemoteDependencyData.d.ts → IRemoteDependencyData.d.ts} +2 -3
  184. package/types/Interfaces/Contracts/{Generated/StackFrame.d.ts → IStackFrame.d.ts} +1 -1
  185. package/types/Interfaces/Contracts/RequestData.d.ts +0 -0
  186. package/types/Interfaces/Contracts/{Generated/SeverityLevel.d.ts → SeverityLevel.d.ts} +0 -0
  187. package/types/Interfaces/IExceptionTelemetry.d.ts +1 -1
  188. package/types/Interfaces/ITraceTelemetry.d.ts +1 -1
  189. package/types/Interfaces/PartAExtensions.d.ts +1 -1
  190. package/types/Interfaces/Telemetry/IEnvelope.d.ts +24 -0
  191. package/types/StorageHelperFuncs.d.ts +14 -2
  192. package/types/Telemetry/Common/Data.d.ts +10 -2
  193. package/types/Telemetry/Common/DataPoint.d.ts +31 -2
  194. package/types/Telemetry/Common/Envelope.d.ts +35 -4
  195. package/types/Telemetry/Event.d.ts +19 -3
  196. package/types/Telemetry/Exception.d.ts +75 -7
  197. package/types/Telemetry/Metric.d.ts +19 -2
  198. package/types/Telemetry/PageView.d.ts +30 -2
  199. package/types/Telemetry/PageViewPerformance.d.ts +50 -2
  200. package/types/Telemetry/RemoteDependencyData.d.ts +46 -2
  201. package/types/Telemetry/Trace.d.ts +23 -3
  202. package/types/applicationinsights-common.d.ts +7 -7
  203. package/types/tsdoc-metadata.json +1 -1
  204. package/dist-esm/Interfaces/Contracts/Generated/AvailabilityData.js +0 -27
  205. package/dist-esm/Interfaces/Contracts/Generated/AvailabilityData.js.map +0 -1
  206. package/dist-esm/Interfaces/Contracts/Generated/Base.js +0 -17
  207. package/dist-esm/Interfaces/Contracts/Generated/Base.js.map +0 -1
  208. package/dist-esm/Interfaces/Contracts/Generated/Data.js +0 -21
  209. package/dist-esm/Interfaces/Contracts/Generated/Data.js.map +0 -1
  210. package/dist-esm/Interfaces/Contracts/Generated/DataPoint.js +0 -21
  211. package/dist-esm/Interfaces/Contracts/Generated/DataPoint.js.map +0 -1
  212. package/dist-esm/Interfaces/Contracts/Generated/DataPointType.js +0 -16
  213. package/dist-esm/Interfaces/Contracts/Generated/DataPointType.js.map +0 -1
  214. package/dist-esm/Interfaces/Contracts/Generated/DependencyKind.js +0 -17
  215. package/dist-esm/Interfaces/Contracts/Generated/DependencyKind.js.map +0 -1
  216. package/dist-esm/Interfaces/Contracts/Generated/DependencySourceType.js +0 -17
  217. package/dist-esm/Interfaces/Contracts/Generated/DependencySourceType.js.map +0 -1
  218. package/dist-esm/Interfaces/Contracts/Generated/Domain.js.map +0 -1
  219. package/dist-esm/Interfaces/Contracts/Generated/Envelope.js +0 -28
  220. package/dist-esm/Interfaces/Contracts/Generated/Envelope.js.map +0 -1
  221. package/dist-esm/Interfaces/Contracts/Generated/EventData.js +0 -28
  222. package/dist-esm/Interfaces/Contracts/Generated/EventData.js.map +0 -1
  223. package/dist-esm/Interfaces/Contracts/Generated/ExceptionData.js +0 -32
  224. package/dist-esm/Interfaces/Contracts/Generated/ExceptionData.js.map +0 -1
  225. package/dist-esm/Interfaces/Contracts/Generated/ExceptionDetails.js +0 -24
  226. package/dist-esm/Interfaces/Contracts/Generated/ExceptionDetails.js.map +0 -1
  227. package/dist-esm/Interfaces/Contracts/Generated/MessageData.js +0 -28
  228. package/dist-esm/Interfaces/Contracts/Generated/MessageData.js.map +0 -1
  229. package/dist-esm/Interfaces/Contracts/Generated/MetricData.js +0 -32
  230. package/dist-esm/Interfaces/Contracts/Generated/MetricData.js.map +0 -1
  231. package/dist-esm/Interfaces/Contracts/Generated/PageViewData.js +0 -34
  232. package/dist-esm/Interfaces/Contracts/Generated/PageViewData.js.map +0 -1
  233. package/dist-esm/Interfaces/Contracts/Generated/PageViewPerfData.js +0 -34
  234. package/dist-esm/Interfaces/Contracts/Generated/PageViewPerfData.js.map +0 -1
  235. package/dist-esm/Interfaces/Contracts/Generated/RemoteDependencyData.js +0 -32
  236. package/dist-esm/Interfaces/Contracts/Generated/RemoteDependencyData.js.map +0 -1
  237. package/dist-esm/Interfaces/Contracts/Generated/RequestData.js +0 -28
  238. package/dist-esm/Interfaces/Contracts/Generated/RequestData.js.map +0 -1
  239. package/dist-esm/Interfaces/Contracts/Generated/StackFrame.js +0 -17
  240. package/dist-esm/Interfaces/Contracts/Generated/StackFrame.js.map +0 -1
  241. package/dist-esm/Telemetry/Common/Base.js +0 -22
  242. package/dist-esm/Telemetry/Common/Base.js.map +0 -1
  243. package/src/Interfaces/Contracts/Generated/AvailabilityData.ts +0 -57
  244. package/src/Interfaces/Contracts/Generated/Envelope.ts +0 -50
  245. package/src/Interfaces/Contracts/Generated/PageViewData.ts +0 -50
  246. package/src/Interfaces/Contracts/Generated/PageViewPerfData.ts +0 -70
  247. package/src/Interfaces/Contracts/Generated/RequestData.ts +0 -50
  248. package/src/Telemetry/Common/Base.ts +0 -14
  249. package/types/Interfaces/Contracts/Generated/AvailabilityData.d.ts +0 -42
  250. package/types/Interfaces/Contracts/Generated/Envelope.d.ts +0 -38
  251. package/types/Interfaces/Contracts/Generated/PageViewPerfData.d.ts +0 -51
  252. package/types/Interfaces/Contracts/Generated/RequestData.d.ts +0 -38
  253. package/types/Telemetry/Common/Base.d.ts +0 -8
@@ -1,34 +1,31 @@
1
1
  /*
2
- * Application Insights JavaScript SDK - Common, 2.8.0-nightly.2202-06
2
+ * Application Insights JavaScript SDK - Common, 2.8.0-nightly.2204-04
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
 
6
6
 
7
- import { __extendsFn as __extends } from "@microsoft/applicationinsights-shims";
8
- import { EventData } from "../Interfaces/Contracts/Generated/EventData";
9
7
  import { dataSanitizeString, dataSanitizeProperties, dataSanitizeMeasurements } from "./Common/DataSanitizer";
10
8
  import { strNotSpecified } from "../Constants";
11
- var Event = /** @class */ (function (_super) {
12
- __extends(Event, _super);
9
+ var Event = /** @class */ (function () {
13
10
  /**
14
11
  * Constructs a new instance of the EventTelemetry object
15
12
  */
16
13
  function Event(logger, name, properties, measurements) {
17
- var _this = _super.call(this) || this;
18
- _this.aiDataContract = {
14
+ this.aiDataContract = {
19
15
  ver: 1 /* Required */,
20
16
  name: 1 /* Required */,
21
17
  properties: 0 /* Default */,
22
18
  measurements: 0 /* Default */
23
19
  };
24
- _this.name = dataSanitizeString(logger, name) || strNotSpecified;
25
- _this.properties = dataSanitizeProperties(logger, properties);
26
- _this.measurements = dataSanitizeMeasurements(logger, measurements);
27
- return _this;
20
+ var _self = this;
21
+ _self.ver = 2;
22
+ _self.name = dataSanitizeString(logger, name) || strNotSpecified;
23
+ _self.properties = dataSanitizeProperties(logger, properties);
24
+ _self.measurements = dataSanitizeMeasurements(logger, measurements);
28
25
  }
29
26
  Event.envelopeType = "Microsoft.ApplicationInsights.{0}.Event";
30
27
  Event.dataType = "EventData";
31
28
  return Event;
32
- }(EventData));
29
+ }());
33
30
  export { Event };
34
31
  //# sourceMappingURL=Event.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Event.js.map","sources":["Event.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { __extends } from \"tslib\";\r\nimport { EventData } from \"../Interfaces/Contracts/Generated/EventData\";\r\nimport { dataSanitizeString, dataSanitizeProperties, dataSanitizeMeasurements } from \"./Common/DataSanitizer\";\r\nimport { strNotSpecified } from \"../Constants\";\r\nvar Event = /** @class */ (function (_super) {\r\n __extends(Event, _super);\r\n /**\r\n * Constructs a new instance of the EventTelemetry object\r\n */\r\n function Event(logger, name, properties, measurements) {\r\n var _this = _super.call(this) || this;\r\n _this.aiDataContract = {\r\n ver: 1 /* Required */,\r\n name: 1 /* Required */,\r\n properties: 0 /* Default */,\r\n measurements: 0 /* Default */\r\n };\r\n _this.name = dataSanitizeString(logger, name) || strNotSpecified;\r\n _this.properties = dataSanitizeProperties(logger, properties);\r\n _this.measurements = dataSanitizeMeasurements(logger, measurements);\r\n return _this;\r\n }\r\n Event.envelopeType = \"Microsoft.ApplicationInsights.{0}.Event\";\r\n Event.dataType = \"EventData\";\r\n return Event;\r\n}(EventData));\r\nexport { Event };\r\n//# sourceMappingURL=Event.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC,gFAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
1
+ {"version":3,"file":"Event.js.map","sources":["Event.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { dataSanitizeString, dataSanitizeProperties, dataSanitizeMeasurements } from \"./Common/DataSanitizer\";\r\nimport { strNotSpecified } from \"../Constants\";\r\nvar Event = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of the EventTelemetry object\r\n */\r\n function Event(logger, name, properties, measurements) {\r\n this.aiDataContract = {\r\n ver: 1 /* Required */,\r\n name: 1 /* Required */,\r\n properties: 0 /* Default */,\r\n measurements: 0 /* Default */\r\n };\r\n var _self = this;\r\n _self.ver = 2;\r\n _self.name = dataSanitizeString(logger, name) || strNotSpecified;\r\n _self.properties = dataSanitizeProperties(logger, properties);\r\n _self.measurements = dataSanitizeMeasurements(logger, measurements);\r\n }\r\n Event.envelopeType = \"Microsoft.ApplicationInsights.{0}.Event\";\r\n Event.dataType = \"EventData\";\r\n return Event;\r\n}());\r\nexport { Event };\r\n//# sourceMappingURL=Event.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
@@ -1,13 +1,10 @@
1
1
  /*
2
- * Application Insights JavaScript SDK - Common, 2.8.0-nightly.2202-06
2
+ * Application Insights JavaScript SDK - Common, 2.8.0-nightly.2204-04
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
 
6
6
 
7
- import { __assignFn as __assign, __extendsFn as __extends } from "@microsoft/applicationinsights-shims";
8
- import { StackFrame } from "../Interfaces/Contracts/Generated/StackFrame";
9
- import { ExceptionData } from "../Interfaces/Contracts/Generated/ExceptionData";
10
- import { ExceptionDetails } from "../Interfaces/Contracts/Generated/ExceptionDetails";
7
+ import { __assignFn as __assign } from "@microsoft/applicationinsights-shims";
11
8
  import { dataSanitizeException, dataSanitizeMeasurements, dataSanitizeMessage, dataSanitizeProperties, dataSanitizeString } from "./Common/DataSanitizer";
12
9
  import { isNullOrUndefined, arrMap, isString, strTrim, isArray, isError, arrForEach, isObject, isFunction } from "@microsoft/applicationinsights-core-js";
13
10
  import { strNotSpecified } from "../Constants";
@@ -279,54 +276,52 @@ export function _formatErrorCode(errorObj) {
279
276
  // Fallback to just letting the object format itself into a string
280
277
  return "" + (errorObj || "");
281
278
  }
282
- var Exception = /** @class */ (function (_super) {
283
- __extends(Exception, _super);
279
+ var Exception = /** @class */ (function () {
284
280
  /**
285
281
  * Constructs a new instance of the ExceptionTelemetry object
286
282
  */
287
283
  function Exception(logger, exception, properties, measurements, severityLevel, id) {
288
- var _this = _super.call(this) || this;
289
- _this.aiDataContract = {
284
+ this.aiDataContract = {
290
285
  ver: 1 /* Required */,
291
286
  exceptions: 1 /* Required */,
292
287
  severityLevel: 0 /* Default */,
293
288
  properties: 0 /* Default */,
294
289
  measurements: 0 /* Default */
295
290
  };
291
+ var _self = this;
292
+ _self.ver = 2; // TODO: handle the CS"4.0" ==> breeze 2 conversion in a better way
296
293
  if (!_isExceptionInternal(exception)) {
297
294
  if (!properties) {
298
295
  properties = {};
299
296
  }
300
- _this.exceptions = [new _ExceptionDetails(logger, exception, properties)];
301
- _this.properties = dataSanitizeProperties(logger, properties);
302
- _this.measurements = dataSanitizeMeasurements(logger, measurements);
297
+ _self.exceptions = [new _ExceptionDetails(logger, exception, properties)];
298
+ _self.properties = dataSanitizeProperties(logger, properties);
299
+ _self.measurements = dataSanitizeMeasurements(logger, measurements);
303
300
  if (severityLevel) {
304
- _this.severityLevel = severityLevel;
301
+ _self.severityLevel = severityLevel;
305
302
  }
306
303
  if (id) {
307
- _this.id = id;
304
+ _self.id = id;
308
305
  }
309
306
  }
310
307
  else {
311
- _this.exceptions = exception.exceptions;
312
- _this.properties = exception.properties;
313
- _this.measurements = exception.measurements;
308
+ _self.exceptions = exception.exceptions || [];
309
+ _self.properties = exception.properties;
310
+ _self.measurements = exception.measurements;
314
311
  if (exception.severityLevel) {
315
- _this.severityLevel = exception.severityLevel;
312
+ _self.severityLevel = exception.severityLevel;
316
313
  }
317
314
  if (exception.id) {
318
- _this.id = exception.id;
315
+ _self.id = exception.id;
319
316
  }
320
317
  if (exception.problemGroup) {
321
- _this.problemGroup = exception.problemGroup;
318
+ _self.problemGroup = exception.problemGroup;
322
319
  }
323
320
  // bool/int types, use isNullOrUndefined
324
- _this.ver = 2; // TODO: handle the CS"4.0" ==> breeze 2 conversion in a better way
325
321
  if (!isNullOrUndefined(exception.isManual)) {
326
- _this.isManual = exception.isManual;
322
+ _self.isManual = exception.isManual;
327
323
  }
328
324
  }
329
- return _this;
330
325
  }
331
326
  Exception.CreateAutoException = function (message, url, lineNumber, columnNumber, error, evt, stack, errorSrc) {
332
327
  var errorType = _getErrorType(error || evt || message);
@@ -383,13 +378,11 @@ var Exception = /** @class */ (function (_super) {
383
378
  Exception.dataType = "ExceptionData";
384
379
  Exception.formatError = _formatErrorCode;
385
380
  return Exception;
386
- }(ExceptionData));
381
+ }());
387
382
  export { Exception };
388
- var _ExceptionDetails = /** @class */ (function (_super) {
389
- __extends(_ExceptionDetails, _super);
383
+ var _ExceptionDetails = /** @class */ (function () {
390
384
  function _ExceptionDetails(logger, exception, properties) {
391
- var _this = _super.call(this) || this;
392
- _this.aiDataContract = {
385
+ this.aiDataContract = {
393
386
  id: 0 /* Default */,
394
387
  outerId: 0 /* Default */,
395
388
  typeName: 1 /* Required */,
@@ -398,41 +391,42 @@ var _ExceptionDetails = /** @class */ (function (_super) {
398
391
  stack: 0 /* Default */,
399
392
  parsedStack: 2 /* Array */
400
393
  };
394
+ var _self = this;
401
395
  if (!_isExceptionDetailsInternal(exception)) {
402
396
  var error = exception;
403
397
  var evt = error && error.evt;
404
398
  if (!isError(error)) {
405
399
  error = error[strError] || evt || error;
406
400
  }
407
- _this.typeName = dataSanitizeString(logger, _getErrorType(error)) || strNotSpecified;
408
- _this.message = dataSanitizeMessage(logger, _formatMessage(exception || error, _this.typeName)) || strNotSpecified;
401
+ _self.typeName = dataSanitizeString(logger, _getErrorType(error)) || strNotSpecified;
402
+ _self.message = dataSanitizeMessage(logger, _formatMessage(exception || error, _self.typeName)) || strNotSpecified;
409
403
  var stack = exception[strStackDetails] || _getStackFromErrorObj(exception);
410
- _this.parsedStack = _parseStack(stack);
411
- _this[strStack] = dataSanitizeException(logger, _formatStackTrace(stack));
412
- _this.hasFullStack = isArray(_this.parsedStack) && _this.parsedStack.length > 0;
404
+ _self.parsedStack = _parseStack(stack);
405
+ _self[strStack] = dataSanitizeException(logger, _formatStackTrace(stack));
406
+ _self.hasFullStack = isArray(_self.parsedStack) && _self.parsedStack.length > 0;
413
407
  if (properties) {
414
- properties.typeName = properties.typeName || _this.typeName;
408
+ properties.typeName = properties.typeName || _self.typeName;
415
409
  }
416
410
  }
417
411
  else {
418
- _this.typeName = exception.typeName;
419
- _this.message = exception.message;
420
- _this[strStack] = exception[strStack];
421
- _this.parsedStack = exception.parsedStack;
422
- _this.hasFullStack = exception.hasFullStack;
412
+ _self.typeName = exception.typeName;
413
+ _self.message = exception.message;
414
+ _self[strStack] = exception[strStack];
415
+ _self.parsedStack = exception.parsedStack || [];
416
+ _self.hasFullStack = exception.hasFullStack;
423
417
  }
424
- return _this;
425
418
  }
426
419
  _ExceptionDetails.prototype.toInterface = function () {
427
- var parsedStack = this.parsedStack instanceof Array
428
- && arrMap(this.parsedStack, function (frame) { return frame.toInterface(); });
420
+ var _self = this;
421
+ var parsedStack = _self.parsedStack instanceof Array
422
+ && arrMap(_self.parsedStack, function (frame) { return frame.toInterface(); });
429
423
  var exceptionDetailsInterface = {
430
- id: this.id,
431
- outerId: this.outerId,
432
- typeName: this.typeName,
433
- message: this.message,
434
- hasFullStack: this.hasFullStack,
435
- stack: this[strStack],
424
+ id: _self.id,
425
+ outerId: _self.outerId,
426
+ typeName: _self.typeName,
427
+ message: _self.message,
428
+ hasFullStack: _self.hasFullStack,
429
+ stack: _self[strStack],
436
430
  parsedStack: parsedStack || undefined
437
431
  };
438
432
  return exceptionDetailsInterface;
@@ -445,63 +439,62 @@ var _ExceptionDetails = /** @class */ (function (_super) {
445
439
  return exceptionDetails;
446
440
  };
447
441
  return _ExceptionDetails;
448
- }(ExceptionDetails));
442
+ }());
449
443
  export { _ExceptionDetails };
450
- var _StackFrame = /** @class */ (function (_super) {
451
- __extends(_StackFrame, _super);
444
+ var _StackFrame = /** @class */ (function () {
452
445
  function _StackFrame(sourceFrame, level) {
453
- var _this = _super.call(this) || this;
454
- _this.sizeInBytes = 0;
455
- _this.aiDataContract = {
446
+ this.aiDataContract = {
456
447
  level: 1 /* Required */,
457
448
  method: 1 /* Required */,
458
449
  assembly: 0 /* Default */,
459
450
  fileName: 0 /* Default */,
460
451
  line: 0 /* Default */
461
452
  };
453
+ var _self = this;
454
+ _self.sizeInBytes = 0;
462
455
  // Not converting this to isString() as typescript uses this logic to "understand" the different
463
456
  // types for the 2 different code paths
464
457
  if (typeof sourceFrame === "string") {
465
458
  var frame = sourceFrame;
466
- _this.level = level;
467
- _this.method = NoMethod;
468
- _this.assembly = strTrim(frame);
469
- _this.fileName = "";
470
- _this.line = 0;
459
+ _self.level = level;
460
+ _self.method = NoMethod;
461
+ _self.assembly = strTrim(frame);
462
+ _self.fileName = "";
463
+ _self.line = 0;
471
464
  var matches = frame.match(_StackFrame.regex);
472
465
  if (matches && matches.length >= 5) {
473
- _this.method = strTrim(matches[2]) || _this.method;
474
- _this.fileName = strTrim(matches[4]);
475
- _this.line = parseInt(matches[5]) || 0;
466
+ _self.method = strTrim(matches[2]) || _self.method;
467
+ _self.fileName = strTrim(matches[4]);
468
+ _self.line = parseInt(matches[5]) || 0;
476
469
  }
477
470
  }
478
471
  else {
479
- _this.level = sourceFrame.level;
480
- _this.method = sourceFrame.method;
481
- _this.assembly = sourceFrame.assembly;
482
- _this.fileName = sourceFrame.fileName;
483
- _this.line = sourceFrame.line;
484
- _this.sizeInBytes = 0;
472
+ _self.level = sourceFrame.level;
473
+ _self.method = sourceFrame.method;
474
+ _self.assembly = sourceFrame.assembly;
475
+ _self.fileName = sourceFrame.fileName;
476
+ _self.line = sourceFrame.line;
477
+ _self.sizeInBytes = 0;
485
478
  }
486
- _this.sizeInBytes += _this.method.length;
487
- _this.sizeInBytes += _this.fileName.length;
488
- _this.sizeInBytes += _this.assembly.length;
479
+ _self.sizeInBytes += _self.method.length;
480
+ _self.sizeInBytes += _self.fileName.length;
481
+ _self.sizeInBytes += _self.assembly.length;
489
482
  // todo: these might need to be removed depending on how the back-end settles on their size calculation
490
- _this.sizeInBytes += _StackFrame.baseSize;
491
- _this.sizeInBytes += _this.level.toString().length;
492
- _this.sizeInBytes += _this.line.toString().length;
493
- return _this;
483
+ _self.sizeInBytes += _StackFrame.baseSize;
484
+ _self.sizeInBytes += _self.level.toString().length;
485
+ _self.sizeInBytes += _self.line.toString().length;
494
486
  }
495
487
  _StackFrame.CreateFromInterface = function (frame) {
496
488
  return new _StackFrame(frame, null /* level is available in frame interface */);
497
489
  };
498
490
  _StackFrame.prototype.toInterface = function () {
491
+ var _self = this;
499
492
  return {
500
- level: this.level,
501
- method: this.method,
502
- assembly: this.assembly,
503
- fileName: this.fileName,
504
- line: this.line
493
+ level: _self.level,
494
+ method: _self.method,
495
+ assembly: _self.assembly,
496
+ fileName: _self.fileName,
497
+ line: _self.line
505
498
  };
506
499
  };
507
500
  // regex to match stack frames from ie/chrome/ff
@@ -509,6 +502,6 @@ var _StackFrame = /** @class */ (function (_super) {
509
502
  _StackFrame.regex = /^([\s]+at)?[\s]{0,50}([^\@\()]+?)[\s]{0,50}(\@|\()([^\(\n]+):([0-9]+):([0-9]+)(\)?)$/;
510
503
  _StackFrame.baseSize = 58; // '{"method":"","level":,"assembly":"","fileName":"","line":}'.length
511
504
  return _StackFrame;
512
- }(StackFrame));
505
+ }());
513
506
  export { _StackFrame };
514
507
  //# sourceMappingURL=Exception.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Exception.js.map","sources":["Exception.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { __assign, __extends } from \"tslib\";\r\nimport { StackFrame } from \"../Interfaces/Contracts/Generated/StackFrame\";\r\nimport { ExceptionData } from \"../Interfaces/Contracts/Generated/ExceptionData\";\r\nimport { ExceptionDetails } from \"../Interfaces/Contracts/Generated/ExceptionDetails\";\r\nimport { dataSanitizeException, dataSanitizeMeasurements, dataSanitizeMessage, dataSanitizeProperties, dataSanitizeString } from \"./Common/DataSanitizer\";\r\nimport { isNullOrUndefined, arrMap, isString, strTrim, isArray, isError, arrForEach, isObject, isFunction } from \"@microsoft/applicationinsights-core-js\";\r\nimport { strNotSpecified } from \"../Constants\";\r\nvar NoMethod = \"<no_method>\";\r\nvar strError = \"error\";\r\nvar strStack = \"stack\";\r\nvar strStackDetails = \"stackDetails\";\r\nvar strErrorSrc = \"errorSrc\";\r\nvar strMessage = \"message\";\r\nvar strDescription = \"description\";\r\nfunction _stringify(value, convertToString) {\r\n var result = value;\r\n if (result && !isString(result)) {\r\n if (JSON && JSON.stringify) {\r\n result = JSON.stringify(value);\r\n if (convertToString && (!result || result === \"{}\")) {\r\n if (isFunction(value.toString)) {\r\n result = value.toString();\r\n }\r\n else {\r\n result = \"\" + value;\r\n }\r\n }\r\n }\r\n else {\r\n result = \"\" + value + \" - (Missing JSON.stringify)\";\r\n }\r\n }\r\n return result || \"\";\r\n}\r\nfunction _formatMessage(theEvent, errorType) {\r\n var evtMessage = theEvent;\r\n if (theEvent) {\r\n if (evtMessage && !isString(evtMessage)) {\r\n evtMessage = theEvent[strMessage] || theEvent[strDescription] || evtMessage;\r\n }\r\n // Make sure the message is a string\r\n if (evtMessage && !isString(evtMessage)) {\r\n // tslint:disable-next-line: prefer-conditional-expression\r\n evtMessage = _stringify(evtMessage, true);\r\n }\r\n if (theEvent[\"filename\"]) {\r\n // Looks like an event object with filename\r\n evtMessage = evtMessage + \" @\" + (theEvent[\"filename\"] || \"\") + \":\" + (theEvent[\"lineno\"] || \"?\") + \":\" + (theEvent[\"colno\"] || \"?\");\r\n }\r\n }\r\n // Automatically add the error type to the message if it does already appear to be present\r\n if (errorType && errorType !== \"String\" && errorType !== \"Object\" && errorType !== \"Error\" && (evtMessage || \"\").indexOf(errorType) === -1) {\r\n evtMessage = errorType + \": \" + evtMessage;\r\n }\r\n return evtMessage || \"\";\r\n}\r\nfunction _isExceptionDetailsInternal(value) {\r\n try {\r\n if (isObject(value)) {\r\n return \"hasFullStack\" in value && \"typeName\" in value;\r\n }\r\n }\r\n catch (e) {\r\n // This can happen with some native browser objects, but should not happen for the type we are checking for\r\n }\r\n return false;\r\n}\r\nfunction _isExceptionInternal(value) {\r\n try {\r\n if (isObject(value)) {\r\n return (\"ver\" in value && \"exceptions\" in value && \"properties\" in value);\r\n }\r\n }\r\n catch (e) {\r\n // This can happen with some native browser objects, but should not happen for the type we are checking for\r\n }\r\n return false;\r\n}\r\nfunction _isStackDetails(details) {\r\n return details && details.src && isString(details.src) && details.obj && isArray(details.obj);\r\n}\r\nfunction _convertStackObj(errorStack) {\r\n var src = errorStack || \"\";\r\n if (!isString(src)) {\r\n if (isString(src[strStack])) {\r\n src = src[strStack];\r\n }\r\n else {\r\n src = \"\" + src;\r\n }\r\n }\r\n var items = src.split(\"\\n\");\r\n return {\r\n src: src,\r\n obj: items\r\n };\r\n}\r\nfunction _getOperaStack(errorMessage) {\r\n var stack = [];\r\n var lines = errorMessage.split(\"\\n\");\r\n for (var lp = 0; lp < lines.length; lp++) {\r\n var entry = lines[lp];\r\n if (lines[lp + 1]) {\r\n entry += \"@\" + lines[lp + 1];\r\n lp++;\r\n }\r\n stack.push(entry);\r\n }\r\n return {\r\n src: errorMessage,\r\n obj: stack\r\n };\r\n}\r\nfunction _getStackFromErrorObj(errorObj) {\r\n var details = null;\r\n if (errorObj) {\r\n try {\r\n /* Using bracket notation is support older browsers (IE 7/8 -- dont remember the version) that throw when using dot\r\n notation for undefined objects and we don't want to loose the error from being reported */\r\n if (errorObj[strStack]) {\r\n // Chrome/Firefox\r\n details = _convertStackObj(errorObj[strStack]);\r\n }\r\n else if (errorObj[strError] && errorObj[strError][strStack]) {\r\n // Edge error event provides the stack and error object\r\n details = _convertStackObj(errorObj[strError][strStack]);\r\n }\r\n else if (errorObj[\"exception\"] && errorObj.exception[strStack]) {\r\n details = _convertStackObj(errorObj.exception[strStack]);\r\n }\r\n else if (_isStackDetails(errorObj)) {\r\n details = errorObj;\r\n }\r\n else if (_isStackDetails(errorObj[strStackDetails])) {\r\n details = errorObj[strStackDetails];\r\n }\r\n else if (window && window[\"opera\"] && errorObj[strMessage]) {\r\n // Opera\r\n details = _getOperaStack(errorObj.message);\r\n }\r\n else if (isString(errorObj)) {\r\n details = _convertStackObj(errorObj);\r\n }\r\n else {\r\n var evtMessage = errorObj[strMessage] || errorObj[strDescription] || \"\";\r\n if (isString(errorObj[strErrorSrc])) {\r\n if (evtMessage) {\r\n evtMessage += \"\\n\";\r\n }\r\n evtMessage += \" from \" + errorObj[strErrorSrc];\r\n }\r\n if (evtMessage) {\r\n details = _convertStackObj(evtMessage);\r\n }\r\n }\r\n }\r\n catch (e) {\r\n // something unexpected happened so to avoid failing to report any error lets swallow the exception\r\n // and fallback to the callee/caller method\r\n details = _convertStackObj(e);\r\n }\r\n }\r\n return details || {\r\n src: \"\",\r\n obj: null\r\n };\r\n}\r\nfunction _formatStackTrace(stackDetails) {\r\n var stack = \"\";\r\n if (stackDetails) {\r\n if (stackDetails.obj) {\r\n arrForEach(stackDetails.obj, function (entry) {\r\n stack += entry + \"\\n\";\r\n });\r\n }\r\n else {\r\n stack = stackDetails.src || \"\";\r\n }\r\n }\r\n return stack;\r\n}\r\nfunction _parseStack(stack) {\r\n var parsedStack;\r\n var frames = stack.obj;\r\n if (frames && frames.length > 0) {\r\n parsedStack = [];\r\n var level_1 = 0;\r\n var totalSizeInBytes_1 = 0;\r\n arrForEach(frames, function (frame) {\r\n var theFrame = frame.toString();\r\n if (_StackFrame.regex.test(theFrame)) {\r\n var parsedFrame = new _StackFrame(theFrame, level_1++);\r\n totalSizeInBytes_1 += parsedFrame.sizeInBytes;\r\n parsedStack.push(parsedFrame);\r\n }\r\n });\r\n // DP Constraint - exception parsed stack must be < 32KB\r\n // remove frames from the middle to meet the threshold\r\n var exceptionParsedStackThreshold = 32 * 1024;\r\n if (totalSizeInBytes_1 > exceptionParsedStackThreshold) {\r\n var left = 0;\r\n var right = parsedStack.length - 1;\r\n var size = 0;\r\n var acceptedLeft = left;\r\n var acceptedRight = right;\r\n while (left < right) {\r\n // check size\r\n var lSize = parsedStack[left].sizeInBytes;\r\n var rSize = parsedStack[right].sizeInBytes;\r\n size += lSize + rSize;\r\n if (size > exceptionParsedStackThreshold) {\r\n // remove extra frames from the middle\r\n var howMany = acceptedRight - acceptedLeft + 1;\r\n parsedStack.splice(acceptedLeft, howMany);\r\n break;\r\n }\r\n // update pointers\r\n acceptedLeft = left;\r\n acceptedRight = right;\r\n left++;\r\n right--;\r\n }\r\n }\r\n }\r\n return parsedStack;\r\n}\r\nfunction _getErrorType(errorType) {\r\n // Gets the Error Type by passing the constructor (used to get the true type of native error object).\r\n var typeName = \"\";\r\n if (errorType) {\r\n typeName = errorType.typeName || errorType.name || \"\";\r\n if (!typeName) {\r\n try {\r\n var funcNameRegex = /function (.{1,200})\\(/;\r\n var results = (funcNameRegex).exec((errorType).constructor.toString());\r\n typeName = (results && results.length > 1) ? results[1] : \"\";\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty -- Ignoring any failures as nothing we can do\r\n }\r\n }\r\n }\r\n return typeName;\r\n}\r\n/**\r\n * Formats the provided errorObj for display and reporting, it may be a String, Object, integer or undefined depending on the browser.\r\n * @param errorObj The supplied errorObj\r\n */\r\nexport function _formatErrorCode(errorObj) {\r\n if (errorObj) {\r\n try {\r\n if (!isString(errorObj)) {\r\n var errorType = _getErrorType(errorObj);\r\n var result = _stringify(errorObj, false);\r\n if (!result || result === \"{}\") {\r\n if (errorObj[strError]) {\r\n // Looks like an MS Error Event\r\n errorObj = errorObj[strError];\r\n errorType = _getErrorType(errorObj);\r\n }\r\n result = _stringify(errorObj, true);\r\n }\r\n if (result.indexOf(errorType) !== 0 && errorType !== \"String\") {\r\n return errorType + \":\" + result;\r\n }\r\n return result;\r\n }\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty -- Ignoring any failures as nothing we can do\r\n }\r\n }\r\n // Fallback to just letting the object format itself into a string\r\n return \"\" + (errorObj || \"\");\r\n}\r\nvar Exception = /** @class */ (function (_super) {\r\n __extends(Exception, _super);\r\n /**\r\n * Constructs a new instance of the ExceptionTelemetry object\r\n */\r\n function Exception(logger, exception, properties, measurements, severityLevel, id) {\r\n var _this = _super.call(this) || this;\r\n _this.aiDataContract = {\r\n ver: 1 /* Required */,\r\n exceptions: 1 /* Required */,\r\n severityLevel: 0 /* Default */,\r\n properties: 0 /* Default */,\r\n measurements: 0 /* Default */\r\n };\r\n if (!_isExceptionInternal(exception)) {\r\n if (!properties) {\r\n properties = {};\r\n }\r\n _this.exceptions = [new _ExceptionDetails(logger, exception, properties)];\r\n _this.properties = dataSanitizeProperties(logger, properties);\r\n _this.measurements = dataSanitizeMeasurements(logger, measurements);\r\n if (severityLevel) {\r\n _this.severityLevel = severityLevel;\r\n }\r\n if (id) {\r\n _this.id = id;\r\n }\r\n }\r\n else {\r\n _this.exceptions = exception.exceptions;\r\n _this.properties = exception.properties;\r\n _this.measurements = exception.measurements;\r\n if (exception.severityLevel) {\r\n _this.severityLevel = exception.severityLevel;\r\n }\r\n if (exception.id) {\r\n _this.id = exception.id;\r\n }\r\n if (exception.problemGroup) {\r\n _this.problemGroup = exception.problemGroup;\r\n }\r\n // bool/int types, use isNullOrUndefined\r\n _this.ver = 2; // TODO: handle the CS\"4.0\" ==> breeze 2 conversion in a better way\r\n if (!isNullOrUndefined(exception.isManual)) {\r\n _this.isManual = exception.isManual;\r\n }\r\n }\r\n return _this;\r\n }\r\n Exception.CreateAutoException = function (message, url, lineNumber, columnNumber, error, evt, stack, errorSrc) {\r\n var errorType = _getErrorType(error || evt || message);\r\n return {\r\n message: _formatMessage(message, errorType),\r\n url: url,\r\n lineNumber: lineNumber,\r\n columnNumber: columnNumber,\r\n error: _formatErrorCode(error || evt || message),\r\n evt: _formatErrorCode(evt || message),\r\n typeName: errorType,\r\n stackDetails: _getStackFromErrorObj(stack || error || evt),\r\n errorSrc: errorSrc\r\n };\r\n };\r\n Exception.CreateFromInterface = function (logger, exception, properties, measurements) {\r\n var exceptions = exception.exceptions\r\n && arrMap(exception.exceptions, function (ex) { return _ExceptionDetails.CreateFromInterface(logger, ex); });\r\n var exceptionData = new Exception(logger, __assign(__assign({}, exception), { exceptions: exceptions }), properties, measurements);\r\n return exceptionData;\r\n };\r\n Exception.prototype.toInterface = function () {\r\n var _a = this, exceptions = _a.exceptions, properties = _a.properties, measurements = _a.measurements, severityLevel = _a.severityLevel, problemGroup = _a.problemGroup, id = _a.id, isManual = _a.isManual;\r\n var exceptionDetailsInterface = exceptions instanceof Array\r\n && arrMap(exceptions, function (exception) { return exception.toInterface(); })\r\n || undefined;\r\n return {\r\n ver: \"4.0\",\r\n exceptions: exceptionDetailsInterface,\r\n severityLevel: severityLevel,\r\n properties: properties,\r\n measurements: measurements,\r\n problemGroup: problemGroup,\r\n id: id,\r\n isManual: isManual\r\n };\r\n };\r\n /**\r\n * Creates a simple exception with 1 stack frame. Useful for manual constracting of exception.\r\n */\r\n Exception.CreateSimpleException = function (message, typeName, assembly, fileName, details, line) {\r\n return {\r\n exceptions: [\r\n {\r\n hasFullStack: true,\r\n message: message,\r\n stack: details,\r\n typeName: typeName\r\n }\r\n ]\r\n };\r\n };\r\n Exception.envelopeType = \"Microsoft.ApplicationInsights.{0}.Exception\";\r\n Exception.dataType = \"ExceptionData\";\r\n Exception.formatError = _formatErrorCode;\r\n return Exception;\r\n}(ExceptionData));\r\nexport { Exception };\r\nvar _ExceptionDetails = /** @class */ (function (_super) {\r\n __extends(_ExceptionDetails, _super);\r\n function _ExceptionDetails(logger, exception, properties) {\r\n var _this = _super.call(this) || this;\r\n _this.aiDataContract = {\r\n id: 0 /* Default */,\r\n outerId: 0 /* Default */,\r\n typeName: 1 /* Required */,\r\n message: 1 /* Required */,\r\n hasFullStack: 0 /* Default */,\r\n stack: 0 /* Default */,\r\n parsedStack: 2 /* Array */\r\n };\r\n if (!_isExceptionDetailsInternal(exception)) {\r\n var error = exception;\r\n var evt = error && error.evt;\r\n if (!isError(error)) {\r\n error = error[strError] || evt || error;\r\n }\r\n _this.typeName = dataSanitizeString(logger, _getErrorType(error)) || strNotSpecified;\r\n _this.message = dataSanitizeMessage(logger, _formatMessage(exception || error, _this.typeName)) || strNotSpecified;\r\n var stack = exception[strStackDetails] || _getStackFromErrorObj(exception);\r\n _this.parsedStack = _parseStack(stack);\r\n _this[strStack] = dataSanitizeException(logger, _formatStackTrace(stack));\r\n _this.hasFullStack = isArray(_this.parsedStack) && _this.parsedStack.length > 0;\r\n if (properties) {\r\n properties.typeName = properties.typeName || _this.typeName;\r\n }\r\n }\r\n else {\r\n _this.typeName = exception.typeName;\r\n _this.message = exception.message;\r\n _this[strStack] = exception[strStack];\r\n _this.parsedStack = exception.parsedStack;\r\n _this.hasFullStack = exception.hasFullStack;\r\n }\r\n return _this;\r\n }\r\n _ExceptionDetails.prototype.toInterface = function () {\r\n var parsedStack = this.parsedStack instanceof Array\r\n && arrMap(this.parsedStack, function (frame) { return frame.toInterface(); });\r\n var exceptionDetailsInterface = {\r\n id: this.id,\r\n outerId: this.outerId,\r\n typeName: this.typeName,\r\n message: this.message,\r\n hasFullStack: this.hasFullStack,\r\n stack: this[strStack],\r\n parsedStack: parsedStack || undefined\r\n };\r\n return exceptionDetailsInterface;\r\n };\r\n _ExceptionDetails.CreateFromInterface = function (logger, exception) {\r\n var parsedStack = (exception.parsedStack instanceof Array\r\n && arrMap(exception.parsedStack, function (frame) { return _StackFrame.CreateFromInterface(frame); }))\r\n || exception.parsedStack;\r\n var exceptionDetails = new _ExceptionDetails(logger, __assign(__assign({}, exception), { parsedStack: parsedStack }));\r\n return exceptionDetails;\r\n };\r\n return _ExceptionDetails;\r\n}(ExceptionDetails));\r\nexport { _ExceptionDetails };\r\nvar _StackFrame = /** @class */ (function (_super) {\r\n __extends(_StackFrame, _super);\r\n function _StackFrame(sourceFrame, level) {\r\n var _this = _super.call(this) || this;\r\n _this.sizeInBytes = 0;\r\n _this.aiDataContract = {\r\n level: 1 /* Required */,\r\n method: 1 /* Required */,\r\n assembly: 0 /* Default */,\r\n fileName: 0 /* Default */,\r\n line: 0 /* Default */\r\n };\r\n // Not converting this to isString() as typescript uses this logic to \"understand\" the different\r\n // types for the 2 different code paths\r\n if (typeof sourceFrame === \"string\") {\r\n var frame = sourceFrame;\r\n _this.level = level;\r\n _this.method = NoMethod;\r\n _this.assembly = strTrim(frame);\r\n _this.fileName = \"\";\r\n _this.line = 0;\r\n var matches = frame.match(_StackFrame.regex);\r\n if (matches && matches.length >= 5) {\r\n _this.method = strTrim(matches[2]) || _this.method;\r\n _this.fileName = strTrim(matches[4]);\r\n _this.line = parseInt(matches[5]) || 0;\r\n }\r\n }\r\n else {\r\n _this.level = sourceFrame.level;\r\n _this.method = sourceFrame.method;\r\n _this.assembly = sourceFrame.assembly;\r\n _this.fileName = sourceFrame.fileName;\r\n _this.line = sourceFrame.line;\r\n _this.sizeInBytes = 0;\r\n }\r\n _this.sizeInBytes += _this.method.length;\r\n _this.sizeInBytes += _this.fileName.length;\r\n _this.sizeInBytes += _this.assembly.length;\r\n // todo: these might need to be removed depending on how the back-end settles on their size calculation\r\n _this.sizeInBytes += _StackFrame.baseSize;\r\n _this.sizeInBytes += _this.level.toString().length;\r\n _this.sizeInBytes += _this.line.toString().length;\r\n return _this;\r\n }\r\n _StackFrame.CreateFromInterface = function (frame) {\r\n return new _StackFrame(frame, null /* level is available in frame interface */);\r\n };\r\n _StackFrame.prototype.toInterface = function () {\r\n return {\r\n level: this.level,\r\n method: this.method,\r\n assembly: this.assembly,\r\n fileName: this.fileName,\r\n line: this.line\r\n };\r\n };\r\n // regex to match stack frames from ie/chrome/ff\r\n // methodName=$2, fileName=$4, lineNo=$5, column=$6\r\n _StackFrame.regex = /^([\\s]+at)?[\\s]{0,50}([^\\@\\()]+?)[\\s]{0,50}(\\@|\\()([^\\(\\n]+):([0-9]+):([0-9]+)(\\)?)$/;\r\n _StackFrame.baseSize = 58; // '{\"method\":\"\",\"level\":,\"assembly\":\"\",\"fileName\":\"\",\"line\":}'.length\r\n return _StackFrame;\r\n}(StackFrame));\r\nexport { _StackFrame };\r\n//# sourceMappingURL=Exception.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC,wGAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
1
+ {"version":3,"file":"Exception.js.map","sources":["Exception.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { __assign } from \"tslib\";\r\nimport { dataSanitizeException, dataSanitizeMeasurements, dataSanitizeMessage, dataSanitizeProperties, dataSanitizeString } from \"./Common/DataSanitizer\";\r\nimport { isNullOrUndefined, arrMap, isString, strTrim, isArray, isError, arrForEach, isObject, isFunction } from \"@microsoft/applicationinsights-core-js\";\r\nimport { strNotSpecified } from \"../Constants\";\r\nvar NoMethod = \"<no_method>\";\r\nvar strError = \"error\";\r\nvar strStack = \"stack\";\r\nvar strStackDetails = \"stackDetails\";\r\nvar strErrorSrc = \"errorSrc\";\r\nvar strMessage = \"message\";\r\nvar strDescription = \"description\";\r\nfunction _stringify(value, convertToString) {\r\n var result = value;\r\n if (result && !isString(result)) {\r\n if (JSON && JSON.stringify) {\r\n result = JSON.stringify(value);\r\n if (convertToString && (!result || result === \"{}\")) {\r\n if (isFunction(value.toString)) {\r\n result = value.toString();\r\n }\r\n else {\r\n result = \"\" + value;\r\n }\r\n }\r\n }\r\n else {\r\n result = \"\" + value + \" - (Missing JSON.stringify)\";\r\n }\r\n }\r\n return result || \"\";\r\n}\r\nfunction _formatMessage(theEvent, errorType) {\r\n var evtMessage = theEvent;\r\n if (theEvent) {\r\n if (evtMessage && !isString(evtMessage)) {\r\n evtMessage = theEvent[strMessage] || theEvent[strDescription] || evtMessage;\r\n }\r\n // Make sure the message is a string\r\n if (evtMessage && !isString(evtMessage)) {\r\n // tslint:disable-next-line: prefer-conditional-expression\r\n evtMessage = _stringify(evtMessage, true);\r\n }\r\n if (theEvent[\"filename\"]) {\r\n // Looks like an event object with filename\r\n evtMessage = evtMessage + \" @\" + (theEvent[\"filename\"] || \"\") + \":\" + (theEvent[\"lineno\"] || \"?\") + \":\" + (theEvent[\"colno\"] || \"?\");\r\n }\r\n }\r\n // Automatically add the error type to the message if it does already appear to be present\r\n if (errorType && errorType !== \"String\" && errorType !== \"Object\" && errorType !== \"Error\" && (evtMessage || \"\").indexOf(errorType) === -1) {\r\n evtMessage = errorType + \": \" + evtMessage;\r\n }\r\n return evtMessage || \"\";\r\n}\r\nfunction _isExceptionDetailsInternal(value) {\r\n try {\r\n if (isObject(value)) {\r\n return \"hasFullStack\" in value && \"typeName\" in value;\r\n }\r\n }\r\n catch (e) {\r\n // This can happen with some native browser objects, but should not happen for the type we are checking for\r\n }\r\n return false;\r\n}\r\nfunction _isExceptionInternal(value) {\r\n try {\r\n if (isObject(value)) {\r\n return (\"ver\" in value && \"exceptions\" in value && \"properties\" in value);\r\n }\r\n }\r\n catch (e) {\r\n // This can happen with some native browser objects, but should not happen for the type we are checking for\r\n }\r\n return false;\r\n}\r\nfunction _isStackDetails(details) {\r\n return details && details.src && isString(details.src) && details.obj && isArray(details.obj);\r\n}\r\nfunction _convertStackObj(errorStack) {\r\n var src = errorStack || \"\";\r\n if (!isString(src)) {\r\n if (isString(src[strStack])) {\r\n src = src[strStack];\r\n }\r\n else {\r\n src = \"\" + src;\r\n }\r\n }\r\n var items = src.split(\"\\n\");\r\n return {\r\n src: src,\r\n obj: items\r\n };\r\n}\r\nfunction _getOperaStack(errorMessage) {\r\n var stack = [];\r\n var lines = errorMessage.split(\"\\n\");\r\n for (var lp = 0; lp < lines.length; lp++) {\r\n var entry = lines[lp];\r\n if (lines[lp + 1]) {\r\n entry += \"@\" + lines[lp + 1];\r\n lp++;\r\n }\r\n stack.push(entry);\r\n }\r\n return {\r\n src: errorMessage,\r\n obj: stack\r\n };\r\n}\r\nfunction _getStackFromErrorObj(errorObj) {\r\n var details = null;\r\n if (errorObj) {\r\n try {\r\n /* Using bracket notation is support older browsers (IE 7/8 -- dont remember the version) that throw when using dot\r\n notation for undefined objects and we don't want to loose the error from being reported */\r\n if (errorObj[strStack]) {\r\n // Chrome/Firefox\r\n details = _convertStackObj(errorObj[strStack]);\r\n }\r\n else if (errorObj[strError] && errorObj[strError][strStack]) {\r\n // Edge error event provides the stack and error object\r\n details = _convertStackObj(errorObj[strError][strStack]);\r\n }\r\n else if (errorObj[\"exception\"] && errorObj.exception[strStack]) {\r\n details = _convertStackObj(errorObj.exception[strStack]);\r\n }\r\n else if (_isStackDetails(errorObj)) {\r\n details = errorObj;\r\n }\r\n else if (_isStackDetails(errorObj[strStackDetails])) {\r\n details = errorObj[strStackDetails];\r\n }\r\n else if (window && window[\"opera\"] && errorObj[strMessage]) {\r\n // Opera\r\n details = _getOperaStack(errorObj.message);\r\n }\r\n else if (isString(errorObj)) {\r\n details = _convertStackObj(errorObj);\r\n }\r\n else {\r\n var evtMessage = errorObj[strMessage] || errorObj[strDescription] || \"\";\r\n if (isString(errorObj[strErrorSrc])) {\r\n if (evtMessage) {\r\n evtMessage += \"\\n\";\r\n }\r\n evtMessage += \" from \" + errorObj[strErrorSrc];\r\n }\r\n if (evtMessage) {\r\n details = _convertStackObj(evtMessage);\r\n }\r\n }\r\n }\r\n catch (e) {\r\n // something unexpected happened so to avoid failing to report any error lets swallow the exception\r\n // and fallback to the callee/caller method\r\n details = _convertStackObj(e);\r\n }\r\n }\r\n return details || {\r\n src: \"\",\r\n obj: null\r\n };\r\n}\r\nfunction _formatStackTrace(stackDetails) {\r\n var stack = \"\";\r\n if (stackDetails) {\r\n if (stackDetails.obj) {\r\n arrForEach(stackDetails.obj, function (entry) {\r\n stack += entry + \"\\n\";\r\n });\r\n }\r\n else {\r\n stack = stackDetails.src || \"\";\r\n }\r\n }\r\n return stack;\r\n}\r\nfunction _parseStack(stack) {\r\n var parsedStack;\r\n var frames = stack.obj;\r\n if (frames && frames.length > 0) {\r\n parsedStack = [];\r\n var level_1 = 0;\r\n var totalSizeInBytes_1 = 0;\r\n arrForEach(frames, function (frame) {\r\n var theFrame = frame.toString();\r\n if (_StackFrame.regex.test(theFrame)) {\r\n var parsedFrame = new _StackFrame(theFrame, level_1++);\r\n totalSizeInBytes_1 += parsedFrame.sizeInBytes;\r\n parsedStack.push(parsedFrame);\r\n }\r\n });\r\n // DP Constraint - exception parsed stack must be < 32KB\r\n // remove frames from the middle to meet the threshold\r\n var exceptionParsedStackThreshold = 32 * 1024;\r\n if (totalSizeInBytes_1 > exceptionParsedStackThreshold) {\r\n var left = 0;\r\n var right = parsedStack.length - 1;\r\n var size = 0;\r\n var acceptedLeft = left;\r\n var acceptedRight = right;\r\n while (left < right) {\r\n // check size\r\n var lSize = parsedStack[left].sizeInBytes;\r\n var rSize = parsedStack[right].sizeInBytes;\r\n size += lSize + rSize;\r\n if (size > exceptionParsedStackThreshold) {\r\n // remove extra frames from the middle\r\n var howMany = acceptedRight - acceptedLeft + 1;\r\n parsedStack.splice(acceptedLeft, howMany);\r\n break;\r\n }\r\n // update pointers\r\n acceptedLeft = left;\r\n acceptedRight = right;\r\n left++;\r\n right--;\r\n }\r\n }\r\n }\r\n return parsedStack;\r\n}\r\nfunction _getErrorType(errorType) {\r\n // Gets the Error Type by passing the constructor (used to get the true type of native error object).\r\n var typeName = \"\";\r\n if (errorType) {\r\n typeName = errorType.typeName || errorType.name || \"\";\r\n if (!typeName) {\r\n try {\r\n var funcNameRegex = /function (.{1,200})\\(/;\r\n var results = (funcNameRegex).exec((errorType).constructor.toString());\r\n typeName = (results && results.length > 1) ? results[1] : \"\";\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty -- Ignoring any failures as nothing we can do\r\n }\r\n }\r\n }\r\n return typeName;\r\n}\r\n/**\r\n * Formats the provided errorObj for display and reporting, it may be a String, Object, integer or undefined depending on the browser.\r\n * @param errorObj The supplied errorObj\r\n */\r\nexport function _formatErrorCode(errorObj) {\r\n if (errorObj) {\r\n try {\r\n if (!isString(errorObj)) {\r\n var errorType = _getErrorType(errorObj);\r\n var result = _stringify(errorObj, false);\r\n if (!result || result === \"{}\") {\r\n if (errorObj[strError]) {\r\n // Looks like an MS Error Event\r\n errorObj = errorObj[strError];\r\n errorType = _getErrorType(errorObj);\r\n }\r\n result = _stringify(errorObj, true);\r\n }\r\n if (result.indexOf(errorType) !== 0 && errorType !== \"String\") {\r\n return errorType + \":\" + result;\r\n }\r\n return result;\r\n }\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty -- Ignoring any failures as nothing we can do\r\n }\r\n }\r\n // Fallback to just letting the object format itself into a string\r\n return \"\" + (errorObj || \"\");\r\n}\r\nvar Exception = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of the ExceptionTelemetry object\r\n */\r\n function Exception(logger, exception, properties, measurements, severityLevel, id) {\r\n this.aiDataContract = {\r\n ver: 1 /* Required */,\r\n exceptions: 1 /* Required */,\r\n severityLevel: 0 /* Default */,\r\n properties: 0 /* Default */,\r\n measurements: 0 /* Default */\r\n };\r\n var _self = this;\r\n _self.ver = 2; // TODO: handle the CS\"4.0\" ==> breeze 2 conversion in a better way\r\n if (!_isExceptionInternal(exception)) {\r\n if (!properties) {\r\n properties = {};\r\n }\r\n _self.exceptions = [new _ExceptionDetails(logger, exception, properties)];\r\n _self.properties = dataSanitizeProperties(logger, properties);\r\n _self.measurements = dataSanitizeMeasurements(logger, measurements);\r\n if (severityLevel) {\r\n _self.severityLevel = severityLevel;\r\n }\r\n if (id) {\r\n _self.id = id;\r\n }\r\n }\r\n else {\r\n _self.exceptions = exception.exceptions || [];\r\n _self.properties = exception.properties;\r\n _self.measurements = exception.measurements;\r\n if (exception.severityLevel) {\r\n _self.severityLevel = exception.severityLevel;\r\n }\r\n if (exception.id) {\r\n _self.id = exception.id;\r\n }\r\n if (exception.problemGroup) {\r\n _self.problemGroup = exception.problemGroup;\r\n }\r\n // bool/int types, use isNullOrUndefined\r\n if (!isNullOrUndefined(exception.isManual)) {\r\n _self.isManual = exception.isManual;\r\n }\r\n }\r\n }\r\n Exception.CreateAutoException = function (message, url, lineNumber, columnNumber, error, evt, stack, errorSrc) {\r\n var errorType = _getErrorType(error || evt || message);\r\n return {\r\n message: _formatMessage(message, errorType),\r\n url: url,\r\n lineNumber: lineNumber,\r\n columnNumber: columnNumber,\r\n error: _formatErrorCode(error || evt || message),\r\n evt: _formatErrorCode(evt || message),\r\n typeName: errorType,\r\n stackDetails: _getStackFromErrorObj(stack || error || evt),\r\n errorSrc: errorSrc\r\n };\r\n };\r\n Exception.CreateFromInterface = function (logger, exception, properties, measurements) {\r\n var exceptions = exception.exceptions\r\n && arrMap(exception.exceptions, function (ex) { return _ExceptionDetails.CreateFromInterface(logger, ex); });\r\n var exceptionData = new Exception(logger, __assign(__assign({}, exception), { exceptions: exceptions }), properties, measurements);\r\n return exceptionData;\r\n };\r\n Exception.prototype.toInterface = function () {\r\n var _a = this, exceptions = _a.exceptions, properties = _a.properties, measurements = _a.measurements, severityLevel = _a.severityLevel, problemGroup = _a.problemGroup, id = _a.id, isManual = _a.isManual;\r\n var exceptionDetailsInterface = exceptions instanceof Array\r\n && arrMap(exceptions, function (exception) { return exception.toInterface(); })\r\n || undefined;\r\n return {\r\n ver: \"4.0\",\r\n exceptions: exceptionDetailsInterface,\r\n severityLevel: severityLevel,\r\n properties: properties,\r\n measurements: measurements,\r\n problemGroup: problemGroup,\r\n id: id,\r\n isManual: isManual\r\n };\r\n };\r\n /**\r\n * Creates a simple exception with 1 stack frame. Useful for manual constracting of exception.\r\n */\r\n Exception.CreateSimpleException = function (message, typeName, assembly, fileName, details, line) {\r\n return {\r\n exceptions: [\r\n {\r\n hasFullStack: true,\r\n message: message,\r\n stack: details,\r\n typeName: typeName\r\n }\r\n ]\r\n };\r\n };\r\n Exception.envelopeType = \"Microsoft.ApplicationInsights.{0}.Exception\";\r\n Exception.dataType = \"ExceptionData\";\r\n Exception.formatError = _formatErrorCode;\r\n return Exception;\r\n}());\r\nexport { Exception };\r\nvar _ExceptionDetails = /** @class */ (function () {\r\n function _ExceptionDetails(logger, exception, properties) {\r\n this.aiDataContract = {\r\n id: 0 /* Default */,\r\n outerId: 0 /* Default */,\r\n typeName: 1 /* Required */,\r\n message: 1 /* Required */,\r\n hasFullStack: 0 /* Default */,\r\n stack: 0 /* Default */,\r\n parsedStack: 2 /* Array */\r\n };\r\n var _self = this;\r\n if (!_isExceptionDetailsInternal(exception)) {\r\n var error = exception;\r\n var evt = error && error.evt;\r\n if (!isError(error)) {\r\n error = error[strError] || evt || error;\r\n }\r\n _self.typeName = dataSanitizeString(logger, _getErrorType(error)) || strNotSpecified;\r\n _self.message = dataSanitizeMessage(logger, _formatMessage(exception || error, _self.typeName)) || strNotSpecified;\r\n var stack = exception[strStackDetails] || _getStackFromErrorObj(exception);\r\n _self.parsedStack = _parseStack(stack);\r\n _self[strStack] = dataSanitizeException(logger, _formatStackTrace(stack));\r\n _self.hasFullStack = isArray(_self.parsedStack) && _self.parsedStack.length > 0;\r\n if (properties) {\r\n properties.typeName = properties.typeName || _self.typeName;\r\n }\r\n }\r\n else {\r\n _self.typeName = exception.typeName;\r\n _self.message = exception.message;\r\n _self[strStack] = exception[strStack];\r\n _self.parsedStack = exception.parsedStack || [];\r\n _self.hasFullStack = exception.hasFullStack;\r\n }\r\n }\r\n _ExceptionDetails.prototype.toInterface = function () {\r\n var _self = this;\r\n var parsedStack = _self.parsedStack instanceof Array\r\n && arrMap(_self.parsedStack, function (frame) { return frame.toInterface(); });\r\n var exceptionDetailsInterface = {\r\n id: _self.id,\r\n outerId: _self.outerId,\r\n typeName: _self.typeName,\r\n message: _self.message,\r\n hasFullStack: _self.hasFullStack,\r\n stack: _self[strStack],\r\n parsedStack: parsedStack || undefined\r\n };\r\n return exceptionDetailsInterface;\r\n };\r\n _ExceptionDetails.CreateFromInterface = function (logger, exception) {\r\n var parsedStack = (exception.parsedStack instanceof Array\r\n && arrMap(exception.parsedStack, function (frame) { return _StackFrame.CreateFromInterface(frame); }))\r\n || exception.parsedStack;\r\n var exceptionDetails = new _ExceptionDetails(logger, __assign(__assign({}, exception), { parsedStack: parsedStack }));\r\n return exceptionDetails;\r\n };\r\n return _ExceptionDetails;\r\n}());\r\nexport { _ExceptionDetails };\r\nvar _StackFrame = /** @class */ (function () {\r\n function _StackFrame(sourceFrame, level) {\r\n this.aiDataContract = {\r\n level: 1 /* Required */,\r\n method: 1 /* Required */,\r\n assembly: 0 /* Default */,\r\n fileName: 0 /* Default */,\r\n line: 0 /* Default */\r\n };\r\n var _self = this;\r\n _self.sizeInBytes = 0;\r\n // Not converting this to isString() as typescript uses this logic to \"understand\" the different\r\n // types for the 2 different code paths\r\n if (typeof sourceFrame === \"string\") {\r\n var frame = sourceFrame;\r\n _self.level = level;\r\n _self.method = NoMethod;\r\n _self.assembly = strTrim(frame);\r\n _self.fileName = \"\";\r\n _self.line = 0;\r\n var matches = frame.match(_StackFrame.regex);\r\n if (matches && matches.length >= 5) {\r\n _self.method = strTrim(matches[2]) || _self.method;\r\n _self.fileName = strTrim(matches[4]);\r\n _self.line = parseInt(matches[5]) || 0;\r\n }\r\n }\r\n else {\r\n _self.level = sourceFrame.level;\r\n _self.method = sourceFrame.method;\r\n _self.assembly = sourceFrame.assembly;\r\n _self.fileName = sourceFrame.fileName;\r\n _self.line = sourceFrame.line;\r\n _self.sizeInBytes = 0;\r\n }\r\n _self.sizeInBytes += _self.method.length;\r\n _self.sizeInBytes += _self.fileName.length;\r\n _self.sizeInBytes += _self.assembly.length;\r\n // todo: these might need to be removed depending on how the back-end settles on their size calculation\r\n _self.sizeInBytes += _StackFrame.baseSize;\r\n _self.sizeInBytes += _self.level.toString().length;\r\n _self.sizeInBytes += _self.line.toString().length;\r\n }\r\n _StackFrame.CreateFromInterface = function (frame) {\r\n return new _StackFrame(frame, null /* level is available in frame interface */);\r\n };\r\n _StackFrame.prototype.toInterface = function () {\r\n var _self = this;\r\n return {\r\n level: _self.level,\r\n method: _self.method,\r\n assembly: _self.assembly,\r\n fileName: _self.fileName,\r\n line: _self.line\r\n };\r\n };\r\n // regex to match stack frames from ie/chrome/ff\r\n // methodName=$2, fileName=$4, lineNo=$5, column=$6\r\n _StackFrame.regex = /^([\\s]+at)?[\\s]{0,50}([^\\@\\()]+?)[\\s]{0,50}(\\@|\\()([^\\(\\n]+):([0-9]+):([0-9]+)(\\)?)$/;\r\n _StackFrame.baseSize = 58; // '{\"method\":\"\",\"level\":,\"assembly\":\"\",\"fileName\":\"\",\"line\":}'.length\r\n return _StackFrame;\r\n}());\r\nexport { _StackFrame };\r\n//# sourceMappingURL=Exception.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC,8EAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
@@ -1,26 +1,24 @@
1
1
  /*
2
- * Application Insights JavaScript SDK - Common, 2.8.0-nightly.2202-06
2
+ * Application Insights JavaScript SDK - Common, 2.8.0-nightly.2204-04
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
 
6
6
 
7
- import { __extendsFn as __extends } from "@microsoft/applicationinsights-shims";
8
- import { MetricData } from "../Interfaces/Contracts/Generated/MetricData";
9
7
  import { dataSanitizeMeasurements, dataSanitizeProperties, dataSanitizeString } from "./Common/DataSanitizer";
10
8
  import { DataPoint } from "./Common/DataPoint";
11
9
  import { strNotSpecified } from "../Constants";
12
- var Metric = /** @class */ (function (_super) {
13
- __extends(Metric, _super);
10
+ var Metric = /** @class */ (function () {
14
11
  /**
15
12
  * Constructs a new instance of the MetricTelemetry object
16
13
  */
17
14
  function Metric(logger, name, value, count, min, max, stdDev, properties, measurements) {
18
- var _this = _super.call(this) || this;
19
- _this.aiDataContract = {
15
+ this.aiDataContract = {
20
16
  ver: 1 /* Required */,
21
17
  metrics: 1 /* Required */,
22
18
  properties: 0 /* Default */
23
19
  };
20
+ var _self = this;
21
+ _self.ver = 2;
24
22
  var dataPoint = new DataPoint();
25
23
  dataPoint.count = count > 0 ? count : undefined;
26
24
  dataPoint.max = isNaN(max) || max === null ? undefined : max;
@@ -28,14 +26,13 @@ var Metric = /** @class */ (function (_super) {
28
26
  dataPoint.name = dataSanitizeString(logger, name) || strNotSpecified;
29
27
  dataPoint.value = value;
30
28
  dataPoint.stdDev = isNaN(stdDev) || stdDev === null ? undefined : stdDev;
31
- _this.metrics = [dataPoint];
32
- _this.properties = dataSanitizeProperties(logger, properties);
33
- _this.measurements = dataSanitizeMeasurements(logger, measurements);
34
- return _this;
29
+ _self.metrics = [dataPoint];
30
+ _self.properties = dataSanitizeProperties(logger, properties);
31
+ _self.measurements = dataSanitizeMeasurements(logger, measurements);
35
32
  }
36
33
  Metric.envelopeType = "Microsoft.ApplicationInsights.{0}.Metric";
37
34
  Metric.dataType = "MetricData";
38
35
  return Metric;
39
- }(MetricData));
36
+ }());
40
37
  export { Metric };
41
38
  //# sourceMappingURL=Metric.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Metric.js.map","sources":["Metric.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { __extends } from \"tslib\";\r\nimport { MetricData } from \"../Interfaces/Contracts/Generated/MetricData\";\r\nimport { dataSanitizeMeasurements, dataSanitizeProperties, dataSanitizeString } from \"./Common/DataSanitizer\";\r\nimport { DataPoint } from \"./Common/DataPoint\";\r\nimport { strNotSpecified } from \"../Constants\";\r\nvar Metric = /** @class */ (function (_super) {\r\n __extends(Metric, _super);\r\n /**\r\n * Constructs a new instance of the MetricTelemetry object\r\n */\r\n function Metric(logger, name, value, count, min, max, stdDev, properties, measurements) {\r\n var _this = _super.call(this) || this;\r\n _this.aiDataContract = {\r\n ver: 1 /* Required */,\r\n metrics: 1 /* Required */,\r\n properties: 0 /* Default */\r\n };\r\n var dataPoint = new DataPoint();\r\n dataPoint.count = count > 0 ? count : undefined;\r\n dataPoint.max = isNaN(max) || max === null ? undefined : max;\r\n dataPoint.min = isNaN(min) || min === null ? undefined : min;\r\n dataPoint.name = dataSanitizeString(logger, name) || strNotSpecified;\r\n dataPoint.value = value;\r\n dataPoint.stdDev = isNaN(stdDev) || stdDev === null ? undefined : stdDev;\r\n _this.metrics = [dataPoint];\r\n _this.properties = dataSanitizeProperties(logger, properties);\r\n _this.measurements = dataSanitizeMeasurements(logger, measurements);\r\n return _this;\r\n }\r\n Metric.envelopeType = \"Microsoft.ApplicationInsights.{0}.Metric\";\r\n Metric.dataType = \"MetricData\";\r\n return Metric;\r\n}(MetricData));\r\nexport { Metric };\r\n//# sourceMappingURL=Metric.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC,gFAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
1
+ {"version":3,"file":"Metric.js.map","sources":["Metric.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { dataSanitizeMeasurements, dataSanitizeProperties, dataSanitizeString } from \"./Common/DataSanitizer\";\r\nimport { DataPoint } from \"./Common/DataPoint\";\r\nimport { strNotSpecified } from \"../Constants\";\r\nvar Metric = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of the MetricTelemetry object\r\n */\r\n function Metric(logger, name, value, count, min, max, stdDev, properties, measurements) {\r\n this.aiDataContract = {\r\n ver: 1 /* Required */,\r\n metrics: 1 /* Required */,\r\n properties: 0 /* Default */\r\n };\r\n var _self = this;\r\n _self.ver = 2;\r\n var dataPoint = new DataPoint();\r\n dataPoint.count = count > 0 ? count : undefined;\r\n dataPoint.max = isNaN(max) || max === null ? undefined : max;\r\n dataPoint.min = isNaN(min) || min === null ? undefined : min;\r\n dataPoint.name = dataSanitizeString(logger, name) || strNotSpecified;\r\n dataPoint.value = value;\r\n dataPoint.stdDev = isNaN(stdDev) || stdDev === null ? undefined : stdDev;\r\n _self.metrics = [dataPoint];\r\n _self.properties = dataSanitizeProperties(logger, properties);\r\n _self.measurements = dataSanitizeMeasurements(logger, measurements);\r\n }\r\n Metric.envelopeType = \"Microsoft.ApplicationInsights.{0}.Metric\";\r\n Metric.dataType = \"MetricData\";\r\n return Metric;\r\n}());\r\nexport { Metric };\r\n//# sourceMappingURL=Metric.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
@@ -1,22 +1,18 @@
1
1
  /*
2
- * Application Insights JavaScript SDK - Common, 2.8.0-nightly.2202-06
2
+ * Application Insights JavaScript SDK - Common, 2.8.0-nightly.2204-04
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
 
6
6
 
7
- import { __extendsFn as __extends } from "@microsoft/applicationinsights-shims";
8
- import { PageViewData } from "../Interfaces/Contracts/Generated/PageViewData";
9
7
  import { dataSanitizeId, dataSanitizeMeasurements, dataSanitizeProperties, dataSanitizeString, dataSanitizeUrl } from "./Common/DataSanitizer";
10
8
  import { msToTimeSpan } from "../HelperFuncs";
11
9
  import { strNotSpecified } from "../Constants";
12
- var PageView = /** @class */ (function (_super) {
13
- __extends(PageView, _super);
10
+ var PageView = /** @class */ (function () {
14
11
  /**
15
12
  * Constructs a new instance of the PageEventTelemetry object
16
13
  */
17
14
  function PageView(logger, name, url, durationMs, properties, measurements, id) {
18
- var _this = _super.call(this) || this;
19
- _this.aiDataContract = {
15
+ this.aiDataContract = {
20
16
  ver: 1 /* Required */,
21
17
  name: 0 /* Default */,
22
18
  url: 0 /* Default */,
@@ -25,19 +21,20 @@ var PageView = /** @class */ (function (_super) {
25
21
  measurements: 0 /* Default */,
26
22
  id: 0 /* Default */
27
23
  };
28
- _this.id = dataSanitizeId(logger, id);
29
- _this.url = dataSanitizeUrl(logger, url);
30
- _this.name = dataSanitizeString(logger, name) || strNotSpecified;
24
+ var _self = this;
25
+ _self.ver = 2;
26
+ _self.id = dataSanitizeId(logger, id);
27
+ _self.url = dataSanitizeUrl(logger, url);
28
+ _self.name = dataSanitizeString(logger, name) || strNotSpecified;
31
29
  if (!isNaN(durationMs)) {
32
- _this.duration = msToTimeSpan(durationMs);
30
+ _self.duration = msToTimeSpan(durationMs);
33
31
  }
34
- _this.properties = dataSanitizeProperties(logger, properties);
35
- _this.measurements = dataSanitizeMeasurements(logger, measurements);
36
- return _this;
32
+ _self.properties = dataSanitizeProperties(logger, properties);
33
+ _self.measurements = dataSanitizeMeasurements(logger, measurements);
37
34
  }
38
35
  PageView.envelopeType = "Microsoft.ApplicationInsights.{0}.Pageview";
39
36
  PageView.dataType = "PageviewData";
40
37
  return PageView;
41
- }(PageViewData));
38
+ }());
42
39
  export { PageView };
43
40
  //# sourceMappingURL=PageView.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PageView.js.map","sources":["PageView.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { __extends } from \"tslib\";\r\nimport { PageViewData } from \"../Interfaces/Contracts/Generated/PageViewData\";\r\nimport { dataSanitizeId, dataSanitizeMeasurements, dataSanitizeProperties, dataSanitizeString, dataSanitizeUrl } from \"./Common/DataSanitizer\";\r\nimport { msToTimeSpan } from \"../HelperFuncs\";\r\nimport { strNotSpecified } from \"../Constants\";\r\nvar PageView = /** @class */ (function (_super) {\r\n __extends(PageView, _super);\r\n /**\r\n * Constructs a new instance of the PageEventTelemetry object\r\n */\r\n function PageView(logger, name, url, durationMs, properties, measurements, id) {\r\n var _this = _super.call(this) || this;\r\n _this.aiDataContract = {\r\n ver: 1 /* Required */,\r\n name: 0 /* Default */,\r\n url: 0 /* Default */,\r\n duration: 0 /* Default */,\r\n properties: 0 /* Default */,\r\n measurements: 0 /* Default */,\r\n id: 0 /* Default */\r\n };\r\n _this.id = dataSanitizeId(logger, id);\r\n _this.url = dataSanitizeUrl(logger, url);\r\n _this.name = dataSanitizeString(logger, name) || strNotSpecified;\r\n if (!isNaN(durationMs)) {\r\n _this.duration = msToTimeSpan(durationMs);\r\n }\r\n _this.properties = dataSanitizeProperties(logger, properties);\r\n _this.measurements = dataSanitizeMeasurements(logger, measurements);\r\n return _this;\r\n }\r\n PageView.envelopeType = \"Microsoft.ApplicationInsights.{0}.Pageview\";\r\n PageView.dataType = \"PageviewData\";\r\n return PageView;\r\n}(PageViewData));\r\nexport { PageView };\r\n//# sourceMappingURL=PageView.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC,gFAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
1
+ {"version":3,"file":"PageView.js.map","sources":["PageView.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { dataSanitizeId, dataSanitizeMeasurements, dataSanitizeProperties, dataSanitizeString, dataSanitizeUrl } from \"./Common/DataSanitizer\";\r\nimport { msToTimeSpan } from \"../HelperFuncs\";\r\nimport { strNotSpecified } from \"../Constants\";\r\nvar PageView = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of the PageEventTelemetry object\r\n */\r\n function PageView(logger, name, url, durationMs, properties, measurements, id) {\r\n this.aiDataContract = {\r\n ver: 1 /* Required */,\r\n name: 0 /* Default */,\r\n url: 0 /* Default */,\r\n duration: 0 /* Default */,\r\n properties: 0 /* Default */,\r\n measurements: 0 /* Default */,\r\n id: 0 /* Default */\r\n };\r\n var _self = this;\r\n _self.ver = 2;\r\n _self.id = dataSanitizeId(logger, id);\r\n _self.url = dataSanitizeUrl(logger, url);\r\n _self.name = dataSanitizeString(logger, name) || strNotSpecified;\r\n if (!isNaN(durationMs)) {\r\n _self.duration = msToTimeSpan(durationMs);\r\n }\r\n _self.properties = dataSanitizeProperties(logger, properties);\r\n _self.measurements = dataSanitizeMeasurements(logger, measurements);\r\n }\r\n PageView.envelopeType = \"Microsoft.ApplicationInsights.{0}.Pageview\";\r\n PageView.dataType = \"PageviewData\";\r\n return PageView;\r\n}());\r\nexport { PageView };\r\n//# sourceMappingURL=PageView.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}