@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,223 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
IDiagnosticLogger, _eInternalMessageId, _throwInternal, dumpObj, eLoggingSeverity, getExceptionName, getGlobal, getGlobalInst,
|
|
6
|
-
isNullOrUndefined, objForEachKey
|
|
7
|
-
} from "@microsoft/applicationinsights-core-js";
|
|
8
|
-
import { StorageType } from "./Enums";
|
|
9
|
-
|
|
10
|
-
let _canUseLocalStorage: boolean = undefined;
|
|
11
|
-
let _canUseSessionStorage: boolean = undefined;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Gets the localStorage object if available
|
|
15
|
-
* @return {Storage} - Returns the storage object if available else returns null
|
|
16
|
-
*/
|
|
17
|
-
function _getLocalStorageObject(): Storage {
|
|
18
|
-
if (utlCanUseLocalStorage()) {
|
|
19
|
-
return _getVerifiedStorageObject(StorageType.LocalStorage);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Tests storage object (localStorage or sessionStorage) to verify that it is usable
|
|
27
|
-
* More details here: https://mathiasbynens.be/notes/localstorage-pattern
|
|
28
|
-
* @param storageType - Type of storage
|
|
29
|
-
* @return {Storage} Returns storage object verified that it is usable
|
|
30
|
-
*/
|
|
31
|
-
function _getVerifiedStorageObject(storageType: StorageType): Storage {
|
|
32
|
-
try {
|
|
33
|
-
if (isNullOrUndefined(getGlobal())) {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
let uid = (new Date).toString();
|
|
37
|
-
let storage: Storage = getGlobalInst(storageType === StorageType.LocalStorage ? "localStorage" : "sessionStorage");
|
|
38
|
-
storage.setItem(uid, uid);
|
|
39
|
-
let fail = storage.getItem(uid) !== uid;
|
|
40
|
-
storage.removeItem(uid);
|
|
41
|
-
if (!fail) {
|
|
42
|
-
return storage;
|
|
43
|
-
}
|
|
44
|
-
} catch (exception) {
|
|
45
|
-
// eslint-disable-next-line no-empty
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Gets the sessionStorage object if available
|
|
53
|
-
* @return {Storage} - Returns the storage object if available else returns null
|
|
54
|
-
*/
|
|
55
|
-
function _getSessionStorageObject(): Storage {
|
|
56
|
-
if (utlCanUseSessionStorage()) {
|
|
57
|
-
return _getVerifiedStorageObject(StorageType.SessionStorage);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return null;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Disables the global SDK usage of local or session storage if available
|
|
65
|
-
*/
|
|
66
|
-
export function utlDisableStorage() {
|
|
67
|
-
_canUseLocalStorage = false;
|
|
68
|
-
_canUseSessionStorage = false;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Re-enables the global SDK usage of local or session storage if available
|
|
73
|
-
*/
|
|
74
|
-
export function utlEnableStorage() {
|
|
75
|
-
_canUseLocalStorage = utlCanUseLocalStorage(true);
|
|
76
|
-
_canUseSessionStorage = utlCanUseSessionStorage(true);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Returns whether LocalStorage can be used, if the reset parameter is passed a true this will override
|
|
81
|
-
* any previous disable calls.
|
|
82
|
-
* @param reset - Should the usage be reset and determined only based on whether LocalStorage is available
|
|
83
|
-
*/
|
|
84
|
-
export function utlCanUseLocalStorage(reset?: boolean): boolean {
|
|
85
|
-
if (reset || _canUseLocalStorage === undefined) {
|
|
86
|
-
_canUseLocalStorage = !!_getVerifiedStorageObject(StorageType.LocalStorage);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return _canUseLocalStorage;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export function utlGetLocalStorage(logger: IDiagnosticLogger, name: string): string {
|
|
93
|
-
const storage = _getLocalStorageObject();
|
|
94
|
-
if (storage !== null) {
|
|
95
|
-
try {
|
|
96
|
-
return storage.getItem(name);
|
|
97
|
-
} catch (e) {
|
|
98
|
-
_canUseLocalStorage = false;
|
|
99
|
-
|
|
100
|
-
_throwInternal(logger,
|
|
101
|
-
eLoggingSeverity.WARNING,
|
|
102
|
-
_eInternalMessageId.BrowserCannotReadLocalStorage,
|
|
103
|
-
"Browser failed read of local storage. " + getExceptionName(e),
|
|
104
|
-
{ exception: dumpObj(e) });
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
return null;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export function utlSetLocalStorage(logger: IDiagnosticLogger, name: string, data: string): boolean {
|
|
111
|
-
const storage = _getLocalStorageObject();
|
|
112
|
-
if (storage !== null) {
|
|
113
|
-
try {
|
|
114
|
-
storage.setItem(name, data);
|
|
115
|
-
return true;
|
|
116
|
-
} catch (e) {
|
|
117
|
-
_canUseLocalStorage = false;
|
|
118
|
-
|
|
119
|
-
_throwInternal(logger,
|
|
120
|
-
eLoggingSeverity.WARNING,
|
|
121
|
-
_eInternalMessageId.BrowserCannotWriteLocalStorage,
|
|
122
|
-
"Browser failed write to local storage. " + getExceptionName(e),
|
|
123
|
-
{ exception: dumpObj(e) });
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
return false;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export function utlRemoveStorage(logger: IDiagnosticLogger, name: string): boolean {
|
|
130
|
-
const storage = _getLocalStorageObject();
|
|
131
|
-
if (storage !== null) {
|
|
132
|
-
try {
|
|
133
|
-
storage.removeItem(name);
|
|
134
|
-
return true;
|
|
135
|
-
} catch (e) {
|
|
136
|
-
_canUseLocalStorage = false;
|
|
137
|
-
|
|
138
|
-
_throwInternal(logger,
|
|
139
|
-
eLoggingSeverity.WARNING,
|
|
140
|
-
_eInternalMessageId.BrowserFailedRemovalFromLocalStorage,
|
|
141
|
-
"Browser failed removal of local storage item. " + getExceptionName(e),
|
|
142
|
-
{ exception: dumpObj(e) });
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
return false;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
export function utlCanUseSessionStorage(reset?: boolean): boolean {
|
|
149
|
-
if (reset || _canUseSessionStorage === undefined) {
|
|
150
|
-
_canUseSessionStorage = !!_getVerifiedStorageObject(StorageType.SessionStorage);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
return _canUseSessionStorage;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
export function utlGetSessionStorageKeys(): string[] {
|
|
157
|
-
const keys: string[] = [];
|
|
158
|
-
|
|
159
|
-
if (utlCanUseSessionStorage()) {
|
|
160
|
-
objForEachKey(getGlobalInst<any>("sessionStorage"), (key) => {
|
|
161
|
-
keys.push(key);
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
return keys;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
export function utlGetSessionStorage(logger: IDiagnosticLogger, name: string): string {
|
|
169
|
-
const storage = _getSessionStorageObject();
|
|
170
|
-
if (storage !== null) {
|
|
171
|
-
try {
|
|
172
|
-
return storage.getItem(name);
|
|
173
|
-
} catch (e) {
|
|
174
|
-
_canUseSessionStorage = false;
|
|
175
|
-
|
|
176
|
-
_throwInternal(logger,
|
|
177
|
-
eLoggingSeverity.WARNING,
|
|
178
|
-
_eInternalMessageId.BrowserCannotReadSessionStorage,
|
|
179
|
-
"Browser failed read of session storage. " + getExceptionName(e),
|
|
180
|
-
{ exception: dumpObj(e) });
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
return null;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
export function utlSetSessionStorage(logger: IDiagnosticLogger, name: string, data: string): boolean {
|
|
187
|
-
const storage = _getSessionStorageObject();
|
|
188
|
-
if (storage !== null) {
|
|
189
|
-
try {
|
|
190
|
-
storage.setItem(name, data);
|
|
191
|
-
return true;
|
|
192
|
-
} catch (e) {
|
|
193
|
-
_canUseSessionStorage = false;
|
|
194
|
-
|
|
195
|
-
_throwInternal(logger,
|
|
196
|
-
eLoggingSeverity.WARNING,
|
|
197
|
-
_eInternalMessageId.BrowserCannotWriteSessionStorage,
|
|
198
|
-
"Browser failed write to session storage. " + getExceptionName(e),
|
|
199
|
-
{ exception: dumpObj(e) });
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
return false;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
export function utlRemoveSessionStorage(logger: IDiagnosticLogger, name: string): boolean {
|
|
206
|
-
const storage = _getSessionStorageObject();
|
|
207
|
-
if (storage !== null) {
|
|
208
|
-
try {
|
|
209
|
-
storage.removeItem(name);
|
|
210
|
-
return true;
|
|
211
|
-
} catch (e) {
|
|
212
|
-
_canUseSessionStorage = false;
|
|
213
|
-
|
|
214
|
-
_throwInternal(logger,
|
|
215
|
-
eLoggingSeverity.WARNING,
|
|
216
|
-
_eInternalMessageId.BrowserFailedRemovalFromSessionStorage,
|
|
217
|
-
"Browser failed removal of session storage item. " + getExceptionName(e),
|
|
218
|
-
{ exception: dumpObj(e) });
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
return false;
|
|
223
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
|
|
4
|
-
import { IData } from "../../Interfaces/Contracts/IData";
|
|
5
|
-
import { ISerializable } from "../../Interfaces/Telemetry/ISerializable";
|
|
6
|
-
import { FieldType } from "../../Enums";
|
|
7
|
-
|
|
8
|
-
export class Data<TDomain> implements IData<TDomain>, ISerializable {
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* The data contract for serializing this object.
|
|
12
|
-
*/
|
|
13
|
-
public aiDataContract = {
|
|
14
|
-
baseType: FieldType.Required,
|
|
15
|
-
baseData: FieldType.Required
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Name of item (B section) if any. If telemetry data is derived straight from this, this should be null.
|
|
20
|
-
*/
|
|
21
|
-
public baseType: string;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Container for data item (B section).
|
|
25
|
-
*/
|
|
26
|
-
public baseData: TDomain;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Constructs a new instance of telemetry data.
|
|
30
|
-
*/
|
|
31
|
-
constructor(baseType: string, data: TDomain) {
|
|
32
|
-
this.baseType = baseType;
|
|
33
|
-
this.baseData = data;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
|
|
4
|
-
import { FieldType } from "../../Enums";
|
|
5
|
-
import { DataPointType } from "../../Interfaces/Contracts/DataPointType";
|
|
6
|
-
import { IDataPoint } from "../../Interfaces/Contracts/IDataPoint";
|
|
7
|
-
import { ISerializable } from "../../Interfaces/Telemetry/ISerializable";
|
|
8
|
-
|
|
9
|
-
export class DataPoint implements IDataPoint, ISerializable {
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* The data contract for serializing this object.
|
|
13
|
-
*/
|
|
14
|
-
public aiDataContract = {
|
|
15
|
-
name: FieldType.Required,
|
|
16
|
-
kind: FieldType.Default,
|
|
17
|
-
value: FieldType.Required,
|
|
18
|
-
count: FieldType.Default,
|
|
19
|
-
min: FieldType.Default,
|
|
20
|
-
max: FieldType.Default,
|
|
21
|
-
stdDev: FieldType.Default
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Name of the metric.
|
|
26
|
-
*/
|
|
27
|
-
public name: string;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Metric type. Single measurement or the aggregated value.
|
|
31
|
-
*/
|
|
32
|
-
public kind: DataPointType = DataPointType.Measurement;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Single value for measurement. Sum of individual measurements for the aggregation.
|
|
36
|
-
*/
|
|
37
|
-
public value: number;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Metric weight of the aggregated metric. Should not be set for a measurement.
|
|
41
|
-
*/
|
|
42
|
-
public count: number;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Minimum value of the aggregated metric. Should not be set for a measurement.
|
|
46
|
-
*/
|
|
47
|
-
public min: number;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Maximum value of the aggregated metric. Should not be set for a measurement.
|
|
51
|
-
*/
|
|
52
|
-
public max: number;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Standard deviation of the aggregated metric. Should not be set for a measurement.
|
|
56
|
-
*/
|
|
57
|
-
public stdDev: number;
|
|
58
|
-
}
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
IDiagnosticLogger, _eInternalMessageId, _throwInternal, eLoggingSeverity, getJSON, hasJSON, isObject, objForEachKey, strTrim
|
|
6
|
-
} from "@microsoft/applicationinsights-core-js";
|
|
7
|
-
|
|
8
|
-
export const enum DataSanitizerValues {
|
|
9
|
-
/**
|
|
10
|
-
* Max length allowed for custom names.
|
|
11
|
-
*/
|
|
12
|
-
MAX_NAME_LENGTH = 150,
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Max length allowed for Id field in page views.
|
|
16
|
-
*/
|
|
17
|
-
MAX_ID_LENGTH = 128,
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Max length allowed for custom values.
|
|
21
|
-
*/
|
|
22
|
-
MAX_PROPERTY_LENGTH = 8192,
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Max length allowed for names
|
|
26
|
-
*/
|
|
27
|
-
MAX_STRING_LENGTH = 1024,
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Max length allowed for url.
|
|
31
|
-
*/
|
|
32
|
-
MAX_URL_LENGTH = 2048,
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Max length allowed for messages.
|
|
36
|
-
*/
|
|
37
|
-
MAX_MESSAGE_LENGTH = 32768,
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Max length allowed for exceptions.
|
|
41
|
-
*/
|
|
42
|
-
MAX_EXCEPTION_LENGTH = 32768
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export function dataSanitizeKeyAndAddUniqueness(logger: IDiagnosticLogger, key: any, map: any) {
|
|
46
|
-
const origLength = key.length;
|
|
47
|
-
let field = dataSanitizeKey(logger, key);
|
|
48
|
-
|
|
49
|
-
// validation truncated the length. We need to add uniqueness
|
|
50
|
-
if (field.length !== origLength) {
|
|
51
|
-
let i = 0;
|
|
52
|
-
let uniqueField = field;
|
|
53
|
-
while (map[uniqueField] !== undefined) {
|
|
54
|
-
i++;
|
|
55
|
-
uniqueField = field.substring(0, DataSanitizerValues.MAX_NAME_LENGTH - 3) + dsPadNumber(i);
|
|
56
|
-
}
|
|
57
|
-
field = uniqueField;
|
|
58
|
-
}
|
|
59
|
-
return field;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export function dataSanitizeKey(logger: IDiagnosticLogger, name: any) {
|
|
63
|
-
let nameTrunc: String;
|
|
64
|
-
if (name) {
|
|
65
|
-
// Remove any leading or trailing whitespace
|
|
66
|
-
name = strTrim(name.toString());
|
|
67
|
-
|
|
68
|
-
// truncate the string to 150 chars
|
|
69
|
-
if (name.length > DataSanitizerValues.MAX_NAME_LENGTH) {
|
|
70
|
-
nameTrunc = name.substring(0, DataSanitizerValues.MAX_NAME_LENGTH);
|
|
71
|
-
_throwInternal(logger,
|
|
72
|
-
eLoggingSeverity.WARNING,
|
|
73
|
-
_eInternalMessageId.NameTooLong,
|
|
74
|
-
"name is too long. It has been truncated to " + DataSanitizerValues.MAX_NAME_LENGTH + " characters.",
|
|
75
|
-
{ name }, true);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return nameTrunc || name;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export function dataSanitizeString(logger: IDiagnosticLogger, value: any, maxLength: number = DataSanitizerValues.MAX_STRING_LENGTH) {
|
|
83
|
-
let valueTrunc : String;
|
|
84
|
-
if (value) {
|
|
85
|
-
maxLength = maxLength ? maxLength : DataSanitizerValues.MAX_STRING_LENGTH; // in case default parameters dont work
|
|
86
|
-
value = strTrim(value.toString());
|
|
87
|
-
if (value.length > maxLength) {
|
|
88
|
-
valueTrunc = value.substring(0, maxLength);
|
|
89
|
-
_throwInternal(logger,
|
|
90
|
-
eLoggingSeverity.WARNING,
|
|
91
|
-
_eInternalMessageId.StringValueTooLong,
|
|
92
|
-
"string value is too long. It has been truncated to " + maxLength + " characters.",
|
|
93
|
-
{ value }, true);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
return valueTrunc || value;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export function dataSanitizeUrl(logger: IDiagnosticLogger, url: any) {
|
|
101
|
-
return dataSanitizeInput(logger, url, DataSanitizerValues.MAX_URL_LENGTH, _eInternalMessageId.UrlTooLong);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export function dataSanitizeMessage(logger: IDiagnosticLogger, message: any) {
|
|
105
|
-
let messageTrunc : String;
|
|
106
|
-
if (message) {
|
|
107
|
-
if (message.length > DataSanitizerValues.MAX_MESSAGE_LENGTH) {
|
|
108
|
-
messageTrunc = message.substring(0, DataSanitizerValues.MAX_MESSAGE_LENGTH);
|
|
109
|
-
_throwInternal(logger,
|
|
110
|
-
eLoggingSeverity.WARNING, _eInternalMessageId.MessageTruncated,
|
|
111
|
-
"message is too long, it has been truncated to " + DataSanitizerValues.MAX_MESSAGE_LENGTH + " characters.",
|
|
112
|
-
{ message },
|
|
113
|
-
true);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
return messageTrunc || message;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export function dataSanitizeException(logger: IDiagnosticLogger, exception: any) {
|
|
121
|
-
let exceptionTrunc : String;
|
|
122
|
-
if (exception) {
|
|
123
|
-
// Make surte its a string
|
|
124
|
-
let value:string = "" + exception;
|
|
125
|
-
if (value.length > DataSanitizerValues.MAX_EXCEPTION_LENGTH) {
|
|
126
|
-
exceptionTrunc = value.substring(0, DataSanitizerValues.MAX_EXCEPTION_LENGTH);
|
|
127
|
-
_throwInternal(logger,
|
|
128
|
-
eLoggingSeverity.WARNING, _eInternalMessageId.ExceptionTruncated, "exception is too long, it has been truncated to " + DataSanitizerValues.MAX_EXCEPTION_LENGTH + " characters.",
|
|
129
|
-
{ exception }, true);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
return exceptionTrunc || exception;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export function dataSanitizeProperties(logger: IDiagnosticLogger, properties: any) {
|
|
137
|
-
if (properties) {
|
|
138
|
-
const tempProps = {};
|
|
139
|
-
objForEachKey(properties, (prop, value) => {
|
|
140
|
-
if (isObject(value) && hasJSON()) {
|
|
141
|
-
// Stringify any part C properties
|
|
142
|
-
try {
|
|
143
|
-
value = getJSON().stringify(value);
|
|
144
|
-
} catch (e) {
|
|
145
|
-
_throwInternal(logger,eLoggingSeverity.WARNING, _eInternalMessageId.CannotSerializeObjectNonSerializable, "custom property is not valid", { exception: e}, true);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
value = dataSanitizeString(logger, value, DataSanitizerValues.MAX_PROPERTY_LENGTH);
|
|
149
|
-
prop = dataSanitizeKeyAndAddUniqueness(logger, prop, tempProps);
|
|
150
|
-
tempProps[prop] = value;
|
|
151
|
-
});
|
|
152
|
-
properties = tempProps;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
return properties;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
export function dataSanitizeMeasurements(logger: IDiagnosticLogger, measurements: any) {
|
|
159
|
-
if (measurements) {
|
|
160
|
-
const tempMeasurements = {};
|
|
161
|
-
objForEachKey(measurements, (measure, value) => {
|
|
162
|
-
measure = dataSanitizeKeyAndAddUniqueness(logger, measure, tempMeasurements);
|
|
163
|
-
tempMeasurements[measure] = value;
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
measurements = tempMeasurements;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
return measurements;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
export function dataSanitizeId(logger: IDiagnosticLogger, id: string): string {
|
|
173
|
-
return id ? dataSanitizeInput(logger, id, DataSanitizerValues.MAX_ID_LENGTH, _eInternalMessageId.IdTooLong).toString() : id;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
export function dataSanitizeInput(logger: IDiagnosticLogger, input: any, maxLength: number, _msgId: _eInternalMessageId) {
|
|
177
|
-
let inputTrunc : String;
|
|
178
|
-
if (input) {
|
|
179
|
-
input = strTrim(input.toString());
|
|
180
|
-
if (input.length > maxLength) {
|
|
181
|
-
inputTrunc = input.substring(0, maxLength);
|
|
182
|
-
_throwInternal(logger,
|
|
183
|
-
eLoggingSeverity.WARNING,
|
|
184
|
-
_msgId,
|
|
185
|
-
"input is too long, it has been truncated to " + maxLength + " characters.",
|
|
186
|
-
{ data: input },
|
|
187
|
-
true);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
return inputTrunc || input;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
export function dsPadNumber(num: number) {
|
|
195
|
-
const s = "00" + num;
|
|
196
|
-
return s.substr(s.length - 3);
|
|
197
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
|
|
4
|
-
import { IDiagnosticLogger, toISOString } from "@microsoft/applicationinsights-core-js";
|
|
5
|
-
import { strNotSpecified } from "../../Constants";
|
|
6
|
-
import { FieldType } from "../../Enums";
|
|
7
|
-
import { IBase } from "../../Interfaces/Contracts/IBase";
|
|
8
|
-
import { IEnvelope } from "../../Interfaces/Telemetry/IEnvelope";
|
|
9
|
-
import { dataSanitizeString } from "./DataSanitizer";
|
|
10
|
-
|
|
11
|
-
export class Envelope implements IEnvelope {
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* The data contract for serializing this object.
|
|
15
|
-
*/
|
|
16
|
-
public aiDataContract: any;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Envelope version. For internal use only. By assigning this the default, it will not be serialized within the payload unless changed to a value other than #1.
|
|
20
|
-
*/
|
|
21
|
-
public ver: number; /* 1 */
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Type name of telemetry data item.
|
|
25
|
-
*/
|
|
26
|
-
public name: string;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Event date time when telemetry item was created. This is the wall clock time on the client when the event was generated. There is no guarantee that the client's time is accurate. This field must be formatted in UTC ISO 8601 format, with a trailing 'Z' character, as described publicly on https://en.wikipedia.org/wiki/ISO_8601#UTC. Note: the number of decimal seconds digits provided are variable (and unspecified). Consumers should handle this, i.e. managed code consumers should not use format 'O' for parsing as it specifies a fixed length. Example: 2009-06-15T13:45:30.0000000Z.
|
|
30
|
-
*/
|
|
31
|
-
public time: string;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Sampling rate used in application. This telemetry item represents 1 / sampleRate actual telemetry items.
|
|
35
|
-
*/
|
|
36
|
-
public sampleRate: number; /* 100.0 */
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Sequence field used to track absolute order of uploaded events.
|
|
40
|
-
*/
|
|
41
|
-
public seq: string;
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* The application's instrumentation key. The key is typically represented as a GUID, but there are cases when it is not a guid. No code should rely on iKey being a GUID. Instrumentation key is case insensitive.
|
|
45
|
-
*/
|
|
46
|
-
public iKey: string;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Key/value collection of context properties. See ContextTagKeys for information on available properties.
|
|
50
|
-
*/
|
|
51
|
-
public tags: any; /* {} */
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Telemetry data item.
|
|
55
|
-
*/
|
|
56
|
-
public data: IBase;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Constructs a new instance of telemetry data.
|
|
60
|
-
*/
|
|
61
|
-
constructor(logger: IDiagnosticLogger, data: IBase, name: string) {
|
|
62
|
-
let _self = this;
|
|
63
|
-
_self.ver = 1;
|
|
64
|
-
_self.sampleRate = 100.0;
|
|
65
|
-
_self.tags = {};
|
|
66
|
-
_self.name = dataSanitizeString(logger, name) || strNotSpecified;
|
|
67
|
-
_self.data = data;
|
|
68
|
-
_self.time = toISOString(new Date());
|
|
69
|
-
|
|
70
|
-
_self.aiDataContract = {
|
|
71
|
-
time: FieldType.Required,
|
|
72
|
-
iKey: FieldType.Required,
|
|
73
|
-
name: FieldType.Required,
|
|
74
|
-
sampleRate: () => {
|
|
75
|
-
return (this.sampleRate === 100) ? FieldType.Hidden : FieldType.Required;
|
|
76
|
-
},
|
|
77
|
-
tags: FieldType.Required,
|
|
78
|
-
data: FieldType.Required
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
}
|
package/src/Telemetry/Event.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
|
|
4
|
-
import { IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
|
|
5
|
-
import { strNotSpecified } from "../Constants";
|
|
6
|
-
import { FieldType } from "../Enums";
|
|
7
|
-
import { IEventData } from "../Interfaces/Contracts/IEventData";
|
|
8
|
-
import { ISerializable } from "../Interfaces/Telemetry/ISerializable";
|
|
9
|
-
import { dataSanitizeMeasurements, dataSanitizeProperties, dataSanitizeString } from "./Common/DataSanitizer";
|
|
10
|
-
|
|
11
|
-
export class Event implements IEventData, ISerializable {
|
|
12
|
-
public static envelopeType = "Microsoft.ApplicationInsights.{0}.Event";
|
|
13
|
-
public static dataType = "EventData";
|
|
14
|
-
|
|
15
|
-
public aiDataContract = {
|
|
16
|
-
ver: FieldType.Required,
|
|
17
|
-
name: FieldType.Required,
|
|
18
|
-
properties: FieldType.Default,
|
|
19
|
-
measurements: FieldType.Default
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Schema version
|
|
24
|
-
*/
|
|
25
|
-
public ver: number; /* 2 */
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Event name. Keep it low cardinality to allow proper grouping and useful metrics.
|
|
29
|
-
*/
|
|
30
|
-
public name: string;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Collection of custom properties.
|
|
34
|
-
*/
|
|
35
|
-
public properties: any; /* {} */
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Collection of custom measurements.
|
|
39
|
-
*/
|
|
40
|
-
public measurements: any; /* {} */
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Constructs a new instance of the EventTelemetry object
|
|
44
|
-
*/
|
|
45
|
-
constructor(logger: IDiagnosticLogger, name: string, properties?: any, measurements?: any) {
|
|
46
|
-
let _self = this;
|
|
47
|
-
_self.ver = 2;
|
|
48
|
-
_self.name = dataSanitizeString(logger, name) || strNotSpecified;
|
|
49
|
-
_self.properties = dataSanitizeProperties(logger, properties);
|
|
50
|
-
_self.measurements = dataSanitizeMeasurements(logger, measurements);
|
|
51
|
-
}
|
|
52
|
-
}
|