@microsoft/applicationinsights-common 3.0.3-nightly3.2308-09 → 3.0.3-nightly3.2308-11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/browser/es5/applicationinsights-common.cjs.js +42 -18
  2. package/browser/es5/applicationinsights-common.cjs.js.map +1 -1
  3. package/browser/es5/applicationinsights-common.cjs.min.js +2 -2
  4. package/browser/es5/applicationinsights-common.cjs.min.js.map +1 -1
  5. package/browser/es5/applicationinsights-common.gbl.js +44 -20
  6. package/browser/es5/applicationinsights-common.gbl.js.map +1 -1
  7. package/browser/es5/applicationinsights-common.gbl.min.js +2 -2
  8. package/browser/es5/applicationinsights-common.gbl.min.js.map +1 -1
  9. package/browser/es5/applicationinsights-common.integrity.json +25 -25
  10. package/browser/es5/applicationinsights-common.js +44 -20
  11. package/browser/es5/applicationinsights-common.js.map +1 -1
  12. package/browser/es5/applicationinsights-common.min.js +2 -2
  13. package/browser/es5/applicationinsights-common.min.js.map +1 -1
  14. package/dist/es5/applicationinsights-common.js +42 -18
  15. package/dist/es5/applicationinsights-common.js.map +1 -1
  16. package/dist/es5/applicationinsights-common.min.js +2 -2
  17. package/dist/es5/applicationinsights-common.min.js.map +1 -1
  18. package/dist-es5/ConnectionStringParser.js +1 -1
  19. package/dist-es5/Constants.js +1 -1
  20. package/dist-es5/DomHelperFuncs.js +1 -1
  21. package/dist-es5/Enums.js +1 -1
  22. package/dist-es5/HelperFuncs.js +1 -1
  23. package/dist-es5/Interfaces/ConnectionString.js +1 -1
  24. package/dist-es5/Interfaces/Context/IApplication.js +1 -1
  25. package/dist-es5/Interfaces/Context/IDevice.js +1 -1
  26. package/dist-es5/Interfaces/Context/IInternal.js +1 -1
  27. package/dist-es5/Interfaces/Context/ILocation.js +1 -1
  28. package/dist-es5/Interfaces/Context/IOperatingSystem.js +1 -1
  29. package/dist-es5/Interfaces/Context/ISample.js +1 -1
  30. package/dist-es5/Interfaces/Context/ISession.js +1 -1
  31. package/dist-es5/Interfaces/Context/ISessionManager.js +1 -1
  32. package/dist-es5/Interfaces/Context/ITelemetryTrace.js +1 -1
  33. package/dist-es5/Interfaces/Context/IUser.js +1 -1
  34. package/dist-es5/Interfaces/Context/IWeb.js +1 -1
  35. package/dist-es5/Interfaces/Contracts/AvailabilityData.js +1 -1
  36. package/dist-es5/Interfaces/Contracts/ContextTagKeys.js +1 -1
  37. package/dist-es5/Interfaces/Contracts/DataPointType.js +1 -1
  38. package/dist-es5/Interfaces/Contracts/DependencyKind.js +1 -1
  39. package/dist-es5/Interfaces/Contracts/DependencySourceType.js +1 -1
  40. package/dist-es5/Interfaces/Contracts/IBase.js +1 -1
  41. package/dist-es5/Interfaces/Contracts/IData.js +1 -1
  42. package/dist-es5/Interfaces/Contracts/IDataPoint.js +1 -1
  43. package/dist-es5/Interfaces/Contracts/IDomain.js +1 -1
  44. package/dist-es5/Interfaces/Contracts/IEnvelope.js +1 -1
  45. package/dist-es5/Interfaces/Contracts/IEventData.js +1 -1
  46. package/dist-es5/Interfaces/Contracts/IExceptionData.js +1 -1
  47. package/dist-es5/Interfaces/Contracts/IExceptionDetails.js +1 -1
  48. package/dist-es5/Interfaces/Contracts/IMessageData.js +1 -1
  49. package/dist-es5/Interfaces/Contracts/IMetricData.js +1 -1
  50. package/dist-es5/Interfaces/Contracts/IPageViewData.js +1 -1
  51. package/dist-es5/Interfaces/Contracts/IPageViewPerfData.js +1 -1
  52. package/dist-es5/Interfaces/Contracts/IRemoteDependencyData.js +1 -1
  53. package/dist-es5/Interfaces/Contracts/IStackFrame.js +1 -1
  54. package/dist-es5/Interfaces/Contracts/RequestData.js +1 -1
  55. package/dist-es5/Interfaces/Contracts/SeverityLevel.js +1 -1
  56. package/dist-es5/Interfaces/IAppInsights.js +1 -1
  57. package/dist-es5/Interfaces/IConfig.js +1 -1
  58. package/dist-es5/Interfaces/ICorrelationConfig.js +1 -1
  59. package/dist-es5/Interfaces/IDependencyTelemetry.js +1 -1
  60. package/dist-es5/Interfaces/IEventTelemetry.js +1 -1
  61. package/dist-es5/Interfaces/IExceptionTelemetry.js +1 -1
  62. package/dist-es5/Interfaces/IMetricTelemetry.js +1 -1
  63. package/dist-es5/Interfaces/IPageViewPerformanceTelemetry.js +1 -1
  64. package/dist-es5/Interfaces/IPageViewTelemetry.js +1 -1
  65. package/dist-es5/Interfaces/IPartC.js +1 -1
  66. package/dist-es5/Interfaces/IPropertiesPlugin.js +1 -1
  67. package/dist-es5/Interfaces/IRequestContext.js +1 -1
  68. package/dist-es5/Interfaces/IStorageBuffer.js +1 -1
  69. package/dist-es5/Interfaces/ITelemetryContext.js +1 -1
  70. package/dist-es5/Interfaces/IThrottleMgr.js +1 -1
  71. package/dist-es5/Interfaces/ITraceTelemetry.js +1 -1
  72. package/dist-es5/Interfaces/PartAExtensions.js +1 -1
  73. package/dist-es5/Interfaces/Telemetry/IEnvelope.js +1 -1
  74. package/dist-es5/Interfaces/Telemetry/ISerializable.js +1 -1
  75. package/dist-es5/RequestResponseHeaders.js +1 -1
  76. package/dist-es5/StorageHelperFuncs.js +1 -1
  77. package/dist-es5/Telemetry/Common/Data.js +1 -1
  78. package/dist-es5/Telemetry/Common/DataPoint.js +1 -1
  79. package/dist-es5/Telemetry/Common/DataSanitizer.js +1 -1
  80. package/dist-es5/Telemetry/Common/Envelope.js +1 -1
  81. package/dist-es5/Telemetry/Event.js +1 -1
  82. package/dist-es5/Telemetry/Exception.js +1 -1
  83. package/dist-es5/Telemetry/Metric.js +1 -1
  84. package/dist-es5/Telemetry/PageView.js +1 -1
  85. package/dist-es5/Telemetry/PageViewPerformance.js +1 -1
  86. package/dist-es5/Telemetry/RemoteDependencyData.js +1 -1
  87. package/dist-es5/Telemetry/Trace.js +1 -1
  88. package/dist-es5/TelemetryItemCreator.js +1 -1
  89. package/dist-es5/ThrottleMgr.js +44 -18
  90. package/dist-es5/ThrottleMgr.js.map +1 -1
  91. package/dist-es5/UrlHelperFuncs.js +1 -1
  92. package/dist-es5/Util.js +1 -1
  93. package/dist-es5/__DynamicConstants.js +1 -1
  94. package/dist-es5/applicationinsights-common.js +1 -1
  95. package/package.json +2 -2
  96. package/types/applicationinsights-common.d.ts +5 -3
  97. package/types/applicationinsights-common.namespaced.d.ts +5 -3
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - Common, 3.0.3-nightly3.2308-09
2
+ * Application Insights JavaScript SDK - Common, 3.0.3-nightly3.2308-11
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
6
6
  var undef = "undefined";
7
- var nsKey, key, nm, theExports = {}, modName = "es5_applicationinsights_common_3_0_3_nightly3_2308_09", msMod="__ms$mod__";
8
- var mods={}, modDetail=mods[modName]={}, ver="3.0.3-nightly3.2308-09";
7
+ var nsKey, key, nm, theExports = {}, modName = "es5_applicationinsights_common_3_0_3_nightly3_2308_11", msMod="__ms$mod__";
8
+ var mods={}, modDetail=mods[modName]={}, ver="3.0.3-nightly3.2308-11";
9
9
  var baseNs=global, nsKey="Microsoft", baseNs=baseNs[nsKey]=(baseNs[nsKey]||{});
10
10
  // Versioned namespace "Microsoft.ApplicationInsights3"
11
11
  var exportNs=baseNs, nsKey="ApplicationInsights3", exportNs=exportNs[nsKey]=(exportNs[nsKey]||{});
@@ -1225,7 +1225,7 @@ function newId(maxLength) {
1225
1225
  return result;
1226
1226
  }
1227
1227
 
1228
- var version = '3.0.3-nightly3.2308-09';
1228
+ var version = '3.0.3-nightly3.2308-11';
1229
1229
  var instanceName = "." + newId(6);
1230
1230
  var _dataUid = 0;
1231
1231
  function createUniqueNamespace(name, includeVersion) {
@@ -2756,7 +2756,8 @@ var ThrottleMgr = /** @class */ (function () {
2756
2756
  };
2757
2757
  _self.canThrottle = function (msgId) {
2758
2758
  var localObj = _getLocalStorageObjByKey(msgId);
2759
- return _canThrottle(_config, _canUseLocalStorage, localObj);
2759
+ var cfg = _getCfgByKey(msgId);
2760
+ return _canThrottle(cfg, _canUseLocalStorage, localObj);
2760
2761
  };
2761
2762
  _self.isTriggered = function (msgId) {
2762
2763
  return _isTrigger(msgId);
@@ -2808,18 +2809,19 @@ var ThrottleMgr = /** @class */ (function () {
2808
2809
  };
2809
2810
  function _flushMessage(msgID, message, severity, saveUnsentMsg) {
2810
2811
  if (_isReady) {
2811
- var isSampledIn = _canSampledIn();
2812
+ var isSampledIn = _canSampledIn(msgID);
2812
2813
  if (!isSampledIn) {
2813
2814
  return;
2814
2815
  }
2816
+ var cfg = _getCfgByKey(msgID);
2815
2817
  var localStorageObj = _getLocalStorageObjByKey(msgID);
2816
- var canThrottle = _canThrottle(_config, _canUseLocalStorage, localStorageObj);
2818
+ var canThrottle = _canThrottle(cfg, _canUseLocalStorage, localStorageObj);
2817
2819
  var throttled = false;
2818
2820
  var number = 0;
2819
2821
  var isTriggered = _isTrigger(msgID);
2820
2822
  try {
2821
2823
  if (canThrottle && !isTriggered) {
2822
- number = Math.min(_config.limit.maxSendNumber, localStorageObj[_DYN_COUNT ] + 1);
2824
+ number = Math.min(cfg.limit.maxSendNumber, localStorageObj[_DYN_COUNT ] + 1);
2823
2825
  localStorageObj[_DYN_COUNT ] = 0;
2824
2826
  throttled = true;
2825
2827
  _isTriggered[msgID] = true;
@@ -2859,23 +2861,39 @@ var ThrottleMgr = /** @class */ (function () {
2859
2861
  _isTriggered = {};
2860
2862
  _localStorageObj = {};
2861
2863
  _queue = {};
2864
+ _config = {};
2865
+ _setCfgByKey(109 );
2862
2866
  _namePrefix = isNotNullOrUndefined(namePrefix) ? namePrefix : "";
2863
2867
  core.addUnloadHook(onConfigChange(core.config, function (details) {
2864
- var _a, _b;
2865
2868
  var coreConfig = details.cfg;
2866
2869
  _canUseLocalStorage = utlCanUseLocalStorage();
2867
2870
  var configMgr = coreConfig.throttleMgrCfg || {};
2868
- _config = {};
2869
- _config[_DYN_DISABLED ] = !!configMgr[_DYN_DISABLED ];
2870
- var configInterval = configMgr[_DYN_INTERVAL ] || {};
2871
+ objForEachKey(configMgr, function (key, cfg) {
2872
+ _setCfgByKey(parseInt(key), cfg);
2873
+ });
2874
+ }));
2875
+ }
2876
+ function _getCfgByKey(msgID) {
2877
+ return _config[msgID] || _config[109 ];
2878
+ }
2879
+ function _setCfgByKey(msgID, config) {
2880
+ var _a, _b;
2881
+ try {
2882
+ var cfg = config || {};
2883
+ var curCfg = {};
2884
+ curCfg[_DYN_DISABLED ] = !!cfg[_DYN_DISABLED ];
2885
+ var configInterval = cfg[_DYN_INTERVAL ] || {};
2871
2886
  _isSpecificDaysGiven = (configInterval === null || configInterval === void 0 ? void 0 : configInterval.daysOfMonth) && (configInterval === null || configInterval === void 0 ? void 0 : configInterval.daysOfMonth[_DYN_LENGTH ]) > 0;
2872
- _config[_DYN_INTERVAL ] = _getIntervalConfig(configInterval);
2887
+ curCfg[_DYN_INTERVAL ] = _getIntervalConfig(configInterval);
2873
2888
  var limit = {
2874
- samplingRate: ((_a = configMgr.limit) === null || _a === void 0 ? void 0 : _a.samplingRate) || 100,
2875
- maxSendNumber: ((_b = configMgr.limit) === null || _b === void 0 ? void 0 : _b.maxSendNumber) || 1
2889
+ samplingRate: ((_a = cfg.limit) === null || _a === void 0 ? void 0 : _a.samplingRate) || 100,
2890
+ maxSendNumber: ((_b = cfg.limit) === null || _b === void 0 ? void 0 : _b.maxSendNumber) || 1
2876
2891
  };
2877
- _config.limit = limit;
2878
- }));
2892
+ curCfg.limit = limit;
2893
+ _config[msgID] = curCfg;
2894
+ }
2895
+ catch (e) {
2896
+ }
2879
2897
  }
2880
2898
  function _getIntervalConfig(interval) {
2881
2899
  interval = interval || {};
@@ -2896,7 +2914,7 @@ var ThrottleMgr = /** @class */ (function () {
2896
2914
  return interval;
2897
2915
  }
2898
2916
  function _canThrottle(config, canUseLocalStorage, localStorageObj) {
2899
- if (!config[_DYN_DISABLED ] && canUseLocalStorage && isNotNullOrUndefined(localStorageObj)) {
2917
+ if (config && !config[_DYN_DISABLED ] && canUseLocalStorage && isNotNullOrUndefined(localStorageObj)) {
2900
2918
  var curDate = _getThrottleDate();
2901
2919
  var date = localStorageObj[_DYN_DATE ];
2902
2920
  var interval = config[_DYN_INTERVAL ];
@@ -2994,8 +3012,14 @@ var ThrottleMgr = /** @class */ (function () {
2994
3012
  function _sendMessage(msgID, logger, message, severity) {
2995
3013
  _throwInternal(logger, severity || 1 , msgID, message);
2996
3014
  }
2997
- function _canSampledIn() {
2998
- return randomValue(1000000) <= _config.limit.samplingRate;
3015
+ function _canSampledIn(msgID) {
3016
+ try {
3017
+ var cfg = _getCfgByKey(msgID);
3018
+ return randomValue(1000000) <= cfg.limit.samplingRate;
3019
+ }
3020
+ catch (e) {
3021
+ }
3022
+ return false;
2999
3023
  }
3000
3024
  function _getLocalStorageObjByKey(key) {
3001
3025
  try {