coveo.analytics 2.20.7 → 2.20.8

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,6 +1,6 @@
1
1
  import { AnalyticsClient, ClientOptions } from '../client/analytics';
2
2
  import { SearchEventRequest } from '../events';
3
- import { FacetBaseMeta, FacetMetadata, FacetSortMeta, FacetStateMetadata, PagerMetadata, InterfaceChangeMetadata, QueryErrorMeta, SearchPageEvents, ResultsSortMetadata } from '../searchPage/searchPageEvents';
3
+ import { FacetBaseMeta, FacetMetadata, FacetSortMeta, FacetStateMetadata, PagerMetadata, InterfaceChangeMetadata, QueryErrorMeta, SearchPageEvents, ResultsSortMetadata, FacetRangeMetadata, CategoryFacetMetadata } from '../searchPage/searchPageEvents';
4
4
  export interface InsightClientProvider {
5
5
  getSearchEventRequestPayload: () => Omit<SearchEventRequest, 'actionCause' | 'searchQueryUid'>;
6
6
  getSearchUID: () => string;
@@ -27,6 +27,8 @@ export declare class CoveoInsightClient {
27
27
  logInterfaceLoad(): Promise<void | import("../events").SearchEventResponse>;
28
28
  logInterfaceChange(metadata: InterfaceChangeMetadata): Promise<void | import("../events").SearchEventResponse>;
29
29
  logFetchMoreResults(): Promise<void | import("../events").CustomEventResponse>;
30
+ logBreadcrumbFacet(metadata: FacetMetadata | FacetRangeMetadata | CategoryFacetMetadata): Promise<void | import("../events").SearchEventResponse>;
31
+ logBreadcrumbResetAll(): Promise<void | import("../events").SearchEventResponse>;
30
32
  logFacetSelect(meta: FacetMetadata): Promise<void | import("../events").SearchEventResponse>;
31
33
  logFacetDeselect(meta: FacetMetadata): Promise<void | import("../events").SearchEventResponse>;
32
34
  logFacetUpdateSort(meta: FacetSortMeta): Promise<void | import("../events").SearchEventResponse>;
@@ -1790,6 +1790,12 @@ class CoveoInsightClient {
1790
1790
  logFetchMoreResults() {
1791
1791
  return this.logCustomEvent(SearchPageEvents.pagerScrolling, { type: 'getMoreResults' });
1792
1792
  }
1793
+ logBreadcrumbFacet(metadata) {
1794
+ return this.logSearchEvent(SearchPageEvents.breadcrumbFacet, metadata);
1795
+ }
1796
+ logBreadcrumbResetAll() {
1797
+ return this.logSearchEvent(SearchPageEvents.breadcrumbResetAll);
1798
+ }
1793
1799
  logFacetSelect(meta) {
1794
1800
  return this.logSearchEvent(SearchPageEvents.facetSelect, meta);
1795
1801
  }
package/dist/library.js CHANGED
@@ -84171,6 +84171,12 @@ var CoveoInsightClient = (function () {
84171
84171
  CoveoInsightClient.prototype.logFetchMoreResults = function () {
84172
84172
  return this.logCustomEvent(SearchPageEvents.pagerScrolling, { type: 'getMoreResults' });
84173
84173
  };
84174
+ CoveoInsightClient.prototype.logBreadcrumbFacet = function (metadata) {
84175
+ return this.logSearchEvent(SearchPageEvents.breadcrumbFacet, metadata);
84176
+ };
84177
+ CoveoInsightClient.prototype.logBreadcrumbResetAll = function () {
84178
+ return this.logSearchEvent(SearchPageEvents.breadcrumbResetAll);
84179
+ };
84174
84180
  CoveoInsightClient.prototype.logFacetSelect = function (meta) {
84175
84181
  return this.logSearchEvent(SearchPageEvents.facetSelect, meta);
84176
84182
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coveo.analytics",
3
- "version": "2.20.7",
3
+ "version": "2.20.8",
4
4
  "description": "📈 Coveo analytics client (node and browser compatible) ",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.es.js",
@@ -119,6 +119,22 @@ describe('InsightClient', () => {
119
119
  expectMatchCustomEventPayload(SearchPageEvents.pagerScrolling, {type: 'getMoreResults'});
120
120
  });
121
121
 
122
+ it('should send proper payload for #breadcrumbResetAll', async () => {
123
+ await client.logBreadcrumbResetAll();
124
+ expectMatchPayload(SearchPageEvents.breadcrumbResetAll);
125
+ });
126
+
127
+ it('should send proper payload for #breadcrumbFacet', async () => {
128
+ const meta = {
129
+ facetField: '@foo',
130
+ facetId: 'bar',
131
+ facetTitle: 'title',
132
+ facetValue: 'qwerty',
133
+ };
134
+ await client.logBreadcrumbFacet(meta);
135
+ expectMatchPayload(SearchPageEvents.breadcrumbFacet, meta);
136
+ });
137
+
122
138
  it('should send proper payload for #logFacetSelect', async () => {
123
139
  const meta = {
124
140
  facetField: '@foo',
@@ -13,6 +13,8 @@ import {
13
13
  QueryErrorMeta,
14
14
  SearchPageEvents,
15
15
  ResultsSortMetadata,
16
+ FacetRangeMetadata,
17
+ CategoryFacetMetadata,
16
18
  } from '../searchPage/searchPageEvents';
17
19
 
18
20
  export interface InsightClientProvider {
@@ -64,6 +66,14 @@ export class CoveoInsightClient {
64
66
  return this.logCustomEvent(SearchPageEvents.pagerScrolling, {type: 'getMoreResults'});
65
67
  }
66
68
 
69
+ public logBreadcrumbFacet(metadata: FacetMetadata | FacetRangeMetadata | CategoryFacetMetadata) {
70
+ return this.logSearchEvent(SearchPageEvents.breadcrumbFacet, metadata);
71
+ }
72
+
73
+ public logBreadcrumbResetAll() {
74
+ return this.logSearchEvent(SearchPageEvents.breadcrumbResetAll);
75
+ }
76
+
67
77
  public logFacetSelect(meta: FacetMetadata) {
68
78
  return this.logSearchEvent(SearchPageEvents.facetSelect, meta);
69
79
  }