@coveo/relay-event-types 0.0.0 → 6.24.1

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,11 +1,25 @@
1
1
  {
2
2
  "name": "@coveo/relay-event-types",
3
- "version": "0.0.0",
4
- "description": "",
3
+ "version": "6.24.1",
4
+ "description": "Typescript types for Coveo Events, intended to be used with the Relay package.",
5
+ "types": "./relay-event-types.d.ts",
6
+ "author": "Coveo",
7
+ "license": "Apache-2.0",
8
+ "keywords": [
9
+ "Coveo",
10
+ "analytics",
11
+ "relay",
12
+ "event",
13
+ "types"
14
+ ],
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/coveo/analytics_schema.git"
21
+ },
5
22
  "scripts": {
6
23
  "test": "echo \"Error: no test specified\" && exit 1"
7
- },
8
- "keywords": [],
9
- "author": "",
10
- "license": "Apache-2.0"
24
+ }
11
25
  }
@@ -0,0 +1,161 @@
1
+ /**
2
+ * Copyright (c) Coveo Solutions Inc. These types are automatically generated. Do not modify manually!
3
+ */
4
+
5
+ /**
6
+ * List of supported currencies.
7
+ */
8
+ type CurrencyCodeISO4217 = "AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BRL" | "BSD" | "BTC" | "BTN" | "BWP" | "BYN" | "BZD" | "CAD" | "CDF" | "CHF" | "CLF" | "CLP" | "CNH" | "CNY" | "COP" | "CRC" | "CUC" | "CUP" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GGP" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "IMP" | "INR" | "IQD" | "IRR" | "ISK" | "JEP" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KPW" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LYD" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MRU" | "MUR" | "MVR" | "MWK" | "MXN" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SDG" | "SEK" | "SGD" | "SHP" | "SLL" | "SOS" | "SRD" | "SSP" | "STD" | "STN" | "SVC" | "SYP" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "UYU" | "UZS" | "VEF" | "VES" | "VND" | "VUV" | "WST" | "XAF" | "XAG" | "XAU" | "XCD" | "XDR" | "XOF" | "XPD" | "XPF" | "XPT" | "YER" | "ZAR" | "ZMW" | "ZWL";
9
+
10
+ /**
11
+ * A UUID which cannot be null.
12
+ */
13
+ type UuidNotNull = string;
14
+
15
+ interface Base {
16
+ }
17
+
18
+ /**
19
+ * The ecCartAction event is emitted when a user adds or removes a product from the cart or changes a product's quantity.
20
+ */
21
+ export interface EcCartAction extends Base {
22
+ /**
23
+ * Specifies the action. Use "add" to increase quantity and "remove" to decrease it.
24
+ */
25
+ action: "add" | "remove";
26
+ currency: CurrencyCodeISO4217;
27
+ product: Product;
28
+ /**
29
+ * Represents the change in product quantity, not the final amount.
30
+ */
31
+ quantity: number;
32
+ }
33
+
34
+ /**
35
+ * The ecProductClick event is emitted when a user clicks a product, be it on a search page, listing page, or recommendation carousel.
36
+ */
37
+ export interface EcProductClick extends Base {
38
+ /**
39
+ * Indicates the product's position using a 1-based index.
40
+ */
41
+ position: number;
42
+ /**
43
+ * Response ID linked to the commerce API request that returned the clicked item.
44
+ */
45
+ responseId: UuidNotNull;
46
+ currency: CurrencyCodeISO4217;
47
+ product: Product;
48
+ }
49
+
50
+ /**
51
+ * 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).
52
+ */
53
+ export interface EcProductView extends Base {
54
+ currency: CurrencyCodeISO4217;
55
+ product: Product;
56
+ }
57
+
58
+ /**
59
+ * The ecPurchase event is emitted when the user completes a purchase.
60
+ */
61
+ export interface EcPurchase extends Base {
62
+ currency: CurrencyCodeISO4217;
63
+ products: ProductQuantity[];
64
+ transaction: {
65
+ /**
66
+ * The transaction ID. You can use it to cross-reference any orders you've exported from Coveo against records in your own system.
67
+ */
68
+ id: string;
69
+ /**
70
+ * Total revenue from the transaction, including tax, shipping, and discounts.
71
+ */
72
+ revenue: number;
73
+ };
74
+ }
75
+
76
+ /**
77
+ * 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.
78
+ */
79
+ export interface ItemClick extends Base {
80
+ /**
81
+ * A unique identifier identifying the query made to a search system.
82
+ */
83
+ searchUid: string;
84
+ position: number;
85
+ itemMetadata: ItemMetaData;
86
+ }
87
+
88
+ interface ItemMetaData {
89
+ /**
90
+ * The index field name used to uniquely identify the item.
91
+ */
92
+ uniqueFieldName: string;
93
+ /**
94
+ * The index field value used to uniquely identify the item.
95
+ */
96
+ uniqueFieldValue: string;
97
+ /**
98
+ * The title of the clicked item.
99
+ */
100
+ title?: string;
101
+ /**
102
+ * The author of the clicked item.
103
+ */
104
+ author?: string;
105
+ /**
106
+ * The URL identifying the clicked item.
107
+ */
108
+ url?: string;
109
+ }
110
+
111
+ /**
112
+ * Represents the Coveo Analytics Item View Event. This should be sent when landing on a page dedicated to an item.
113
+ */
114
+ export interface ItemView extends Base {
115
+ itemMetadata: ItemMetaData;
116
+ }
117
+
118
+ interface Product {
119
+ /**
120
+ * A unique identifier for the product. The value must match the product id field configured in the catalog.
121
+ */
122
+ productId: string;
123
+ /**
124
+ * The product name.
125
+ */
126
+ name: string;
127
+ price: number;
128
+ }
129
+
130
+ interface ProductQuantity {
131
+ product: Product;
132
+ quantity: number;
133
+ }
134
+
135
+ /**
136
+ * Represents the Coveo Analytics Search Event. Send this schema exclusively when conducting A/B tests against a competitor's search solution.
137
+ */
138
+ export interface Search extends Base {
139
+ /**
140
+ * A unique identifier identifying the query made to a search system.
141
+ */
142
+ searchUid: string;
143
+ queryText: string;
144
+ numberOfResults?: number;
145
+ responseTimeInMs?: number;
146
+ }
147
+
148
+ interface User {
149
+ /**
150
+ * User ID serves as a unique identifier for the user. As the user performs actions, this is enriched on the resulting events. For authenticated users, this typically appears as their email address, making it easily readable.
151
+ */
152
+ id: string;
153
+ }
154
+
155
+ /**
156
+ * Represents the Coveo Analytics User Login Event. This should be sent when a user logs in to a website.
157
+ */
158
+ export interface UserLogin extends Base {
159
+ user: User;
160
+ }
161
+