@microsoft/applicationinsights-web-basic 3.0.0 → 3.0.1-nightly3.2304-38

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 (44) hide show
  1. package/browser/es5/{aib.3.0.0.cjs.js → aib.3.0.1-nightly3.2304-38.cjs.js} +51 -44
  2. package/browser/es5/aib.3.0.1-nightly3.2304-38.cjs.js.map +1 -0
  3. package/browser/es5/aib.3.0.1-nightly3.2304-38.cjs.min.js +6 -0
  4. package/browser/es5/aib.3.0.1-nightly3.2304-38.cjs.min.js.map +1 -0
  5. package/browser/es5/{aib.3.0.0.gbl.js → aib.3.0.1-nightly3.2304-38.gbl.js} +51 -44
  6. package/browser/es5/aib.3.0.1-nightly3.2304-38.gbl.js.map +1 -0
  7. package/browser/es5/aib.3.0.1-nightly3.2304-38.gbl.min.js +6 -0
  8. package/browser/es5/aib.3.0.1-nightly3.2304-38.gbl.min.js.map +1 -0
  9. package/browser/es5/aib.3.0.1-nightly3.2304-38.integrity.json +66 -0
  10. package/browser/es5/{aib.3.0.0.js → aib.3.0.1-nightly3.2304-38.js} +51 -44
  11. package/browser/es5/aib.3.0.1-nightly3.2304-38.js.map +1 -0
  12. package/browser/es5/aib.3.0.1-nightly3.2304-38.min.js +6 -0
  13. package/browser/es5/aib.3.0.1-nightly3.2304-38.min.js.map +1 -0
  14. package/browser/es5/aib.3.cjs.js +50 -43
  15. package/browser/es5/aib.3.cjs.js.map +1 -1
  16. package/browser/es5/aib.3.cjs.min.js +2 -2
  17. package/browser/es5/aib.3.cjs.min.js.map +1 -1
  18. package/browser/es5/aib.3.gbl.js +50 -43
  19. package/browser/es5/aib.3.gbl.js.map +1 -1
  20. package/browser/es5/aib.3.gbl.min.js +2 -2
  21. package/browser/es5/aib.3.gbl.min.js.map +1 -1
  22. package/browser/es5/aib.3.js +50 -43
  23. package/browser/es5/aib.3.js.map +1 -1
  24. package/browser/es5/aib.3.min.js +2 -2
  25. package/browser/es5/aib.3.min.js.map +1 -1
  26. package/dist/es5/applicationinsights-web-basic.js +50 -43
  27. package/dist/es5/applicationinsights-web-basic.js.map +1 -1
  28. package/dist/es5/applicationinsights-web-basic.min.js +2 -2
  29. package/dist/es5/applicationinsights-web-basic.min.js.map +1 -1
  30. package/dist-es5/__DynamicConstants.js +1 -1
  31. package/dist-es5/index.js +1 -1
  32. package/package.json +66 -63
  33. package/types/applicationinsights-web-basic.d.ts +11 -4
  34. package/types/applicationinsights-web-basic.namespaced.d.ts +11 -4
  35. package/browser/es5/aib.3.0.0.cjs.js.map +0 -1
  36. package/browser/es5/aib.3.0.0.cjs.min.js +0 -6
  37. package/browser/es5/aib.3.0.0.cjs.min.js.map +0 -1
  38. package/browser/es5/aib.3.0.0.gbl.js.map +0 -1
  39. package/browser/es5/aib.3.0.0.gbl.min.js +0 -6
  40. package/browser/es5/aib.3.0.0.gbl.min.js.map +0 -1
  41. package/browser/es5/aib.3.0.0.integrity.json +0 -66
  42. package/browser/es5/aib.3.0.0.js.map +0 -1
  43. package/browser/es5/aib.3.0.0.min.js +0 -6
  44. package/browser/es5/aib.3.0.0.min.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript Web SDK - Basic, 3.0.0
2
+ * Application Insights JavaScript Web SDK - Basic, 3.0.1-nightly3.2304-38
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  this.Microsoft = this.Microsoft || {};
@@ -868,17 +868,8 @@ this.Microsoft = this.Microsoft || {};
868
868
  function scheduleTimeout(callback, timeout) {
869
869
  return _createTimeoutWith(this, true, UNDEF_VALUE, arrSlice(arguments));
870
870
  }
871
-
872
- function scheduleInterval(callback, timeout) {
873
- var self = this;
874
- var theArguments = arrSlice(arguments);
875
- var handler = _createTimerHandler(true, function (intervalId) {
876
- intervalId && clearInterval(intervalId);
877
- return setInterval.apply(self, theArguments);
878
- }, function (intervalId) {
879
- clearInterval(intervalId);
880
- });
881
- return handler.h;
871
+ function createTimeout(callback, timeout) {
872
+ return _createTimeoutWith(this, false, UNDEF_VALUE, arrSlice(arguments));
882
873
  }
883
874
 
884
875
  var _a$4;
@@ -1207,6 +1198,7 @@ this.Microsoft = this.Microsoft || {};
1207
1198
  var _DYN_GET_NOTIFY_MGR = "getNotifyMgr";
1208
1199
  var _DYN_ADD_NOTIFICATION_LIS1 = "addNotificationListener";
1209
1200
  var _DYN_REMOVE_NOTIFICATION_2 = "removeNotificationListener";
1201
+ var _DYN_ENABLED = "enabled";
1210
1202
  var _DYN_STOP_POLLING_INTERNA3 = "stopPollingInternalLogs";
1211
1203
  var _DYN_ON_COMPLETE = "onComplete";
1212
1204
  var _DYN_VERSION = "version";
@@ -1642,7 +1634,7 @@ this.Microsoft = this.Microsoft || {};
1642
1634
  return result;
1643
1635
  }
1644
1636
 
1645
- var version = '3.0.0';
1637
+ var version = "3.0.1-nightly3.2304-38";
1646
1638
  var instanceName = "." + newId(6);
1647
1639
  var _dataUid = 0;
1648
1640
  function _canAcceptData(target) {
@@ -2531,7 +2523,7 @@ this.Microsoft = this.Microsoft || {};
2531
2523
  return _isIgnoredCookie(cookieMgrCfg, name);
2532
2524
  }
2533
2525
  function _isCfgEnabled(rootConfig, cookieMgrConfig) {
2534
- var isCfgEnabled = cookieMgrConfig.enabled;
2526
+ var isCfgEnabled = cookieMgrConfig[_DYN_ENABLED ];
2535
2527
  if (isNullOrUndefined(isCfgEnabled)) {
2536
2528
  var cookieEnabled = void 0;
2537
2529
  if (!isUndefined(rootConfig[strIsCookieUseDisabled])) {
@@ -2574,7 +2566,7 @@ this.Microsoft = this.Microsoft || {};
2574
2566
  },
2575
2567
  setEnabled: function (value) {
2576
2568
  _enabled = value !== false;
2577
- cookieMgrConfig.enabled = value;
2569
+ cookieMgrConfig[_DYN_ENABLED ] = value;
2578
2570
  },
2579
2571
  set: function (name, value, maxAgeSec, domain, path) {
2580
2572
  var result = false;
@@ -3829,6 +3821,7 @@ this.Microsoft = this.Microsoft || {};
3829
3821
  var _pluginVersionString;
3830
3822
  var _internalLogPoller;
3831
3823
  var _internalLogPollerListening;
3824
+ var _forceStopInternalLogPoller;
3832
3825
  dynamicProto(AppInsightsCore, this, function (_self) {
3833
3826
  _initDefaults();
3834
3827
  _self["_getDbgPlgTargets"] = function () {
@@ -3968,33 +3961,40 @@ this.Microsoft = this.Microsoft || {};
3968
3961
  };
3969
3962
  _self[_DYN_POLL_INTERNAL_LOGS ] = function (eventName) {
3970
3963
  _internalLogsEventName = eventName || null;
3971
- function _startLogPoller(config) {
3972
- var interval = config.diagnosticLogInterval;
3973
- if (!interval || !(interval > 0)) {
3974
- interval = 10000;
3964
+ _forceStopInternalLogPoller = false;
3965
+ _internalLogPoller && _internalLogPoller[_DYN_CANCEL ]();
3966
+ return _startLogPoller(true);
3967
+ };
3968
+ function _startLogPoller(alwaysStart) {
3969
+ if ((!_internalLogPoller || !_internalLogPoller[_DYN_ENABLED ]) && !_forceStopInternalLogPoller) {
3970
+ var shouldStart = alwaysStart || (_self.logger && _self.logger.queue[_DYN_LENGTH$2 ] > 0);
3971
+ if (shouldStart) {
3972
+ if (!_internalLogPollerListening) {
3973
+ _internalLogPollerListening = true;
3974
+ _addUnloadHook(_configHandler[_DYN_WATCH ](function (details) {
3975
+ var interval = details.cfg.diagnosticLogInterval;
3976
+ if (!interval || !(interval > 0)) {
3977
+ interval = 10000;
3978
+ }
3979
+ var isRunning = false;
3980
+ if (_internalLogPoller) {
3981
+ isRunning = _internalLogPoller[_DYN_ENABLED ];
3982
+ _internalLogPoller[_DYN_CANCEL ]();
3983
+ }
3984
+ _internalLogPoller = createTimeout(_flushInternalLogs, interval);
3985
+ _internalLogPoller.unref();
3986
+ _internalLogPoller[_DYN_ENABLED ] = isRunning;
3987
+ }));
3988
+ }
3989
+ _internalLogPoller[_DYN_ENABLED ] = true;
3975
3990
  }
3976
- _internalLogPoller && _internalLogPoller[_DYN_CANCEL ]();
3977
- _internalLogPoller = scheduleInterval(function () {
3978
- _flushInternalLogs();
3979
- }, interval);
3980
- }
3981
- if (!_internalLogPollerListening) {
3982
- _internalLogPollerListening = true;
3983
- _addUnloadHook(_configHandler[_DYN_WATCH ](function (details) {
3984
- _startLogPoller(details.cfg);
3985
- }));
3986
- }
3987
- else {
3988
- _startLogPoller(_configHandler.cfg);
3989
3991
  }
3990
3992
  return _internalLogPoller;
3991
- };
3993
+ }
3992
3994
  _self[_DYN_STOP_POLLING_INTERNA3 ] = function () {
3993
- if (_internalLogPoller) {
3994
- _internalLogPoller[_DYN_CANCEL ]();
3995
- _internalLogPoller = null;
3996
- _flushInternalLogs();
3997
- }
3995
+ _forceStopInternalLogPoller = true;
3996
+ _internalLogPoller && _internalLogPoller[_DYN_CANCEL ]();
3997
+ _flushInternalLogs();
3998
3998
  };
3999
3999
  proxyFunctions(_self, function () { return _telemetryInitializerPlugin; }, ["addTelemetryInitializer"]);
4000
4000
  _self.unload = function (isAsync, unloadComplete, cbTimeout) {
@@ -4025,6 +4025,7 @@ this.Microsoft = this.Microsoft || {};
4025
4025
  _self[_DYN_STOP_POLLING_INTERNA3 ]();
4026
4026
  processUnloadCtx[_DYN_PROCESS_NEXT ](unloadState);
4027
4027
  }
4028
+ _flushInternalLogs();
4028
4029
  if (!_flushChannels(isAsync, _doUnload, 6 , cbTimeout)) ;
4029
4030
  };
4030
4031
  _self[_DYN_GET_PLUGIN ] = _getPlugin;
@@ -4212,9 +4213,12 @@ this.Microsoft = this.Microsoft || {};
4212
4213
  _cfgListeners = [];
4213
4214
  _pluginVersionString = null;
4214
4215
  _pluginVersionStringArr = null;
4216
+ _forceStopInternalLogPoller = false;
4215
4217
  }
4216
4218
  function _createTelCtx() {
4217
- return createProcessTelemetryContext(_getPluginChain(), _configHandler.cfg, _self);
4219
+ var theCtx = createProcessTelemetryContext(_getPluginChain(), _configHandler.cfg, _self);
4220
+ theCtx[_DYN_ON_COMPLETE ](_startLogPoller);
4221
+ return theCtx;
4218
4222
  }
4219
4223
  function _initPluginChain(updateState) {
4220
4224
  var theExtensions = _validateExtensions(_self[_DYN_LOGGER ], ChannelControllerPriority, _configExtensions);
@@ -4336,6 +4340,7 @@ this.Microsoft = this.Microsoft || {};
4336
4340
  _channelConfig = newChannelConfig;
4337
4341
  }
4338
4342
  removeComplete && removeComplete(removed);
4343
+ _startLogPoller();
4339
4344
  });
4340
4345
  unloadCtx[_DYN_PROCESS_NEXT ](unloadState);
4341
4346
  }
@@ -4344,8 +4349,9 @@ this.Microsoft = this.Microsoft || {};
4344
4349
  }
4345
4350
  }
4346
4351
  function _flushInternalLogs() {
4347
- var queue = _self[_DYN_LOGGER ] ? _self[_DYN_LOGGER ].queue : [];
4348
- if (queue) {
4352
+ if (_self[_DYN_LOGGER ] && _self[_DYN_LOGGER ].queue) {
4353
+ var queue = _self[_DYN_LOGGER ].queue.slice(0);
4354
+ _self.logger.queue[_DYN_LENGTH$2 ] = 0;
4349
4355
  arrForEach(queue, function (logMessage) {
4350
4356
  var _a;
4351
4357
  var item = (_a = {},
@@ -4357,7 +4363,6 @@ this.Microsoft = this.Microsoft || {};
4357
4363
  _a);
4358
4364
  _self.track(item);
4359
4365
  });
4360
- queue[_DYN_LENGTH$2 ] = 0;
4361
4366
  }
4362
4367
  }
4363
4368
  function _flushChannels(isAsync, callBack, sendReason, cbTimeout) {
@@ -4430,6 +4435,7 @@ this.Microsoft = this.Microsoft || {};
4430
4435
  }
4431
4436
  function _doUpdate(updateState) {
4432
4437
  var updateCtx = createProcessTelemetryUpdateContext(_getPluginChain(), _self);
4438
+ updateCtx[_DYN_ON_COMPLETE ](_startLogPoller);
4433
4439
  if (!_self._updateHook || _self._updateHook(updateCtx, updateState) !== true) {
4434
4440
  updateCtx[_DYN_PROCESS_NEXT ](updateState);
4435
4441
  }
@@ -4438,6 +4444,7 @@ this.Microsoft = this.Microsoft || {};
4438
4444
  var logger = _self[_DYN_LOGGER ];
4439
4445
  if (logger) {
4440
4446
  _throwInternal(logger, 2 , 73 , message);
4447
+ _startLogPoller();
4441
4448
  }
4442
4449
  else {
4443
4450
  throwError(message);
@@ -5953,7 +5960,7 @@ this.Microsoft = this.Microsoft || {};
5953
5960
  }
5954
5961
  }
5955
5962
  var EnvelopeCreator = {
5956
- Version: '3.0.0'
5963
+ Version: "3.0.1-nightly3.2304-38"
5957
5964
  };
5958
5965
  function DependencyEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {
5959
5966
  EnvelopeCreatorInit(logger, telemetryItem);
@@ -7461,4 +7468,4 @@ this.Microsoft = this.Microsoft || {};
7461
7468
  exports.throwError = throwError;
7462
7469
 
7463
7470
  })(this.Microsoft.ApplicationInsights3 = this.Microsoft.ApplicationInsights3 || {});
7464
- //# sourceMappingURL=aib.3.0.0.gbl.js.map
7471
+ //# sourceMappingURL=aib.3.0.1-nightly3.2304-38.gbl.js.map