coveo.analytics 2.30.56 → 2.32.0
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.
- package/README.md +37 -43
- package/dist/browser.mjs +513 -357
- package/dist/coveoua.browser.js +1 -1
- package/dist/coveoua.browser.js.map +1 -1
- package/dist/coveoua.debug.js +542 -359
- package/dist/coveoua.debug.js.map +1 -1
- package/dist/coveoua.js +1 -1
- package/dist/coveoua.js.map +1 -1
- package/dist/definitions/client/analytics.d.ts +3 -2
- package/dist/definitions/client/runtimeEnvironment.d.ts +1 -1
- package/dist/definitions/donottrack.d.ts +1 -0
- package/dist/definitions/react-native/index.d.ts +1 -2
- package/dist/definitions/version.d.ts +1 -1
- package/dist/library.cjs +15350 -3699
- package/dist/library.es.js +513 -357
- package/dist/library.js +15350 -3699
- package/dist/library.mjs +15350 -3699
- package/dist/react-native.es.js +634 -460
- package/modules/package.json +9 -9
- package/package.json +60 -91
- package/react-native/package.json +7 -7
- package/src/caseAssist/caseAssistActions.ts +51 -50
- package/src/caseAssist/caseAssistClient.spec.ts +328 -297
- package/src/caseAssist/caseAssistClient.ts +201 -185
- package/src/client/analytics.spec.ts +724 -703
- package/src/client/analytics.ts +677 -602
- package/src/client/analyticsBeaconClient.spec.ts +195 -188
- package/src/client/analyticsBeaconClient.ts +99 -88
- package/src/client/analyticsFetchClient.ts +77 -61
- package/src/client/analyticsRequestClient.ts +17 -17
- package/src/client/location.ts +3 -3
- package/src/client/measurementProtocolMapper.ts +54 -45
- package/src/client/measurementProtocolMapping/baseMeasurementProtocolMapper.ts +48 -44
- package/src/client/measurementProtocolMapping/commerceMeasurementProtocolMapper.ts +133 -121
- package/src/client/measurementProtocolMapping/serviceMeasurementProtocolMapper.ts +17 -17
- package/src/client/noopAnalytics.ts +80 -68
- package/src/client/runtimeEnvironment.ts +50 -41
- package/src/client/utils.spec.ts +112 -97
- package/src/client/utils.ts +39 -39
- package/src/cookieutils.spec.ts +59 -0
- package/src/cookieutils.ts +40 -39
- package/src/coveoua/browser.ts +14 -12
- package/src/coveoua/library.ts +4 -4
- package/src/coveoua/plugins.ts +36 -34
- package/src/coveoua/simpleanalytics.spec.ts +467 -452
- package/src/coveoua/simpleanalytics.ts +146 -140
- package/src/detector.ts +17 -17
- package/src/donottrack.spec.ts +199 -121
- package/src/donottrack.ts +31 -8
- package/src/events.ts +86 -79
- package/src/formatting/format-array-for-coveo-custom-data.spec.ts +13 -12
- package/src/formatting/format-array-for-coveo-custom-data.ts +18 -18
- package/src/formatting/format-omnibox-metadata.ts +16 -12
- package/src/history.spec.ts +197 -195
- package/src/history.ts +143 -133
- package/src/hook/addDefaultValues.ts +13 -8
- package/src/hook/enhanceViewEvent.ts +17 -17
- package/src/insight/insightClient.spec.ts +1848 -1717
- package/src/insight/insightClient.ts +866 -761
- package/src/insight/insightEvents.ts +57 -56
- package/src/plugins/BasePlugin.ts +125 -121
- package/src/plugins/ec.spec.ts +457 -429
- package/src/plugins/ec.ts +202 -199
- package/src/plugins/link.spec.ts +183 -159
- package/src/plugins/link.ts +88 -85
- package/src/plugins/svc.spec.ts +161 -155
- package/src/plugins/svc.ts +93 -91
- package/src/react-native/index.ts +8 -1
- package/src/react-native/react-native-runtime.ts +33 -33
- package/src/react-native/react-native-utils.ts +1 -1
- package/src/react-native/react-native.spec.ts +31 -21
- package/src/searchPage/searchPageClient.spec.ts +1944 -1794
- package/src/searchPage/searchPageClient.ts +1261 -1040
- package/src/searchPage/searchPageEvents.ts +524 -511
- package/src/storage.spec.ts +51 -51
- package/src/storage.ts +47 -47
- package/dist/definitions/bundle/browser-fetch.d.ts +0 -1
- package/dist/definitions/src/coveoua/browser.d.ts +0 -6
- package/dist/definitions/src/coveoua/headless.d.ts +0 -6
- package/dist/definitions/src/coveoua/library.d.ts +0 -17
- package/dist/definitions/src/coveoua/plugins.d.ts +0 -10
- package/dist/definitions/src/coveoua/simpleanalytics.d.ts +0 -33
- package/dist/definitions/src/react-native/index.d.ts +0 -3
- package/dist/definitions/src/react-native/react-native-runtime.d.ts +0 -19
|
@@ -1,1060 +1,1281 @@
|
|
|
1
|
-
import CoveoAnalyticsClient, {
|
|
1
|
+
import CoveoAnalyticsClient, {
|
|
2
|
+
ClientOptions,
|
|
3
|
+
AnalyticsClient,
|
|
4
|
+
PreparedEvent,
|
|
5
|
+
} from '../client/analytics';
|
|
2
6
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
SearchEventRequest,
|
|
8
|
+
CustomEventRequest,
|
|
9
|
+
SearchEventResponse,
|
|
10
|
+
AnyEventResponse,
|
|
11
|
+
ClickEventResponse,
|
|
12
|
+
CustomEventResponse,
|
|
13
|
+
PreparedClickEventRequest,
|
|
14
|
+
PreparedSearchEventRequest,
|
|
11
15
|
} from '../events';
|
|
12
16
|
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
17
|
+
SearchPageEvents,
|
|
18
|
+
OmniboxSuggestionsMetadata,
|
|
19
|
+
FacetMetadata,
|
|
20
|
+
FacetRangeMetadata,
|
|
21
|
+
CategoryFacetMetadata,
|
|
22
|
+
DocumentIdentifier,
|
|
23
|
+
InterfaceChangeMetadata,
|
|
24
|
+
ResultsSortMetadata,
|
|
25
|
+
PartialDocumentInformation,
|
|
26
|
+
CustomEventsTypes,
|
|
27
|
+
TriggerNotifyMetadata,
|
|
28
|
+
TriggerExecuteMetadata,
|
|
29
|
+
TriggerRedirectMetadata,
|
|
30
|
+
PagerResizeMetadata,
|
|
31
|
+
PagerMetadata,
|
|
32
|
+
FacetBaseMeta,
|
|
33
|
+
FacetSortMeta,
|
|
34
|
+
QueryErrorMeta,
|
|
35
|
+
FacetStateMetadata,
|
|
36
|
+
SmartSnippetFeedbackReason,
|
|
37
|
+
SmartSnippetSuggestionMeta,
|
|
38
|
+
SmartSnippetDocumentIdentifier,
|
|
39
|
+
StaticFilterMetadata,
|
|
40
|
+
StaticFilterToggleValueMetadata,
|
|
41
|
+
UndoTriggerRedirectMetadata,
|
|
42
|
+
SmartSnippetLinkMeta,
|
|
43
|
+
GeneratedAnswerFeedbackMeta,
|
|
44
|
+
GeneratedAnswerCitationMeta,
|
|
45
|
+
GeneratedAnswerStreamEndMeta,
|
|
46
|
+
GeneratedAnswerSourceHoverMeta,
|
|
47
|
+
GeneratedAnswerBaseMeta,
|
|
48
|
+
GeneratedAnswerRephraseMeta,
|
|
49
|
+
GeneratedAnswerFeedbackMetaV2,
|
|
50
|
+
GeneratedAnswerCitationClickMeta,
|
|
51
|
+
GeneratedAnswerInlineLinkMeta,
|
|
52
|
+
GeneratedAnswerFollowupOpenSourceMeta,
|
|
49
53
|
} from './searchPageEvents';
|
|
50
54
|
import {NoopAnalytics} from '../client/noopAnalytics';
|
|
51
55
|
import {formatOmniboxMetadata} from '../formatting/format-omnibox-metadata';
|
|
52
|
-
import
|
|
56
|
+
import {shouldDisableAnalyticsForPrivacy} from '../donottrack';
|
|
53
57
|
|
|
54
58
|
export interface SearchPageClientProvider {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
59
|
+
getBaseMetadata: () => Record<string, any>;
|
|
60
|
+
getSearchEventRequestPayload: () => Omit<SearchEventRequest, 'actionCause' | 'searchQueryUid'>;
|
|
61
|
+
getSearchUID: () => string;
|
|
62
|
+
getPipeline: () => string;
|
|
63
|
+
getOriginContext?: () => string;
|
|
64
|
+
getOriginLevel1: () => string;
|
|
65
|
+
getOriginLevel2: () => string;
|
|
66
|
+
getOriginLevel3: () => string;
|
|
67
|
+
getLanguage: () => string;
|
|
68
|
+
getIsAnonymous: () => boolean;
|
|
69
|
+
getFacetState?: () => FacetStateMetadata[];
|
|
70
|
+
getSplitTestRunName?: () => string | undefined;
|
|
71
|
+
getSplitTestRunVersion?: () => string | undefined;
|
|
72
|
+
getGeneratedAnswerMetadata?: () => Record<string, any>;
|
|
69
73
|
}
|
|
70
74
|
|
|
71
75
|
export interface SearchPageClientOptions extends ClientOptions {
|
|
72
|
-
|
|
76
|
+
enableAnalytics: boolean;
|
|
73
77
|
}
|
|
74
78
|
|
|
75
79
|
export type EventDescription = Pick<SearchEventRequest, 'actionCause' | 'customData'>;
|
|
76
80
|
|
|
77
81
|
export interface EventBuilder<T extends AnyEventResponse = AnyEventResponse> {
|
|
78
|
-
|
|
79
|
-
|
|
82
|
+
description: EventDescription;
|
|
83
|
+
log(metadata: {searchUID: string}): Promise<T | void>;
|
|
80
84
|
}
|
|
81
85
|
|
|
82
86
|
export class CoveoSearchPageClient {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
)
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
}
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
)
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
)
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
}
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
87
|
+
public coveoAnalyticsClient: AnalyticsClient;
|
|
88
|
+
|
|
89
|
+
constructor(
|
|
90
|
+
private opts: Partial<SearchPageClientOptions>,
|
|
91
|
+
private provider: SearchPageClientProvider
|
|
92
|
+
) {
|
|
93
|
+
const shouldDisableAnalytics =
|
|
94
|
+
opts.enableAnalytics === false ||
|
|
95
|
+
shouldDisableAnalyticsForPrivacy(opts.disableBrowserPrivacySignals);
|
|
96
|
+
this.coveoAnalyticsClient = shouldDisableAnalytics
|
|
97
|
+
? new NoopAnalytics()
|
|
98
|
+
: new CoveoAnalyticsClient(opts);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
public disable() {
|
|
102
|
+
this.coveoAnalyticsClient = new NoopAnalytics();
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
public enable() {
|
|
106
|
+
this.coveoAnalyticsClient = new CoveoAnalyticsClient(this.opts);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
public makeInterfaceLoad() {
|
|
110
|
+
return this.makeSearchEvent(SearchPageEvents.interfaceLoad);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
public async logInterfaceLoad() {
|
|
114
|
+
return (await this.makeInterfaceLoad()).log({
|
|
115
|
+
searchUID: this.provider.getSearchUID(),
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
public makeRecommendationInterfaceLoad() {
|
|
120
|
+
return this.makeSearchEvent(SearchPageEvents.recommendationInterfaceLoad);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
public async logRecommendationInterfaceLoad() {
|
|
124
|
+
return (await this.makeRecommendationInterfaceLoad()).log({
|
|
125
|
+
searchUID: this.provider.getSearchUID(),
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
public makeRecommendation() {
|
|
130
|
+
return this.makeCustomEvent(SearchPageEvents.recommendation);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
public async logRecommendation() {
|
|
134
|
+
return (await this.makeRecommendation()).log({
|
|
135
|
+
searchUID: this.provider.getSearchUID(),
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
public makeRecommendationOpen(info: PartialDocumentInformation, identifier: DocumentIdentifier) {
|
|
140
|
+
return this.makeClickEvent(SearchPageEvents.recommendationOpen, info, identifier);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
public async logRecommendationOpen(
|
|
144
|
+
info: PartialDocumentInformation,
|
|
145
|
+
identifier: DocumentIdentifier
|
|
146
|
+
) {
|
|
147
|
+
return (await this.makeRecommendationOpen(info, identifier)).log({
|
|
148
|
+
searchUID: this.provider.getSearchUID(),
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
public makeStaticFilterClearAll(meta: StaticFilterMetadata) {
|
|
153
|
+
return this.makeSearchEvent(SearchPageEvents.staticFilterClearAll, meta);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
public async logStaticFilterClearAll(meta: StaticFilterMetadata) {
|
|
157
|
+
return (await this.makeStaticFilterClearAll(meta)).log({
|
|
158
|
+
searchUID: this.provider.getSearchUID(),
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
public makeStaticFilterSelect(meta: StaticFilterToggleValueMetadata) {
|
|
163
|
+
return this.makeSearchEvent(SearchPageEvents.staticFilterSelect, meta);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
public async logStaticFilterSelect(meta: StaticFilterToggleValueMetadata) {
|
|
167
|
+
return (await this.makeStaticFilterSelect(meta)).log({
|
|
168
|
+
searchUID: this.provider.getSearchUID(),
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
public makeStaticFilterDeselect(meta: StaticFilterToggleValueMetadata) {
|
|
173
|
+
return this.makeSearchEvent(SearchPageEvents.staticFilterDeselect, meta);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
public async logStaticFilterDeselect(meta: StaticFilterToggleValueMetadata) {
|
|
177
|
+
return (await this.makeStaticFilterDeselect(meta)).log({
|
|
178
|
+
searchUID: this.provider.getSearchUID(),
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
public makeFetchMoreResults() {
|
|
183
|
+
return this.makeCustomEvent(SearchPageEvents.pagerScrolling, {
|
|
184
|
+
type: 'getMoreResults',
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
public async logFetchMoreResults() {
|
|
189
|
+
return (await this.makeFetchMoreResults()).log({
|
|
190
|
+
searchUID: this.provider.getSearchUID(),
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
public makeInterfaceChange(metadata: InterfaceChangeMetadata) {
|
|
195
|
+
return this.makeSearchEvent(SearchPageEvents.interfaceChange, metadata);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
public async logInterfaceChange(metadata: InterfaceChangeMetadata) {
|
|
199
|
+
return (await this.makeInterfaceChange(metadata)).log({
|
|
200
|
+
searchUID: this.provider.getSearchUID(),
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
public makeDidYouMeanAutomatic() {
|
|
205
|
+
return this.makeSearchEvent(SearchPageEvents.didyoumeanAutomatic);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
public async logDidYouMeanAutomatic() {
|
|
209
|
+
return (await this.makeDidYouMeanAutomatic()).log({
|
|
210
|
+
searchUID: this.provider.getSearchUID(),
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
public makeDidYouMeanClick() {
|
|
215
|
+
return this.makeSearchEvent(SearchPageEvents.didyoumeanClick);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
public async logDidYouMeanClick() {
|
|
219
|
+
return (await this.makeDidYouMeanClick()).log({
|
|
220
|
+
searchUID: this.provider.getSearchUID(),
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
public makeResultsSort(metadata: ResultsSortMetadata) {
|
|
225
|
+
return this.makeSearchEvent(SearchPageEvents.resultsSort, metadata);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
public async logResultsSort(metadata: ResultsSortMetadata) {
|
|
229
|
+
return (await this.makeResultsSort(metadata)).log({
|
|
230
|
+
searchUID: this.provider.getSearchUID(),
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
public makeSearchboxSubmit() {
|
|
235
|
+
return this.makeSearchEvent(SearchPageEvents.searchboxSubmit);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
public async logSearchboxSubmit() {
|
|
239
|
+
return (await this.makeSearchboxSubmit()).log({
|
|
240
|
+
searchUID: this.provider.getSearchUID(),
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
public makeSearchboxClear() {
|
|
245
|
+
return this.makeSearchEvent(SearchPageEvents.searchboxClear);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
public async logSearchboxClear() {
|
|
249
|
+
return (await this.makeSearchboxClear()).log({
|
|
250
|
+
searchUID: this.provider.getSearchUID(),
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
public makeSearchboxAsYouType() {
|
|
255
|
+
return this.makeSearchEvent(SearchPageEvents.searchboxAsYouType);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
public async logSearchboxAsYouType() {
|
|
259
|
+
return (await this.makeSearchboxAsYouType()).log({
|
|
260
|
+
searchUID: this.provider.getSearchUID(),
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
public makeBreadcrumbFacet(metadata: FacetMetadata | FacetRangeMetadata | CategoryFacetMetadata) {
|
|
265
|
+
return this.makeSearchEvent(SearchPageEvents.breadcrumbFacet, metadata);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
public async logBreadcrumbFacet(
|
|
269
|
+
metadata: FacetMetadata | FacetRangeMetadata | CategoryFacetMetadata
|
|
270
|
+
) {
|
|
271
|
+
return (await this.makeBreadcrumbFacet(metadata)).log({
|
|
272
|
+
searchUID: this.provider.getSearchUID(),
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
public makeBreadcrumbResetAll() {
|
|
277
|
+
return this.makeSearchEvent(SearchPageEvents.breadcrumbResetAll);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
public async logBreadcrumbResetAll() {
|
|
281
|
+
return (await this.makeBreadcrumbResetAll()).log({
|
|
282
|
+
searchUID: this.provider.getSearchUID(),
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
public makeDocumentQuickview(info: PartialDocumentInformation, identifier: DocumentIdentifier) {
|
|
287
|
+
return this.makeClickEvent(SearchPageEvents.documentQuickview, info, identifier);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
public async logDocumentQuickview(
|
|
291
|
+
info: PartialDocumentInformation,
|
|
292
|
+
identifier: DocumentIdentifier
|
|
293
|
+
) {
|
|
294
|
+
return (await this.makeDocumentQuickview(info, identifier)).log({
|
|
295
|
+
searchUID: this.provider.getSearchUID(),
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
public makeDocumentOpen(info: PartialDocumentInformation, identifier: DocumentIdentifier) {
|
|
300
|
+
return this.makeClickEvent(SearchPageEvents.documentOpen, info, identifier);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
public async logDocumentOpen(info: PartialDocumentInformation, identifier: DocumentIdentifier) {
|
|
304
|
+
return (await this.makeDocumentOpen(info, identifier)).log({
|
|
305
|
+
searchUID: this.provider.getSearchUID(),
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
public makeOmniboxAnalytics(meta: OmniboxSuggestionsMetadata) {
|
|
310
|
+
return this.makeSearchEvent(SearchPageEvents.omniboxAnalytics, formatOmniboxMetadata(meta));
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
public async logOmniboxAnalytics(meta: OmniboxSuggestionsMetadata) {
|
|
314
|
+
return (await this.makeOmniboxAnalytics(meta)).log({
|
|
315
|
+
searchUID: this.provider.getSearchUID(),
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
public makeOmniboxFromLink(meta: OmniboxSuggestionsMetadata) {
|
|
320
|
+
return this.makeSearchEvent(SearchPageEvents.omniboxFromLink, formatOmniboxMetadata(meta));
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
public async logOmniboxFromLink(meta: OmniboxSuggestionsMetadata) {
|
|
324
|
+
return (await this.makeOmniboxFromLink(meta)).log({
|
|
325
|
+
searchUID: this.provider.getSearchUID(),
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
public makeSearchFromLink() {
|
|
330
|
+
return this.makeSearchEvent(SearchPageEvents.searchFromLink);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
public async logSearchFromLink() {
|
|
334
|
+
return (await this.makeSearchFromLink()).log({
|
|
335
|
+
searchUID: this.provider.getSearchUID(),
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
public makeTriggerNotify(meta: TriggerNotifyMetadata) {
|
|
340
|
+
return this.makeCustomEvent(SearchPageEvents.triggerNotify, meta);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
public async logTriggerNotify(meta: TriggerNotifyMetadata) {
|
|
344
|
+
return (await this.makeTriggerNotify(meta)).log({
|
|
345
|
+
searchUID: this.provider.getSearchUID(),
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
public makeTriggerExecute(meta: TriggerExecuteMetadata) {
|
|
350
|
+
return this.makeCustomEvent(SearchPageEvents.triggerExecute, meta);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
public async logTriggerExecute(meta: TriggerExecuteMetadata) {
|
|
354
|
+
return (await this.makeTriggerExecute(meta)).log({
|
|
355
|
+
searchUID: this.provider.getSearchUID(),
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
public makeTriggerQuery() {
|
|
360
|
+
return this.makeCustomEvent(
|
|
361
|
+
SearchPageEvents.triggerQuery,
|
|
362
|
+
{query: this.provider.getSearchEventRequestPayload().queryText},
|
|
363
|
+
'queryPipelineTriggers'
|
|
364
|
+
);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
public async logTriggerQuery() {
|
|
368
|
+
return (await this.makeTriggerQuery()).log({
|
|
369
|
+
searchUID: this.provider.getSearchUID(),
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
public makeUndoTriggerQuery(meta: UndoTriggerRedirectMetadata) {
|
|
374
|
+
return this.makeSearchEvent(SearchPageEvents.undoTriggerQuery, meta);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
public async logUndoTriggerQuery(meta: UndoTriggerRedirectMetadata) {
|
|
378
|
+
return (await this.makeUndoTriggerQuery(meta)).log({
|
|
379
|
+
searchUID: this.provider.getSearchUID(),
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
public makeTriggerRedirect(meta: TriggerRedirectMetadata) {
|
|
384
|
+
return this.makeCustomEvent(SearchPageEvents.triggerRedirect, {
|
|
385
|
+
...meta,
|
|
386
|
+
query: this.provider.getSearchEventRequestPayload().queryText,
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
public async logTriggerRedirect(meta: TriggerRedirectMetadata) {
|
|
391
|
+
return (await this.makeTriggerRedirect(meta)).log({
|
|
392
|
+
searchUID: this.provider.getSearchUID(),
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
public makePagerResize(meta: PagerResizeMetadata) {
|
|
397
|
+
return this.makeCustomEvent(SearchPageEvents.pagerResize, meta);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
public async logPagerResize(meta: PagerResizeMetadata) {
|
|
401
|
+
return (await this.makePagerResize(meta)).log({
|
|
402
|
+
searchUID: this.provider.getSearchUID(),
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
public makePagerNumber(meta: PagerMetadata) {
|
|
407
|
+
return this.makeCustomEvent(SearchPageEvents.pagerNumber, meta);
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
public async logPagerNumber(meta: PagerMetadata) {
|
|
411
|
+
return (await this.makePagerNumber(meta)).log({
|
|
412
|
+
searchUID: this.provider.getSearchUID(),
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
public makePagerNext(meta: PagerMetadata) {
|
|
417
|
+
return this.makeCustomEvent(SearchPageEvents.pagerNext, meta);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
public async logPagerNext(meta: PagerMetadata) {
|
|
421
|
+
return (await this.makePagerNext(meta)).log({
|
|
422
|
+
searchUID: this.provider.getSearchUID(),
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
public makePagerPrevious(meta: PagerMetadata) {
|
|
427
|
+
return this.makeCustomEvent(SearchPageEvents.pagerPrevious, meta);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
public async logPagerPrevious(meta: PagerMetadata) {
|
|
431
|
+
return (await this.makePagerPrevious(meta)).log({
|
|
432
|
+
searchUID: this.provider.getSearchUID(),
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
public makePagerScrolling() {
|
|
437
|
+
return this.makeCustomEvent(SearchPageEvents.pagerScrolling);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
public async logPagerScrolling() {
|
|
441
|
+
return (await this.makePagerScrolling()).log({
|
|
442
|
+
searchUID: this.provider.getSearchUID(),
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
public makeFacetClearAll(meta: FacetBaseMeta) {
|
|
447
|
+
return this.makeSearchEvent(SearchPageEvents.facetClearAll, meta);
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
public async logFacetClearAll(meta: FacetBaseMeta) {
|
|
451
|
+
return (await this.makeFacetClearAll(meta)).log({
|
|
452
|
+
searchUID: this.provider.getSearchUID(),
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
public makeFacetSearch(meta: FacetBaseMeta) {
|
|
457
|
+
return this.makeSearchEvent(SearchPageEvents.facetSearch, meta);
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
public async logFacetSearch(meta: FacetBaseMeta) {
|
|
461
|
+
return (await this.makeFacetSearch(meta)).log({
|
|
462
|
+
searchUID: this.provider.getSearchUID(),
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
public makeFacetSelect(meta: FacetMetadata) {
|
|
467
|
+
return this.makeSearchEvent(SearchPageEvents.facetSelect, meta);
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
public async logFacetSelect(meta: FacetMetadata) {
|
|
471
|
+
return (await this.makeFacetSelect(meta)).log({
|
|
472
|
+
searchUID: this.provider.getSearchUID(),
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
public makeFacetDeselect(meta: FacetMetadata) {
|
|
477
|
+
return this.makeSearchEvent(SearchPageEvents.facetDeselect, meta);
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
public async logFacetDeselect(meta: FacetMetadata) {
|
|
481
|
+
return (await this.makeFacetDeselect(meta)).log({
|
|
482
|
+
searchUID: this.provider.getSearchUID(),
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
public makeFacetExclude(meta: FacetMetadata) {
|
|
487
|
+
return this.makeSearchEvent(SearchPageEvents.facetExclude, meta);
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
public async logFacetExclude(meta: FacetMetadata) {
|
|
491
|
+
return (await this.makeFacetExclude(meta)).log({
|
|
492
|
+
searchUID: this.provider.getSearchUID(),
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
public makeFacetUnexclude(meta: FacetMetadata) {
|
|
497
|
+
return this.makeSearchEvent(SearchPageEvents.facetUnexclude, meta);
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
public async logFacetUnexclude(meta: FacetMetadata) {
|
|
501
|
+
return (await this.makeFacetUnexclude(meta)).log({
|
|
502
|
+
searchUID: this.provider.getSearchUID(),
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
public makeFacetSelectAll(meta: FacetBaseMeta) {
|
|
507
|
+
return this.makeSearchEvent(SearchPageEvents.facetSelectAll, meta);
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
public async logFacetSelectAll(meta: FacetBaseMeta) {
|
|
511
|
+
return (await this.makeFacetSelectAll(meta)).log({
|
|
512
|
+
searchUID: this.provider.getSearchUID(),
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
public makeFacetUpdateSort(meta: FacetSortMeta) {
|
|
517
|
+
return this.makeSearchEvent(SearchPageEvents.facetUpdateSort, meta);
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
public async logFacetUpdateSort(meta: FacetSortMeta) {
|
|
521
|
+
return (await this.makeFacetUpdateSort(meta)).log({
|
|
522
|
+
searchUID: this.provider.getSearchUID(),
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
public makeFacetShowMore(meta: FacetBaseMeta) {
|
|
527
|
+
return this.makeCustomEvent(SearchPageEvents.facetShowMore, meta);
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
public async logFacetShowMore(meta: FacetBaseMeta) {
|
|
531
|
+
return (await this.makeFacetShowMore(meta)).log({
|
|
532
|
+
searchUID: this.provider.getSearchUID(),
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
public makeFacetShowLess(meta: FacetBaseMeta) {
|
|
537
|
+
return this.makeCustomEvent(SearchPageEvents.facetShowLess, meta);
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
public async logFacetShowLess(meta: FacetBaseMeta) {
|
|
541
|
+
return (await this.makeFacetShowLess(meta)).log({
|
|
542
|
+
searchUID: this.provider.getSearchUID(),
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
public makeQueryError(meta: QueryErrorMeta) {
|
|
547
|
+
return this.makeCustomEvent(SearchPageEvents.queryError, meta);
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
public async logQueryError(meta: QueryErrorMeta) {
|
|
551
|
+
return (await this.makeQueryError(meta)).log({
|
|
552
|
+
searchUID: this.provider.getSearchUID(),
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
public async makeQueryErrorBack(): Promise<EventBuilder<SearchEventResponse>> {
|
|
557
|
+
const customEventBuilder = await this.makeCustomEvent(SearchPageEvents.queryErrorBack);
|
|
558
|
+
return {
|
|
559
|
+
description: customEventBuilder.description,
|
|
560
|
+
log: async () => {
|
|
561
|
+
await customEventBuilder.log({searchUID: this.provider.getSearchUID()});
|
|
562
|
+
return this.logSearchEvent(SearchPageEvents.queryErrorBack);
|
|
563
|
+
},
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
public async logQueryErrorBack() {
|
|
568
|
+
return (await this.makeQueryErrorBack()).log({
|
|
569
|
+
searchUID: this.provider.getSearchUID(),
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
public async makeQueryErrorRetry(): Promise<EventBuilder<SearchEventResponse>> {
|
|
574
|
+
const customEventBuilder = await this.makeCustomEvent(SearchPageEvents.queryErrorRetry);
|
|
575
|
+
return {
|
|
576
|
+
description: customEventBuilder.description,
|
|
577
|
+
log: async () => {
|
|
578
|
+
await customEventBuilder.log({searchUID: this.provider.getSearchUID()});
|
|
579
|
+
return this.logSearchEvent(SearchPageEvents.queryErrorRetry);
|
|
580
|
+
},
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
public async logQueryErrorRetry() {
|
|
585
|
+
return (await this.makeQueryErrorRetry()).log({
|
|
586
|
+
searchUID: this.provider.getSearchUID(),
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
public async makeQueryErrorClear(): Promise<EventBuilder<SearchEventResponse>> {
|
|
591
|
+
const customEventBuilder = await this.makeCustomEvent(SearchPageEvents.queryErrorClear);
|
|
592
|
+
return {
|
|
593
|
+
description: customEventBuilder.description,
|
|
594
|
+
log: async () => {
|
|
595
|
+
await customEventBuilder.log({searchUID: this.provider.getSearchUID()});
|
|
596
|
+
return this.logSearchEvent(SearchPageEvents.queryErrorClear);
|
|
597
|
+
},
|
|
598
|
+
};
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
public async logQueryErrorClear() {
|
|
602
|
+
return (await this.makeQueryErrorClear()).log({
|
|
603
|
+
searchUID: this.provider.getSearchUID(),
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
public makeLikeSmartSnippet() {
|
|
608
|
+
return this.makeCustomEvent(SearchPageEvents.likeSmartSnippet);
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
public async logLikeSmartSnippet() {
|
|
612
|
+
return (await this.makeLikeSmartSnippet()).log({
|
|
613
|
+
searchUID: this.provider.getSearchUID(),
|
|
614
|
+
});
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
public makeDislikeSmartSnippet() {
|
|
618
|
+
return this.makeCustomEvent(SearchPageEvents.dislikeSmartSnippet);
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
public async logDislikeSmartSnippet() {
|
|
622
|
+
return (await this.makeDislikeSmartSnippet()).log({
|
|
623
|
+
searchUID: this.provider.getSearchUID(),
|
|
624
|
+
});
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
public makeExpandSmartSnippet() {
|
|
628
|
+
return this.makeCustomEvent(SearchPageEvents.expandSmartSnippet);
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
public async logExpandSmartSnippet() {
|
|
632
|
+
return (await this.makeExpandSmartSnippet()).log({
|
|
633
|
+
searchUID: this.provider.getSearchUID(),
|
|
634
|
+
});
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
public makeCollapseSmartSnippet() {
|
|
638
|
+
return this.makeCustomEvent(SearchPageEvents.collapseSmartSnippet);
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
public async logCollapseSmartSnippet() {
|
|
642
|
+
return (await this.makeCollapseSmartSnippet()).log({
|
|
643
|
+
searchUID: this.provider.getSearchUID(),
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
public makeOpenSmartSnippetFeedbackModal() {
|
|
648
|
+
return this.makeCustomEvent(SearchPageEvents.openSmartSnippetFeedbackModal);
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
public async logOpenSmartSnippetFeedbackModal() {
|
|
652
|
+
return (await this.makeOpenSmartSnippetFeedbackModal()).log({
|
|
653
|
+
searchUID: this.provider.getSearchUID(),
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
public makeCloseSmartSnippetFeedbackModal() {
|
|
658
|
+
return this.makeCustomEvent(SearchPageEvents.closeSmartSnippetFeedbackModal);
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
public async logCloseSmartSnippetFeedbackModal() {
|
|
662
|
+
return (await this.makeCloseSmartSnippetFeedbackModal()).log({
|
|
663
|
+
searchUID: this.provider.getSearchUID(),
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
public makeSmartSnippetFeedbackReason(reason: SmartSnippetFeedbackReason, details?: string) {
|
|
668
|
+
return this.makeCustomEvent(SearchPageEvents.sendSmartSnippetReason, {
|
|
669
|
+
reason,
|
|
670
|
+
details,
|
|
671
|
+
});
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
public async logSmartSnippetFeedbackReason(reason: SmartSnippetFeedbackReason, details?: string) {
|
|
675
|
+
return (await this.makeSmartSnippetFeedbackReason(reason, details)).log({
|
|
676
|
+
searchUID: this.provider.getSearchUID(),
|
|
677
|
+
});
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
public makeExpandSmartSnippetSuggestion(
|
|
681
|
+
snippet: SmartSnippetSuggestionMeta | SmartSnippetDocumentIdentifier
|
|
682
|
+
) {
|
|
683
|
+
return this.makeCustomEvent(
|
|
684
|
+
SearchPageEvents.expandSmartSnippetSuggestion,
|
|
685
|
+
'documentId' in snippet ? snippet : {documentId: snippet}
|
|
686
|
+
);
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
public async logExpandSmartSnippetSuggestion(
|
|
690
|
+
snippet: SmartSnippetSuggestionMeta | SmartSnippetDocumentIdentifier
|
|
691
|
+
) {
|
|
692
|
+
return (await this.makeExpandSmartSnippetSuggestion(snippet)).log({
|
|
693
|
+
searchUID: this.provider.getSearchUID(),
|
|
694
|
+
});
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
public makeCollapseSmartSnippetSuggestion(
|
|
698
|
+
snippet: SmartSnippetSuggestionMeta | SmartSnippetDocumentIdentifier
|
|
699
|
+
) {
|
|
700
|
+
return this.makeCustomEvent(
|
|
701
|
+
SearchPageEvents.collapseSmartSnippetSuggestion,
|
|
702
|
+
'documentId' in snippet ? snippet : {documentId: snippet}
|
|
703
|
+
);
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
public async logCollapseSmartSnippetSuggestion(
|
|
707
|
+
snippet: SmartSnippetSuggestionMeta | SmartSnippetDocumentIdentifier
|
|
708
|
+
) {
|
|
709
|
+
return (await this.makeCollapseSmartSnippetSuggestion(snippet)).log({
|
|
710
|
+
searchUID: this.provider.getSearchUID(),
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
/**
|
|
715
|
+
* @deprecated
|
|
716
|
+
*/
|
|
717
|
+
private makeShowMoreSmartSnippetSuggestion(snippet: SmartSnippetSuggestionMeta) {
|
|
718
|
+
return this.makeCustomEvent(SearchPageEvents.showMoreSmartSnippetSuggestion, snippet);
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
/**
|
|
722
|
+
* @deprecated
|
|
723
|
+
*/
|
|
724
|
+
public async logShowMoreSmartSnippetSuggestion(snippet: SmartSnippetSuggestionMeta) {
|
|
725
|
+
return (await this.makeShowMoreSmartSnippetSuggestion(snippet)).log({
|
|
726
|
+
searchUID: this.provider.getSearchUID(),
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
/**
|
|
731
|
+
* @deprecated
|
|
732
|
+
*/
|
|
733
|
+
private makeShowLessSmartSnippetSuggestion(snippet: SmartSnippetSuggestionMeta) {
|
|
734
|
+
return this.makeCustomEvent(SearchPageEvents.showLessSmartSnippetSuggestion, snippet);
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
/**
|
|
738
|
+
* @deprecated
|
|
739
|
+
*/
|
|
740
|
+
public async logShowLessSmartSnippetSuggestion(snippet: SmartSnippetSuggestionMeta) {
|
|
741
|
+
return (await this.makeShowLessSmartSnippetSuggestion(snippet)).log({
|
|
742
|
+
searchUID: this.provider.getSearchUID(),
|
|
743
|
+
});
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
public makeOpenSmartSnippetSource(
|
|
747
|
+
info: PartialDocumentInformation,
|
|
748
|
+
identifier: DocumentIdentifier
|
|
749
|
+
) {
|
|
750
|
+
return this.makeClickEvent(SearchPageEvents.openSmartSnippetSource, info, identifier);
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
public async logOpenSmartSnippetSource(
|
|
754
|
+
info: PartialDocumentInformation,
|
|
755
|
+
identifier: DocumentIdentifier
|
|
756
|
+
) {
|
|
757
|
+
return (await this.makeOpenSmartSnippetSource(info, identifier)).log({
|
|
758
|
+
searchUID: this.provider.getSearchUID(),
|
|
759
|
+
});
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
public makeOpenSmartSnippetSuggestionSource(
|
|
763
|
+
info: PartialDocumentInformation,
|
|
764
|
+
snippet: SmartSnippetSuggestionMeta
|
|
765
|
+
) {
|
|
766
|
+
return this.makeClickEvent(
|
|
767
|
+
SearchPageEvents.openSmartSnippetSuggestionSource,
|
|
768
|
+
info,
|
|
769
|
+
{
|
|
770
|
+
contentIDKey: snippet.documentId.contentIdKey,
|
|
771
|
+
contentIDValue: snippet.documentId.contentIdValue,
|
|
772
|
+
},
|
|
773
|
+
snippet
|
|
774
|
+
);
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
public makeCopyToClipboard(info: PartialDocumentInformation, identifier: DocumentIdentifier) {
|
|
778
|
+
return this.makeClickEvent(SearchPageEvents.copyToClipboard, info, identifier);
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
public async logCopyToClipboard(
|
|
782
|
+
info: PartialDocumentInformation,
|
|
783
|
+
identifier: DocumentIdentifier
|
|
784
|
+
) {
|
|
785
|
+
return (await this.makeCopyToClipboard(info, identifier)).log({
|
|
786
|
+
searchUID: this.provider.getSearchUID(),
|
|
787
|
+
});
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
public async logOpenSmartSnippetSuggestionSource(
|
|
791
|
+
info: PartialDocumentInformation,
|
|
792
|
+
snippet: SmartSnippetSuggestionMeta
|
|
793
|
+
) {
|
|
794
|
+
return (await this.makeOpenSmartSnippetSuggestionSource(info, snippet)).log({
|
|
795
|
+
searchUID: this.provider.getSearchUID(),
|
|
796
|
+
});
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
public makeOpenSmartSnippetInlineLink(
|
|
800
|
+
info: PartialDocumentInformation,
|
|
801
|
+
identifierAndLink: DocumentIdentifier & SmartSnippetLinkMeta
|
|
802
|
+
) {
|
|
803
|
+
return this.makeClickEvent(
|
|
804
|
+
SearchPageEvents.openSmartSnippetInlineLink,
|
|
805
|
+
info,
|
|
806
|
+
{
|
|
807
|
+
contentIDKey: identifierAndLink.contentIDKey,
|
|
808
|
+
contentIDValue: identifierAndLink.contentIDValue,
|
|
809
|
+
},
|
|
810
|
+
identifierAndLink
|
|
811
|
+
);
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
public async logOpenSmartSnippetInlineLink(
|
|
815
|
+
info: PartialDocumentInformation,
|
|
816
|
+
identifierAndLink: DocumentIdentifier & SmartSnippetLinkMeta
|
|
817
|
+
) {
|
|
818
|
+
return (await this.makeOpenSmartSnippetInlineLink(info, identifierAndLink)).log({
|
|
819
|
+
searchUID: this.provider.getSearchUID(),
|
|
820
|
+
});
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
public makeOpenSmartSnippetSuggestionInlineLink(
|
|
824
|
+
info: PartialDocumentInformation,
|
|
825
|
+
snippetAndLink: SmartSnippetSuggestionMeta & SmartSnippetLinkMeta
|
|
826
|
+
) {
|
|
827
|
+
return this.makeClickEvent(
|
|
828
|
+
SearchPageEvents.openSmartSnippetSuggestionInlineLink,
|
|
829
|
+
info,
|
|
830
|
+
{
|
|
831
|
+
contentIDKey: snippetAndLink.documentId.contentIdKey,
|
|
832
|
+
contentIDValue: snippetAndLink.documentId.contentIdValue,
|
|
833
|
+
},
|
|
834
|
+
snippetAndLink
|
|
835
|
+
);
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
public async logOpenSmartSnippetSuggestionInlineLink(
|
|
839
|
+
info: PartialDocumentInformation,
|
|
840
|
+
snippetAndLink: SmartSnippetSuggestionMeta & SmartSnippetLinkMeta
|
|
841
|
+
) {
|
|
842
|
+
return (await this.makeOpenSmartSnippetSuggestionInlineLink(info, snippetAndLink)).log({
|
|
843
|
+
searchUID: this.provider.getSearchUID(),
|
|
844
|
+
});
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
public makeRecentQueryClick() {
|
|
848
|
+
return this.makeSearchEvent(SearchPageEvents.recentQueryClick);
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
public async logRecentQueryClick() {
|
|
852
|
+
return (await this.makeRecentQueryClick()).log({
|
|
853
|
+
searchUID: this.provider.getSearchUID(),
|
|
854
|
+
});
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
public makeClearRecentQueries() {
|
|
858
|
+
return this.makeCustomEvent(SearchPageEvents.clearRecentQueries);
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
public async logClearRecentQueries() {
|
|
862
|
+
return (await this.makeClearRecentQueries()).log({
|
|
863
|
+
searchUID: this.provider.getSearchUID(),
|
|
864
|
+
});
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
public makeRecentResultClick(info: PartialDocumentInformation, identifier: DocumentIdentifier) {
|
|
868
|
+
return this.makeCustomEvent(SearchPageEvents.recentResultClick, {
|
|
869
|
+
info,
|
|
870
|
+
identifier,
|
|
871
|
+
});
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
public async logRecentResultClick(
|
|
875
|
+
info: PartialDocumentInformation,
|
|
876
|
+
identifier: DocumentIdentifier
|
|
877
|
+
) {
|
|
878
|
+
return (await this.makeRecentResultClick(info, identifier)).log({
|
|
879
|
+
searchUID: this.provider.getSearchUID(),
|
|
880
|
+
});
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
public makeClearRecentResults() {
|
|
884
|
+
return this.makeCustomEvent(SearchPageEvents.clearRecentResults);
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
public async logClearRecentResults() {
|
|
888
|
+
return (await this.makeClearRecentResults()).log({
|
|
889
|
+
searchUID: this.provider.getSearchUID(),
|
|
890
|
+
});
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
public makeNoResultsBack() {
|
|
894
|
+
return this.makeSearchEvent(SearchPageEvents.noResultsBack);
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
public async logNoResultsBack() {
|
|
898
|
+
return (await this.makeNoResultsBack()).log({
|
|
899
|
+
searchUID: this.provider.getSearchUID(),
|
|
900
|
+
});
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
public makeShowMoreFoldedResults(
|
|
904
|
+
info: PartialDocumentInformation,
|
|
905
|
+
identifier: DocumentIdentifier
|
|
906
|
+
) {
|
|
907
|
+
return this.makeClickEvent(SearchPageEvents.showMoreFoldedResults, info, identifier);
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
public async logShowMoreFoldedResults(
|
|
911
|
+
info: PartialDocumentInformation,
|
|
912
|
+
identifier: DocumentIdentifier
|
|
913
|
+
) {
|
|
914
|
+
return (await this.makeShowMoreFoldedResults(info, identifier)).log({
|
|
915
|
+
searchUID: this.provider.getSearchUID(),
|
|
916
|
+
});
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
public makeShowLessFoldedResults() {
|
|
920
|
+
return this.makeCustomEvent(SearchPageEvents.showLessFoldedResults);
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
public async logShowLessFoldedResults() {
|
|
924
|
+
return (await this.makeShowLessFoldedResults()).log({
|
|
925
|
+
searchUID: this.provider.getSearchUID(),
|
|
926
|
+
});
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
private makeEventDescription(
|
|
930
|
+
preparedEvent: PreparedEvent<unknown, unknown, AnyEventResponse>,
|
|
931
|
+
actionCause: SearchPageEvents
|
|
932
|
+
): EventDescription {
|
|
933
|
+
return {actionCause, customData: preparedEvent.payload?.customData};
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
public async makeCustomEvent(
|
|
937
|
+
event: SearchPageEvents,
|
|
938
|
+
metadata?: Record<string, any>,
|
|
939
|
+
eventType: string = CustomEventsTypes[event]!
|
|
940
|
+
): Promise<EventBuilder<CustomEventResponse>> {
|
|
941
|
+
this.coveoAnalyticsClient.getParameters;
|
|
942
|
+
const customData = {...this.provider.getBaseMetadata(), ...metadata};
|
|
943
|
+
const request: CustomEventRequest = {
|
|
944
|
+
...(await this.getBaseEventRequest(customData)),
|
|
945
|
+
eventType,
|
|
946
|
+
eventValue: event,
|
|
947
|
+
};
|
|
948
|
+
const preparedEvent = await this.coveoAnalyticsClient.makeCustomEvent(request);
|
|
949
|
+
return {
|
|
950
|
+
description: this.makeEventDescription(preparedEvent, event),
|
|
951
|
+
log: ({searchUID}) => preparedEvent.log({lastSearchQueryUid: searchUID}),
|
|
952
|
+
};
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
public async logCustomEvent(
|
|
956
|
+
event: SearchPageEvents,
|
|
957
|
+
metadata?: Record<string, any>,
|
|
958
|
+
eventType: string = CustomEventsTypes[event]!
|
|
959
|
+
) {
|
|
960
|
+
return (await this.makeCustomEvent(event, metadata, eventType)).log({
|
|
961
|
+
searchUID: this.provider.getSearchUID(),
|
|
962
|
+
});
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
public async makeCustomEventWithType(
|
|
966
|
+
eventValue: string,
|
|
967
|
+
eventType: string,
|
|
968
|
+
metadata?: Record<string, any>
|
|
969
|
+
): Promise<EventBuilder<CustomEventResponse>> {
|
|
970
|
+
const customData = {...this.provider.getBaseMetadata(), ...metadata};
|
|
971
|
+
const payload: CustomEventRequest = {
|
|
972
|
+
...(await this.getBaseEventRequest(customData)),
|
|
973
|
+
eventType,
|
|
974
|
+
eventValue,
|
|
975
|
+
};
|
|
976
|
+
const preparedEvent = await this.coveoAnalyticsClient.makeCustomEvent(payload);
|
|
977
|
+
return {
|
|
978
|
+
description: this.makeEventDescription(preparedEvent, eventValue as SearchPageEvents),
|
|
979
|
+
log: ({searchUID}) => preparedEvent.log({lastSearchQueryUid: searchUID}),
|
|
980
|
+
};
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
public async logCustomEventWithType(
|
|
984
|
+
eventValue: string,
|
|
985
|
+
eventType: string,
|
|
986
|
+
metadata?: Record<string, any>
|
|
987
|
+
) {
|
|
988
|
+
return (await this.makeCustomEventWithType(eventValue, eventType, metadata)).log({
|
|
989
|
+
searchUID: this.provider.getSearchUID(),
|
|
990
|
+
});
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
public async logSearchEvent(event: SearchPageEvents, metadata?: Record<string, any>) {
|
|
994
|
+
return (await this.makeSearchEvent(event, metadata)).log({
|
|
995
|
+
searchUID: this.provider.getSearchUID(),
|
|
996
|
+
});
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
public async makeSearchEvent(
|
|
1000
|
+
event: SearchPageEvents,
|
|
1001
|
+
metadata?: Record<string, any>
|
|
1002
|
+
): Promise<EventBuilder<SearchEventResponse>> {
|
|
1003
|
+
const request = await this.getBaseSearchEventRequest(event, metadata);
|
|
1004
|
+
const preparedEvent = await this.coveoAnalyticsClient.makeSearchEvent(request);
|
|
1005
|
+
return {
|
|
1006
|
+
description: this.makeEventDescription(preparedEvent, event),
|
|
1007
|
+
log: ({searchUID}) => preparedEvent.log({searchQueryUid: searchUID}),
|
|
1008
|
+
};
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
public async makeClickEvent(
|
|
1012
|
+
event: SearchPageEvents,
|
|
1013
|
+
info: PartialDocumentInformation,
|
|
1014
|
+
identifier: DocumentIdentifier,
|
|
1015
|
+
metadata?: Record<string, any>
|
|
1016
|
+
): Promise<EventBuilder<ClickEventResponse>> {
|
|
1017
|
+
const request: PreparedClickEventRequest = {
|
|
1018
|
+
...info,
|
|
1019
|
+
...(await this.getBaseEventRequest({...identifier, ...metadata})),
|
|
1020
|
+
queryPipeline: this.provider.getPipeline(),
|
|
1021
|
+
actionCause: event,
|
|
1022
|
+
};
|
|
1023
|
+
const preparedEvent = await this.coveoAnalyticsClient.makeClickEvent(request);
|
|
1024
|
+
return {
|
|
1025
|
+
description: this.makeEventDescription(preparedEvent, event),
|
|
1026
|
+
log: ({searchUID}) => preparedEvent.log({searchQueryUid: searchUID}),
|
|
1027
|
+
};
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
public async logClickEvent(
|
|
1031
|
+
event: SearchPageEvents,
|
|
1032
|
+
info: PartialDocumentInformation,
|
|
1033
|
+
identifier: DocumentIdentifier,
|
|
1034
|
+
metadata?: Record<string, any>
|
|
1035
|
+
) {
|
|
1036
|
+
return (await this.makeClickEvent(event, info, identifier, metadata)).log({
|
|
1037
|
+
searchUID: this.provider.getSearchUID(),
|
|
1038
|
+
});
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
private async getBaseSearchEventRequest(
|
|
1042
|
+
event: SearchPageEvents,
|
|
1043
|
+
metadata?: Record<string, any>
|
|
1044
|
+
): Promise<PreparedSearchEventRequest> {
|
|
1045
|
+
return {
|
|
1046
|
+
...(await this.getBaseEventRequest({
|
|
1047
|
+
...metadata,
|
|
1048
|
+
...this.provider.getGeneratedAnswerMetadata?.(),
|
|
1049
|
+
})),
|
|
1050
|
+
...this.provider.getSearchEventRequestPayload(),
|
|
1051
|
+
queryPipeline: this.provider.getPipeline(),
|
|
1052
|
+
actionCause: event,
|
|
1053
|
+
};
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
private async getBaseEventRequest(metadata?: Record<string, any>) {
|
|
1057
|
+
const customData = {...this.provider.getBaseMetadata(), ...metadata};
|
|
1058
|
+
return {
|
|
1059
|
+
...this.getOrigins(),
|
|
1060
|
+
...this.getSplitTestRun(),
|
|
1061
|
+
customData,
|
|
1062
|
+
language: this.provider.getLanguage(),
|
|
1063
|
+
facetState: this.provider.getFacetState ? this.provider.getFacetState() : [],
|
|
1064
|
+
anonymous: this.provider.getIsAnonymous(),
|
|
1065
|
+
clientId: await this.getClientId(),
|
|
1066
|
+
};
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
private getOrigins() {
|
|
1070
|
+
return {
|
|
1071
|
+
originContext: this.provider.getOriginContext?.(),
|
|
1072
|
+
originLevel1: this.provider.getOriginLevel1(),
|
|
1073
|
+
originLevel2: this.provider.getOriginLevel2(),
|
|
1074
|
+
originLevel3: this.provider.getOriginLevel3(),
|
|
1075
|
+
};
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
private getClientId() {
|
|
1079
|
+
return this.coveoAnalyticsClient instanceof CoveoAnalyticsClient
|
|
1080
|
+
? this.coveoAnalyticsClient.getCurrentVisitorId()
|
|
1081
|
+
: undefined;
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
private getSplitTestRun() {
|
|
1085
|
+
const splitTestRunName = this.provider.getSplitTestRunName
|
|
1086
|
+
? this.provider.getSplitTestRunName()
|
|
1087
|
+
: '';
|
|
1088
|
+
const splitTestRunVersion = this.provider.getSplitTestRunVersion
|
|
1089
|
+
? this.provider.getSplitTestRunVersion()
|
|
1090
|
+
: '';
|
|
1091
|
+
return {
|
|
1092
|
+
...(splitTestRunName && {splitTestRunName}),
|
|
1093
|
+
...(splitTestRunVersion && {splitTestRunVersion}),
|
|
1094
|
+
};
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
public makeLikeGeneratedAnswer(metadata: GeneratedAnswerBaseMeta) {
|
|
1098
|
+
return this.makeCustomEvent(SearchPageEvents.likeGeneratedAnswer, metadata);
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
public async logLikeGeneratedAnswer(metadata: GeneratedAnswerBaseMeta) {
|
|
1102
|
+
return (await this.makeLikeGeneratedAnswer(metadata)).log({
|
|
1103
|
+
searchUID: this.provider.getSearchUID(),
|
|
1104
|
+
});
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
public makeDislikeGeneratedAnswer(metadata: GeneratedAnswerBaseMeta) {
|
|
1108
|
+
return this.makeCustomEvent(SearchPageEvents.dislikeGeneratedAnswer, metadata);
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
public async logDislikeGeneratedAnswer(metadata: GeneratedAnswerBaseMeta) {
|
|
1112
|
+
return (await this.makeDislikeGeneratedAnswer(metadata)).log({
|
|
1113
|
+
searchUID: this.provider.getSearchUID(),
|
|
1114
|
+
});
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
public makeOpenGeneratedAnswerSource(metadata: GeneratedAnswerCitationMeta) {
|
|
1118
|
+
return this.makeCustomEvent(SearchPageEvents.openGeneratedAnswerSource, metadata);
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
public async logOpenGeneratedAnswerSource(metadata: GeneratedAnswerCitationMeta) {
|
|
1122
|
+
return (await this.makeOpenGeneratedAnswerSource(metadata)).log({
|
|
1123
|
+
searchUID: this.provider.getSearchUID(),
|
|
1124
|
+
});
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
public makeGeneratedAnswerOpenInlineLink(metadata: GeneratedAnswerInlineLinkMeta) {
|
|
1128
|
+
return this.makeCustomEvent(SearchPageEvents.generatedAnswerOpenInlineLink, metadata);
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
public async logGeneratedAnswerOpenInlineLink(metadata: GeneratedAnswerInlineLinkMeta) {
|
|
1132
|
+
return (await this.makeGeneratedAnswerOpenInlineLink(metadata)).log({
|
|
1133
|
+
searchUID: this.provider.getSearchUID(),
|
|
1134
|
+
});
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
public makeGeneratedAnswerCitationClick(
|
|
1138
|
+
info: PartialDocumentInformation,
|
|
1139
|
+
citation: GeneratedAnswerCitationClickMeta
|
|
1140
|
+
) {
|
|
1141
|
+
return this.makeClickEvent(
|
|
1142
|
+
SearchPageEvents.generatedAnswerCitationClick,
|
|
1143
|
+
{...info, documentPosition: 1},
|
|
1144
|
+
{
|
|
1145
|
+
contentIDKey: citation.documentId.contentIdKey,
|
|
1146
|
+
contentIDValue: citation.documentId.contentIdValue,
|
|
1147
|
+
},
|
|
1148
|
+
citation
|
|
1149
|
+
);
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
public async logGeneratedAnswerCitationClick(
|
|
1153
|
+
info: PartialDocumentInformation,
|
|
1154
|
+
citation: GeneratedAnswerCitationClickMeta
|
|
1155
|
+
) {
|
|
1156
|
+
return (await this.makeGeneratedAnswerCitationClick(info, citation)).log({
|
|
1157
|
+
searchUID: this.provider.getSearchUID(),
|
|
1158
|
+
});
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
public makeGeneratedAnswerFollowupOpenSource(metadata: GeneratedAnswerFollowupOpenSourceMeta) {
|
|
1162
|
+
return this.makeCustomEvent(SearchPageEvents.generatedAnswerFollowupOpenSource, metadata);
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
public async logGeneratedAnswerFollowupOpenSource(
|
|
1166
|
+
metadata: GeneratedAnswerFollowupOpenSourceMeta
|
|
1167
|
+
) {
|
|
1168
|
+
return (await this.makeGeneratedAnswerFollowupOpenSource(metadata)).log({
|
|
1169
|
+
searchUID: this.provider.getSearchUID(),
|
|
1170
|
+
});
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
public makeGeneratedAnswerSourceHover(metadata: GeneratedAnswerSourceHoverMeta) {
|
|
1174
|
+
return this.makeCustomEvent(SearchPageEvents.generatedAnswerSourceHover, metadata);
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
public async logGeneratedAnswerSourceHover(metadata: GeneratedAnswerSourceHoverMeta) {
|
|
1178
|
+
return (await this.makeGeneratedAnswerSourceHover(metadata)).log({
|
|
1179
|
+
searchUID: this.provider.getSearchUID(),
|
|
1180
|
+
});
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1183
|
+
public makeGeneratedAnswerCopyToClipboard(metadata: GeneratedAnswerBaseMeta) {
|
|
1184
|
+
return this.makeCustomEvent(SearchPageEvents.generatedAnswerCopyToClipboard, metadata);
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
public async logGeneratedAnswerCopyToClipboard(metadata: GeneratedAnswerBaseMeta) {
|
|
1188
|
+
return (await this.makeGeneratedAnswerCopyToClipboard(metadata)).log({
|
|
1189
|
+
searchUID: this.provider.getSearchUID(),
|
|
1190
|
+
});
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
public makeGeneratedAnswerHideAnswers(metadata: GeneratedAnswerBaseMeta) {
|
|
1194
|
+
return this.makeCustomEvent(SearchPageEvents.generatedAnswerHideAnswers, metadata);
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
public async logGeneratedAnswerHideAnswers(metadata: GeneratedAnswerBaseMeta) {
|
|
1198
|
+
return (await this.makeGeneratedAnswerHideAnswers(metadata)).log({
|
|
1199
|
+
searchUID: this.provider.getSearchUID(),
|
|
1200
|
+
});
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
public makeGeneratedAnswerShowAnswers(metadata: GeneratedAnswerBaseMeta) {
|
|
1204
|
+
return this.makeCustomEvent(SearchPageEvents.generatedAnswerShowAnswers, metadata);
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
public async logGeneratedAnswerShowAnswers(metadata: GeneratedAnswerBaseMeta) {
|
|
1208
|
+
return (await this.makeGeneratedAnswerShowAnswers(metadata)).log({
|
|
1209
|
+
searchUID: this.provider.getSearchUID(),
|
|
1210
|
+
});
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
public makeGeneratedAnswerExpand(metadata: GeneratedAnswerBaseMeta) {
|
|
1214
|
+
return this.makeCustomEvent(SearchPageEvents.generatedAnswerExpand, metadata);
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
public async logGeneratedAnswerExpand(metadata: GeneratedAnswerBaseMeta) {
|
|
1218
|
+
return (await this.makeGeneratedAnswerExpand(metadata)).log({
|
|
1219
|
+
searchUID: this.provider.getSearchUID(),
|
|
1220
|
+
});
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
public makeGeneratedAnswerCollapse(metadata: GeneratedAnswerBaseMeta) {
|
|
1224
|
+
return this.makeCustomEvent(SearchPageEvents.generatedAnswerCollapse, metadata);
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
public async logGeneratedAnswerCollapse(metadata: GeneratedAnswerBaseMeta) {
|
|
1228
|
+
return (await this.makeGeneratedAnswerCollapse(metadata)).log({
|
|
1229
|
+
searchUID: this.provider.getSearchUID(),
|
|
1230
|
+
});
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
public makeGeneratedAnswerFeedbackSubmit(meta: GeneratedAnswerFeedbackMeta) {
|
|
1234
|
+
return this.makeCustomEvent(SearchPageEvents.generatedAnswerFeedbackSubmit, meta);
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
public async logGeneratedAnswerFeedbackSubmit(meta: GeneratedAnswerFeedbackMeta) {
|
|
1238
|
+
return (await this.makeGeneratedAnswerFeedbackSubmit(meta)).log({
|
|
1239
|
+
searchUID: this.provider.getSearchUID(),
|
|
1240
|
+
});
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
public makeGeneratedAnswerFeedbackSubmitV2(metadata: GeneratedAnswerBaseMeta) {
|
|
1244
|
+
return this.makeCustomEvent(SearchPageEvents.generatedAnswerFeedbackSubmitV2, metadata);
|
|
1245
|
+
}
|
|
1246
|
+
public async logGeneratedAnswerFeedbackSubmitV2(meta: GeneratedAnswerFeedbackMetaV2) {
|
|
1247
|
+
return (await this.makeGeneratedAnswerFeedbackSubmitV2(meta)).log({
|
|
1248
|
+
searchUID: this.provider.getSearchUID(),
|
|
1249
|
+
});
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
public makeRephraseGeneratedAnswer(meta: GeneratedAnswerRephraseMeta) {
|
|
1253
|
+
return this.makeSearchEvent(SearchPageEvents.rephraseGeneratedAnswer, meta);
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
public async logRephraseGeneratedAnswer(meta: GeneratedAnswerRephraseMeta) {
|
|
1257
|
+
return (await this.makeRephraseGeneratedAnswer(meta)).log({
|
|
1258
|
+
searchUID: this.provider.getSearchUID(),
|
|
1259
|
+
});
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
public makeRetryGeneratedAnswer() {
|
|
1263
|
+
return this.makeSearchEvent(SearchPageEvents.retryGeneratedAnswer);
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
public async logRetryGeneratedAnswer() {
|
|
1267
|
+
return (await this.makeRetryGeneratedAnswer()).log({
|
|
1268
|
+
searchUID: this.provider.getSearchUID(),
|
|
1269
|
+
});
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
public makeGeneratedAnswerStreamEnd(metadata: GeneratedAnswerStreamEndMeta) {
|
|
1273
|
+
return this.makeCustomEvent(SearchPageEvents.generatedAnswerStreamEnd, metadata);
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
public async logGeneratedAnswerStreamEnd(metadata: GeneratedAnswerStreamEndMeta) {
|
|
1277
|
+
return (await this.makeGeneratedAnswerStreamEnd(metadata)).log({
|
|
1278
|
+
searchUID: this.provider.getSearchUID(),
|
|
1279
|
+
});
|
|
1280
|
+
}
|
|
1060
1281
|
}
|