@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
  (function (global, factory) {
@@ -340,6 +340,7 @@
340
340
  var strIsInitialized = "isInitialized";
341
341
  var strTeardown = "teardown";
342
342
  var strCore = "core";
343
+ var strUpdate = "update";
343
344
  var strDisabled = "disabled";
344
345
  var strDoTeardown = "_doTeardown";
345
346
 
@@ -541,7 +542,7 @@
541
542
  });
542
543
  return objFreeze(enumClass);
543
544
  }
544
- function objExtend(obj, obj2, obj3, obj4, obj5, obj6) {
545
+ function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) {
545
546
  var theArgs = arguments;
546
547
  var extended = theArgs[0] || {};
547
548
  var argLen = theArgs.length;
@@ -861,6 +862,10 @@
861
862
  }
862
863
  return DiagnosticLogger;
863
864
  }());
865
+ function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) {
866
+ if (isUserAct === void 0) { isUserAct = false; }
867
+ (logger || new DiagnosticLogger()).throwInternal(severity, msgId, msg, properties, isUserAct);
868
+ }
864
869
 
865
870
  var strExecutionContextKey = "ctx";
866
871
  var PerfEvent = /** @class */ (function () {
@@ -1187,7 +1192,7 @@
1187
1192
  completeDetails.func.call(completeDetails.self, completeDetails.args);
1188
1193
  }
1189
1194
  catch (e) {
1190
- core.logger.throwInternal(2 , 73 , "Unexpected Exception during onComplete - " + dumpObj(e));
1195
+ _throwInternal(core.logger, 2 , 73 , "Unexpected Exception during onComplete - " + dumpObj(e));
1191
1196
  }
1192
1197
  });
1193
1198
  _onComplete = [];
@@ -1286,6 +1291,27 @@
1286
1291
  context.createNew = _createNew;
1287
1292
  return context;
1288
1293
  }
1294
+ function createProcessTelemetryUpdateContext(telemetryChain, config, core, startAt) {
1295
+ var internalContext = _createInternalContext(telemetryChain, config, core, startAt);
1296
+ var context = internalContext.ctx;
1297
+ function _processNext(updateState) {
1298
+ return context.iterate(function (plugin) {
1299
+ if (isFunction(plugin[strUpdate])) {
1300
+ plugin[strUpdate](context, updateState);
1301
+ }
1302
+ });
1303
+ }
1304
+ function _createNew(plugins, startAt) {
1305
+ if (plugins === void 0) { plugins = null; }
1306
+ if (isArray(plugins)) {
1307
+ plugins = createTelemetryProxyChain(plugins, config, core, startAt);
1308
+ }
1309
+ return createProcessTelemetryUpdateContext(plugins || context.getNext(), config, core, startAt);
1310
+ }
1311
+ context.processNext = _processNext;
1312
+ context.createNew = _createNew;
1313
+ return context;
1314
+ }
1289
1315
  function createTelemetryProxyChain(plugins, config, core, startAt) {
1290
1316
  var firstProxy = null;
1291
1317
  var add = startAt ? false : true;
@@ -1332,6 +1358,7 @@
1332
1358
  },
1333
1359
  processTelemetry: _processTelemetry,
1334
1360
  unload: _unloadPlugin,
1361
+ update: _updatePlugin,
1335
1362
  _id: chainId,
1336
1363
  _setNext: function (nextPlugin) {
1337
1364
  nextProxy = nextPlugin;
@@ -1371,7 +1398,7 @@
1371
1398
  hasRun = true;
1372
1399
  }
1373
1400
  if (!nextProxy || !hasNextRun) {
1374
- itemCtx.diagLog().throwInternal(1 , 73 , "Plugin [" + plugin.identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext));
1401
+ _throwInternal(itemCtx.diagLog(), 1 , 73 , "Plugin [" + plugin.identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext));
1375
1402
  }
1376
1403
  }
1377
1404
  }, details, isAsync);
@@ -1419,6 +1446,24 @@
1419
1446
  unloadCtx.processNext(unloadState);
1420
1447
  }
1421
1448
  }
1449
+ function _updatePlugin(updateCtx, updateState) {
1450
+ function _callUpdate() {
1451
+ var hasRun = false;
1452
+ if (plugin) {
1453
+ var pluginState = _getPluginState(plugin);
1454
+ var pluginCore = plugin[strCore] || pluginState.core;
1455
+ if (plugin && (!pluginCore || pluginCore === updateCtx[strCore]()) && !pluginState[strTeardown]) {
1456
+ if (plugin[strUpdate] && plugin[strUpdate](updateCtx, updateState) === true) {
1457
+ hasRun = true;
1458
+ }
1459
+ }
1460
+ }
1461
+ return hasRun;
1462
+ }
1463
+ if (!_processChain(updateCtx, _callUpdate, "update", function () { }, false)) {
1464
+ updateCtx.processNext(updateState);
1465
+ }
1466
+ }
1422
1467
  return objFreeze(proxyChain);
1423
1468
  }
1424
1469
 
@@ -1437,7 +1482,7 @@
1437
1482
  handler(unloadCtx, unloadState);
1438
1483
  }
1439
1484
  catch (e) {
1440
- unloadCtx.diagLog().throwInternal(2 , 73 , "Unexpected error calling unload handler - " + dumpObj(e));
1485
+ _throwInternal(unloadCtx.diagLog(), 2 , 73 , "Unexpected error calling unload handler - " + dumpObj(e));
1441
1486
  }
1442
1487
  });
1443
1488
  handlers = [];
@@ -1496,6 +1541,30 @@
1496
1541
  }
1497
1542
  return result;
1498
1543
  };
1544
+ _self.update = function (updateCtx, updateState) {
1545
+ if (!_self.core || (updateCtx && _self.core !== updateCtx.core())) {
1546
+ return;
1547
+ }
1548
+ var result;
1549
+ var updateDone = false;
1550
+ var theUpdateCtx = updateCtx || createProcessTelemetryUpdateContext(null, {}, _self.core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin);
1551
+ var theUpdateState = updateState || {
1552
+ reason: 0
1553
+ };
1554
+ function _updateCallback() {
1555
+ if (!updateDone) {
1556
+ updateDone = true;
1557
+ _setDefaults(theUpdateCtx.getCfg(), theUpdateCtx.core(), theUpdateCtx.getNext());
1558
+ }
1559
+ }
1560
+ if (!_self._doUpdate || _self._doUpdate(theUpdateCtx, theUpdateState, _updateCallback) !== true) {
1561
+ _updateCallback();
1562
+ }
1563
+ else {
1564
+ result = true;
1565
+ }
1566
+ return result;
1567
+ };
1499
1568
  _self._addHook = function (hooks) {
1500
1569
  if (hooks) {
1501
1570
  if (isArray(hooks)) {
@@ -1584,12 +1653,12 @@
1584
1653
  }
1585
1654
  return name;
1586
1655
  }
1587
- function _getEvtNamespace(eventName, namespaces) {
1588
- if (namespaces) {
1656
+ function _getEvtNamespace(eventName, evtNamespace) {
1657
+ if (evtNamespace) {
1589
1658
  var theNamespace_1 = "";
1590
- if (isArray(namespaces)) {
1659
+ if (isArray(evtNamespace)) {
1591
1660
  theNamespace_1 = "";
1592
- arrForEach(namespaces, function (name) {
1661
+ arrForEach(evtNamespace, function (name) {
1593
1662
  name = _normalizeNamespace(name);
1594
1663
  if (name) {
1595
1664
  if (name[0] !== ".") {
@@ -1600,7 +1669,7 @@
1600
1669
  });
1601
1670
  }
1602
1671
  else {
1603
- theNamespace_1 = _normalizeNamespace(namespaces);
1672
+ theNamespace_1 = _normalizeNamespace(evtNamespace);
1604
1673
  }
1605
1674
  if (theNamespace_1) {
1606
1675
  if (theNamespace_1[0] !== ".") {
@@ -2609,7 +2678,7 @@
2609
2678
  this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _ExtendedInternalMessageId.TrackPageActionEventFailed, "trackPageAction failed, page action event will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
2610
2679
  }
2611
2680
  };
2612
- ClickAnalyticsPlugin.Version = "2.8.0-beta.2203-04";
2681
+ ClickAnalyticsPlugin.Version = "2.8.0-beta.2203-07";
2613
2682
  return ClickAnalyticsPlugin;
2614
2683
  }(BaseTelemetryPlugin));
2615
2684