@microsoft/applicationinsights-debugplugin-js 2.8.0-beta.2203-03 → 2.8.0-beta.2203-06

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 (51) hide show
  1. package/browser/{ai.dbg.2.8.0-beta.2203-03.cjs.js → ai.dbg.2.8.0-beta.2203-06.cjs.js} +91 -22
  2. package/browser/ai.dbg.2.8.0-beta.2203-06.cjs.js.map +1 -0
  3. package/browser/ai.dbg.2.8.0-beta.2203-06.cjs.min.js +6 -0
  4. package/browser/ai.dbg.2.8.0-beta.2203-06.cjs.min.js.map +1 -0
  5. package/browser/{ai.dbg.2.8.0-beta.2203-03.gbl.js → ai.dbg.2.8.0-beta.2203-06.gbl.js} +91 -22
  6. package/browser/ai.dbg.2.8.0-beta.2203-06.gbl.js.map +1 -0
  7. package/browser/ai.dbg.2.8.0-beta.2203-06.gbl.min.js +6 -0
  8. package/browser/ai.dbg.2.8.0-beta.2203-06.gbl.min.js.map +1 -0
  9. package/browser/ai.dbg.2.8.0-beta.2203-06.integrity.json +66 -0
  10. package/browser/{ai.dbg.2.8.0-beta.2203-03.js → ai.dbg.2.8.0-beta.2203-06.js} +91 -22
  11. package/browser/ai.dbg.2.8.0-beta.2203-06.js.map +1 -0
  12. package/browser/ai.dbg.2.8.0-beta.2203-06.min.js +6 -0
  13. package/browser/ai.dbg.2.8.0-beta.2203-06.min.js.map +1 -0
  14. package/browser/ai.dbg.2.cjs.js +90 -21
  15. package/browser/ai.dbg.2.cjs.js.map +1 -1
  16. package/browser/ai.dbg.2.cjs.min.js +2 -2
  17. package/browser/ai.dbg.2.cjs.min.js.map +1 -1
  18. package/browser/ai.dbg.2.gbl.js +90 -21
  19. package/browser/ai.dbg.2.gbl.js.map +1 -1
  20. package/browser/ai.dbg.2.gbl.min.js +2 -2
  21. package/browser/ai.dbg.2.gbl.min.js.map +1 -1
  22. package/browser/ai.dbg.2.js +90 -21
  23. package/browser/ai.dbg.2.js.map +1 -1
  24. package/browser/ai.dbg.2.min.js +2 -2
  25. package/browser/ai.dbg.2.min.js.map +1 -1
  26. package/dist/applicationinsights-debugplugin-js.d.ts +1 -1
  27. package/dist/applicationinsights-debugplugin-js.js +90 -21
  28. package/dist/applicationinsights-debugplugin-js.js.map +1 -1
  29. package/dist/applicationinsights-debugplugin-js.min.js +2 -2
  30. package/dist/applicationinsights-debugplugin-js.min.js.map +1 -1
  31. package/dist/applicationinsights-debugplugin-js.rollup.d.ts +1 -1
  32. package/dist-esm/DebugPlugin.js +1 -1
  33. package/dist-esm/applicationinsights-debugplugin-js.js +1 -1
  34. package/dist-esm/components/Dashboard.js +1 -1
  35. package/dist-esm/components/LogEntry.js +1 -1
  36. package/dist-esm/components/debugBins.js +1 -1
  37. package/dist-esm/components/filterList.js +1 -1
  38. package/dist-esm/components/helpers.js +1 -1
  39. package/dist-esm/components/styleNodeSrc.js +1 -1
  40. package/dist-esm/interfaces/IDebugPluginConfig.js +1 -1
  41. package/package.json +3 -3
  42. package/browser/ai.dbg.2.8.0-beta.2203-03.cjs.js.map +0 -1
  43. package/browser/ai.dbg.2.8.0-beta.2203-03.cjs.min.js +0 -6
  44. package/browser/ai.dbg.2.8.0-beta.2203-03.cjs.min.js.map +0 -1
  45. package/browser/ai.dbg.2.8.0-beta.2203-03.gbl.js.map +0 -1
  46. package/browser/ai.dbg.2.8.0-beta.2203-03.gbl.min.js +0 -6
  47. package/browser/ai.dbg.2.8.0-beta.2203-03.gbl.min.js.map +0 -1
  48. package/browser/ai.dbg.2.8.0-beta.2203-03.integrity.json +0 -66
  49. package/browser/ai.dbg.2.8.0-beta.2203-03.js.map +0 -1
  50. package/browser/ai.dbg.2.8.0-beta.2203-03.min.js +0 -6
  51. package/browser/ai.dbg.2.8.0-beta.2203-03.min.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - Debug Plugin, 2.8.0-beta.2203-03
2
+ * Application Insights JavaScript SDK - Debug Plugin, 2.8.0-beta.2203-06
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  'use strict';
@@ -325,6 +325,7 @@ var strSetNextPlugin = "setNextPlugin";
325
325
  var strIsInitialized = "isInitialized";
326
326
  var strTeardown = "teardown";
327
327
  var strCore = "core";
328
+ var strUpdate = "update";
328
329
  var strDisabled = "disabled";
329
330
  var strDoTeardown = "_doTeardown";
330
331
 
@@ -709,7 +710,7 @@ function createEnumStyle(values) {
709
710
  });
710
711
  return objFreeze(enumClass);
711
712
  }
712
- function objExtend(obj, obj2, obj3, obj4, obj5, obj6) {
713
+ function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) {
713
714
  var theArgs = arguments;
714
715
  var extended = theArgs[0] || {};
715
716
  var argLen = theArgs.length;
@@ -1056,6 +1057,10 @@ var DiagnosticLogger = /** @class */ (function () {
1056
1057
  }
1057
1058
  return DiagnosticLogger;
1058
1059
  }());
1060
+ function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) {
1061
+ if (isUserAct === void 0) { isUserAct = false; }
1062
+ (logger || new DiagnosticLogger()).throwInternal(severity, msgId, msg, properties, isUserAct);
1063
+ }
1059
1064
 
1060
1065
  var strExecutionContextKey = "ctx";
1061
1066
  var PerfEvent = /** @class */ (function () {
@@ -1396,7 +1401,7 @@ function _createInternalContext(telemetryChain, config, core, startAt) {
1396
1401
  completeDetails.func.call(completeDetails.self, completeDetails.args);
1397
1402
  }
1398
1403
  catch (e) {
1399
- core.logger.throwInternal(2 , 73 , "Unexpected Exception during onComplete - " + dumpObj(e));
1404
+ _throwInternal(core.logger, 2 , 73 , "Unexpected Exception during onComplete - " + dumpObj(e));
1400
1405
  }
1401
1406
  });
1402
1407
  _onComplete = [];
@@ -1495,6 +1500,27 @@ function createProcessTelemetryUnloadContext(telemetryChain, config, core, start
1495
1500
  context.createNew = _createNew;
1496
1501
  return context;
1497
1502
  }
1503
+ function createProcessTelemetryUpdateContext(telemetryChain, config, core, startAt) {
1504
+ var internalContext = _createInternalContext(telemetryChain, config, core, startAt);
1505
+ var context = internalContext.ctx;
1506
+ function _processNext(updateState) {
1507
+ return context.iterate(function (plugin) {
1508
+ if (isFunction(plugin[strUpdate])) {
1509
+ plugin[strUpdate](context, updateState);
1510
+ }
1511
+ });
1512
+ }
1513
+ function _createNew(plugins, startAt) {
1514
+ if (plugins === void 0) { plugins = null; }
1515
+ if (isArray(plugins)) {
1516
+ plugins = createTelemetryProxyChain(plugins, config, core, startAt);
1517
+ }
1518
+ return createProcessTelemetryUpdateContext(plugins || context.getNext(), config, core, startAt);
1519
+ }
1520
+ context.processNext = _processNext;
1521
+ context.createNew = _createNew;
1522
+ return context;
1523
+ }
1498
1524
  function createTelemetryProxyChain(plugins, config, core, startAt) {
1499
1525
  var firstProxy = null;
1500
1526
  var add = startAt ? false : true;
@@ -1541,6 +1567,7 @@ function createTelemetryPluginProxy(plugin, config, core) {
1541
1567
  },
1542
1568
  processTelemetry: _processTelemetry,
1543
1569
  unload: _unloadPlugin,
1570
+ update: _updatePlugin,
1544
1571
  _id: chainId,
1545
1572
  _setNext: function (nextPlugin) {
1546
1573
  nextProxy = nextPlugin;
@@ -1580,7 +1607,7 @@ function createTelemetryPluginProxy(plugin, config, core) {
1580
1607
  hasRun = true;
1581
1608
  }
1582
1609
  if (!nextProxy || !hasNextRun) {
1583
- itemCtx.diagLog().throwInternal(1 , 73 , "Plugin [" + plugin.identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext));
1610
+ _throwInternal(itemCtx.diagLog(), 1 , 73 , "Plugin [" + plugin.identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext));
1584
1611
  }
1585
1612
  }
1586
1613
  }, details, isAsync);
@@ -1628,6 +1655,24 @@ function createTelemetryPluginProxy(plugin, config, core) {
1628
1655
  unloadCtx.processNext(unloadState);
1629
1656
  }
1630
1657
  }
1658
+ function _updatePlugin(updateCtx, updateState) {
1659
+ function _callUpdate() {
1660
+ var hasRun = false;
1661
+ if (plugin) {
1662
+ var pluginState = _getPluginState(plugin);
1663
+ var pluginCore = plugin[strCore] || pluginState.core;
1664
+ if (plugin && (!pluginCore || pluginCore === updateCtx[strCore]()) && !pluginState[strTeardown]) {
1665
+ if (plugin[strUpdate] && plugin[strUpdate](updateCtx, updateState) === true) {
1666
+ hasRun = true;
1667
+ }
1668
+ }
1669
+ }
1670
+ return hasRun;
1671
+ }
1672
+ if (!_processChain(updateCtx, _callUpdate, "update", function () { }, false)) {
1673
+ updateCtx.processNext(updateState);
1674
+ }
1675
+ }
1631
1676
  return objFreeze(proxyChain);
1632
1677
  }
1633
1678
 
@@ -1778,7 +1823,7 @@ function areCookiesSupported(logger) {
1778
1823
  _supportsCookies = doc[strCookie] !== undefined;
1779
1824
  }
1780
1825
  catch (e) {
1781
- logger && logger.throwInternal(2 , 68 , "Cannot access document.cookie - " + getExceptionName(e), { exception: dumpObj(e) });
1826
+ _throwInternal(logger, 2 , 68 , "Cannot access document.cookie - " + getExceptionName(e), { exception: dumpObj(e) });
1782
1827
  }
1783
1828
  }
1784
1829
  return _supportsCookies;
@@ -1872,7 +1917,7 @@ function createUnloadHandlerContainer() {
1872
1917
  handler(unloadCtx, unloadState);
1873
1918
  }
1874
1919
  catch (e) {
1875
- unloadCtx.diagLog().throwInternal(2 , 73 , "Unexpected error calling unload handler - " + dumpObj(e));
1920
+ _throwInternal(unloadCtx.diagLog(), 2 , 73 , "Unexpected error calling unload handler - " + dumpObj(e));
1876
1921
  }
1877
1922
  });
1878
1923
  handlers = [];
@@ -1931,6 +1976,30 @@ var BaseTelemetryPlugin = /** @class */ (function () {
1931
1976
  }
1932
1977
  return result;
1933
1978
  };
1979
+ _self.update = function (updateCtx, updateState) {
1980
+ if (!_self.core || (updateCtx && _self.core !== updateCtx.core())) {
1981
+ return;
1982
+ }
1983
+ var result;
1984
+ var updateDone = false;
1985
+ var theUpdateCtx = updateCtx || createProcessTelemetryUpdateContext(null, {}, _self.core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin);
1986
+ var theUpdateState = updateState || {
1987
+ reason: 0
1988
+ };
1989
+ function _updateCallback() {
1990
+ if (!updateDone) {
1991
+ updateDone = true;
1992
+ _setDefaults(theUpdateCtx.getCfg(), theUpdateCtx.core(), theUpdateCtx.getNext());
1993
+ }
1994
+ }
1995
+ if (!_self._doUpdate || _self._doUpdate(theUpdateCtx, theUpdateState, _updateCallback) !== true) {
1996
+ _updateCallback();
1997
+ }
1998
+ else {
1999
+ result = true;
2000
+ }
2001
+ return result;
2002
+ };
1934
2003
  _self._addHook = function (hooks) {
1935
2004
  if (hooks) {
1936
2005
  if (isArray(hooks)) {
@@ -2019,12 +2088,12 @@ function _normalizeNamespace(name) {
2019
2088
  }
2020
2089
  return name;
2021
2090
  }
2022
- function _getEvtNamespace(eventName, namespaces) {
2023
- if (namespaces) {
2091
+ function _getEvtNamespace(eventName, evtNamespace) {
2092
+ if (evtNamespace) {
2024
2093
  var theNamespace_1 = "";
2025
- if (isArray(namespaces)) {
2094
+ if (isArray(evtNamespace)) {
2026
2095
  theNamespace_1 = "";
2027
- arrForEach(namespaces, function (name) {
2096
+ arrForEach(evtNamespace, function (name) {
2028
2097
  name = _normalizeNamespace(name);
2029
2098
  if (name) {
2030
2099
  if (name[0] !== ".") {
@@ -2035,7 +2104,7 @@ function _getEvtNamespace(eventName, namespaces) {
2035
2104
  });
2036
2105
  }
2037
2106
  else {
2038
- theNamespace_1 = _normalizeNamespace(namespaces);
2107
+ theNamespace_1 = _normalizeNamespace(evtNamespace);
2039
2108
  }
2040
2109
  if (theNamespace_1) {
2041
2110
  if (theNamespace_1[0] !== ".") {
@@ -2555,8 +2624,8 @@ function utlDisableStorage() {
2555
2624
  _canUseLocalStorage = false;
2556
2625
  _canUseSessionStorage = false;
2557
2626
  }
2558
- function utlCanUseLocalStorage() {
2559
- if (_canUseLocalStorage === undefined) {
2627
+ function utlCanUseLocalStorage(reset) {
2628
+ if (reset || _canUseLocalStorage === undefined) {
2560
2629
  _canUseLocalStorage = !!_getVerifiedStorageObject(StorageType.LocalStorage);
2561
2630
  }
2562
2631
  return _canUseLocalStorage;
@@ -2569,7 +2638,7 @@ function utlGetLocalStorage(logger, name) {
2569
2638
  }
2570
2639
  catch (e) {
2571
2640
  _canUseLocalStorage = false;
2572
- logger.throwInternal(2 , _InternalMessageId.BrowserCannotReadLocalStorage, "Browser failed read of local storage. " + getExceptionName(e), { exception: dumpObj(e) });
2641
+ _throwInternal(logger, 2 , _InternalMessageId.BrowserCannotReadLocalStorage, "Browser failed read of local storage. " + getExceptionName(e), { exception: dumpObj(e) });
2573
2642
  }
2574
2643
  }
2575
2644
  return null;
@@ -2583,7 +2652,7 @@ function utlSetLocalStorage(logger, name, data) {
2583
2652
  }
2584
2653
  catch (e) {
2585
2654
  _canUseLocalStorage = false;
2586
- logger.throwInternal(2 , _InternalMessageId.BrowserCannotWriteLocalStorage, "Browser failed write to local storage. " + getExceptionName(e), { exception: dumpObj(e) });
2655
+ _throwInternal(logger, 2 , _InternalMessageId.BrowserCannotWriteLocalStorage, "Browser failed write to local storage. " + getExceptionName(e), { exception: dumpObj(e) });
2587
2656
  }
2588
2657
  }
2589
2658
  return false;
@@ -2597,13 +2666,13 @@ function utlRemoveStorage(logger, name) {
2597
2666
  }
2598
2667
  catch (e) {
2599
2668
  _canUseLocalStorage = false;
2600
- logger.throwInternal(2 , _InternalMessageId.BrowserFailedRemovalFromLocalStorage, "Browser failed removal of local storage item. " + getExceptionName(e), { exception: dumpObj(e) });
2669
+ _throwInternal(logger, 2 , _InternalMessageId.BrowserFailedRemovalFromLocalStorage, "Browser failed removal of local storage item. " + getExceptionName(e), { exception: dumpObj(e) });
2601
2670
  }
2602
2671
  }
2603
2672
  return false;
2604
2673
  }
2605
- function utlCanUseSessionStorage() {
2606
- if (_canUseSessionStorage === undefined) {
2674
+ function utlCanUseSessionStorage(reset) {
2675
+ if (reset || _canUseSessionStorage === undefined) {
2607
2676
  _canUseSessionStorage = !!_getVerifiedStorageObject(StorageType.SessionStorage);
2608
2677
  }
2609
2678
  return _canUseSessionStorage;
@@ -2625,7 +2694,7 @@ function utlGetSessionStorage(logger, name) {
2625
2694
  }
2626
2695
  catch (e) {
2627
2696
  _canUseSessionStorage = false;
2628
- logger.throwInternal(2 , _InternalMessageId.BrowserCannotReadSessionStorage, "Browser failed read of session storage. " + getExceptionName(e), { exception: dumpObj(e) });
2697
+ _throwInternal(logger, 2 , _InternalMessageId.BrowserCannotReadSessionStorage, "Browser failed read of session storage. " + getExceptionName(e), { exception: dumpObj(e) });
2629
2698
  }
2630
2699
  }
2631
2700
  return null;
@@ -2639,7 +2708,7 @@ function utlSetSessionStorage(logger, name, data) {
2639
2708
  }
2640
2709
  catch (e) {
2641
2710
  _canUseSessionStorage = false;
2642
- logger.throwInternal(2 , _InternalMessageId.BrowserCannotWriteSessionStorage, "Browser failed write to session storage. " + getExceptionName(e), { exception: dumpObj(e) });
2711
+ _throwInternal(logger, 2 , _InternalMessageId.BrowserCannotWriteSessionStorage, "Browser failed write to session storage. " + getExceptionName(e), { exception: dumpObj(e) });
2643
2712
  }
2644
2713
  }
2645
2714
  return false;
@@ -2653,7 +2722,7 @@ function utlRemoveSessionStorage(logger, name) {
2653
2722
  }
2654
2723
  catch (e) {
2655
2724
  _canUseSessionStorage = false;
2656
- logger.throwInternal(2 , _InternalMessageId.BrowserFailedRemovalFromSessionStorage, "Browser failed removal of session storage item. " + getExceptionName(e), { exception: dumpObj(e) });
2725
+ _throwInternal(logger, 2 , _InternalMessageId.BrowserFailedRemovalFromSessionStorage, "Browser failed removal of session storage item. " + getExceptionName(e), { exception: dumpObj(e) });
2657
2726
  }
2658
2727
  }
2659
2728
  return false;
@@ -3888,4 +3957,4 @@ var DebugPlugin = /** @class */ (function (_super) {
3888
3957
  var DebugPlugin$1 = DebugPlugin;
3889
3958
 
3890
3959
  exports.DebugPlugin = DebugPlugin$1;
3891
- //# sourceMappingURL=ai.dbg.2.8.0-beta.2203-03.cjs.js.map
3960
+ //# sourceMappingURL=ai.dbg.2.8.0-beta.2203-06.cjs.js.map