@algolia/client-analytics 5.7.0 → 5.8.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.
Files changed (55) hide show
  1. package/README.md +5 -6
  2. package/dist/browser.d.ts +825 -834
  3. package/dist/builds/browser.js +144 -168
  4. package/dist/builds/browser.js.map +1 -1
  5. package/dist/builds/browser.min.js +1 -1
  6. package/dist/builds/browser.min.js.map +1 -1
  7. package/dist/builds/browser.umd.js +3 -3
  8. package/dist/builds/fetch.js +141 -165
  9. package/dist/builds/fetch.js.map +1 -1
  10. package/dist/builds/node.cjs +141 -165
  11. package/dist/builds/node.cjs.map +1 -1
  12. package/dist/builds/node.js +142 -166
  13. package/dist/builds/node.js.map +1 -1
  14. package/dist/fetch.d.ts +824 -832
  15. package/dist/node.d.cts +824 -832
  16. package/dist/node.d.ts +824 -832
  17. package/dist/src/analyticsClient.cjs +140 -164
  18. package/dist/src/analyticsClient.cjs.map +1 -1
  19. package/dist/src/analyticsClient.js +140 -164
  20. package/dist/src/analyticsClient.js.map +1 -1
  21. package/index.js +1 -1
  22. package/model/clickPosition.ts +1 -1
  23. package/model/clientMethodProps.ts +23 -22
  24. package/model/dailyRevenue.ts +1 -1
  25. package/model/getAddToCartRateResponse.ts +1 -1
  26. package/model/getAverageClickPositionResponse.ts +1 -1
  27. package/model/getClickPositionsResponse.ts +1 -1
  28. package/model/getClickThroughRateResponse.ts +1 -1
  29. package/model/getConversionRateResponse.ts +1 -1
  30. package/model/getNoClickRateResponse.ts +1 -1
  31. package/model/getNoResultsRateResponse.ts +1 -1
  32. package/model/getPurchaseRateResponse.ts +1 -1
  33. package/model/getRevenue.ts +2 -2
  34. package/model/getSearchesCountResponse.ts +1 -1
  35. package/model/getSearchesNoClicksResponse.ts +1 -1
  36. package/model/getSearchesNoResultsResponse.ts +1 -1
  37. package/model/getTopCountriesResponse.ts +1 -1
  38. package/model/getTopFilterAttributesResponse.ts +1 -1
  39. package/model/getTopFilterForAttributeResponse.ts +1 -1
  40. package/model/getTopFiltersNoResultsResponse.ts +1 -1
  41. package/model/getTopFiltersNoResultsValues.ts +1 -1
  42. package/model/getUsersCountResponse.ts +1 -1
  43. package/model/index.ts +5 -5
  44. package/model/operator.ts +1 -1
  45. package/model/orderBy.ts +1 -1
  46. package/model/topHitWithRevenueAnalytics.ts +1 -1
  47. package/model/topHitsResponse.ts +1 -1
  48. package/model/topHitsResponseWithAnalytics.ts +1 -1
  49. package/model/topHitsResponseWithRevenueAnalytics.ts +1 -1
  50. package/model/topSearchWithAnalytics.ts +1 -1
  51. package/model/topSearchWithRevenueAnalytics.ts +2 -2
  52. package/model/topSearchesResponse.ts +1 -1
  53. package/model/topSearchesResponseWithAnalytics.ts +1 -1
  54. package/model/topSearchesResponseWithRevenueAnalytics.ts +1 -1
  55. package/package.json +6 -6
package/dist/node.d.cts CHANGED
@@ -1,1355 +1,1371 @@
1
1
  import * as _algolia_client_common from '@algolia/client-common';
2
2
  import { CreateClientOptions, RequestOptions, ClientOptions } from '@algolia/client-common';
3
3
 
4
- type Direction = 'asc' | 'desc';
5
-
6
- /**
7
- * Attribute by which to order the response items. If the `clickAnalytics` parameter is false, only `searchCount` is available.
8
- */
9
- type OrderBy = 'averageClickPosition' | 'clickThroughRate' | 'conversionRate' | 'searchCount';
10
-
11
- /**
12
- * Properties for the `customDelete` method.
13
- */
14
- type CustomDeleteProps = {
4
+ type DailyAddToCartRates = {
15
5
  /**
16
- * Path of the endpoint, anything after \"/1\" must be specified.
6
+ * Add-to-cart rate, calculated as number of tracked searches with at least one add-to-cart event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
17
7
  */
18
- path: string;
8
+ rate: number | null;
19
9
  /**
20
- * Query parameters to apply to the current query.
10
+ * Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
21
11
  */
22
- parameters?: Record<string, any>;
23
- };
24
- /**
25
- * Properties for the `customGet` method.
26
- */
27
- type CustomGetProps = {
12
+ trackedSearchCount: number;
28
13
  /**
29
- * Path of the endpoint, anything after \"/1\" must be specified.
14
+ * Number of add-to-cart events from this search.
30
15
  */
31
- path: string;
16
+ addToCartCount: number;
32
17
  /**
33
- * Query parameters to apply to the current query.
18
+ * Date in the format YYYY-MM-DD.
34
19
  */
35
- parameters?: Record<string, any>;
20
+ date: string;
36
21
  };
37
- /**
38
- * Properties for the `customPost` method.
39
- */
40
- type CustomPostProps = {
22
+
23
+ type GetAddToCartRateResponse = {
41
24
  /**
42
- * Path of the endpoint, anything after \"/1\" must be specified.
25
+ * Add-to-cart rate, calculated as number of tracked searches with at least one add-to-cart event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
43
26
  */
44
- path: string;
27
+ rate: number | null;
45
28
  /**
46
- * Query parameters to apply to the current query.
29
+ * Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
47
30
  */
48
- parameters?: Record<string, any>;
31
+ trackedSearchCount: number;
49
32
  /**
50
- * Parameters to send with the custom request.
33
+ * Number of add-to-cart events from this search.
51
34
  */
52
- body?: Record<string, unknown>;
53
- };
54
- /**
55
- * Properties for the `customPut` method.
56
- */
57
- type CustomPutProps = {
35
+ addToCartCount: number;
58
36
  /**
59
- * Path of the endpoint, anything after \"/1\" must be specified.
37
+ * Daily add-to-cart rates.
60
38
  */
61
- path: string;
39
+ dates: Array<DailyAddToCartRates>;
40
+ };
41
+
42
+ type DailyAverageClicks = {
62
43
  /**
63
- * Query parameters to apply to the current query.
44
+ * Average position of a clicked search result in the list of search results. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
64
45
  */
65
- parameters?: Record<string, any>;
46
+ average: number | null;
66
47
  /**
67
- * Parameters to send with the custom request.
48
+ * Number of clicks associated with this search.
68
49
  */
69
- body?: Record<string, unknown>;
70
- };
71
- /**
72
- * Properties for the `getAddToCartRate` method.
73
- */
74
- type GetAddToCartRateProps = {
50
+ clickCount: number;
75
51
  /**
76
- * Index name.
52
+ * Date in the format YYYY-MM-DD.
77
53
  */
78
- index: string;
54
+ date: string;
55
+ };
56
+
57
+ type GetAverageClickPositionResponse = {
79
58
  /**
80
- * Start date of the period to analyze, in `YYYY-MM-DD` format.
59
+ * Average position of a clicked search result in the list of search results. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
81
60
  */
82
- startDate?: string;
61
+ average: number | null;
83
62
  /**
84
- * End date of the period to analyze, in `YYYY-MM-DD` format.
63
+ * Number of clicks associated with this search.
85
64
  */
86
- endDate?: string;
65
+ clickCount: number;
87
66
  /**
88
- * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
67
+ * Daily average click positions.
89
68
  */
90
- tags?: string;
69
+ dates: Array<DailyAverageClicks>;
91
70
  };
71
+
92
72
  /**
93
- * Properties for the `getAverageClickPosition` method.
73
+ * Click position.
94
74
  */
95
- type GetAverageClickPositionProps = {
96
- /**
97
- * Index name.
98
- */
99
- index: string;
75
+ type ClickPosition = {
100
76
  /**
101
- * Start date of the period to analyze, in `YYYY-MM-DD` format.
77
+ * Range of positions in the search results, using the pattern `[start,end]`. For positions 11 and up, click events are summed over the specified range. `-1` indicates the end of the list of search results.
102
78
  */
103
- startDate?: string;
79
+ position?: Array<number>;
104
80
  /**
105
- * End date of the period to analyze, in `YYYY-MM-DD` format.
81
+ * Number of times this search has been clicked at that position.
106
82
  */
107
- endDate?: string;
83
+ clickCount?: number;
84
+ };
85
+
86
+ type GetClickPositionsResponse = {
108
87
  /**
109
- * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
88
+ * List of positions in the search results and clicks associated with this search.
110
89
  */
111
- tags?: string;
90
+ positions: Array<ClickPosition>;
112
91
  };
113
- /**
114
- * Properties for the `getClickPositions` method.
115
- */
116
- type GetClickPositionsProps = {
92
+
93
+ type DailyClickThroughRates = {
117
94
  /**
118
- * Index name.
95
+ * Click-through rate, calculated as number of tracked searches with at least one click event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
119
96
  */
120
- index: string;
97
+ rate: number | null;
121
98
  /**
122
- * Start date of the period to analyze, in `YYYY-MM-DD` format.
99
+ * Number of clicks associated with this search.
123
100
  */
124
- startDate?: string;
101
+ clickCount: number;
125
102
  /**
126
- * End date of the period to analyze, in `YYYY-MM-DD` format.
103
+ * Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
127
104
  */
128
- endDate?: string;
105
+ trackedSearchCount: number;
129
106
  /**
130
- * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
107
+ * Date in the format YYYY-MM-DD.
131
108
  */
132
- tags?: string;
109
+ date: string;
133
110
  };
134
- /**
135
- * Properties for the `getClickThroughRate` method.
136
- */
137
- type GetClickThroughRateProps = {
111
+
112
+ type GetClickThroughRateResponse = {
138
113
  /**
139
- * Index name.
114
+ * Click-through rate, calculated as number of tracked searches with at least one click event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
140
115
  */
141
- index: string;
116
+ rate: number | null;
142
117
  /**
143
- * Start date of the period to analyze, in `YYYY-MM-DD` format.
118
+ * Number of clicks associated with this search.
144
119
  */
145
- startDate?: string;
120
+ clickCount: number;
146
121
  /**
147
- * End date of the period to analyze, in `YYYY-MM-DD` format.
122
+ * Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
148
123
  */
149
- endDate?: string;
124
+ trackedSearchCount: number;
150
125
  /**
151
- * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
126
+ * Daily click-through rates.
152
127
  */
153
- tags?: string;
128
+ dates: Array<DailyClickThroughRates>;
154
129
  };
155
- /**
156
- * Properties for the `getConversionRate` method.
157
- */
158
- type GetConversionRateProps = {
130
+
131
+ type DailyConversionRates = {
159
132
  /**
160
- * Index name.
133
+ * Conversion rate, calculated as number of tracked searches with at least one conversion event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
161
134
  */
162
- index: string;
135
+ rate: number | null;
163
136
  /**
164
- * Start date of the period to analyze, in `YYYY-MM-DD` format.
137
+ * Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
165
138
  */
166
- startDate?: string;
139
+ trackedSearchCount: number;
167
140
  /**
168
- * End date of the period to analyze, in `YYYY-MM-DD` format.
141
+ * Number of conversions from this search.
169
142
  */
170
- endDate?: string;
143
+ conversionCount: number;
171
144
  /**
172
- * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
145
+ * Date in the format YYYY-MM-DD.
173
146
  */
174
- tags?: string;
147
+ date: string;
175
148
  };
176
- /**
177
- * Properties for the `getNoClickRate` method.
178
- */
179
- type GetNoClickRateProps = {
149
+
150
+ type GetConversionRateResponse = {
180
151
  /**
181
- * Index name.
152
+ * Conversion rate, calculated as number of tracked searches with at least one conversion event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
182
153
  */
183
- index: string;
154
+ rate: number | null;
184
155
  /**
185
- * Start date of the period to analyze, in `YYYY-MM-DD` format.
156
+ * Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
186
157
  */
187
- startDate?: string;
158
+ trackedSearchCount: number;
188
159
  /**
189
- * End date of the period to analyze, in `YYYY-MM-DD` format.
160
+ * Number of conversions from this search.
190
161
  */
191
- endDate?: string;
162
+ conversionCount: number;
192
163
  /**
193
- * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
164
+ * Daily conversion rates.
194
165
  */
195
- tags?: string;
166
+ dates: Array<DailyConversionRates>;
196
167
  };
197
- /**
198
- * Properties for the `getNoResultsRate` method.
199
- */
200
- type GetNoResultsRateProps = {
168
+
169
+ type DailyNoClickRates = {
201
170
  /**
202
- * Index name.
171
+ * No click rate, calculated as number of tracked searches without any click divided by the number of tracked searches.
203
172
  */
204
- index: string;
173
+ rate: number;
205
174
  /**
206
- * Start date of the period to analyze, in `YYYY-MM-DD` format.
175
+ * Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
207
176
  */
208
- startDate?: string;
177
+ count: number;
209
178
  /**
210
- * End date of the period to analyze, in `YYYY-MM-DD` format.
179
+ * Number of times this search was returned as a result without any click.
211
180
  */
212
- endDate?: string;
181
+ noClickCount: number;
213
182
  /**
214
- * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
183
+ * Date in the format YYYY-MM-DD.
215
184
  */
216
- tags?: string;
185
+ date: string;
217
186
  };
218
- /**
219
- * Properties for the `getPurchaseRate` method.
220
- */
221
- type GetPurchaseRateProps = {
187
+
188
+ type GetNoClickRateResponse = {
222
189
  /**
223
- * Index name.
190
+ * No click rate, calculated as number of tracked searches without any click divided by the number of tracked searches.
224
191
  */
225
- index: string;
192
+ rate: number;
226
193
  /**
227
- * Start date of the period to analyze, in `YYYY-MM-DD` format.
194
+ * Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
228
195
  */
229
- startDate?: string;
196
+ count: number;
230
197
  /**
231
- * End date of the period to analyze, in `YYYY-MM-DD` format.
198
+ * Number of times this search was returned as a result without any click.
232
199
  */
233
- endDate?: string;
200
+ noClickCount: number;
234
201
  /**
235
- * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
202
+ * Daily no click rates.
236
203
  */
237
- tags?: string;
204
+ dates: Array<DailyNoClickRates>;
238
205
  };
239
- /**
240
- * Properties for the `getRevenue` method.
241
- */
242
- type GetRevenueProps = {
206
+
207
+ type DailyNoResultsRates = {
243
208
  /**
244
- * Index name.
209
+ * Date in the format YYYY-MM-DD.
245
210
  */
246
- index: string;
211
+ date: string;
247
212
  /**
248
- * Start date of the period to analyze, in `YYYY-MM-DD` format.
213
+ * Number of searches without any results.
249
214
  */
250
- startDate?: string;
215
+ noResultCount: number;
251
216
  /**
252
- * End date of the period to analyze, in `YYYY-MM-DD` format.
217
+ * Number of searches.
253
218
  */
254
- endDate?: string;
219
+ count: number;
255
220
  /**
256
- * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
221
+ * No results rate, calculated as number of searches with zero results divided by the total number of searches.
257
222
  */
258
- tags?: string;
223
+ rate: number;
259
224
  };
260
- /**
261
- * Properties for the `getSearchesCount` method.
262
- */
263
- type GetSearchesCountProps = {
225
+
226
+ type GetNoResultsRateResponse = {
264
227
  /**
265
- * Index name.
228
+ * No results rate, calculated as number of searches with zero results divided by the total number of searches.
266
229
  */
267
- index: string;
230
+ rate: number;
268
231
  /**
269
- * Start date of the period to analyze, in `YYYY-MM-DD` format.
232
+ * Number of searches.
270
233
  */
271
- startDate?: string;
234
+ count: number;
272
235
  /**
273
- * End date of the period to analyze, in `YYYY-MM-DD` format.
236
+ * Number of searches without any results.
274
237
  */
275
- endDate?: string;
238
+ noResultCount: number;
276
239
  /**
277
- * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
240
+ * Daily no results rates.
278
241
  */
279
- tags?: string;
242
+ dates: Array<DailyNoResultsRates>;
280
243
  };
281
- /**
282
- * Properties for the `getSearchesNoClicks` method.
283
- */
284
- type GetSearchesNoClicksProps = {
285
- /**
286
- * Index name.
287
- */
288
- index: string;
289
- /**
290
- * Start date of the period to analyze, in `YYYY-MM-DD` format.
291
- */
292
- startDate?: string;
244
+
245
+ type DailyPurchaseRates = {
293
246
  /**
294
- * End date of the period to analyze, in `YYYY-MM-DD` format.
247
+ * Purchase rate, calculated as number of tracked searches with at least one purchase event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
295
248
  */
296
- endDate?: string;
249
+ rate: number | null;
297
250
  /**
298
- * Number of items to return.
251
+ * Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
299
252
  */
300
- limit?: number;
253
+ trackedSearchCount: number;
301
254
  /**
302
- * Position of the first item to return.
255
+ * Number of purchase events from this search.
303
256
  */
304
- offset?: number;
257
+ purchaseCount: number;
305
258
  /**
306
- * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
259
+ * Date in the format YYYY-MM-DD.
307
260
  */
308
- tags?: string;
261
+ date: string;
309
262
  };
310
- /**
311
- * Properties for the `getSearchesNoResults` method.
312
- */
313
- type GetSearchesNoResultsProps = {
263
+
264
+ type GetPurchaseRateResponse = {
314
265
  /**
315
- * Index name.
266
+ * Purchase rate, calculated as number of tracked searches with at least one purchase event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
316
267
  */
317
- index: string;
268
+ rate: number | null;
318
269
  /**
319
- * Start date of the period to analyze, in `YYYY-MM-DD` format.
270
+ * Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
320
271
  */
321
- startDate?: string;
272
+ trackedSearchCount: number;
322
273
  /**
323
- * End date of the period to analyze, in `YYYY-MM-DD` format.
274
+ * Number of purchase events from this search.
324
275
  */
325
- endDate?: string;
276
+ purchaseCount: number;
326
277
  /**
327
- * Number of items to return.
278
+ * Daily purchase rates.
328
279
  */
329
- limit?: number;
280
+ dates: Array<DailyPurchaseRates>;
281
+ };
282
+
283
+ /**
284
+ * Currency code.
285
+ */
286
+ type CurrencyCode = {
330
287
  /**
331
- * Position of the first item to return.
288
+ * Currency code.
332
289
  */
333
- offset?: number;
290
+ currency?: string;
334
291
  /**
335
- * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
292
+ * Revenue associated with this search in this currency.
336
293
  */
337
- tags?: string;
294
+ revenue?: number;
338
295
  };
339
- /**
340
- * Properties for the `getStatus` method.
341
- */
342
- type GetStatusProps = {
296
+
297
+ type DailyRevenue = {
343
298
  /**
344
- * Index name.
299
+ * Revenue associated with this search, broken-down by currencies.
345
300
  */
346
- index: string;
301
+ currencies: {
302
+ [key: string]: CurrencyCode;
303
+ };
304
+ /**
305
+ * Date in the format YYYY-MM-DD.
306
+ */
307
+ date: string;
347
308
  };
348
- /**
349
- * Properties for the `getTopCountries` method.
350
- */
351
- type GetTopCountriesProps = {
309
+
310
+ type GetRevenue = {
352
311
  /**
353
- * Index name.
312
+ * Revenue associated with this search, broken-down by currencies.
354
313
  */
355
- index: string;
314
+ currencies: {
315
+ [key: string]: CurrencyCode;
316
+ };
356
317
  /**
357
- * Start date of the period to analyze, in `YYYY-MM-DD` format.
318
+ * Daily revenue.
358
319
  */
359
- startDate?: string;
320
+ dates: Array<DailyRevenue>;
321
+ };
322
+
323
+ type DailySearches = {
360
324
  /**
361
- * End date of the period to analyze, in `YYYY-MM-DD` format.
325
+ * Date in the format YYYY-MM-DD.
362
326
  */
363
- endDate?: string;
327
+ date: string;
364
328
  /**
365
- * Number of items to return.
329
+ * Number of occurrences.
366
330
  */
367
- limit?: number;
331
+ count: number;
332
+ };
333
+
334
+ type GetSearchesCountResponse = {
368
335
  /**
369
- * Position of the first item to return.
336
+ * Number of occurrences.
370
337
  */
371
- offset?: number;
338
+ count: number;
372
339
  /**
373
- * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
340
+ * Daily number of searches.
374
341
  */
375
- tags?: string;
342
+ dates: Array<DailySearches>;
376
343
  };
377
- /**
378
- * Properties for the `getTopFilterAttributes` method.
379
- */
380
- type GetTopFilterAttributesProps = {
344
+
345
+ type DailySearchesNoClicks = {
381
346
  /**
382
- * Index name.
347
+ * Search query.
383
348
  */
384
- index: string;
349
+ search: string;
385
350
  /**
386
- * Search query.
351
+ * Number of tracked searches.
387
352
  */
388
- search?: string;
353
+ count: number;
389
354
  /**
390
- * Start date of the period to analyze, in `YYYY-MM-DD` format.
355
+ * Number of results (hits).
391
356
  */
392
- startDate?: string;
357
+ nbHits: number;
358
+ };
359
+
360
+ type GetSearchesNoClicksResponse = {
393
361
  /**
394
- * End date of the period to analyze, in `YYYY-MM-DD` format.
362
+ * Searches without any clicks.
395
363
  */
396
- endDate?: string;
364
+ searches: Array<DailySearchesNoClicks>;
365
+ };
366
+
367
+ type DailySearchesNoResults = {
397
368
  /**
398
- * Number of items to return.
369
+ * Search query.
399
370
  */
400
- limit?: number;
371
+ search: string;
401
372
  /**
402
- * Position of the first item to return.
373
+ * Number of occurrences.
403
374
  */
404
- offset?: number;
375
+ count: number;
405
376
  /**
406
- * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
377
+ * Number of searches for this term with applied filters.
407
378
  */
408
- tags?: string;
379
+ withFilterCount: number;
409
380
  };
410
- /**
411
- * Properties for the `getTopFilterForAttribute` method.
412
- */
413
- type GetTopFilterForAttributeProps = {
381
+
382
+ type GetSearchesNoResultsResponse = {
414
383
  /**
415
- * Attribute name.
384
+ * Searches without results.
416
385
  */
417
- attribute: string;
386
+ searches: Array<DailySearchesNoResults>;
387
+ };
388
+
389
+ type GetStatusResponse = {
418
390
  /**
419
- * Index name.
391
+ * Date and time when the object was updated, in RFC 3339 format.
420
392
  */
421
- index: string;
393
+ updatedAt: string | null;
394
+ };
395
+
396
+ type TopCountry = {
422
397
  /**
423
- * Search query.
398
+ * Country code.
424
399
  */
425
- search?: string;
400
+ country: string;
426
401
  /**
427
- * Start date of the period to analyze, in `YYYY-MM-DD` format.
402
+ * Number of occurrences.
428
403
  */
429
- startDate?: string;
404
+ count: number;
405
+ };
406
+
407
+ type GetTopCountriesResponse = {
430
408
  /**
431
- * End date of the period to analyze, in `YYYY-MM-DD` format.
409
+ * Countries and number of searches.
432
410
  */
433
- endDate?: string;
411
+ countries: Array<TopCountry>;
412
+ };
413
+
414
+ type GetTopFilterAttribute = {
434
415
  /**
435
- * Number of items to return.
416
+ * Attribute name.
436
417
  */
437
- limit?: number;
418
+ attribute: string;
438
419
  /**
439
- * Position of the first item to return.
420
+ * Number of occurrences.
440
421
  */
441
- offset?: number;
422
+ count: number;
423
+ };
424
+
425
+ type GetTopFilterAttributesResponse = {
442
426
  /**
443
- * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
427
+ * Most frequent filters.
444
428
  */
445
- tags?: string;
429
+ attributes: Array<GetTopFilterAttribute>;
446
430
  };
431
+
447
432
  /**
448
- * Properties for the `getTopFiltersNoResults` method.
433
+ * Character that characterizes how the filter is applied. For example, for a facet filter `facet:value`, `:` is the operator. For a numeric filter `count>50`, `>` is the operator.
449
434
  */
450
- type GetTopFiltersNoResultsProps = {
435
+ type Operator = ':' | '<' | '<=' | '=' | '!=' | '>' | '>=';
436
+
437
+ type GetTopFilterForAttribute = {
451
438
  /**
452
- * Index name.
439
+ * Attribute name.
453
440
  */
454
- index: string;
441
+ attribute: string;
442
+ operator: Operator;
455
443
  /**
456
- * Search query.
444
+ * Attribute value.
457
445
  */
458
- search?: string;
446
+ value: string;
459
447
  /**
460
- * Start date of the period to analyze, in `YYYY-MM-DD` format.
448
+ * Number of occurrences.
461
449
  */
462
- startDate?: string;
450
+ count: number;
451
+ };
452
+
453
+ type GetTopFilterForAttributeResponse = {
463
454
  /**
464
- * End date of the period to analyze, in `YYYY-MM-DD` format.
455
+ * Filter values for an attribute.
465
456
  */
466
- endDate?: string;
457
+ values: Array<GetTopFilterForAttribute>;
458
+ };
459
+
460
+ type GetTopFiltersNoResultsValue = {
467
461
  /**
468
- * Number of items to return.
462
+ * Attribute name.
469
463
  */
470
- limit?: number;
464
+ attribute: string;
465
+ operator: Operator;
471
466
  /**
472
- * Position of the first item to return.
467
+ * Attribute value.
473
468
  */
474
- offset?: number;
469
+ value: string;
470
+ };
471
+
472
+ type GetTopFiltersNoResultsValues = {
475
473
  /**
476
- * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
474
+ * Number of occurrences.
477
475
  */
478
- tags?: string;
476
+ count: number;
477
+ /**
478
+ * Filters with no results.
479
+ */
480
+ values: Array<GetTopFiltersNoResultsValue>;
479
481
  };
480
- /**
481
- * Properties for the `getTopHits` method.
482
- */
483
- type GetTopHitsProps = {
482
+
483
+ type GetTopFiltersNoResultsResponse = {
484
484
  /**
485
- * Index name.
485
+ * Filters for searches without any results. If null, the search term specified with the `search` parameter is not a search without results, or the `search` parameter is absent from the request.
486
486
  */
487
- index: string;
487
+ values: Array<GetTopFiltersNoResultsValues> | null;
488
+ };
489
+
490
+ type TopHit = {
488
491
  /**
489
- * Search query.
492
+ * Object ID of a record that\'s returned as a search result.
490
493
  */
491
- search?: string;
494
+ hit: string;
492
495
  /**
493
- * Whether to include metrics related to click and conversion events in the response.
496
+ * Number of occurrences.
494
497
  */
495
- clickAnalytics?: boolean;
498
+ count: number;
499
+ };
500
+
501
+ type TopHitsResponse = {
496
502
  /**
497
- * Whether to include revenue-related metrics in the response. If true, metrics related to click and conversion events are also included in the response.
503
+ * Most frequent search results.
498
504
  */
499
- revenueAnalytics?: boolean;
505
+ hits: Array<TopHit>;
506
+ };
507
+
508
+ type TopHitWithAnalytics = {
500
509
  /**
501
- * Start date of the period to analyze, in `YYYY-MM-DD` format.
510
+ * Object ID of a record that\'s returned as a search result.
502
511
  */
503
- startDate?: string;
512
+ hit: string;
504
513
  /**
505
- * End date of the period to analyze, in `YYYY-MM-DD` format.
514
+ * Number of occurrences.
506
515
  */
507
- endDate?: string;
516
+ count: number;
508
517
  /**
509
- * Number of items to return.
518
+ * Click-through rate, calculated as number of tracked searches with at least one click event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
510
519
  */
511
- limit?: number;
520
+ clickThroughRate: number | null;
512
521
  /**
513
- * Position of the first item to return.
522
+ * Conversion rate, calculated as number of tracked searches with at least one conversion event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
514
523
  */
515
- offset?: number;
524
+ conversionRate: number | null;
516
525
  /**
517
- * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
526
+ * Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
518
527
  */
519
- tags?: string;
520
- };
521
- /**
522
- * Properties for the `getTopSearches` method.
523
- */
524
- type GetTopSearchesProps = {
528
+ trackedHitCount: number;
525
529
  /**
526
- * Index name.
530
+ * Number of clicks associated with this search.
527
531
  */
528
- index: string;
532
+ clickCount: number;
529
533
  /**
530
- * Whether to include metrics related to click and conversion events in the response.
534
+ * Number of conversions from this search.
531
535
  */
532
- clickAnalytics?: boolean;
536
+ conversionCount: number;
537
+ };
538
+
539
+ type TopHitsResponseWithAnalytics = {
533
540
  /**
534
- * Whether to include revenue-related metrics in the response. If true, metrics related to click and conversion events are also included in the response.
541
+ * Most frequent search results with click and conversion metrics.
535
542
  */
536
- revenueAnalytics?: boolean;
543
+ hits: Array<TopHitWithAnalytics>;
544
+ };
545
+
546
+ type TopHitWithRevenueAnalytics = {
537
547
  /**
538
- * Start date of the period to analyze, in `YYYY-MM-DD` format.
548
+ * Object ID of a record that\'s returned as a search result.
539
549
  */
540
- startDate?: string;
550
+ hit: string;
541
551
  /**
542
- * End date of the period to analyze, in `YYYY-MM-DD` format.
552
+ * Number of occurrences.
543
553
  */
544
- endDate?: string;
554
+ count: number;
545
555
  /**
546
- * Attribute by which to order the response items. If the `clickAnalytics` parameter is false, only `searchCount` is available.
556
+ * Click-through rate, calculated as number of tracked searches with at least one click event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
547
557
  */
548
- orderBy?: OrderBy;
558
+ clickThroughRate: number | null;
549
559
  /**
550
- * Sorting direction of the results: ascending or descending.
560
+ * Conversion rate, calculated as number of tracked searches with at least one conversion event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
551
561
  */
552
- direction?: Direction;
562
+ conversionRate: number | null;
553
563
  /**
554
- * Number of items to return.
564
+ * Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
555
565
  */
556
- limit?: number;
566
+ trackedHitCount: number;
557
567
  /**
558
- * Position of the first item to return.
568
+ * Number of clicks associated with this search.
559
569
  */
560
- offset?: number;
570
+ clickCount: number;
561
571
  /**
562
- * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
572
+ * Number of conversions from this search.
563
573
  */
564
- tags?: string;
565
- };
566
- /**
567
- * Properties for the `getUsersCount` method.
568
- */
569
- type GetUsersCountProps = {
574
+ conversionCount: number;
570
575
  /**
571
- * Index name.
576
+ * Add-to-cart rate, calculated as number of tracked searches with at least one add-to-cart event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
572
577
  */
573
- index: string;
578
+ addToCartRate: number | null;
574
579
  /**
575
- * Start date of the period to analyze, in `YYYY-MM-DD` format.
580
+ * Number of add-to-cart events from this search.
576
581
  */
577
- startDate?: string;
582
+ addToCartCount: number;
578
583
  /**
579
- * End date of the period to analyze, in `YYYY-MM-DD` format.
584
+ * Purchase rate, calculated as number of tracked searches with at least one purchase event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
580
585
  */
581
- endDate?: string;
586
+ purchaseRate: number | null;
582
587
  /**
583
- * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
588
+ * Number of purchase events from this search.
584
589
  */
585
- tags?: string;
590
+ purchaseCount: number;
591
+ /**
592
+ * Revenue associated with this search, broken-down by currencies.
593
+ */
594
+ currencies: {
595
+ [key: string]: CurrencyCode;
596
+ };
586
597
  };
587
598
 
588
- type DailyAddToCartRates = {
599
+ type TopHitsResponseWithRevenueAnalytics = {
589
600
  /**
590
- * Add-to-cart rate, calculated as number of tracked searches with at least one add-to-cart event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
601
+ * Most frequent search results with click, conversion, and revenue metrics.
591
602
  */
592
- rate: number | null;
603
+ hits: Array<TopHitWithRevenueAnalytics>;
604
+ };
605
+
606
+ type GetTopHitsResponse = TopHitsResponse | TopHitsResponseWithAnalytics | TopHitsResponseWithRevenueAnalytics;
607
+
608
+ type TopSearch = {
593
609
  /**
594
- * Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
610
+ * Search query.
595
611
  */
596
- trackedSearchCount: number;
612
+ search: string;
597
613
  /**
598
- * Number of add-to-cart events from this search.
614
+ * Number of searches.
599
615
  */
600
- addToCartCount: number;
616
+ count: number;
601
617
  /**
602
- * Date in the format YYYY-MM-DD.
618
+ * Number of results (hits).
603
619
  */
604
- date: string;
620
+ nbHits: number;
605
621
  };
606
622
 
607
- type GetAddToCartRateResponse = {
623
+ type TopSearchesResponse = {
608
624
  /**
609
- * Add-to-cart rate, calculated as number of tracked searches with at least one add-to-cart event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
625
+ * Most popular searches and their number of search results (hits).
610
626
  */
611
- rate: number | null;
627
+ searches: Array<TopSearch>;
628
+ };
629
+
630
+ type TopSearchWithAnalytics = {
612
631
  /**
613
- * Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
632
+ * Search query.
614
633
  */
615
- trackedSearchCount: number;
634
+ search: string;
616
635
  /**
617
- * Number of add-to-cart events from this search.
636
+ * Number of searches.
618
637
  */
619
- addToCartCount: number;
638
+ count: number;
620
639
  /**
621
- * Daily add-to-cart rates.
640
+ * Click-through rate, calculated as number of tracked searches with at least one click event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
622
641
  */
623
- dates: DailyAddToCartRates[];
624
- };
625
-
626
- type DailyAverageClicks = {
642
+ clickThroughRate: number | null;
627
643
  /**
628
644
  * Average position of a clicked search result in the list of search results. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
629
645
  */
630
- average: number | null;
646
+ averageClickPosition: number | null;
631
647
  /**
632
- * Number of clicks associated with this search.
648
+ * List of positions in the search results and clicks associated with this search.
633
649
  */
634
- clickCount: number;
650
+ clickPositions: Array<ClickPosition>;
635
651
  /**
636
- * Date in the format YYYY-MM-DD.
652
+ * Conversion rate, calculated as number of tracked searches with at least one conversion event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
637
653
  */
638
- date: string;
639
- };
640
-
641
- type GetAverageClickPositionResponse = {
654
+ conversionRate: number | null;
642
655
  /**
643
- * Average position of a clicked search result in the list of search results. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
656
+ * Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
644
657
  */
645
- average: number | null;
658
+ trackedSearchCount: number;
646
659
  /**
647
660
  * Number of clicks associated with this search.
648
661
  */
649
662
  clickCount: number;
650
663
  /**
651
- * Daily average click positions.
652
- */
653
- dates: DailyAverageClicks[];
654
- };
655
-
656
- /**
657
- * Click position.
658
- */
659
- type ClickPosition = {
660
- /**
661
- * Range of positions in the search results, using the pattern `[start,end]`. For positions 11 and up, click events are summed over the specified range. `-1` indicates the end of the list of search results.
664
+ * Number of conversions from this search.
662
665
  */
663
- position?: number[];
666
+ conversionCount: number;
664
667
  /**
665
- * Number of times this search has been clicked at that position.
668
+ * Number of results (hits).
666
669
  */
667
- clickCount?: number;
670
+ nbHits: number;
668
671
  };
669
672
 
670
- type GetClickPositionsResponse = {
673
+ type TopSearchesResponseWithAnalytics = {
671
674
  /**
672
- * List of positions in the search results and clicks associated with this search.
675
+ * Most popular searches and their associated click and conversion metrics.
673
676
  */
674
- positions: ClickPosition[];
677
+ searches: Array<TopSearchWithAnalytics>;
675
678
  };
676
679
 
677
- type DailyClickThroughRates = {
678
- /**
679
- * Click-through rate, calculated as number of tracked searches with at least one click event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
680
- */
681
- rate: number | null;
682
- /**
683
- * Number of clicks associated with this search.
684
- */
685
- clickCount: number;
680
+ type TopSearchWithRevenueAnalytics = {
686
681
  /**
687
- * Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
682
+ * Search query.
688
683
  */
689
- trackedSearchCount: number;
684
+ search: string;
690
685
  /**
691
- * Date in the format YYYY-MM-DD.
686
+ * Number of searches.
692
687
  */
693
- date: string;
694
- };
695
-
696
- type GetClickThroughRateResponse = {
688
+ count: number;
697
689
  /**
698
690
  * Click-through rate, calculated as number of tracked searches with at least one click event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
699
691
  */
700
- rate: number | null;
701
- /**
702
- * Number of clicks associated with this search.
703
- */
704
- clickCount: number;
692
+ clickThroughRate: number | null;
705
693
  /**
706
- * Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
694
+ * Average position of a clicked search result in the list of search results. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
707
695
  */
708
- trackedSearchCount: number;
696
+ averageClickPosition: number | null;
709
697
  /**
710
- * Daily click-through rates.
698
+ * List of positions in the search results and clicks associated with this search.
711
699
  */
712
- dates: DailyClickThroughRates[];
713
- };
714
-
715
- type DailyConversionRates = {
700
+ clickPositions: Array<ClickPosition>;
716
701
  /**
717
702
  * Conversion rate, calculated as number of tracked searches with at least one conversion event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
718
703
  */
719
- rate: number | null;
704
+ conversionRate: number | null;
720
705
  /**
721
706
  * Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
722
707
  */
723
708
  trackedSearchCount: number;
709
+ /**
710
+ * Number of clicks associated with this search.
711
+ */
712
+ clickCount: number;
724
713
  /**
725
714
  * Number of conversions from this search.
726
715
  */
727
716
  conversionCount: number;
728
717
  /**
729
- * Date in the format YYYY-MM-DD.
718
+ * Number of results (hits).
730
719
  */
731
- date: string;
732
- };
733
-
734
- type GetConversionRateResponse = {
720
+ nbHits: number;
735
721
  /**
736
- * Conversion rate, calculated as number of tracked searches with at least one conversion event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
722
+ * Revenue associated with this search, broken-down by currencies.
737
723
  */
738
- rate: number | null;
724
+ currencies: {
725
+ [key: string]: CurrencyCode;
726
+ };
739
727
  /**
740
- * Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
741
- */
742
- trackedSearchCount: number;
743
- /**
744
- * Number of conversions from this search.
728
+ * Add-to-cart rate, calculated as number of tracked searches with at least one add-to-cart event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
745
729
  */
746
- conversionCount: number;
730
+ addToCartRate: number | null;
747
731
  /**
748
- * Daily conversion rates.
732
+ * Number of add-to-cart events from this search.
749
733
  */
750
- dates: DailyConversionRates[];
751
- };
752
-
753
- type DailyNoClickRates = {
734
+ addToCartCount: number;
754
735
  /**
755
- * No click rate, calculated as number of tracked searches without any click divided by the number of tracked searches.
736
+ * Purchase rate, calculated as number of tracked searches with at least one purchase event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
756
737
  */
757
- rate: number;
738
+ purchaseRate: number | null;
758
739
  /**
759
- * Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
740
+ * Number of purchase events from this search.
760
741
  */
761
- count: number;
742
+ purchaseCount: number;
743
+ };
744
+
745
+ type TopSearchesResponseWithRevenueAnalytics = {
762
746
  /**
763
- * Number of times this search was returned as a result without any click.
747
+ * Most popular searches, including their click and revenue metrics.
764
748
  */
765
- noClickCount: number;
749
+ searches: Array<TopSearchWithRevenueAnalytics>;
750
+ };
751
+
752
+ type GetTopSearchesResponse = TopSearchesResponse | TopSearchesResponseWithAnalytics | TopSearchesResponseWithRevenueAnalytics;
753
+
754
+ type DailyUsers = {
766
755
  /**
767
756
  * Date in the format YYYY-MM-DD.
768
757
  */
769
758
  date: string;
759
+ /**
760
+ * Number of unique users.
761
+ */
762
+ count: number;
770
763
  };
771
764
 
772
- type GetNoClickRateResponse = {
765
+ type GetUsersCountResponse = {
773
766
  /**
774
- * No click rate, calculated as number of tracked searches without any click divided by the number of tracked searches.
767
+ * Number of unique users.
775
768
  */
776
- rate: number;
769
+ count: number;
777
770
  /**
778
- * Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
771
+ * Daily number of unique users.
779
772
  */
780
- count: number;
773
+ dates: Array<DailyUsers>;
774
+ };
775
+
776
+ type Direction = 'asc' | 'desc';
777
+
778
+ /**
779
+ * Attribute by which to order the response items. If the `clickAnalytics` parameter is false, only `searchCount` is available.
780
+ */
781
+ type OrderBy = 'searchCount' | 'clickThroughRate' | 'conversionRate' | 'averageClickPosition';
782
+
783
+ /**
784
+ * Properties for the `customDelete` method.
785
+ */
786
+ type CustomDeleteProps = {
781
787
  /**
782
- * Number of times this search was returned as a result without any click.
788
+ * Path of the endpoint, anything after \"/1\" must be specified.
783
789
  */
784
- noClickCount: number;
790
+ path: string;
785
791
  /**
786
- * Daily no click rates.
792
+ * Query parameters to apply to the current query.
787
793
  */
788
- dates: DailyNoClickRates[];
794
+ parameters?: {
795
+ [key: string]: any;
796
+ };
789
797
  };
790
-
791
- type DailyNoResultsRates = {
798
+ /**
799
+ * Properties for the `customGet` method.
800
+ */
801
+ type CustomGetProps = {
792
802
  /**
793
- * Date in the format YYYY-MM-DD.
803
+ * Path of the endpoint, anything after \"/1\" must be specified.
794
804
  */
795
- date: string;
805
+ path: string;
796
806
  /**
797
- * Number of searches without any results.
807
+ * Query parameters to apply to the current query.
798
808
  */
799
- noResultCount: number;
809
+ parameters?: {
810
+ [key: string]: any;
811
+ };
812
+ };
813
+ /**
814
+ * Properties for the `customPost` method.
815
+ */
816
+ type CustomPostProps = {
800
817
  /**
801
- * Number of searches.
818
+ * Path of the endpoint, anything after \"/1\" must be specified.
802
819
  */
803
- count: number;
820
+ path: string;
804
821
  /**
805
- * No results rate, calculated as number of searches with zero results divided by the total number of searches.
822
+ * Query parameters to apply to the current query.
806
823
  */
807
- rate: number;
808
- };
809
-
810
- type GetNoResultsRateResponse = {
824
+ parameters?: {
825
+ [key: string]: any;
826
+ };
811
827
  /**
812
- * No results rate, calculated as number of searches with zero results divided by the total number of searches.
828
+ * Parameters to send with the custom request.
813
829
  */
814
- rate: number;
830
+ body?: Record<string, unknown>;
831
+ };
832
+ /**
833
+ * Properties for the `customPut` method.
834
+ */
835
+ type CustomPutProps = {
815
836
  /**
816
- * Number of searches.
837
+ * Path of the endpoint, anything after \"/1\" must be specified.
817
838
  */
818
- count: number;
839
+ path: string;
819
840
  /**
820
- * Number of searches without any results.
841
+ * Query parameters to apply to the current query.
821
842
  */
822
- noResultCount: number;
843
+ parameters?: {
844
+ [key: string]: any;
845
+ };
823
846
  /**
824
- * Daily no results rates.
847
+ * Parameters to send with the custom request.
825
848
  */
826
- dates: DailyNoResultsRates[];
849
+ body?: Record<string, unknown>;
827
850
  };
828
-
829
- type DailyPurchaseRates = {
851
+ /**
852
+ * Properties for the `getAddToCartRate` method.
853
+ */
854
+ type GetAddToCartRateProps = {
830
855
  /**
831
- * Purchase rate, calculated as number of tracked searches with at least one purchase event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
856
+ * Index name.
832
857
  */
833
- rate: number | null;
858
+ index: string;
834
859
  /**
835
- * Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
860
+ * Start date of the period to analyze, in `YYYY-MM-DD` format.
836
861
  */
837
- trackedSearchCount: number;
862
+ startDate?: string;
838
863
  /**
839
- * Number of purchase events from this search.
864
+ * End date of the period to analyze, in `YYYY-MM-DD` format.
840
865
  */
841
- purchaseCount: number;
866
+ endDate?: string;
842
867
  /**
843
- * Date in the format YYYY-MM-DD.
868
+ * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
844
869
  */
845
- date: string;
870
+ tags?: string;
846
871
  };
847
-
848
- type GetPurchaseRateResponse = {
872
+ /**
873
+ * Properties for the `getAverageClickPosition` method.
874
+ */
875
+ type GetAverageClickPositionProps = {
849
876
  /**
850
- * Purchase rate, calculated as number of tracked searches with at least one purchase event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
877
+ * Index name.
851
878
  */
852
- rate: number | null;
879
+ index: string;
853
880
  /**
854
- * Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
881
+ * Start date of the period to analyze, in `YYYY-MM-DD` format.
855
882
  */
856
- trackedSearchCount: number;
883
+ startDate?: string;
857
884
  /**
858
- * Number of purchase events from this search.
885
+ * End date of the period to analyze, in `YYYY-MM-DD` format.
859
886
  */
860
- purchaseCount: number;
887
+ endDate?: string;
861
888
  /**
862
- * Daily purchase rates.
889
+ * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
863
890
  */
864
- dates: DailyPurchaseRates[];
891
+ tags?: string;
865
892
  };
866
-
867
893
  /**
868
- * Currency code.
894
+ * Properties for the `getClickPositions` method.
869
895
  */
870
- type CurrencyCode = {
896
+ type GetClickPositionsProps = {
871
897
  /**
872
- * Currency code.
898
+ * Index name.
873
899
  */
874
- currency?: string;
900
+ index: string;
875
901
  /**
876
- * Revenue associated with this search in this currency.
902
+ * Start date of the period to analyze, in `YYYY-MM-DD` format.
877
903
  */
878
- revenue?: number;
879
- };
880
-
881
- type DailyRevenue = {
904
+ startDate?: string;
882
905
  /**
883
- * Revenue associated with this search, broken-down by currencies.
906
+ * End date of the period to analyze, in `YYYY-MM-DD` format.
884
907
  */
885
- currencies: Record<string, CurrencyCode>;
908
+ endDate?: string;
886
909
  /**
887
- * Date in the format YYYY-MM-DD.
910
+ * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
888
911
  */
889
- date: string;
912
+ tags?: string;
890
913
  };
891
-
892
- type GetRevenue = {
914
+ /**
915
+ * Properties for the `getClickThroughRate` method.
916
+ */
917
+ type GetClickThroughRateProps = {
893
918
  /**
894
- * Revenue associated with this search, broken-down by currencies.
919
+ * Index name.
895
920
  */
896
- currencies: Record<string, CurrencyCode>;
921
+ index: string;
897
922
  /**
898
- * Daily revenue.
923
+ * Start date of the period to analyze, in `YYYY-MM-DD` format.
899
924
  */
900
- dates: DailyRevenue[];
901
- };
902
-
903
- type DailySearches = {
925
+ startDate?: string;
904
926
  /**
905
- * Date in the format YYYY-MM-DD.
927
+ * End date of the period to analyze, in `YYYY-MM-DD` format.
906
928
  */
907
- date: string;
929
+ endDate?: string;
908
930
  /**
909
- * Number of occurrences.
931
+ * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
910
932
  */
911
- count: number;
933
+ tags?: string;
912
934
  };
913
-
914
- type GetSearchesCountResponse = {
915
- /**
916
- * Number of occurrences.
917
- */
918
- count: number;
935
+ /**
936
+ * Properties for the `getConversionRate` method.
937
+ */
938
+ type GetConversionRateProps = {
919
939
  /**
920
- * Daily number of searches.
940
+ * Index name.
921
941
  */
922
- dates: DailySearches[];
923
- };
924
-
925
- type DailySearchesNoClicks = {
942
+ index: string;
926
943
  /**
927
- * Search query.
944
+ * Start date of the period to analyze, in `YYYY-MM-DD` format.
928
945
  */
929
- search: string;
946
+ startDate?: string;
930
947
  /**
931
- * Number of tracked searches.
948
+ * End date of the period to analyze, in `YYYY-MM-DD` format.
932
949
  */
933
- count: number;
950
+ endDate?: string;
934
951
  /**
935
- * Number of results (hits).
952
+ * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
936
953
  */
937
- nbHits: number;
954
+ tags?: string;
938
955
  };
939
-
940
- type GetSearchesNoClicksResponse = {
956
+ /**
957
+ * Properties for the `getNoClickRate` method.
958
+ */
959
+ type GetNoClickRateProps = {
941
960
  /**
942
- * Searches without any clicks.
961
+ * Index name.
943
962
  */
944
- searches: DailySearchesNoClicks[];
945
- };
946
-
947
- type DailySearchesNoResults = {
963
+ index: string;
948
964
  /**
949
- * Search query.
965
+ * Start date of the period to analyze, in `YYYY-MM-DD` format.
950
966
  */
951
- search: string;
967
+ startDate?: string;
952
968
  /**
953
- * Number of occurrences.
969
+ * End date of the period to analyze, in `YYYY-MM-DD` format.
954
970
  */
955
- count: number;
971
+ endDate?: string;
956
972
  /**
957
- * Number of searches for this term with applied filters.
973
+ * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
958
974
  */
959
- withFilterCount: number;
975
+ tags?: string;
960
976
  };
961
-
962
- type GetSearchesNoResultsResponse = {
977
+ /**
978
+ * Properties for the `getNoResultsRate` method.
979
+ */
980
+ type GetNoResultsRateProps = {
963
981
  /**
964
- * Searches without results.
982
+ * Index name.
965
983
  */
966
- searches: DailySearchesNoResults[];
967
- };
968
-
969
- type GetStatusResponse = {
984
+ index: string;
970
985
  /**
971
- * Date and time when the object was updated, in RFC 3339 format.
986
+ * Start date of the period to analyze, in `YYYY-MM-DD` format.
972
987
  */
973
- updatedAt: string | null;
974
- };
975
-
976
- type TopCountry = {
988
+ startDate?: string;
977
989
  /**
978
- * Country code.
990
+ * End date of the period to analyze, in `YYYY-MM-DD` format.
979
991
  */
980
- country: string;
992
+ endDate?: string;
981
993
  /**
982
- * Number of occurrences.
994
+ * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
983
995
  */
984
- count: number;
996
+ tags?: string;
985
997
  };
986
-
987
- type GetTopCountriesResponse = {
998
+ /**
999
+ * Properties for the `getPurchaseRate` method.
1000
+ */
1001
+ type GetPurchaseRateProps = {
988
1002
  /**
989
- * Countries and number of searches.
1003
+ * Index name.
990
1004
  */
991
- countries: TopCountry[];
992
- };
993
-
994
- type GetTopFilterAttribute = {
1005
+ index: string;
995
1006
  /**
996
- * Attribute name.
1007
+ * Start date of the period to analyze, in `YYYY-MM-DD` format.
997
1008
  */
998
- attribute: string;
1009
+ startDate?: string;
999
1010
  /**
1000
- * Number of occurrences.
1011
+ * End date of the period to analyze, in `YYYY-MM-DD` format.
1001
1012
  */
1002
- count: number;
1003
- };
1004
-
1005
- type GetTopFilterAttributesResponse = {
1013
+ endDate?: string;
1006
1014
  /**
1007
- * Most frequent filters.
1015
+ * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1008
1016
  */
1009
- attributes: GetTopFilterAttribute[];
1017
+ tags?: string;
1010
1018
  };
1011
-
1012
1019
  /**
1013
- * Character that characterizes how the filter is applied. For example, for a facet filter `facet:value`, `:` is the operator. For a numeric filter `count>50`, `>` is the operator.
1020
+ * Properties for the `getRevenue` method.
1014
1021
  */
1015
- type Operator = ':' | '!=' | '<' | '<=' | '=' | '>' | '>=';
1016
-
1017
- type GetTopFilterForAttribute = {
1022
+ type GetRevenueProps = {
1018
1023
  /**
1019
- * Attribute name.
1024
+ * Index name.
1020
1025
  */
1021
- attribute: string;
1022
- operator: Operator;
1026
+ index: string;
1023
1027
  /**
1024
- * Attribute value.
1028
+ * Start date of the period to analyze, in `YYYY-MM-DD` format.
1025
1029
  */
1026
- value: string;
1030
+ startDate?: string;
1027
1031
  /**
1028
- * Number of occurrences.
1032
+ * End date of the period to analyze, in `YYYY-MM-DD` format.
1029
1033
  */
1030
- count: number;
1031
- };
1032
-
1033
- type GetTopFilterForAttributeResponse = {
1034
+ endDate?: string;
1034
1035
  /**
1035
- * Filter values for an attribute.
1036
+ * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1036
1037
  */
1037
- values: GetTopFilterForAttribute[];
1038
+ tags?: string;
1038
1039
  };
1039
-
1040
- type GetTopFiltersNoResultsValue = {
1040
+ /**
1041
+ * Properties for the `getSearchesCount` method.
1042
+ */
1043
+ type GetSearchesCountProps = {
1041
1044
  /**
1042
- * Attribute name.
1045
+ * Index name.
1043
1046
  */
1044
- attribute: string;
1045
- operator: Operator;
1047
+ index: string;
1046
1048
  /**
1047
- * Attribute value.
1049
+ * Start date of the period to analyze, in `YYYY-MM-DD` format.
1048
1050
  */
1049
- value: string;
1050
- };
1051
-
1052
- type GetTopFiltersNoResultsValues = {
1051
+ startDate?: string;
1053
1052
  /**
1054
- * Number of occurrences.
1053
+ * End date of the period to analyze, in `YYYY-MM-DD` format.
1055
1054
  */
1056
- count: number;
1055
+ endDate?: string;
1057
1056
  /**
1058
- * Filters with no results.
1057
+ * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1059
1058
  */
1060
- values: GetTopFiltersNoResultsValue[];
1059
+ tags?: string;
1061
1060
  };
1062
-
1063
- type GetTopFiltersNoResultsResponse = {
1061
+ /**
1062
+ * Properties for the `getSearchesNoClicks` method.
1063
+ */
1064
+ type GetSearchesNoClicksProps = {
1064
1065
  /**
1065
- * Filters for searches without any results. If null, the search term specified with the `search` parameter is not a search without results, or the `search` parameter is absent from the request.
1066
+ * Index name.
1066
1067
  */
1067
- values: GetTopFiltersNoResultsValues[] | null;
1068
- };
1069
-
1070
- type TopHit = {
1068
+ index: string;
1071
1069
  /**
1072
- * Object ID of a record that\'s returned as a search result.
1070
+ * Start date of the period to analyze, in `YYYY-MM-DD` format.
1073
1071
  */
1074
- hit: string;
1072
+ startDate?: string;
1075
1073
  /**
1076
- * Number of occurrences.
1074
+ * End date of the period to analyze, in `YYYY-MM-DD` format.
1077
1075
  */
1078
- count: number;
1079
- };
1080
-
1081
- type TopHitsResponse = {
1076
+ endDate?: string;
1082
1077
  /**
1083
- * Most frequent search results.
1078
+ * Number of items to return. Combined with the `offset` parameter, only the first 1000 items can be retrieved.
1084
1079
  */
1085
- hits: TopHit[];
1086
- };
1087
-
1088
- type TopHitWithAnalytics = {
1080
+ limit?: number;
1089
1081
  /**
1090
- * Object ID of a record that\'s returned as a search result.
1082
+ * Position of the first item to return. Combined with the `limit` parameter, only the first 1000 items can be retrieved.
1091
1083
  */
1092
- hit: string;
1084
+ offset?: number;
1093
1085
  /**
1094
- * Number of occurrences.
1086
+ * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1095
1087
  */
1096
- count: number;
1088
+ tags?: string;
1089
+ };
1090
+ /**
1091
+ * Properties for the `getSearchesNoResults` method.
1092
+ */
1093
+ type GetSearchesNoResultsProps = {
1097
1094
  /**
1098
- * Click-through rate, calculated as number of tracked searches with at least one click event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
1095
+ * Index name.
1099
1096
  */
1100
- clickThroughRate: number | null;
1097
+ index: string;
1101
1098
  /**
1102
- * Conversion rate, calculated as number of tracked searches with at least one conversion event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
1099
+ * Start date of the period to analyze, in `YYYY-MM-DD` format.
1103
1100
  */
1104
- conversionRate: number | null;
1101
+ startDate?: string;
1105
1102
  /**
1106
- * Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
1103
+ * End date of the period to analyze, in `YYYY-MM-DD` format.
1107
1104
  */
1108
- trackedHitCount: number;
1105
+ endDate?: string;
1109
1106
  /**
1110
- * Number of clicks associated with this search.
1107
+ * Number of items to return. Combined with the `offset` parameter, only the first 1000 items can be retrieved.
1111
1108
  */
1112
- clickCount: number;
1109
+ limit?: number;
1113
1110
  /**
1114
- * Number of conversions from this search.
1111
+ * Position of the first item to return. Combined with the `limit` parameter, only the first 1000 items can be retrieved.
1115
1112
  */
1116
- conversionCount: number;
1113
+ offset?: number;
1114
+ /**
1115
+ * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1116
+ */
1117
+ tags?: string;
1117
1118
  };
1118
-
1119
- type TopHitsResponseWithAnalytics = {
1119
+ /**
1120
+ * Properties for the `getStatus` method.
1121
+ */
1122
+ type GetStatusProps = {
1120
1123
  /**
1121
- * Most frequent search results with click and conversion metrics.
1124
+ * Index name.
1122
1125
  */
1123
- hits: TopHitWithAnalytics[];
1126
+ index: string;
1124
1127
  };
1125
-
1126
- type TopHitWithRevenueAnalytics = {
1128
+ /**
1129
+ * Properties for the `getTopCountries` method.
1130
+ */
1131
+ type GetTopCountriesProps = {
1132
+ /**
1133
+ * Index name.
1134
+ */
1135
+ index: string;
1127
1136
  /**
1128
- * Object ID of a record that\'s returned as a search result.
1137
+ * Start date of the period to analyze, in `YYYY-MM-DD` format.
1129
1138
  */
1130
- hit: string;
1139
+ startDate?: string;
1131
1140
  /**
1132
- * Number of occurrences.
1141
+ * End date of the period to analyze, in `YYYY-MM-DD` format.
1133
1142
  */
1134
- count: number;
1143
+ endDate?: string;
1135
1144
  /**
1136
- * Click-through rate, calculated as number of tracked searches with at least one click event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
1145
+ * Number of items to return. Combined with the `offset` parameter, only the first 1000 items can be retrieved.
1137
1146
  */
1138
- clickThroughRate: number | null;
1147
+ limit?: number;
1139
1148
  /**
1140
- * Conversion rate, calculated as number of tracked searches with at least one conversion event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
1149
+ * Position of the first item to return. Combined with the `limit` parameter, only the first 1000 items can be retrieved.
1141
1150
  */
1142
- conversionRate: number | null;
1151
+ offset?: number;
1143
1152
  /**
1144
- * Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
1153
+ * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1145
1154
  */
1146
- trackedHitCount: number;
1155
+ tags?: string;
1156
+ };
1157
+ /**
1158
+ * Properties for the `getTopFilterAttributes` method.
1159
+ */
1160
+ type GetTopFilterAttributesProps = {
1147
1161
  /**
1148
- * Number of clicks associated with this search.
1162
+ * Index name.
1149
1163
  */
1150
- clickCount: number;
1164
+ index: string;
1151
1165
  /**
1152
- * Number of conversions from this search.
1166
+ * Search query.
1153
1167
  */
1154
- conversionCount: number;
1168
+ search?: string;
1155
1169
  /**
1156
- * Add-to-cart rate, calculated as number of tracked searches with at least one add-to-cart event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
1170
+ * Start date of the period to analyze, in `YYYY-MM-DD` format.
1157
1171
  */
1158
- addToCartRate: number | null;
1172
+ startDate?: string;
1159
1173
  /**
1160
- * Number of add-to-cart events from this search.
1174
+ * End date of the period to analyze, in `YYYY-MM-DD` format.
1161
1175
  */
1162
- addToCartCount: number;
1176
+ endDate?: string;
1163
1177
  /**
1164
- * Purchase rate, calculated as number of tracked searches with at least one purchase event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
1178
+ * Number of items to return. Combined with the `offset` parameter, only the first 1000 items can be retrieved.
1165
1179
  */
1166
- purchaseRate: number | null;
1180
+ limit?: number;
1167
1181
  /**
1168
- * Number of purchase events from this search.
1182
+ * Position of the first item to return. Combined with the `limit` parameter, only the first 1000 items can be retrieved.
1169
1183
  */
1170
- purchaseCount: number;
1184
+ offset?: number;
1171
1185
  /**
1172
- * Revenue associated with this search, broken-down by currencies.
1186
+ * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1173
1187
  */
1174
- currencies: Record<string, CurrencyCode>;
1188
+ tags?: string;
1175
1189
  };
1176
-
1177
- type TopHitsResponseWithRevenueAnalytics = {
1190
+ /**
1191
+ * Properties for the `getTopFilterForAttribute` method.
1192
+ */
1193
+ type GetTopFilterForAttributeProps = {
1178
1194
  /**
1179
- * Most frequent search results with click, conversion, and revenue metrics.
1195
+ * Attribute name.
1180
1196
  */
1181
- hits: TopHitWithRevenueAnalytics[];
1182
- };
1183
-
1184
- type GetTopHitsResponse = TopHitsResponse | TopHitsResponseWithAnalytics | TopHitsResponseWithRevenueAnalytics;
1185
-
1186
- type TopSearch = {
1197
+ attribute: string;
1187
1198
  /**
1188
- * Search query.
1199
+ * Index name.
1189
1200
  */
1190
- search: string;
1201
+ index: string;
1191
1202
  /**
1192
- * Number of searches.
1203
+ * Search query.
1193
1204
  */
1194
- count: number;
1205
+ search?: string;
1195
1206
  /**
1196
- * Number of results (hits).
1207
+ * Start date of the period to analyze, in `YYYY-MM-DD` format.
1197
1208
  */
1198
- nbHits: number;
1199
- };
1200
-
1201
- type TopSearchesResponse = {
1209
+ startDate?: string;
1202
1210
  /**
1203
- * Most popular searches and their number of search results (hits).
1211
+ * End date of the period to analyze, in `YYYY-MM-DD` format.
1204
1212
  */
1205
- searches: TopSearch[];
1206
- };
1207
-
1208
- type TopSearchWithAnalytics = {
1213
+ endDate?: string;
1209
1214
  /**
1210
- * Search query.
1215
+ * Number of items to return. Combined with the `offset` parameter, only the first 1000 items can be retrieved.
1211
1216
  */
1212
- search: string;
1217
+ limit?: number;
1213
1218
  /**
1214
- * Number of searches.
1219
+ * Position of the first item to return. Combined with the `limit` parameter, only the first 1000 items can be retrieved.
1215
1220
  */
1216
- count: number;
1221
+ offset?: number;
1217
1222
  /**
1218
- * Click-through rate, calculated as number of tracked searches with at least one click event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
1223
+ * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1219
1224
  */
1220
- clickThroughRate: number | null;
1225
+ tags?: string;
1226
+ };
1227
+ /**
1228
+ * Properties for the `getTopFiltersNoResults` method.
1229
+ */
1230
+ type GetTopFiltersNoResultsProps = {
1221
1231
  /**
1222
- * Average position of a clicked search result in the list of search results. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
1232
+ * Index name.
1223
1233
  */
1224
- averageClickPosition: number | null;
1234
+ index: string;
1225
1235
  /**
1226
- * List of positions in the search results and clicks associated with this search.
1236
+ * Search query.
1227
1237
  */
1228
- clickPositions: ClickPosition[];
1238
+ search?: string;
1229
1239
  /**
1230
- * Conversion rate, calculated as number of tracked searches with at least one conversion event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
1240
+ * Start date of the period to analyze, in `YYYY-MM-DD` format.
1231
1241
  */
1232
- conversionRate: number | null;
1242
+ startDate?: string;
1233
1243
  /**
1234
- * Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
1244
+ * End date of the period to analyze, in `YYYY-MM-DD` format.
1235
1245
  */
1236
- trackedSearchCount: number;
1246
+ endDate?: string;
1237
1247
  /**
1238
- * Number of clicks associated with this search.
1248
+ * Number of items to return. Combined with the `offset` parameter, only the first 1000 items can be retrieved.
1239
1249
  */
1240
- clickCount: number;
1250
+ limit?: number;
1241
1251
  /**
1242
- * Number of conversions from this search.
1252
+ * Position of the first item to return. Combined with the `limit` parameter, only the first 1000 items can be retrieved.
1243
1253
  */
1244
- conversionCount: number;
1254
+ offset?: number;
1245
1255
  /**
1246
- * Number of results (hits).
1256
+ * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1247
1257
  */
1248
- nbHits: number;
1258
+ tags?: string;
1249
1259
  };
1250
-
1251
- type TopSearchesResponseWithAnalytics = {
1260
+ /**
1261
+ * Properties for the `getTopHits` method.
1262
+ */
1263
+ type GetTopHitsProps = {
1252
1264
  /**
1253
- * Most popular searches and their associated click and conversion metrics.
1265
+ * Index name.
1254
1266
  */
1255
- searches: TopSearchWithAnalytics[];
1256
- };
1257
-
1258
- type TopSearchWithRevenueAnalytics = {
1267
+ index: string;
1259
1268
  /**
1260
1269
  * Search query.
1261
1270
  */
1262
- search: string;
1271
+ search?: string;
1263
1272
  /**
1264
- * Number of searches.
1273
+ * Whether to include metrics related to click and conversion events in the response.
1265
1274
  */
1266
- count: number;
1275
+ clickAnalytics?: boolean;
1267
1276
  /**
1268
- * Click-through rate, calculated as number of tracked searches with at least one click event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
1277
+ * Whether to include revenue-related metrics in the response. If true, metrics related to click and conversion events are also included in the response.
1269
1278
  */
1270
- clickThroughRate: number | null;
1279
+ revenueAnalytics?: boolean;
1271
1280
  /**
1272
- * Average position of a clicked search result in the list of search results. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
1281
+ * Start date of the period to analyze, in `YYYY-MM-DD` format.
1273
1282
  */
1274
- averageClickPosition: number | null;
1283
+ startDate?: string;
1275
1284
  /**
1276
- * List of positions in the search results and clicks associated with this search.
1285
+ * End date of the period to analyze, in `YYYY-MM-DD` format.
1277
1286
  */
1278
- clickPositions: ClickPosition[];
1287
+ endDate?: string;
1279
1288
  /**
1280
- * Conversion rate, calculated as number of tracked searches with at least one conversion event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
1289
+ * Number of items to return. Combined with the `offset` parameter, only the first 1000 items can be retrieved.
1281
1290
  */
1282
- conversionRate: number | null;
1291
+ limit?: number;
1283
1292
  /**
1284
- * Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
1293
+ * Position of the first item to return. Combined with the `limit` parameter, only the first 1000 items can be retrieved.
1285
1294
  */
1286
- trackedSearchCount: number;
1295
+ offset?: number;
1287
1296
  /**
1288
- * Number of clicks associated with this search.
1297
+ * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1289
1298
  */
1290
- clickCount: number;
1299
+ tags?: string;
1300
+ };
1301
+ /**
1302
+ * Properties for the `getTopSearches` method.
1303
+ */
1304
+ type GetTopSearchesProps = {
1291
1305
  /**
1292
- * Number of conversions from this search.
1306
+ * Index name.
1293
1307
  */
1294
- conversionCount: number;
1308
+ index: string;
1295
1309
  /**
1296
- * Number of results (hits).
1310
+ * Whether to include metrics related to click and conversion events in the response.
1297
1311
  */
1298
- nbHits: number;
1312
+ clickAnalytics?: boolean;
1299
1313
  /**
1300
- * Revenue associated with this search, broken-down by currencies.
1314
+ * Whether to include revenue-related metrics in the response. If true, metrics related to click and conversion events are also included in the response.
1301
1315
  */
1302
- currencies: Record<string, CurrencyCode>;
1316
+ revenueAnalytics?: boolean;
1303
1317
  /**
1304
- * Add-to-cart rate, calculated as number of tracked searches with at least one add-to-cart event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
1318
+ * Start date of the period to analyze, in `YYYY-MM-DD` format.
1305
1319
  */
1306
- addToCartRate: number | null;
1320
+ startDate?: string;
1307
1321
  /**
1308
- * Number of add-to-cart events from this search.
1322
+ * End date of the period to analyze, in `YYYY-MM-DD` format.
1309
1323
  */
1310
- addToCartCount: number;
1324
+ endDate?: string;
1311
1325
  /**
1312
- * Purchase rate, calculated as number of tracked searches with at least one purchase event divided by the number of tracked searches. If null, Algolia didn\'t receive any search requests with `clickAnalytics` set to true.
1326
+ * Attribute by which to order the response items. If the `clickAnalytics` parameter is false, only `searchCount` is available.
1313
1327
  */
1314
- purchaseRate: number | null;
1328
+ orderBy?: OrderBy;
1315
1329
  /**
1316
- * Number of purchase events from this search.
1330
+ * Sorting direction of the results: ascending or descending.
1317
1331
  */
1318
- purchaseCount: number;
1319
- };
1320
-
1321
- type TopSearchesResponseWithRevenueAnalytics = {
1332
+ direction?: Direction;
1322
1333
  /**
1323
- * Most popular searches, including their click and revenue metrics.
1334
+ * Number of items to return. Combined with the `offset` parameter, only the first 1000 items can be retrieved.
1324
1335
  */
1325
- searches: TopSearchWithRevenueAnalytics[];
1326
- };
1327
-
1328
- type GetTopSearchesResponse = TopSearchesResponse | TopSearchesResponseWithAnalytics | TopSearchesResponseWithRevenueAnalytics;
1329
-
1330
- type DailyUsers = {
1336
+ limit?: number;
1331
1337
  /**
1332
- * Date in the format YYYY-MM-DD.
1338
+ * Position of the first item to return. Combined with the `limit` parameter, only the first 1000 items can be retrieved.
1333
1339
  */
1334
- date: string;
1340
+ offset?: number;
1335
1341
  /**
1336
- * Number of unique users.
1342
+ * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1337
1343
  */
1338
- count: number;
1344
+ tags?: string;
1339
1345
  };
1340
-
1341
- type GetUsersCountResponse = {
1346
+ /**
1347
+ * Properties for the `getUsersCount` method.
1348
+ */
1349
+ type GetUsersCountProps = {
1342
1350
  /**
1343
- * Number of unique users.
1351
+ * Index name.
1344
1352
  */
1345
- count: number;
1353
+ index: string;
1346
1354
  /**
1347
- * Daily number of unique users.
1355
+ * Start date of the period to analyze, in `YYYY-MM-DD` format.
1356
+ */
1357
+ startDate?: string;
1358
+ /**
1359
+ * End date of the period to analyze, in `YYYY-MM-DD` format.
1360
+ */
1361
+ endDate?: string;
1362
+ /**
1363
+ * Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1348
1364
  */
1349
- dates: DailyUsers[];
1365
+ tags?: string;
1350
1366
  };
1351
1367
 
1352
- declare const apiClientVersion = "5.7.0";
1368
+ declare const apiClientVersion = "5.8.0";
1353
1369
  declare const REGIONS: readonly ["de", "us"];
1354
1370
  type Region = (typeof REGIONS)[number];
1355
1371
  declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }: CreateClientOptions & {
@@ -1386,7 +1402,6 @@ declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOptio
1386
1402
  }): void;
1387
1403
  /**
1388
1404
  * This method allow you to send requests to the Algolia REST API.
1389
- *
1390
1405
  * @param customDelete - The customDelete object.
1391
1406
  * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
1392
1407
  * @param customDelete.parameters - Query parameters to apply to the current query.
@@ -1395,7 +1410,6 @@ declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOptio
1395
1410
  customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
1396
1411
  /**
1397
1412
  * This method allow you to send requests to the Algolia REST API.
1398
- *
1399
1413
  * @param customGet - The customGet object.
1400
1414
  * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
1401
1415
  * @param customGet.parameters - Query parameters to apply to the current query.
@@ -1404,7 +1418,6 @@ declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOptio
1404
1418
  customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
1405
1419
  /**
1406
1420
  * This method allow you to send requests to the Algolia REST API.
1407
- *
1408
1421
  * @param customPost - The customPost object.
1409
1422
  * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
1410
1423
  * @param customPost.parameters - Query parameters to apply to the current query.
@@ -1414,7 +1427,6 @@ declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOptio
1414
1427
  customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
1415
1428
  /**
1416
1429
  * This method allow you to send requests to the Algolia REST API.
1417
- *
1418
1430
  * @param customPut - The customPut object.
1419
1431
  * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
1420
1432
  * @param customPut.parameters - Query parameters to apply to the current query.
@@ -1426,8 +1438,7 @@ declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOptio
1426
1438
  * Retrieves the add-to-cart rate for all of your searches with at least one add-to-cart event, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.
1427
1439
  *
1428
1440
  * Required API Key ACLs:
1429
- * - analytics.
1430
- *
1441
+ * - analytics
1431
1442
  * @param getAddToCartRate - The getAddToCartRate object.
1432
1443
  * @param getAddToCartRate.index - Index name.
1433
1444
  * @param getAddToCartRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
@@ -1440,8 +1451,7 @@ declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOptio
1440
1451
  * Retrieves the average click position of your search results, including a daily breakdown. The average click position is the average of all clicked search results\' positions. For example, if users only ever click on the first result for any search, the average click position is 1. By default, the analyzed period includes the last eight days including the current day.
1441
1452
  *
1442
1453
  * Required API Key ACLs:
1443
- * - analytics.
1444
- *
1454
+ * - analytics
1445
1455
  * @param getAverageClickPosition - The getAverageClickPosition object.
1446
1456
  * @param getAverageClickPosition.index - Index name.
1447
1457
  * @param getAverageClickPosition.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
@@ -1454,8 +1464,7 @@ declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOptio
1454
1464
  * Retrieves the positions in the search results and their associated number of clicks. This lets you check how many clicks the first, second, or tenth search results receive.
1455
1465
  *
1456
1466
  * Required API Key ACLs:
1457
- * - analytics.
1458
- *
1467
+ * - analytics
1459
1468
  * @param getClickPositions - The getClickPositions object.
1460
1469
  * @param getClickPositions.index - Index name.
1461
1470
  * @param getClickPositions.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
@@ -1468,8 +1477,7 @@ declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOptio
1468
1477
  * Retrieves the click-through rate for all of your searches with at least one click event, including a daily breakdown By default, the analyzed period includes the last eight days including the current day.
1469
1478
  *
1470
1479
  * Required API Key ACLs:
1471
- * - analytics.
1472
- *
1480
+ * - analytics
1473
1481
  * @param getClickThroughRate - The getClickThroughRate object.
1474
1482
  * @param getClickThroughRate.index - Index name.
1475
1483
  * @param getClickThroughRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
@@ -1482,8 +1490,7 @@ declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOptio
1482
1490
  * Retrieves the conversion rate for all of your searches with at least one conversion event, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.
1483
1491
  *
1484
1492
  * Required API Key ACLs:
1485
- * - analytics.
1486
- *
1493
+ * - analytics
1487
1494
  * @param getConversionRate - The getConversionRate object.
1488
1495
  * @param getConversionRate.index - Index name.
1489
1496
  * @param getConversionRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
@@ -1496,8 +1503,7 @@ declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOptio
1496
1503
  * Retrieves the fraction of searches that didn\'t lead to any click within a time range, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.
1497
1504
  *
1498
1505
  * Required API Key ACLs:
1499
- * - analytics.
1500
- *
1506
+ * - analytics
1501
1507
  * @param getNoClickRate - The getNoClickRate object.
1502
1508
  * @param getNoClickRate.index - Index name.
1503
1509
  * @param getNoClickRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
@@ -1510,8 +1516,7 @@ declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOptio
1510
1516
  * Retrieves the fraction of searches that didn\'t return any results within a time range, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.
1511
1517
  *
1512
1518
  * Required API Key ACLs:
1513
- * - analytics.
1514
- *
1519
+ * - analytics
1515
1520
  * @param getNoResultsRate - The getNoResultsRate object.
1516
1521
  * @param getNoResultsRate.index - Index name.
1517
1522
  * @param getNoResultsRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
@@ -1524,8 +1529,7 @@ declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOptio
1524
1529
  * Retrieves the purchase rate for all of your searches with at least one purchase event, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.
1525
1530
  *
1526
1531
  * Required API Key ACLs:
1527
- * - analytics.
1528
- *
1532
+ * - analytics
1529
1533
  * @param getPurchaseRate - The getPurchaseRate object.
1530
1534
  * @param getPurchaseRate.index - Index name.
1531
1535
  * @param getPurchaseRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
@@ -1538,8 +1542,7 @@ declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOptio
1538
1542
  * Retrieves revenue-related metrics, such as the total revenue or the average order value. To retrieve revenue-related metrics, sent purchase events. By default, the analyzed period includes the last eight days including the current day.
1539
1543
  *
1540
1544
  * Required API Key ACLs:
1541
- * - analytics.
1542
- *
1545
+ * - analytics
1543
1546
  * @param getRevenue - The getRevenue object.
1544
1547
  * @param getRevenue.index - Index name.
1545
1548
  * @param getRevenue.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
@@ -1552,8 +1555,7 @@ declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOptio
1552
1555
  * Retrieves the number of searches within a time range, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.
1553
1556
  *
1554
1557
  * Required API Key ACLs:
1555
- * - analytics.
1556
- *
1558
+ * - analytics
1557
1559
  * @param getSearchesCount - The getSearchesCount object.
1558
1560
  * @param getSearchesCount.index - Index name.
1559
1561
  * @param getSearchesCount.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
@@ -1566,14 +1568,13 @@ declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOptio
1566
1568
  * Retrieves the most popular searches that didn\'t lead to any clicks, from the 1,000 most frequent searches.
1567
1569
  *
1568
1570
  * Required API Key ACLs:
1569
- * - analytics.
1570
- *
1571
+ * - analytics
1571
1572
  * @param getSearchesNoClicks - The getSearchesNoClicks object.
1572
1573
  * @param getSearchesNoClicks.index - Index name.
1573
1574
  * @param getSearchesNoClicks.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1574
1575
  * @param getSearchesNoClicks.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1575
- * @param getSearchesNoClicks.limit - Number of items to return.
1576
- * @param getSearchesNoClicks.offset - Position of the first item to return.
1576
+ * @param getSearchesNoClicks.limit - Number of items to return. Combined with the `offset` parameter, only the first 1000 items can be retrieved.
1577
+ * @param getSearchesNoClicks.offset - Position of the first item to return. Combined with the `limit` parameter, only the first 1000 items can be retrieved.
1577
1578
  * @param getSearchesNoClicks.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1578
1579
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1579
1580
  */
@@ -1582,14 +1583,13 @@ declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOptio
1582
1583
  * Retrieves the most popular searches that didn\'t return any results.
1583
1584
  *
1584
1585
  * Required API Key ACLs:
1585
- * - analytics.
1586
- *
1586
+ * - analytics
1587
1587
  * @param getSearchesNoResults - The getSearchesNoResults object.
1588
1588
  * @param getSearchesNoResults.index - Index name.
1589
1589
  * @param getSearchesNoResults.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1590
1590
  * @param getSearchesNoResults.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1591
- * @param getSearchesNoResults.limit - Number of items to return.
1592
- * @param getSearchesNoResults.offset - Position of the first item to return.
1591
+ * @param getSearchesNoResults.limit - Number of items to return. Combined with the `offset` parameter, only the first 1000 items can be retrieved.
1592
+ * @param getSearchesNoResults.offset - Position of the first item to return. Combined with the `limit` parameter, only the first 1000 items can be retrieved.
1593
1593
  * @param getSearchesNoResults.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1594
1594
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1595
1595
  */
@@ -1598,8 +1598,7 @@ declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOptio
1598
1598
  * Retrieves the time when the Analytics data for the specified index was last updated. The Analytics data is updated every 5 minutes.
1599
1599
  *
1600
1600
  * Required API Key ACLs:
1601
- * - analytics.
1602
- *
1601
+ * - analytics
1603
1602
  * @param getStatus - The getStatus object.
1604
1603
  * @param getStatus.index - Index name.
1605
1604
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -1609,14 +1608,13 @@ declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOptio
1609
1608
  * Retrieves the countries with the most searches to your index.
1610
1609
  *
1611
1610
  * Required API Key ACLs:
1612
- * - analytics.
1613
- *
1611
+ * - analytics
1614
1612
  * @param getTopCountries - The getTopCountries object.
1615
1613
  * @param getTopCountries.index - Index name.
1616
1614
  * @param getTopCountries.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1617
1615
  * @param getTopCountries.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1618
- * @param getTopCountries.limit - Number of items to return.
1619
- * @param getTopCountries.offset - Position of the first item to return.
1616
+ * @param getTopCountries.limit - Number of items to return. Combined with the `offset` parameter, only the first 1000 items can be retrieved.
1617
+ * @param getTopCountries.offset - Position of the first item to return. Combined with the `limit` parameter, only the first 1000 items can be retrieved.
1620
1618
  * @param getTopCountries.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1621
1619
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1622
1620
  */
@@ -1625,15 +1623,14 @@ declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOptio
1625
1623
  * Retrieves the most frequently used filter attributes. These are attributes of your records that you included in the `attributesForFaceting` setting.
1626
1624
  *
1627
1625
  * Required API Key ACLs:
1628
- * - analytics.
1629
- *
1626
+ * - analytics
1630
1627
  * @param getTopFilterAttributes - The getTopFilterAttributes object.
1631
1628
  * @param getTopFilterAttributes.index - Index name.
1632
1629
  * @param getTopFilterAttributes.search - Search query.
1633
1630
  * @param getTopFilterAttributes.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1634
1631
  * @param getTopFilterAttributes.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1635
- * @param getTopFilterAttributes.limit - Number of items to return.
1636
- * @param getTopFilterAttributes.offset - Position of the first item to return.
1632
+ * @param getTopFilterAttributes.limit - Number of items to return. Combined with the `offset` parameter, only the first 1000 items can be retrieved.
1633
+ * @param getTopFilterAttributes.offset - Position of the first item to return. Combined with the `limit` parameter, only the first 1000 items can be retrieved.
1637
1634
  * @param getTopFilterAttributes.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1638
1635
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1639
1636
  */
@@ -1642,16 +1639,15 @@ declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOptio
1642
1639
  * Retrieves the most frequent filter (facet) values for a filter attribute. These are attributes of your records that you included in the `attributesForFaceting` setting.
1643
1640
  *
1644
1641
  * Required API Key ACLs:
1645
- * - analytics.
1646
- *
1642
+ * - analytics
1647
1643
  * @param getTopFilterForAttribute - The getTopFilterForAttribute object.
1648
1644
  * @param getTopFilterForAttribute.attribute - Attribute name.
1649
1645
  * @param getTopFilterForAttribute.index - Index name.
1650
1646
  * @param getTopFilterForAttribute.search - Search query.
1651
1647
  * @param getTopFilterForAttribute.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1652
1648
  * @param getTopFilterForAttribute.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1653
- * @param getTopFilterForAttribute.limit - Number of items to return.
1654
- * @param getTopFilterForAttribute.offset - Position of the first item to return.
1649
+ * @param getTopFilterForAttribute.limit - Number of items to return. Combined with the `offset` parameter, only the first 1000 items can be retrieved.
1650
+ * @param getTopFilterForAttribute.offset - Position of the first item to return. Combined with the `limit` parameter, only the first 1000 items can be retrieved.
1655
1651
  * @param getTopFilterForAttribute.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1656
1652
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1657
1653
  */
@@ -1660,15 +1656,14 @@ declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOptio
1660
1656
  * Retrieves the most frequently used filters for a search that didn\'t return any results. To get the most frequent searches without results, use the [Retrieve searches without results](#tag/search/operation/getSearchesNoResults) operation.
1661
1657
  *
1662
1658
  * Required API Key ACLs:
1663
- * - analytics.
1664
- *
1659
+ * - analytics
1665
1660
  * @param getTopFiltersNoResults - The getTopFiltersNoResults object.
1666
1661
  * @param getTopFiltersNoResults.index - Index name.
1667
1662
  * @param getTopFiltersNoResults.search - Search query.
1668
1663
  * @param getTopFiltersNoResults.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1669
1664
  * @param getTopFiltersNoResults.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1670
- * @param getTopFiltersNoResults.limit - Number of items to return.
1671
- * @param getTopFiltersNoResults.offset - Position of the first item to return.
1665
+ * @param getTopFiltersNoResults.limit - Number of items to return. Combined with the `offset` parameter, only the first 1000 items can be retrieved.
1666
+ * @param getTopFiltersNoResults.offset - Position of the first item to return. Combined with the `limit` parameter, only the first 1000 items can be retrieved.
1672
1667
  * @param getTopFiltersNoResults.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1673
1668
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1674
1669
  */
@@ -1677,8 +1672,7 @@ declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOptio
1677
1672
  * Retrieves the object IDs of the most frequent search results.
1678
1673
  *
1679
1674
  * Required API Key ACLs:
1680
- * - analytics.
1681
- *
1675
+ * - analytics
1682
1676
  * @param getTopHits - The getTopHits object.
1683
1677
  * @param getTopHits.index - Index name.
1684
1678
  * @param getTopHits.search - Search query.
@@ -1686,8 +1680,8 @@ declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOptio
1686
1680
  * @param getTopHits.revenueAnalytics - Whether to include revenue-related metrics in the response. If true, metrics related to click and conversion events are also included in the response.
1687
1681
  * @param getTopHits.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1688
1682
  * @param getTopHits.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1689
- * @param getTopHits.limit - Number of items to return.
1690
- * @param getTopHits.offset - Position of the first item to return.
1683
+ * @param getTopHits.limit - Number of items to return. Combined with the `offset` parameter, only the first 1000 items can be retrieved.
1684
+ * @param getTopHits.offset - Position of the first item to return. Combined with the `limit` parameter, only the first 1000 items can be retrieved.
1691
1685
  * @param getTopHits.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1692
1686
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1693
1687
  */
@@ -1696,8 +1690,7 @@ declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOptio
1696
1690
  * Returns the most popular search terms.
1697
1691
  *
1698
1692
  * Required API Key ACLs:
1699
- * - analytics.
1700
- *
1693
+ * - analytics
1701
1694
  * @param getTopSearches - The getTopSearches object.
1702
1695
  * @param getTopSearches.index - Index name.
1703
1696
  * @param getTopSearches.clickAnalytics - Whether to include metrics related to click and conversion events in the response.
@@ -1706,8 +1699,8 @@ declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOptio
1706
1699
  * @param getTopSearches.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1707
1700
  * @param getTopSearches.orderBy - Attribute by which to order the response items. If the `clickAnalytics` parameter is false, only `searchCount` is available.
1708
1701
  * @param getTopSearches.direction - Sorting direction of the results: ascending or descending.
1709
- * @param getTopSearches.limit - Number of items to return.
1710
- * @param getTopSearches.offset - Position of the first item to return.
1702
+ * @param getTopSearches.limit - Number of items to return. Combined with the `offset` parameter, only the first 1000 items can be retrieved.
1703
+ * @param getTopSearches.offset - Position of the first item to return. Combined with the `limit` parameter, only the first 1000 items can be retrieved.
1711
1704
  * @param getTopSearches.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1712
1705
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1713
1706
  */
@@ -1716,8 +1709,7 @@ declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOptio
1716
1709
  * Retrieves the number of unique users within a time range, including a daily breakdown. Since this endpoint returns the number of unique users, the sum of the daily values might be different from the total number. By default, Algolia distinguishes search users by their IP address, _unless_ you include a pseudonymous user identifier in your search requests with the `userToken` API parameter or `x-algolia-usertoken` request header. By default, the analyzed period includes the last eight days including the current day.
1717
1710
  *
1718
1711
  * Required API Key ACLs:
1719
- * - analytics.
1720
- *
1712
+ * - analytics
1721
1713
  * @param getUsersCount - The getUsersCount object.
1722
1714
  * @param getUsersCount.index - Index name.
1723
1715
  * @param getUsersCount.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.