@microsoft/1ds-core-js 4.3.10-nightly3.2507-28 → 4.3.10-nightly3.2508-02

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 (38) hide show
  1. package/bundle/es5/{ms.core-4.3.10-nightly3.2507-28.gbl.js → ms.core-4.3.10-nightly3.2508-02.gbl.js} +136 -53
  2. package/bundle/es5/{ms.core-4.3.10-nightly3.2507-28.gbl.js.map → ms.core-4.3.10-nightly3.2508-02.gbl.js.map} +1 -1
  3. package/bundle/es5/ms.core-4.3.10-nightly3.2508-02.gbl.min.js +7 -0
  4. package/bundle/es5/{ms.core-4.3.10-nightly3.2507-28.gbl.min.js.map → ms.core-4.3.10-nightly3.2508-02.gbl.min.js.map} +1 -1
  5. package/bundle/es5/ms.core-4.3.10-nightly3.2508-02.integrity.json +46 -0
  6. package/bundle/es5/{ms.core-4.3.10-nightly3.2507-28.js → ms.core-4.3.10-nightly3.2508-02.js} +136 -53
  7. package/bundle/es5/{ms.core-4.3.10-nightly3.2507-28.js.map → ms.core-4.3.10-nightly3.2508-02.js.map} +1 -1
  8. package/bundle/es5/ms.core-4.3.10-nightly3.2508-02.min.js +7 -0
  9. package/bundle/es5/{ms.core-4.3.10-nightly3.2507-28.min.js.map → ms.core-4.3.10-nightly3.2508-02.min.js.map} +1 -1
  10. package/bundle/es5/ms.core.gbl.js +135 -52
  11. package/bundle/es5/ms.core.gbl.js.map +1 -1
  12. package/bundle/es5/ms.core.gbl.min.js +2 -2
  13. package/bundle/es5/ms.core.gbl.min.js.map +1 -1
  14. package/bundle/es5/ms.core.integrity.json +17 -17
  15. package/bundle/es5/ms.core.js +135 -52
  16. package/bundle/es5/ms.core.js.map +1 -1
  17. package/bundle/es5/ms.core.min.js +2 -2
  18. package/bundle/es5/ms.core.min.js.map +1 -1
  19. package/dist/es5/ms.core.js +133 -50
  20. package/dist/es5/ms.core.js.map +1 -1
  21. package/dist/es5/ms.core.min.js +2 -2
  22. package/dist/es5/ms.core.min.js.map +1 -1
  23. package/dist-es5/AppInsightsCore.js +1 -1
  24. package/dist-es5/BaseCore.js +1 -1
  25. package/dist-es5/DataModels.js +1 -1
  26. package/dist-es5/Enums.js +1 -1
  27. package/dist-es5/Index.js +1 -1
  28. package/dist-es5/InternalConstants.js +1 -1
  29. package/dist-es5/Utils.js +2 -2
  30. package/dist-es5/Utils.js.map +1 -1
  31. package/dist-es5/ValueSanitizer.js +1 -1
  32. package/dist-es5/__DynamicConstants.js +1 -1
  33. package/package.json +2 -2
  34. package/types/1ds-core-js.d.ts +2 -2
  35. package/types/1ds-core-js.namespaced.d.ts +10 -2
  36. package/bundle/es5/ms.core-4.3.10-nightly3.2507-28.gbl.min.js +0 -7
  37. package/bundle/es5/ms.core-4.3.10-nightly3.2507-28.integrity.json +0 -46
  38. package/bundle/es5/ms.core-4.3.10-nightly3.2507-28.min.js +0 -7
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * 1DS JS SDK Core, 4.3.10-nightly3.2507-28
2
+ * 1DS JS SDK Core, 4.3.10-nightly3.2508-02
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  * (Microsoft Internal Only)
5
5
  */
6
6
  (function (global, factory) {
7
7
  var undef = "undefined";
8
- var nsKey, key, nm, theExports = {}, modName = "es5_ms_core_4_3_10_nightly3_2507_28", msMod="__ms$mod__";
9
- var mods={}, modDetail=mods[modName]={}, ver="4.3.10-nightly3.2507-28";
8
+ var nsKey, key, nm, theExports = {}, modName = "es5_ms_core_4_3_10_nightly3_2508_02", msMod="__ms$mod__";
9
+ var mods={}, modDetail=mods[modName]={}, ver="4.3.10-nightly3.2508-02";
10
10
  // Versioned namespace "oneDS4"
11
11
  var exportNs=global, nsKey="oneDS4", exportNs=exportNs[nsKey]=(exportNs[nsKey]||{});
12
12
  // Global namespace "oneDS"
@@ -2542,7 +2542,7 @@ function newId(maxLength) {
2542
2542
  return result;
2543
2543
  }
2544
2544
 
2545
- var version = '3.3.10-nightly3.2507-28';
2545
+ var version = '3.3.10-nightly3.2508-02';
2546
2546
  var instanceName = "." + newId(6);
2547
2547
  var _dataUid = 0;
2548
2548
  function _canAcceptData(target) {
@@ -3499,6 +3499,7 @@ var rootDefaultConfig = (_a$3 = {
3499
3499
  _b.enabled = UNDEFINED_VALUE,
3500
3500
  _b.ignoreCookies = UNDEFINED_VALUE,
3501
3501
  _b.blockedCookies = UNDEFINED_VALUE,
3502
+ _b.disableCookieDefer = false,
3502
3503
  _b)),
3503
3504
  cookieDomain: UNDEFINED_VALUE,
3504
3505
  cookiePath: UNDEFINED_VALUE
@@ -3578,16 +3579,99 @@ function createCookieMgr(rootConfig, logger) {
3578
3579
  var _getCookieFn;
3579
3580
  var _setCookieFn;
3580
3581
  var _delCookieFn;
3582
+ var _pendingCookies = [];
3583
+ function _formatDeletionValue(path) {
3584
+ var _a;
3585
+ var values = (_a = {},
3586
+ _a[STR_PATH] = path ? path : "/",
3587
+ _a[strExpires] = "Thu, 01 Jan 1970 00:00:01 GMT",
3588
+ _a);
3589
+ if (!isIE()) {
3590
+ values["max-age"] = "0";
3591
+ }
3592
+ return _formatCookieValue(STR_EMPTY$2, values);
3593
+ }
3594
+ function _formatSetCookieValue(value, maxAgeSec, domain, path) {
3595
+ var values = {};
3596
+ var theValue = strTrim(value || STR_EMPTY$2);
3597
+ var idx = strIndexOf(theValue, ";");
3598
+ if (idx !== -1) {
3599
+ theValue = strTrim(strLeft(value, idx));
3600
+ values = _extractParts(strSubstring(value, idx + 1));
3601
+ }
3602
+ setValue(values, STR_DOMAIN, domain || _domain, isTruthy, isUndefined);
3603
+ if (!isNullOrUndefined(maxAgeSec)) {
3604
+ var _isIE = isIE();
3605
+ if (isUndefined(values[strExpires])) {
3606
+ var nowMs = utcNow();
3607
+ var expireMs = nowMs + (maxAgeSec * 1000);
3608
+ if (expireMs > 0) {
3609
+ var expiry = new Date();
3610
+ expiry.setTime(expireMs);
3611
+ setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || STR_EMPTY$2, isTruthy);
3612
+ }
3613
+ }
3614
+ if (!_isIE) {
3615
+ setValue(values, "max-age", STR_EMPTY$2 + maxAgeSec, null, isUndefined);
3616
+ }
3617
+ }
3618
+ var location = getLocation();
3619
+ if (location && location.protocol === "https:") {
3620
+ setValue(values, "secure", null, null, isUndefined);
3621
+ if (_allowUaSameSite === null) {
3622
+ _allowUaSameSite = !uaDisallowsSameSiteNone((getNavigator() || {})[_DYN_USER_AGENT ]);
3623
+ }
3624
+ if (_allowUaSameSite) {
3625
+ setValue(values, "SameSite", "None", null, isUndefined);
3626
+ }
3627
+ }
3628
+ setValue(values, STR_PATH, path || _path, null, isUndefined);
3629
+ return _formatCookieValue(theValue, values);
3630
+ }
3631
+ function _removePendingCookie(name) {
3632
+ if (_pendingCookies) {
3633
+ for (var i = _pendingCookies[_DYN_LENGTH$1 ] - 1; i >= 0; i--) {
3634
+ if (_pendingCookies[i].n === name) {
3635
+ _pendingCookies[_DYN_SPLICE ](i, 1);
3636
+ }
3637
+ }
3638
+ }
3639
+ }
3640
+ function _flushPendingCookies() {
3641
+ if (areCookiesSupported(logger) && _pendingCookies) {
3642
+ arrForEach(_pendingCookies, function (pendingData) {
3643
+ if (!_isBlockedCookie(cookieMgrConfig, pendingData.n)) {
3644
+ if (pendingData.o === 0 ) {
3645
+ _setCookieFn(pendingData.n, pendingData.v);
3646
+ }
3647
+ else if (pendingData.o === 1 ) {
3648
+ _delCookieFn(pendingData.n, pendingData.v);
3649
+ }
3650
+ }
3651
+ });
3652
+ _pendingCookies = [];
3653
+ }
3654
+ }
3581
3655
  rootConfig = createDynamicConfig(rootConfig || _globalCookieConfig, null, logger).cfg;
3582
3656
  unloadHandler = onConfigChange(rootConfig, function (details) {
3583
3657
  details.setDf(details.cfg, rootDefaultConfig);
3584
3658
  cookieMgrConfig = details.ref(details.cfg, "cookieCfg");
3585
3659
  _path = cookieMgrConfig[STR_PATH ] || "/";
3586
3660
  _domain = cookieMgrConfig[STR_DOMAIN ];
3661
+ if (cookieMgrConfig.disableCookieDefer) {
3662
+ _pendingCookies = null;
3663
+ }
3664
+ else if (_pendingCookies === null) {
3665
+ _pendingCookies = [];
3666
+ }
3667
+ var wasEnabled = _enabled;
3587
3668
  _enabled = _isCfgEnabled(rootConfig, cookieMgrConfig) !== false;
3588
3669
  _getCookieFn = cookieMgrConfig.getCookie || _getCookieValue;
3589
3670
  _setCookieFn = cookieMgrConfig.setCookie || _setCookieValue;
3590
3671
  _delCookieFn = cookieMgrConfig.delCookie || _setCookieValue;
3672
+ if (!wasEnabled && _enabled && _pendingCookies) {
3673
+ _flushPendingCookies();
3674
+ }
3591
3675
  }, logger);
3592
3676
  var cookieMgr = {
3593
3677
  isEnabled: function () {
@@ -3599,55 +3683,52 @@ function createCookieMgr(rootConfig, logger) {
3599
3683
  return enabled;
3600
3684
  },
3601
3685
  setEnabled: function (value) {
3602
- _enabled = value !== false;
3603
3686
  cookieMgrConfig[_DYN_ENABLED ] = value;
3687
+ if (!isUndefined(rootConfig[strDisableCookiesUsage])) {
3688
+ rootConfig[strDisableCookiesUsage] = !value;
3689
+ }
3604
3690
  },
3605
3691
  set: function (name, value, maxAgeSec, domain, path) {
3606
3692
  var result = false;
3607
- if (_isMgrEnabled(cookieMgr) && !_isBlockedCookie(cookieMgrConfig, name)) {
3608
- var values = {};
3609
- var theValue = strTrim(value || STR_EMPTY$2);
3610
- var idx = strIndexOf(theValue, ";");
3611
- if (idx !== -1) {
3612
- theValue = strTrim(strLeft(value, idx));
3613
- values = _extractParts(strSubstring(value, idx + 1));
3614
- }
3615
- setValue(values, STR_DOMAIN, domain || _domain, isTruthy, isUndefined);
3616
- if (!isNullOrUndefined(maxAgeSec)) {
3617
- var _isIE = isIE();
3618
- if (isUndefined(values[strExpires])) {
3619
- var nowMs = utcNow();
3620
- var expireMs = nowMs + (maxAgeSec * 1000);
3621
- if (expireMs > 0) {
3622
- var expiry = new Date();
3623
- expiry.setTime(expireMs);
3624
- setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || STR_EMPTY$2, isTruthy);
3625
- }
3626
- }
3627
- if (!_isIE) {
3628
- setValue(values, "max-age", STR_EMPTY$2 + maxAgeSec, null, isUndefined);
3629
- }
3693
+ var isBlocked = _isBlockedCookie(cookieMgrConfig, name);
3694
+ if (!isBlocked) {
3695
+ var cookieValue = _formatSetCookieValue(value, maxAgeSec, domain, path);
3696
+ if (_isMgrEnabled(cookieMgr)) {
3697
+ _setCookieFn(name, cookieValue);
3698
+ result = true;
3630
3699
  }
3631
- var location_1 = getLocation();
3632
- if (location_1 && location_1.protocol === "https:") {
3633
- setValue(values, "secure", null, null, isUndefined);
3634
- if (_allowUaSameSite === null) {
3635
- _allowUaSameSite = !uaDisallowsSameSiteNone((getNavigator() || {})[_DYN_USER_AGENT ]);
3636
- }
3637
- if (_allowUaSameSite) {
3638
- setValue(values, "SameSite", "None", null, isUndefined);
3639
- }
3700
+ else if (_pendingCookies) {
3701
+ _removePendingCookie(name);
3702
+ _pendingCookies[_DYN_PUSH ]({
3703
+ n: name,
3704
+ o: 0 ,
3705
+ v: cookieValue
3706
+ });
3707
+ result = true;
3640
3708
  }
3641
- setValue(values, STR_PATH, path || _path, null, isUndefined);
3642
- _setCookieFn(name, _formatCookieValue(theValue, values));
3643
- result = true;
3644
3709
  }
3645
3710
  return result;
3646
3711
  },
3647
3712
  get: function (name) {
3648
3713
  var value = STR_EMPTY$2;
3649
- if (_isMgrEnabled(cookieMgr) && !_isIgnoredCookie(cookieMgrConfig, name)) {
3650
- value = _getCookieFn(name);
3714
+ var isIgnored = _isIgnoredCookie(cookieMgrConfig, name);
3715
+ if (!isIgnored) {
3716
+ if (_isMgrEnabled(cookieMgr)) {
3717
+ value = _getCookieFn(name);
3718
+ }
3719
+ else if (_pendingCookies) {
3720
+ for (var i = _pendingCookies[_DYN_LENGTH$1 ] - 1; i >= 0; i--) {
3721
+ var pendingData = _pendingCookies[i];
3722
+ if (pendingData.n === name) {
3723
+ if (pendingData.o === 0 ) {
3724
+ var cookieValue = pendingData.v;
3725
+ var idx = strIndexOf(cookieValue, ";");
3726
+ value = idx !== -1 ? strTrim(strLeft(cookieValue, idx)) : strTrim(cookieValue);
3727
+ }
3728
+ break;
3729
+ }
3730
+ }
3731
+ }
3651
3732
  }
3652
3733
  return value;
3653
3734
  },
@@ -3656,20 +3737,21 @@ function createCookieMgr(rootConfig, logger) {
3656
3737
  if (_isMgrEnabled(cookieMgr)) {
3657
3738
  result = cookieMgr.purge(name, path);
3658
3739
  }
3740
+ else if (_pendingCookies) {
3741
+ _removePendingCookie(name);
3742
+ _pendingCookies[_DYN_PUSH ]({
3743
+ n: name,
3744
+ o: 1 ,
3745
+ v: _formatDeletionValue(path)
3746
+ });
3747
+ result = true;
3748
+ }
3659
3749
  return result;
3660
3750
  },
3661
3751
  purge: function (name, path) {
3662
- var _a;
3663
3752
  var result = false;
3664
3753
  if (areCookiesSupported(logger)) {
3665
- var values = (_a = {},
3666
- _a[STR_PATH] = path ? path : "/",
3667
- _a[strExpires] = "Thu, 01 Jan 1970 00:00:01 GMT",
3668
- _a);
3669
- if (!isIE()) {
3670
- values["max-age"] = "0";
3671
- }
3672
- _delCookieFn(name, _formatCookieValue(STR_EMPTY$2, values));
3754
+ _delCookieFn(name, _formatDeletionValue(path));
3673
3755
  result = true;
3674
3756
  }
3675
3757
  return result;
@@ -3677,6 +3759,7 @@ function createCookieMgr(rootConfig, logger) {
3677
3759
  unload: function (isAsync) {
3678
3760
  unloadHandler && unloadHandler.rm();
3679
3761
  unloadHandler = null;
3762
+ _pendingCookies = null;
3680
3763
  }
3681
3764
  };
3682
3765
  cookieMgr[strConfigCookieMgr] = cookieMgr;
@@ -6713,7 +6796,7 @@ var _DYN_RM_FIELD_SANITIZER = "rmFieldSanitizer";
6713
6796
  var _DYN_CAN_HANDLE = "canHandle";
6714
6797
 
6715
6798
  var _a;
6716
- var Version = '4.3.10-nightly3.2507-28';
6799
+ var Version = '4.3.10-nightly3.2508-02';
6717
6800
  var FullVersionString = "1DS-Web-JS-" + Version;
6718
6801
  var ObjHasOwnProperty = ObjProto$1.hasOwnProperty;
6719
6802
  var strDisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
@@ -7471,4 +7554,4 @@ exports.toISOString = toISOString;
7471
7554
  exports.useXDomainRequest = useXDomainRequest;
7472
7555
 
7473
7556
  }));
7474
- //# sourceMappingURL=ms.core-4.3.10-nightly3.2507-28.gbl.js.map
7557
+ //# sourceMappingURL=ms.core-4.3.10-nightly3.2508-02.gbl.js.map