@microsoft/applicationinsights-react-native 4.3.9-nightly.2602-08 → 4.3.9-nightly.2603-02

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - React Native Plugin, 4.3.9-nightly.2602-08
2
+ * Application Insights JavaScript SDK - React Native Plugin, 4.3.9-nightly.2603-02
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -18,7 +18,7 @@
18
18
  var strShimPrototype = "prototype";
19
19
  var ObjClass$1 = Object;
20
20
 
21
- /*! https://github.com/nevware21/ts-utils v0.12.6 */
21
+ /*! https://github.com/nevware21/ts-utils v0.13.0 */
22
22
  function _pureAssign(func1, func2) {
23
23
  return func1 || func2;
24
24
  }
@@ -732,7 +732,7 @@
732
732
  function _setName(baseClass, name) {
733
733
  name && (baseClass[NAME] = name);
734
734
  }
735
- function createCustomError(name, constructCb, errorBase) {
735
+ function createCustomError(name, constructCb, errorBase, superArgsFn) {
736
736
  var theBaseClass = errorBase || Error;
737
737
  var orgName = theBaseClass[PROTOTYPE][NAME];
738
738
  var captureFn = Error.captureStackTrace;
@@ -741,7 +741,7 @@
741
741
  var theArgs = arguments;
742
742
  try {
743
743
  safe(_setName, [theBaseClass, name]);
744
- var _self = fnApply(theBaseClass, _this, ArrSlice[CALL](theArgs)) || _this;
744
+ var _self = fnApply(theBaseClass, _this, superArgsFn ? superArgsFn(theArgs) : ArrSlice[CALL](theArgs)) || _this;
745
745
  if (_self !== _this) {
746
746
  var orgProto = objGetPrototypeOf(_this);
747
747
  if (orgProto !== objGetPrototypeOf(_self)) {
@@ -1379,9 +1379,11 @@
1379
1379
  var _DYN_CANCEL = "cancel";
1380
1380
  var _DYN_INITIALIZE = "initialize";
1381
1381
  var _DYN_IDENTIFIER = "identifier";
1382
+ var _DYN_STRINGIFY = "stringify";
1382
1383
  var _DYN_IS_INITIALIZED = "isInitialized";
1383
1384
  var _DYN_GET_PLUGIN = "getPlugin";
1384
1385
  var _DYN_NAME = "name";
1386
+ var _DYN_TIME = "time";
1385
1387
  var _DYN_PROCESS_NEXT = "processNext";
1386
1388
  var _DYN_GET_PROCESS_TEL_CONT2 = "getProcessTelContext";
1387
1389
  var _DYN_UNLOAD = "unload";
@@ -1395,11 +1397,13 @@
1395
1397
  var _DYN_UPDATE = "update";
1396
1398
  var _DYN_GET_NEXT = "getNext";
1397
1399
  var _DYN_SET_NEXT_PLUGIN = "setNextPlugin";
1398
- var _DYN_USER_AGENT = "userAgent";
1399
- var _DYN_REPLACE = "replace";
1400
1400
  var _DYN_IS_CHILD_EVT = "isChildEvt";
1401
1401
  var _DYN_GET_CTX = "getCtx";
1402
1402
  var _DYN_SET_CTX = "setCtx";
1403
+ var _DYN_CONFIG = "config";
1404
+ var _DYN_CALL = "call";
1405
+ var _DYN_REPLACE = "replace";
1406
+ var _DYN_USER_AGENT = "userAgent";
1403
1407
 
1404
1408
  var aggregationErrorType;
1405
1409
  function throwAggregationError(message, sourceErrors) {
@@ -1491,8 +1495,18 @@
1491
1495
  var strMsCrypto = "msCrypto";
1492
1496
  var strMsie = "msie";
1493
1497
  var strTrident = "trident/";
1494
- var _isTrident = null;
1495
- var _navUserAgentCheck = null;
1498
+ var _isTrident;
1499
+ var _navUserAgentCheck;
1500
+ var _userAgent;
1501
+ function getUserAgentString() {
1502
+ if (!_userAgent) {
1503
+ _userAgent = getLazy(function () {
1504
+ var nav = getNavigator() || {};
1505
+ return nav[_DYN_USER_AGENT ] || STR_EMPTY;
1506
+ });
1507
+ }
1508
+ return _userAgent.v;
1509
+ }
1496
1510
  function getConsole() {
1497
1511
  if (typeof console !== strShimUndefined) {
1498
1512
  return console;
@@ -1515,13 +1529,13 @@
1515
1529
  return getInst(strMsCrypto);
1516
1530
  }
1517
1531
  function isIE() {
1518
- var nav = getNavigator();
1519
- if (nav && (nav[_DYN_USER_AGENT ] !== _navUserAgentCheck || _isTrident === null)) {
1520
- _navUserAgentCheck = nav[_DYN_USER_AGENT ];
1521
- var userAgent = (_navUserAgentCheck || STR_EMPTY)[_DYN_TO_LOWER_CASE ]();
1522
- _isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident));
1532
+ var userAgent = getUserAgentString();
1533
+ if (!_isTrident || userAgent !== _navUserAgentCheck) {
1534
+ _navUserAgentCheck = userAgent;
1535
+ var lwrUserAgent = _navUserAgentCheck[_DYN_TO_LOWER_CASE ]();
1536
+ _isTrident = createCachedValue(strContains(lwrUserAgent, strMsie) || strContains(lwrUserAgent, strTrident));
1523
1537
  }
1524
- return _isTrident;
1538
+ return _isTrident.v;
1525
1539
  }
1526
1540
 
1527
1541
  var UInt32Mask = 0x100000000;
@@ -1542,7 +1556,7 @@
1542
1556
  function _autoSeedMwc() {
1543
1557
  try {
1544
1558
  var now = utcNow() & 0x7fffffff;
1545
- _mwcSeed(((Math.random() * UInt32Mask) ^ now) + now);
1559
+ _mwcSeed(((mathRandom() * UInt32Mask) ^ now) + now);
1546
1560
  }
1547
1561
  catch (e) {
1548
1562
  }
@@ -1560,7 +1574,7 @@
1560
1574
  value = mwcRandom32() & MaxUInt32;
1561
1575
  }
1562
1576
  if (value === 0) {
1563
- value = mathFloor((UInt32Mask * Math.random()) | 0);
1577
+ value = mathFloor((UInt32Mask * mathRandom()) | 0);
1564
1578
  }
1565
1579
  if (!signed) {
1566
1580
  value >>>= 0;
@@ -1594,7 +1608,7 @@
1594
1608
  return result;
1595
1609
  }
1596
1610
 
1597
- var version = '3.3.12-nightly3.2602-20';
1611
+ var version = '3.4.0-nightly3.2603-05';
1598
1612
  var instanceName = "." + newId(6);
1599
1613
  var _dataUid = 0;
1600
1614
  function _canAcceptData(target) {
@@ -2151,7 +2165,7 @@
2151
2165
  configHandler = null;
2152
2166
  }
2153
2167
  };
2154
- objDefine(handler, "toJSON", { v: function () { return "WatcherHandler" + (handler.fn ? "" : "[X]"); } });
2168
+ objDefine(handler, "toJSON", { v: function () { return "WatcherHandler" + (handler.fn ? STR_EMPTY : "[X]"); } });
2155
2169
  state.use(handler, configHandler);
2156
2170
  return handler;
2157
2171
  }
@@ -2321,7 +2335,7 @@
2321
2335
  msgId;
2322
2336
  var strProps = STR_EMPTY;
2323
2337
  if (hasJSON()) {
2324
- strProps = getJSON().stringify(properties);
2338
+ strProps = getJSON()[_DYN_STRINGIFY ](properties);
2325
2339
  }
2326
2340
  var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : STR_EMPTY) +
2327
2341
  (properties ? " props:" + _sanitizeDiagnosticText(strProps) : STR_EMPTY);
@@ -2396,6 +2410,9 @@
2396
2410
  _unloadHandler && _unloadHandler.rm();
2397
2411
  _unloadHandler = null;
2398
2412
  };
2413
+ objDefine(_self, "dbgMode", {
2414
+ g: function () { return _enableDebug; }
2415
+ });
2399
2416
  function _logInternalMessage(severity, message) {
2400
2417
  if (_areInternalMessagesThrottled()) {
2401
2418
  return;
@@ -2461,6 +2478,9 @@
2461
2478
  _getLogger(logger)[_DYN_WARN_TO_CONSOLE ](message);
2462
2479
  }
2463
2480
 
2481
+ function _noopVoid() {
2482
+ }
2483
+
2464
2484
  var strExecutionContextKey = "ctx";
2465
2485
  var strParentContextKey = "ParentContextKey";
2466
2486
  var strChildrenContextKey = "ChildrenContextKey";
@@ -2516,13 +2536,13 @@
2516
2536
  for (var lp = 0; lp < childEvts[_DYN_LENGTH ]; lp++) {
2517
2537
  var childEvt = childEvts[lp];
2518
2538
  if (childEvt) {
2519
- childTime += childEvt.time;
2539
+ childTime += childEvt[_DYN_TIME ];
2520
2540
  }
2521
2541
  }
2522
2542
  }
2523
- _self.time = utcNow() - _self.start;
2524
- _self.exTime = _self.time - childTime;
2525
- _self.complete = function () { };
2543
+ _self[_DYN_TIME ] = utcNow() - _self.start;
2544
+ _self.exTime = _self[_DYN_TIME ] - childTime;
2545
+ _self.complete = _noopVoid;
2526
2546
  };
2527
2547
  }
2528
2548
  PerfEvent.ParentContextKey = "parent";
@@ -2589,7 +2609,7 @@
2589
2609
  }
2590
2610
  proxy = proxy[_DYN_GET_NEXT ]();
2591
2611
  }
2592
- return createTelemetryProxyChain([startAt], core.config || {}, core);
2612
+ return createTelemetryProxyChain([startAt], core[_DYN_CONFIG ] || {}, core);
2593
2613
  }
2594
2614
  function _createInternalContext(telemetryChain, dynamicHandler, core, startAt) {
2595
2615
  var _nextProxy = null;
@@ -2648,7 +2668,7 @@
2648
2668
  if (onComplete && onComplete[_DYN_LENGTH ] > 0) {
2649
2669
  arrForEach(onComplete, function (completeDetails) {
2650
2670
  try {
2651
- completeDetails.func.call(completeDetails.self, completeDetails.args);
2671
+ completeDetails.func[_DYN_CALL ](completeDetails.self, completeDetails.args);
2652
2672
  }
2653
2673
  catch (e) {
2654
2674
  _throwInternal(core[_DYN_LOGGER ], 2 , 73 , "Unexpected Exception during onComplete - " + dumpObj(e));
@@ -2661,27 +2681,26 @@
2661
2681
  }
2662
2682
  function _getExtCfg(identifier, createIfMissing) {
2663
2683
  var idCfg = null;
2664
- var cfg = dynamicHandler.cfg;
2684
+ var extCfg = _getCfg(dynamicHandler.cfg, "extensionConfig", createIfMissing);
2685
+ if (extCfg) {
2686
+ idCfg = _getCfg(extCfg, identifier, createIfMissing);
2687
+ }
2688
+ return idCfg;
2689
+ }
2690
+ function _getCfg(cfg, identifier, createIfMissing) {
2691
+ var idCfg = null;
2665
2692
  if (cfg && identifier) {
2666
- var extCfg = cfg[STR_EXTENSION_CONFIG ];
2667
- if (!extCfg && createIfMissing) {
2668
- extCfg = {};
2669
- }
2670
- cfg[STR_EXTENSION_CONFIG] = extCfg;
2671
- extCfg = dynamicHandler.ref(cfg, STR_EXTENSION_CONFIG);
2672
- if (extCfg) {
2673
- idCfg = extCfg[identifier];
2674
- if (!idCfg && createIfMissing) {
2675
- idCfg = {};
2676
- }
2677
- extCfg[identifier] = idCfg;
2678
- idCfg = dynamicHandler.ref(extCfg, identifier);
2693
+ idCfg = cfg[identifier];
2694
+ if (!idCfg && createIfMissing) {
2695
+ idCfg = {};
2679
2696
  }
2697
+ cfg[identifier] = idCfg;
2698
+ idCfg = dynamicHandler.ref(cfg, identifier);
2680
2699
  }
2681
2700
  return idCfg;
2682
2701
  }
2683
- function _resolveExtCfg(identifier, defaultValues) {
2684
- var newConfig = _getExtCfg(identifier, true);
2702
+ function _resolveExtCfg(identifier, defaultValues, rootOnly) {
2703
+ var newConfig = rootOnly ? _getCfg(dynamicHandler.cfg, identifier, true) : _getExtCfg(identifier, true);
2685
2704
  if (defaultValues) {
2686
2705
  objForEachKey(defaultValues, function (field, defaultValue) {
2687
2706
  if (isNullOrUndefined(newConfig[field])) {
@@ -2742,7 +2761,7 @@
2742
2761
  return context;
2743
2762
  }
2744
2763
  function createProcessTelemetryUnloadContext(telemetryChain, core, startAt) {
2745
- var config = createDynamicConfig(core.config);
2764
+ var config = createDynamicConfig(core[_DYN_CONFIG ]);
2746
2765
  var internalContext = _createInternalContext(telemetryChain, config, core, startAt);
2747
2766
  var context = internalContext.ctx;
2748
2767
  function _processNext(unloadState) {
@@ -2762,7 +2781,7 @@
2762
2781
  return context;
2763
2782
  }
2764
2783
  function createProcessTelemetryUpdateContext(telemetryChain, core, startAt) {
2765
- var config = createDynamicConfig(core.config);
2784
+ var config = createDynamicConfig(core[_DYN_CONFIG ]);
2766
2785
  var internalContext = _createInternalContext(telemetryChain, config, core, startAt);
2767
2786
  var context = internalContext.ctx;
2768
2787
  function _processNext(updateState) {
@@ -2810,6 +2829,7 @@
2810
2829
  return firstProxy;
2811
2830
  }
2812
2831
  function createTelemetryPluginProxy(plugin, config, core) {
2832
+ var _a;
2813
2833
  var nextProxy = null;
2814
2834
  var hasProcessTelemetry = isFunction(plugin[STR_PROCESS_TELEMETRY ]);
2815
2835
  var hasSetNext = isFunction(plugin[_DYN_SET_NEXT_PLUGIN ]);
@@ -2820,21 +2840,22 @@
2820
2840
  else {
2821
2841
  chainId = "Unknown-0-" + _chainId++;
2822
2842
  }
2823
- var proxyChain = {
2824
- getPlugin: function () {
2825
- return plugin;
2826
- },
2827
- getNext: function () {
2828
- return nextProxy;
2843
+ var proxyChain = (_a = {
2844
+ getPlugin: function () {
2845
+ return plugin;
2846
+ },
2847
+ getNext: function () {
2848
+ return nextProxy;
2849
+ }
2829
2850
  },
2830
- processTelemetry: _processTelemetry,
2831
- unload: _unloadPlugin,
2832
- update: _updatePlugin,
2833
- _id: chainId,
2834
- _setNext: function (nextPlugin) {
2851
+ _a[STR_PROCESS_TELEMETRY ] = _processTelemetry,
2852
+ _a.unload = _unloadPlugin,
2853
+ _a.update = _updatePlugin,
2854
+ _a._id = chainId,
2855
+ _a._setNext = function (nextPlugin) {
2835
2856
  nextProxy = nextPlugin;
2836
- }
2837
- };
2857
+ },
2858
+ _a);
2838
2859
  function _getTelCtx() {
2839
2860
  var itemCtx;
2840
2861
  if (plugin && isFunction(plugin[strGetTelCtx])) {
@@ -2913,7 +2934,7 @@
2913
2934
  }
2914
2935
  return hasRun;
2915
2936
  }
2916
- if (!_processChain(unloadCtx, _callTeardown, "unload", function () { }, unloadState.isAsync)) {
2937
+ if (!_processChain(unloadCtx, _callTeardown, "unload", _noopVoid, unloadState.isAsync)) {
2917
2938
  unloadCtx[_DYN_PROCESS_NEXT ](unloadState);
2918
2939
  }
2919
2940
  }
@@ -2931,7 +2952,7 @@
2931
2952
  }
2932
2953
  return hasRun;
2933
2954
  }
2934
- if (!_processChain(updateCtx, _callUpdate, "update", function () { }, false)) {
2955
+ if (!_processChain(updateCtx, _callUpdate, "update", _noopVoid, false)) {
2935
2956
  updateCtx[_DYN_PROCESS_NEXT ](updateState);
2936
2957
  }
2937
2958
  }
@@ -2969,7 +2990,7 @@
2969
2990
  _hooks = [];
2970
2991
  arrForEach(oldHooks, function (fn) {
2971
2992
  try {
2972
- (fn.rm || fn.remove).call(fn);
2993
+ (fn.rm || fn.remove)[_DYN_CALL ](fn);
2973
2994
  }
2974
2995
  catch (e) {
2975
2996
  _throwInternal(logger, 2 , 73 , "Unloading:" + dumpObj(e));