@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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RequestData.js.map","sources":["RequestData.js"],"sourcesContent":["\"use strict\";\r\n// // Copyright (c) Microsoft Corporation. All rights reserved.\r\n// // Licensed under the MIT License.\r\n// import { IDomain } from \"./IDomain\";\r\n// /**\r\n// * An instance of Request represents completion of an external request to the application to do work and contains a summary of that request execution and the results.\r\n// */\r\n// export class RequestData implements IDomain {\r\n// /**\r\n// * Schema version\r\n// */\r\n// public ver: number = 2;\r\n// /**\r\n// * Identifier of a request call instance. Used for correlation between request and other telemetry items.\r\n// */\r\n// public id: string;\r\n// /**\r\n// * Source of the request. Examples are the instrumentation key of the caller or the ip address of the caller.\r\n// */\r\n// public source: string;\r\n// /**\r\n// * Name of the request. Represents code path taken to process request. Low cardinality value to allow better grouping of requests. For HTTP requests it represents the HTTP method and URL path template like 'GET /values/{id}'.\r\n// */\r\n// public name: string;\r\n// /**\r\n// * Indication of successful or unsuccessful call.\r\n// */\r\n// public success: boolean;\r\n// /**\r\n// * Request URL with all query string parameters.\r\n// */\r\n// public url: string;\r\n// /**\r\n// * Collection of custom properties.\r\n// */\r\n// public properties: any = {};\r\n// /**\r\n// * Collection of custom measurements.\r\n// */\r\n// public measurements: any = {};\r\n// }\r\n//# sourceMappingURL=RequestData.js.map"],"names":[],"mappings":";;;;AAAA;AACA,GAA+D;AAC/D,GAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,5 +1,5 @@
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
 
@@ -1,5 +1,5 @@
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
 
@@ -1,5 +1,5 @@
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
 
@@ -1,5 +1,5 @@
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
 
@@ -1,5 +1,5 @@
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
 
@@ -1,5 +1,5 @@
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
 
@@ -1,5 +1,5 @@
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
  export {};
@@ -1,5 +1,5 @@
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
 
@@ -1,5 +1,5 @@
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
  export {};
@@ -1,5 +1,5 @@
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
  export {};
@@ -1,5 +1,5 @@
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
  export {};
@@ -1,5 +1,5 @@
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
 
@@ -1,5 +1,5 @@
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
 
@@ -1,5 +1,5 @@
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
  export {};
@@ -1,5 +1,5 @@
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
 
@@ -1,5 +1,5 @@
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
 
@@ -1,8 +1,8 @@
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
- import { ContextTagKeys } from "./Contracts/Generated/ContextTagKeys";
5
+ import { ContextTagKeys } from "./Contracts/ContextTagKeys";
6
6
  export var Extensions = {
7
7
  UserExt: "user",
8
8
  DeviceExt: "device",
@@ -1 +1 @@
1
- {"version":3,"file":"PartAExtensions.js.map","sources":["PartAExtensions.js"],"sourcesContent":["import { ContextTagKeys } from \"./Contracts/Generated/ContextTagKeys\";\r\nexport var Extensions = {\r\n UserExt: \"user\",\r\n DeviceExt: \"device\",\r\n TraceExt: \"trace\",\r\n WebExt: \"web\",\r\n AppExt: \"app\",\r\n OSExt: \"os\",\r\n SessionExt: \"ses\",\r\n SDKExt: \"sdk\"\r\n};\r\nexport var CtxTagKeys = new ContextTagKeys();\r\n//# sourceMappingURL=PartAExtensions.js.map"],"names":[],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
1
+ {"version":3,"file":"PartAExtensions.js.map","sources":["PartAExtensions.js"],"sourcesContent":["import { ContextTagKeys } from \"./Contracts/ContextTagKeys\";\r\nexport var Extensions = {\r\n UserExt: \"user\",\r\n DeviceExt: \"device\",\r\n TraceExt: \"trace\",\r\n WebExt: \"web\",\r\n AppExt: \"app\",\r\n OSExt: \"os\",\r\n SessionExt: \"ses\",\r\n SDKExt: \"sdk\"\r\n};\r\nexport var CtxTagKeys = new ContextTagKeys();\r\n//# sourceMappingURL=PartAExtensions.js.map"],"names":[],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
@@ -1,5 +1,5 @@
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
 
@@ -1,5 +1,5 @@
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
 
@@ -1,5 +1,5 @@
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
 
@@ -1,10 +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 { dumpObj, getExceptionName, getGlobal, getGlobalInst, isNullOrUndefined, LoggingSeverity, objForEachKey, _InternalMessageId } from "@microsoft/applicationinsights-core-js";
7
+ import { dumpObj, getExceptionName, getGlobal, getGlobalInst, isNullOrUndefined, objForEachKey, _InternalMessageId, _throwInternal } from "@microsoft/applicationinsights-core-js";
8
8
  import { StorageType } from "./Enums";
9
9
  var _canUseLocalStorage = undefined;
10
10
  var _canUseSessionStorage = undefined;
@@ -53,12 +53,27 @@ function _getSessionStorageObject() {
53
53
  }
54
54
  return null;
55
55
  }
56
+ /**
57
+ * Disables the global SDK usage of local or session storage if available
58
+ */
56
59
  export function utlDisableStorage() {
57
60
  _canUseLocalStorage = false;
58
61
  _canUseSessionStorage = false;
59
62
  }
60
- export function utlCanUseLocalStorage() {
61
- if (_canUseLocalStorage === undefined) {
63
+ /**
64
+ * Re-enables the global SDK usage of local or session storage if available
65
+ */
66
+ export function utlEnableStorage() {
67
+ _canUseLocalStorage = utlCanUseLocalStorage(true);
68
+ _canUseSessionStorage = utlCanUseSessionStorage(true);
69
+ }
70
+ /**
71
+ * Returns whether LocalStorage can be used, if the reset parameter is passed a true this will override
72
+ * any previous disable calls.
73
+ * @param reset - Should the usage be reset and determined only based on whether LocalStorage is available
74
+ */
75
+ export function utlCanUseLocalStorage(reset) {
76
+ if (reset || _canUseLocalStorage === undefined) {
62
77
  _canUseLocalStorage = !!_getVerifiedStorageObject(StorageType.LocalStorage);
63
78
  }
64
79
  return _canUseLocalStorage;
@@ -71,7 +86,7 @@ export function utlGetLocalStorage(logger, name) {
71
86
  }
72
87
  catch (e) {
73
88
  _canUseLocalStorage = false;
74
- logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserCannotReadLocalStorage, "Browser failed read of local storage. " + getExceptionName(e), { exception: dumpObj(e) });
89
+ _throwInternal(logger, 2 /* WARNING */, _InternalMessageId.BrowserCannotReadLocalStorage, "Browser failed read of local storage. " + getExceptionName(e), { exception: dumpObj(e) });
75
90
  }
76
91
  }
77
92
  return null;
@@ -85,7 +100,7 @@ export function utlSetLocalStorage(logger, name, data) {
85
100
  }
86
101
  catch (e) {
87
102
  _canUseLocalStorage = false;
88
- logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserCannotWriteLocalStorage, "Browser failed write to local storage. " + getExceptionName(e), { exception: dumpObj(e) });
103
+ _throwInternal(logger, 2 /* WARNING */, _InternalMessageId.BrowserCannotWriteLocalStorage, "Browser failed write to local storage. " + getExceptionName(e), { exception: dumpObj(e) });
89
104
  }
90
105
  }
91
106
  return false;
@@ -99,13 +114,13 @@ export function utlRemoveStorage(logger, name) {
99
114
  }
100
115
  catch (e) {
101
116
  _canUseLocalStorage = false;
102
- logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserFailedRemovalFromLocalStorage, "Browser failed removal of local storage item. " + getExceptionName(e), { exception: dumpObj(e) });
117
+ _throwInternal(logger, 2 /* WARNING */, _InternalMessageId.BrowserFailedRemovalFromLocalStorage, "Browser failed removal of local storage item. " + getExceptionName(e), { exception: dumpObj(e) });
103
118
  }
104
119
  }
105
120
  return false;
106
121
  }
107
- export function utlCanUseSessionStorage() {
108
- if (_canUseSessionStorage === undefined) {
122
+ export function utlCanUseSessionStorage(reset) {
123
+ if (reset || _canUseSessionStorage === undefined) {
109
124
  _canUseSessionStorage = !!_getVerifiedStorageObject(StorageType.SessionStorage);
110
125
  }
111
126
  return _canUseSessionStorage;
@@ -127,7 +142,7 @@ export function utlGetSessionStorage(logger, name) {
127
142
  }
128
143
  catch (e) {
129
144
  _canUseSessionStorage = false;
130
- logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserCannotReadSessionStorage, "Browser failed read of session storage. " + getExceptionName(e), { exception: dumpObj(e) });
145
+ _throwInternal(logger, 2 /* WARNING */, _InternalMessageId.BrowserCannotReadSessionStorage, "Browser failed read of session storage. " + getExceptionName(e), { exception: dumpObj(e) });
131
146
  }
132
147
  }
133
148
  return null;
@@ -141,7 +156,7 @@ export function utlSetSessionStorage(logger, name, data) {
141
156
  }
142
157
  catch (e) {
143
158
  _canUseSessionStorage = false;
144
- logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserCannotWriteSessionStorage, "Browser failed write to session storage. " + getExceptionName(e), { exception: dumpObj(e) });
159
+ _throwInternal(logger, 2 /* WARNING */, _InternalMessageId.BrowserCannotWriteSessionStorage, "Browser failed write to session storage. " + getExceptionName(e), { exception: dumpObj(e) });
145
160
  }
146
161
  }
147
162
  return false;
@@ -155,7 +170,7 @@ export function utlRemoveSessionStorage(logger, name) {
155
170
  }
156
171
  catch (e) {
157
172
  _canUseSessionStorage = false;
158
- logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserFailedRemovalFromSessionStorage, "Browser failed removal of session storage item. " + getExceptionName(e), { exception: dumpObj(e) });
173
+ _throwInternal(logger, 2 /* WARNING */, _InternalMessageId.BrowserFailedRemovalFromSessionStorage, "Browser failed removal of session storage item. " + getExceptionName(e), { exception: dumpObj(e) });
159
174
  }
160
175
  }
161
176
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"StorageHelperFuncs.js.map","sources":["StorageHelperFuncs.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { dumpObj, getExceptionName, getGlobal, getGlobalInst, isNullOrUndefined, LoggingSeverity, objForEachKey, _InternalMessageId } from \"@microsoft/applicationinsights-core-js\";\r\nimport { StorageType } from \"./Enums\";\r\nvar _canUseLocalStorage = undefined;\r\nvar _canUseSessionStorage = undefined;\r\n/**\r\n * Gets the localStorage object if available\r\n * @return {Storage} - Returns the storage object if available else returns null\r\n */\r\nfunction _getLocalStorageObject() {\r\n if (utlCanUseLocalStorage()) {\r\n return _getVerifiedStorageObject(StorageType.LocalStorage);\r\n }\r\n return null;\r\n}\r\n/**\r\n * Tests storage object (localStorage or sessionStorage) to verify that it is usable\r\n * More details here: https://mathiasbynens.be/notes/localstorage-pattern\r\n * @param storageType Type of storage\r\n * @return {Storage} Returns storage object verified that it is usable\r\n */\r\nfunction _getVerifiedStorageObject(storageType) {\r\n try {\r\n if (isNullOrUndefined(getGlobal())) {\r\n return null;\r\n }\r\n var uid = new Date;\r\n var storage = getGlobalInst(storageType === StorageType.LocalStorage ? \"localStorage\" : \"sessionStorage\");\r\n storage.setItem(uid.toString(), uid.toString());\r\n var fail = storage.getItem(uid.toString()) !== uid.toString();\r\n storage.removeItem(uid.toString());\r\n if (!fail) {\r\n return storage;\r\n }\r\n }\r\n catch (exception) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return null;\r\n}\r\n/**\r\n * Gets the sessionStorage object if available\r\n * @return {Storage} - Returns the storage object if available else returns null\r\n */\r\nfunction _getSessionStorageObject() {\r\n if (utlCanUseSessionStorage()) {\r\n return _getVerifiedStorageObject(StorageType.SessionStorage);\r\n }\r\n return null;\r\n}\r\nexport function utlDisableStorage() {\r\n _canUseLocalStorage = false;\r\n _canUseSessionStorage = false;\r\n}\r\nexport function utlCanUseLocalStorage() {\r\n if (_canUseLocalStorage === undefined) {\r\n _canUseLocalStorage = !!_getVerifiedStorageObject(StorageType.LocalStorage);\r\n }\r\n return _canUseLocalStorage;\r\n}\r\nexport function utlGetLocalStorage(logger, name) {\r\n var storage = _getLocalStorageObject();\r\n if (storage !== null) {\r\n try {\r\n return storage.getItem(name);\r\n }\r\n catch (e) {\r\n _canUseLocalStorage = false;\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserCannotReadLocalStorage, \"Browser failed read of local storage. \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n return null;\r\n}\r\nexport function utlSetLocalStorage(logger, name, data) {\r\n var storage = _getLocalStorageObject();\r\n if (storage !== null) {\r\n try {\r\n storage.setItem(name, data);\r\n return true;\r\n }\r\n catch (e) {\r\n _canUseLocalStorage = false;\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserCannotWriteLocalStorage, \"Browser failed write to local storage. \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n return false;\r\n}\r\nexport function utlRemoveStorage(logger, name) {\r\n var storage = _getLocalStorageObject();\r\n if (storage !== null) {\r\n try {\r\n storage.removeItem(name);\r\n return true;\r\n }\r\n catch (e) {\r\n _canUseLocalStorage = false;\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserFailedRemovalFromLocalStorage, \"Browser failed removal of local storage item. \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n return false;\r\n}\r\nexport function utlCanUseSessionStorage() {\r\n if (_canUseSessionStorage === undefined) {\r\n _canUseSessionStorage = !!_getVerifiedStorageObject(StorageType.SessionStorage);\r\n }\r\n return _canUseSessionStorage;\r\n}\r\nexport function utlGetSessionStorageKeys() {\r\n var keys = [];\r\n if (utlCanUseSessionStorage()) {\r\n objForEachKey(getGlobalInst(\"sessionStorage\"), function (key) {\r\n keys.push(key);\r\n });\r\n }\r\n return keys;\r\n}\r\nexport function utlGetSessionStorage(logger, name) {\r\n var storage = _getSessionStorageObject();\r\n if (storage !== null) {\r\n try {\r\n return storage.getItem(name);\r\n }\r\n catch (e) {\r\n _canUseSessionStorage = false;\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserCannotReadSessionStorage, \"Browser failed read of session storage. \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n return null;\r\n}\r\nexport function utlSetSessionStorage(logger, name, data) {\r\n var storage = _getSessionStorageObject();\r\n if (storage !== null) {\r\n try {\r\n storage.setItem(name, data);\r\n return true;\r\n }\r\n catch (e) {\r\n _canUseSessionStorage = false;\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserCannotWriteSessionStorage, \"Browser failed write to session storage. \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n return false;\r\n}\r\nexport function utlRemoveSessionStorage(logger, name) {\r\n var storage = _getSessionStorageObject();\r\n if (storage !== null) {\r\n try {\r\n storage.removeItem(name);\r\n return true;\r\n }\r\n catch (e) {\r\n _canUseSessionStorage = false;\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserFailedRemovalFromSessionStorage, \"Browser failed removal of session storage item. \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n return false;\r\n}\r\n//# sourceMappingURL=StorageHelperFuncs.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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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":"StorageHelperFuncs.js.map","sources":["StorageHelperFuncs.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { dumpObj, getExceptionName, getGlobal, getGlobalInst, isNullOrUndefined, objForEachKey, _InternalMessageId, _throwInternal } from \"@microsoft/applicationinsights-core-js\";\r\nimport { StorageType } from \"./Enums\";\r\nvar _canUseLocalStorage = undefined;\r\nvar _canUseSessionStorage = undefined;\r\n/**\r\n * Gets the localStorage object if available\r\n * @return {Storage} - Returns the storage object if available else returns null\r\n */\r\nfunction _getLocalStorageObject() {\r\n if (utlCanUseLocalStorage()) {\r\n return _getVerifiedStorageObject(StorageType.LocalStorage);\r\n }\r\n return null;\r\n}\r\n/**\r\n * Tests storage object (localStorage or sessionStorage) to verify that it is usable\r\n * More details here: https://mathiasbynens.be/notes/localstorage-pattern\r\n * @param storageType Type of storage\r\n * @return {Storage} Returns storage object verified that it is usable\r\n */\r\nfunction _getVerifiedStorageObject(storageType) {\r\n try {\r\n if (isNullOrUndefined(getGlobal())) {\r\n return null;\r\n }\r\n var uid = new Date;\r\n var storage = getGlobalInst(storageType === StorageType.LocalStorage ? \"localStorage\" : \"sessionStorage\");\r\n storage.setItem(uid.toString(), uid.toString());\r\n var fail = storage.getItem(uid.toString()) !== uid.toString();\r\n storage.removeItem(uid.toString());\r\n if (!fail) {\r\n return storage;\r\n }\r\n }\r\n catch (exception) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return null;\r\n}\r\n/**\r\n * Gets the sessionStorage object if available\r\n * @return {Storage} - Returns the storage object if available else returns null\r\n */\r\nfunction _getSessionStorageObject() {\r\n if (utlCanUseSessionStorage()) {\r\n return _getVerifiedStorageObject(StorageType.SessionStorage);\r\n }\r\n return null;\r\n}\r\n/**\r\n * Disables the global SDK usage of local or session storage if available\r\n */\r\nexport function utlDisableStorage() {\r\n _canUseLocalStorage = false;\r\n _canUseSessionStorage = false;\r\n}\r\n/**\r\n * Re-enables the global SDK usage of local or session storage if available\r\n */\r\nexport function utlEnableStorage() {\r\n _canUseLocalStorage = utlCanUseLocalStorage(true);\r\n _canUseSessionStorage = utlCanUseSessionStorage(true);\r\n}\r\n/**\r\n * Returns whether LocalStorage can be used, if the reset parameter is passed a true this will override\r\n * any previous disable calls.\r\n * @param reset - Should the usage be reset and determined only based on whether LocalStorage is available\r\n */\r\nexport function utlCanUseLocalStorage(reset) {\r\n if (reset || _canUseLocalStorage === undefined) {\r\n _canUseLocalStorage = !!_getVerifiedStorageObject(StorageType.LocalStorage);\r\n }\r\n return _canUseLocalStorage;\r\n}\r\nexport function utlGetLocalStorage(logger, name) {\r\n var storage = _getLocalStorageObject();\r\n if (storage !== null) {\r\n try {\r\n return storage.getItem(name);\r\n }\r\n catch (e) {\r\n _canUseLocalStorage = false;\r\n _throwInternal(logger, 2 /* WARNING */, _InternalMessageId.BrowserCannotReadLocalStorage, \"Browser failed read of local storage. \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n return null;\r\n}\r\nexport function utlSetLocalStorage(logger, name, data) {\r\n var storage = _getLocalStorageObject();\r\n if (storage !== null) {\r\n try {\r\n storage.setItem(name, data);\r\n return true;\r\n }\r\n catch (e) {\r\n _canUseLocalStorage = false;\r\n _throwInternal(logger, 2 /* WARNING */, _InternalMessageId.BrowserCannotWriteLocalStorage, \"Browser failed write to local storage. \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n return false;\r\n}\r\nexport function utlRemoveStorage(logger, name) {\r\n var storage = _getLocalStorageObject();\r\n if (storage !== null) {\r\n try {\r\n storage.removeItem(name);\r\n return true;\r\n }\r\n catch (e) {\r\n _canUseLocalStorage = false;\r\n _throwInternal(logger, 2 /* WARNING */, _InternalMessageId.BrowserFailedRemovalFromLocalStorage, \"Browser failed removal of local storage item. \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n return false;\r\n}\r\nexport function utlCanUseSessionStorage(reset) {\r\n if (reset || _canUseSessionStorage === undefined) {\r\n _canUseSessionStorage = !!_getVerifiedStorageObject(StorageType.SessionStorage);\r\n }\r\n return _canUseSessionStorage;\r\n}\r\nexport function utlGetSessionStorageKeys() {\r\n var keys = [];\r\n if (utlCanUseSessionStorage()) {\r\n objForEachKey(getGlobalInst(\"sessionStorage\"), function (key) {\r\n keys.push(key);\r\n });\r\n }\r\n return keys;\r\n}\r\nexport function utlGetSessionStorage(logger, name) {\r\n var storage = _getSessionStorageObject();\r\n if (storage !== null) {\r\n try {\r\n return storage.getItem(name);\r\n }\r\n catch (e) {\r\n _canUseSessionStorage = false;\r\n _throwInternal(logger, 2 /* WARNING */, _InternalMessageId.BrowserCannotReadSessionStorage, \"Browser failed read of session storage. \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n return null;\r\n}\r\nexport function utlSetSessionStorage(logger, name, data) {\r\n var storage = _getSessionStorageObject();\r\n if (storage !== null) {\r\n try {\r\n storage.setItem(name, data);\r\n return true;\r\n }\r\n catch (e) {\r\n _canUseSessionStorage = false;\r\n _throwInternal(logger, 2 /* WARNING */, _InternalMessageId.BrowserCannotWriteSessionStorage, \"Browser failed write to session storage. \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n return false;\r\n}\r\nexport function utlRemoveSessionStorage(logger, name) {\r\n var storage = _getSessionStorageObject();\r\n if (storage !== null) {\r\n try {\r\n storage.removeItem(name);\r\n return true;\r\n }\r\n catch (e) {\r\n _canUseSessionStorage = false;\r\n _throwInternal(logger, 2 /* WARNING */, _InternalMessageId.BrowserFailedRemovalFromSessionStorage, \"Browser failed removal of session storage item. \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n return false;\r\n}\r\n//# sourceMappingURL=StorageHelperFuncs.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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,30 +1,25 @@
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 { Data as AIData } from "../../Interfaces/Contracts/Generated/Data";
9
- var Data = /** @class */ (function (_super) {
10
- __extends(Data, _super);
7
+ var Data = /** @class */ (function () {
11
8
  /**
12
9
  * Constructs a new instance of telemetry data.
13
10
  */
14
11
  function Data(baseType, data) {
15
- var _this = _super.call(this) || this;
16
12
  /**
17
13
  * The data contract for serializing this object.
18
14
  */
19
- _this.aiDataContract = {
15
+ this.aiDataContract = {
20
16
  baseType: 1 /* Required */,
21
17
  baseData: 1 /* Required */
22
18
  };
23
- _this.baseType = baseType;
24
- _this.baseData = data;
25
- return _this;
19
+ this.baseType = baseType;
20
+ this.baseData = data;
26
21
  }
27
22
  return Data;
28
- }(AIData));
23
+ }());
29
24
  export { Data };
30
25
  //# sourceMappingURL=Data.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Data.js.map","sources":["Data.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { __extends } from \"tslib\";\r\nimport { Data as AIData } from \"../../Interfaces/Contracts/Generated/Data\";\r\nvar Data = /** @class */ (function (_super) {\r\n __extends(Data, _super);\r\n /**\r\n * Constructs a new instance of telemetry data.\r\n */\r\n function Data(baseType, data) {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * The data contract for serializing this object.\r\n */\r\n _this.aiDataContract = {\r\n baseType: 1 /* Required */,\r\n baseData: 1 /* Required */\r\n };\r\n _this.baseType = baseType;\r\n _this.baseData = data;\r\n return _this;\r\n }\r\n return Data;\r\n}(AIData));\r\nexport { Data };\r\n//# sourceMappingURL=Data.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"}
1
+ {"version":3,"file":"Data.js.map","sources":["Data.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nvar Data = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of telemetry data.\r\n */\r\n function Data(baseType, data) {\r\n /**\r\n * The data contract for serializing this object.\r\n */\r\n this.aiDataContract = {\r\n baseType: 1 /* Required */,\r\n baseData: 1 /* Required */\r\n };\r\n this.baseType = baseType;\r\n this.baseData = data;\r\n }\r\n return Data;\r\n}());\r\nexport { Data };\r\n//# sourceMappingURL=Data.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"}
@@ -1,19 +1,15 @@
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 { DataPoint as AIDataPoint } from "../../Interfaces/Contracts/Generated/DataPoint";
9
- var DataPoint = /** @class */ (function (_super) {
10
- __extends(DataPoint, _super);
7
+ var DataPoint = /** @class */ (function () {
11
8
  function DataPoint() {
12
- var _this = _super !== null && _super.apply(this, arguments) || this;
13
9
  /**
14
10
  * The data contract for serializing this object.
15
11
  */
16
- _this.aiDataContract = {
12
+ this.aiDataContract = {
17
13
  name: 1 /* Required */,
18
14
  kind: 0 /* Default */,
19
15
  value: 1 /* Required */,
@@ -22,9 +18,12 @@ var DataPoint = /** @class */ (function (_super) {
22
18
  max: 0 /* Default */,
23
19
  stdDev: 0 /* Default */
24
20
  };
25
- return _this;
21
+ /**
22
+ * Metric type. Single measurement or the aggregated value.
23
+ */
24
+ this.kind = 0 /* Measurement */;
26
25
  }
27
26
  return DataPoint;
28
- }(AIDataPoint));
27
+ }());
29
28
  export { DataPoint };
30
29
  //# sourceMappingURL=DataPoint.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DataPoint.js.map","sources":["DataPoint.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { __extends } from \"tslib\";\r\nimport { DataPoint as AIDataPoint } from \"../../Interfaces/Contracts/Generated/DataPoint\";\r\nvar DataPoint = /** @class */ (function (_super) {\r\n __extends(DataPoint, _super);\r\n function DataPoint() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n /**\r\n * The data contract for serializing this object.\r\n */\r\n _this.aiDataContract = {\r\n name: 1 /* Required */,\r\n kind: 0 /* Default */,\r\n value: 1 /* Required */,\r\n count: 0 /* Default */,\r\n min: 0 /* Default */,\r\n max: 0 /* Default */,\r\n stdDev: 0 /* Default */\r\n };\r\n return _this;\r\n }\r\n return DataPoint;\r\n}(AIDataPoint));\r\nexport { DataPoint };\r\n//# sourceMappingURL=DataPoint.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"}
1
+ {"version":3,"file":"DataPoint.js.map","sources":["DataPoint.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nvar DataPoint = /** @class */ (function () {\r\n function DataPoint() {\r\n /**\r\n * The data contract for serializing this object.\r\n */\r\n this.aiDataContract = {\r\n name: 1 /* Required */,\r\n kind: 0 /* Default */,\r\n value: 1 /* Required */,\r\n count: 0 /* Default */,\r\n min: 0 /* Default */,\r\n max: 0 /* Default */,\r\n stdDev: 0 /* Default */\r\n };\r\n /**\r\n * Metric type. Single measurement or the aggregated value.\r\n */\r\n this.kind = 0 /* Measurement */;\r\n }\r\n return DataPoint;\r\n}());\r\nexport { DataPoint };\r\n//# sourceMappingURL=DataPoint.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"}
@@ -1,10 +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 { LoggingSeverity, _InternalMessageId, hasJSON, getJSON, objForEachKey, isObject, strTrim } from "@microsoft/applicationinsights-core-js";
7
+ import { _InternalMessageId, hasJSON, getJSON, objForEachKey, isObject, strTrim, _throwInternal } from "@microsoft/applicationinsights-core-js";
8
8
  export function dataSanitizeKeyAndAddUniqueness(logger, key, map) {
9
9
  var origLength = key.length;
10
10
  var field = dataSanitizeKey(logger, key);
@@ -28,7 +28,7 @@ export function dataSanitizeKey(logger, name) {
28
28
  // truncate the string to 150 chars
29
29
  if (name.length > 150 /* MAX_NAME_LENGTH */) {
30
30
  nameTrunc = name.substring(0, 150 /* MAX_NAME_LENGTH */);
31
- logger && logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.NameTooLong, "name is too long. It has been truncated to " + 150 /* MAX_NAME_LENGTH */ + " characters.", { name: name }, true);
31
+ _throwInternal(logger, 2 /* WARNING */, _InternalMessageId.NameTooLong, "name is too long. It has been truncated to " + 150 /* MAX_NAME_LENGTH */ + " characters.", { name: name }, true);
32
32
  }
33
33
  }
34
34
  return nameTrunc || name;
@@ -41,7 +41,7 @@ export function dataSanitizeString(logger, value, maxLength) {
41
41
  value = strTrim(value);
42
42
  if (value.toString().length > maxLength) {
43
43
  valueTrunc = value.toString().substring(0, maxLength);
44
- logger && logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.StringValueTooLong, "string value is too long. It has been truncated to " + maxLength + " characters.", { value: value }, true);
44
+ _throwInternal(logger, 2 /* WARNING */, _InternalMessageId.StringValueTooLong, "string value is too long. It has been truncated to " + maxLength + " characters.", { value: value }, true);
45
45
  }
46
46
  }
47
47
  return valueTrunc || value;
@@ -54,7 +54,7 @@ export function dataSanitizeMessage(logger, message) {
54
54
  if (message) {
55
55
  if (message.length > 32768 /* MAX_MESSAGE_LENGTH */) {
56
56
  messageTrunc = message.substring(0, 32768 /* MAX_MESSAGE_LENGTH */);
57
- logger && logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.MessageTruncated, "message is too long, it has been truncated to " + 32768 /* MAX_MESSAGE_LENGTH */ + " characters.", { message: message }, true);
57
+ _throwInternal(logger, 2 /* WARNING */, _InternalMessageId.MessageTruncated, "message is too long, it has been truncated to " + 32768 /* MAX_MESSAGE_LENGTH */ + " characters.", { message: message }, true);
58
58
  }
59
59
  }
60
60
  return messageTrunc || message;
@@ -66,7 +66,7 @@ export function dataSanitizeException(logger, exception) {
66
66
  var value = "" + exception;
67
67
  if (value.length > 32768 /* MAX_EXCEPTION_LENGTH */) {
68
68
  exceptionTrunc = value.substring(0, 32768 /* MAX_EXCEPTION_LENGTH */);
69
- logger && logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.ExceptionTruncated, "exception is too long, it has been truncated to " + 32768 /* MAX_EXCEPTION_LENGTH */ + " characters.", { exception: exception }, true);
69
+ _throwInternal(logger, 2 /* WARNING */, _InternalMessageId.ExceptionTruncated, "exception is too long, it has been truncated to " + 32768 /* MAX_EXCEPTION_LENGTH */ + " characters.", { exception: exception }, true);
70
70
  }
71
71
  }
72
72
  return exceptionTrunc || exception;
@@ -81,7 +81,7 @@ export function dataSanitizeProperties(logger, properties) {
81
81
  value = getJSON().stringify(value);
82
82
  }
83
83
  catch (e) {
84
- logger && logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.CannotSerializeObjectNonSerializable, "custom property is not valid", { exception: e }, true);
84
+ _throwInternal(logger, 2 /* WARNING */, _InternalMessageId.CannotSerializeObjectNonSerializable, "custom property is not valid", { exception: e }, true);
85
85
  }
86
86
  }
87
87
  value = dataSanitizeString(logger, value, 8192 /* MAX_PROPERTY_LENGTH */);
@@ -112,7 +112,7 @@ export function dataSanitizeInput(logger, input, maxLength, _msgId) {
112
112
  input = strTrim(input);
113
113
  if (input.length > maxLength) {
114
114
  inputTrunc = input.substring(0, maxLength);
115
- logger && logger.throwInternal(LoggingSeverity.WARNING, _msgId, "input is too long, it has been truncated to " + maxLength + " characters.", { data: input }, true);
115
+ _throwInternal(logger, 2 /* WARNING */, _msgId, "input is too long, it has been truncated to " + maxLength + " characters.", { data: input }, true);
116
116
  }
117
117
  }
118
118
  return inputTrunc || input;
@@ -1 +1 @@
1
- {"version":3,"file":"DataSanitizer.js.map","sources":["DataSanitizer.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { LoggingSeverity, _InternalMessageId, hasJSON, getJSON, objForEachKey, isObject, strTrim } from \"@microsoft/applicationinsights-core-js\";\r\nexport function dataSanitizeKeyAndAddUniqueness(logger, key, map) {\r\n var origLength = key.length;\r\n var field = dataSanitizeKey(logger, key);\r\n // validation truncated the length. We need to add uniqueness\r\n if (field.length !== origLength) {\r\n var i = 0;\r\n var uniqueField = field;\r\n while (map[uniqueField] !== undefined) {\r\n i++;\r\n uniqueField = field.substring(0, 150 /* MAX_NAME_LENGTH */ - 3) + dsPadNumber(i);\r\n }\r\n field = uniqueField;\r\n }\r\n return field;\r\n}\r\nexport function dataSanitizeKey(logger, name) {\r\n var nameTrunc;\r\n if (name) {\r\n // Remove any leading or trailing whitespace\r\n name = strTrim(name.toString());\r\n // truncate the string to 150 chars\r\n if (name.length > 150 /* MAX_NAME_LENGTH */) {\r\n nameTrunc = name.substring(0, 150 /* MAX_NAME_LENGTH */);\r\n logger && logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.NameTooLong, \"name is too long. It has been truncated to \" + 150 /* MAX_NAME_LENGTH */ + \" characters.\", { name: name }, true);\r\n }\r\n }\r\n return nameTrunc || name;\r\n}\r\nexport function dataSanitizeString(logger, value, maxLength) {\r\n if (maxLength === void 0) { maxLength = 1024 /* MAX_STRING_LENGTH */; }\r\n var valueTrunc;\r\n if (value) {\r\n maxLength = maxLength ? maxLength : 1024 /* MAX_STRING_LENGTH */; // in case default parameters dont work\r\n value = strTrim(value);\r\n if (value.toString().length > maxLength) {\r\n valueTrunc = value.toString().substring(0, maxLength);\r\n logger && logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.StringValueTooLong, \"string value is too long. It has been truncated to \" + maxLength + \" characters.\", { value: value }, true);\r\n }\r\n }\r\n return valueTrunc || value;\r\n}\r\nexport function dataSanitizeUrl(logger, url) {\r\n return dataSanitizeInput(logger, url, 2048 /* MAX_URL_LENGTH */, _InternalMessageId.UrlTooLong);\r\n}\r\nexport function dataSanitizeMessage(logger, message) {\r\n var messageTrunc;\r\n if (message) {\r\n if (message.length > 32768 /* MAX_MESSAGE_LENGTH */) {\r\n messageTrunc = message.substring(0, 32768 /* MAX_MESSAGE_LENGTH */);\r\n logger && logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.MessageTruncated, \"message is too long, it has been truncated to \" + 32768 /* MAX_MESSAGE_LENGTH */ + \" characters.\", { message: message }, true);\r\n }\r\n }\r\n return messageTrunc || message;\r\n}\r\nexport function dataSanitizeException(logger, exception) {\r\n var exceptionTrunc;\r\n if (exception) {\r\n // Make surte its a string\r\n var value = \"\" + exception;\r\n if (value.length > 32768 /* MAX_EXCEPTION_LENGTH */) {\r\n exceptionTrunc = value.substring(0, 32768 /* MAX_EXCEPTION_LENGTH */);\r\n logger && logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.ExceptionTruncated, \"exception is too long, it has been truncated to \" + 32768 /* MAX_EXCEPTION_LENGTH */ + \" characters.\", { exception: exception }, true);\r\n }\r\n }\r\n return exceptionTrunc || exception;\r\n}\r\nexport function dataSanitizeProperties(logger, properties) {\r\n if (properties) {\r\n var tempProps_1 = {};\r\n objForEachKey(properties, function (prop, value) {\r\n if (isObject(value) && hasJSON()) {\r\n // Stringify any part C properties\r\n try {\r\n value = getJSON().stringify(value);\r\n }\r\n catch (e) {\r\n logger && logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.CannotSerializeObjectNonSerializable, \"custom property is not valid\", { exception: e }, true);\r\n }\r\n }\r\n value = dataSanitizeString(logger, value, 8192 /* MAX_PROPERTY_LENGTH */);\r\n prop = dataSanitizeKeyAndAddUniqueness(logger, prop, tempProps_1);\r\n tempProps_1[prop] = value;\r\n });\r\n properties = tempProps_1;\r\n }\r\n return properties;\r\n}\r\nexport function dataSanitizeMeasurements(logger, measurements) {\r\n if (measurements) {\r\n var tempMeasurements_1 = {};\r\n objForEachKey(measurements, function (measure, value) {\r\n measure = dataSanitizeKeyAndAddUniqueness(logger, measure, tempMeasurements_1);\r\n tempMeasurements_1[measure] = value;\r\n });\r\n measurements = tempMeasurements_1;\r\n }\r\n return measurements;\r\n}\r\nexport function dataSanitizeId(logger, id) {\r\n return id ? dataSanitizeInput(logger, id, 128 /* MAX_ID_LENGTH */, _InternalMessageId.IdTooLong).toString() : id;\r\n}\r\nexport function dataSanitizeInput(logger, input, maxLength, _msgId) {\r\n var inputTrunc;\r\n if (input) {\r\n input = strTrim(input);\r\n if (input.length > maxLength) {\r\n inputTrunc = input.substring(0, maxLength);\r\n logger && logger.throwInternal(LoggingSeverity.WARNING, _msgId, \"input is too long, it has been truncated to \" + maxLength + \" characters.\", { data: input }, true);\r\n }\r\n }\r\n return inputTrunc || input;\r\n}\r\nexport function dsPadNumber(num) {\r\n var s = \"00\" + num;\r\n return s.substr(s.length - 3);\r\n}\r\n/**\r\n * Provides the DataSanitizer functions within the previous namespace.\r\n */\r\nexport var DataSanitizer = {\r\n MAX_NAME_LENGTH: 150 /* MAX_NAME_LENGTH */,\r\n MAX_ID_LENGTH: 128 /* MAX_ID_LENGTH */,\r\n MAX_PROPERTY_LENGTH: 8192 /* MAX_PROPERTY_LENGTH */,\r\n MAX_STRING_LENGTH: 1024 /* MAX_STRING_LENGTH */,\r\n MAX_URL_LENGTH: 2048 /* MAX_URL_LENGTH */,\r\n MAX_MESSAGE_LENGTH: 32768 /* MAX_MESSAGE_LENGTH */,\r\n MAX_EXCEPTION_LENGTH: 32768 /* MAX_EXCEPTION_LENGTH */,\r\n sanitizeKeyAndAddUniqueness: dataSanitizeKeyAndAddUniqueness,\r\n sanitizeKey: dataSanitizeKey,\r\n sanitizeString: dataSanitizeString,\r\n sanitizeUrl: dataSanitizeUrl,\r\n sanitizeMessage: dataSanitizeMessage,\r\n sanitizeException: dataSanitizeException,\r\n sanitizeProperties: dataSanitizeProperties,\r\n sanitizeMeasurements: dataSanitizeMeasurements,\r\n sanitizeId: dataSanitizeId,\r\n sanitizeInput: dataSanitizeInput,\r\n padNumber: dsPadNumber,\r\n trim: strTrim\r\n};\r\n//# sourceMappingURL=DataSanitizer.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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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":"DataSanitizer.js.map","sources":["DataSanitizer.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { _InternalMessageId, hasJSON, getJSON, objForEachKey, isObject, strTrim, _throwInternal } from \"@microsoft/applicationinsights-core-js\";\r\nexport function dataSanitizeKeyAndAddUniqueness(logger, key, map) {\r\n var origLength = key.length;\r\n var field = dataSanitizeKey(logger, key);\r\n // validation truncated the length. We need to add uniqueness\r\n if (field.length !== origLength) {\r\n var i = 0;\r\n var uniqueField = field;\r\n while (map[uniqueField] !== undefined) {\r\n i++;\r\n uniqueField = field.substring(0, 150 /* MAX_NAME_LENGTH */ - 3) + dsPadNumber(i);\r\n }\r\n field = uniqueField;\r\n }\r\n return field;\r\n}\r\nexport function dataSanitizeKey(logger, name) {\r\n var nameTrunc;\r\n if (name) {\r\n // Remove any leading or trailing whitespace\r\n name = strTrim(name.toString());\r\n // truncate the string to 150 chars\r\n if (name.length > 150 /* MAX_NAME_LENGTH */) {\r\n nameTrunc = name.substring(0, 150 /* MAX_NAME_LENGTH */);\r\n _throwInternal(logger, 2 /* WARNING */, _InternalMessageId.NameTooLong, \"name is too long. It has been truncated to \" + 150 /* MAX_NAME_LENGTH */ + \" characters.\", { name: name }, true);\r\n }\r\n }\r\n return nameTrunc || name;\r\n}\r\nexport function dataSanitizeString(logger, value, maxLength) {\r\n if (maxLength === void 0) { maxLength = 1024 /* MAX_STRING_LENGTH */; }\r\n var valueTrunc;\r\n if (value) {\r\n maxLength = maxLength ? maxLength : 1024 /* MAX_STRING_LENGTH */; // in case default parameters dont work\r\n value = strTrim(value);\r\n if (value.toString().length > maxLength) {\r\n valueTrunc = value.toString().substring(0, maxLength);\r\n _throwInternal(logger, 2 /* WARNING */, _InternalMessageId.StringValueTooLong, \"string value is too long. It has been truncated to \" + maxLength + \" characters.\", { value: value }, true);\r\n }\r\n }\r\n return valueTrunc || value;\r\n}\r\nexport function dataSanitizeUrl(logger, url) {\r\n return dataSanitizeInput(logger, url, 2048 /* MAX_URL_LENGTH */, _InternalMessageId.UrlTooLong);\r\n}\r\nexport function dataSanitizeMessage(logger, message) {\r\n var messageTrunc;\r\n if (message) {\r\n if (message.length > 32768 /* MAX_MESSAGE_LENGTH */) {\r\n messageTrunc = message.substring(0, 32768 /* MAX_MESSAGE_LENGTH */);\r\n _throwInternal(logger, 2 /* WARNING */, _InternalMessageId.MessageTruncated, \"message is too long, it has been truncated to \" + 32768 /* MAX_MESSAGE_LENGTH */ + \" characters.\", { message: message }, true);\r\n }\r\n }\r\n return messageTrunc || message;\r\n}\r\nexport function dataSanitizeException(logger, exception) {\r\n var exceptionTrunc;\r\n if (exception) {\r\n // Make surte its a string\r\n var value = \"\" + exception;\r\n if (value.length > 32768 /* MAX_EXCEPTION_LENGTH */) {\r\n exceptionTrunc = value.substring(0, 32768 /* MAX_EXCEPTION_LENGTH */);\r\n _throwInternal(logger, 2 /* WARNING */, _InternalMessageId.ExceptionTruncated, \"exception is too long, it has been truncated to \" + 32768 /* MAX_EXCEPTION_LENGTH */ + \" characters.\", { exception: exception }, true);\r\n }\r\n }\r\n return exceptionTrunc || exception;\r\n}\r\nexport function dataSanitizeProperties(logger, properties) {\r\n if (properties) {\r\n var tempProps_1 = {};\r\n objForEachKey(properties, function (prop, value) {\r\n if (isObject(value) && hasJSON()) {\r\n // Stringify any part C properties\r\n try {\r\n value = getJSON().stringify(value);\r\n }\r\n catch (e) {\r\n _throwInternal(logger, 2 /* WARNING */, _InternalMessageId.CannotSerializeObjectNonSerializable, \"custom property is not valid\", { exception: e }, true);\r\n }\r\n }\r\n value = dataSanitizeString(logger, value, 8192 /* MAX_PROPERTY_LENGTH */);\r\n prop = dataSanitizeKeyAndAddUniqueness(logger, prop, tempProps_1);\r\n tempProps_1[prop] = value;\r\n });\r\n properties = tempProps_1;\r\n }\r\n return properties;\r\n}\r\nexport function dataSanitizeMeasurements(logger, measurements) {\r\n if (measurements) {\r\n var tempMeasurements_1 = {};\r\n objForEachKey(measurements, function (measure, value) {\r\n measure = dataSanitizeKeyAndAddUniqueness(logger, measure, tempMeasurements_1);\r\n tempMeasurements_1[measure] = value;\r\n });\r\n measurements = tempMeasurements_1;\r\n }\r\n return measurements;\r\n}\r\nexport function dataSanitizeId(logger, id) {\r\n return id ? dataSanitizeInput(logger, id, 128 /* MAX_ID_LENGTH */, _InternalMessageId.IdTooLong).toString() : id;\r\n}\r\nexport function dataSanitizeInput(logger, input, maxLength, _msgId) {\r\n var inputTrunc;\r\n if (input) {\r\n input = strTrim(input);\r\n if (input.length > maxLength) {\r\n inputTrunc = input.substring(0, maxLength);\r\n _throwInternal(logger, 2 /* WARNING */, _msgId, \"input is too long, it has been truncated to \" + maxLength + \" characters.\", { data: input }, true);\r\n }\r\n }\r\n return inputTrunc || input;\r\n}\r\nexport function dsPadNumber(num) {\r\n var s = \"00\" + num;\r\n return s.substr(s.length - 3);\r\n}\r\n/**\r\n * Provides the DataSanitizer functions within the previous namespace.\r\n */\r\nexport var DataSanitizer = {\r\n MAX_NAME_LENGTH: 150 /* MAX_NAME_LENGTH */,\r\n MAX_ID_LENGTH: 128 /* MAX_ID_LENGTH */,\r\n MAX_PROPERTY_LENGTH: 8192 /* MAX_PROPERTY_LENGTH */,\r\n MAX_STRING_LENGTH: 1024 /* MAX_STRING_LENGTH */,\r\n MAX_URL_LENGTH: 2048 /* MAX_URL_LENGTH */,\r\n MAX_MESSAGE_LENGTH: 32768 /* MAX_MESSAGE_LENGTH */,\r\n MAX_EXCEPTION_LENGTH: 32768 /* MAX_EXCEPTION_LENGTH */,\r\n sanitizeKeyAndAddUniqueness: dataSanitizeKeyAndAddUniqueness,\r\n sanitizeKey: dataSanitizeKey,\r\n sanitizeString: dataSanitizeString,\r\n sanitizeUrl: dataSanitizeUrl,\r\n sanitizeMessage: dataSanitizeMessage,\r\n sanitizeException: dataSanitizeException,\r\n sanitizeProperties: dataSanitizeProperties,\r\n sanitizeMeasurements: dataSanitizeMeasurements,\r\n sanitizeId: dataSanitizeId,\r\n sanitizeInput: dataSanitizeInput,\r\n padNumber: dsPadNumber,\r\n trim: strTrim\r\n};\r\n//# sourceMappingURL=DataSanitizer.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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,25 +1,26 @@
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 { Envelope as AIEnvelope } from "../../Interfaces/Contracts/Generated/Envelope";
9
7
  import { dataSanitizeString } from "./DataSanitizer";
10
8
  import { toISOString } from "@microsoft/applicationinsights-core-js";
11
9
  import { strNotSpecified } from "../../Constants";
12
- var Envelope = /** @class */ (function (_super) {
13
- __extends(Envelope, _super);
10
+ var Envelope = /** @class */ (function () {
14
11
  /**
15
12
  * Constructs a new instance of telemetry data.
16
13
  */
17
14
  function Envelope(logger, data, name) {
18
- var _this = _super.call(this) || this;
19
- _this.name = dataSanitizeString(logger, name) || strNotSpecified;
20
- _this.data = data;
21
- _this.time = toISOString(new Date());
22
- _this.aiDataContract = {
15
+ var _this = this;
16
+ var _self = this;
17
+ _self.ver = 1;
18
+ _self.sampleRate = 100.0;
19
+ _self.tags = {};
20
+ _self.name = dataSanitizeString(logger, name) || strNotSpecified;
21
+ _self.data = data;
22
+ _self.time = toISOString(new Date());
23
+ _self.aiDataContract = {
23
24
  time: 1 /* Required */,
24
25
  iKey: 1 /* Required */,
25
26
  name: 1 /* Required */,
@@ -29,9 +30,8 @@ var Envelope = /** @class */ (function (_super) {
29
30
  tags: 1 /* Required */,
30
31
  data: 1 /* Required */
31
32
  };
32
- return _this;
33
33
  }
34
34
  return Envelope;
35
- }(AIEnvelope));
35
+ }());
36
36
  export { Envelope };
37
37
  //# sourceMappingURL=Envelope.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Envelope.js.map","sources":["Envelope.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { __extends } from \"tslib\";\r\nimport { Envelope as AIEnvelope } from \"../../Interfaces/Contracts/Generated/Envelope\";\r\nimport { dataSanitizeString } from \"./DataSanitizer\";\r\nimport { toISOString } from \"@microsoft/applicationinsights-core-js\";\r\nimport { strNotSpecified } from \"../../Constants\";\r\nvar Envelope = /** @class */ (function (_super) {\r\n __extends(Envelope, _super);\r\n /**\r\n * Constructs a new instance of telemetry data.\r\n */\r\n function Envelope(logger, data, name) {\r\n var _this = _super.call(this) || this;\r\n _this.name = dataSanitizeString(logger, name) || strNotSpecified;\r\n _this.data = data;\r\n _this.time = toISOString(new Date());\r\n _this.aiDataContract = {\r\n time: 1 /* Required */,\r\n iKey: 1 /* Required */,\r\n name: 1 /* Required */,\r\n sampleRate: function () {\r\n return (_this.sampleRate === 100) ? 4 /* Hidden */ : 1 /* Required */;\r\n },\r\n tags: 1 /* Required */,\r\n data: 1 /* Required */\r\n };\r\n return _this;\r\n }\r\n return Envelope;\r\n}(AIEnvelope));\r\nexport { Envelope };\r\n//# sourceMappingURL=Envelope.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"}
1
+ {"version":3,"file":"Envelope.js.map","sources":["Envelope.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { dataSanitizeString } from \"./DataSanitizer\";\r\nimport { toISOString } from \"@microsoft/applicationinsights-core-js\";\r\nimport { strNotSpecified } from \"../../Constants\";\r\nvar Envelope = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of telemetry data.\r\n */\r\n function Envelope(logger, data, name) {\r\n var _this = this;\r\n var _self = this;\r\n _self.ver = 1;\r\n _self.sampleRate = 100.0;\r\n _self.tags = {};\r\n _self.name = dataSanitizeString(logger, name) || strNotSpecified;\r\n _self.data = data;\r\n _self.time = toISOString(new Date());\r\n _self.aiDataContract = {\r\n time: 1 /* Required */,\r\n iKey: 1 /* Required */,\r\n name: 1 /* Required */,\r\n sampleRate: function () {\r\n return (_this.sampleRate === 100) ? 4 /* Hidden */ : 1 /* Required */;\r\n },\r\n tags: 1 /* Required */,\r\n data: 1 /* Required */\r\n };\r\n }\r\n return Envelope;\r\n}());\r\nexport { Envelope };\r\n//# sourceMappingURL=Envelope.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"}