@microsoft/applicationinsights-web-basic 3.0.0-beta.2210-09 → 3.0.0-beta.2210-11

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.
package/browser/aib.2.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript Web SDK - Basic, 3.0.0-beta.2210-09
2
+ * Application Insights JavaScript Web SDK - Basic, 3.0.0-beta.2210-11
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -1024,15 +1024,14 @@
1024
1024
  var _DYN_PROCESS_NEXT = "processNext";
1025
1025
  var _DYN_GET_PROCESS_TEL_CONT0 = "getProcessTelContext";
1026
1026
  var _DYN_GET_NOTIFY_MGR = "getNotifyMgr";
1027
- var _DYN__NOTIFICATION_MANAGE1 = "NotificationManager";
1028
- var _DYN_ADD_NOTIFICATION_LIS2 = "addNotificationListener";
1029
- var _DYN_REMOVE_NOTIFICATION_3 = "removeNotificationListener";
1030
- var _DYN_STOP_POLLING_INTERNA4 = "stopPollingInternalLogs";
1027
+ var _DYN_ADD_NOTIFICATION_LIS1 = "addNotificationListener";
1028
+ var _DYN_REMOVE_NOTIFICATION_2 = "removeNotificationListener";
1029
+ var _DYN_STOP_POLLING_INTERNA3 = "stopPollingInternalLogs";
1031
1030
  var _DYN_ON_COMPLETE = "onComplete";
1032
1031
  var _DYN_CALL = "call";
1033
1032
  var _DYN_GET_PLUGIN = "getPlugin";
1034
1033
  var _DYN_FLUSH = "flush";
1035
- var _DYN_LOGGING_LEVEL_CONSOL5 = "loggingLevelConsole";
1034
+ var _DYN_LOGGING_LEVEL_CONSOL4 = "loggingLevelConsole";
1036
1035
  var _DYN__EXTENSIONS = "_extensions";
1037
1036
  var _DYN_TEARDOWN = "teardown";
1038
1037
  var _DYN_MESSAGE_ID = "messageId";
@@ -1050,7 +1049,7 @@
1050
1049
  var _DYN_SPLIT$1 = "split";
1051
1050
  var _DYN_NODE_TYPE = "nodeType";
1052
1051
  var _DYN_REPLACE = "replace";
1053
- var _DYN_ENABLE_DEBUG_EXCEPTI6 = "enableDebugExceptions";
1052
+ var _DYN_ENABLE_DEBUG_EXCEPTI5 = "enableDebugExceptions";
1054
1053
  var _DYN_LOG_INTERNAL_MESSAGE = "logInternalMessage";
1055
1054
  var _DYN_TO_LOWER_CASE$1 = "toLowerCase";
1056
1055
  var _DYN_TYPE = "type";
@@ -1064,6 +1063,22 @@
1064
1063
  var _DYN_SPAN_ID = "spanId";
1065
1064
  var _DYN_TRACE_FLAGS = "traceFlags";
1066
1065
 
1066
+ var aggregationErrorType;
1067
+ function throwAggregationError(message, sourceErrors) {
1068
+ if (!aggregationErrorType) {
1069
+ aggregationErrorType = createCustomError("AggregationError", function (self, args) {
1070
+ if (args[_DYN_LENGTH$2 ] > 1) {
1071
+ self.errors = args[1];
1072
+ }
1073
+ });
1074
+ }
1075
+ var theMessage = message || "One or more errors occurred.";
1076
+ arrForEach(sourceErrors, function (srcError, idx) {
1077
+ theMessage += "\n".concat(idx, " > ").concat(dumpObj(srcError));
1078
+ });
1079
+ throw new aggregationErrorType(message, sourceErrors || []);
1080
+ }
1081
+
1067
1082
  var UNDEFINED_VALUE$1 = undefined;
1068
1083
  var STR_EMPTY = "";
1069
1084
  var STR_CHANNELS = "channels";
@@ -1479,7 +1494,7 @@
1479
1494
  }
1480
1495
 
1481
1496
  var _objDefineProperty = ObjDefineProperty;
1482
- var version = "3.0.0-beta.2210-09";
1497
+ var version = "3.0.0-beta.2210-11";
1483
1498
  var instanceName = "." + newId(6);
1484
1499
  var _dataUid = 0;
1485
1500
  function _createAccessor(target, prop, value) {
@@ -1790,14 +1805,11 @@
1790
1805
  });
1791
1806
  }
1792
1807
  catch (e) {
1793
- var message = "Watcher [" + dumpObj(callback) + "] failed [" + dumpObj(e) + "]";
1794
1808
  var logger = cfgHandler[_DYN_LOGGER ];
1795
1809
  if (logger) {
1796
- cfgHandler.logger[_DYN_THROW_INTERNAL ](1 , 107 , message);
1797
- }
1798
- else {
1799
- throwInvalidAccess(message);
1810
+ logger[_DYN_THROW_INTERNAL ](1 , 107 , "Watcher [" + dumpObj(callback) + "] failed [" + dumpObj(e) + "]");
1800
1811
  }
1812
+ throw e;
1801
1813
  }
1802
1814
  finally {
1803
1815
  theState.act = prevWatcher || null;
@@ -1811,13 +1823,27 @@
1811
1823
  _watcherTimer.cancel();
1812
1824
  _watcherTimer = null;
1813
1825
  }
1826
+ var watcherFailures_1 = [];
1814
1827
  arrForEach(notifyHandlers, function (handler) {
1815
1828
  if (handler.fn) {
1816
- _useHandler(handler, handler.fn);
1829
+ try {
1830
+ _useHandler(handler, handler.fn);
1831
+ }
1832
+ catch (e) {
1833
+ watcherFailures_1[_DYN_PUSH$1 ](e);
1834
+ }
1817
1835
  }
1818
1836
  });
1819
1837
  if (_waitingHandlers) {
1820
- _notifyWatchers();
1838
+ try {
1839
+ _notifyWatchers();
1840
+ }
1841
+ catch (e) {
1842
+ watcherFailures_1[_DYN_PUSH$1 ](e);
1843
+ }
1844
+ }
1845
+ if (watcherFailures_1[_DYN_LENGTH$2 ] > 0) {
1846
+ throwAggregationError("Unexpected watcher error occurred: ", watcherFailures_1);
1821
1847
  }
1822
1848
  }
1823
1849
  }
@@ -1982,7 +2008,7 @@
1982
2008
  loggingLevelTelemetry: 1,
1983
2009
  maxMessageLimit: 25
1984
2010
  },
1985
- _a$4[_DYN_ENABLE_DEBUG_EXCEPTI6 ] = false,
2011
+ _a$4[_DYN_ENABLE_DEBUG_EXCEPTI5 ] = false,
1986
2012
  _a$4);
1987
2013
  function _sanitizeDiagnosticText(text) {
1988
2014
  if (text) {
@@ -2039,7 +2065,7 @@
2039
2065
  _self.consoleLoggingLevel = function () { return _loggingLevelConsole; };
2040
2066
  _self.telemetryLoggingLevel = function () { return _loggingLevelTelemetry; };
2041
2067
  _self.maxInternalMessageLimit = function () { return _maxInternalMessageLimit; };
2042
- _self[_DYN_ENABLE_DEBUG_EXCEPTI6 ] = function () { return _enableDebugExceptions; };
2068
+ _self[_DYN_ENABLE_DEBUG_EXCEPTI5 ] = function () { return _enableDebugExceptions; };
2043
2069
  _self[_DYN_THROW_INTERNAL ] = function (severity, msgId, msg, properties, isUserAct) {
2044
2070
  if (isUserAct === void 0) { isUserAct = false; }
2045
2071
  var message = new _InternalLogMessage(msgId, msg, isUserAct, properties);
@@ -2116,10 +2142,10 @@
2116
2142
  var handler = createDynamicConfig(config, defaultValues$2, _self);
2117
2143
  handler[_DYN_WATCH ](function (details) {
2118
2144
  var config = details.cfg;
2119
- _loggingLevelConsole = config[_DYN_LOGGING_LEVEL_CONSOL5 ];
2145
+ _loggingLevelConsole = config[_DYN_LOGGING_LEVEL_CONSOL4 ];
2120
2146
  _loggingLevelTelemetry = config.loggingLevelTelemetry;
2121
2147
  _maxInternalMessageLimit = config.maxMessageLimit;
2122
- _enableDebugExceptions = config[_DYN_ENABLE_DEBUG_EXCEPTI6 ];
2148
+ _enableDebugExceptions = config[_DYN_ENABLE_DEBUG_EXCEPTI5 ];
2123
2149
  });
2124
2150
  }
2125
2151
  function _areInternalMessagesThrottled() {
@@ -3237,10 +3263,10 @@
3237
3263
  perfEvtsSendAll = !!details.cfg.perfEvtsSendAll;
3238
3264
  });
3239
3265
  dynamicProto(NotificationManager, this, function (_self) {
3240
- _self[_DYN_ADD_NOTIFICATION_LIS2 ] = function (listener) {
3266
+ _self[_DYN_ADD_NOTIFICATION_LIS1 ] = function (listener) {
3241
3267
  _self.listeners[_DYN_PUSH$1 ](listener);
3242
3268
  };
3243
- _self[_DYN_REMOVE_NOTIFICATION_3 ] = function (listener) {
3269
+ _self[_DYN_REMOVE_NOTIFICATION_2 ] = function (listener) {
3244
3270
  var index = arrIndexOf(_self[_DYN_LISTENERS ], listener);
3245
3271
  while (index > -1) {
3246
3272
  _self.listeners[_DYN_SPLICE ](index, 1);
@@ -3731,16 +3757,15 @@
3731
3757
  _notificationManager = new NotificationManager(details.cfg);
3732
3758
  _self[strNotificationManager] = _notificationManager;
3733
3759
  }));
3734
- _configHandler.cfg.extensionConfig[_DYN__NOTIFICATION_MANAGE1 ] = _notificationManager;
3735
3760
  }
3736
3761
  return _notificationManager;
3737
3762
  };
3738
- _self[_DYN_ADD_NOTIFICATION_LIS2 ] = function (listener) {
3739
- _self[_DYN_GET_NOTIFY_MGR ]()[_DYN_ADD_NOTIFICATION_LIS2 ](listener);
3763
+ _self[_DYN_ADD_NOTIFICATION_LIS1 ] = function (listener) {
3764
+ _self[_DYN_GET_NOTIFY_MGR ]()[_DYN_ADD_NOTIFICATION_LIS1 ](listener);
3740
3765
  };
3741
- _self[_DYN_REMOVE_NOTIFICATION_3 ] = function (listener) {
3766
+ _self[_DYN_REMOVE_NOTIFICATION_2 ] = function (listener) {
3742
3767
  if (_notificationManager) {
3743
- _notificationManager[_DYN_REMOVE_NOTIFICATION_3 ](listener);
3768
+ _notificationManager[_DYN_REMOVE_NOTIFICATION_2 ](listener);
3744
3769
  }
3745
3770
  };
3746
3771
  _self.getCookieMgr = function () {
@@ -3798,7 +3823,7 @@
3798
3823
  }));
3799
3824
  return _internalLogPoller;
3800
3825
  };
3801
- _self[_DYN_STOP_POLLING_INTERNA4 ] = function () {
3826
+ _self[_DYN_STOP_POLLING_INTERNA3 ] = function () {
3802
3827
  if (_internalLogPoller) {
3803
3828
  clearInterval(_internalLogPoller);
3804
3829
  _internalLogPoller = 0;
@@ -3840,7 +3865,7 @@
3840
3865
  unloadState.flushComplete = flushComplete;
3841
3866
  _isUnloading = true;
3842
3867
  _unloadHandlers.run(processUnloadCtx, unloadState);
3843
- _self[_DYN_STOP_POLLING_INTERNA4 ]();
3868
+ _self[_DYN_STOP_POLLING_INTERNA3 ]();
3844
3869
  processUnloadCtx[_DYN_PROCESS_NEXT ](unloadState);
3845
3870
  }
3846
3871
  if (!_flushChannels(isAsync, _doUnload, 6 , cbTimeout)) {
@@ -3905,7 +3930,6 @@
3905
3930
  newConfig[STR_CHANNELS ] = cfg[STR_CHANNELS ];
3906
3931
  _configHandler._block(function (details) {
3907
3932
  var theConfig = details.cfg;
3908
- var notificationManager = theConfig.extensionConfig[_DYN__NOTIFICATION_MANAGE1 ];
3909
3933
  _deepMergeConfig(details, theConfig, newConfig, mergeExisting);
3910
3934
  if (!mergeExisting) {
3911
3935
  objForEachKey(theConfig, function (key) {
@@ -3915,7 +3939,6 @@
3915
3939
  });
3916
3940
  }
3917
3941
  details[_DYN_SET_DF ](theConfig, defaultConfig);
3918
- theConfig.extensionConfig[_DYN__NOTIFICATION_MANAGE1 ] = notificationManager;
3919
3942
  });
3920
3943
  _configHandler[_DYN_NOTIFY ]();
3921
3944
  _doUpdate(updateState);
@@ -3953,7 +3976,7 @@
3953
3976
  var _a;
3954
3977
  _isInitialized = false;
3955
3978
  _configHandler = createDynamicConfig({}, defaultConfig, _self[_DYN_LOGGER ]);
3956
- _configHandler.cfg[_DYN_LOGGING_LEVEL_CONSOL5 ] = 1 ;
3979
+ _configHandler.cfg[_DYN_LOGGING_LEVEL_CONSOL4 ] = 1 ;
3957
3980
  objDefineProp(_self, "config", (_a = {},
3958
3981
  _a[_DYN_CONFIGURABLE ] = true,
3959
3982
  _a[_DYN_ENUMERABLE ] = true,
@@ -4144,12 +4167,12 @@
4144
4167
  _addUnloadHook(_configHandler[_DYN_WATCH ](function (details) {
4145
4168
  var disableDbgExt = details.cfg.disableDbgExt;
4146
4169
  if (disableDbgExt === true && _debugListener) {
4147
- _notificationManager[_DYN_REMOVE_NOTIFICATION_3 ](_debugListener);
4170
+ _notificationManager[_DYN_REMOVE_NOTIFICATION_2 ](_debugListener);
4148
4171
  _debugListener = null;
4149
4172
  }
4150
4173
  if (_notificationManager && !_debugListener && disableDbgExt !== true) {
4151
4174
  _debugListener = getDebugListener(details.cfg);
4152
- _notificationManager[_DYN_ADD_NOTIFICATION_LIS2 ](_debugListener);
4175
+ _notificationManager[_DYN_ADD_NOTIFICATION_LIS1 ](_debugListener);
4153
4176
  }
4154
4177
  }));
4155
4178
  }
@@ -5659,7 +5682,7 @@
5659
5682
  }
5660
5683
  }
5661
5684
  var EnvelopeCreator = {
5662
- Version: "3.0.0-beta.2210-09"
5685
+ Version: "3.0.0-beta.2210-11"
5663
5686
  };
5664
5687
  function DependencyEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {
5665
5688
  EnvelopeCreatorInit(logger, telemetryItem);