coveo.analytics 2.23.7 → 2.23.9

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.
@@ -258,6 +258,32 @@ export class CoveoInsightClient {
258
258
  );
259
259
  }
260
260
 
261
+ public logCaseAttach(
262
+ info: PartialDocumentInformation,
263
+ identifier: DocumentIdentifier,
264
+ caseMetadata?: CaseMetadata
265
+ ) {
266
+ const metadata = {
267
+ documentTitle: info.documentTitle,
268
+ documentURL: info.documentUrl,
269
+ resultUriHash: info.documentUriHash,
270
+ };
271
+
272
+ return this.logClickEvent(
273
+ SearchPageEvents.caseAttach,
274
+ info,
275
+ identifier,
276
+ caseMetadata ? {...generateMetadataToSend(caseMetadata, false), ...metadata} : metadata
277
+ );
278
+ }
279
+
280
+ public logCaseDetach(resultUriHash: string, metadata?: CaseMetadata) {
281
+ return this.logCustomEvent(
282
+ SearchPageEvents.caseDetach,
283
+ metadata ? {...generateMetadataToSend(metadata, false), resultUriHash} : {resultUriHash}
284
+ );
285
+ }
286
+
261
287
  public async logCustomEvent(event: SearchPageEvents | InsightEvents, metadata?: Record<string, any>) {
262
288
  const customData = {...this.provider.getBaseMetadata(), ...metadata};
263
289
 
@@ -278,6 +278,14 @@ export enum SearchPageEvents {
278
278
  * Identifies the click event that gets logged when a user clicks the Copy To Clipboard result action.
279
279
  */
280
280
  copyToClipboard = 'copyToClipboard',
281
+ /**
282
+ * Identifies the click event that gets logged when a user clicks the Attach To Case result action.
283
+ */
284
+ caseAttach = 'caseAttach',
285
+ /**
286
+ * Identifies the custom event that gets logged when a user clicks the Detach From Case result action.
287
+ */
288
+ caseDetach = 'caseDetach',
281
289
  }
282
290
 
283
291
  export const CustomEventsTypes: Partial<Record<SearchPageEvents | InsightEvents, string>> = {
@@ -314,6 +322,7 @@ export const CustomEventsTypes: Partial<Record<SearchPageEvents | InsightEvents,
314
322
  [SearchPageEvents.clearRecentResults]: 'recentlyClickedDocuments',
315
323
  [SearchPageEvents.showLessFoldedResults]: 'folding',
316
324
  [InsightEvents.expandToFullUI]: 'interface',
325
+ [SearchPageEvents.caseDetach]: 'case',
317
326
  };
318
327
 
319
328
  export interface StaticFilterMetadata {