@microsoft/applicationinsights-common 3.0.0-beta.2303-11 → 3.0.0-nightly3.2304-28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/es5/applicationinsights-common.cjs.js +3965 -0
- package/browser/es5/applicationinsights-common.cjs.js.map +1 -0
- package/browser/es5/applicationinsights-common.cjs.min.js +6 -0
- package/browser/es5/applicationinsights-common.cjs.min.js.map +1 -0
- package/browser/es5/applicationinsights-common.gbl.js +3969 -0
- package/browser/es5/applicationinsights-common.gbl.js.map +1 -0
- package/browser/es5/applicationinsights-common.gbl.min.js +6 -0
- package/browser/es5/applicationinsights-common.gbl.min.js.map +1 -0
- package/browser/es5/applicationinsights-common.integrity.json +66 -0
- package/browser/{applicationinsights-common.js → es5/applicationinsights-common.js} +194 -167
- package/browser/es5/applicationinsights-common.js.map +1 -0
- package/browser/es5/applicationinsights-common.min.js +6 -0
- package/browser/es5/applicationinsights-common.min.js.map +1 -0
- package/dist/{applicationinsights-common.js → es5/applicationinsights-common.js} +194 -167
- package/dist/es5/applicationinsights-common.js.map +1 -0
- package/dist/es5/applicationinsights-common.min.js +6 -0
- package/dist/es5/applicationinsights-common.min.js.map +1 -0
- package/{dist-esm → dist-es5}/ConnectionStringParser.js +1 -1
- package/{dist-esm → dist-es5}/Constants.js +1 -1
- package/{dist-esm → dist-es5}/DomHelperFuncs.js +1 -1
- package/{dist-esm → dist-es5}/Enums.js +1 -1
- package/{dist-esm → dist-es5}/HelperFuncs.js +1 -1
- package/dist-es5/Interfaces/ConnectionString.js +6 -0
- package/dist-es5/Interfaces/Context/IApplication.js +8 -0
- package/dist-es5/Interfaces/Context/IDevice.js +8 -0
- package/dist-es5/Interfaces/Context/IInternal.js +8 -0
- package/dist-es5/Interfaces/Context/ILocation.js +8 -0
- package/dist-es5/Interfaces/Context/IOperatingSystem.js +8 -0
- package/dist-es5/Interfaces/Context/ISample.js +8 -0
- package/dist-es5/Interfaces/Context/ISession.js +8 -0
- package/dist-es5/Interfaces/Context/ITelemetryTrace.js +8 -0
- package/dist-es5/Interfaces/Context/IUser.js +8 -0
- package/dist-es5/Interfaces/Context/IWeb.js +8 -0
- package/{dist-esm → dist-es5}/Interfaces/Contracts/AvailabilityData.js +1 -1
- package/{dist-esm → dist-es5}/Interfaces/Contracts/ContextTagKeys.js +1 -1
- package/dist-es5/Interfaces/Contracts/DataPointType.js +8 -0
- package/dist-es5/Interfaces/Contracts/DependencyKind.js +8 -0
- package/dist-es5/Interfaces/Contracts/DependencySourceType.js +8 -0
- package/dist-es5/Interfaces/Contracts/IBase.js +8 -0
- package/dist-es5/Interfaces/Contracts/IData.js +8 -0
- package/dist-es5/Interfaces/Contracts/IDataPoint.js +6 -0
- package/dist-es5/Interfaces/Contracts/IDomain.js +8 -0
- package/{dist-esm → dist-es5}/Interfaces/Contracts/IEnvelope.js +1 -1
- package/dist-es5/Interfaces/Contracts/IEventData.js +8 -0
- package/dist-es5/Interfaces/Contracts/IExceptionData.js +8 -0
- package/dist-es5/Interfaces/Contracts/IExceptionDetails.js +8 -0
- package/dist-es5/Interfaces/Contracts/IMessageData.js +8 -0
- package/dist-es5/Interfaces/Contracts/IMetricData.js +8 -0
- package/dist-es5/Interfaces/Contracts/IPageViewData.js +8 -0
- package/dist-es5/Interfaces/Contracts/IPageViewPerfData.js +8 -0
- package/dist-es5/Interfaces/Contracts/IRemoteDependencyData.js +8 -0
- package/dist-es5/Interfaces/Contracts/IStackFrame.js +8 -0
- package/{dist-esm → dist-es5}/Interfaces/Contracts/RequestData.js +1 -1
- package/{dist-esm → dist-es5}/Interfaces/Contracts/SeverityLevel.js +1 -1
- package/dist-es5/Interfaces/IAppInsights.js +8 -0
- package/{dist-esm → dist-es5}/Interfaces/IConfig.js +1 -1
- package/dist-es5/Interfaces/ICorrelationConfig.js +8 -0
- package/dist-es5/Interfaces/IDependencyTelemetry.js +8 -0
- package/dist-es5/Interfaces/IEventTelemetry.js +6 -0
- package/dist-es5/Interfaces/IExceptionTelemetry.js +8 -0
- package/dist-es5/Interfaces/IMetricTelemetry.js +6 -0
- package/dist-es5/Interfaces/IPageViewPerformanceTelemetry.js +6 -0
- package/dist-es5/Interfaces/IPageViewTelemetry.js +6 -0
- package/dist-es5/Interfaces/IPartC.js +8 -0
- package/dist-es5/Interfaces/IPropertiesPlugin.js +8 -0
- package/dist-es5/Interfaces/IRequestContext.js +6 -0
- package/dist-es5/Interfaces/ITelemetryContext.js +8 -0
- package/dist-es5/Interfaces/IThrottleMgr.js +6 -0
- package/dist-es5/Interfaces/ITraceTelemetry.js +8 -0
- package/{dist-esm → dist-es5}/Interfaces/PartAExtensions.js +1 -1
- package/dist-es5/Interfaces/Telemetry/IEnvelope.js +8 -0
- package/dist-es5/Interfaces/Telemetry/ISerializable.js +8 -0
- package/{dist-esm → dist-es5}/RequestResponseHeaders.js +1 -1
- package/{dist-esm → dist-es5}/StorageHelperFuncs.js +1 -1
- package/{dist-esm → dist-es5}/Telemetry/Common/Data.js +1 -1
- package/{dist-esm → dist-es5}/Telemetry/Common/DataPoint.js +1 -1
- package/{dist-esm → dist-es5}/Telemetry/Common/DataSanitizer.js +3 -2
- package/dist-es5/Telemetry/Common/DataSanitizer.js.map +1 -0
- package/{dist-esm → dist-es5}/Telemetry/Common/Envelope.js +1 -1
- package/{dist-esm → dist-es5}/Telemetry/Event.js +1 -1
- package/{dist-esm → dist-es5}/Telemetry/Exception.js +1 -1
- package/{dist-esm → dist-es5}/Telemetry/Metric.js +1 -1
- package/{dist-esm → dist-es5}/Telemetry/PageView.js +1 -1
- package/{dist-esm → dist-es5}/Telemetry/PageViewPerformance.js +1 -1
- package/{dist-esm → dist-es5}/Telemetry/RemoteDependencyData.js +1 -1
- package/{dist-esm → dist-es5}/Telemetry/Trace.js +1 -1
- package/{dist-esm → dist-es5}/TelemetryItemCreator.js +1 -1
- package/{dist-esm → dist-es5}/ThrottleMgr.js +1 -1
- package/{dist-esm → dist-es5}/UrlHelperFuncs.js +1 -1
- package/{dist-esm → dist-es5}/Util.js +1 -1
- package/{dist-esm → dist-es5}/__DynamicConstants.js +1 -1
- package/{dist-esm → dist-es5}/applicationinsights-common.js +1 -1
- package/package.json +18 -17
- package/tsconfig.json +4 -3
- package/types/applicationinsights-common.d.ts +2561 -58
- package/{dist/applicationinsights-common.d.ts → types/applicationinsights-common.namespaced.d.ts} +1 -1
- package/browser/applicationinsights-common.integrity.json +0 -26
- package/browser/applicationinsights-common.js.map +0 -1
- package/browser/applicationinsights-common.min.js +0 -6
- package/browser/applicationinsights-common.min.js.map +0 -1
- package/dist/applicationinsights-common.api.json +0 -19540
- package/dist/applicationinsights-common.api.md +0 -1224
- package/dist/applicationinsights-common.js.map +0 -1
- package/dist/applicationinsights-common.min.js +0 -6
- package/dist/applicationinsights-common.min.js.map +0 -1
- package/dist/applicationinsights-common.rollup.d.ts +0 -2562
- package/dist-esm/Interfaces/ConnectionString.js +0 -6
- package/dist-esm/Interfaces/Context/IApplication.js +0 -8
- package/dist-esm/Interfaces/Context/IDevice.js +0 -8
- package/dist-esm/Interfaces/Context/IInternal.js +0 -8
- package/dist-esm/Interfaces/Context/ILocation.js +0 -8
- package/dist-esm/Interfaces/Context/IOperatingSystem.js +0 -8
- package/dist-esm/Interfaces/Context/ISample.js +0 -8
- package/dist-esm/Interfaces/Context/ISession.js +0 -8
- package/dist-esm/Interfaces/Context/ITelemetryTrace.js +0 -8
- package/dist-esm/Interfaces/Context/IUser.js +0 -8
- package/dist-esm/Interfaces/Context/IWeb.js +0 -8
- package/dist-esm/Interfaces/Contracts/DataPointType.js +0 -8
- package/dist-esm/Interfaces/Contracts/DependencyKind.js +0 -8
- package/dist-esm/Interfaces/Contracts/DependencySourceType.js +0 -8
- package/dist-esm/Interfaces/Contracts/IBase.js +0 -8
- package/dist-esm/Interfaces/Contracts/IData.js +0 -8
- package/dist-esm/Interfaces/Contracts/IDataPoint.js +0 -6
- package/dist-esm/Interfaces/Contracts/IDomain.js +0 -8
- package/dist-esm/Interfaces/Contracts/IEventData.js +0 -8
- package/dist-esm/Interfaces/Contracts/IExceptionData.js +0 -8
- package/dist-esm/Interfaces/Contracts/IExceptionDetails.js +0 -8
- package/dist-esm/Interfaces/Contracts/IMessageData.js +0 -8
- package/dist-esm/Interfaces/Contracts/IMetricData.js +0 -8
- package/dist-esm/Interfaces/Contracts/IPageViewData.js +0 -8
- package/dist-esm/Interfaces/Contracts/IPageViewPerfData.js +0 -8
- package/dist-esm/Interfaces/Contracts/IRemoteDependencyData.js +0 -8
- package/dist-esm/Interfaces/Contracts/IStackFrame.js +0 -8
- package/dist-esm/Interfaces/IAppInsights.js +0 -8
- package/dist-esm/Interfaces/ICorrelationConfig.js +0 -8
- package/dist-esm/Interfaces/IDependencyTelemetry.js +0 -8
- package/dist-esm/Interfaces/IEventTelemetry.js +0 -6
- package/dist-esm/Interfaces/IExceptionTelemetry.js +0 -8
- package/dist-esm/Interfaces/IMetricTelemetry.js +0 -6
- package/dist-esm/Interfaces/IPageViewPerformanceTelemetry.js +0 -6
- package/dist-esm/Interfaces/IPageViewTelemetry.js +0 -6
- package/dist-esm/Interfaces/IPartC.js +0 -8
- package/dist-esm/Interfaces/IPropertiesPlugin.js +0 -8
- package/dist-esm/Interfaces/IRequestContext.js +0 -6
- package/dist-esm/Interfaces/ITelemetryContext.js +0 -8
- package/dist-esm/Interfaces/IThrottleMgr.js +0 -6
- package/dist-esm/Interfaces/ITraceTelemetry.js +0 -8
- package/dist-esm/Interfaces/Telemetry/IEnvelope.js +0 -8
- package/dist-esm/Interfaces/Telemetry/ISerializable.js +0 -8
- package/dist-esm/Telemetry/Common/DataSanitizer.js.map +0 -1
- package/src/ConnectionStringParser.ts +0 -47
- package/src/Constants.ts +0 -18
- package/src/DomHelperFuncs.ts +0 -19
- package/src/Enums.ts +0 -65
- package/src/HelperFuncs.ts +0 -54
- package/src/Interfaces/ConnectionString.ts +0 -3
- package/src/Interfaces/Context/IApplication.ts +0 -14
- package/src/Interfaces/Context/IDevice.ts +0 -28
- package/src/Interfaces/Context/IInternal.ts +0 -29
- package/src/Interfaces/Context/ILocation.ts +0 -9
- package/src/Interfaces/Context/IOperatingSystem.ts +0 -7
- package/src/Interfaces/Context/ISample.ts +0 -13
- package/src/Interfaces/Context/ISession.ts +0 -22
- package/src/Interfaces/Context/ITelemetryTrace.ts +0 -33
- package/src/Interfaces/Context/IUser.ts +0 -50
- package/src/Interfaces/Context/IWeb.ts +0 -39
- package/src/Interfaces/Contracts/AvailabilityData.ts +0 -57
- package/src/Interfaces/Contracts/ContextTagKeys.ts +0 -299
- package/src/Interfaces/Contracts/DataPointType.ts +0 -10
- package/src/Interfaces/Contracts/DependencyKind.ts +0 -11
- package/src/Interfaces/Contracts/DependencySourceType.ts +0 -11
- package/src/Interfaces/Contracts/IBase.ts +0 -13
- package/src/Interfaces/Contracts/IData.ts +0 -19
- package/src/Interfaces/Contracts/IDataPoint.ts +0 -44
- package/src/Interfaces/Contracts/IDomain.ts +0 -8
- package/src/Interfaces/Contracts/IEnvelope.ts +0 -50
- package/src/Interfaces/Contracts/IEventData.ts +0 -30
- package/src/Interfaces/Contracts/IExceptionData.ts +0 -37
- package/src/Interfaces/Contracts/IExceptionDetails.ts +0 -45
- package/src/Interfaces/Contracts/IMessageData.ts +0 -36
- package/src/Interfaces/Contracts/IMetricData.ts +0 -31
- package/src/Interfaces/Contracts/IPageViewData.ts +0 -26
- package/src/Interfaces/Contracts/IPageViewPerfData.ts +0 -35
- package/src/Interfaces/Contracts/IRemoteDependencyData.ts +0 -65
- package/src/Interfaces/Contracts/IStackFrame.ts +0 -33
- package/src/Interfaces/Contracts/RequestData.ts +0 -50
- package/src/Interfaces/Contracts/SeverityLevel.ts +0 -28
- package/src/Interfaces/IAppInsights.ts +0 -31
- package/src/Interfaces/IConfig.ts +0 -396
- package/src/Interfaces/ICorrelationConfig.ts +0 -71
- package/src/Interfaces/IDependencyTelemetry.ts +0 -22
- package/src/Interfaces/IEventTelemetry.ts +0 -20
- package/src/Interfaces/IExceptionTelemetry.ts +0 -143
- package/src/Interfaces/IMetricTelemetry.ts +0 -56
- package/src/Interfaces/IPageViewPerformanceTelemetry.ts +0 -61
- package/src/Interfaces/IPageViewTelemetry.ts +0 -65
- package/src/Interfaces/IPartC.ts +0 -18
- package/src/Interfaces/IPropertiesPlugin.ts +0 -8
- package/src/Interfaces/IRequestContext.ts +0 -6
- package/src/Interfaces/ITelemetryContext.ts +0 -69
- package/src/Interfaces/IThrottleMgr.ts +0 -111
- package/src/Interfaces/ITraceTelemetry.ts +0 -28
- package/src/Interfaces/PartAExtensions.ts +0 -14
- package/src/Interfaces/Telemetry/IEnvelope.ts +0 -47
- package/src/Interfaces/Telemetry/ISerializable.ts +0 -11
- package/src/RequestResponseHeaders.ts +0 -96
- package/src/StorageHelperFuncs.ts +0 -223
- package/src/Telemetry/Common/Data.ts +0 -35
- package/src/Telemetry/Common/DataPoint.ts +0 -58
- package/src/Telemetry/Common/DataSanitizer.ts +0 -197
- package/src/Telemetry/Common/Envelope.ts +0 -81
- package/src/Telemetry/Event.ts +0 -52
- package/src/Telemetry/Exception.ts +0 -681
- package/src/Telemetry/Metric.ts +0 -61
- package/src/Telemetry/PageView.ts +0 -79
- package/src/Telemetry/PageViewPerformance.ts +0 -113
- package/src/Telemetry/RemoteDependencyData.ts +0 -122
- package/src/Telemetry/Trace.ts +0 -64
- package/src/TelemetryItemCreator.ts +0 -75
- package/src/ThrottleMgr.ts +0 -345
- package/src/UrlHelperFuncs.ts +0 -101
- package/src/Util.ts +0 -221
- package/src/__DynamicConstants.ts +0 -50
- package/src/applicationinsights-common.ts +0 -76
- package/types/ConnectionStringParser.d.ts +0 -5
- package/types/Constants.d.ts +0 -15
- package/types/DomHelperFuncs.d.ts +0 -1
- package/types/Enums.d.ts +0 -49
- package/types/HelperFuncs.d.ts +0 -8
- package/types/Interfaces/ConnectionString.d.ts +0 -4
- package/types/Interfaces/Context/IApplication.d.ts +0 -10
- package/types/Interfaces/Context/IDevice.d.ts +0 -22
- package/types/Interfaces/Context/IInternal.d.ts +0 -23
- package/types/Interfaces/Context/ILocation.d.ts +0 -6
- package/types/Interfaces/Context/IOperatingSystem.d.ts +0 -3
- package/types/Interfaces/Context/ISample.d.ts +0 -8
- package/types/Interfaces/Context/ISession.d.ts +0 -17
- package/types/Interfaces/Context/ITelemetryTrace.d.ts +0 -25
- package/types/Interfaces/Context/IUser.d.ts +0 -39
- package/types/Interfaces/Context/IWeb.d.ts +0 -30
- package/types/Interfaces/Contracts/AvailabilityData.d.ts +0 -0
- package/types/Interfaces/Contracts/ContextTagKeys.d.ts +0 -175
- package/types/Interfaces/Contracts/DataPointType.d.ts +0 -7
- package/types/Interfaces/Contracts/DependencyKind.d.ts +0 -8
- package/types/Interfaces/Contracts/DependencySourceType.d.ts +0 -8
- package/types/Interfaces/Contracts/IBase.d.ts +0 -9
- package/types/Interfaces/Contracts/IData.d.ts +0 -14
- package/types/Interfaces/Contracts/IDataPoint.d.ts +0 -34
- package/types/Interfaces/Contracts/IDomain.d.ts +0 -5
- package/types/Interfaces/Contracts/IEnvelope.d.ts +0 -0
- package/types/Interfaces/Contracts/IEventData.d.ts +0 -22
- package/types/Interfaces/Contracts/IExceptionData.d.ts +0 -28
- package/types/Interfaces/Contracts/IExceptionDetails.d.ts +0 -34
- package/types/Interfaces/Contracts/IMessageData.d.ts +0 -27
- package/types/Interfaces/Contracts/IMetricData.d.ts +0 -23
- package/types/Interfaces/Contracts/IPageViewData.d.ts +0 -18
- package/types/Interfaces/Contracts/IPageViewPerfData.d.ts +0 -26
- package/types/Interfaces/Contracts/IRemoteDependencyData.d.ts +0 -50
- package/types/Interfaces/Contracts/IStackFrame.d.ts +0 -25
- package/types/Interfaces/Contracts/RequestData.d.ts +0 -0
- package/types/Interfaces/Contracts/SeverityLevel.d.ts +0 -15
- package/types/Interfaces/IAppInsights.d.ts +0 -37
- package/types/Interfaces/IConfig.d.ts +0 -323
- package/types/Interfaces/ICorrelationConfig.d.ts +0 -59
- package/types/Interfaces/IDependencyTelemetry.d.ts +0 -17
- package/types/Interfaces/IEventTelemetry.d.ts +0 -15
- package/types/Interfaces/IExceptionTelemetry.d.ts +0 -123
- package/types/Interfaces/IMetricTelemetry.d.ts +0 -46
- package/types/Interfaces/IPageViewPerformanceTelemetry.d.ts +0 -55
- package/types/Interfaces/IPageViewTelemetry.d.ts +0 -52
- package/types/Interfaces/IPartC.d.ts +0 -18
- package/types/Interfaces/IPropertiesPlugin.d.ts +0 -4
- package/types/Interfaces/IRequestContext.d.ts +0 -6
- package/types/Interfaces/ITelemetryContext.d.ts +0 -55
- package/types/Interfaces/IThrottleMgr.d.ts +0 -96
- package/types/Interfaces/ITraceTelemetry.d.ts +0 -22
- package/types/Interfaces/PartAExtensions.d.ts +0 -12
- package/types/Interfaces/Telemetry/IEnvelope.d.ts +0 -37
- package/types/Interfaces/Telemetry/ISerializable.d.ts +0 -8
- package/types/RequestResponseHeaders.d.ts +0 -68
- package/types/StorageHelperFuncs.d.ts +0 -23
- package/types/Telemetry/Common/Data.d.ts +0 -24
- package/types/Telemetry/Common/DataPoint.d.ts +0 -46
- package/types/Telemetry/Common/DataSanitizer.d.ts +0 -42
- package/types/Telemetry/Common/Envelope.d.ts +0 -45
- package/types/Telemetry/Event.d.ts +0 -34
- package/types/Telemetry/Exception.d.ts +0 -150
- package/types/Telemetry/Metric.d.ts +0 -36
- package/types/Telemetry/PageView.d.ts +0 -53
- package/types/Telemetry/PageViewPerformance.d.ts +0 -78
- package/types/Telemetry/RemoteDependencyData.d.ts +0 -79
- package/types/Telemetry/Trace.d.ts +0 -41
- package/types/TelemetryItemCreator.d.ts +0 -27
- package/types/ThrottleMgr.d.ts +0 -13
- package/types/UrlHelperFuncs.d.ts +0 -6
- package/types/Util.d.ts +0 -36
- package/types/__DynamicConstants.d.ts +0 -38
- package/types/tsdoc-metadata.json +0 -11
- /package/{dist-esm → dist-es5}/ConnectionStringParser.js.map +0 -0
- /package/{dist-esm → dist-es5}/Constants.js.map +0 -0
- /package/{dist-esm → dist-es5}/DomHelperFuncs.js.map +0 -0
- /package/{dist-esm → dist-es5}/Enums.js.map +0 -0
- /package/{dist-esm → dist-es5}/HelperFuncs.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/ConnectionString.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Context/IApplication.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Context/IDevice.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Context/IInternal.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Context/ILocation.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Context/IOperatingSystem.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Context/ISample.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Context/ISession.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Context/ITelemetryTrace.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Context/IUser.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Context/IWeb.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Contracts/AvailabilityData.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Contracts/ContextTagKeys.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Contracts/DataPointType.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Contracts/DependencyKind.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Contracts/DependencySourceType.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Contracts/IBase.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Contracts/IData.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Contracts/IDataPoint.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Contracts/IDomain.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Contracts/IEnvelope.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Contracts/IEventData.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Contracts/IExceptionData.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Contracts/IExceptionDetails.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Contracts/IMessageData.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Contracts/IMetricData.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Contracts/IPageViewData.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Contracts/IPageViewPerfData.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Contracts/IRemoteDependencyData.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Contracts/IStackFrame.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Contracts/RequestData.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Contracts/SeverityLevel.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/IAppInsights.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/IConfig.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/ICorrelationConfig.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/IDependencyTelemetry.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/IEventTelemetry.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/IExceptionTelemetry.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/IMetricTelemetry.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/IPageViewPerformanceTelemetry.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/IPageViewTelemetry.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/IPartC.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/IPropertiesPlugin.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/IRequestContext.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/ITelemetryContext.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/IThrottleMgr.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/ITraceTelemetry.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/PartAExtensions.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Telemetry/IEnvelope.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/Telemetry/ISerializable.js.map +0 -0
- /package/{dist-esm → dist-es5}/RequestResponseHeaders.js.map +0 -0
- /package/{dist-esm → dist-es5}/StorageHelperFuncs.js.map +0 -0
- /package/{dist-esm → dist-es5}/Telemetry/Common/Data.js.map +0 -0
- /package/{dist-esm → dist-es5}/Telemetry/Common/DataPoint.js.map +0 -0
- /package/{dist-esm → dist-es5}/Telemetry/Common/Envelope.js.map +0 -0
- /package/{dist-esm → dist-es5}/Telemetry/Event.js.map +0 -0
- /package/{dist-esm → dist-es5}/Telemetry/Exception.js.map +0 -0
- /package/{dist-esm → dist-es5}/Telemetry/Metric.js.map +0 -0
- /package/{dist-esm → dist-es5}/Telemetry/PageView.js.map +0 -0
- /package/{dist-esm → dist-es5}/Telemetry/PageViewPerformance.js.map +0 -0
- /package/{dist-esm → dist-es5}/Telemetry/RemoteDependencyData.js.map +0 -0
- /package/{dist-esm → dist-es5}/Telemetry/Trace.js.map +0 -0
- /package/{dist-esm → dist-es5}/TelemetryItemCreator.js.map +0 -0
- /package/{dist-esm → dist-es5}/ThrottleMgr.js.map +0 -0
- /package/{dist-esm → dist-es5}/UrlHelperFuncs.js.map +0 -0
- /package/{dist-esm → dist-es5}/Util.js.map +0 -0
- /package/{dist-esm → dist-es5}/__DynamicConstants.js.map +0 -0
- /package/{dist-esm → dist-es5}/applicationinsights-common.js.map +0 -0
|
@@ -1,681 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
IDiagnosticLogger, arrForEach, arrMap, isArray, isError, isFunction, isNullOrUndefined, isObject, isString, strTrim
|
|
6
|
-
} from "@microsoft/applicationinsights-core-js";
|
|
7
|
-
import { strIndexOf } from "@nevware21/ts-utils";
|
|
8
|
-
import { strNotSpecified } from "../Constants";
|
|
9
|
-
import { FieldType } from "../Enums";
|
|
10
|
-
import { IExceptionData } from "../Interfaces/Contracts/IExceptionData";
|
|
11
|
-
import { IExceptionDetails } from "../Interfaces/Contracts/IExceptionDetails";
|
|
12
|
-
import { IStackFrame } from "../Interfaces/Contracts/IStackFrame";
|
|
13
|
-
import { SeverityLevel } from "../Interfaces/Contracts/SeverityLevel";
|
|
14
|
-
import {
|
|
15
|
-
IAutoExceptionTelemetry, IExceptionDetailsInternal, IExceptionInternal, IExceptionStackFrameInternal, IStackDetails
|
|
16
|
-
} from "../Interfaces/IExceptionTelemetry";
|
|
17
|
-
import { ISerializable } from "../Interfaces/Telemetry/ISerializable";
|
|
18
|
-
import {
|
|
19
|
-
dataSanitizeException, dataSanitizeMeasurements, dataSanitizeMessage, dataSanitizeProperties, dataSanitizeString
|
|
20
|
-
} from "./Common/DataSanitizer";
|
|
21
|
-
|
|
22
|
-
const NoMethod = "<no_method>";
|
|
23
|
-
const strError = "error";
|
|
24
|
-
const strStack = "stack";
|
|
25
|
-
const strStackDetails = "stackDetails";
|
|
26
|
-
const strErrorSrc = "errorSrc";
|
|
27
|
-
const strMessage = "message";
|
|
28
|
-
const strDescription = "description";
|
|
29
|
-
|
|
30
|
-
function _stringify(value: any, convertToString: boolean) {
|
|
31
|
-
let result = value;
|
|
32
|
-
if (result && !isString(result)) {
|
|
33
|
-
if (JSON && JSON.stringify) {
|
|
34
|
-
result = JSON.stringify(value);
|
|
35
|
-
if (convertToString && (!result || result === "{}")) {
|
|
36
|
-
if (isFunction(value.toString)) {
|
|
37
|
-
result = value.toString();
|
|
38
|
-
} else {
|
|
39
|
-
result = "" + value;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
} else {
|
|
43
|
-
result = "" + value + " - (Missing JSON.stringify)";
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return result || "";
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function _formatMessage(theEvent: any, errorType: string) {
|
|
51
|
-
let evtMessage = theEvent;
|
|
52
|
-
if (theEvent) {
|
|
53
|
-
if (evtMessage && !isString(evtMessage)) {
|
|
54
|
-
evtMessage = theEvent[strMessage] || theEvent[strDescription] || evtMessage;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// Make sure the message is a string
|
|
58
|
-
if (evtMessage && !isString(evtMessage)) {
|
|
59
|
-
// tslint:disable-next-line: prefer-conditional-expression
|
|
60
|
-
evtMessage = _stringify(evtMessage, true);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (theEvent["filename"]) {
|
|
64
|
-
// Looks like an event object with filename
|
|
65
|
-
evtMessage = evtMessage + " @" + (theEvent["filename"] || "") + ":" + (theEvent["lineno"] || "?") + ":" + (theEvent["colno"] || "?");
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// Automatically add the error type to the message if it does already appear to be present
|
|
70
|
-
if (errorType && errorType !== "String" && errorType !== "Object" && errorType !== "Error" && strIndexOf(evtMessage || "", errorType) === -1) {
|
|
71
|
-
evtMessage = errorType + ": " + evtMessage;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return evtMessage || "";
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function _isExceptionDetailsInternal(value:any): value is IExceptionDetailsInternal {
|
|
78
|
-
try {
|
|
79
|
-
if (isObject(value)) {
|
|
80
|
-
return "hasFullStack" in value && "typeName" in value;
|
|
81
|
-
}
|
|
82
|
-
} catch (e) {
|
|
83
|
-
// This can happen with some native browser objects, but should not happen for the type we are checking for
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
return false;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function _isExceptionInternal(value:any): value is IExceptionInternal {
|
|
90
|
-
try {
|
|
91
|
-
if (isObject(value)) {
|
|
92
|
-
return ("ver" in value && "exceptions" in value && "properties" in value);
|
|
93
|
-
}
|
|
94
|
-
} catch (e) {
|
|
95
|
-
// This can happen with some native browser objects, but should not happen for the type we are checking for
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
return false;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function _isStackDetails(details:any): details is IStackDetails {
|
|
102
|
-
return details && details.src && isString(details.src) && details.obj && isArray(details.obj);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function _convertStackObj(errorStack:string): IStackDetails {
|
|
106
|
-
let src = errorStack || "";
|
|
107
|
-
if (!isString(src)) {
|
|
108
|
-
if (isString(src[strStack])) {
|
|
109
|
-
src = src[strStack];
|
|
110
|
-
} else {
|
|
111
|
-
src = "" + src;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
let items = src.split("\n");
|
|
116
|
-
return {
|
|
117
|
-
src,
|
|
118
|
-
obj: items
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function _getOperaStack(errorMessage:string): IStackDetails {
|
|
123
|
-
var stack: string[] = [];
|
|
124
|
-
var lines = errorMessage.split("\n");
|
|
125
|
-
for (var lp = 0; lp < lines.length; lp++) {
|
|
126
|
-
var entry = lines[lp];
|
|
127
|
-
if (lines[lp + 1]) {
|
|
128
|
-
entry += "@" + lines[lp + 1];
|
|
129
|
-
lp++;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
stack.push(entry);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
return {
|
|
136
|
-
src: errorMessage,
|
|
137
|
-
obj: stack
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
function _getStackFromErrorObj(errorObj:any): IStackDetails {
|
|
142
|
-
let details = null;
|
|
143
|
-
if (errorObj) {
|
|
144
|
-
try {
|
|
145
|
-
/* Using bracket notation is support older browsers (IE 7/8 -- dont remember the version) that throw when using dot
|
|
146
|
-
notation for undefined objects and we don't want to loose the error from being reported */
|
|
147
|
-
if (errorObj[strStack]) {
|
|
148
|
-
// Chrome/Firefox
|
|
149
|
-
details = _convertStackObj(errorObj[strStack]);
|
|
150
|
-
} else if (errorObj[strError] && errorObj[strError][strStack]) {
|
|
151
|
-
// Edge error event provides the stack and error object
|
|
152
|
-
details = _convertStackObj(errorObj[strError][strStack]);
|
|
153
|
-
} else if (errorObj["exception"] && errorObj.exception[strStack]) {
|
|
154
|
-
details = _convertStackObj(errorObj.exception[strStack]);
|
|
155
|
-
} else if (_isStackDetails(errorObj)) {
|
|
156
|
-
details = errorObj;
|
|
157
|
-
} else if (_isStackDetails(errorObj[strStackDetails])) {
|
|
158
|
-
details = errorObj[strStackDetails];
|
|
159
|
-
} else if (window && window["opera"] && errorObj[strMessage]) {
|
|
160
|
-
// Opera
|
|
161
|
-
details = _getOperaStack(errorObj.message);
|
|
162
|
-
} else if (errorObj["reason"] && errorObj.reason[strStack]) {
|
|
163
|
-
// UnhandledPromiseRejection
|
|
164
|
-
details = _convertStackObj(errorObj.reason[strStack]);
|
|
165
|
-
} else if (isString(errorObj)) {
|
|
166
|
-
details = _convertStackObj(errorObj);
|
|
167
|
-
} else {
|
|
168
|
-
let evtMessage = errorObj[strMessage] || errorObj[strDescription] || "";
|
|
169
|
-
|
|
170
|
-
if (isString(errorObj[strErrorSrc])) {
|
|
171
|
-
if (evtMessage) {
|
|
172
|
-
evtMessage += "\n";
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
evtMessage += " from " + errorObj[strErrorSrc];
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
if (evtMessage) {
|
|
179
|
-
details = _convertStackObj(evtMessage);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
} catch (e) {
|
|
183
|
-
// something unexpected happened so to avoid failing to report any error lets swallow the exception
|
|
184
|
-
// and fallback to the callee/caller method
|
|
185
|
-
details = _convertStackObj(e);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
return details || {
|
|
190
|
-
src: "",
|
|
191
|
-
obj: null
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
function _formatStackTrace(stackDetails: IStackDetails) {
|
|
196
|
-
let stack = "";
|
|
197
|
-
|
|
198
|
-
if (stackDetails) {
|
|
199
|
-
if (stackDetails.obj) {
|
|
200
|
-
arrForEach(stackDetails.obj, (entry) => {
|
|
201
|
-
stack += entry + "\n";
|
|
202
|
-
});
|
|
203
|
-
} else {
|
|
204
|
-
stack = stackDetails.src || "";
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
return stack;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
function _parseStack(stack:IStackDetails): _StackFrame[] {
|
|
213
|
-
let parsedStack: _StackFrame[];
|
|
214
|
-
let frames = stack.obj;
|
|
215
|
-
if (frames && frames.length > 0) {
|
|
216
|
-
parsedStack = [];
|
|
217
|
-
let level = 0;
|
|
218
|
-
|
|
219
|
-
let totalSizeInBytes = 0;
|
|
220
|
-
|
|
221
|
-
arrForEach(frames, (frame) => {
|
|
222
|
-
let theFrame = frame.toString();
|
|
223
|
-
if (_StackFrame.regex.test(theFrame)) {
|
|
224
|
-
const parsedFrame = new _StackFrame(theFrame, level++);
|
|
225
|
-
totalSizeInBytes += parsedFrame.sizeInBytes;
|
|
226
|
-
parsedStack.push(parsedFrame);
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
|
|
230
|
-
// DP Constraint - exception parsed stack must be < 32KB
|
|
231
|
-
// remove frames from the middle to meet the threshold
|
|
232
|
-
const exceptionParsedStackThreshold = 32 * 1024;
|
|
233
|
-
if (totalSizeInBytes > exceptionParsedStackThreshold) {
|
|
234
|
-
let left = 0;
|
|
235
|
-
let right = parsedStack.length - 1;
|
|
236
|
-
let size = 0;
|
|
237
|
-
let acceptedLeft = left;
|
|
238
|
-
let acceptedRight = right;
|
|
239
|
-
|
|
240
|
-
while (left < right) {
|
|
241
|
-
// check size
|
|
242
|
-
const lSize = parsedStack[left].sizeInBytes;
|
|
243
|
-
const rSize = parsedStack[right].sizeInBytes;
|
|
244
|
-
size += lSize + rSize;
|
|
245
|
-
|
|
246
|
-
if (size > exceptionParsedStackThreshold) {
|
|
247
|
-
|
|
248
|
-
// remove extra frames from the middle
|
|
249
|
-
const howMany = acceptedRight - acceptedLeft + 1;
|
|
250
|
-
parsedStack.splice(acceptedLeft, howMany);
|
|
251
|
-
break;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
// update pointers
|
|
255
|
-
acceptedLeft = left;
|
|
256
|
-
acceptedRight = right;
|
|
257
|
-
|
|
258
|
-
left++;
|
|
259
|
-
right--;
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
return parsedStack;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
function _getErrorType(errorType: any) {
|
|
268
|
-
// Gets the Error Type by passing the constructor (used to get the true type of native error object).
|
|
269
|
-
let typeName = "";
|
|
270
|
-
if (errorType) {
|
|
271
|
-
typeName = errorType.typeName || errorType.name || "";
|
|
272
|
-
if (!typeName) {
|
|
273
|
-
try {
|
|
274
|
-
var funcNameRegex = /function (.{1,200})\(/;
|
|
275
|
-
var results = (funcNameRegex).exec((errorType).constructor.toString());
|
|
276
|
-
typeName = (results && results.length > 1) ? results[1] : "";
|
|
277
|
-
} catch (e) {
|
|
278
|
-
// eslint-disable-next-line no-empty -- Ignoring any failures as nothing we can do
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
return typeName;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
/**
|
|
287
|
-
* Formats the provided errorObj for display and reporting, it may be a String, Object, integer or undefined depending on the browser.
|
|
288
|
-
* @param errorObj - The supplied errorObj
|
|
289
|
-
*/
|
|
290
|
-
export function _formatErrorCode(errorObj:any) {
|
|
291
|
-
if (errorObj) {
|
|
292
|
-
try {
|
|
293
|
-
if (!isString(errorObj)) {
|
|
294
|
-
var errorType = _getErrorType(errorObj);
|
|
295
|
-
var result = _stringify(errorObj, false);
|
|
296
|
-
if (!result || result === "{}") {
|
|
297
|
-
if (errorObj[strError]) {
|
|
298
|
-
// Looks like an MS Error Event
|
|
299
|
-
errorObj = errorObj[strError];
|
|
300
|
-
errorType = _getErrorType(errorObj);
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
result = _stringify(errorObj, true);
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
if (strIndexOf(result, errorType) !== 0 && errorType !== "String") {
|
|
307
|
-
return errorType + ":" + result;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
return result;
|
|
311
|
-
}
|
|
312
|
-
} catch (e) {
|
|
313
|
-
// eslint-disable-next-line no-empty -- Ignoring any failures as nothing we can do
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
// Fallback to just letting the object format itself into a string
|
|
318
|
-
return "" + (errorObj || "");
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
export class Exception implements IExceptionData, ISerializable {
|
|
322
|
-
|
|
323
|
-
public static envelopeType = "Microsoft.ApplicationInsights.{0}.Exception";
|
|
324
|
-
public static dataType = "ExceptionData";
|
|
325
|
-
|
|
326
|
-
public id?: string;
|
|
327
|
-
public problemGroup?: string;
|
|
328
|
-
public isManual?: boolean;
|
|
329
|
-
|
|
330
|
-
public aiDataContract = {
|
|
331
|
-
ver: FieldType.Required,
|
|
332
|
-
exceptions: FieldType.Required,
|
|
333
|
-
severityLevel: FieldType.Default,
|
|
334
|
-
properties: FieldType.Default,
|
|
335
|
-
measurements: FieldType.Default
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
/**
|
|
339
|
-
* Schema version
|
|
340
|
-
*/
|
|
341
|
-
public ver: number; /* 2 */
|
|
342
|
-
|
|
343
|
-
/**
|
|
344
|
-
* Exception chain - list of inner exceptions.
|
|
345
|
-
*/
|
|
346
|
-
public exceptions: IExceptionDetails[]; /* [] */
|
|
347
|
-
|
|
348
|
-
/**
|
|
349
|
-
* Severity level. Mostly used to indicate exception severity level when it is reported by logging library.
|
|
350
|
-
*/
|
|
351
|
-
public severityLevel: SeverityLevel;
|
|
352
|
-
|
|
353
|
-
/**
|
|
354
|
-
* Collection of custom properties.
|
|
355
|
-
*/
|
|
356
|
-
public properties: any;
|
|
357
|
-
|
|
358
|
-
/**
|
|
359
|
-
* Collection of custom measurements.
|
|
360
|
-
*/
|
|
361
|
-
public measurements: any;
|
|
362
|
-
|
|
363
|
-
/**
|
|
364
|
-
* Constructs a new instance of the ExceptionTelemetry object
|
|
365
|
-
*/
|
|
366
|
-
constructor(logger: IDiagnosticLogger, exception: Error | IExceptionInternal | IAutoExceptionTelemetry, properties?: {[key: string]: any}, measurements?: {[key: string]: number}, severityLevel?: SeverityLevel, id?: string) {
|
|
367
|
-
let _self = this;
|
|
368
|
-
_self.ver = 2; // TODO: handle the CS"4.0" ==> breeze 2 conversion in a better way
|
|
369
|
-
if (!_isExceptionInternal(exception)) {
|
|
370
|
-
if (!properties) {
|
|
371
|
-
properties = { };
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
_self.exceptions = [new _ExceptionDetails(logger, exception, properties)];
|
|
375
|
-
_self.properties = dataSanitizeProperties(logger, properties);
|
|
376
|
-
_self.measurements = dataSanitizeMeasurements(logger, measurements);
|
|
377
|
-
if (severityLevel) {
|
|
378
|
-
_self.severityLevel = severityLevel;
|
|
379
|
-
}
|
|
380
|
-
if (id) {
|
|
381
|
-
_self.id = id;
|
|
382
|
-
}
|
|
383
|
-
} else {
|
|
384
|
-
_self.exceptions = exception.exceptions || [];
|
|
385
|
-
_self.properties = exception.properties;
|
|
386
|
-
_self.measurements = exception.measurements;
|
|
387
|
-
if (exception.severityLevel) {
|
|
388
|
-
_self.severityLevel = exception.severityLevel;
|
|
389
|
-
}
|
|
390
|
-
if (exception.id) {
|
|
391
|
-
_self.id = exception.id;
|
|
392
|
-
}
|
|
393
|
-
if (exception.problemGroup) {
|
|
394
|
-
_self.problemGroup = exception.problemGroup;
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
// bool/int types, use isNullOrUndefined
|
|
398
|
-
if (!isNullOrUndefined(exception.isManual)) {
|
|
399
|
-
_self.isManual = exception.isManual;
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
public static CreateAutoException(
|
|
405
|
-
message: string | Event,
|
|
406
|
-
url: string,
|
|
407
|
-
lineNumber: number,
|
|
408
|
-
columnNumber: number,
|
|
409
|
-
error: any,
|
|
410
|
-
evt?: Event|string,
|
|
411
|
-
stack?: string,
|
|
412
|
-
errorSrc?: string
|
|
413
|
-
): IAutoExceptionTelemetry {
|
|
414
|
-
|
|
415
|
-
let errorType = _getErrorType(error || evt || message);
|
|
416
|
-
|
|
417
|
-
return {
|
|
418
|
-
message: _formatMessage(message, errorType),
|
|
419
|
-
url,
|
|
420
|
-
lineNumber,
|
|
421
|
-
columnNumber,
|
|
422
|
-
error: _formatErrorCode(error || evt || message),
|
|
423
|
-
evt: _formatErrorCode(evt || message),
|
|
424
|
-
typeName: errorType,
|
|
425
|
-
stackDetails: _getStackFromErrorObj(stack || error || evt),
|
|
426
|
-
errorSrc
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
public static CreateFromInterface(logger: IDiagnosticLogger, exception: IExceptionInternal, properties?: any, measurements?: { [key: string]: number }): Exception {
|
|
431
|
-
const exceptions: _ExceptionDetails[] = exception.exceptions
|
|
432
|
-
&& arrMap(exception.exceptions, (ex: IExceptionDetailsInternal) => _ExceptionDetails.CreateFromInterface(logger, ex));
|
|
433
|
-
const exceptionData = new Exception(logger, {...exception, exceptions}, properties, measurements);
|
|
434
|
-
return exceptionData;
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
public toInterface(): IExceptionInternal {
|
|
438
|
-
const { exceptions, properties, measurements, severityLevel, problemGroup, id, isManual } = this;
|
|
439
|
-
|
|
440
|
-
const exceptionDetailsInterface = exceptions instanceof Array
|
|
441
|
-
&& arrMap(exceptions, (exception: _ExceptionDetails) => exception.toInterface())
|
|
442
|
-
|| undefined;
|
|
443
|
-
|
|
444
|
-
return {
|
|
445
|
-
ver: "4.0", // TODO: handle the CS"4.0" ==> breeze 2 conversion in a better way
|
|
446
|
-
exceptions: exceptionDetailsInterface,
|
|
447
|
-
severityLevel,
|
|
448
|
-
properties,
|
|
449
|
-
measurements,
|
|
450
|
-
problemGroup,
|
|
451
|
-
id,
|
|
452
|
-
isManual
|
|
453
|
-
} as IExceptionInternal;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
/**
|
|
457
|
-
* Creates a simple exception with 1 stack frame. Useful for manual constracting of exception.
|
|
458
|
-
*/
|
|
459
|
-
public static CreateSimpleException(message: string, typeName: string, assembly: string, fileName: string,
|
|
460
|
-
details: string, line: number): Exception {
|
|
461
|
-
|
|
462
|
-
return {
|
|
463
|
-
exceptions: [
|
|
464
|
-
{
|
|
465
|
-
hasFullStack: true,
|
|
466
|
-
message,
|
|
467
|
-
stack: details,
|
|
468
|
-
typeName
|
|
469
|
-
} as IExceptionDetails
|
|
470
|
-
]
|
|
471
|
-
} as Exception;
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
public static formatError = _formatErrorCode;
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
export class _ExceptionDetails implements IExceptionDetails, ISerializable {
|
|
478
|
-
|
|
479
|
-
public aiDataContract = {
|
|
480
|
-
id: FieldType.Default,
|
|
481
|
-
outerId: FieldType.Default,
|
|
482
|
-
typeName: FieldType.Required,
|
|
483
|
-
message: FieldType.Required,
|
|
484
|
-
hasFullStack: FieldType.Default,
|
|
485
|
-
stack: FieldType.Default,
|
|
486
|
-
parsedStack: FieldType.Array
|
|
487
|
-
};
|
|
488
|
-
|
|
489
|
-
/**
|
|
490
|
-
* In case exception is nested (outer exception contains inner one), the id and outerId properties are used to represent the nesting.
|
|
491
|
-
*/
|
|
492
|
-
public id: number;
|
|
493
|
-
|
|
494
|
-
/**
|
|
495
|
-
* The value of outerId is a reference to an element in ExceptionDetails that represents the outer exception
|
|
496
|
-
*/
|
|
497
|
-
public outerId: number;
|
|
498
|
-
|
|
499
|
-
/**
|
|
500
|
-
* Exception type name.
|
|
501
|
-
*/
|
|
502
|
-
public typeName: string;
|
|
503
|
-
|
|
504
|
-
/**
|
|
505
|
-
* Exception message.
|
|
506
|
-
*/
|
|
507
|
-
public message: string;
|
|
508
|
-
|
|
509
|
-
/**
|
|
510
|
-
* Indicates if full exception stack is provided in the exception. The stack may be trimmed, such as in the case of a StackOverflow exception.
|
|
511
|
-
*/
|
|
512
|
-
public hasFullStack: boolean;
|
|
513
|
-
|
|
514
|
-
/**
|
|
515
|
-
* Text describing the stack. Either stack or parsedStack should have a value.
|
|
516
|
-
*/
|
|
517
|
-
public stack: string;
|
|
518
|
-
|
|
519
|
-
/**
|
|
520
|
-
* List of stack frames. Either stack or parsedStack should have a value.
|
|
521
|
-
*/
|
|
522
|
-
public parsedStack: IStackFrame[]; /* [] */
|
|
523
|
-
|
|
524
|
-
constructor(logger: IDiagnosticLogger, exception: Error | IExceptionDetailsInternal | IAutoExceptionTelemetry, properties?: {[key: string]: any}) {
|
|
525
|
-
let _self = this;
|
|
526
|
-
if (!_isExceptionDetailsInternal(exception)) {
|
|
527
|
-
let error = exception as any;
|
|
528
|
-
let evt = error && error.evt;
|
|
529
|
-
if (!isError(error)) {
|
|
530
|
-
error = error[strError] || evt || error;
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
_self.typeName = dataSanitizeString(logger, _getErrorType(error)) || strNotSpecified;
|
|
534
|
-
_self.message = dataSanitizeMessage(logger, _formatMessage(exception || error, _self.typeName)) || strNotSpecified;
|
|
535
|
-
const stack = exception[strStackDetails] || _getStackFromErrorObj(exception);
|
|
536
|
-
_self.parsedStack = _parseStack(stack);
|
|
537
|
-
|
|
538
|
-
// after parsedStack is inited, iterate over each frame object, sanitize its assembly field
|
|
539
|
-
if (isArray(_self.parsedStack)){
|
|
540
|
-
arrMap(_self.parsedStack, (frame: _StackFrame) => frame.assembly = dataSanitizeString(logger, frame.assembly));
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
_self[strStack] = dataSanitizeException(logger, _formatStackTrace(stack));
|
|
544
|
-
_self.hasFullStack = isArray(_self.parsedStack) && _self.parsedStack.length > 0;
|
|
545
|
-
|
|
546
|
-
if (properties) {
|
|
547
|
-
properties.typeName = properties.typeName || _self.typeName;
|
|
548
|
-
}
|
|
549
|
-
} else {
|
|
550
|
-
_self.typeName = exception.typeName;
|
|
551
|
-
_self.message = exception.message;
|
|
552
|
-
_self[strStack] = exception[strStack];
|
|
553
|
-
_self.parsedStack = exception.parsedStack || [];
|
|
554
|
-
_self.hasFullStack = exception.hasFullStack;
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
public toInterface(): IExceptionDetailsInternal {
|
|
559
|
-
let _self = this;
|
|
560
|
-
const parsedStack = _self.parsedStack instanceof Array
|
|
561
|
-
&& arrMap(_self.parsedStack, (frame: _StackFrame) => frame.toInterface());
|
|
562
|
-
|
|
563
|
-
const exceptionDetailsInterface: IExceptionDetailsInternal = {
|
|
564
|
-
id: _self.id,
|
|
565
|
-
outerId: _self.outerId,
|
|
566
|
-
typeName: _self.typeName,
|
|
567
|
-
message: _self.message,
|
|
568
|
-
hasFullStack: _self.hasFullStack,
|
|
569
|
-
stack: _self[strStack],
|
|
570
|
-
parsedStack: parsedStack || undefined
|
|
571
|
-
};
|
|
572
|
-
|
|
573
|
-
return exceptionDetailsInterface;
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
public static CreateFromInterface(logger:IDiagnosticLogger, exception: IExceptionDetailsInternal): _ExceptionDetails {
|
|
577
|
-
const parsedStack = (exception.parsedStack instanceof Array
|
|
578
|
-
&& arrMap(exception.parsedStack, frame => _StackFrame.CreateFromInterface(frame)))
|
|
579
|
-
|| exception.parsedStack;
|
|
580
|
-
|
|
581
|
-
const exceptionDetails = new _ExceptionDetails(logger, {...exception, parsedStack});
|
|
582
|
-
|
|
583
|
-
return exceptionDetails;
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
export class _StackFrame implements IStackFrame, ISerializable {
|
|
588
|
-
|
|
589
|
-
// regex to match stack frames from ie/chrome/ff
|
|
590
|
-
// methodName=$2, fileName=$4, lineNo=$5, column=$6
|
|
591
|
-
public static regex = /^([\s]+at)?[\s]{0,50}([^\@\()]+?)[\s]{0,50}(\@|\()([^\(\n]+):([0-9]+):([0-9]+)(\)?)$/;
|
|
592
|
-
public static baseSize = 58; // '{"method":"","level":,"assembly":"","fileName":"","line":}'.length
|
|
593
|
-
|
|
594
|
-
public sizeInBytes: number; /* 0 */
|
|
595
|
-
|
|
596
|
-
public aiDataContract = {
|
|
597
|
-
level: FieldType.Required,
|
|
598
|
-
method: FieldType.Required,
|
|
599
|
-
assembly: FieldType.Default,
|
|
600
|
-
fileName: FieldType.Default,
|
|
601
|
-
line: FieldType.Default
|
|
602
|
-
};
|
|
603
|
-
|
|
604
|
-
/**
|
|
605
|
-
* Level in the call stack. For the long stacks SDK may not report every function in a call stack.
|
|
606
|
-
*/
|
|
607
|
-
public level: number;
|
|
608
|
-
|
|
609
|
-
/**
|
|
610
|
-
* Method name.
|
|
611
|
-
*/
|
|
612
|
-
public method: string;
|
|
613
|
-
|
|
614
|
-
/**
|
|
615
|
-
* Name of the assembly (dll, jar, etc.) containing this function.
|
|
616
|
-
*/
|
|
617
|
-
public assembly: string;
|
|
618
|
-
|
|
619
|
-
/**
|
|
620
|
-
* File name or URL of the method implementation.
|
|
621
|
-
*/
|
|
622
|
-
public fileName: string;
|
|
623
|
-
|
|
624
|
-
/**
|
|
625
|
-
* Line number of the code implementation.
|
|
626
|
-
*/
|
|
627
|
-
public line: number;
|
|
628
|
-
|
|
629
|
-
constructor(sourceFrame: string | IExceptionStackFrameInternal, level: number) {
|
|
630
|
-
let _self = this;
|
|
631
|
-
_self.sizeInBytes = 0;
|
|
632
|
-
|
|
633
|
-
// Not converting this to isString() as typescript uses this logic to "understand" the different
|
|
634
|
-
// types for the 2 different code paths
|
|
635
|
-
if (typeof sourceFrame === "string") {
|
|
636
|
-
const frame: string = sourceFrame;
|
|
637
|
-
_self.level = level;
|
|
638
|
-
_self.method = NoMethod;
|
|
639
|
-
_self.assembly = strTrim(frame);
|
|
640
|
-
_self.fileName = "";
|
|
641
|
-
_self.line = 0;
|
|
642
|
-
const matches = frame.match(_StackFrame.regex);
|
|
643
|
-
if (matches && matches.length >= 5) {
|
|
644
|
-
_self.method = strTrim(matches[2]) || _self.method;
|
|
645
|
-
_self.fileName = strTrim(matches[4]);
|
|
646
|
-
_self.line = parseInt(matches[5]) || 0;
|
|
647
|
-
}
|
|
648
|
-
} else {
|
|
649
|
-
_self.level = sourceFrame.level;
|
|
650
|
-
_self.method = sourceFrame.method;
|
|
651
|
-
_self.assembly = sourceFrame.assembly;
|
|
652
|
-
_self.fileName = sourceFrame.fileName;
|
|
653
|
-
_self.line = sourceFrame.line;
|
|
654
|
-
_self.sizeInBytes = 0;
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
_self.sizeInBytes += _self.method.length;
|
|
658
|
-
_self.sizeInBytes += _self.fileName.length;
|
|
659
|
-
_self.sizeInBytes += _self.assembly.length;
|
|
660
|
-
|
|
661
|
-
// todo: these might need to be removed depending on how the back-end settles on their size calculation
|
|
662
|
-
_self.sizeInBytes += _StackFrame.baseSize;
|
|
663
|
-
_self.sizeInBytes += _self.level.toString().length;
|
|
664
|
-
_self.sizeInBytes += _self.line.toString().length;
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
public static CreateFromInterface(frame: IExceptionStackFrameInternal) {
|
|
668
|
-
return new _StackFrame(frame, null /* level is available in frame interface */);
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
public toInterface() {
|
|
672
|
-
let _self = this;
|
|
673
|
-
return {
|
|
674
|
-
level: _self.level,
|
|
675
|
-
method: _self.method,
|
|
676
|
-
assembly: _self.assembly,
|
|
677
|
-
fileName: _self.fileName,
|
|
678
|
-
line: _self.line
|
|
679
|
-
};
|
|
680
|
-
}
|
|
681
|
-
}
|