@microsoft/applicationinsights-analytics-js 2.7.1-nightly.202110-07 → 2.7.1-nightly.202110-16
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/applicationinsights-analytics-js.integrity.json +9 -9
- package/browser/applicationinsights-analytics-js.js +45 -36
- package/browser/applicationinsights-analytics-js.js.map +1 -1
- package/browser/applicationinsights-analytics-js.min.js +2 -2
- package/browser/applicationinsights-analytics-js.min.js.map +1 -1
- package/dist/applicationinsights-analytics-js.api.json +1 -1
- package/dist/applicationinsights-analytics-js.d.ts +1 -1
- package/dist/applicationinsights-analytics-js.js +45 -36
- package/dist/applicationinsights-analytics-js.js.map +1 -1
- package/dist/applicationinsights-analytics-js.min.js +2 -2
- package/dist/applicationinsights-analytics-js.min.js.map +1 -1
- package/dist/applicationinsights-analytics-js.rollup.d.ts +1 -1
- package/dist-esm/JavaScriptSDK/ApplicationInsights.js +7 -6
- package/dist-esm/JavaScriptSDK/ApplicationInsights.js.map +1 -1
- package/dist-esm/JavaScriptSDK/Telemetry/PageViewManager.js +3 -3
- package/dist-esm/JavaScriptSDK/Telemetry/PageViewManager.js.map +1 -1
- package/dist-esm/JavaScriptSDK/Telemetry/PageViewPerformanceManager.js +4 -4
- package/dist-esm/JavaScriptSDK/Telemetry/PageViewPerformanceManager.js.map +1 -1
- package/dist-esm/JavaScriptSDK/Telemetry/PageVisitTimeManager.js +3 -3
- package/dist-esm/JavaScriptSDK/Telemetry/PageVisitTimeManager.js.map +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryConfig.js +1 -1
- package/dist-esm/applicationinsights-analytics-js.js +1 -1
- package/package.json +5 -6
- package/src/JavaScriptSDK/ApplicationInsights.ts +6 -5
- package/src/JavaScriptSDK/Telemetry/PageViewManager.ts +3 -3
- package/src/JavaScriptSDK/Telemetry/PageViewPerformanceManager.ts +3 -3
- package/src/JavaScriptSDK/Telemetry/PageVisitTimeManager.ts +2 -2
- package/types/JavaScriptSDK/ApplicationInsights.d.ts +1 -1
- package/types/JavaScriptSDK/Telemetry/PageViewManager.d.ts +3 -3
- package/types/JavaScriptSDK/Telemetry/PageViewPerformanceManager.d.ts +2 -2
- package/types/JavaScriptSDK/Telemetry/PageVisitTimeManager.d.ts +1 -1
- package/types/tsdoc-metadata.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Microsoft Application Insights JavaScript SDK - Web Analytics, 2.7.1-nightly.202110-
|
|
2
|
+
* Microsoft Application Insights JavaScript SDK - Web Analytics, 2.7.1-nightly.202110-16
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* Microsoft Application Insights Team
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - Web Analytics, 2.7.1-nightly.202110-
|
|
2
|
+
* Application Insights JavaScript SDK - Web Analytics, 2.7.1-nightly.202110-16
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
(function (global, factory) {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
}
|
|
49
49
|
var type = typeof obj;
|
|
50
50
|
if (type !== strShimObject && type !== strShimFunction) {
|
|
51
|
-
throwTypeError(
|
|
51
|
+
throwTypeError("Object prototype may only be an Object:" + obj);
|
|
52
52
|
}
|
|
53
53
|
function tmpFunc() { }
|
|
54
54
|
tmpFunc[strShimPrototype] = obj;
|
|
@@ -714,12 +714,26 @@
|
|
|
714
714
|
var AiNonUserActionablePrefix = "AI (Internal): ";
|
|
715
715
|
var AiUserActionablePrefix = "AI: ";
|
|
716
716
|
var AIInternalMessagePrefix = "AITR_";
|
|
717
|
+
var strErrorToConsole = "errorToConsole";
|
|
718
|
+
var strWarnToConsole = "warnToConsole";
|
|
717
719
|
function _sanitizeDiagnosticText(text) {
|
|
718
720
|
if (text) {
|
|
719
721
|
return "\"" + text.replace(/\"/g, "") + "\"";
|
|
720
722
|
}
|
|
721
723
|
return "";
|
|
722
724
|
}
|
|
725
|
+
function _logToConsole(func, message) {
|
|
726
|
+
var theConsole = getConsole();
|
|
727
|
+
if (!!theConsole) {
|
|
728
|
+
var logFunc = "log";
|
|
729
|
+
if (theConsole[func]) {
|
|
730
|
+
logFunc = "func";
|
|
731
|
+
}
|
|
732
|
+
if (isFunction(theConsole[logFunc])) {
|
|
733
|
+
theConsole[logFunc](message);
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
}
|
|
723
737
|
var _InternalLogMessage = /** @class */ (function () {
|
|
724
738
|
function _InternalLogMessage(msgId, msg, isUserAct, properties) {
|
|
725
739
|
if (isUserAct === void 0) { isUserAct = false; }
|
|
@@ -744,7 +758,7 @@
|
|
|
744
758
|
}
|
|
745
759
|
var DiagnosticLogger = /** @class */ (function () {
|
|
746
760
|
function DiagnosticLogger(config) {
|
|
747
|
-
this.identifier =
|
|
761
|
+
this.identifier = "DiagnosticLogger";
|
|
748
762
|
this.queue = [];
|
|
749
763
|
var _messageCount = 0;
|
|
750
764
|
var _messageLogged = {};
|
|
@@ -752,10 +766,10 @@
|
|
|
752
766
|
if (isNullOrUndefined(config)) {
|
|
753
767
|
config = {};
|
|
754
768
|
}
|
|
755
|
-
_self.consoleLoggingLevel = function () { return _getConfigValue(
|
|
756
|
-
_self.telemetryLoggingLevel = function () { return _getConfigValue(
|
|
757
|
-
_self.maxInternalMessageLimit = function () { return _getConfigValue(
|
|
758
|
-
_self.enableDebugExceptions = function () { return _getConfigValue(
|
|
769
|
+
_self.consoleLoggingLevel = function () { return _getConfigValue("loggingLevelConsole", 0); };
|
|
770
|
+
_self.telemetryLoggingLevel = function () { return _getConfigValue("loggingLevelTelemetry", 1); };
|
|
771
|
+
_self.maxInternalMessageLimit = function () { return _getConfigValue("maxMessageLimit", 25); };
|
|
772
|
+
_self.enableDebugExceptions = function () { return _getConfigValue("enableDebugExceptions", false); };
|
|
759
773
|
_self.throwInternal = function (severity, msgId, msg, properties, isUserAct) {
|
|
760
774
|
if (isUserAct === void 0) { isUserAct = false; }
|
|
761
775
|
var message = new _InternalLogMessage(msgId, msg, isUserAct, properties);
|
|
@@ -763,18 +777,19 @@
|
|
|
763
777
|
throw message;
|
|
764
778
|
}
|
|
765
779
|
else {
|
|
780
|
+
var logFunc = severity === LoggingSeverity.CRITICAL ? strErrorToConsole : strWarnToConsole;
|
|
766
781
|
if (!isUndefined(message.message)) {
|
|
767
782
|
var logLevel = _self.consoleLoggingLevel();
|
|
768
783
|
if (isUserAct) {
|
|
769
784
|
var messageKey = +message.messageId;
|
|
770
|
-
if (!_messageLogged[messageKey] && logLevel >=
|
|
771
|
-
_self
|
|
785
|
+
if (!_messageLogged[messageKey] && logLevel >= severity) {
|
|
786
|
+
_self[logFunc](message.message);
|
|
772
787
|
_messageLogged[messageKey] = true;
|
|
773
788
|
}
|
|
774
789
|
}
|
|
775
790
|
else {
|
|
776
|
-
if (logLevel >=
|
|
777
|
-
_self
|
|
791
|
+
if (logLevel >= severity) {
|
|
792
|
+
_self[logFunc](message.message);
|
|
778
793
|
}
|
|
779
794
|
}
|
|
780
795
|
_self.logInternalMessage(severity, message);
|
|
@@ -782,16 +797,10 @@
|
|
|
782
797
|
}
|
|
783
798
|
};
|
|
784
799
|
_self.warnToConsole = function (message) {
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
logFunc = 'warn';
|
|
790
|
-
}
|
|
791
|
-
if (isFunction(theConsole[logFunc])) {
|
|
792
|
-
theConsole[logFunc](message);
|
|
793
|
-
}
|
|
794
|
-
}
|
|
800
|
+
_logToConsole("warn", message);
|
|
801
|
+
};
|
|
802
|
+
_self.errorToConsole = function (message) {
|
|
803
|
+
_logToConsole("error", message);
|
|
795
804
|
};
|
|
796
805
|
_self.resetInternalMessageCount = function () {
|
|
797
806
|
_messageCount = 0;
|
|
@@ -848,7 +857,7 @@
|
|
|
848
857
|
_self.isChildEvt = function () { return false; };
|
|
849
858
|
if (isFunction(payloadDetails)) {
|
|
850
859
|
var theDetails_1;
|
|
851
|
-
accessorDefined = objDefineAccessors(_self,
|
|
860
|
+
accessorDefined = objDefineAccessors(_self, "payload", function () {
|
|
852
861
|
if (!theDetails_1 && isFunction(payloadDetails)) {
|
|
853
862
|
theDetails_1 = payloadDetails();
|
|
854
863
|
payloadDetails = null;
|
|
@@ -1532,7 +1541,7 @@
|
|
|
1532
1541
|
name = strTrim(name.toString());
|
|
1533
1542
|
if (name.length > 150 ) {
|
|
1534
1543
|
nameTrunc = name.substring(0, 150 );
|
|
1535
|
-
logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.NameTooLong, "name is too long. It has been truncated to " + 150 + " characters.", { name: name }, true);
|
|
1544
|
+
logger && logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.NameTooLong, "name is too long. It has been truncated to " + 150 + " characters.", { name: name }, true);
|
|
1536
1545
|
}
|
|
1537
1546
|
}
|
|
1538
1547
|
return nameTrunc || name;
|
|
@@ -1545,7 +1554,7 @@
|
|
|
1545
1554
|
value = strTrim(value);
|
|
1546
1555
|
if (value.toString().length > maxLength) {
|
|
1547
1556
|
valueTrunc = value.toString().substring(0, maxLength);
|
|
1548
|
-
logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.StringValueTooLong, "string value is too long. It has been truncated to " + maxLength + " characters.", { value: value }, true);
|
|
1557
|
+
logger && logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.StringValueTooLong, "string value is too long. It has been truncated to " + maxLength + " characters.", { value: value }, true);
|
|
1549
1558
|
}
|
|
1550
1559
|
}
|
|
1551
1560
|
return valueTrunc || value;
|
|
@@ -1558,7 +1567,7 @@
|
|
|
1558
1567
|
if (message) {
|
|
1559
1568
|
if (message.length > 32768 ) {
|
|
1560
1569
|
messageTrunc = message.substring(0, 32768 );
|
|
1561
|
-
logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.MessageTruncated, "message is too long, it has been truncated to " + 32768 + " characters.", { message: message }, true);
|
|
1570
|
+
logger && logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.MessageTruncated, "message is too long, it has been truncated to " + 32768 + " characters.", { message: message }, true);
|
|
1562
1571
|
}
|
|
1563
1572
|
}
|
|
1564
1573
|
return messageTrunc || message;
|
|
@@ -1569,7 +1578,7 @@
|
|
|
1569
1578
|
var value = "" + exception;
|
|
1570
1579
|
if (value.length > 32768 ) {
|
|
1571
1580
|
exceptionTrunc = value.substring(0, 32768 );
|
|
1572
|
-
logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.ExceptionTruncated, "exception is too long, it has been truncated to " + 32768 + " characters.", { exception: exception }, true);
|
|
1581
|
+
logger && logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.ExceptionTruncated, "exception is too long, it has been truncated to " + 32768 + " characters.", { exception: exception }, true);
|
|
1573
1582
|
}
|
|
1574
1583
|
}
|
|
1575
1584
|
return exceptionTrunc || exception;
|
|
@@ -1583,7 +1592,7 @@
|
|
|
1583
1592
|
value = getJSON().stringify(value);
|
|
1584
1593
|
}
|
|
1585
1594
|
catch (e) {
|
|
1586
|
-
logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.CannotSerializeObjectNonSerializable, "custom property is not valid", { exception: e }, true);
|
|
1595
|
+
logger && logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.CannotSerializeObjectNonSerializable, "custom property is not valid", { exception: e }, true);
|
|
1587
1596
|
}
|
|
1588
1597
|
}
|
|
1589
1598
|
value = dataSanitizeString(logger, value, 8192 );
|
|
@@ -1614,7 +1623,7 @@
|
|
|
1614
1623
|
input = strTrim(input);
|
|
1615
1624
|
if (input.length > maxLength) {
|
|
1616
1625
|
inputTrunc = input.substring(0, maxLength);
|
|
1617
|
-
logger.throwInternal(LoggingSeverity.WARNING, _msgId, "input is too long, it has been truncated to " + maxLength + " characters.", { data: input }, true);
|
|
1626
|
+
logger && logger.throwInternal(LoggingSeverity.WARNING, _msgId, "input is too long, it has been truncated to " + maxLength + " characters.", { data: input }, true);
|
|
1618
1627
|
}
|
|
1619
1628
|
}
|
|
1620
1629
|
return inputTrunc || input;
|
|
@@ -1768,7 +1777,7 @@
|
|
|
1768
1777
|
tempAnchor = { host: urlParseHost(url, true) };
|
|
1769
1778
|
}
|
|
1770
1779
|
else if (!anchorCache[anchorIdx]) {
|
|
1771
|
-
tempAnchor = anchorCache[anchorIdx] = _document.createElement(
|
|
1780
|
+
tempAnchor = anchorCache[anchorIdx] = _document.createElement("a");
|
|
1772
1781
|
}
|
|
1773
1782
|
tempAnchor.href = url;
|
|
1774
1783
|
anchorIdx++;
|
|
@@ -1818,7 +1827,7 @@
|
|
|
1818
1827
|
if (!name) {
|
|
1819
1828
|
if (parsedUrl.pathname != null) {
|
|
1820
1829
|
var pathName = (parsedUrl.pathname.length === 0) ? "/" : parsedUrl.pathname;
|
|
1821
|
-
if (pathName.charAt(0) !==
|
|
1830
|
+
if (pathName.charAt(0) !== "/") {
|
|
1822
1831
|
pathName = "/" + pathName;
|
|
1823
1832
|
}
|
|
1824
1833
|
data = parsedUrl.pathname;
|
|
@@ -2010,7 +2019,7 @@
|
|
|
2010
2019
|
else if (errorObj[strError] && errorObj[strError][strStack]) {
|
|
2011
2020
|
details = _convertStackObj(errorObj[strError][strStack]);
|
|
2012
2021
|
}
|
|
2013
|
-
else if (errorObj[
|
|
2022
|
+
else if (errorObj["exception"] && errorObj.exception[strStack]) {
|
|
2014
2023
|
details = _convertStackObj(errorObj.exception[strStack]);
|
|
2015
2024
|
}
|
|
2016
2025
|
else if (_isStackDetails(errorObj)) {
|
|
@@ -2019,7 +2028,7 @@
|
|
|
2019
2028
|
else if (_isStackDetails(errorObj[strStackDetails])) {
|
|
2020
2029
|
details = errorObj[strStackDetails];
|
|
2021
2030
|
}
|
|
2022
|
-
else if (window[
|
|
2031
|
+
else if (window["opera"] && errorObj[strMessage]) {
|
|
2023
2032
|
details = _getOperaStack(errorObj.message);
|
|
2024
2033
|
}
|
|
2025
2034
|
else if (isString(errorObj)) {
|
|
@@ -2950,7 +2959,7 @@
|
|
|
2950
2959
|
durations[_i] = arguments[_i];
|
|
2951
2960
|
}
|
|
2952
2961
|
var _navigator = getNavigator() || {};
|
|
2953
|
-
var botAgentNames = [
|
|
2962
|
+
var botAgentNames = ["googlebot", "adsbot-google", "apis-google", "mediapartners-google"];
|
|
2954
2963
|
var userAgent = _navigator.userAgent;
|
|
2955
2964
|
var isGoogleBot = false;
|
|
2956
2965
|
if (userAgent) {
|
|
@@ -3319,7 +3328,7 @@
|
|
|
3319
3328
|
if (_location && _location.pathname) {
|
|
3320
3329
|
traceLocationName = _location.pathname + (_location.hash || "");
|
|
3321
3330
|
}
|
|
3322
|
-
_properties.context.telemetryTrace.name = traceLocationName;
|
|
3331
|
+
_properties.context.telemetryTrace.name = dataSanitizeString(_self_1.diagLog(), traceLocationName);
|
|
3323
3332
|
}
|
|
3324
3333
|
if (_currUri) {
|
|
3325
3334
|
_prevUri = _currUri;
|
|
@@ -3348,7 +3357,7 @@
|
|
|
3348
3357
|
}
|
|
3349
3358
|
function _addDefaultTelemetryInitializers(configGetters) {
|
|
3350
3359
|
if (!configGetters.isBrowserLinkTrackingEnabled()) {
|
|
3351
|
-
var browserLinkPaths_1 = [
|
|
3360
|
+
var browserLinkPaths_1 = ["/browserLinkSignalR/", "/__browserLink/"];
|
|
3352
3361
|
var dropBrowserLinkRequests = function (envelope) {
|
|
3353
3362
|
if (envelope.baseType === RemoteDependencyData.dataType) {
|
|
3354
3363
|
var remoteData = envelope.baseData;
|
|
@@ -3397,7 +3406,7 @@
|
|
|
3397
3406
|
config.disableFlushOnUnload = stringToBoolOrDefault(config.disableFlushOnUnload, config.disableFlushOnBeforeUnload);
|
|
3398
3407
|
return config;
|
|
3399
3408
|
};
|
|
3400
|
-
ApplicationInsights.Version = "2.7.1-nightly.202110-
|
|
3409
|
+
ApplicationInsights.Version = "2.7.1-nightly.202110-16";
|
|
3401
3410
|
return ApplicationInsights;
|
|
3402
3411
|
}(BaseTelemetryPlugin));
|
|
3403
3412
|
var Timing = /** @class */ (function () {
|