@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
- * Microsoft.ApplicationInsights, 2.8.0-beta.2203-03
2
+ * Microsoft.ApplicationInsights, 2.8.0-beta.2203-06
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  *
5
5
  * Microsoft Application Insights Team
@@ -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
  (function (global, factory) {
@@ -327,6 +327,7 @@
327
327
  var strIsInitialized = "isInitialized";
328
328
  var strTeardown = "teardown";
329
329
  var strCore = "core";
330
+ var strUpdate = "update";
330
331
  var strDisabled = "disabled";
331
332
  var strDoTeardown = "_doTeardown";
332
333
 
@@ -711,7 +712,7 @@
711
712
  });
712
713
  return objFreeze(enumClass);
713
714
  }
714
- function objExtend(obj, obj2, obj3, obj4, obj5, obj6) {
715
+ function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) {
715
716
  var theArgs = arguments;
716
717
  var extended = theArgs[0] || {};
717
718
  var argLen = theArgs.length;
@@ -1058,6 +1059,10 @@
1058
1059
  }
1059
1060
  return DiagnosticLogger;
1060
1061
  }());
1062
+ function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) {
1063
+ if (isUserAct === void 0) { isUserAct = false; }
1064
+ (logger || new DiagnosticLogger()).throwInternal(severity, msgId, msg, properties, isUserAct);
1065
+ }
1061
1066
 
1062
1067
  var strExecutionContextKey = "ctx";
1063
1068
  var PerfEvent = /** @class */ (function () {
@@ -1398,7 +1403,7 @@
1398
1403
  completeDetails.func.call(completeDetails.self, completeDetails.args);
1399
1404
  }
1400
1405
  catch (e) {
1401
- core.logger.throwInternal(2 , 73 , "Unexpected Exception during onComplete - " + dumpObj(e));
1406
+ _throwInternal(core.logger, 2 , 73 , "Unexpected Exception during onComplete - " + dumpObj(e));
1402
1407
  }
1403
1408
  });
1404
1409
  _onComplete = [];
@@ -1497,6 +1502,27 @@
1497
1502
  context.createNew = _createNew;
1498
1503
  return context;
1499
1504
  }
1505
+ function createProcessTelemetryUpdateContext(telemetryChain, config, core, startAt) {
1506
+ var internalContext = _createInternalContext(telemetryChain, config, core, startAt);
1507
+ var context = internalContext.ctx;
1508
+ function _processNext(updateState) {
1509
+ return context.iterate(function (plugin) {
1510
+ if (isFunction(plugin[strUpdate])) {
1511
+ plugin[strUpdate](context, updateState);
1512
+ }
1513
+ });
1514
+ }
1515
+ function _createNew(plugins, startAt) {
1516
+ if (plugins === void 0) { plugins = null; }
1517
+ if (isArray(plugins)) {
1518
+ plugins = createTelemetryProxyChain(plugins, config, core, startAt);
1519
+ }
1520
+ return createProcessTelemetryUpdateContext(plugins || context.getNext(), config, core, startAt);
1521
+ }
1522
+ context.processNext = _processNext;
1523
+ context.createNew = _createNew;
1524
+ return context;
1525
+ }
1500
1526
  function createTelemetryProxyChain(plugins, config, core, startAt) {
1501
1527
  var firstProxy = null;
1502
1528
  var add = startAt ? false : true;
@@ -1543,6 +1569,7 @@
1543
1569
  },
1544
1570
  processTelemetry: _processTelemetry,
1545
1571
  unload: _unloadPlugin,
1572
+ update: _updatePlugin,
1546
1573
  _id: chainId,
1547
1574
  _setNext: function (nextPlugin) {
1548
1575
  nextProxy = nextPlugin;
@@ -1582,7 +1609,7 @@
1582
1609
  hasRun = true;
1583
1610
  }
1584
1611
  if (!nextProxy || !hasNextRun) {
1585
- itemCtx.diagLog().throwInternal(1 , 73 , "Plugin [" + plugin.identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext));
1612
+ _throwInternal(itemCtx.diagLog(), 1 , 73 , "Plugin [" + plugin.identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext));
1586
1613
  }
1587
1614
  }
1588
1615
  }, details, isAsync);
@@ -1630,6 +1657,24 @@
1630
1657
  unloadCtx.processNext(unloadState);
1631
1658
  }
1632
1659
  }
1660
+ function _updatePlugin(updateCtx, updateState) {
1661
+ function _callUpdate() {
1662
+ var hasRun = false;
1663
+ if (plugin) {
1664
+ var pluginState = _getPluginState(plugin);
1665
+ var pluginCore = plugin[strCore] || pluginState.core;
1666
+ if (plugin && (!pluginCore || pluginCore === updateCtx[strCore]()) && !pluginState[strTeardown]) {
1667
+ if (plugin[strUpdate] && plugin[strUpdate](updateCtx, updateState) === true) {
1668
+ hasRun = true;
1669
+ }
1670
+ }
1671
+ }
1672
+ return hasRun;
1673
+ }
1674
+ if (!_processChain(updateCtx, _callUpdate, "update", function () { }, false)) {
1675
+ updateCtx.processNext(updateState);
1676
+ }
1677
+ }
1633
1678
  return objFreeze(proxyChain);
1634
1679
  }
1635
1680
 
@@ -1780,7 +1825,7 @@
1780
1825
  _supportsCookies = doc[strCookie] !== undefined;
1781
1826
  }
1782
1827
  catch (e) {
1783
- logger && logger.throwInternal(2 , 68 , "Cannot access document.cookie - " + getExceptionName(e), { exception: dumpObj(e) });
1828
+ _throwInternal(logger, 2 , 68 , "Cannot access document.cookie - " + getExceptionName(e), { exception: dumpObj(e) });
1784
1829
  }
1785
1830
  }
1786
1831
  return _supportsCookies;
@@ -1874,7 +1919,7 @@
1874
1919
  handler(unloadCtx, unloadState);
1875
1920
  }
1876
1921
  catch (e) {
1877
- unloadCtx.diagLog().throwInternal(2 , 73 , "Unexpected error calling unload handler - " + dumpObj(e));
1922
+ _throwInternal(unloadCtx.diagLog(), 2 , 73 , "Unexpected error calling unload handler - " + dumpObj(e));
1878
1923
  }
1879
1924
  });
1880
1925
  handlers = [];
@@ -1933,6 +1978,30 @@
1933
1978
  }
1934
1979
  return result;
1935
1980
  };
1981
+ _self.update = function (updateCtx, updateState) {
1982
+ if (!_self.core || (updateCtx && _self.core !== updateCtx.core())) {
1983
+ return;
1984
+ }
1985
+ var result;
1986
+ var updateDone = false;
1987
+ var theUpdateCtx = updateCtx || createProcessTelemetryUpdateContext(null, {}, _self.core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin);
1988
+ var theUpdateState = updateState || {
1989
+ reason: 0
1990
+ };
1991
+ function _updateCallback() {
1992
+ if (!updateDone) {
1993
+ updateDone = true;
1994
+ _setDefaults(theUpdateCtx.getCfg(), theUpdateCtx.core(), theUpdateCtx.getNext());
1995
+ }
1996
+ }
1997
+ if (!_self._doUpdate || _self._doUpdate(theUpdateCtx, theUpdateState, _updateCallback) !== true) {
1998
+ _updateCallback();
1999
+ }
2000
+ else {
2001
+ result = true;
2002
+ }
2003
+ return result;
2004
+ };
1936
2005
  _self._addHook = function (hooks) {
1937
2006
  if (hooks) {
1938
2007
  if (isArray(hooks)) {
@@ -2021,12 +2090,12 @@
2021
2090
  }
2022
2091
  return name;
2023
2092
  }
2024
- function _getEvtNamespace(eventName, namespaces) {
2025
- if (namespaces) {
2093
+ function _getEvtNamespace(eventName, evtNamespace) {
2094
+ if (evtNamespace) {
2026
2095
  var theNamespace_1 = "";
2027
- if (isArray(namespaces)) {
2096
+ if (isArray(evtNamespace)) {
2028
2097
  theNamespace_1 = "";
2029
- arrForEach(namespaces, function (name) {
2098
+ arrForEach(evtNamespace, function (name) {
2030
2099
  name = _normalizeNamespace(name);
2031
2100
  if (name) {
2032
2101
  if (name[0] !== ".") {
@@ -2037,7 +2106,7 @@
2037
2106
  });
2038
2107
  }
2039
2108
  else {
2040
- theNamespace_1 = _normalizeNamespace(namespaces);
2109
+ theNamespace_1 = _normalizeNamespace(evtNamespace);
2041
2110
  }
2042
2111
  if (theNamespace_1) {
2043
2112
  if (theNamespace_1[0] !== ".") {
@@ -2557,8 +2626,8 @@
2557
2626
  _canUseLocalStorage = false;
2558
2627
  _canUseSessionStorage = false;
2559
2628
  }
2560
- function utlCanUseLocalStorage() {
2561
- if (_canUseLocalStorage === undefined) {
2629
+ function utlCanUseLocalStorage(reset) {
2630
+ if (reset || _canUseLocalStorage === undefined) {
2562
2631
  _canUseLocalStorage = !!_getVerifiedStorageObject(StorageType.LocalStorage);
2563
2632
  }
2564
2633
  return _canUseLocalStorage;
@@ -2571,7 +2640,7 @@
2571
2640
  }
2572
2641
  catch (e) {
2573
2642
  _canUseLocalStorage = false;
2574
- logger.throwInternal(2 , _InternalMessageId.BrowserCannotReadLocalStorage, "Browser failed read of local storage. " + getExceptionName(e), { exception: dumpObj(e) });
2643
+ _throwInternal(logger, 2 , _InternalMessageId.BrowserCannotReadLocalStorage, "Browser failed read of local storage. " + getExceptionName(e), { exception: dumpObj(e) });
2575
2644
  }
2576
2645
  }
2577
2646
  return null;
@@ -2585,7 +2654,7 @@
2585
2654
  }
2586
2655
  catch (e) {
2587
2656
  _canUseLocalStorage = false;
2588
- logger.throwInternal(2 , _InternalMessageId.BrowserCannotWriteLocalStorage, "Browser failed write to local storage. " + getExceptionName(e), { exception: dumpObj(e) });
2657
+ _throwInternal(logger, 2 , _InternalMessageId.BrowserCannotWriteLocalStorage, "Browser failed write to local storage. " + getExceptionName(e), { exception: dumpObj(e) });
2589
2658
  }
2590
2659
  }
2591
2660
  return false;
@@ -2599,13 +2668,13 @@
2599
2668
  }
2600
2669
  catch (e) {
2601
2670
  _canUseLocalStorage = false;
2602
- logger.throwInternal(2 , _InternalMessageId.BrowserFailedRemovalFromLocalStorage, "Browser failed removal of local storage item. " + getExceptionName(e), { exception: dumpObj(e) });
2671
+ _throwInternal(logger, 2 , _InternalMessageId.BrowserFailedRemovalFromLocalStorage, "Browser failed removal of local storage item. " + getExceptionName(e), { exception: dumpObj(e) });
2603
2672
  }
2604
2673
  }
2605
2674
  return false;
2606
2675
  }
2607
- function utlCanUseSessionStorage() {
2608
- if (_canUseSessionStorage === undefined) {
2676
+ function utlCanUseSessionStorage(reset) {
2677
+ if (reset || _canUseSessionStorage === undefined) {
2609
2678
  _canUseSessionStorage = !!_getVerifiedStorageObject(StorageType.SessionStorage);
2610
2679
  }
2611
2680
  return _canUseSessionStorage;
@@ -2627,7 +2696,7 @@
2627
2696
  }
2628
2697
  catch (e) {
2629
2698
  _canUseSessionStorage = false;
2630
- logger.throwInternal(2 , _InternalMessageId.BrowserCannotReadSessionStorage, "Browser failed read of session storage. " + getExceptionName(e), { exception: dumpObj(e) });
2699
+ _throwInternal(logger, 2 , _InternalMessageId.BrowserCannotReadSessionStorage, "Browser failed read of session storage. " + getExceptionName(e), { exception: dumpObj(e) });
2631
2700
  }
2632
2701
  }
2633
2702
  return null;
@@ -2641,7 +2710,7 @@
2641
2710
  }
2642
2711
  catch (e) {
2643
2712
  _canUseSessionStorage = false;
2644
- logger.throwInternal(2 , _InternalMessageId.BrowserCannotWriteSessionStorage, "Browser failed write to session storage. " + getExceptionName(e), { exception: dumpObj(e) });
2713
+ _throwInternal(logger, 2 , _InternalMessageId.BrowserCannotWriteSessionStorage, "Browser failed write to session storage. " + getExceptionName(e), { exception: dumpObj(e) });
2645
2714
  }
2646
2715
  }
2647
2716
  return false;
@@ -2655,7 +2724,7 @@
2655
2724
  }
2656
2725
  catch (e) {
2657
2726
  _canUseSessionStorage = false;
2658
- logger.throwInternal(2 , _InternalMessageId.BrowserFailedRemovalFromSessionStorage, "Browser failed removal of session storage item. " + getExceptionName(e), { exception: dumpObj(e) });
2727
+ _throwInternal(logger, 2 , _InternalMessageId.BrowserFailedRemovalFromSessionStorage, "Browser failed removal of session storage item. " + getExceptionName(e), { exception: dumpObj(e) });
2659
2728
  }
2660
2729
  }
2661
2730
  return false;