@algolia/client-analytics 5.2.5 → 5.3.1

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