@microsoft/applicationinsights-clickanalytics-js 2.8.0-beta.2203-04 → 2.8.0-beta.2203-07

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 (55) hide show
  1. package/browser/{ai.clck.2.8.0-beta.2203-04.cjs.js → ai.clck.2.8.0-beta.2203-07.cjs.js} +81 -12
  2. package/browser/ai.clck.2.8.0-beta.2203-07.cjs.js.map +1 -0
  3. package/browser/ai.clck.2.8.0-beta.2203-07.cjs.min.js +6 -0
  4. package/browser/ai.clck.2.8.0-beta.2203-07.cjs.min.js.map +1 -0
  5. package/browser/{ai.clck.2.8.0-beta.2203-04.gbl.js → ai.clck.2.8.0-beta.2203-07.gbl.js} +81 -12
  6. package/browser/ai.clck.2.8.0-beta.2203-07.gbl.js.map +1 -0
  7. package/browser/ai.clck.2.8.0-beta.2203-07.gbl.min.js +6 -0
  8. package/browser/ai.clck.2.8.0-beta.2203-07.gbl.min.js.map +1 -0
  9. package/browser/ai.clck.2.8.0-beta.2203-07.integrity.json +66 -0
  10. package/browser/{ai.clck.2.8.0-beta.2203-04.js → ai.clck.2.8.0-beta.2203-07.js} +81 -12
  11. package/browser/ai.clck.2.8.0-beta.2203-07.js.map +1 -0
  12. package/browser/ai.clck.2.8.0-beta.2203-07.min.js +6 -0
  13. package/browser/ai.clck.2.8.0-beta.2203-07.min.js.map +1 -0
  14. package/browser/ai.clck.2.cjs.js +80 -11
  15. package/browser/ai.clck.2.cjs.js.map +1 -1
  16. package/browser/ai.clck.2.cjs.min.js +2 -2
  17. package/browser/ai.clck.2.cjs.min.js.map +1 -1
  18. package/browser/ai.clck.2.gbl.js +80 -11
  19. package/browser/ai.clck.2.gbl.js.map +1 -1
  20. package/browser/ai.clck.2.gbl.min.js +2 -2
  21. package/browser/ai.clck.2.gbl.min.js.map +1 -1
  22. package/browser/ai.clck.2.js +80 -11
  23. package/browser/ai.clck.2.js.map +1 -1
  24. package/browser/ai.clck.2.min.js +2 -2
  25. package/browser/ai.clck.2.min.js.map +1 -1
  26. package/dist/applicationinsights-clickanalytics-js.d.ts +1 -1
  27. package/dist/applicationinsights-clickanalytics-js.js +80 -11
  28. package/dist/applicationinsights-clickanalytics-js.js.map +1 -1
  29. package/dist/applicationinsights-clickanalytics-js.min.js +2 -2
  30. package/dist/applicationinsights-clickanalytics-js.min.js.map +1 -1
  31. package/dist/applicationinsights-clickanalytics-js.rollup.d.ts +1 -1
  32. package/dist-esm/Behaviours.js +1 -1
  33. package/dist-esm/ClickAnalyticsPlugin.js +2 -2
  34. package/dist-esm/ClickAnalyticsPlugin.js.map +1 -1
  35. package/dist-esm/DataCollector.js +1 -1
  36. package/dist-esm/Enums.js +1 -1
  37. package/dist-esm/Interfaces/Datamodel.js +1 -1
  38. package/dist-esm/applicationinsights-clickanalytics-js.js +1 -1
  39. package/dist-esm/common/Utils.js +1 -1
  40. package/dist-esm/events/PageAction.js +1 -1
  41. package/dist-esm/events/WebEvent.js +1 -1
  42. package/dist-esm/handlers/AutoCaptureHandler.js +1 -1
  43. package/dist-esm/handlers/DomContentHandler.js +1 -1
  44. package/package.json +4 -4
  45. package/src/ClickAnalyticsPlugin.ts +1 -1
  46. package/browser/ai.clck.2.8.0-beta.2203-04.cjs.js.map +0 -1
  47. package/browser/ai.clck.2.8.0-beta.2203-04.cjs.min.js +0 -6
  48. package/browser/ai.clck.2.8.0-beta.2203-04.cjs.min.js.map +0 -1
  49. package/browser/ai.clck.2.8.0-beta.2203-04.gbl.js.map +0 -1
  50. package/browser/ai.clck.2.8.0-beta.2203-04.gbl.min.js +0 -6
  51. package/browser/ai.clck.2.8.0-beta.2203-04.gbl.min.js.map +0 -1
  52. package/browser/ai.clck.2.8.0-beta.2203-04.integrity.json +0 -66
  53. package/browser/ai.clck.2.8.0-beta.2203-04.js.map +0 -1
  54. package/browser/ai.clck.2.8.0-beta.2203-04.min.js +0 -6
  55. package/browser/ai.clck.2.8.0-beta.2203-04.min.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - Click Analytics, 2.8.0-beta.2203-04
2
+ * Application Insights JavaScript SDK - Click Analytics, 2.8.0-beta.2203-07
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  this.Microsoft = this.Microsoft || {};
@@ -338,6 +338,7 @@ this.Microsoft = this.Microsoft || {};
338
338
  var strIsInitialized = "isInitialized";
339
339
  var strTeardown = "teardown";
340
340
  var strCore = "core";
341
+ var strUpdate = "update";
341
342
  var strDisabled = "disabled";
342
343
  var strDoTeardown = "_doTeardown";
343
344
 
@@ -539,7 +540,7 @@ this.Microsoft = this.Microsoft || {};
539
540
  });
540
541
  return objFreeze(enumClass);
541
542
  }
542
- function objExtend(obj, obj2, obj3, obj4, obj5, obj6) {
543
+ function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) {
543
544
  var theArgs = arguments;
544
545
  var extended = theArgs[0] || {};
545
546
  var argLen = theArgs.length;
@@ -859,6 +860,10 @@ this.Microsoft = this.Microsoft || {};
859
860
  }
860
861
  return DiagnosticLogger;
861
862
  }());
863
+ function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) {
864
+ if (isUserAct === void 0) { isUserAct = false; }
865
+ (logger || new DiagnosticLogger()).throwInternal(severity, msgId, msg, properties, isUserAct);
866
+ }
862
867
 
863
868
  var strExecutionContextKey = "ctx";
864
869
  var PerfEvent = /** @class */ (function () {
@@ -1185,7 +1190,7 @@ this.Microsoft = this.Microsoft || {};
1185
1190
  completeDetails.func.call(completeDetails.self, completeDetails.args);
1186
1191
  }
1187
1192
  catch (e) {
1188
- core.logger.throwInternal(2 , 73 , "Unexpected Exception during onComplete - " + dumpObj(e));
1193
+ _throwInternal(core.logger, 2 , 73 , "Unexpected Exception during onComplete - " + dumpObj(e));
1189
1194
  }
1190
1195
  });
1191
1196
  _onComplete = [];
@@ -1284,6 +1289,27 @@ this.Microsoft = this.Microsoft || {};
1284
1289
  context.createNew = _createNew;
1285
1290
  return context;
1286
1291
  }
1292
+ function createProcessTelemetryUpdateContext(telemetryChain, config, core, startAt) {
1293
+ var internalContext = _createInternalContext(telemetryChain, config, core, startAt);
1294
+ var context = internalContext.ctx;
1295
+ function _processNext(updateState) {
1296
+ return context.iterate(function (plugin) {
1297
+ if (isFunction(plugin[strUpdate])) {
1298
+ plugin[strUpdate](context, updateState);
1299
+ }
1300
+ });
1301
+ }
1302
+ function _createNew(plugins, startAt) {
1303
+ if (plugins === void 0) { plugins = null; }
1304
+ if (isArray(plugins)) {
1305
+ plugins = createTelemetryProxyChain(plugins, config, core, startAt);
1306
+ }
1307
+ return createProcessTelemetryUpdateContext(plugins || context.getNext(), config, core, startAt);
1308
+ }
1309
+ context.processNext = _processNext;
1310
+ context.createNew = _createNew;
1311
+ return context;
1312
+ }
1287
1313
  function createTelemetryProxyChain(plugins, config, core, startAt) {
1288
1314
  var firstProxy = null;
1289
1315
  var add = startAt ? false : true;
@@ -1330,6 +1356,7 @@ this.Microsoft = this.Microsoft || {};
1330
1356
  },
1331
1357
  processTelemetry: _processTelemetry,
1332
1358
  unload: _unloadPlugin,
1359
+ update: _updatePlugin,
1333
1360
  _id: chainId,
1334
1361
  _setNext: function (nextPlugin) {
1335
1362
  nextProxy = nextPlugin;
@@ -1369,7 +1396,7 @@ this.Microsoft = this.Microsoft || {};
1369
1396
  hasRun = true;
1370
1397
  }
1371
1398
  if (!nextProxy || !hasNextRun) {
1372
- itemCtx.diagLog().throwInternal(1 , 73 , "Plugin [" + plugin.identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext));
1399
+ _throwInternal(itemCtx.diagLog(), 1 , 73 , "Plugin [" + plugin.identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext));
1373
1400
  }
1374
1401
  }
1375
1402
  }, details, isAsync);
@@ -1417,6 +1444,24 @@ this.Microsoft = this.Microsoft || {};
1417
1444
  unloadCtx.processNext(unloadState);
1418
1445
  }
1419
1446
  }
1447
+ function _updatePlugin(updateCtx, updateState) {
1448
+ function _callUpdate() {
1449
+ var hasRun = false;
1450
+ if (plugin) {
1451
+ var pluginState = _getPluginState(plugin);
1452
+ var pluginCore = plugin[strCore] || pluginState.core;
1453
+ if (plugin && (!pluginCore || pluginCore === updateCtx[strCore]()) && !pluginState[strTeardown]) {
1454
+ if (plugin[strUpdate] && plugin[strUpdate](updateCtx, updateState) === true) {
1455
+ hasRun = true;
1456
+ }
1457
+ }
1458
+ }
1459
+ return hasRun;
1460
+ }
1461
+ if (!_processChain(updateCtx, _callUpdate, "update", function () { }, false)) {
1462
+ updateCtx.processNext(updateState);
1463
+ }
1464
+ }
1420
1465
  return objFreeze(proxyChain);
1421
1466
  }
1422
1467
 
@@ -1435,7 +1480,7 @@ this.Microsoft = this.Microsoft || {};
1435
1480
  handler(unloadCtx, unloadState);
1436
1481
  }
1437
1482
  catch (e) {
1438
- unloadCtx.diagLog().throwInternal(2 , 73 , "Unexpected error calling unload handler - " + dumpObj(e));
1483
+ _throwInternal(unloadCtx.diagLog(), 2 , 73 , "Unexpected error calling unload handler - " + dumpObj(e));
1439
1484
  }
1440
1485
  });
1441
1486
  handlers = [];
@@ -1494,6 +1539,30 @@ this.Microsoft = this.Microsoft || {};
1494
1539
  }
1495
1540
  return result;
1496
1541
  };
1542
+ _self.update = function (updateCtx, updateState) {
1543
+ if (!_self.core || (updateCtx && _self.core !== updateCtx.core())) {
1544
+ return;
1545
+ }
1546
+ var result;
1547
+ var updateDone = false;
1548
+ var theUpdateCtx = updateCtx || createProcessTelemetryUpdateContext(null, {}, _self.core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin);
1549
+ var theUpdateState = updateState || {
1550
+ reason: 0
1551
+ };
1552
+ function _updateCallback() {
1553
+ if (!updateDone) {
1554
+ updateDone = true;
1555
+ _setDefaults(theUpdateCtx.getCfg(), theUpdateCtx.core(), theUpdateCtx.getNext());
1556
+ }
1557
+ }
1558
+ if (!_self._doUpdate || _self._doUpdate(theUpdateCtx, theUpdateState, _updateCallback) !== true) {
1559
+ _updateCallback();
1560
+ }
1561
+ else {
1562
+ result = true;
1563
+ }
1564
+ return result;
1565
+ };
1497
1566
  _self._addHook = function (hooks) {
1498
1567
  if (hooks) {
1499
1568
  if (isArray(hooks)) {
@@ -1582,12 +1651,12 @@ this.Microsoft = this.Microsoft || {};
1582
1651
  }
1583
1652
  return name;
1584
1653
  }
1585
- function _getEvtNamespace(eventName, namespaces) {
1586
- if (namespaces) {
1654
+ function _getEvtNamespace(eventName, evtNamespace) {
1655
+ if (evtNamespace) {
1587
1656
  var theNamespace_1 = "";
1588
- if (isArray(namespaces)) {
1657
+ if (isArray(evtNamespace)) {
1589
1658
  theNamespace_1 = "";
1590
- arrForEach(namespaces, function (name) {
1659
+ arrForEach(evtNamespace, function (name) {
1591
1660
  name = _normalizeNamespace(name);
1592
1661
  if (name) {
1593
1662
  if (name[0] !== ".") {
@@ -1598,7 +1667,7 @@ this.Microsoft = this.Microsoft || {};
1598
1667
  });
1599
1668
  }
1600
1669
  else {
1601
- theNamespace_1 = _normalizeNamespace(namespaces);
1670
+ theNamespace_1 = _normalizeNamespace(evtNamespace);
1602
1671
  }
1603
1672
  if (theNamespace_1) {
1604
1673
  if (theNamespace_1[0] !== ".") {
@@ -2607,7 +2676,7 @@ this.Microsoft = this.Microsoft || {};
2607
2676
  this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _ExtendedInternalMessageId.TrackPageActionEventFailed, "trackPageAction failed, page action event will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
2608
2677
  }
2609
2678
  };
2610
- ClickAnalyticsPlugin.Version = "2.8.0-beta.2203-04";
2679
+ ClickAnalyticsPlugin.Version = "2.8.0-beta.2203-07";
2611
2680
  return ClickAnalyticsPlugin;
2612
2681
  }(BaseTelemetryPlugin));
2613
2682
 
@@ -2619,4 +2688,4 @@ this.Microsoft = this.Microsoft || {};
2619
2688
  (function(obj, prop, descriptor) { /* ai_es3_polyfil defineProperty */ var func = Object["defineProperty"]; if (func) { try { return func(obj, prop, descriptor); } catch(e) { /* IE8 defines defineProperty, but will throw */ } } if (descriptor && typeof descriptor.value !== undefined) { obj[prop] = descriptor.value; } return obj; })(exports, '__esModule', { value: true });
2620
2689
 
2621
2690
  })(this.Microsoft.ApplicationInsights = this.Microsoft.ApplicationInsights || {});
2622
- //# sourceMappingURL=ai.clck.2.8.0-beta.2203-04.gbl.js.map
2691
+ //# sourceMappingURL=ai.clck.2.8.0-beta.2203-07.gbl.js.map