@microsoft/applicationinsights-core-js 3.3.10-nightly3.2507-29 → 3.3.10-nightly3.2508-01

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 (104) hide show
  1. package/browser/es5/applicationinsights-core-js.cjs.js +132 -49
  2. package/browser/es5/applicationinsights-core-js.cjs.js.map +1 -1
  3. package/browser/es5/applicationinsights-core-js.cjs.min.js +2 -2
  4. package/browser/es5/applicationinsights-core-js.cjs.min.js.map +1 -1
  5. package/browser/es5/applicationinsights-core-js.gbl.js +134 -51
  6. package/browser/es5/applicationinsights-core-js.gbl.js.map +1 -1
  7. package/browser/es5/applicationinsights-core-js.gbl.min.js +2 -2
  8. package/browser/es5/applicationinsights-core-js.gbl.min.js.map +1 -1
  9. package/browser/es5/applicationinsights-core-js.integrity.json +25 -25
  10. package/browser/es5/applicationinsights-core-js.js +134 -51
  11. package/browser/es5/applicationinsights-core-js.js.map +1 -1
  12. package/browser/es5/applicationinsights-core-js.min.js +2 -2
  13. package/browser/es5/applicationinsights-core-js.min.js.map +1 -1
  14. package/dist/es5/applicationinsights-core-js.js +132 -49
  15. package/dist/es5/applicationinsights-core-js.js.map +1 -1
  16. package/dist/es5/applicationinsights-core-js.min.js +2 -2
  17. package/dist/es5/applicationinsights-core-js.min.js.map +1 -1
  18. package/dist-es5/Config/ConfigDefaultHelpers.js +1 -1
  19. package/dist-es5/Config/ConfigDefaults.js +1 -1
  20. package/dist-es5/Config/DynamicConfig.js +1 -1
  21. package/dist-es5/Config/DynamicProperty.js +1 -1
  22. package/dist-es5/Config/DynamicState.js +1 -1
  23. package/dist-es5/Config/DynamicSupport.js +1 -1
  24. package/dist-es5/Config/IConfigDefaults.js +1 -1
  25. package/dist-es5/Config/IDynamicConfigHandler.js +1 -1
  26. package/dist-es5/Config/IDynamicPropertyHandler.js +1 -1
  27. package/dist-es5/Config/IDynamicWatcher.js +1 -1
  28. package/dist-es5/Config/_IDynamicConfigHandlerState.js +1 -1
  29. package/dist-es5/JavaScriptSDK/AggregationError.js +1 -1
  30. package/dist-es5/JavaScriptSDK/AppInsightsCore.js +1 -1
  31. package/dist-es5/JavaScriptSDK/AsyncUtils.js +1 -1
  32. package/dist-es5/JavaScriptSDK/BaseTelemetryPlugin.js +1 -1
  33. package/dist-es5/JavaScriptSDK/Constants.js +1 -1
  34. package/dist-es5/JavaScriptSDK/CookieMgr.js +172 -58
  35. package/dist-es5/JavaScriptSDK/CookieMgr.js.map +1 -1
  36. package/dist-es5/JavaScriptSDK/CoreUtils.js +1 -1
  37. package/dist-es5/JavaScriptSDK/DataCacheHelper.js +2 -2
  38. package/dist-es5/JavaScriptSDK/DataCacheHelper.js.map +1 -1
  39. package/dist-es5/JavaScriptSDK/DbgExtensionUtils.js +1 -1
  40. package/dist-es5/JavaScriptSDK/DiagnosticLogger.js +1 -1
  41. package/dist-es5/JavaScriptSDK/EnvUtils.js +1 -1
  42. package/dist-es5/JavaScriptSDK/EventHelpers.js +1 -1
  43. package/dist-es5/JavaScriptSDK/HelperFuncs.js +1 -1
  44. package/dist-es5/JavaScriptSDK/InstrumentHooks.js +1 -1
  45. package/dist-es5/JavaScriptSDK/InternalConstants.js +1 -1
  46. package/dist-es5/JavaScriptSDK/NotificationManager.js +1 -1
  47. package/dist-es5/JavaScriptSDK/PerfManager.js +1 -1
  48. package/dist-es5/JavaScriptSDK/ProcessTelemetryContext.js +1 -1
  49. package/dist-es5/JavaScriptSDK/RandomHelper.js +1 -1
  50. package/dist-es5/JavaScriptSDK/ResponseHelpers.js +1 -1
  51. package/dist-es5/JavaScriptSDK/SenderPostManager.js +1 -1
  52. package/dist-es5/JavaScriptSDK/StatsBeat.js +1 -1
  53. package/dist-es5/JavaScriptSDK/TelemetryHelpers.js +1 -1
  54. package/dist-es5/JavaScriptSDK/TelemetryInitializerPlugin.js +1 -1
  55. package/dist-es5/JavaScriptSDK/UnloadHandlerContainer.js +1 -1
  56. package/dist-es5/JavaScriptSDK/UnloadHookContainer.js +1 -1
  57. package/dist-es5/JavaScriptSDK/W3cTraceParent.js +1 -1
  58. package/dist-es5/JavaScriptSDK.Enums/EnumHelperFuncs.js +1 -1
  59. package/dist-es5/JavaScriptSDK.Enums/EventsDiscardedReason.js +1 -1
  60. package/dist-es5/JavaScriptSDK.Enums/FeatureOptInEnums.js +1 -1
  61. package/dist-es5/JavaScriptSDK.Enums/InitActiveStatusEnum.js +1 -1
  62. package/dist-es5/JavaScriptSDK.Enums/LoggingEnums.js +1 -1
  63. package/dist-es5/JavaScriptSDK.Enums/SendRequestReason.js +1 -1
  64. package/dist-es5/JavaScriptSDK.Enums/StatsType.js +1 -1
  65. package/dist-es5/JavaScriptSDK.Enums/TelemetryUnloadReason.js +1 -1
  66. package/dist-es5/JavaScriptSDK.Enums/TelemetryUpdateReason.js +1 -1
  67. package/dist-es5/JavaScriptSDK.Interfaces/IAppInsightsCore.js +1 -1
  68. package/dist-es5/JavaScriptSDK.Interfaces/IChannelControls.js +1 -1
  69. package/dist-es5/JavaScriptSDK.Interfaces/IChannelControlsHost.js +1 -1
  70. package/dist-es5/JavaScriptSDK.Interfaces/IConfiguration.js +1 -1
  71. package/dist-es5/JavaScriptSDK.Interfaces/ICookieMgr.js +1 -1
  72. package/dist-es5/JavaScriptSDK.Interfaces/IDbgExtension.js +1 -1
  73. package/dist-es5/JavaScriptSDK.Interfaces/IDiagnosticLogger.js +1 -1
  74. package/dist-es5/JavaScriptSDK.Interfaces/IDistributedTraceContext.js +1 -1
  75. package/dist-es5/JavaScriptSDK.Interfaces/IExceptionConfig.js +1 -1
  76. package/dist-es5/JavaScriptSDK.Interfaces/IFeatureOptIn.js +1 -1
  77. package/dist-es5/JavaScriptSDK.Interfaces/IInstrumentHooks.js +1 -1
  78. package/dist-es5/JavaScriptSDK.Interfaces/INetworkStatsbeat.js +1 -1
  79. package/dist-es5/JavaScriptSDK.Interfaces/INotificationListener.js +1 -1
  80. package/dist-es5/JavaScriptSDK.Interfaces/INotificationManager.js +1 -1
  81. package/dist-es5/JavaScriptSDK.Interfaces/IPerfEvent.js +1 -1
  82. package/dist-es5/JavaScriptSDK.Interfaces/IPerfManager.js +1 -1
  83. package/dist-es5/JavaScriptSDK.Interfaces/IProcessTelemetryContext.js +1 -1
  84. package/dist-es5/JavaScriptSDK.Interfaces/ISenderPostManager.js +1 -1
  85. package/dist-es5/JavaScriptSDK.Interfaces/IStatsBeat.js +1 -1
  86. package/dist-es5/JavaScriptSDK.Interfaces/IStatsEventData.js +1 -1
  87. package/dist-es5/JavaScriptSDK.Interfaces/IStatsMgr.js +1 -1
  88. package/dist-es5/JavaScriptSDK.Interfaces/ITelemetryInitializers.js +1 -1
  89. package/dist-es5/JavaScriptSDK.Interfaces/ITelemetryItem.js +1 -1
  90. package/dist-es5/JavaScriptSDK.Interfaces/ITelemetryPlugin.js +1 -1
  91. package/dist-es5/JavaScriptSDK.Interfaces/ITelemetryPluginChain.js +1 -1
  92. package/dist-es5/JavaScriptSDK.Interfaces/ITelemetryUnloadState.js +1 -1
  93. package/dist-es5/JavaScriptSDK.Interfaces/ITelemetryUpdateState.js +1 -1
  94. package/dist-es5/JavaScriptSDK.Interfaces/ITraceParent.js +1 -1
  95. package/dist-es5/JavaScriptSDK.Interfaces/IUnloadHook.js +1 -1
  96. package/dist-es5/JavaScriptSDK.Interfaces/IUnloadableComponent.js +1 -1
  97. package/dist-es5/JavaScriptSDK.Interfaces/IXDomainRequest.js +1 -1
  98. package/dist-es5/JavaScriptSDK.Interfaces/IXHROverride.js +1 -1
  99. package/dist-es5/__DynamicConstants.js +4 -4
  100. package/dist-es5/__DynamicConstants.js.map +1 -1
  101. package/dist-es5/applicationinsights-core-js.js +1 -1
  102. package/package.json +1 -1
  103. package/types/applicationinsights-core-js.d.ts +9 -1
  104. package/types/applicationinsights-core-js.namespaced.d.ts +9 -1
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - Core, 3.3.10-nightly3.2507-29
2
+ * Application Insights JavaScript SDK - Core, 3.3.10-nightly3.2508-01
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_core_js_3_3_10_nightly3_2507_29", msMod="__ms$mod__";
8
- var mods={}, modDetail=mods[modName]={}, ver="3.3.10-nightly3.2507-29";
7
+ var nsKey, key, nm, theExports = {}, modName = "es5_applicationinsights_core_js_3_3_10_nightly3_2508_01", msMod="__ms$mod__";
8
+ var mods={}, modDetail=mods[modName]={}, ver="3.3.10-nightly3.2508-01";
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]||{});
@@ -2679,7 +2679,7 @@ function newId(maxLength) {
2679
2679
  return result;
2680
2680
  }
2681
2681
 
2682
- var version = '3.3.10-nightly3.2507-29';
2682
+ var version = '3.3.10-nightly3.2508-01';
2683
2683
  var instanceName = "." + newId(6);
2684
2684
  var _dataUid = 0;
2685
2685
  function _canAcceptData(target) {
@@ -3683,6 +3683,7 @@ var rootDefaultConfig = (_a$2 = {
3683
3683
  _b.enabled = UNDEFINED_VALUE,
3684
3684
  _b.ignoreCookies = UNDEFINED_VALUE,
3685
3685
  _b.blockedCookies = UNDEFINED_VALUE,
3686
+ _b.disableCookieDefer = false,
3686
3687
  _b)),
3687
3688
  cookieDomain: UNDEFINED_VALUE,
3688
3689
  cookiePath: UNDEFINED_VALUE
@@ -3762,16 +3763,99 @@ function createCookieMgr(rootConfig, logger) {
3762
3763
  var _getCookieFn;
3763
3764
  var _setCookieFn;
3764
3765
  var _delCookieFn;
3766
+ var _pendingCookies = [];
3767
+ function _formatDeletionValue(path) {
3768
+ var _a;
3769
+ var values = (_a = {},
3770
+ _a[STR_PATH] = path ? path : "/",
3771
+ _a[strExpires] = "Thu, 01 Jan 1970 00:00:01 GMT",
3772
+ _a);
3773
+ if (!isIE()) {
3774
+ values["max-age"] = "0";
3775
+ }
3776
+ return _formatCookieValue(STR_EMPTY$1, values);
3777
+ }
3778
+ function _formatSetCookieValue(value, maxAgeSec, domain, path) {
3779
+ var values = {};
3780
+ var theValue = strTrim(value || STR_EMPTY$1);
3781
+ var idx = strIndexOf(theValue, ";");
3782
+ if (idx !== -1) {
3783
+ theValue = strTrim(strLeft(value, idx));
3784
+ values = _extractParts(strSubstring(value, idx + 1));
3785
+ }
3786
+ setValue(values, STR_DOMAIN, domain || _domain, isTruthy, isUndefined);
3787
+ if (!isNullOrUndefined(maxAgeSec)) {
3788
+ var _isIE = isIE();
3789
+ if (isUndefined(values[strExpires])) {
3790
+ var nowMs = utcNow();
3791
+ var expireMs = nowMs + (maxAgeSec * 1000);
3792
+ if (expireMs > 0) {
3793
+ var expiry = new Date();
3794
+ expiry.setTime(expireMs);
3795
+ setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || STR_EMPTY$1, isTruthy);
3796
+ }
3797
+ }
3798
+ if (!_isIE) {
3799
+ setValue(values, "max-age", STR_EMPTY$1 + maxAgeSec, null, isUndefined);
3800
+ }
3801
+ }
3802
+ var location = getLocation();
3803
+ if (location && location.protocol === "https:") {
3804
+ setValue(values, "secure", null, null, isUndefined);
3805
+ if (_allowUaSameSite === null) {
3806
+ _allowUaSameSite = !uaDisallowsSameSiteNone((getNavigator() || {})[_DYN_USER_AGENT ]);
3807
+ }
3808
+ if (_allowUaSameSite) {
3809
+ setValue(values, "SameSite", "None", null, isUndefined);
3810
+ }
3811
+ }
3812
+ setValue(values, STR_PATH, path || _path, null, isUndefined);
3813
+ return _formatCookieValue(theValue, values);
3814
+ }
3815
+ function _removePendingCookie(name) {
3816
+ if (_pendingCookies) {
3817
+ for (var i = _pendingCookies[_DYN_LENGTH ] - 1; i >= 0; i--) {
3818
+ if (_pendingCookies[i].n === name) {
3819
+ _pendingCookies[_DYN_SPLICE ](i, 1);
3820
+ }
3821
+ }
3822
+ }
3823
+ }
3824
+ function _flushPendingCookies() {
3825
+ if (areCookiesSupported(logger) && _pendingCookies) {
3826
+ arrForEach(_pendingCookies, function (pendingData) {
3827
+ if (!_isBlockedCookie(cookieMgrConfig, pendingData.n)) {
3828
+ if (pendingData.o === 0 ) {
3829
+ _setCookieFn(pendingData.n, pendingData.v);
3830
+ }
3831
+ else if (pendingData.o === 1 ) {
3832
+ _delCookieFn(pendingData.n, pendingData.v);
3833
+ }
3834
+ }
3835
+ });
3836
+ _pendingCookies = [];
3837
+ }
3838
+ }
3765
3839
  rootConfig = createDynamicConfig(rootConfig || _globalCookieConfig, null, logger).cfg;
3766
3840
  unloadHandler = onConfigChange(rootConfig, function (details) {
3767
3841
  details.setDf(details.cfg, rootDefaultConfig);
3768
3842
  cookieMgrConfig = details.ref(details.cfg, "cookieCfg");
3769
3843
  _path = cookieMgrConfig[STR_PATH ] || "/";
3770
3844
  _domain = cookieMgrConfig[STR_DOMAIN ];
3845
+ if (cookieMgrConfig.disableCookieDefer) {
3846
+ _pendingCookies = null;
3847
+ }
3848
+ else if (_pendingCookies === null) {
3849
+ _pendingCookies = [];
3850
+ }
3851
+ var wasEnabled = _enabled;
3771
3852
  _enabled = _isCfgEnabled(rootConfig, cookieMgrConfig) !== false;
3772
3853
  _getCookieFn = cookieMgrConfig.getCookie || _getCookieValue;
3773
3854
  _setCookieFn = cookieMgrConfig.setCookie || _setCookieValue;
3774
3855
  _delCookieFn = cookieMgrConfig.delCookie || _setCookieValue;
3856
+ if (!wasEnabled && _enabled && _pendingCookies) {
3857
+ _flushPendingCookies();
3858
+ }
3775
3859
  }, logger);
3776
3860
  var cookieMgr = {
3777
3861
  isEnabled: function () {
@@ -3783,55 +3867,52 @@ function createCookieMgr(rootConfig, logger) {
3783
3867
  return enabled;
3784
3868
  },
3785
3869
  setEnabled: function (value) {
3786
- _enabled = value !== false;
3787
3870
  cookieMgrConfig[_DYN_ENABLED ] = value;
3871
+ if (!isUndefined(rootConfig[strDisableCookiesUsage])) {
3872
+ rootConfig[strDisableCookiesUsage] = !value;
3873
+ }
3788
3874
  },
3789
3875
  set: function (name, value, maxAgeSec, domain, path) {
3790
3876
  var result = false;
3791
- if (_isMgrEnabled(cookieMgr) && !_isBlockedCookie(cookieMgrConfig, name)) {
3792
- var values = {};
3793
- var theValue = strTrim(value || STR_EMPTY$1);
3794
- var idx = strIndexOf(theValue, ";");
3795
- if (idx !== -1) {
3796
- theValue = strTrim(strLeft(value, idx));
3797
- values = _extractParts(strSubstring(value, idx + 1));
3798
- }
3799
- setValue(values, STR_DOMAIN, domain || _domain, isTruthy, isUndefined);
3800
- if (!isNullOrUndefined(maxAgeSec)) {
3801
- var _isIE = isIE();
3802
- if (isUndefined(values[strExpires])) {
3803
- var nowMs = utcNow();
3804
- var expireMs = nowMs + (maxAgeSec * 1000);
3805
- if (expireMs > 0) {
3806
- var expiry = new Date();
3807
- expiry.setTime(expireMs);
3808
- setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || STR_EMPTY$1, isTruthy);
3809
- }
3810
- }
3811
- if (!_isIE) {
3812
- setValue(values, "max-age", STR_EMPTY$1 + maxAgeSec, null, isUndefined);
3813
- }
3877
+ var isBlocked = _isBlockedCookie(cookieMgrConfig, name);
3878
+ if (!isBlocked) {
3879
+ var cookieValue = _formatSetCookieValue(value, maxAgeSec, domain, path);
3880
+ if (_isMgrEnabled(cookieMgr)) {
3881
+ _setCookieFn(name, cookieValue);
3882
+ result = true;
3814
3883
  }
3815
- var location_1 = getLocation();
3816
- if (location_1 && location_1.protocol === "https:") {
3817
- setValue(values, "secure", null, null, isUndefined);
3818
- if (_allowUaSameSite === null) {
3819
- _allowUaSameSite = !uaDisallowsSameSiteNone((getNavigator() || {})[_DYN_USER_AGENT ]);
3820
- }
3821
- if (_allowUaSameSite) {
3822
- setValue(values, "SameSite", "None", null, isUndefined);
3823
- }
3884
+ else if (_pendingCookies) {
3885
+ _removePendingCookie(name);
3886
+ _pendingCookies[_DYN_PUSH ]({
3887
+ n: name,
3888
+ o: 0 ,
3889
+ v: cookieValue
3890
+ });
3891
+ result = true;
3824
3892
  }
3825
- setValue(values, STR_PATH, path || _path, null, isUndefined);
3826
- _setCookieFn(name, _formatCookieValue(theValue, values));
3827
- result = true;
3828
3893
  }
3829
3894
  return result;
3830
3895
  },
3831
3896
  get: function (name) {
3832
3897
  var value = STR_EMPTY$1;
3833
- if (_isMgrEnabled(cookieMgr) && !_isIgnoredCookie(cookieMgrConfig, name)) {
3834
- value = _getCookieFn(name);
3898
+ var isIgnored = _isIgnoredCookie(cookieMgrConfig, name);
3899
+ if (!isIgnored) {
3900
+ if (_isMgrEnabled(cookieMgr)) {
3901
+ value = _getCookieFn(name);
3902
+ }
3903
+ else if (_pendingCookies) {
3904
+ for (var i = _pendingCookies[_DYN_LENGTH ] - 1; i >= 0; i--) {
3905
+ var pendingData = _pendingCookies[i];
3906
+ if (pendingData.n === name) {
3907
+ if (pendingData.o === 0 ) {
3908
+ var cookieValue = pendingData.v;
3909
+ var idx = strIndexOf(cookieValue, ";");
3910
+ value = idx !== -1 ? strTrim(strLeft(cookieValue, idx)) : strTrim(cookieValue);
3911
+ }
3912
+ break;
3913
+ }
3914
+ }
3915
+ }
3835
3916
  }
3836
3917
  return value;
3837
3918
  },
@@ -3840,20 +3921,21 @@ function createCookieMgr(rootConfig, logger) {
3840
3921
  if (_isMgrEnabled(cookieMgr)) {
3841
3922
  result = cookieMgr.purge(name, path);
3842
3923
  }
3924
+ else if (_pendingCookies) {
3925
+ _removePendingCookie(name);
3926
+ _pendingCookies[_DYN_PUSH ]({
3927
+ n: name,
3928
+ o: 1 ,
3929
+ v: _formatDeletionValue(path)
3930
+ });
3931
+ result = true;
3932
+ }
3843
3933
  return result;
3844
3934
  },
3845
3935
  purge: function (name, path) {
3846
- var _a;
3847
3936
  var result = false;
3848
3937
  if (areCookiesSupported(logger)) {
3849
- var values = (_a = {},
3850
- _a[STR_PATH] = path ? path : "/",
3851
- _a[strExpires] = "Thu, 01 Jan 1970 00:00:01 GMT",
3852
- _a);
3853
- if (!isIE()) {
3854
- values["max-age"] = "0";
3855
- }
3856
- _delCookieFn(name, _formatCookieValue(STR_EMPTY$1, values));
3938
+ _delCookieFn(name, _formatDeletionValue(path));
3857
3939
  result = true;
3858
3940
  }
3859
3941
  return result;
@@ -3861,6 +3943,7 @@ function createCookieMgr(rootConfig, logger) {
3861
3943
  unload: function (isAsync) {
3862
3944
  unloadHandler && unloadHandler.rm();
3863
3945
  unloadHandler = null;
3946
+ _pendingCookies = null;
3864
3947
  }
3865
3948
  };
3866
3949
  cookieMgr[strConfigCookieMgr] = cookieMgr;