@algolia/client-analytics 5.0.0-alpha.99 → 5.0.0-beta.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.
Files changed (186) hide show
  1. package/dist/builds/browser.d.ts +37 -3
  2. package/dist/builds/browser.d.ts.map +1 -1
  3. package/dist/builds/node.d.ts +37 -3
  4. package/dist/builds/node.d.ts.map +1 -1
  5. package/dist/client-analytics.cjs +314 -153
  6. package/dist/client-analytics.esm.browser.js +300 -144
  7. package/dist/client-analytics.esm.node.js +314 -153
  8. package/dist/client-analytics.umd.js +2 -2
  9. package/dist/model/clickPositionsInner.d.ts +14 -0
  10. package/dist/model/clickPositionsInner.d.ts.map +1 -0
  11. package/dist/model/clientMethodProps.d.ts +161 -90
  12. package/dist/model/clientMethodProps.d.ts.map +1 -1
  13. package/dist/model/currenciesValue.d.ts +14 -0
  14. package/dist/model/currenciesValue.d.ts.map +1 -0
  15. package/dist/model/dailyAddToCartRates.d.ts +19 -0
  16. package/dist/model/dailyAddToCartRates.d.ts.map +1 -0
  17. package/dist/model/dailyAverageClicks.d.ts +15 -0
  18. package/dist/model/dailyAverageClicks.d.ts.map +1 -0
  19. package/dist/model/dailyClickThroughRates.d.ts +19 -0
  20. package/dist/model/dailyClickThroughRates.d.ts.map +1 -0
  21. package/dist/model/dailyConversionRates.d.ts +19 -0
  22. package/dist/model/dailyConversionRates.d.ts.map +1 -0
  23. package/dist/model/dailyNoClickRates.d.ts +19 -0
  24. package/dist/model/dailyNoClickRates.d.ts.map +1 -0
  25. package/dist/model/dailyNoResultsRates.d.ts +19 -0
  26. package/dist/model/dailyNoResultsRates.d.ts.map +1 -0
  27. package/dist/model/dailyPurchaseRates.d.ts +19 -0
  28. package/dist/model/dailyPurchaseRates.d.ts.map +1 -0
  29. package/dist/model/dailyRevenue.d.ts +12 -0
  30. package/dist/model/dailyRevenue.d.ts.map +1 -0
  31. package/dist/model/dailySearches.d.ts +11 -0
  32. package/dist/model/dailySearches.d.ts.map +1 -0
  33. package/dist/model/dailySearchesNoClicks.d.ts +15 -0
  34. package/dist/model/dailySearchesNoClicks.d.ts.map +1 -0
  35. package/dist/model/dailySearchesNoResults.d.ts +15 -0
  36. package/dist/model/dailySearchesNoResults.d.ts.map +1 -0
  37. package/dist/model/dailyUsers.d.ts +11 -0
  38. package/dist/model/dailyUsers.d.ts.map +1 -0
  39. package/dist/model/getAddToCartRateResponse.d.ts +20 -0
  40. package/dist/model/getAddToCartRateResponse.d.ts.map +1 -0
  41. package/dist/model/getAverageClickPositionResponse.d.ts +6 -6
  42. package/dist/model/getAverageClickPositionResponse.d.ts.map +1 -1
  43. package/dist/model/getClickPositionsResponse.d.ts +3 -3
  44. package/dist/model/getClickPositionsResponse.d.ts.map +1 -1
  45. package/dist/model/getClickThroughRateResponse.d.ts +7 -7
  46. package/dist/model/getClickThroughRateResponse.d.ts.map +1 -1
  47. package/dist/model/getConversionRateResponse.d.ts +20 -0
  48. package/dist/model/getConversionRateResponse.d.ts.map +1 -0
  49. package/dist/model/getNoClickRateResponse.d.ts +6 -6
  50. package/dist/model/getNoClickRateResponse.d.ts.map +1 -1
  51. package/dist/model/getNoResultsRateResponse.d.ts +6 -6
  52. package/dist/model/getNoResultsRateResponse.d.ts.map +1 -1
  53. package/dist/model/getPurchaseRateResponse.d.ts +20 -0
  54. package/dist/model/getPurchaseRateResponse.d.ts.map +1 -0
  55. package/dist/model/getRevenue.d.ts +13 -0
  56. package/dist/model/getRevenue.d.ts.map +1 -0
  57. package/dist/model/getSearchesCountResponse.d.ts +3 -3
  58. package/dist/model/getSearchesCountResponse.d.ts.map +1 -1
  59. package/dist/model/getSearchesNoClicksResponse.d.ts +3 -3
  60. package/dist/model/getSearchesNoClicksResponse.d.ts.map +1 -1
  61. package/dist/model/getSearchesNoResultsResponse.d.ts +3 -3
  62. package/dist/model/getSearchesNoResultsResponse.d.ts.map +1 -1
  63. package/dist/model/getStatusResponse.d.ts +2 -2
  64. package/dist/model/getStatusResponse.d.ts.map +1 -1
  65. package/dist/model/getTopCountriesResponse.d.ts +1 -1
  66. package/dist/model/getTopFilterAttributesResponse.d.ts +1 -1
  67. package/dist/model/getTopFilterForAttribute.d.ts +2 -4
  68. package/dist/model/getTopFilterForAttribute.d.ts.map +1 -1
  69. package/dist/model/getTopFiltersNoResultsResponse.d.ts +2 -2
  70. package/dist/model/getTopFiltersNoResultsResponse.d.ts.map +1 -1
  71. package/dist/model/getTopFiltersNoResultsValue.d.ts +2 -4
  72. package/dist/model/getTopFiltersNoResultsValue.d.ts.map +1 -1
  73. package/dist/model/getTopHitsResponse.d.ts +2 -1
  74. package/dist/model/getTopHitsResponse.d.ts.map +1 -1
  75. package/dist/model/getTopSearchesResponse.d.ts +2 -1
  76. package/dist/model/getTopSearchesResponse.d.ts.map +1 -1
  77. package/dist/model/getUsersCountResponse.d.ts +4 -4
  78. package/dist/model/getUsersCountResponse.d.ts.map +1 -1
  79. package/dist/model/index.d.ts +23 -11
  80. package/dist/model/index.d.ts.map +1 -1
  81. package/dist/model/operator.d.ts +5 -0
  82. package/dist/model/operator.d.ts.map +1 -0
  83. package/dist/model/orderBy.d.ts +1 -1
  84. package/dist/model/topCountry.d.ts +1 -1
  85. package/dist/model/topHit.d.ts +1 -1
  86. package/dist/model/topHitWithAnalytics.d.ts +9 -9
  87. package/dist/model/topHitWithAnalytics.d.ts.map +1 -1
  88. package/dist/model/topHitWithRevenueAnalytics.d.ts +52 -0
  89. package/dist/model/topHitWithRevenueAnalytics.d.ts.map +1 -0
  90. package/dist/model/topHitsResponse.d.ts +1 -1
  91. package/dist/model/topHitsResponseWithAnalytics.d.ts +1 -1
  92. package/dist/model/topHitsResponseWithRevenueAnalytics.d.ts +8 -0
  93. package/dist/model/topHitsResponseWithRevenueAnalytics.d.ts.map +1 -0
  94. package/dist/model/topSearch.d.ts +3 -3
  95. package/dist/model/topSearchWithAnalytics.d.ts +17 -12
  96. package/dist/model/topSearchWithAnalytics.d.ts.map +1 -1
  97. package/dist/model/topSearchWithRevenueAnalytics.d.ts +65 -0
  98. package/dist/model/topSearchWithRevenueAnalytics.d.ts.map +1 -0
  99. package/dist/model/topSearchesResponse.d.ts +1 -1
  100. package/dist/model/topSearchesResponseWithAnalytics.d.ts +1 -1
  101. package/dist/model/topSearchesResponseWithRevenueAnalytics.d.ts +8 -0
  102. package/dist/model/topSearchesResponseWithRevenueAnalytics.d.ts.map +1 -0
  103. package/dist/src/analyticsClient.d.ts +211 -138
  104. package/dist/src/analyticsClient.d.ts.map +1 -1
  105. package/model/clickPositionsInner.ts +16 -0
  106. package/model/clientMethodProps.ts +164 -90
  107. package/model/currenciesValue.ts +16 -0
  108. package/model/dailyAddToCartRates.ts +23 -0
  109. package/model/dailyAverageClicks.ts +18 -0
  110. package/model/dailyClickThroughRates.ts +23 -0
  111. package/model/dailyConversionRates.ts +23 -0
  112. package/model/dailyNoClickRates.ts +23 -0
  113. package/model/dailyNoResultsRates.ts +23 -0
  114. package/model/dailyPurchaseRates.ts +23 -0
  115. package/model/dailyRevenue.ts +15 -0
  116. package/model/{searchEvent.ts → dailySearches.ts} +2 -2
  117. package/model/{searchNoResultEvent.ts → dailySearchesNoClicks.ts} +4 -4
  118. package/model/{searchNoClickEvent.ts → dailySearchesNoResults.ts} +3 -3
  119. package/model/{userWithDate.ts → dailyUsers.ts} +3 -3
  120. package/model/getAddToCartRateResponse.ts +25 -0
  121. package/model/getAverageClickPositionResponse.ts +6 -6
  122. package/model/getClickPositionsResponse.ts +3 -3
  123. package/model/getClickThroughRateResponse.ts +7 -7
  124. package/model/getConversionRateResponse.ts +25 -0
  125. package/model/getNoClickRateResponse.ts +6 -6
  126. package/model/getNoResultsRateResponse.ts +6 -6
  127. package/model/getPurchaseRateResponse.ts +25 -0
  128. package/model/getRevenue.ts +16 -0
  129. package/model/getSearchesCountResponse.ts +3 -3
  130. package/model/getSearchesNoClicksResponse.ts +3 -3
  131. package/model/getSearchesNoResultsResponse.ts +3 -3
  132. package/model/getStatusResponse.ts +2 -2
  133. package/model/getTopCountriesResponse.ts +1 -1
  134. package/model/getTopFilterAttributesResponse.ts +1 -1
  135. package/model/getTopFilterForAttribute.ts +3 -4
  136. package/model/getTopFiltersNoResultsResponse.ts +2 -2
  137. package/model/getTopFiltersNoResultsValue.ts +3 -4
  138. package/model/getTopHitsResponse.ts +5 -1
  139. package/model/getTopSearchesResponse.ts +3 -1
  140. package/model/getUsersCountResponse.ts +4 -4
  141. package/model/index.ts +23 -11
  142. package/model/operator.ts +6 -0
  143. package/model/orderBy.ts +1 -1
  144. package/model/topCountry.ts +1 -1
  145. package/model/topHit.ts +1 -1
  146. package/model/topHitWithAnalytics.ts +9 -9
  147. package/model/topHitWithRevenueAnalytics.ts +65 -0
  148. package/model/topHitsResponse.ts +1 -1
  149. package/model/topHitsResponseWithAnalytics.ts +1 -1
  150. package/model/topHitsResponseWithRevenueAnalytics.ts +10 -0
  151. package/model/topSearch.ts +3 -3
  152. package/model/topSearchWithAnalytics.ts +19 -12
  153. package/model/topSearchWithRevenueAnalytics.ts +81 -0
  154. package/model/topSearchesResponse.ts +1 -1
  155. package/model/topSearchesResponseWithAnalytics.ts +1 -1
  156. package/model/topSearchesResponseWithRevenueAnalytics.ts +10 -0
  157. package/package.json +7 -7
  158. package/dist/model/averageClickEvent.d.ts +0 -15
  159. package/dist/model/averageClickEvent.d.ts.map +0 -1
  160. package/dist/model/clickPosition.d.ts +0 -11
  161. package/dist/model/clickPosition.d.ts.map +0 -1
  162. package/dist/model/clickThroughRateEvent.d.ts +0 -19
  163. package/dist/model/clickThroughRateEvent.d.ts.map +0 -1
  164. package/dist/model/conversionRateEvent.d.ts +0 -19
  165. package/dist/model/conversionRateEvent.d.ts.map +0 -1
  166. package/dist/model/getConversationRateResponse.d.ts +0 -20
  167. package/dist/model/getConversationRateResponse.d.ts.map +0 -1
  168. package/dist/model/noClickRateEvent.d.ts +0 -19
  169. package/dist/model/noClickRateEvent.d.ts.map +0 -1
  170. package/dist/model/noResultsRateEvent.d.ts +0 -19
  171. package/dist/model/noResultsRateEvent.d.ts.map +0 -1
  172. package/dist/model/searchEvent.d.ts +0 -11
  173. package/dist/model/searchEvent.d.ts.map +0 -1
  174. package/dist/model/searchNoClickEvent.d.ts +0 -15
  175. package/dist/model/searchNoClickEvent.d.ts.map +0 -1
  176. package/dist/model/searchNoResultEvent.d.ts +0 -15
  177. package/dist/model/searchNoResultEvent.d.ts.map +0 -1
  178. package/dist/model/userWithDate.d.ts +0 -11
  179. package/dist/model/userWithDate.d.ts.map +0 -1
  180. package/model/averageClickEvent.ts +0 -18
  181. package/model/clickPosition.ts +0 -13
  182. package/model/clickThroughRateEvent.ts +0 -23
  183. package/model/conversionRateEvent.ts +0 -23
  184. package/model/getConversationRateResponse.ts +0 -25
  185. package/model/noClickRateEvent.ts +0 -23
  186. package/model/noResultsRateEvent.ts +0 -23
@@ -2,7 +2,7 @@ import { createAuth, createTransporter, getAlgoliaAgent, DEFAULT_CONNECT_TIMEOUT
2
2
  import { createHttpRequester } from '@algolia/requester-node-http';
3
3
 
4
4
  // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
5
- const apiClientVersion = '5.0.0-alpha.99';
5
+ const apiClientVersion = '5.0.0-beta.1';
6
6
  const REGIONS = ['de', 'us'];
7
7
  function getDefaultHosts(region) {
8
8
  const url = !region
@@ -64,7 +64,6 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
64
64
  /**
65
65
  * This method allow you to send requests to the Algolia REST API.
66
66
  *
67
- * @summary Send requests to the Algolia REST API.
68
67
  * @param customDelete - The customDelete object.
69
68
  * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
70
69
  * @param customDelete.parameters - Query parameters to apply to the current query.
@@ -74,7 +73,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
74
73
  if (!path) {
75
74
  throw new Error('Parameter `path` is required when calling `customDelete`.');
76
75
  }
77
- const requestPath = '/1{path}'.replace('{path}', path);
76
+ const requestPath = '/{path}'.replace('{path}', path);
78
77
  const headers = {};
79
78
  const queryParameters = parameters ? parameters : {};
80
79
  const request = {
@@ -88,7 +87,6 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
88
87
  /**
89
88
  * This method allow you to send requests to the Algolia REST API.
90
89
  *
91
- * @summary Send requests to the Algolia REST API.
92
90
  * @param customGet - The customGet object.
93
91
  * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
94
92
  * @param customGet.parameters - Query parameters to apply to the current query.
@@ -98,7 +96,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
98
96
  if (!path) {
99
97
  throw new Error('Parameter `path` is required when calling `customGet`.');
100
98
  }
101
- const requestPath = '/1{path}'.replace('{path}', path);
99
+ const requestPath = '/{path}'.replace('{path}', path);
102
100
  const headers = {};
103
101
  const queryParameters = parameters ? parameters : {};
104
102
  const request = {
@@ -112,7 +110,6 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
112
110
  /**
113
111
  * This method allow you to send requests to the Algolia REST API.
114
112
  *
115
- * @summary Send requests to the Algolia REST API.
116
113
  * @param customPost - The customPost object.
117
114
  * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
118
115
  * @param customPost.parameters - Query parameters to apply to the current query.
@@ -123,7 +120,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
123
120
  if (!path) {
124
121
  throw new Error('Parameter `path` is required when calling `customPost`.');
125
122
  }
126
- const requestPath = '/1{path}'.replace('{path}', path);
123
+ const requestPath = '/{path}'.replace('{path}', path);
127
124
  const headers = {};
128
125
  const queryParameters = parameters ? parameters : {};
129
126
  const request = {
@@ -138,7 +135,6 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
138
135
  /**
139
136
  * This method allow you to send requests to the Algolia REST API.
140
137
  *
141
- * @summary Send requests to the Algolia REST API.
142
138
  * @param customPut - The customPut object.
143
139
  * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
144
140
  * @param customPut.parameters - Query parameters to apply to the current query.
@@ -149,7 +145,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
149
145
  if (!path) {
150
146
  throw new Error('Parameter `path` is required when calling `customPut`.');
151
147
  }
152
- const requestPath = '/1{path}'.replace('{path}', path);
148
+ const requestPath = '/{path}'.replace('{path}', path);
153
149
  const headers = {};
154
150
  const queryParameters = parameters ? parameters : {};
155
151
  const request = {
@@ -162,14 +158,56 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
162
158
  return transporter.request(request, requestOptions);
163
159
  },
164
160
  /**
165
- * Return the average click position for the complete time range and for individual days. > **Note**: If all `positions` have a `clickCount` of `0` or `null`, it means Algolia didn\'t receive any click events for tracked searches. A _tracked_ search is a search request where the `clickAnalytics` parameter is `true`.
161
+ * 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.
162
+ *
163
+ * Required API Key ACLs:
164
+ * - analytics.
165
+ *
166
+ * @param getAddToCartRate - The getAddToCartRate object.
167
+ * @param getAddToCartRate.index - Index name.
168
+ * @param getAddToCartRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
169
+ * @param getAddToCartRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
170
+ * @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/).
171
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
172
+ */
173
+ getAddToCartRate({ index, startDate, endDate, tags }, requestOptions) {
174
+ if (!index) {
175
+ throw new Error('Parameter `index` is required when calling `getAddToCartRate`.');
176
+ }
177
+ const requestPath = '/2/conversions/addToCartRate';
178
+ const headers = {};
179
+ const queryParameters = {};
180
+ if (index !== undefined) {
181
+ queryParameters.index = index.toString();
182
+ }
183
+ if (startDate !== undefined) {
184
+ queryParameters.startDate = startDate.toString();
185
+ }
186
+ if (endDate !== undefined) {
187
+ queryParameters.endDate = endDate.toString();
188
+ }
189
+ if (tags !== undefined) {
190
+ queryParameters.tags = tags.toString();
191
+ }
192
+ const request = {
193
+ method: 'GET',
194
+ path: requestPath,
195
+ queryParameters,
196
+ headers,
197
+ };
198
+ return transporter.request(request, requestOptions);
199
+ },
200
+ /**
201
+ * 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.
202
+ *
203
+ * Required API Key ACLs:
204
+ * - analytics.
166
205
  *
167
- * @summary Get average click position.
168
206
  * @param getAverageClickPosition - The getAverageClickPosition object.
169
- * @param getAverageClickPosition.index - Index name to target.
170
- * @param getAverageClickPosition.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
171
- * @param getAverageClickPosition.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
172
- * @param getAverageClickPosition.tags - Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
207
+ * @param getAverageClickPosition.index - Index name.
208
+ * @param getAverageClickPosition.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
209
+ * @param getAverageClickPosition.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
210
+ * @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/).
173
211
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
174
212
  */
175
213
  getAverageClickPosition({ index, startDate, endDate, tags }, requestOptions) {
@@ -200,14 +238,16 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
200
238
  return transporter.request(request, requestOptions);
201
239
  },
202
240
  /**
203
- * Show the number of clicks events and their associated position in the search results. > **Note**: If all `positions` have a `clickCount` of `0` or `null`, it means Algolia didn\'t receive any click events for tracked searches. A _tracked_ search is a search request where the `clickAnalytics` parameter is `true`.
241
+ * 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.
242
+ *
243
+ * Required API Key ACLs:
244
+ * - analytics.
204
245
  *
205
- * @summary Get click positions.
206
246
  * @param getClickPositions - The getClickPositions object.
207
- * @param getClickPositions.index - Index name to target.
208
- * @param getClickPositions.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
209
- * @param getClickPositions.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
210
- * @param getClickPositions.tags - Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
247
+ * @param getClickPositions.index - Index name.
248
+ * @param getClickPositions.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
249
+ * @param getClickPositions.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
250
+ * @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/).
211
251
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
212
252
  */
213
253
  getClickPositions({ index, startDate, endDate, tags }, requestOptions) {
@@ -238,14 +278,16 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
238
278
  return transporter.request(request, requestOptions);
239
279
  },
240
280
  /**
241
- * Returns a [click-through rate (CTR)](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#click-through-rate).
281
+ * 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.
282
+ *
283
+ * Required API Key ACLs:
284
+ * - analytics.
242
285
  *
243
- * @summary Get click-through rate (CTR).
244
286
  * @param getClickThroughRate - The getClickThroughRate object.
245
- * @param getClickThroughRate.index - Index name to target.
246
- * @param getClickThroughRate.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
247
- * @param getClickThroughRate.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
248
- * @param getClickThroughRate.tags - Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
287
+ * @param getClickThroughRate.index - Index name.
288
+ * @param getClickThroughRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
289
+ * @param getClickThroughRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
290
+ * @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/).
249
291
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
250
292
  */
251
293
  getClickThroughRate({ index, startDate, endDate, tags }, requestOptions) {
@@ -276,19 +318,21 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
276
318
  return transporter.request(request, requestOptions);
277
319
  },
278
320
  /**
279
- * Return a [conversion rate](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#conversion-rate).
280
- *
281
- * @summary Get conversion rate (CR).
282
- * @param getConversationRate - The getConversationRate object.
283
- * @param getConversationRate.index - Index name to target.
284
- * @param getConversationRate.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
285
- * @param getConversationRate.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
286
- * @param getConversationRate.tags - Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
321
+ * 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.
322
+ *
323
+ * Required API Key ACLs:
324
+ * - analytics.
325
+ *
326
+ * @param getConversionRate - The getConversionRate object.
327
+ * @param getConversionRate.index - Index name.
328
+ * @param getConversionRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
329
+ * @param getConversionRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
330
+ * @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/).
287
331
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
288
332
  */
289
- getConversationRate({ index, startDate, endDate, tags }, requestOptions) {
333
+ getConversionRate({ index, startDate, endDate, tags }, requestOptions) {
290
334
  if (!index) {
291
- throw new Error('Parameter `index` is required when calling `getConversationRate`.');
335
+ throw new Error('Parameter `index` is required when calling `getConversionRate`.');
292
336
  }
293
337
  const requestPath = '/2/conversions/conversionRate';
294
338
  const headers = {};
@@ -314,14 +358,16 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
314
358
  return transporter.request(request, requestOptions);
315
359
  },
316
360
  /**
317
- * Returns the rate at which searches don\'t lead to any clicks. The endpoint returns a value for the complete given time range, as well as a value per day. It also returns the count of searches and searches without clicks.
361
+ * 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.
362
+ *
363
+ * Required API Key ACLs:
364
+ * - analytics.
318
365
  *
319
- * @summary Get no click rate.
320
366
  * @param getNoClickRate - The getNoClickRate object.
321
- * @param getNoClickRate.index - Index name to target.
322
- * @param getNoClickRate.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
323
- * @param getNoClickRate.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
324
- * @param getNoClickRate.tags - Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
367
+ * @param getNoClickRate.index - Index name.
368
+ * @param getNoClickRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
369
+ * @param getNoClickRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
370
+ * @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/).
325
371
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
326
372
  */
327
373
  getNoClickRate({ index, startDate, endDate, tags }, requestOptions) {
@@ -352,14 +398,16 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
352
398
  return transporter.request(request, requestOptions);
353
399
  },
354
400
  /**
355
- * Returns the rate at which searches didn\'t return any results.
401
+ * 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.
402
+ *
403
+ * Required API Key ACLs:
404
+ * - analytics.
356
405
  *
357
- * @summary Get no results rate.
358
406
  * @param getNoResultsRate - The getNoResultsRate object.
359
- * @param getNoResultsRate.index - Index name to target.
360
- * @param getNoResultsRate.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
361
- * @param getNoResultsRate.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
362
- * @param getNoResultsRate.tags - Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
407
+ * @param getNoResultsRate.index - Index name.
408
+ * @param getNoResultsRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
409
+ * @param getNoResultsRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
410
+ * @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/).
363
411
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
364
412
  */
365
413
  getNoResultsRate({ index, startDate, endDate, tags }, requestOptions) {
@@ -390,14 +438,96 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
390
438
  return transporter.request(request, requestOptions);
391
439
  },
392
440
  /**
393
- * Returns the number of searches within a time range.
441
+ * 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.
442
+ *
443
+ * Required API Key ACLs:
444
+ * - analytics.
445
+ *
446
+ * @param getPurchaseRate - The getPurchaseRate object.
447
+ * @param getPurchaseRate.index - Index name.
448
+ * @param getPurchaseRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
449
+ * @param getPurchaseRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
450
+ * @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/).
451
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
452
+ */
453
+ getPurchaseRate({ index, startDate, endDate, tags }, requestOptions) {
454
+ if (!index) {
455
+ throw new Error('Parameter `index` is required when calling `getPurchaseRate`.');
456
+ }
457
+ const requestPath = '/2/conversions/purchaseRate';
458
+ const headers = {};
459
+ const queryParameters = {};
460
+ if (index !== undefined) {
461
+ queryParameters.index = index.toString();
462
+ }
463
+ if (startDate !== undefined) {
464
+ queryParameters.startDate = startDate.toString();
465
+ }
466
+ if (endDate !== undefined) {
467
+ queryParameters.endDate = endDate.toString();
468
+ }
469
+ if (tags !== undefined) {
470
+ queryParameters.tags = tags.toString();
471
+ }
472
+ const request = {
473
+ method: 'GET',
474
+ path: requestPath,
475
+ queryParameters,
476
+ headers,
477
+ };
478
+ return transporter.request(request, requestOptions);
479
+ },
480
+ /**
481
+ * 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.
482
+ *
483
+ * Required API Key ACLs:
484
+ * - analytics.
485
+ *
486
+ * @param getRevenue - The getRevenue object.
487
+ * @param getRevenue.index - Index name.
488
+ * @param getRevenue.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
489
+ * @param getRevenue.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
490
+ * @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/).
491
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
492
+ */
493
+ getRevenue({ index, startDate, endDate, tags }, requestOptions) {
494
+ if (!index) {
495
+ throw new Error('Parameter `index` is required when calling `getRevenue`.');
496
+ }
497
+ const requestPath = '/2/conversions/revenue';
498
+ const headers = {};
499
+ const queryParameters = {};
500
+ if (index !== undefined) {
501
+ queryParameters.index = index.toString();
502
+ }
503
+ if (startDate !== undefined) {
504
+ queryParameters.startDate = startDate.toString();
505
+ }
506
+ if (endDate !== undefined) {
507
+ queryParameters.endDate = endDate.toString();
508
+ }
509
+ if (tags !== undefined) {
510
+ queryParameters.tags = tags.toString();
511
+ }
512
+ const request = {
513
+ method: 'GET',
514
+ path: requestPath,
515
+ queryParameters,
516
+ headers,
517
+ };
518
+ return transporter.request(request, requestOptions);
519
+ },
520
+ /**
521
+ * 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.
522
+ *
523
+ * Required API Key ACLs:
524
+ * - analytics.
394
525
  *
395
- * @summary Get number of searches.
396
526
  * @param getSearchesCount - The getSearchesCount object.
397
- * @param getSearchesCount.index - Index name to target.
398
- * @param getSearchesCount.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
399
- * @param getSearchesCount.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
400
- * @param getSearchesCount.tags - Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
527
+ * @param getSearchesCount.index - Index name.
528
+ * @param getSearchesCount.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
529
+ * @param getSearchesCount.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
530
+ * @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/).
401
531
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
402
532
  */
403
533
  getSearchesCount({ index, startDate, endDate, tags }, requestOptions) {
@@ -428,16 +558,18 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
428
558
  return transporter.request(request, requestOptions);
429
559
  },
430
560
  /**
431
- * Return the most popular of the last 1,000 searches that didn\'t lead to any clicks.
561
+ * Retrieves the most popular searches that didn\'t lead to any clicks, from the 1,000 most frequent searches.
562
+ *
563
+ * Required API Key ACLs:
564
+ * - analytics.
432
565
  *
433
- * @summary Get top searches with no clicks.
434
566
  * @param getSearchesNoClicks - The getSearchesNoClicks object.
435
- * @param getSearchesNoClicks.index - Index name to target.
436
- * @param getSearchesNoClicks.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
437
- * @param getSearchesNoClicks.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
438
- * @param getSearchesNoClicks.limit - Number of records to return (page size).
439
- * @param getSearchesNoClicks.offset - Position of the starting record. Used for paging. 0 is the first record.
440
- * @param getSearchesNoClicks.tags - Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
567
+ * @param getSearchesNoClicks.index - Index name.
568
+ * @param getSearchesNoClicks.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
569
+ * @param getSearchesNoClicks.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
570
+ * @param getSearchesNoClicks.limit - Number of items to return.
571
+ * @param getSearchesNoClicks.offset - Position of the first item to return.
572
+ * @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/).
441
573
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
442
574
  */
443
575
  getSearchesNoClicks({ index, startDate, endDate, limit, offset, tags, }, requestOptions) {
@@ -474,16 +606,18 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
474
606
  return transporter.request(request, requestOptions);
475
607
  },
476
608
  /**
477
- * Returns the most popular of the latest 1,000 searches that didn\'t return any results.
609
+ * Retrieves the most popular searches that didn\'t return any results.
610
+ *
611
+ * Required API Key ACLs:
612
+ * - analytics.
478
613
  *
479
- * @summary Get top searches with no results.
480
614
  * @param getSearchesNoResults - The getSearchesNoResults object.
481
- * @param getSearchesNoResults.index - Index name to target.
482
- * @param getSearchesNoResults.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
483
- * @param getSearchesNoResults.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
484
- * @param getSearchesNoResults.limit - Number of records to return (page size).
485
- * @param getSearchesNoResults.offset - Position of the starting record. Used for paging. 0 is the first record.
486
- * @param getSearchesNoResults.tags - Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
615
+ * @param getSearchesNoResults.index - Index name.
616
+ * @param getSearchesNoResults.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
617
+ * @param getSearchesNoResults.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
618
+ * @param getSearchesNoResults.limit - Number of items to return.
619
+ * @param getSearchesNoResults.offset - Position of the first item to return.
620
+ * @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/).
487
621
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
488
622
  */
489
623
  getSearchesNoResults({ index, startDate, endDate, limit, offset, tags, }, requestOptions) {
@@ -520,11 +654,13 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
520
654
  return transporter.request(request, requestOptions);
521
655
  },
522
656
  /**
523
- * Return the latest update time of the Analytics API for an index. If the index has been recently created or no search has been performed yet, `updatedAt` will be `null`. > **Note**: The Analytics API is updated every 5 minutes.
657
+ * Retrieves the time when the Analytics data for the specified index was last updated. The Analytics data is updated every 5 minutes.
658
+ *
659
+ * Required API Key ACLs:
660
+ * - analytics.
524
661
  *
525
- * @summary Get Analytics API status.
526
662
  * @param getStatus - The getStatus object.
527
- * @param getStatus.index - Index name to target.
663
+ * @param getStatus.index - Index name.
528
664
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
529
665
  */
530
666
  getStatus({ index }, requestOptions) {
@@ -546,16 +682,18 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
546
682
  return transporter.request(request, requestOptions);
547
683
  },
548
684
  /**
549
- * Returns top countries. Limited to the 1,000 most frequent ones.
685
+ * Retrieves the countries with the most searches to your index.
686
+ *
687
+ * Required API Key ACLs:
688
+ * - analytics.
550
689
  *
551
- * @summary Get top countries.
552
690
  * @param getTopCountries - The getTopCountries object.
553
- * @param getTopCountries.index - Index name to target.
554
- * @param getTopCountries.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
555
- * @param getTopCountries.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
556
- * @param getTopCountries.limit - Number of records to return (page size).
557
- * @param getTopCountries.offset - Position of the starting record. Used for paging. 0 is the first record.
558
- * @param getTopCountries.tags - Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
691
+ * @param getTopCountries.index - Index name.
692
+ * @param getTopCountries.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
693
+ * @param getTopCountries.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
694
+ * @param getTopCountries.limit - Number of items to return.
695
+ * @param getTopCountries.offset - Position of the first item to return.
696
+ * @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/).
559
697
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
560
698
  */
561
699
  getTopCountries({ index, startDate, endDate, limit, offset, tags }, requestOptions) {
@@ -592,17 +730,19 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
592
730
  return transporter.request(request, requestOptions);
593
731
  },
594
732
  /**
595
- * Return the most popular [filterable attributes](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/) in the 1,000 most recently used filters.
733
+ * Retrieves the most frequently used filter attributes. These are attributes of your records that you included in the `attributesForFaceting` setting.
734
+ *
735
+ * Required API Key ACLs:
736
+ * - analytics.
596
737
  *
597
- * @summary Get top filterable attributes.
598
738
  * @param getTopFilterAttributes - The getTopFilterAttributes object.
599
- * @param getTopFilterAttributes.index - Index name to target.
600
- * @param getTopFilterAttributes.search - User query.
601
- * @param getTopFilterAttributes.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
602
- * @param getTopFilterAttributes.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
603
- * @param getTopFilterAttributes.limit - Number of records to return (page size).
604
- * @param getTopFilterAttributes.offset - Position of the starting record. Used for paging. 0 is the first record.
605
- * @param getTopFilterAttributes.tags - Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
739
+ * @param getTopFilterAttributes.index - Index name.
740
+ * @param getTopFilterAttributes.search - Search query.
741
+ * @param getTopFilterAttributes.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
742
+ * @param getTopFilterAttributes.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
743
+ * @param getTopFilterAttributes.limit - Number of items to return.
744
+ * @param getTopFilterAttributes.offset - Position of the first item to return.
745
+ * @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/).
606
746
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
607
747
  */
608
748
  getTopFilterAttributes({ index, search, startDate, endDate, limit, offset, tags, }, requestOptions) {
@@ -642,18 +782,20 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
642
782
  return transporter.request(request, requestOptions);
643
783
  },
644
784
  /**
645
- * Returns the most popular filter values for an attribute in the 1,000 most recently used filters.
785
+ * Retrieves the most frequent filter (facet) values for a filter attribute. These are attributes of your records that you included in the `attributesForFaceting` setting.
786
+ *
787
+ * Required API Key ACLs:
788
+ * - analytics.
646
789
  *
647
- * @summary Get top filter values for an attribute.
648
790
  * @param getTopFilterForAttribute - The getTopFilterForAttribute object.
649
791
  * @param getTopFilterForAttribute.attribute - Attribute name.
650
- * @param getTopFilterForAttribute.index - Index name to target.
651
- * @param getTopFilterForAttribute.search - User query.
652
- * @param getTopFilterForAttribute.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
653
- * @param getTopFilterForAttribute.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
654
- * @param getTopFilterForAttribute.limit - Number of records to return (page size).
655
- * @param getTopFilterForAttribute.offset - Position of the starting record. Used for paging. 0 is the first record.
656
- * @param getTopFilterForAttribute.tags - Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
792
+ * @param getTopFilterForAttribute.index - Index name.
793
+ * @param getTopFilterForAttribute.search - Search query.
794
+ * @param getTopFilterForAttribute.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
795
+ * @param getTopFilterForAttribute.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
796
+ * @param getTopFilterForAttribute.limit - Number of items to return.
797
+ * @param getTopFilterForAttribute.offset - Position of the first item to return.
798
+ * @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/).
657
799
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
658
800
  */
659
801
  getTopFilterForAttribute({ attribute, index, search, startDate, endDate, limit, offset, tags, }, requestOptions) {
@@ -696,17 +838,19 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
696
838
  return transporter.request(request, requestOptions);
697
839
  },
698
840
  /**
699
- * Returns top filters for filter-enabled searches that don\'t return results. Limited to the 1,000 most recently used filters.
841
+ * 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.
842
+ *
843
+ * Required API Key ACLs:
844
+ * - analytics.
700
845
  *
701
- * @summary Get top filters for a no result search.
702
846
  * @param getTopFiltersNoResults - The getTopFiltersNoResults object.
703
- * @param getTopFiltersNoResults.index - Index name to target.
704
- * @param getTopFiltersNoResults.search - User query.
705
- * @param getTopFiltersNoResults.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
706
- * @param getTopFiltersNoResults.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
707
- * @param getTopFiltersNoResults.limit - Number of records to return (page size).
708
- * @param getTopFiltersNoResults.offset - Position of the starting record. Used for paging. 0 is the first record.
709
- * @param getTopFiltersNoResults.tags - Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
847
+ * @param getTopFiltersNoResults.index - Index name.
848
+ * @param getTopFiltersNoResults.search - Search query.
849
+ * @param getTopFiltersNoResults.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
850
+ * @param getTopFiltersNoResults.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
851
+ * @param getTopFiltersNoResults.limit - Number of items to return.
852
+ * @param getTopFiltersNoResults.offset - Position of the first item to return.
853
+ * @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/).
710
854
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
711
855
  */
712
856
  getTopFiltersNoResults({ index, search, startDate, endDate, limit, offset, tags, }, requestOptions) {
@@ -746,21 +890,24 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
746
890
  return transporter.request(request, requestOptions);
747
891
  },
748
892
  /**
749
- * Return the most popular clicked results in the last 1,000 searches.
893
+ * Retrieves the object IDs of the most frequent search results.
894
+ *
895
+ * Required API Key ACLs:
896
+ * - analytics.
750
897
  *
751
- * @summary Get top hits.
752
898
  * @param getTopHits - The getTopHits object.
753
- * @param getTopHits.index - Index name to target.
754
- * @param getTopHits.search - User query.
755
- * @param getTopHits.clickAnalytics - Whether to include [click and conversion](https://www.algolia.com/doc/guides/sending-events/getting-started/) rates for a search.
756
- * @param getTopHits.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
757
- * @param getTopHits.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
758
- * @param getTopHits.limit - Number of records to return (page size).
759
- * @param getTopHits.offset - Position of the starting record. Used for paging. 0 is the first record.
760
- * @param getTopHits.tags - Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
899
+ * @param getTopHits.index - Index name.
900
+ * @param getTopHits.search - Search query.
901
+ * @param getTopHits.clickAnalytics - Whether to include metrics related to click and conversion events in the response.
902
+ * @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.
903
+ * @param getTopHits.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
904
+ * @param getTopHits.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
905
+ * @param getTopHits.limit - Number of items to return.
906
+ * @param getTopHits.offset - Position of the first item to return.
907
+ * @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/).
761
908
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
762
909
  */
763
- getTopHits({ index, search, clickAnalytics, startDate, endDate, limit, offset, tags, }, requestOptions) {
910
+ getTopHits({ index, search, clickAnalytics, revenueAnalytics, startDate, endDate, limit, offset, tags, }, requestOptions) {
764
911
  if (!index) {
765
912
  throw new Error('Parameter `index` is required when calling `getTopHits`.');
766
913
  }
@@ -776,6 +923,9 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
776
923
  if (clickAnalytics !== undefined) {
777
924
  queryParameters.clickAnalytics = clickAnalytics.toString();
778
925
  }
926
+ if (revenueAnalytics !== undefined) {
927
+ queryParameters.revenueAnalytics = revenueAnalytics.toString();
928
+ }
779
929
  if (startDate !== undefined) {
780
930
  queryParameters.startDate = startDate.toString();
781
931
  }
@@ -800,22 +950,25 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
800
950
  return transporter.request(request, requestOptions);
801
951
  },
802
952
  /**
803
- * Returns the most popular of the latest 1,000 searches. For each search, also returns the number of hits.
953
+ * Returns the most popular search terms.
954
+ *
955
+ * Required API Key ACLs:
956
+ * - analytics.
804
957
  *
805
- * @summary Get top searches.
806
958
  * @param getTopSearches - The getTopSearches object.
807
- * @param getTopSearches.index - Index name to target.
808
- * @param getTopSearches.clickAnalytics - Whether to include [click and conversion](https://www.algolia.com/doc/guides/sending-events/getting-started/) rates for a search.
809
- * @param getTopSearches.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
810
- * @param getTopSearches.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
811
- * @param getTopSearches.orderBy - Reorder the results.
959
+ * @param getTopSearches.index - Index name.
960
+ * @param getTopSearches.clickAnalytics - Whether to include metrics related to click and conversion events in the response.
961
+ * @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.
962
+ * @param getTopSearches.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
963
+ * @param getTopSearches.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
964
+ * @param getTopSearches.orderBy - Attribute by which to order the response items. If the `clickAnalytics` parameter is false, only `searchCount` is available.
812
965
  * @param getTopSearches.direction - Sorting direction of the results: ascending or descending.
813
- * @param getTopSearches.limit - Number of records to return (page size).
814
- * @param getTopSearches.offset - Position of the starting record. Used for paging. 0 is the first record.
815
- * @param getTopSearches.tags - Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
966
+ * @param getTopSearches.limit - Number of items to return.
967
+ * @param getTopSearches.offset - Position of the first item to return.
968
+ * @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/).
816
969
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
817
970
  */
818
- getTopSearches({ index, clickAnalytics, startDate, endDate, orderBy, direction, limit, offset, tags, }, requestOptions) {
971
+ getTopSearches({ index, clickAnalytics, revenueAnalytics, startDate, endDate, orderBy, direction, limit, offset, tags, }, requestOptions) {
819
972
  if (!index) {
820
973
  throw new Error('Parameter `index` is required when calling `getTopSearches`.');
821
974
  }
@@ -828,6 +981,9 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
828
981
  if (clickAnalytics !== undefined) {
829
982
  queryParameters.clickAnalytics = clickAnalytics.toString();
830
983
  }
984
+ if (revenueAnalytics !== undefined) {
985
+ queryParameters.revenueAnalytics = revenueAnalytics.toString();
986
+ }
831
987
  if (startDate !== undefined) {
832
988
  queryParameters.startDate = startDate.toString();
833
989
  }
@@ -858,14 +1014,16 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
858
1014
  return transporter.request(request, requestOptions);
859
1015
  },
860
1016
  /**
861
- * Return the count of unique users.
1017
+ * 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.
1018
+ *
1019
+ * Required API Key ACLs:
1020
+ * - analytics.
862
1021
  *
863
- * @summary Get user count.
864
1022
  * @param getUsersCount - The getUsersCount object.
865
- * @param getUsersCount.index - Index name to target.
866
- * @param getUsersCount.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
867
- * @param getUsersCount.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
868
- * @param getUsersCount.tags - Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
1023
+ * @param getUsersCount.index - Index name.
1024
+ * @param getUsersCount.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1025
+ * @param getUsersCount.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1026
+ * @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/).
869
1027
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
870
1028
  */
871
1029
  getUsersCount({ index, startDate, endDate, tags }, requestOptions) {
@@ -899,6 +1057,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
899
1057
  }
900
1058
 
901
1059
  // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
1060
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
902
1061
  function analyticsClient(appId, apiKey, region, options) {
903
1062
  if (!appId || typeof appId !== 'string') {
904
1063
  throw new Error('`appId` is missing.');
@@ -909,22 +1068,24 @@ function analyticsClient(appId, apiKey, region, options) {
909
1068
  if (region && (typeof region !== 'string' || !REGIONS.includes(region))) {
910
1069
  throw new Error(`\`region\` must be one of the following: ${REGIONS.join(', ')}`);
911
1070
  }
912
- return createAnalyticsClient({
913
- appId,
914
- apiKey,
915
- region,
916
- timeouts: {
917
- connect: DEFAULT_CONNECT_TIMEOUT_NODE,
918
- read: DEFAULT_READ_TIMEOUT_NODE,
919
- write: DEFAULT_WRITE_TIMEOUT_NODE,
920
- },
921
- requester: createHttpRequester(),
922
- algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
923
- responsesCache: createNullCache(),
924
- requestsCache: createNullCache(),
925
- hostsCache: createMemoryCache(),
926
- ...options,
927
- });
1071
+ return {
1072
+ ...createAnalyticsClient({
1073
+ appId,
1074
+ apiKey,
1075
+ region,
1076
+ timeouts: {
1077
+ connect: DEFAULT_CONNECT_TIMEOUT_NODE,
1078
+ read: DEFAULT_READ_TIMEOUT_NODE,
1079
+ write: DEFAULT_WRITE_TIMEOUT_NODE,
1080
+ },
1081
+ requester: createHttpRequester(),
1082
+ algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
1083
+ responsesCache: createNullCache(),
1084
+ requestsCache: createNullCache(),
1085
+ hostsCache: createMemoryCache(),
1086
+ ...options,
1087
+ }),
1088
+ };
928
1089
  }
929
1090
 
930
1091
  export { analyticsClient, apiClientVersion };