@coveo/relay-event-types 7.2.0 → 7.4.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": "7.2.0",
3
+ "version": "7.4.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",
@@ -23,64 +23,6 @@ interface DocumentSuggestion {
23
23
  responseId: string;
24
24
  }
25
25
 
26
- /**
27
- * The ecCartAction event is emitted when a user adds or removes a product from the cart or changes a product's quantity.
28
- */
29
- export interface EcCartAction extends Base {
30
- /**
31
- * Specifies the action. Use "add" to increase quantity and "remove" to decrease it.
32
- */
33
- action: "add" | "remove";
34
- currency: CurrencyCodeISO4217;
35
- product: Product;
36
- /**
37
- * Represents the change in product quantity, not the total quantity. Can be decimal. Must be greater than 0.
38
- */
39
- quantity: number;
40
- }
41
-
42
- /**
43
- * The ecProductClick event is emitted when a user clicks a product, be it on a search page, listing page, or recommendation carousel.
44
- */
45
- export interface EcProductClick extends Base {
46
- /**
47
- * Indicates the product's position using a 1-based index. Maximum possible value is 32767.
48
- */
49
- position: number;
50
- /**
51
- * Response ID linked to the commerce API request that returned the clicked item.
52
- */
53
- responseId: UuidNotNull;
54
- currency: CurrencyCodeISO4217;
55
- product: Product;
56
- }
57
-
58
- /**
59
- * The ecProductView event is emitted when a user explores a product's details on a Product Detail Page (PDP) or previews the item in a modal from a Product Listing Page (PLP).
60
- */
61
- export interface EcProductView extends Base {
62
- currency: CurrencyCodeISO4217;
63
- product: Product;
64
- }
65
-
66
- /**
67
- * The ecPurchase event is emitted when the user completes a purchase.
68
- */
69
- export interface EcPurchase extends Base {
70
- currency: CurrencyCodeISO4217;
71
- products: ProductQuantity[];
72
- transaction: {
73
- /**
74
- * The transaction ID. You can use it to cross-reference any orders you've exported from Coveo against records in your own system.
75
- */
76
- id: string;
77
- /**
78
- * Total revenue from the transaction, including tax, shipping, and discounts.
79
- */
80
- revenue: number;
81
- };
82
- }
83
-
84
26
  interface Feedback {
85
27
  liked: boolean;
86
28
  /**
@@ -97,6 +39,10 @@ interface Feedback {
97
39
  * 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.
98
40
  */
99
41
  export interface ItemClick extends Base {
42
+ /**
43
+ * The type of operation that triggered this event.
44
+ */
45
+ actionCause?: "preview" | "open";
100
46
  /**
101
47
  * A unique identifier identifying the query made to a search system.
102
48
  */
@@ -315,4 +261,64 @@ export namespace CaseAssist {
315
261
  */
316
262
  fieldValue: string;
317
263
  }
264
+ }
265
+
266
+ export namespace Ec {
267
+ /**
268
+ * The ec.cartAction event is emitted when a user adds or removes a product from the cart or changes a product's quantity.
269
+ */
270
+ export interface CartAction extends Base {
271
+ /**
272
+ * Specifies the action. Use "add" to increase quantity and "remove" to decrease it.
273
+ */
274
+ action: "add" | "remove";
275
+ currency: CurrencyCodeISO4217;
276
+ product: Product;
277
+ /**
278
+ * Represents the change in product quantity, not the total quantity. Can be decimal. Must be greater than 0.
279
+ */
280
+ quantity: number;
281
+ }
282
+
283
+ /**
284
+ * The ec.productClick event is emitted when a user clicks a product, be it on a search page, listing page, or recommendation carousel.
285
+ */
286
+ export interface ProductClick extends Base {
287
+ /**
288
+ * Indicates the product's position using a 1-based index. Maximum possible value is 32767.
289
+ */
290
+ position: number;
291
+ /**
292
+ * Response ID linked to the commerce API request that returned the clicked item.
293
+ */
294
+ responseId: UuidNotNull;
295
+ currency: CurrencyCodeISO4217;
296
+ product: Product;
297
+ }
298
+
299
+ /**
300
+ * The ec.productView event is emitted when a user explores a product's details on a Product Detail Page (PDP) or previews the item in a modal from a Product Listing Page (PLP).
301
+ */
302
+ export interface ProductView extends Base {
303
+ currency: CurrencyCodeISO4217;
304
+ product: Product;
305
+ }
306
+
307
+ /**
308
+ * The ec.purchase event is emitted when the user completes a purchase.
309
+ */
310
+ export interface Purchase extends Base {
311
+ currency: CurrencyCodeISO4217;
312
+ products: ProductQuantity[];
313
+ transaction: {
314
+ /**
315
+ * The transaction ID. You can use it to cross-reference any orders you've exported from Coveo against records in your own system.
316
+ */
317
+ id: string;
318
+ /**
319
+ * Total revenue from the transaction, including tax, shipping, and discounts.
320
+ */
321
+ revenue: number;
322
+ };
323
+ }
318
324
  }