@microsoft/applicationinsights-properties-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 (50) hide show
  1. package/browser/es5/{ai.props.3.3.10-nightly3.2507-29.js → ai.props.3.3.10-nightly3.2508-01.cjs.js} +134 -78
  2. package/browser/es5/{ai.props.3.3.10-nightly3.2507-29.gbl.js.map → ai.props.3.3.10-nightly3.2508-01.cjs.js.map} +1 -1
  3. package/browser/es5/{ai.props.3.3.10-nightly3.2507-29.cjs.min.js → ai.props.3.3.10-nightly3.2508-01.cjs.min.js} +3 -3
  4. package/browser/es5/{ai.props.3.3.10-nightly3.2507-29.cjs.min.js.map → ai.props.3.3.10-nightly3.2508-01.cjs.min.js.map} +1 -1
  5. package/browser/es5/{ai.props.3.3.10-nightly3.2507-29.gbl.js → ai.props.3.3.10-nightly3.2508-01.gbl.js} +136 -53
  6. package/browser/es5/{ai.props.3.3.10-nightly3.2507-29.cjs.js.map → ai.props.3.3.10-nightly3.2508-01.gbl.js.map} +1 -1
  7. package/browser/es5/ai.props.3.3.10-nightly3.2508-01.gbl.min.js +6 -0
  8. package/browser/es5/{ai.props.3.3.10-nightly3.2507-29.gbl.min.js.map → ai.props.3.3.10-nightly3.2508-01.gbl.min.js.map} +1 -1
  9. package/browser/es5/ai.props.3.3.10-nightly3.2508-01.integrity.json +66 -0
  10. package/browser/es5/{ai.props.3.3.10-nightly3.2507-29.cjs.js → ai.props.3.3.10-nightly3.2508-01.js} +161 -51
  11. package/browser/es5/{ai.props.3.3.10-nightly3.2507-29.js.map → ai.props.3.3.10-nightly3.2508-01.js.map} +1 -1
  12. package/browser/es5/ai.props.3.3.10-nightly3.2508-01.min.js +6 -0
  13. package/browser/es5/{ai.props.3.3.10-nightly3.2507-29.min.js.map → ai.props.3.3.10-nightly3.2508-01.min.js.map} +1 -1
  14. package/browser/es5/ai.props.3.cjs.js +133 -50
  15. package/browser/es5/ai.props.3.cjs.js.map +1 -1
  16. package/browser/es5/ai.props.3.cjs.min.js +2 -2
  17. package/browser/es5/ai.props.3.cjs.min.js.map +1 -1
  18. package/browser/es5/ai.props.3.gbl.js +135 -52
  19. package/browser/es5/ai.props.3.gbl.js.map +1 -1
  20. package/browser/es5/ai.props.3.gbl.min.js +2 -2
  21. package/browser/es5/ai.props.3.gbl.min.js.map +1 -1
  22. package/browser/es5/ai.props.3.integrity.json +25 -25
  23. package/browser/es5/ai.props.3.js +135 -52
  24. package/browser/es5/ai.props.3.js.map +1 -1
  25. package/browser/es5/ai.props.3.min.js +2 -2
  26. package/browser/es5/ai.props.3.min.js.map +1 -1
  27. package/dist/es5/applicationinsights-properties-js.js +133 -50
  28. package/dist/es5/applicationinsights-properties-js.js.map +1 -1
  29. package/dist/es5/applicationinsights-properties-js.min.js +2 -2
  30. package/dist/es5/applicationinsights-properties-js.min.js.map +1 -1
  31. package/dist-es5/Context/Application.js +1 -1
  32. package/dist-es5/Context/Device.js +1 -1
  33. package/dist-es5/Context/Internal.js +2 -2
  34. package/dist-es5/Context/Internal.js.map +1 -1
  35. package/dist-es5/Context/Location.js +1 -1
  36. package/dist-es5/Context/Session.js +1 -1
  37. package/dist-es5/Context/TelemetryTrace.js +1 -1
  38. package/dist-es5/Context/User.js +1 -1
  39. package/dist-es5/Interfaces/IPropTelemetryContext.js +1 -1
  40. package/dist-es5/Interfaces/IPropertiesConfig.js +1 -1
  41. package/dist-es5/PropertiesPlugin.js +1 -1
  42. package/dist-es5/TelemetryContext.js +1 -1
  43. package/dist-es5/__DynamicConstants.js +1 -1
  44. package/dist-es5/applicationinsights-properties-js.js +1 -1
  45. package/package.json +3 -3
  46. package/types/applicationinsights-properties-js.d.ts +1 -1
  47. package/types/applicationinsights-properties-js.namespaced.d.ts +9 -1
  48. package/browser/es5/ai.props.3.3.10-nightly3.2507-29.gbl.min.js +0 -6
  49. package/browser/es5/ai.props.3.3.10-nightly3.2507-29.integrity.json +0 -66
  50. package/browser/es5/ai.props.3.3.10-nightly3.2507-29.min.js +0 -6
@@ -1,32 +1,7 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - Properties Plugin, 3.3.10-nightly3.2507-29
2
+ * Application Insights JavaScript SDK - Properties Plugin, 3.3.10-nightly3.2508-01
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
- (function (global, factory) {
6
- var undef = "undefined";
7
- typeof exports === "object" && typeof module !== undef ? factory(exports) :
8
- typeof define === "function" && define.amd ? define(["exports"], factory) :
9
- (function(global){
10
- var nsKey, key, nm, theExports = {}, modName = "es5_ai_props_3_3_10_nightly3_2507_29", msMod="__ms$mod__";
11
- var mods={}, modDetail=mods[modName]={}, ver="3.3.10-nightly3.2507-29";
12
- var baseNs=global, nsKey="Microsoft", baseNs=baseNs[nsKey]=(baseNs[nsKey]||{});
13
- // Versioned namespace "Microsoft.ApplicationInsights3"
14
- var exportNs=baseNs, nsKey="ApplicationInsights3", exportNs=exportNs[nsKey]=(exportNs[nsKey]||{});
15
- // Global namespace "Microsoft.ApplicationInsights"
16
- var destNs=baseNs, nsKey="ApplicationInsights", destNs=destNs[nsKey]=(destNs[nsKey]||{});
17
- var expNsDetail=(exportNs[msMod]=(exportNs[msMod] || {})), expNameVer=(expNsDetail["v"]=(expNsDetail["v"] || []));
18
- var destNsDetail=(destNs[msMod]=(destNs[msMod] || {})), destNameVer=(destNsDetail["v"]=(destNsDetail["v"] || []));
19
- (destNsDetail["o"]=(destNsDetail["o"] || [])).push(mods);
20
- factory(theExports);
21
- for(var key in theExports) {
22
- // Always set the imported value into the "export" versioned namespace (last-write wins)
23
- nm="x", exportNs[key]=theExports[key], expNameVer[key]=ver;
24
- // Copy over any named element that is not already present (first-write wins)
25
- typeof destNs[key]===undef ? (nm="n", destNs[key]=theExports[key]) && (destNameVer[key]=ver) : !destNameVer[key] && (destNameVer[key]="---");
26
- (modDetail[nm] = (modDetail[nm] || [])).push(key);
27
- }
28
- })(typeof globalThis !== undef ? globalThis : global || self);
29
- })(this, (function (exports) {
30
5
  'use strict';
31
6
 
32
7
 
@@ -1548,7 +1523,7 @@ function newId(maxLength) {
1548
1523
  return result;
1549
1524
  }
1550
1525
 
1551
- var version = '3.3.10-nightly3.2507-29';
1526
+ var version = '3.3.10-nightly3.2508-01';
1552
1527
  var instanceName = "." + newId(6);
1553
1528
  var _dataUid = 0;
1554
1529
  function _canAcceptData(target) {
@@ -2443,6 +2418,7 @@ var rootDefaultConfig = (_a$2 = {
2443
2418
  _b.enabled = UNDEFINED_VALUE,
2444
2419
  _b.ignoreCookies = UNDEFINED_VALUE,
2445
2420
  _b.blockedCookies = UNDEFINED_VALUE,
2421
+ _b.disableCookieDefer = false,
2446
2422
  _b)),
2447
2423
  cookieDomain: UNDEFINED_VALUE,
2448
2424
  cookiePath: UNDEFINED_VALUE
@@ -2522,16 +2498,99 @@ function createCookieMgr(rootConfig, logger) {
2522
2498
  var _getCookieFn;
2523
2499
  var _setCookieFn;
2524
2500
  var _delCookieFn;
2501
+ var _pendingCookies = [];
2502
+ function _formatDeletionValue(path) {
2503
+ var _a;
2504
+ var values = (_a = {},
2505
+ _a[STR_PATH] = path ? path : "/",
2506
+ _a[strExpires] = "Thu, 01 Jan 1970 00:00:01 GMT",
2507
+ _a);
2508
+ if (!isIE()) {
2509
+ values["max-age"] = "0";
2510
+ }
2511
+ return _formatCookieValue(STR_EMPTY, values);
2512
+ }
2513
+ function _formatSetCookieValue(value, maxAgeSec, domain, path) {
2514
+ var values = {};
2515
+ var theValue = strTrim(value || STR_EMPTY);
2516
+ var idx = strIndexOf(theValue, ";");
2517
+ if (idx !== -1) {
2518
+ theValue = strTrim(strLeft(value, idx));
2519
+ values = _extractParts(strSubstring(value, idx + 1));
2520
+ }
2521
+ setValue(values, STR_DOMAIN, domain || _domain, isTruthy, isUndefined);
2522
+ if (!isNullOrUndefined(maxAgeSec)) {
2523
+ var _isIE = isIE();
2524
+ if (isUndefined(values[strExpires])) {
2525
+ var nowMs = utcNow();
2526
+ var expireMs = nowMs + (maxAgeSec * 1000);
2527
+ if (expireMs > 0) {
2528
+ var expiry = new Date();
2529
+ expiry.setTime(expireMs);
2530
+ setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || STR_EMPTY, isTruthy);
2531
+ }
2532
+ }
2533
+ if (!_isIE) {
2534
+ setValue(values, "max-age", STR_EMPTY + maxAgeSec, null, isUndefined);
2535
+ }
2536
+ }
2537
+ var location = getLocation();
2538
+ if (location && location.protocol === "https:") {
2539
+ setValue(values, "secure", null, null, isUndefined);
2540
+ if (_allowUaSameSite === null) {
2541
+ _allowUaSameSite = !uaDisallowsSameSiteNone((getNavigator() || {})[_DYN_USER_AGENT ]);
2542
+ }
2543
+ if (_allowUaSameSite) {
2544
+ setValue(values, "SameSite", "None", null, isUndefined);
2545
+ }
2546
+ }
2547
+ setValue(values, STR_PATH, path || _path, null, isUndefined);
2548
+ return _formatCookieValue(theValue, values);
2549
+ }
2550
+ function _removePendingCookie(name) {
2551
+ if (_pendingCookies) {
2552
+ for (var i = _pendingCookies[_DYN_LENGTH$1 ] - 1; i >= 0; i--) {
2553
+ if (_pendingCookies[i].n === name) {
2554
+ _pendingCookies[_DYN_SPLICE ](i, 1);
2555
+ }
2556
+ }
2557
+ }
2558
+ }
2559
+ function _flushPendingCookies() {
2560
+ if (areCookiesSupported(logger) && _pendingCookies) {
2561
+ arrForEach(_pendingCookies, function (pendingData) {
2562
+ if (!_isBlockedCookie(cookieMgrConfig, pendingData.n)) {
2563
+ if (pendingData.o === 0 ) {
2564
+ _setCookieFn(pendingData.n, pendingData.v);
2565
+ }
2566
+ else if (pendingData.o === 1 ) {
2567
+ _delCookieFn(pendingData.n, pendingData.v);
2568
+ }
2569
+ }
2570
+ });
2571
+ _pendingCookies = [];
2572
+ }
2573
+ }
2525
2574
  rootConfig = createDynamicConfig(rootConfig || _globalCookieConfig, null, logger).cfg;
2526
2575
  unloadHandler = onConfigChange(rootConfig, function (details) {
2527
2576
  details.setDf(details.cfg, rootDefaultConfig);
2528
2577
  cookieMgrConfig = details.ref(details.cfg, "cookieCfg");
2529
2578
  _path = cookieMgrConfig[STR_PATH ] || "/";
2530
2579
  _domain = cookieMgrConfig[STR_DOMAIN ];
2580
+ if (cookieMgrConfig.disableCookieDefer) {
2581
+ _pendingCookies = null;
2582
+ }
2583
+ else if (_pendingCookies === null) {
2584
+ _pendingCookies = [];
2585
+ }
2586
+ var wasEnabled = _enabled;
2531
2587
  _enabled = _isCfgEnabled(rootConfig, cookieMgrConfig) !== false;
2532
2588
  _getCookieFn = cookieMgrConfig.getCookie || _getCookieValue;
2533
2589
  _setCookieFn = cookieMgrConfig.setCookie || _setCookieValue;
2534
2590
  _delCookieFn = cookieMgrConfig.delCookie || _setCookieValue;
2591
+ if (!wasEnabled && _enabled && _pendingCookies) {
2592
+ _flushPendingCookies();
2593
+ }
2535
2594
  }, logger);
2536
2595
  var cookieMgr = {
2537
2596
  isEnabled: function () {
@@ -2543,55 +2602,52 @@ function createCookieMgr(rootConfig, logger) {
2543
2602
  return enabled;
2544
2603
  },
2545
2604
  setEnabled: function (value) {
2546
- _enabled = value !== false;
2547
2605
  cookieMgrConfig[_DYN_ENABLED ] = value;
2606
+ if (!isUndefined(rootConfig[strDisableCookiesUsage])) {
2607
+ rootConfig[strDisableCookiesUsage] = !value;
2608
+ }
2548
2609
  },
2549
2610
  set: function (name, value, maxAgeSec, domain, path) {
2550
2611
  var result = false;
2551
- if (_isMgrEnabled(cookieMgr) && !_isBlockedCookie(cookieMgrConfig, name)) {
2552
- var values = {};
2553
- var theValue = strTrim(value || STR_EMPTY);
2554
- var idx = strIndexOf(theValue, ";");
2555
- if (idx !== -1) {
2556
- theValue = strTrim(strLeft(value, idx));
2557
- values = _extractParts(strSubstring(value, idx + 1));
2558
- }
2559
- setValue(values, STR_DOMAIN, domain || _domain, isTruthy, isUndefined);
2560
- if (!isNullOrUndefined(maxAgeSec)) {
2561
- var _isIE = isIE();
2562
- if (isUndefined(values[strExpires])) {
2563
- var nowMs = utcNow();
2564
- var expireMs = nowMs + (maxAgeSec * 1000);
2565
- if (expireMs > 0) {
2566
- var expiry = new Date();
2567
- expiry.setTime(expireMs);
2568
- setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || STR_EMPTY, isTruthy);
2569
- }
2570
- }
2571
- if (!_isIE) {
2572
- setValue(values, "max-age", STR_EMPTY + maxAgeSec, null, isUndefined);
2573
- }
2612
+ var isBlocked = _isBlockedCookie(cookieMgrConfig, name);
2613
+ if (!isBlocked) {
2614
+ var cookieValue = _formatSetCookieValue(value, maxAgeSec, domain, path);
2615
+ if (_isMgrEnabled(cookieMgr)) {
2616
+ _setCookieFn(name, cookieValue);
2617
+ result = true;
2574
2618
  }
2575
- var location_1 = getLocation();
2576
- if (location_1 && location_1.protocol === "https:") {
2577
- setValue(values, "secure", null, null, isUndefined);
2578
- if (_allowUaSameSite === null) {
2579
- _allowUaSameSite = !uaDisallowsSameSiteNone((getNavigator() || {})[_DYN_USER_AGENT ]);
2580
- }
2581
- if (_allowUaSameSite) {
2582
- setValue(values, "SameSite", "None", null, isUndefined);
2583
- }
2619
+ else if (_pendingCookies) {
2620
+ _removePendingCookie(name);
2621
+ _pendingCookies[_DYN_PUSH ]({
2622
+ n: name,
2623
+ o: 0 ,
2624
+ v: cookieValue
2625
+ });
2626
+ result = true;
2584
2627
  }
2585
- setValue(values, STR_PATH, path || _path, null, isUndefined);
2586
- _setCookieFn(name, _formatCookieValue(theValue, values));
2587
- result = true;
2588
2628
  }
2589
2629
  return result;
2590
2630
  },
2591
2631
  get: function (name) {
2592
2632
  var value = STR_EMPTY;
2593
- if (_isMgrEnabled(cookieMgr) && !_isIgnoredCookie(cookieMgrConfig, name)) {
2594
- value = _getCookieFn(name);
2633
+ var isIgnored = _isIgnoredCookie(cookieMgrConfig, name);
2634
+ if (!isIgnored) {
2635
+ if (_isMgrEnabled(cookieMgr)) {
2636
+ value = _getCookieFn(name);
2637
+ }
2638
+ else if (_pendingCookies) {
2639
+ for (var i = _pendingCookies[_DYN_LENGTH$1 ] - 1; i >= 0; i--) {
2640
+ var pendingData = _pendingCookies[i];
2641
+ if (pendingData.n === name) {
2642
+ if (pendingData.o === 0 ) {
2643
+ var cookieValue = pendingData.v;
2644
+ var idx = strIndexOf(cookieValue, ";");
2645
+ value = idx !== -1 ? strTrim(strLeft(cookieValue, idx)) : strTrim(cookieValue);
2646
+ }
2647
+ break;
2648
+ }
2649
+ }
2650
+ }
2595
2651
  }
2596
2652
  return value;
2597
2653
  },
@@ -2600,20 +2656,21 @@ function createCookieMgr(rootConfig, logger) {
2600
2656
  if (_isMgrEnabled(cookieMgr)) {
2601
2657
  result = cookieMgr.purge(name, path);
2602
2658
  }
2659
+ else if (_pendingCookies) {
2660
+ _removePendingCookie(name);
2661
+ _pendingCookies[_DYN_PUSH ]({
2662
+ n: name,
2663
+ o: 1 ,
2664
+ v: _formatDeletionValue(path)
2665
+ });
2666
+ result = true;
2667
+ }
2603
2668
  return result;
2604
2669
  },
2605
2670
  purge: function (name, path) {
2606
- var _a;
2607
2671
  var result = false;
2608
2672
  if (areCookiesSupported(logger)) {
2609
- var values = (_a = {},
2610
- _a[STR_PATH] = path ? path : "/",
2611
- _a[strExpires] = "Thu, 01 Jan 1970 00:00:01 GMT",
2612
- _a);
2613
- if (!isIE()) {
2614
- values["max-age"] = "0";
2615
- }
2616
- _delCookieFn(name, _formatCookieValue(STR_EMPTY, values));
2673
+ _delCookieFn(name, _formatDeletionValue(path));
2617
2674
  result = true;
2618
2675
  }
2619
2676
  return result;
@@ -2621,6 +2678,7 @@ function createCookieMgr(rootConfig, logger) {
2621
2678
  unload: function (isAsync) {
2622
2679
  unloadHandler && unloadHandler.rm();
2623
2680
  unloadHandler = null;
2681
+ _pendingCookies = null;
2624
2682
  }
2625
2683
  };
2626
2684
  cookieMgr[strConfigCookieMgr] = cookieMgr;
@@ -3795,7 +3853,7 @@ var Device = /** @class */ (function () {
3795
3853
  return Device;
3796
3854
  }());
3797
3855
 
3798
- var Version = '3.3.10-nightly3.2507-29';
3856
+ var Version = '3.3.10-nightly3.2508-01';
3799
3857
  var Internal = /** @class */ (function () {
3800
3858
  function Internal(config, unloadHookContainer) {
3801
3859
  var _this = this;
@@ -4359,6 +4417,4 @@ exports.Session = Session;
4359
4417
  exports.SessionManager = _SessionManager;
4360
4418
  exports.TelemetryContext = TelemetryContext;
4361
4419
  exports.TelemetryTrace = TelemetryTrace;
4362
-
4363
- }));
4364
- //# sourceMappingURL=ai.props.3.3.10-nightly3.2507-29.js.map
4420
+ //# sourceMappingURL=ai.props.3.3.10-nightly3.2508-01.cjs.js.map