@microsoft/applicationinsights-core-js 3.3.7-nightly3.2504-04 → 3.3.7-nightly3.2504-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 (98) hide show
  1. package/browser/es5/applicationinsights-core-js.cjs.js +89 -79
  2. package/browser/es5/applicationinsights-core-js.cjs.js.map +1 -1
  3. package/browser/es5/applicationinsights-core-js.cjs.min.js +2 -2
  4. package/browser/es5/applicationinsights-core-js.cjs.min.js.map +1 -1
  5. package/browser/es5/applicationinsights-core-js.gbl.js +91 -81
  6. package/browser/es5/applicationinsights-core-js.gbl.js.map +1 -1
  7. package/browser/es5/applicationinsights-core-js.gbl.min.js +2 -2
  8. package/browser/es5/applicationinsights-core-js.gbl.min.js.map +1 -1
  9. package/browser/es5/applicationinsights-core-js.integrity.json +25 -25
  10. package/browser/es5/applicationinsights-core-js.js +91 -81
  11. package/browser/es5/applicationinsights-core-js.js.map +1 -1
  12. package/browser/es5/applicationinsights-core-js.min.js +2 -2
  13. package/browser/es5/applicationinsights-core-js.min.js.map +1 -1
  14. package/dist/es5/applicationinsights-core-js.js +89 -79
  15. package/dist/es5/applicationinsights-core-js.js.map +1 -1
  16. package/dist/es5/applicationinsights-core-js.min.js +2 -2
  17. package/dist/es5/applicationinsights-core-js.min.js.map +1 -1
  18. package/dist-es5/Config/ConfigDefaultHelpers.js +1 -1
  19. package/dist-es5/Config/ConfigDefaults.js +1 -1
  20. package/dist-es5/Config/DynamicConfig.js +1 -1
  21. package/dist-es5/Config/DynamicProperty.js +1 -1
  22. package/dist-es5/Config/DynamicState.js +1 -1
  23. package/dist-es5/Config/DynamicSupport.js +1 -1
  24. package/dist-es5/Config/IConfigDefaults.js +1 -1
  25. package/dist-es5/Config/IDynamicConfigHandler.js +1 -1
  26. package/dist-es5/Config/IDynamicPropertyHandler.js +1 -1
  27. package/dist-es5/Config/IDynamicWatcher.js +1 -1
  28. package/dist-es5/Config/_IDynamicConfigHandlerState.js +1 -1
  29. package/dist-es5/JavaScriptSDK/AggregationError.js +1 -1
  30. package/dist-es5/JavaScriptSDK/AppInsightsCore.js +109 -99
  31. package/dist-es5/JavaScriptSDK/AppInsightsCore.js.map +1 -1
  32. package/dist-es5/JavaScriptSDK/AsyncUtils.js +1 -1
  33. package/dist-es5/JavaScriptSDK/BaseTelemetryPlugin.js +1 -1
  34. package/dist-es5/JavaScriptSDK/Constants.js +1 -1
  35. package/dist-es5/JavaScriptSDK/CookieMgr.js +1 -1
  36. package/dist-es5/JavaScriptSDK/CoreUtils.js +1 -1
  37. package/dist-es5/JavaScriptSDK/DataCacheHelper.js +2 -2
  38. package/dist-es5/JavaScriptSDK/DataCacheHelper.js.map +1 -1
  39. package/dist-es5/JavaScriptSDK/DbgExtensionUtils.js +1 -1
  40. package/dist-es5/JavaScriptSDK/DiagnosticLogger.js +1 -1
  41. package/dist-es5/JavaScriptSDK/EnvUtils.js +1 -1
  42. package/dist-es5/JavaScriptSDK/EventHelpers.js +1 -1
  43. package/dist-es5/JavaScriptSDK/HelperFuncs.js +1 -1
  44. package/dist-es5/JavaScriptSDK/InstrumentHooks.js +1 -1
  45. package/dist-es5/JavaScriptSDK/InternalConstants.js +1 -1
  46. package/dist-es5/JavaScriptSDK/NotificationManager.js +1 -1
  47. package/dist-es5/JavaScriptSDK/PerfManager.js +1 -1
  48. package/dist-es5/JavaScriptSDK/ProcessTelemetryContext.js +1 -1
  49. package/dist-es5/JavaScriptSDK/RandomHelper.js +1 -1
  50. package/dist-es5/JavaScriptSDK/ResponseHelpers.js +1 -1
  51. package/dist-es5/JavaScriptSDK/SenderPostManager.js +1 -1
  52. package/dist-es5/JavaScriptSDK/TelemetryHelpers.js +1 -1
  53. package/dist-es5/JavaScriptSDK/TelemetryInitializerPlugin.js +1 -1
  54. package/dist-es5/JavaScriptSDK/UnloadHandlerContainer.js +1 -1
  55. package/dist-es5/JavaScriptSDK/UnloadHookContainer.js +1 -1
  56. package/dist-es5/JavaScriptSDK/W3cTraceParent.js +1 -1
  57. package/dist-es5/JavaScriptSDK.Enums/EnumHelperFuncs.js +1 -1
  58. package/dist-es5/JavaScriptSDK.Enums/EventsDiscardedReason.js +1 -1
  59. package/dist-es5/JavaScriptSDK.Enums/FeatureOptInEnums.js +1 -1
  60. package/dist-es5/JavaScriptSDK.Enums/InitActiveStatusEnum.js +1 -1
  61. package/dist-es5/JavaScriptSDK.Enums/LoggingEnums.js +1 -1
  62. package/dist-es5/JavaScriptSDK.Enums/SendRequestReason.js +1 -1
  63. package/dist-es5/JavaScriptSDK.Enums/TelemetryUnloadReason.js +1 -1
  64. package/dist-es5/JavaScriptSDK.Enums/TelemetryUpdateReason.js +1 -1
  65. package/dist-es5/JavaScriptSDK.Interfaces/IAppInsightsCore.js +1 -1
  66. package/dist-es5/JavaScriptSDK.Interfaces/IChannelControls.js +1 -1
  67. package/dist-es5/JavaScriptSDK.Interfaces/IChannelControlsHost.js +1 -1
  68. package/dist-es5/JavaScriptSDK.Interfaces/IConfiguration.js +1 -1
  69. package/dist-es5/JavaScriptSDK.Interfaces/ICookieMgr.js +1 -1
  70. package/dist-es5/JavaScriptSDK.Interfaces/IDbgExtension.js +1 -1
  71. package/dist-es5/JavaScriptSDK.Interfaces/IDiagnosticLogger.js +1 -1
  72. package/dist-es5/JavaScriptSDK.Interfaces/IDistributedTraceContext.js +1 -1
  73. package/dist-es5/JavaScriptSDK.Interfaces/IExceptionConfig.js +1 -1
  74. package/dist-es5/JavaScriptSDK.Interfaces/IFeatureOptIn.js +1 -1
  75. package/dist-es5/JavaScriptSDK.Interfaces/IInstrumentHooks.js +1 -1
  76. package/dist-es5/JavaScriptSDK.Interfaces/INotificationListener.js +1 -1
  77. package/dist-es5/JavaScriptSDK.Interfaces/INotificationManager.js +1 -1
  78. package/dist-es5/JavaScriptSDK.Interfaces/IPerfEvent.js +1 -1
  79. package/dist-es5/JavaScriptSDK.Interfaces/IPerfManager.js +1 -1
  80. package/dist-es5/JavaScriptSDK.Interfaces/IProcessTelemetryContext.js +1 -1
  81. package/dist-es5/JavaScriptSDK.Interfaces/ISenderPostManager.js +1 -1
  82. package/dist-es5/JavaScriptSDK.Interfaces/ITelemetryInitializers.js +1 -1
  83. package/dist-es5/JavaScriptSDK.Interfaces/ITelemetryItem.js +1 -1
  84. package/dist-es5/JavaScriptSDK.Interfaces/ITelemetryPlugin.js +1 -1
  85. package/dist-es5/JavaScriptSDK.Interfaces/ITelemetryPluginChain.js +1 -1
  86. package/dist-es5/JavaScriptSDK.Interfaces/ITelemetryUnloadState.js +1 -1
  87. package/dist-es5/JavaScriptSDK.Interfaces/ITelemetryUpdateState.js +1 -1
  88. package/dist-es5/JavaScriptSDK.Interfaces/ITraceParent.js +1 -1
  89. package/dist-es5/JavaScriptSDK.Interfaces/IUnloadHook.js +1 -1
  90. package/dist-es5/JavaScriptSDK.Interfaces/IUnloadableComponent.js +1 -1
  91. package/dist-es5/JavaScriptSDK.Interfaces/IXDomainRequest.js +1 -1
  92. package/dist-es5/JavaScriptSDK.Interfaces/IXHROverride.js +1 -1
  93. package/dist-es5/__DynamicConstants.js +3 -3
  94. package/dist-es5/__DynamicConstants.js.map +1 -1
  95. package/dist-es5/applicationinsights-core-js.js +1 -1
  96. package/package.json +1 -1
  97. package/types/applicationinsights-core-js.d.ts +1 -1
  98. package/types/applicationinsights-core-js.namespaced.d.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Application Insights JavaScript SDK - Core, 3.3.7-nightly3.2504-04
2
+ * Application Insights JavaScript SDK - Core, 3.3.7-nightly3.2504-06
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Application Insights JavaScript SDK - Core, 3.3.7-nightly3.2504-04
2
+ * Application Insights JavaScript SDK - Core, 3.3.7-nightly3.2504-06
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Application Insights JavaScript SDK - Core, 3.3.7-nightly3.2504-04
2
+ * Application Insights JavaScript SDK - Core, 3.3.7-nightly3.2504-06
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Application Insights JavaScript SDK - Core, 3.3.7-nightly3.2504-04
2
+ * Application Insights JavaScript SDK - Core, 3.3.7-nightly3.2504-06
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Application Insights JavaScript SDK - Core, 3.3.7-nightly3.2504-04
2
+ * Application Insights JavaScript SDK - Core, 3.3.7-nightly3.2504-06
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Application Insights JavaScript SDK - Core, 3.3.7-nightly3.2504-04
2
+ * Application Insights JavaScript SDK - Core, 3.3.7-nightly3.2504-06
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Application Insights JavaScript SDK - Core, 3.3.7-nightly3.2504-04
2
+ * Application Insights JavaScript SDK - Core, 3.3.7-nightly3.2504-06
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Application Insights JavaScript SDK - Core, 3.3.7-nightly3.2504-04
2
+ * Application Insights JavaScript SDK - Core, 3.3.7-nightly3.2504-06
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Application Insights JavaScript SDK - Core, 3.3.7-nightly3.2504-04
2
+ * Application Insights JavaScript SDK - Core, 3.3.7-nightly3.2504-06
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Application Insights JavaScript SDK - Core, 3.3.7-nightly3.2504-04
2
+ * Application Insights JavaScript SDK - Core, 3.3.7-nightly3.2504-06
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Application Insights JavaScript SDK - Core, 3.3.7-nightly3.2504-04
2
+ * Application Insights JavaScript SDK - Core, 3.3.7-nightly3.2504-06
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  export {};
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Application Insights JavaScript SDK - Core, 3.3.7-nightly3.2504-04
2
+ * Application Insights JavaScript SDK - Core, 3.3.7-nightly3.2504-06
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Application Insights JavaScript SDK - Core, 3.3.7-nightly3.2504-04
2
+ * Application Insights JavaScript SDK - Core, 3.3.7-nightly3.2504-06
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
 
@@ -263,105 +263,8 @@ var AppInsightsCore = /** @class */ (function () {
263
263
  // This will be "re-run" if the referenced config properties are changed
264
264
  _addUnloadHook(_configHandler[_DYN_WATCH /* @min:%2ewatch */](function (details) {
265
265
  var rootCfg = details.cfg;
266
- var isPending = _activeStatus === 3 /* eActiveStatus.PENDING */;
267
- if (isPending) {
268
- // means waiting for previous promises to be resolved, won't apply new changes
269
- return;
270
- }
271
266
  _initInMemoMaxSize = rootCfg.initInMemoMaxSize || maxInitQueueSize;
272
- // app Insights core only handle ikey and endpointurl, aisku will handle cs
273
- var ikey = rootCfg.instrumentationKey;
274
- var endpointUrl = rootCfg.endpointUrl; // do not need to validate endpoint url, if it is null, default one will be set by sender
275
- if (isNullOrUndefined(ikey)) {
276
- _instrumentationKey = null;
277
- // if new ikey is null, set status to be inactive, all new events will be saved in memory or dropped
278
- _activeStatus = ActiveStatus.INACTIVE;
279
- var msg = "Please provide instrumentation key";
280
- if (!_isInitialized) {
281
- // only throw error during initialization
282
- throwError(msg);
283
- }
284
- else {
285
- _throwInternal(_logger, 1 /* eLoggingSeverity.CRITICAL */, 100 /* _eInternalMessageId.InvalidInstrumentationKey */, msg);
286
- _releaseQueues();
287
- }
288
- return;
289
- }
290
- var promises = [];
291
- if (isPromiseLike(ikey)) {
292
- promises[_DYN_PUSH /* @min:%2epush */](ikey);
293
- _instrumentationKey = null; // reset current local ikey variable (otherwise it will always be the previous ikeys if timeout is called before promise cb)
294
- }
295
- else {
296
- // string
297
- _instrumentationKey = ikey;
298
- }
299
- if (isPromiseLike(endpointUrl)) {
300
- promises[_DYN_PUSH /* @min:%2epush */](endpointUrl);
301
- _endpoint = null; // reset current local endpoint variable (otherwise it will always be the previous urls if timeout is called before promise cb)
302
- }
303
- else {
304
- // string or null
305
- _endpoint = endpointUrl;
306
- }
307
- // at least have one promise
308
- if (promises[_DYN_LENGTH /* @min:%2elength */]) {
309
- // reset to false for new dynamic changes
310
- _isStatusSet = false;
311
- _activeStatus = 3 /* eActiveStatus.PENDING */;
312
- var initTimeout = isNotNullOrUndefined(rootCfg.initTimeOut) ? rootCfg.initTimeOut : maxInitTimeout; // rootCfg.initTimeOut could be 0
313
- var allPromises = createSyncAllSettledPromise(promises);
314
- _initTimer = scheduleTimeout(function () {
315
- // set _isStatusSet to true
316
- // set active status
317
- // release queues
318
- _initTimer = null;
319
- if (!_isStatusSet) {
320
- _setStatus();
321
- }
322
- }, initTimeout);
323
- doAwaitResponse(allPromises, function (response) {
324
- try {
325
- if (_isStatusSet) {
326
- // promises take too long to resolve, ignore them
327
- // active status should be set by timeout already
328
- return;
329
- }
330
- if (!response.rejected) {
331
- var values = response[_DYN_VALUE /* @min:%2evalue */];
332
- if (values && values[_DYN_LENGTH /* @min:%2elength */]) {
333
- // ikey
334
- var ikeyRes = values[0];
335
- _instrumentationKey = ikeyRes && ikeyRes[_DYN_VALUE /* @min:%2evalue */];
336
- // endpoint
337
- if (values[_DYN_LENGTH /* @min:%2elength */] > 1) {
338
- var endpointRes = values[1];
339
- _endpoint = endpointRes && endpointRes[_DYN_VALUE /* @min:%2evalue */];
340
- }
341
- }
342
- if (_instrumentationKey) {
343
- // if ikey is null, no need to trigger extra dynamic changes for extensions
344
- config.instrumentationKey = _instrumentationKey; // set config.instrumentationKey for extensions to consume
345
- config.endpointUrl = _endpoint; // set config.endpointUrl for extensions to consume
346
- }
347
- }
348
- // set _isStatusSet to true
349
- // set active status
350
- // release queues
351
- _setStatus();
352
- }
353
- catch (e) {
354
- if (!_isStatusSet) {
355
- _setStatus();
356
- }
357
- }
358
- });
359
- }
360
- else {
361
- // means no promises
362
- _setStatus();
363
- }
364
- //_instrumentationKey = details.cfg.instrumentationKey;
267
+ _handleIKeyEndpointPromises(rootCfg);
365
268
  // Mark the extensionConfig and all first level keys as referenced
366
269
  // This is so that calls to getExtCfg() will always return the same object
367
270
  // Even when a user may "re-assign" the plugin properties (or it's unloaded/reloaded)
@@ -507,6 +410,113 @@ var AppInsightsCore = /** @class */ (function () {
507
410
  _internalLogPoller && _internalLogPoller[_DYN_CANCEL /* @min:%2ecancel */]();
508
411
  return _startLogPoller(true);
509
412
  };
413
+ function _handleIKeyEndpointPromises(theConfig) {
414
+ // app Insights core only handle ikey and endpointurl, aisku will handle cs
415
+ // But we want to reference these config values so that if any future changes are made
416
+ // this will trigger the re-run of the watch function
417
+ // and the ikey and endpointUrl will be set to the new values
418
+ var ikey = theConfig.instrumentationKey;
419
+ var endpointUrl = theConfig.endpointUrl; // do not need to validate endpoint url, if it is null, default one will be set by sender
420
+ // Check if we are waiting for previous promises to be resolved, won't apply new changes
421
+ if (_activeStatus !== 3 /* eActiveStatus.PENDING */) {
422
+ if (isNullOrUndefined(ikey)) {
423
+ _instrumentationKey = null;
424
+ // if new ikey is null, set status to be inactive, all new events will be saved in memory or dropped
425
+ _activeStatus = ActiveStatus.INACTIVE;
426
+ var msg = "Please provide instrumentation key";
427
+ if (!_isInitialized) {
428
+ // only throw error during initialization
429
+ throwError(msg);
430
+ }
431
+ else {
432
+ _throwInternal(_logger, 1 /* eLoggingSeverity.CRITICAL */, 100 /* _eInternalMessageId.InvalidInstrumentationKey */, msg);
433
+ _releaseQueues();
434
+ }
435
+ return;
436
+ }
437
+ var promises = [];
438
+ if (isPromiseLike(ikey)) {
439
+ promises[_DYN_PUSH /* @min:%2epush */](ikey);
440
+ _instrumentationKey = null; // reset current local ikey variable (otherwise it will always be the previous ikeys if timeout is called before promise cb)
441
+ }
442
+ else {
443
+ // string
444
+ _instrumentationKey = ikey;
445
+ }
446
+ if (isPromiseLike(endpointUrl)) {
447
+ promises[_DYN_PUSH /* @min:%2epush */](endpointUrl);
448
+ _endpoint = null; // reset current local endpoint variable (otherwise it will always be the previous urls if timeout is called before promise cb)
449
+ }
450
+ else {
451
+ // string or null
452
+ _endpoint = endpointUrl;
453
+ }
454
+ // at least have one promise
455
+ if (promises[_DYN_LENGTH /* @min:%2elength */]) {
456
+ _waitForInitPromises(theConfig, promises);
457
+ }
458
+ else {
459
+ // means no promises
460
+ _setStatus();
461
+ }
462
+ }
463
+ }
464
+ function _waitForInitPromises(theConfig, promises) {
465
+ // reset to false for new dynamic changes
466
+ _isStatusSet = false;
467
+ _activeStatus = 3 /* eActiveStatus.PENDING */;
468
+ var initTimeout = isNotNullOrUndefined(theConfig.initTimeOut) ? theConfig.initTimeOut : maxInitTimeout; // theConfig.initTimeOut could be 0
469
+ var allPromises = createSyncAllSettledPromise(promises);
470
+ if (_initTimer) {
471
+ // Stop any previous timer
472
+ _initTimer[_DYN_CANCEL /* @min:%2ecancel */]();
473
+ }
474
+ _initTimer = scheduleTimeout(function () {
475
+ // set _isStatusSet to true
476
+ // set active status
477
+ // release queues
478
+ _initTimer = null;
479
+ if (!_isStatusSet) {
480
+ _setStatus();
481
+ }
482
+ }, initTimeout);
483
+ doAwaitResponse(allPromises, function (response) {
484
+ try {
485
+ if (_isStatusSet) {
486
+ // promises take too long to resolve, ignore them
487
+ // active status should be set by timeout already
488
+ return;
489
+ }
490
+ if (!response.rejected) {
491
+ var values = response[_DYN_VALUE /* @min:%2evalue */];
492
+ if (values && values[_DYN_LENGTH /* @min:%2elength */]) {
493
+ // ikey
494
+ var ikeyRes = values[0];
495
+ _instrumentationKey = ikeyRes && ikeyRes[_DYN_VALUE /* @min:%2evalue */];
496
+ // endpoint
497
+ if (values[_DYN_LENGTH /* @min:%2elength */] > 1) {
498
+ var endpointRes = values[1];
499
+ _endpoint = endpointRes && endpointRes[_DYN_VALUE /* @min:%2evalue */];
500
+ }
501
+ }
502
+ if (_instrumentationKey) {
503
+ // if ikey is null, no need to trigger extra dynamic changes for extensions
504
+ theConfig.instrumentationKey = _instrumentationKey; // set config.instrumentationKey for extensions to consume
505
+ theConfig.endpointUrl = _endpoint; // set config.endpointUrl for extensions to consume
506
+ }
507
+ }
508
+ // set _isStatusSet to true
509
+ // set active status
510
+ // release queues
511
+ _setStatus();
512
+ }
513
+ catch (e) {
514
+ if (!_isStatusSet) {
515
+ _setStatus();
516
+ }
517
+ }
518
+ });
519
+ }
510
520
  function _setStatus() {
511
521
  _isStatusSet = true;
512
522
  if (isNullOrUndefined(_instrumentationKey)) {