coveo.analytics 2.28.21 → 2.28.23

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.
@@ -728,7 +728,7 @@
728
728
  const v5 = v35('v5', 0x50, sha1);
729
729
  var uuidv5 = v5;
730
730
 
731
- var libVersion = "2.28.21" ;
731
+ var libVersion = "2.28.23" ;
732
732
 
733
733
  var getFormattedLocation = function (location) {
734
734
  return "".concat(location.protocol, "//").concat(location.hostname).concat(location.pathname.indexOf('/') === 0 ? location.pathname : "/".concat(location.pathname)).concat(location.search);
@@ -1551,6 +1551,10 @@
1551
1551
  this.clear();
1552
1552
  this.runtime.storage = new NullStorage();
1553
1553
  }
1554
+ this.addEventTypeMapping(EventType.view, { newEventType: EventType.view, addClientIdParameter: true });
1555
+ this.addEventTypeMapping(EventType.click, { newEventType: EventType.click, addClientIdParameter: true });
1556
+ this.addEventTypeMapping(EventType.custom, { newEventType: EventType.custom, addClientIdParameter: true });
1557
+ this.addEventTypeMapping(EventType.search, { newEventType: EventType.search, addClientIdParameter: true });
1554
1558
  }
1555
1559
  Object.defineProperty(CoveoAnalyticsClient.prototype, "defaultOptions", {
1556
1560
  get: function () {
@@ -2536,7 +2540,6 @@
2536
2540
  return _this.plugins.require(pluginKey, pluginOptions_1);
2537
2541
  });
2538
2542
  this.client.registerBeforeSendEventHook(function (eventType, payload) { return (__assign(__assign({}, payload), _this.params)); });
2539
- this.client.addEventTypeMapping(EventType.view, { newEventType: EventType.view, addClientIdParameter: true });
2540
2543
  }
2541
2544
  else {
2542
2545
  throw new Error("You must pass either your token or a valid object when you call 'init'");
@@ -2693,6 +2696,7 @@
2693
2696
  InsightEvents["showFollowingSessions"] = "showFollowingSessions";
2694
2697
  InsightEvents["clickViewedDocument"] = "clickViewedDocument";
2695
2698
  InsightEvents["clickPageView"] = "clickPageView";
2699
+ InsightEvents["createArticle"] = "createArticle";
2696
2700
  })(InsightEvents || (InsightEvents = {}));
2697
2701
 
2698
2702
  var _a;
@@ -2815,12 +2819,6 @@
2815
2819
  _a[SearchPageEvents.recentResultClick] = 'recentlyClickedDocuments',
2816
2820
  _a[SearchPageEvents.clearRecentResults] = 'recentlyClickedDocuments',
2817
2821
  _a[SearchPageEvents.showLessFoldedResults] = 'folding',
2818
- _a[InsightEvents.expandToFullUI] = 'interface',
2819
- _a[InsightEvents.openUserActions] = 'User Actions',
2820
- _a[InsightEvents.showPrecedingSessions] = 'User Actions',
2821
- _a[InsightEvents.showFollowingSessions] = 'User Actions',
2822
- _a[InsightEvents.clickViewedDocument] = 'User Actions',
2823
- _a[InsightEvents.clickPageView] = 'User Actions',
2824
2822
  _a[SearchPageEvents.caseDetach] = 'case',
2825
2823
  _a[SearchPageEvents.likeGeneratedAnswer] = 'generatedAnswer',
2826
2824
  _a[SearchPageEvents.dislikeGeneratedAnswer] = 'generatedAnswer',
@@ -2831,6 +2829,13 @@
2831
2829
  _a[SearchPageEvents.generatedAnswerHideAnswers] = 'generatedAnswer',
2832
2830
  _a[SearchPageEvents.generatedAnswerShowAnswers] = 'generatedAnswer',
2833
2831
  _a[SearchPageEvents.generatedAnswerFeedbackSubmit] = 'generatedAnswer',
2832
+ _a[InsightEvents.expandToFullUI] = 'interface',
2833
+ _a[InsightEvents.openUserActions] = 'User Actions',
2834
+ _a[InsightEvents.showPrecedingSessions] = 'User Actions',
2835
+ _a[InsightEvents.showFollowingSessions] = 'User Actions',
2836
+ _a[InsightEvents.clickViewedDocument] = 'User Actions',
2837
+ _a[InsightEvents.clickPageView] = 'User Actions',
2838
+ _a[InsightEvents.createArticle] = 'createArticle',
2834
2839
  _a);
2835
2840
 
2836
2841
  var NoopAnalytics = (function () {
@@ -4552,6 +4557,9 @@
4552
4557
  CoveoInsightClient.prototype.logPageViewClick = function (pageView, metadata) {
4553
4558
  return this.logCustomEvent(InsightEvents.clickPageView, __assign(__assign({}, generateMetadataToSend(metadata, false)), { pageView: pageView }));
4554
4559
  };
4560
+ CoveoInsightClient.prototype.logCreateArticle = function (createArticleMetadata, metadata) {
4561
+ return this.logCustomEvent(InsightEvents.createArticle, metadata ? __assign(__assign({}, generateMetadataToSend(metadata, false)), createArticleMetadata) : createArticleMetadata);
4562
+ };
4555
4563
  CoveoInsightClient.prototype.logDocumentOpen = function (info, identifier, metadata) {
4556
4564
  return this.logClickEvent(SearchPageEvents.documentOpen, info, identifier, metadata ? generateMetadataToSend(metadata, false) : undefined);
4557
4565
  };