@coveo/relay-event-types 10.1.3 → 11.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coveo/relay-event-types",
3
- "version": "10.1.3",
3
+ "version": "11.0.0",
4
4
  "description": "Typescript types for Coveo Events, intended to be used with the Relay package.",
5
5
  "types": "./relay-event-types.d.ts",
6
6
  "author": "Coveo",
@@ -27,14 +27,6 @@ interface BaseItemClick extends Base {
27
27
  itemMetadata: ItemMetaData;
28
28
  }
29
29
 
30
- /**
31
- * A document suggestion.
32
- */
33
- interface DocumentSuggestion {
34
- id: string;
35
- responseId: string;
36
- }
37
-
38
30
  /**
39
31
  * Represents the Coveo Analytics Item Click Event. Use this schema when sending data related to a user's click on an item returned by Coveo.
40
32
  */
@@ -94,28 +86,6 @@ interface ProductQuantity {
94
86
  quantity: number;
95
87
  }
96
88
 
97
- interface QnaAnswer {
98
- /**
99
- * The id of the response associated with the service that delivered the answer (e.g. for the Search API, that would be `searchUid`).
100
- */
101
- responseId: string;
102
- /**
103
- * The type of the answer.
104
- */
105
- type: "SmartSnippet" | "SmartSnippetSuggestion" | "RGA";
106
- }
107
-
108
- interface QnaCitation {
109
- /**
110
- * The citation id. This value needs to match the unique identifier of the answer's citation.
111
- */
112
- id: string;
113
- /**
114
- * The type of the citation.
115
- */
116
- type: "Source" | "InlineLink";
117
- }
118
-
119
89
  /**
120
90
  * A support ticket.
121
91
  */
@@ -164,14 +134,26 @@ export namespace CaseAssist {
164
134
  * The caseAssist.documentSuggestionClick event is emitted when a user clicks on a Case Assist document suggestion.
165
135
  */
166
136
  export interface DocumentSuggestionClick extends Base {
167
- documentSuggestion: DocumentSuggestion;
137
+ /**
138
+ * Response ID linked to the Case Assist API request that returned the clicked suggestion.
139
+ */
140
+ responseId: UuidNotNull;
141
+ /**
142
+ * Indicates the clicked suggestion's 1-based position within the returned results.
143
+ */
144
+ position: number;
145
+ itemMetadata: ItemMetaData;
168
146
  }
169
147
 
170
148
  /**
171
149
  * The caseAssist.documentSuggestionFeedback event is emitted when a user gives feedback on a Case Assist document suggestion.
172
150
  */
173
151
  export interface DocumentSuggestionFeedback extends Base {
174
- documentSuggestion: DocumentSuggestion;
152
+ /**
153
+ * Response ID linked to the Case Assist API request that returned the document suggestion.
154
+ */
155
+ responseId: UuidNotNull;
156
+ itemMetadata: ItemMetaData;
175
157
  /**
176
158
  * Whether the user liked the document suggestion or not.
177
159
  */
@@ -182,16 +164,14 @@ export namespace CaseAssist {
182
164
  * The caseAssist.selectFieldClassification event is emitted when a user selects a Case Assist field recommendation.
183
165
  */
184
166
  export interface SelectFieldClassification extends Base {
185
- fieldClassification: {
186
- /**
187
- * The unique identifier of the field classification.
188
- */
189
- id: string;
190
- /**
191
- * The unique identifier of the response that contains the field classification.
192
- */
193
- responseId: string;
194
- };
167
+ /**
168
+ * The unique identifier of the response that contains the field classification.
169
+ */
170
+ responseId: string;
171
+ /**
172
+ * The unique identifier of the field classification.
173
+ */
174
+ classificationId: string;
195
175
  /**
196
176
  * Whether the field classification was automatically selected by Coveo Case Assist.
197
177
  */
@@ -348,46 +328,84 @@ export namespace InsightPanel {
348
328
  }
349
329
  }
350
330
 
351
- export namespace Qna {
331
+ export namespace Rga {
352
332
  /**
353
- * Event to emit when interacting with a Q&A answer.
333
+ * Event to emit when interacting with a generated answer.
354
334
  */
355
335
  export interface AnswerAction extends Base {
356
- answer: QnaAnswer;
336
+ /**
337
+ * The id of the response associated with the service that delivered the answer.
338
+ */
339
+ responseId: string;
340
+ /**
341
+ * The action taken on the answer.
342
+ */
357
343
  action: "copyToClipboard" | "hide" | "show" | "expand" | "collapse" | "like" | "dislike";
358
344
  }
359
345
 
360
346
  /**
361
- * Event to emit when a Q&A answer citation item has been clicked.
347
+ * Event to emit when a generated answer citation item has been clicked.
362
348
  */
363
349
  export interface CitationClick extends Base {
364
- answer: QnaAnswer;
365
- citation: QnaCitation;
350
+ /**
351
+ * The id of the response associated with the service that delivered the answer.
352
+ */
353
+ responseId: string;
354
+ /**
355
+ * The citation id. This value needs to match the unique identifier of the answer's citation.
356
+ */
357
+ citationId: string;
358
+ itemMetadata: ItemMetaData;
366
359
  }
367
360
 
368
361
  /**
369
- * Event to emit when a Q&A answer citation has been hovered.
362
+ * Event to emit when a generated answer citation has been hovered.
370
363
  */
371
364
  export interface CitationHover extends Base {
372
- answer: QnaAnswer;
373
- citation: QnaCitation;
374
- citationHoverTimeInMs?: number;
365
+ /**
366
+ * The id of the response associated with the service that delivered the answer.
367
+ */
368
+ responseId: string;
369
+ /**
370
+ * The citation id. This value needs to match the unique identifier of the answer's citation.
371
+ */
372
+ citationId: string;
373
+ itemMetadata: ItemMetaData;
374
+ /**
375
+ * The time in milliseconds the citation was hovered.
376
+ */
377
+ citationHoverTimeInMs: number;
378
+ }
379
+
380
+ /**
381
+ * Event to emit when a generated answer stream has ended.
382
+ */
383
+ export interface StreamEnd extends Base {
384
+ /**
385
+ * The id of the response associated with the service that delivered the answer.
386
+ */
387
+ responseId: string;
388
+ /**
389
+ * Indicates if the answer was generated or not.
390
+ */
391
+ answerGenerated: boolean;
375
392
  }
376
393
 
377
394
  /**
378
395
  * Event to emit when submitting feedback following the evaluation rubric for a generated answer.
379
396
  */
380
- export interface SubmitRgaFeedback extends Base {
381
- answer: {
382
- /**
383
- * The id of the response associated with the service that delivered the answer.
384
- */
385
- responseId: string;
386
- };
397
+ export interface SubmitFeedback extends Base {
398
+ /**
399
+ * The id of the response associated with the service that delivered the answer.
400
+ */
401
+ responseId: string;
387
402
  /**
388
403
  * Whether or not the answer is helpful.
389
404
  */
390
405
  helpful: boolean;
406
+ /**
407
+ * Details about the evaluation of the answer.
408
+ */
391
409
  details: {
392
410
  /**
393
411
  * Whether or not the answer is clear and easy to read.
@@ -406,24 +424,69 @@ export namespace Qna {
406
424
  */
407
425
  hallucinationFree?: boolean;
408
426
  };
427
+ /**
428
+ * Additional notes about the evaluation.
429
+ */
409
430
  additionalNotes?: string;
431
+ /**
432
+ * The URL of the correct answer.
433
+ */
410
434
  correctAnswerUrl?: string;
411
435
  }
436
+ }
437
+
438
+ export namespace SmartSnippets {
439
+ /**
440
+ * Event to emit when interacting with a snippet.
441
+ */
442
+ export interface AnswerAction extends Base {
443
+ /**
444
+ * The id of the response associated with the service that delivered the snippet.
445
+ */
446
+ responseId: string;
447
+ /**
448
+ * The type of snippet the answer belongs to.
449
+ */
450
+ snippetType: "SmartSnippet" | "SmartSnippetSuggestion";
451
+ itemMetadata: ItemMetaData;
452
+ /**
453
+ * The action taken on the snippet.
454
+ */
455
+ action: "expand" | "collapse" | "like" | "dislike";
456
+ }
412
457
 
413
458
  /**
414
- * Event to emit when submitting the reason of a negative feedback for a Smart Snippet answer.
459
+ * Event to emit when a snippet source has been clicked.
415
460
  */
416
- export interface SubmitSmartSnippetFeedback extends Base {
417
- answer: {
418
- /**
419
- * The id of the response associated with the service that delivered the answer.
420
- */
421
- responseId: string;
422
- };
461
+ export interface SourceClick extends Base {
462
+ /**
463
+ * The id of the response associated with the service that delivered the snippet.
464
+ */
465
+ responseId: string;
466
+ /**
467
+ * The type of snippet the answer belongs to.
468
+ */
469
+ snippetType: "SmartSnippet" | "SmartSnippetSuggestion";
470
+ itemMetadata: ItemMetaData;
471
+ }
472
+
473
+ /**
474
+ * Event to emit when submitting the reason of a negative feedback on a snippet.
475
+ */
476
+ export interface SubmitFeedback extends Base {
477
+ /**
478
+ * The id of the response associated with the service that delivered the snippet.
479
+ */
480
+ responseId: string;
481
+ /**
482
+ * The type of snippet the answer belongs to.
483
+ */
484
+ snippetType: "SmartSnippet" | "SmartSnippetSuggestion";
485
+ itemMetadata: ItemMetaData;
423
486
  /**
424
487
  * The reason for the negative feedback.
425
488
  */
426
- reason: "irrelevant" | "notAccurate" | "outOfDate" | "harmful" | "other";
489
+ reason: "doesNotAnswer" | "partiallyAnswers" | "wasNotAQuestion" | "other";
427
490
  /**
428
491
  * Additional details written in free text.
429
492
  */