@microsoft/applicationinsights-dependencies-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.
@@ -1,25 +1,25 @@
1
1
  {
2
2
  "name": "applicationinsights-dependencies-js",
3
- "version": "2.7.1-nightly.202110-07",
3
+ "version": "2.7.1-nightly.202110-16",
4
4
  "ext": {
5
5
  "@js": {
6
6
  "file": "applicationinsights-dependencies-js.js",
7
7
  "type": "text/javascript; charset=utf-8",
8
- "integrity": "sha256-JacNAxARZjYoyWY4TP220K93BkylUzfX2qrXKHeQ3dM= sha384-GHSeNsRRLa8wKDKL3qyQRPm2Jk+yKIf4GCyo6rx3fEmkLfWrhtLKVD1Fb4OaEtLC sha512-aAf+Yc1PRPDi69ZG11LSyeRKDHn64NTglTq5zozK2xOA0i6ivi5pzqdGmsNMQYshE5cI4i9BWXdUgaxW7QJ4IA==",
8
+ "integrity": "sha256-8RoD91GGoWxamjtgyWs3+IKiQxZJTU/zhcLk8Sbqsnw= sha384-Fdua/FcN/7Ed5F/T/XUdr/zHKrbvHt/8t4oUfD/j83wHj/ZBhbZJmLo5BTOelcbz sha512-Ql573f6UnYIsXVuHB6EvHoSNAn1YOroqdaSn0HGEQ3lkBz977G7dPQiGPO27ff1Ypl7RhgQTDXrVk8FTiRzLcw==",
9
9
  "hashes": {
10
- "sha256": "JacNAxARZjYoyWY4TP220K93BkylUzfX2qrXKHeQ3dM=",
11
- "sha384": "GHSeNsRRLa8wKDKL3qyQRPm2Jk+yKIf4GCyo6rx3fEmkLfWrhtLKVD1Fb4OaEtLC",
12
- "sha512": "aAf+Yc1PRPDi69ZG11LSyeRKDHn64NTglTq5zozK2xOA0i6ivi5pzqdGmsNMQYshE5cI4i9BWXdUgaxW7QJ4IA=="
10
+ "sha256": "8RoD91GGoWxamjtgyWs3+IKiQxZJTU/zhcLk8Sbqsnw=",
11
+ "sha384": "Fdua/FcN/7Ed5F/T/XUdr/zHKrbvHt/8t4oUfD/j83wHj/ZBhbZJmLo5BTOelcbz",
12
+ "sha512": "Ql573f6UnYIsXVuHB6EvHoSNAn1YOroqdaSn0HGEQ3lkBz977G7dPQiGPO27ff1Ypl7RhgQTDXrVk8FTiRzLcw=="
13
13
  }
14
14
  },
15
15
  "@min.js": {
16
16
  "file": "applicationinsights-dependencies-js.min.js",
17
17
  "type": "text/javascript; charset=utf-8",
18
- "integrity": "sha256-WiPrHv/cXkohMozVPwlOzV3+9Aw7UHmB6Ghdk9qZf/s= sha384-gjKTjS24ZUXoIsEtC9KDXjX7U1wz/386VRy7WyAKAfwaumtXo/mf+EDpV9GSiNlk sha512-bFZWMqQkLuvovlwz+SycdkiMEhwsyh59DlB7iaqrGC96P94WfWjOmtxVFRI+Cvb1xq0SeUPEA34Xf4SgJ4wnpQ==",
18
+ "integrity": "sha256-qwmB/wC1nDNnvBos4jGpcIvXJS4mEzCZGQwOvHvlTxM= sha384-5gEhA2srVAp49DWY7jxJtnWfZ4qtakeVBu3zM2zy8oHMCX7Lve3guJBCLCbHP7S7 sha512-acQOGVenL+Q0mUq8jumxeJODrGbWZVfIXMyz7NrmpbHcHfDD5kd2KdsKVkirpLHYnlRiK3dGM+dLRtT0rwjsEg==",
19
19
  "hashes": {
20
- "sha256": "WiPrHv/cXkohMozVPwlOzV3+9Aw7UHmB6Ghdk9qZf/s=",
21
- "sha384": "gjKTjS24ZUXoIsEtC9KDXjX7U1wz/386VRy7WyAKAfwaumtXo/mf+EDpV9GSiNlk",
22
- "sha512": "bFZWMqQkLuvovlwz+SycdkiMEhwsyh59DlB7iaqrGC96P94WfWjOmtxVFRI+Cvb1xq0SeUPEA34Xf4SgJ4wnpQ=="
20
+ "sha256": "qwmB/wC1nDNnvBos4jGpcIvXJS4mEzCZGQwOvHvlTxM=",
21
+ "sha384": "5gEhA2srVAp49DWY7jxJtnWfZ4qtakeVBu3zM2zy8oHMCX7Lve3guJBCLCbHP7S7",
22
+ "sha512": "acQOGVenL+Q0mUq8jumxeJODrGbWZVfIXMyz7NrmpbHcHfDD5kd2KdsKVkirpLHYnlRiK3dGM+dLRtT0rwjsEg=="
23
23
  }
24
24
  }
25
25
  }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - Dependencies Plugin, 2.7.1-nightly.202110-07
2
+ * Application Insights JavaScript SDK - Dependencies Plugin, 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('Object prototype may only be an Object:' + obj);
51
+ throwTypeError("Object prototype may only be an Object:" + obj);
52
52
  }
53
53
  function tmpFunc() { }
54
54
  tmpFunc[strShimPrototype] = obj;
@@ -536,20 +536,20 @@
536
536
  }
537
537
  return str.replace(/^\s+|\s+$/g, "");
538
538
  }
539
- var _objKeysHasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString');
539
+ var _objKeysHasDontEnumBug = !({ toString: null }).propertyIsEnumerable("toString");
540
540
  var _objKeysDontEnums = [
541
- 'toString',
542
- 'toLocaleString',
543
- 'valueOf',
544
- 'hasOwnProperty',
545
- 'isPrototypeOf',
546
- 'propertyIsEnumerable',
547
- 'constructor'
541
+ "toString",
542
+ "toLocaleString",
543
+ "valueOf",
544
+ "hasOwnProperty",
545
+ "isPrototypeOf",
546
+ "propertyIsEnumerable",
547
+ "constructor"
548
548
  ];
549
549
  function objKeys(obj) {
550
550
  var objType = typeof obj;
551
551
  if (objType !== strShimFunction && (objType !== strShimObject || obj === null)) {
552
- throwTypeError('objKeys called on non-object');
552
+ throwTypeError("objKeys called on non-object");
553
553
  }
554
554
  var result = [];
555
555
  for (var prop in obj) {
@@ -740,12 +740,26 @@
740
740
  var AiNonUserActionablePrefix = "AI (Internal): ";
741
741
  var AiUserActionablePrefix = "AI: ";
742
742
  var AIInternalMessagePrefix = "AITR_";
743
+ var strErrorToConsole = "errorToConsole";
744
+ var strWarnToConsole = "warnToConsole";
743
745
  function _sanitizeDiagnosticText(text) {
744
746
  if (text) {
745
747
  return "\"" + text.replace(/\"/g, "") + "\"";
746
748
  }
747
749
  return "";
748
750
  }
751
+ function _logToConsole(func, message) {
752
+ var theConsole = getConsole();
753
+ if (!!theConsole) {
754
+ var logFunc = "log";
755
+ if (theConsole[func]) {
756
+ logFunc = "func";
757
+ }
758
+ if (isFunction(theConsole[logFunc])) {
759
+ theConsole[logFunc](message);
760
+ }
761
+ }
762
+ }
749
763
  var _InternalLogMessage = /** @class */ (function () {
750
764
  function _InternalLogMessage(msgId, msg, isUserAct, properties) {
751
765
  if (isUserAct === void 0) { isUserAct = false; }
@@ -770,7 +784,7 @@
770
784
  }
771
785
  var DiagnosticLogger = /** @class */ (function () {
772
786
  function DiagnosticLogger(config) {
773
- this.identifier = 'DiagnosticLogger';
787
+ this.identifier = "DiagnosticLogger";
774
788
  this.queue = [];
775
789
  var _messageCount = 0;
776
790
  var _messageLogged = {};
@@ -778,10 +792,10 @@
778
792
  if (isNullOrUndefined(config)) {
779
793
  config = {};
780
794
  }
781
- _self.consoleLoggingLevel = function () { return _getConfigValue('loggingLevelConsole', 0); };
782
- _self.telemetryLoggingLevel = function () { return _getConfigValue('loggingLevelTelemetry', 1); };
783
- _self.maxInternalMessageLimit = function () { return _getConfigValue('maxMessageLimit', 25); };
784
- _self.enableDebugExceptions = function () { return _getConfigValue('enableDebugExceptions', false); };
795
+ _self.consoleLoggingLevel = function () { return _getConfigValue("loggingLevelConsole", 0); };
796
+ _self.telemetryLoggingLevel = function () { return _getConfigValue("loggingLevelTelemetry", 1); };
797
+ _self.maxInternalMessageLimit = function () { return _getConfigValue("maxMessageLimit", 25); };
798
+ _self.enableDebugExceptions = function () { return _getConfigValue("enableDebugExceptions", false); };
785
799
  _self.throwInternal = function (severity, msgId, msg, properties, isUserAct) {
786
800
  if (isUserAct === void 0) { isUserAct = false; }
787
801
  var message = new _InternalLogMessage(msgId, msg, isUserAct, properties);
@@ -789,18 +803,19 @@
789
803
  throw message;
790
804
  }
791
805
  else {
806
+ var logFunc = severity === LoggingSeverity.CRITICAL ? strErrorToConsole : strWarnToConsole;
792
807
  if (!isUndefined(message.message)) {
793
808
  var logLevel = _self.consoleLoggingLevel();
794
809
  if (isUserAct) {
795
810
  var messageKey = +message.messageId;
796
- if (!_messageLogged[messageKey] && logLevel >= LoggingSeverity.WARNING) {
797
- _self.warnToConsole(message.message);
811
+ if (!_messageLogged[messageKey] && logLevel >= severity) {
812
+ _self[logFunc](message.message);
798
813
  _messageLogged[messageKey] = true;
799
814
  }
800
815
  }
801
816
  else {
802
- if (logLevel >= LoggingSeverity.WARNING) {
803
- _self.warnToConsole(message.message);
817
+ if (logLevel >= severity) {
818
+ _self[logFunc](message.message);
804
819
  }
805
820
  }
806
821
  _self.logInternalMessage(severity, message);
@@ -808,16 +823,10 @@
808
823
  }
809
824
  };
810
825
  _self.warnToConsole = function (message) {
811
- var theConsole = getConsole();
812
- if (!!theConsole) {
813
- var logFunc = 'log';
814
- if (theConsole.warn) {
815
- logFunc = 'warn';
816
- }
817
- if (isFunction(theConsole[logFunc])) {
818
- theConsole[logFunc](message);
819
- }
820
- }
826
+ _logToConsole("warn", message);
827
+ };
828
+ _self.errorToConsole = function (message) {
829
+ _logToConsole("error", message);
821
830
  };
822
831
  _self.resetInternalMessageCount = function () {
823
832
  _messageCount = 0;
@@ -874,7 +883,7 @@
874
883
  _self.isChildEvt = function () { return false; };
875
884
  if (isFunction(payloadDetails)) {
876
885
  var theDetails_1;
877
- accessorDefined = objDefineAccessors(_self, 'payload', function () {
886
+ accessorDefined = objDefineAccessors(_self, "payload", function () {
878
887
  if (!theDetails_1 && isFunction(payloadDetails)) {
879
888
  theDetails_1 = payloadDetails();
880
889
  payloadDetails = null;
@@ -1481,7 +1490,7 @@
1481
1490
  name = strTrim(name.toString());
1482
1491
  if (name.length > 150 ) {
1483
1492
  nameTrunc = name.substring(0, 150 );
1484
- logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.NameTooLong, "name is too long. It has been truncated to " + 150 + " characters.", { name: name }, true);
1493
+ logger && logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.NameTooLong, "name is too long. It has been truncated to " + 150 + " characters.", { name: name }, true);
1485
1494
  }
1486
1495
  }
1487
1496
  return nameTrunc || name;
@@ -1494,7 +1503,7 @@
1494
1503
  value = strTrim(value);
1495
1504
  if (value.toString().length > maxLength) {
1496
1505
  valueTrunc = value.toString().substring(0, maxLength);
1497
- logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.StringValueTooLong, "string value is too long. It has been truncated to " + maxLength + " characters.", { value: value }, true);
1506
+ logger && logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.StringValueTooLong, "string value is too long. It has been truncated to " + maxLength + " characters.", { value: value }, true);
1498
1507
  }
1499
1508
  }
1500
1509
  return valueTrunc || value;
@@ -1511,7 +1520,7 @@
1511
1520
  value = getJSON().stringify(value);
1512
1521
  }
1513
1522
  catch (e) {
1514
- logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.CannotSerializeObjectNonSerializable, "custom property is not valid", { exception: e }, true);
1523
+ logger && logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.CannotSerializeObjectNonSerializable, "custom property is not valid", { exception: e }, true);
1515
1524
  }
1516
1525
  }
1517
1526
  value = dataSanitizeString(logger, value, 8192 );
@@ -1539,7 +1548,7 @@
1539
1548
  input = strTrim(input);
1540
1549
  if (input.length > maxLength) {
1541
1550
  inputTrunc = input.substring(0, maxLength);
1542
- logger.throwInternal(LoggingSeverity.WARNING, _msgId, "input is too long, it has been truncated to " + maxLength + " characters.", { data: input }, true);
1551
+ logger && logger.throwInternal(LoggingSeverity.WARNING, _msgId, "input is too long, it has been truncated to " + maxLength + " characters.", { data: input }, true);
1543
1552
  }
1544
1553
  }
1545
1554
  return inputTrunc || input;
@@ -1593,7 +1602,7 @@
1593
1602
  tempAnchor = { host: urlParseHost(url, true) };
1594
1603
  }
1595
1604
  else if (!anchorCache[anchorIdx]) {
1596
- tempAnchor = anchorCache[anchorIdx] = _document.createElement('a');
1605
+ tempAnchor = anchorCache[anchorIdx] = _document.createElement("a");
1597
1606
  }
1598
1607
  tempAnchor.href = url;
1599
1608
  anchorIdx++;
@@ -1728,7 +1737,7 @@
1728
1737
  if (!name) {
1729
1738
  if (parsedUrl.pathname != null) {
1730
1739
  var pathName = (parsedUrl.pathname.length === 0) ? "/" : parsedUrl.pathname;
1731
- if (pathName.charAt(0) !== '/') {
1740
+ if (pathName.charAt(0) !== "/") {
1732
1741
  pathName = "/" + pathName;
1733
1742
  }
1734
1743
  data = parsedUrl.pathname;
@@ -2507,7 +2516,7 @@
2507
2516
  isDisabled = xhr[DisabledPropertyName] === true || theUrl[DisabledPropertyName] === true;
2508
2517
  }
2509
2518
  else if (!isNullOrUndefined(request)) {
2510
- isDisabled = (typeof request === 'object' ? request[DisabledPropertyName] === true : false) ||
2519
+ isDisabled = (typeof request === "object" ? request[DisabledPropertyName] === true : false) ||
2511
2520
  (init ? init[DisabledPropertyName] === true : false);
2512
2521
  }
2513
2522
  if (!isDisabled && theUrl && isInternalApplicationInsightsEndpoint(theUrl)) {
@@ -2604,9 +2613,9 @@
2604
2613
  var arr = strTrim(headers).split(/[\r\n]+/);
2605
2614
  var responseHeaderMap_2 = {};
2606
2615
  arrForEach(arr, function (line) {
2607
- var parts = line.split(': ');
2616
+ var parts = line.split(": ");
2608
2617
  var header = parts.shift();
2609
- var value = parts.join(': ');
2618
+ var value = parts.join(": ");
2610
2619
  if (_canIncludeHeaders(header)) {
2611
2620
  responseHeaderMap_2[header] = value;
2612
2621
  }