@algolia/client-analytics 5.0.0-alpha.99 → 5.0.0-beta.10

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 (187) hide show
  1. package/LICENSE +21 -0
  2. package/dist/builds/browser.d.ts +37 -3
  3. package/dist/builds/browser.d.ts.map +1 -1
  4. package/dist/builds/node.d.ts +37 -3
  5. package/dist/builds/node.d.ts.map +1 -1
  6. package/dist/client-analytics.cjs +314 -153
  7. package/dist/client-analytics.esm.browser.js +309 -160
  8. package/dist/client-analytics.esm.node.js +314 -153
  9. package/dist/client-analytics.umd.js +2 -2
  10. package/dist/model/clickPositionsInner.d.ts +14 -0
  11. package/dist/model/clickPositionsInner.d.ts.map +1 -0
  12. package/dist/model/clientMethodProps.d.ts +161 -90
  13. package/dist/model/clientMethodProps.d.ts.map +1 -1
  14. package/dist/model/currenciesValue.d.ts +14 -0
  15. package/dist/model/currenciesValue.d.ts.map +1 -0
  16. package/dist/model/dailyAddToCartRates.d.ts +19 -0
  17. package/dist/model/dailyAddToCartRates.d.ts.map +1 -0
  18. package/dist/model/dailyAverageClicks.d.ts +15 -0
  19. package/dist/model/dailyAverageClicks.d.ts.map +1 -0
  20. package/dist/model/dailyClickThroughRates.d.ts +19 -0
  21. package/dist/model/dailyClickThroughRates.d.ts.map +1 -0
  22. package/dist/model/dailyConversionRates.d.ts +19 -0
  23. package/dist/model/dailyConversionRates.d.ts.map +1 -0
  24. package/dist/model/dailyNoClickRates.d.ts +19 -0
  25. package/dist/model/dailyNoClickRates.d.ts.map +1 -0
  26. package/dist/model/dailyNoResultsRates.d.ts +19 -0
  27. package/dist/model/dailyNoResultsRates.d.ts.map +1 -0
  28. package/dist/model/dailyPurchaseRates.d.ts +19 -0
  29. package/dist/model/dailyPurchaseRates.d.ts.map +1 -0
  30. package/dist/model/dailyRevenue.d.ts +12 -0
  31. package/dist/model/dailyRevenue.d.ts.map +1 -0
  32. package/dist/model/dailySearches.d.ts +11 -0
  33. package/dist/model/dailySearches.d.ts.map +1 -0
  34. package/dist/model/dailySearchesNoClicks.d.ts +15 -0
  35. package/dist/model/dailySearchesNoClicks.d.ts.map +1 -0
  36. package/dist/model/dailySearchesNoResults.d.ts +15 -0
  37. package/dist/model/dailySearchesNoResults.d.ts.map +1 -0
  38. package/dist/model/dailyUsers.d.ts +11 -0
  39. package/dist/model/dailyUsers.d.ts.map +1 -0
  40. package/dist/model/getAddToCartRateResponse.d.ts +20 -0
  41. package/dist/model/getAddToCartRateResponse.d.ts.map +1 -0
  42. package/dist/model/getAverageClickPositionResponse.d.ts +6 -6
  43. package/dist/model/getAverageClickPositionResponse.d.ts.map +1 -1
  44. package/dist/model/getClickPositionsResponse.d.ts +3 -3
  45. package/dist/model/getClickPositionsResponse.d.ts.map +1 -1
  46. package/dist/model/getClickThroughRateResponse.d.ts +7 -7
  47. package/dist/model/getClickThroughRateResponse.d.ts.map +1 -1
  48. package/dist/model/getConversionRateResponse.d.ts +20 -0
  49. package/dist/model/getConversionRateResponse.d.ts.map +1 -0
  50. package/dist/model/getNoClickRateResponse.d.ts +6 -6
  51. package/dist/model/getNoClickRateResponse.d.ts.map +1 -1
  52. package/dist/model/getNoResultsRateResponse.d.ts +6 -6
  53. package/dist/model/getNoResultsRateResponse.d.ts.map +1 -1
  54. package/dist/model/getPurchaseRateResponse.d.ts +20 -0
  55. package/dist/model/getPurchaseRateResponse.d.ts.map +1 -0
  56. package/dist/model/getRevenue.d.ts +13 -0
  57. package/dist/model/getRevenue.d.ts.map +1 -0
  58. package/dist/model/getSearchesCountResponse.d.ts +3 -3
  59. package/dist/model/getSearchesCountResponse.d.ts.map +1 -1
  60. package/dist/model/getSearchesNoClicksResponse.d.ts +3 -3
  61. package/dist/model/getSearchesNoClicksResponse.d.ts.map +1 -1
  62. package/dist/model/getSearchesNoResultsResponse.d.ts +3 -3
  63. package/dist/model/getSearchesNoResultsResponse.d.ts.map +1 -1
  64. package/dist/model/getStatusResponse.d.ts +2 -2
  65. package/dist/model/getStatusResponse.d.ts.map +1 -1
  66. package/dist/model/getTopCountriesResponse.d.ts +1 -1
  67. package/dist/model/getTopFilterAttributesResponse.d.ts +1 -1
  68. package/dist/model/getTopFilterForAttribute.d.ts +2 -4
  69. package/dist/model/getTopFilterForAttribute.d.ts.map +1 -1
  70. package/dist/model/getTopFiltersNoResultsResponse.d.ts +2 -2
  71. package/dist/model/getTopFiltersNoResultsResponse.d.ts.map +1 -1
  72. package/dist/model/getTopFiltersNoResultsValue.d.ts +2 -4
  73. package/dist/model/getTopFiltersNoResultsValue.d.ts.map +1 -1
  74. package/dist/model/getTopHitsResponse.d.ts +2 -1
  75. package/dist/model/getTopHitsResponse.d.ts.map +1 -1
  76. package/dist/model/getTopSearchesResponse.d.ts +2 -1
  77. package/dist/model/getTopSearchesResponse.d.ts.map +1 -1
  78. package/dist/model/getUsersCountResponse.d.ts +4 -4
  79. package/dist/model/getUsersCountResponse.d.ts.map +1 -1
  80. package/dist/model/index.d.ts +23 -11
  81. package/dist/model/index.d.ts.map +1 -1
  82. package/dist/model/operator.d.ts +5 -0
  83. package/dist/model/operator.d.ts.map +1 -0
  84. package/dist/model/orderBy.d.ts +1 -1
  85. package/dist/model/topCountry.d.ts +1 -1
  86. package/dist/model/topHit.d.ts +1 -1
  87. package/dist/model/topHitWithAnalytics.d.ts +9 -9
  88. package/dist/model/topHitWithAnalytics.d.ts.map +1 -1
  89. package/dist/model/topHitWithRevenueAnalytics.d.ts +52 -0
  90. package/dist/model/topHitWithRevenueAnalytics.d.ts.map +1 -0
  91. package/dist/model/topHitsResponse.d.ts +1 -1
  92. package/dist/model/topHitsResponseWithAnalytics.d.ts +1 -1
  93. package/dist/model/topHitsResponseWithRevenueAnalytics.d.ts +8 -0
  94. package/dist/model/topHitsResponseWithRevenueAnalytics.d.ts.map +1 -0
  95. package/dist/model/topSearch.d.ts +3 -3
  96. package/dist/model/topSearchWithAnalytics.d.ts +17 -12
  97. package/dist/model/topSearchWithAnalytics.d.ts.map +1 -1
  98. package/dist/model/topSearchWithRevenueAnalytics.d.ts +65 -0
  99. package/dist/model/topSearchWithRevenueAnalytics.d.ts.map +1 -0
  100. package/dist/model/topSearchesResponse.d.ts +1 -1
  101. package/dist/model/topSearchesResponseWithAnalytics.d.ts +1 -1
  102. package/dist/model/topSearchesResponseWithRevenueAnalytics.d.ts +8 -0
  103. package/dist/model/topSearchesResponseWithRevenueAnalytics.d.ts.map +1 -0
  104. package/dist/src/analyticsClient.d.ts +211 -138
  105. package/dist/src/analyticsClient.d.ts.map +1 -1
  106. package/model/clickPositionsInner.ts +16 -0
  107. package/model/clientMethodProps.ts +164 -90
  108. package/model/currenciesValue.ts +16 -0
  109. package/model/dailyAddToCartRates.ts +23 -0
  110. package/model/dailyAverageClicks.ts +18 -0
  111. package/model/dailyClickThroughRates.ts +23 -0
  112. package/model/dailyConversionRates.ts +23 -0
  113. package/model/dailyNoClickRates.ts +23 -0
  114. package/model/dailyNoResultsRates.ts +23 -0
  115. package/model/dailyPurchaseRates.ts +23 -0
  116. package/model/dailyRevenue.ts +15 -0
  117. package/model/{searchEvent.ts → dailySearches.ts} +2 -2
  118. package/model/{searchNoResultEvent.ts → dailySearchesNoClicks.ts} +4 -4
  119. package/model/{searchNoClickEvent.ts → dailySearchesNoResults.ts} +3 -3
  120. package/model/{userWithDate.ts → dailyUsers.ts} +3 -3
  121. package/model/getAddToCartRateResponse.ts +25 -0
  122. package/model/getAverageClickPositionResponse.ts +6 -6
  123. package/model/getClickPositionsResponse.ts +3 -3
  124. package/model/getClickThroughRateResponse.ts +7 -7
  125. package/model/getConversionRateResponse.ts +25 -0
  126. package/model/getNoClickRateResponse.ts +6 -6
  127. package/model/getNoResultsRateResponse.ts +6 -6
  128. package/model/getPurchaseRateResponse.ts +25 -0
  129. package/model/getRevenue.ts +16 -0
  130. package/model/getSearchesCountResponse.ts +3 -3
  131. package/model/getSearchesNoClicksResponse.ts +3 -3
  132. package/model/getSearchesNoResultsResponse.ts +3 -3
  133. package/model/getStatusResponse.ts +2 -2
  134. package/model/getTopCountriesResponse.ts +1 -1
  135. package/model/getTopFilterAttributesResponse.ts +1 -1
  136. package/model/getTopFilterForAttribute.ts +3 -4
  137. package/model/getTopFiltersNoResultsResponse.ts +2 -2
  138. package/model/getTopFiltersNoResultsValue.ts +3 -4
  139. package/model/getTopHitsResponse.ts +5 -1
  140. package/model/getTopSearchesResponse.ts +3 -1
  141. package/model/getUsersCountResponse.ts +4 -4
  142. package/model/index.ts +23 -11
  143. package/model/operator.ts +6 -0
  144. package/model/orderBy.ts +1 -1
  145. package/model/topCountry.ts +1 -1
  146. package/model/topHit.ts +1 -1
  147. package/model/topHitWithAnalytics.ts +9 -9
  148. package/model/topHitWithRevenueAnalytics.ts +65 -0
  149. package/model/topHitsResponse.ts +1 -1
  150. package/model/topHitsResponseWithAnalytics.ts +1 -1
  151. package/model/topHitsResponseWithRevenueAnalytics.ts +10 -0
  152. package/model/topSearch.ts +3 -3
  153. package/model/topSearchWithAnalytics.ts +19 -12
  154. package/model/topSearchWithRevenueAnalytics.ts +81 -0
  155. package/model/topSearchesResponse.ts +1 -1
  156. package/model/topSearchesResponseWithAnalytics.ts +1 -1
  157. package/model/topSearchesResponseWithRevenueAnalytics.ts +10 -0
  158. package/package.json +11 -8
  159. package/dist/model/averageClickEvent.d.ts +0 -15
  160. package/dist/model/averageClickEvent.d.ts.map +0 -1
  161. package/dist/model/clickPosition.d.ts +0 -11
  162. package/dist/model/clickPosition.d.ts.map +0 -1
  163. package/dist/model/clickThroughRateEvent.d.ts +0 -19
  164. package/dist/model/clickThroughRateEvent.d.ts.map +0 -1
  165. package/dist/model/conversionRateEvent.d.ts +0 -19
  166. package/dist/model/conversionRateEvent.d.ts.map +0 -1
  167. package/dist/model/getConversationRateResponse.d.ts +0 -20
  168. package/dist/model/getConversationRateResponse.d.ts.map +0 -1
  169. package/dist/model/noClickRateEvent.d.ts +0 -19
  170. package/dist/model/noClickRateEvent.d.ts.map +0 -1
  171. package/dist/model/noResultsRateEvent.d.ts +0 -19
  172. package/dist/model/noResultsRateEvent.d.ts.map +0 -1
  173. package/dist/model/searchEvent.d.ts +0 -11
  174. package/dist/model/searchEvent.d.ts.map +0 -1
  175. package/dist/model/searchNoClickEvent.d.ts +0 -15
  176. package/dist/model/searchNoClickEvent.d.ts.map +0 -1
  177. package/dist/model/searchNoResultEvent.d.ts +0 -15
  178. package/dist/model/searchNoResultEvent.d.ts.map +0 -1
  179. package/dist/model/userWithDate.d.ts +0 -11
  180. package/dist/model/userWithDate.d.ts.map +0 -1
  181. package/model/averageClickEvent.ts +0 -18
  182. package/model/clickPosition.ts +0 -13
  183. package/model/clickThroughRateEvent.ts +0 -23
  184. package/model/conversionRateEvent.ts +0 -23
  185. package/model/getConversationRateResponse.ts +0 -25
  186. package/model/noClickRateEvent.ts +0 -23
  187. package/model/noResultsRateEvent.ts +0 -23
@@ -195,6 +195,14 @@ function createStatefulHost(host, status = 'up') {
195
195
  };
196
196
  }
197
197
 
198
+ function _defineProperty(e, r, t) {
199
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
200
+ value: t,
201
+ enumerable: !0,
202
+ configurable: !0,
203
+ writable: !0
204
+ }) : e[r] = t, e;
205
+ }
198
206
  function _toPrimitive(t, r) {
199
207
  if ("object" != typeof t || !t) return t;
200
208
  var e = t[Symbol.toPrimitive];
@@ -207,21 +215,7 @@ function _toPrimitive(t, r) {
207
215
  }
208
216
  function _toPropertyKey(t) {
209
217
  var i = _toPrimitive(t, "string");
210
- return "symbol" == typeof i ? i : String(i);
211
- }
212
- function _defineProperty(obj, key, value) {
213
- key = _toPropertyKey(key);
214
- if (key in obj) {
215
- Object.defineProperty(obj, key, {
216
- value: value,
217
- enumerable: true,
218
- configurable: true,
219
- writable: true
220
- });
221
- } else {
222
- obj[key] = value;
223
- }
224
- return obj;
218
+ return "symbol" == typeof i ? i : i + "";
225
219
  }
226
220
 
227
221
  class AlgoliaError extends Error {
@@ -243,7 +237,7 @@ class ErrorWithStackTrace extends AlgoliaError {
243
237
  }
244
238
  class RetryError extends ErrorWithStackTrace {
245
239
  constructor(stackTrace) {
246
- super('Unreachable hosts - your application id may be incorrect. If the error persists, please create a ticket at https://support.algolia.com/ sharing steps we can use to reproduce the issue.', stackTrace, 'RetryError');
240
+ super('Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.', stackTrace, 'RetryError');
247
241
  }
248
242
  }
249
243
  class ApiError extends ErrorWithStackTrace {
@@ -270,15 +264,14 @@ class DetailedApiError extends ApiError {
270
264
  }
271
265
  function serializeUrl(host, path, queryParameters) {
272
266
  const queryParametersAsString = serializeQueryParameters(queryParameters);
273
- let url = `${host.protocol}://${host.url}/${path.charAt(0) === '/' ? path.substr(1) : path}`;
267
+ let url = `${host.protocol}://${host.url}${host.port ? `:${host.port}` : ''}/${path.charAt(0) === '/' ? path.substring(1) : path}`;
274
268
  if (queryParametersAsString.length) {
275
269
  url += `?${queryParametersAsString}`;
276
270
  }
277
271
  return url;
278
272
  }
279
273
  function serializeQueryParameters(parameters) {
280
- const isObjectOrArray = value => Object.prototype.toString.call(value) === '[object Object]' || Object.prototype.toString.call(value) === '[object Array]';
281
- return Object.keys(parameters).map(key => `${key}=${encodeURIComponent(isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key])}`).join('&');
274
+ return Object.keys(parameters).filter(key => parameters[key] !== undefined).sort().map(key => `${key}=${encodeURIComponent(Object.prototype.toString.call(parameters[key]) === '[object Array]' ? parameters[key].join(',') : parameters[key]).replaceAll('+', '%20')}`).join('&');
282
275
  }
283
276
  function serializeData(request, requestOptions) {
284
277
  if (request.method === 'GET' || request.data === undefined && requestOptions.data === undefined) {
@@ -449,16 +442,13 @@ function createTransporter({
449
442
  if (host === undefined) {
450
443
  throw new RetryError(stackTraceWithoutCredentials(stackTrace));
451
444
  }
452
- let responseTimeout = requestOptions.timeout;
453
- if (responseTimeout === undefined) {
454
- responseTimeout = isRead ? timeouts.read : timeouts.write;
455
- }
445
+ let responseTimeout = isRead ? requestOptions.timeouts?.read || timeouts.read : requestOptions.timeouts?.write || timeouts.write;
456
446
  const payload = {
457
447
  data,
458
448
  headers,
459
449
  method: request.method,
460
450
  url: serializeUrl(host, request.path, queryParameters),
461
- connectTimeout: getTimeout(timeoutsCount, timeouts.connect),
451
+ connectTimeout: getTimeout(timeoutsCount, requestOptions.timeouts?.connect || timeouts.connect),
462
452
  responseTimeout: getTimeout(timeoutsCount, responseTimeout)
463
453
  };
464
454
  /**
@@ -686,7 +676,7 @@ function createXhrRequester() {
686
676
  }
687
677
 
688
678
  // 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.
689
- const apiClientVersion = '5.0.0-alpha.99';
679
+ const apiClientVersion = '5.0.0-beta.10';
690
680
  const REGIONS = ['de', 'us'];
691
681
  function getDefaultHosts(region) {
692
682
  const url = !region
@@ -748,7 +738,6 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
748
738
  /**
749
739
  * This method allow you to send requests to the Algolia REST API.
750
740
  *
751
- * @summary Send requests to the Algolia REST API.
752
741
  * @param customDelete - The customDelete object.
753
742
  * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
754
743
  * @param customDelete.parameters - Query parameters to apply to the current query.
@@ -758,7 +747,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
758
747
  if (!path) {
759
748
  throw new Error('Parameter `path` is required when calling `customDelete`.');
760
749
  }
761
- const requestPath = '/1{path}'.replace('{path}', path);
750
+ const requestPath = '/{path}'.replace('{path}', path);
762
751
  const headers = {};
763
752
  const queryParameters = parameters ? parameters : {};
764
753
  const request = {
@@ -772,7 +761,6 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
772
761
  /**
773
762
  * This method allow you to send requests to the Algolia REST API.
774
763
  *
775
- * @summary Send requests to the Algolia REST API.
776
764
  * @param customGet - The customGet object.
777
765
  * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
778
766
  * @param customGet.parameters - Query parameters to apply to the current query.
@@ -782,7 +770,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
782
770
  if (!path) {
783
771
  throw new Error('Parameter `path` is required when calling `customGet`.');
784
772
  }
785
- const requestPath = '/1{path}'.replace('{path}', path);
773
+ const requestPath = '/{path}'.replace('{path}', path);
786
774
  const headers = {};
787
775
  const queryParameters = parameters ? parameters : {};
788
776
  const request = {
@@ -796,7 +784,6 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
796
784
  /**
797
785
  * This method allow you to send requests to the Algolia REST API.
798
786
  *
799
- * @summary Send requests to the Algolia REST API.
800
787
  * @param customPost - The customPost object.
801
788
  * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
802
789
  * @param customPost.parameters - Query parameters to apply to the current query.
@@ -807,7 +794,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
807
794
  if (!path) {
808
795
  throw new Error('Parameter `path` is required when calling `customPost`.');
809
796
  }
810
- const requestPath = '/1{path}'.replace('{path}', path);
797
+ const requestPath = '/{path}'.replace('{path}', path);
811
798
  const headers = {};
812
799
  const queryParameters = parameters ? parameters : {};
813
800
  const request = {
@@ -822,7 +809,6 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
822
809
  /**
823
810
  * This method allow you to send requests to the Algolia REST API.
824
811
  *
825
- * @summary Send requests to the Algolia REST API.
826
812
  * @param customPut - The customPut object.
827
813
  * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
828
814
  * @param customPut.parameters - Query parameters to apply to the current query.
@@ -833,7 +819,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
833
819
  if (!path) {
834
820
  throw new Error('Parameter `path` is required when calling `customPut`.');
835
821
  }
836
- const requestPath = '/1{path}'.replace('{path}', path);
822
+ const requestPath = '/{path}'.replace('{path}', path);
837
823
  const headers = {};
838
824
  const queryParameters = parameters ? parameters : {};
839
825
  const request = {
@@ -846,14 +832,56 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
846
832
  return transporter.request(request, requestOptions);
847
833
  },
848
834
  /**
849
- * 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`.
835
+ * 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.
836
+ *
837
+ * Required API Key ACLs:
838
+ * - analytics.
839
+ *
840
+ * @param getAddToCartRate - The getAddToCartRate object.
841
+ * @param getAddToCartRate.index - Index name.
842
+ * @param getAddToCartRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
843
+ * @param getAddToCartRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
844
+ * @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/).
845
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
846
+ */
847
+ getAddToCartRate({ index, startDate, endDate, tags }, requestOptions) {
848
+ if (!index) {
849
+ throw new Error('Parameter `index` is required when calling `getAddToCartRate`.');
850
+ }
851
+ const requestPath = '/2/conversions/addToCartRate';
852
+ const headers = {};
853
+ const queryParameters = {};
854
+ if (index !== undefined) {
855
+ queryParameters.index = index.toString();
856
+ }
857
+ if (startDate !== undefined) {
858
+ queryParameters.startDate = startDate.toString();
859
+ }
860
+ if (endDate !== undefined) {
861
+ queryParameters.endDate = endDate.toString();
862
+ }
863
+ if (tags !== undefined) {
864
+ queryParameters.tags = tags.toString();
865
+ }
866
+ const request = {
867
+ method: 'GET',
868
+ path: requestPath,
869
+ queryParameters,
870
+ headers,
871
+ };
872
+ return transporter.request(request, requestOptions);
873
+ },
874
+ /**
875
+ * 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.
876
+ *
877
+ * Required API Key ACLs:
878
+ * - analytics.
850
879
  *
851
- * @summary Get average click position.
852
880
  * @param getAverageClickPosition - The getAverageClickPosition object.
853
- * @param getAverageClickPosition.index - Index name to target.
854
- * @param getAverageClickPosition.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
855
- * @param getAverageClickPosition.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
856
- * @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.
881
+ * @param getAverageClickPosition.index - Index name.
882
+ * @param getAverageClickPosition.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
883
+ * @param getAverageClickPosition.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
884
+ * @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/).
857
885
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
858
886
  */
859
887
  getAverageClickPosition({ index, startDate, endDate, tags }, requestOptions) {
@@ -884,14 +912,16 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
884
912
  return transporter.request(request, requestOptions);
885
913
  },
886
914
  /**
887
- * 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`.
915
+ * 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.
916
+ *
917
+ * Required API Key ACLs:
918
+ * - analytics.
888
919
  *
889
- * @summary Get click positions.
890
920
  * @param getClickPositions - The getClickPositions object.
891
- * @param getClickPositions.index - Index name to target.
892
- * @param getClickPositions.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
893
- * @param getClickPositions.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
894
- * @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.
921
+ * @param getClickPositions.index - Index name.
922
+ * @param getClickPositions.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
923
+ * @param getClickPositions.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
924
+ * @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/).
895
925
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
896
926
  */
897
927
  getClickPositions({ index, startDate, endDate, tags }, requestOptions) {
@@ -922,14 +952,16 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
922
952
  return transporter.request(request, requestOptions);
923
953
  },
924
954
  /**
925
- * Returns a [click-through rate (CTR)](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#click-through-rate).
955
+ * 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.
956
+ *
957
+ * Required API Key ACLs:
958
+ * - analytics.
926
959
  *
927
- * @summary Get click-through rate (CTR).
928
960
  * @param getClickThroughRate - The getClickThroughRate object.
929
- * @param getClickThroughRate.index - Index name to target.
930
- * @param getClickThroughRate.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
931
- * @param getClickThroughRate.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
932
- * @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.
961
+ * @param getClickThroughRate.index - Index name.
962
+ * @param getClickThroughRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
963
+ * @param getClickThroughRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
964
+ * @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/).
933
965
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
934
966
  */
935
967
  getClickThroughRate({ index, startDate, endDate, tags }, requestOptions) {
@@ -960,19 +992,21 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
960
992
  return transporter.request(request, requestOptions);
961
993
  },
962
994
  /**
963
- * Return a [conversion rate](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#conversion-rate).
995
+ * 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.
964
996
  *
965
- * @summary Get conversion rate (CR).
966
- * @param getConversationRate - The getConversationRate object.
967
- * @param getConversationRate.index - Index name to target.
968
- * @param getConversationRate.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
969
- * @param getConversationRate.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
970
- * @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.
997
+ * Required API Key ACLs:
998
+ * - analytics.
999
+ *
1000
+ * @param getConversionRate - The getConversionRate object.
1001
+ * @param getConversionRate.index - Index name.
1002
+ * @param getConversionRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1003
+ * @param getConversionRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1004
+ * @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/).
971
1005
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
972
1006
  */
973
- getConversationRate({ index, startDate, endDate, tags }, requestOptions) {
1007
+ getConversionRate({ index, startDate, endDate, tags }, requestOptions) {
974
1008
  if (!index) {
975
- throw new Error('Parameter `index` is required when calling `getConversationRate`.');
1009
+ throw new Error('Parameter `index` is required when calling `getConversionRate`.');
976
1010
  }
977
1011
  const requestPath = '/2/conversions/conversionRate';
978
1012
  const headers = {};
@@ -998,14 +1032,16 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
998
1032
  return transporter.request(request, requestOptions);
999
1033
  },
1000
1034
  /**
1001
- * 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.
1035
+ * 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.
1036
+ *
1037
+ * Required API Key ACLs:
1038
+ * - analytics.
1002
1039
  *
1003
- * @summary Get no click rate.
1004
1040
  * @param getNoClickRate - The getNoClickRate object.
1005
- * @param getNoClickRate.index - Index name to target.
1006
- * @param getNoClickRate.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1007
- * @param getNoClickRate.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1008
- * @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.
1041
+ * @param getNoClickRate.index - Index name.
1042
+ * @param getNoClickRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1043
+ * @param getNoClickRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1044
+ * @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/).
1009
1045
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1010
1046
  */
1011
1047
  getNoClickRate({ index, startDate, endDate, tags }, requestOptions) {
@@ -1036,14 +1072,16 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1036
1072
  return transporter.request(request, requestOptions);
1037
1073
  },
1038
1074
  /**
1039
- * Returns the rate at which searches didn\'t return any results.
1075
+ * 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.
1076
+ *
1077
+ * Required API Key ACLs:
1078
+ * - analytics.
1040
1079
  *
1041
- * @summary Get no results rate.
1042
1080
  * @param getNoResultsRate - The getNoResultsRate object.
1043
- * @param getNoResultsRate.index - Index name to target.
1044
- * @param getNoResultsRate.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1045
- * @param getNoResultsRate.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1046
- * @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.
1081
+ * @param getNoResultsRate.index - Index name.
1082
+ * @param getNoResultsRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1083
+ * @param getNoResultsRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1084
+ * @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/).
1047
1085
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1048
1086
  */
1049
1087
  getNoResultsRate({ index, startDate, endDate, tags }, requestOptions) {
@@ -1074,14 +1112,96 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1074
1112
  return transporter.request(request, requestOptions);
1075
1113
  },
1076
1114
  /**
1077
- * Returns the number of searches within a time range.
1115
+ * 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.
1116
+ *
1117
+ * Required API Key ACLs:
1118
+ * - analytics.
1119
+ *
1120
+ * @param getPurchaseRate - The getPurchaseRate object.
1121
+ * @param getPurchaseRate.index - Index name.
1122
+ * @param getPurchaseRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1123
+ * @param getPurchaseRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1124
+ * @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/).
1125
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1126
+ */
1127
+ getPurchaseRate({ index, startDate, endDate, tags }, requestOptions) {
1128
+ if (!index) {
1129
+ throw new Error('Parameter `index` is required when calling `getPurchaseRate`.');
1130
+ }
1131
+ const requestPath = '/2/conversions/purchaseRate';
1132
+ const headers = {};
1133
+ const queryParameters = {};
1134
+ if (index !== undefined) {
1135
+ queryParameters.index = index.toString();
1136
+ }
1137
+ if (startDate !== undefined) {
1138
+ queryParameters.startDate = startDate.toString();
1139
+ }
1140
+ if (endDate !== undefined) {
1141
+ queryParameters.endDate = endDate.toString();
1142
+ }
1143
+ if (tags !== undefined) {
1144
+ queryParameters.tags = tags.toString();
1145
+ }
1146
+ const request = {
1147
+ method: 'GET',
1148
+ path: requestPath,
1149
+ queryParameters,
1150
+ headers,
1151
+ };
1152
+ return transporter.request(request, requestOptions);
1153
+ },
1154
+ /**
1155
+ * 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.
1156
+ *
1157
+ * Required API Key ACLs:
1158
+ * - analytics.
1159
+ *
1160
+ * @param getRevenue - The getRevenue object.
1161
+ * @param getRevenue.index - Index name.
1162
+ * @param getRevenue.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1163
+ * @param getRevenue.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1164
+ * @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/).
1165
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1166
+ */
1167
+ getRevenue({ index, startDate, endDate, tags }, requestOptions) {
1168
+ if (!index) {
1169
+ throw new Error('Parameter `index` is required when calling `getRevenue`.');
1170
+ }
1171
+ const requestPath = '/2/conversions/revenue';
1172
+ const headers = {};
1173
+ const queryParameters = {};
1174
+ if (index !== undefined) {
1175
+ queryParameters.index = index.toString();
1176
+ }
1177
+ if (startDate !== undefined) {
1178
+ queryParameters.startDate = startDate.toString();
1179
+ }
1180
+ if (endDate !== undefined) {
1181
+ queryParameters.endDate = endDate.toString();
1182
+ }
1183
+ if (tags !== undefined) {
1184
+ queryParameters.tags = tags.toString();
1185
+ }
1186
+ const request = {
1187
+ method: 'GET',
1188
+ path: requestPath,
1189
+ queryParameters,
1190
+ headers,
1191
+ };
1192
+ return transporter.request(request, requestOptions);
1193
+ },
1194
+ /**
1195
+ * 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.
1196
+ *
1197
+ * Required API Key ACLs:
1198
+ * - analytics.
1078
1199
  *
1079
- * @summary Get number of searches.
1080
1200
  * @param getSearchesCount - The getSearchesCount object.
1081
- * @param getSearchesCount.index - Index name to target.
1082
- * @param getSearchesCount.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1083
- * @param getSearchesCount.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1084
- * @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.
1201
+ * @param getSearchesCount.index - Index name.
1202
+ * @param getSearchesCount.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1203
+ * @param getSearchesCount.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1204
+ * @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/).
1085
1205
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1086
1206
  */
1087
1207
  getSearchesCount({ index, startDate, endDate, tags }, requestOptions) {
@@ -1112,16 +1232,18 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1112
1232
  return transporter.request(request, requestOptions);
1113
1233
  },
1114
1234
  /**
1115
- * Return the most popular of the last 1,000 searches that didn\'t lead to any clicks.
1235
+ * Retrieves the most popular searches that didn\'t lead to any clicks, from the 1,000 most frequent searches.
1236
+ *
1237
+ * Required API Key ACLs:
1238
+ * - analytics.
1116
1239
  *
1117
- * @summary Get top searches with no clicks.
1118
1240
  * @param getSearchesNoClicks - The getSearchesNoClicks object.
1119
- * @param getSearchesNoClicks.index - Index name to target.
1120
- * @param getSearchesNoClicks.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1121
- * @param getSearchesNoClicks.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1122
- * @param getSearchesNoClicks.limit - Number of records to return (page size).
1123
- * @param getSearchesNoClicks.offset - Position of the starting record. Used for paging. 0 is the first record.
1124
- * @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.
1241
+ * @param getSearchesNoClicks.index - Index name.
1242
+ * @param getSearchesNoClicks.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1243
+ * @param getSearchesNoClicks.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1244
+ * @param getSearchesNoClicks.limit - Number of items to return.
1245
+ * @param getSearchesNoClicks.offset - Position of the first item to return.
1246
+ * @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/).
1125
1247
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1126
1248
  */
1127
1249
  getSearchesNoClicks({ index, startDate, endDate, limit, offset, tags, }, requestOptions) {
@@ -1158,16 +1280,18 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1158
1280
  return transporter.request(request, requestOptions);
1159
1281
  },
1160
1282
  /**
1161
- * Returns the most popular of the latest 1,000 searches that didn\'t return any results.
1283
+ * Retrieves the most popular searches that didn\'t return any results.
1284
+ *
1285
+ * Required API Key ACLs:
1286
+ * - analytics.
1162
1287
  *
1163
- * @summary Get top searches with no results.
1164
1288
  * @param getSearchesNoResults - The getSearchesNoResults object.
1165
- * @param getSearchesNoResults.index - Index name to target.
1166
- * @param getSearchesNoResults.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1167
- * @param getSearchesNoResults.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1168
- * @param getSearchesNoResults.limit - Number of records to return (page size).
1169
- * @param getSearchesNoResults.offset - Position of the starting record. Used for paging. 0 is the first record.
1170
- * @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.
1289
+ * @param getSearchesNoResults.index - Index name.
1290
+ * @param getSearchesNoResults.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1291
+ * @param getSearchesNoResults.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1292
+ * @param getSearchesNoResults.limit - Number of items to return.
1293
+ * @param getSearchesNoResults.offset - Position of the first item to return.
1294
+ * @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/).
1171
1295
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1172
1296
  */
1173
1297
  getSearchesNoResults({ index, startDate, endDate, limit, offset, tags, }, requestOptions) {
@@ -1204,11 +1328,13 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1204
1328
  return transporter.request(request, requestOptions);
1205
1329
  },
1206
1330
  /**
1207
- * 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.
1331
+ * Retrieves the time when the Analytics data for the specified index was last updated. The Analytics data is updated every 5 minutes.
1332
+ *
1333
+ * Required API Key ACLs:
1334
+ * - analytics.
1208
1335
  *
1209
- * @summary Get Analytics API status.
1210
1336
  * @param getStatus - The getStatus object.
1211
- * @param getStatus.index - Index name to target.
1337
+ * @param getStatus.index - Index name.
1212
1338
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1213
1339
  */
1214
1340
  getStatus({ index }, requestOptions) {
@@ -1230,16 +1356,18 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1230
1356
  return transporter.request(request, requestOptions);
1231
1357
  },
1232
1358
  /**
1233
- * Returns top countries. Limited to the 1,000 most frequent ones.
1359
+ * Retrieves the countries with the most searches to your index.
1360
+ *
1361
+ * Required API Key ACLs:
1362
+ * - analytics.
1234
1363
  *
1235
- * @summary Get top countries.
1236
1364
  * @param getTopCountries - The getTopCountries object.
1237
- * @param getTopCountries.index - Index name to target.
1238
- * @param getTopCountries.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1239
- * @param getTopCountries.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1240
- * @param getTopCountries.limit - Number of records to return (page size).
1241
- * @param getTopCountries.offset - Position of the starting record. Used for paging. 0 is the first record.
1242
- * @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.
1365
+ * @param getTopCountries.index - Index name.
1366
+ * @param getTopCountries.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1367
+ * @param getTopCountries.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1368
+ * @param getTopCountries.limit - Number of items to return.
1369
+ * @param getTopCountries.offset - Position of the first item to return.
1370
+ * @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/).
1243
1371
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1244
1372
  */
1245
1373
  getTopCountries({ index, startDate, endDate, limit, offset, tags }, requestOptions) {
@@ -1276,17 +1404,19 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1276
1404
  return transporter.request(request, requestOptions);
1277
1405
  },
1278
1406
  /**
1279
- * 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.
1407
+ * Retrieves the most frequently used filter attributes. These are attributes of your records that you included in the `attributesForFaceting` setting.
1408
+ *
1409
+ * Required API Key ACLs:
1410
+ * - analytics.
1280
1411
  *
1281
- * @summary Get top filterable attributes.
1282
1412
  * @param getTopFilterAttributes - The getTopFilterAttributes object.
1283
- * @param getTopFilterAttributes.index - Index name to target.
1284
- * @param getTopFilterAttributes.search - User query.
1285
- * @param getTopFilterAttributes.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1286
- * @param getTopFilterAttributes.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1287
- * @param getTopFilterAttributes.limit - Number of records to return (page size).
1288
- * @param getTopFilterAttributes.offset - Position of the starting record. Used for paging. 0 is the first record.
1289
- * @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.
1413
+ * @param getTopFilterAttributes.index - Index name.
1414
+ * @param getTopFilterAttributes.search - Search query.
1415
+ * @param getTopFilterAttributes.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1416
+ * @param getTopFilterAttributes.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1417
+ * @param getTopFilterAttributes.limit - Number of items to return.
1418
+ * @param getTopFilterAttributes.offset - Position of the first item to return.
1419
+ * @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/).
1290
1420
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1291
1421
  */
1292
1422
  getTopFilterAttributes({ index, search, startDate, endDate, limit, offset, tags, }, requestOptions) {
@@ -1326,18 +1456,20 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1326
1456
  return transporter.request(request, requestOptions);
1327
1457
  },
1328
1458
  /**
1329
- * Returns the most popular filter values for an attribute in the 1,000 most recently used filters.
1459
+ * Retrieves the most frequent filter (facet) values for a filter attribute. These are attributes of your records that you included in the `attributesForFaceting` setting.
1460
+ *
1461
+ * Required API Key ACLs:
1462
+ * - analytics.
1330
1463
  *
1331
- * @summary Get top filter values for an attribute.
1332
1464
  * @param getTopFilterForAttribute - The getTopFilterForAttribute object.
1333
1465
  * @param getTopFilterForAttribute.attribute - Attribute name.
1334
- * @param getTopFilterForAttribute.index - Index name to target.
1335
- * @param getTopFilterForAttribute.search - User query.
1336
- * @param getTopFilterForAttribute.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1337
- * @param getTopFilterForAttribute.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1338
- * @param getTopFilterForAttribute.limit - Number of records to return (page size).
1339
- * @param getTopFilterForAttribute.offset - Position of the starting record. Used for paging. 0 is the first record.
1340
- * @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.
1466
+ * @param getTopFilterForAttribute.index - Index name.
1467
+ * @param getTopFilterForAttribute.search - Search query.
1468
+ * @param getTopFilterForAttribute.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1469
+ * @param getTopFilterForAttribute.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1470
+ * @param getTopFilterForAttribute.limit - Number of items to return.
1471
+ * @param getTopFilterForAttribute.offset - Position of the first item to return.
1472
+ * @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/).
1341
1473
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1342
1474
  */
1343
1475
  getTopFilterForAttribute({ attribute, index, search, startDate, endDate, limit, offset, tags, }, requestOptions) {
@@ -1380,17 +1512,19 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1380
1512
  return transporter.request(request, requestOptions);
1381
1513
  },
1382
1514
  /**
1383
- * Returns top filters for filter-enabled searches that don\'t return results. Limited to the 1,000 most recently used filters.
1515
+ * 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.
1516
+ *
1517
+ * Required API Key ACLs:
1518
+ * - analytics.
1384
1519
  *
1385
- * @summary Get top filters for a no result search.
1386
1520
  * @param getTopFiltersNoResults - The getTopFiltersNoResults object.
1387
- * @param getTopFiltersNoResults.index - Index name to target.
1388
- * @param getTopFiltersNoResults.search - User query.
1389
- * @param getTopFiltersNoResults.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1390
- * @param getTopFiltersNoResults.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1391
- * @param getTopFiltersNoResults.limit - Number of records to return (page size).
1392
- * @param getTopFiltersNoResults.offset - Position of the starting record. Used for paging. 0 is the first record.
1393
- * @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.
1521
+ * @param getTopFiltersNoResults.index - Index name.
1522
+ * @param getTopFiltersNoResults.search - Search query.
1523
+ * @param getTopFiltersNoResults.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1524
+ * @param getTopFiltersNoResults.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1525
+ * @param getTopFiltersNoResults.limit - Number of items to return.
1526
+ * @param getTopFiltersNoResults.offset - Position of the first item to return.
1527
+ * @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/).
1394
1528
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1395
1529
  */
1396
1530
  getTopFiltersNoResults({ index, search, startDate, endDate, limit, offset, tags, }, requestOptions) {
@@ -1430,21 +1564,24 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1430
1564
  return transporter.request(request, requestOptions);
1431
1565
  },
1432
1566
  /**
1433
- * Return the most popular clicked results in the last 1,000 searches.
1567
+ * Retrieves the object IDs of the most frequent search results.
1568
+ *
1569
+ * Required API Key ACLs:
1570
+ * - analytics.
1434
1571
  *
1435
- * @summary Get top hits.
1436
1572
  * @param getTopHits - The getTopHits object.
1437
- * @param getTopHits.index - Index name to target.
1438
- * @param getTopHits.search - User query.
1439
- * @param getTopHits.clickAnalytics - Whether to include [click and conversion](https://www.algolia.com/doc/guides/sending-events/getting-started/) rates for a search.
1440
- * @param getTopHits.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1441
- * @param getTopHits.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1442
- * @param getTopHits.limit - Number of records to return (page size).
1443
- * @param getTopHits.offset - Position of the starting record. Used for paging. 0 is the first record.
1444
- * @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.
1573
+ * @param getTopHits.index - Index name.
1574
+ * @param getTopHits.search - Search query.
1575
+ * @param getTopHits.clickAnalytics - Whether to include metrics related to click and conversion events in the response.
1576
+ * @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.
1577
+ * @param getTopHits.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1578
+ * @param getTopHits.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1579
+ * @param getTopHits.limit - Number of items to return.
1580
+ * @param getTopHits.offset - Position of the first item to return.
1581
+ * @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/).
1445
1582
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1446
1583
  */
1447
- getTopHits({ index, search, clickAnalytics, startDate, endDate, limit, offset, tags, }, requestOptions) {
1584
+ getTopHits({ index, search, clickAnalytics, revenueAnalytics, startDate, endDate, limit, offset, tags, }, requestOptions) {
1448
1585
  if (!index) {
1449
1586
  throw new Error('Parameter `index` is required when calling `getTopHits`.');
1450
1587
  }
@@ -1460,6 +1597,9 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1460
1597
  if (clickAnalytics !== undefined) {
1461
1598
  queryParameters.clickAnalytics = clickAnalytics.toString();
1462
1599
  }
1600
+ if (revenueAnalytics !== undefined) {
1601
+ queryParameters.revenueAnalytics = revenueAnalytics.toString();
1602
+ }
1463
1603
  if (startDate !== undefined) {
1464
1604
  queryParameters.startDate = startDate.toString();
1465
1605
  }
@@ -1484,22 +1624,25 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1484
1624
  return transporter.request(request, requestOptions);
1485
1625
  },
1486
1626
  /**
1487
- * Returns the most popular of the latest 1,000 searches. For each search, also returns the number of hits.
1627
+ * Returns the most popular search terms.
1628
+ *
1629
+ * Required API Key ACLs:
1630
+ * - analytics.
1488
1631
  *
1489
- * @summary Get top searches.
1490
1632
  * @param getTopSearches - The getTopSearches object.
1491
- * @param getTopSearches.index - Index name to target.
1492
- * @param getTopSearches.clickAnalytics - Whether to include [click and conversion](https://www.algolia.com/doc/guides/sending-events/getting-started/) rates for a search.
1493
- * @param getTopSearches.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1494
- * @param getTopSearches.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1495
- * @param getTopSearches.orderBy - Reorder the results.
1633
+ * @param getTopSearches.index - Index name.
1634
+ * @param getTopSearches.clickAnalytics - Whether to include metrics related to click and conversion events in the response.
1635
+ * @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.
1636
+ * @param getTopSearches.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1637
+ * @param getTopSearches.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1638
+ * @param getTopSearches.orderBy - Attribute by which to order the response items. If the `clickAnalytics` parameter is false, only `searchCount` is available.
1496
1639
  * @param getTopSearches.direction - Sorting direction of the results: ascending or descending.
1497
- * @param getTopSearches.limit - Number of records to return (page size).
1498
- * @param getTopSearches.offset - Position of the starting record. Used for paging. 0 is the first record.
1499
- * @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.
1640
+ * @param getTopSearches.limit - Number of items to return.
1641
+ * @param getTopSearches.offset - Position of the first item to return.
1642
+ * @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/).
1500
1643
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1501
1644
  */
1502
- getTopSearches({ index, clickAnalytics, startDate, endDate, orderBy, direction, limit, offset, tags, }, requestOptions) {
1645
+ getTopSearches({ index, clickAnalytics, revenueAnalytics, startDate, endDate, orderBy, direction, limit, offset, tags, }, requestOptions) {
1503
1646
  if (!index) {
1504
1647
  throw new Error('Parameter `index` is required when calling `getTopSearches`.');
1505
1648
  }
@@ -1512,6 +1655,9 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1512
1655
  if (clickAnalytics !== undefined) {
1513
1656
  queryParameters.clickAnalytics = clickAnalytics.toString();
1514
1657
  }
1658
+ if (revenueAnalytics !== undefined) {
1659
+ queryParameters.revenueAnalytics = revenueAnalytics.toString();
1660
+ }
1515
1661
  if (startDate !== undefined) {
1516
1662
  queryParameters.startDate = startDate.toString();
1517
1663
  }
@@ -1542,14 +1688,16 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1542
1688
  return transporter.request(request, requestOptions);
1543
1689
  },
1544
1690
  /**
1545
- * Return the count of unique users.
1691
+ * 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.
1692
+ *
1693
+ * Required API Key ACLs:
1694
+ * - analytics.
1546
1695
  *
1547
- * @summary Get user count.
1548
1696
  * @param getUsersCount - The getUsersCount object.
1549
- * @param getUsersCount.index - Index name to target.
1550
- * @param getUsersCount.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1551
- * @param getUsersCount.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1552
- * @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.
1697
+ * @param getUsersCount.index - Index name.
1698
+ * @param getUsersCount.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1699
+ * @param getUsersCount.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1700
+ * @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/).
1553
1701
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1554
1702
  */
1555
1703
  getUsersCount({ index, startDate, endDate, tags }, requestOptions) {
@@ -1583,6 +1731,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1583
1731
  }
1584
1732
 
1585
1733
  // 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.
1734
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
1586
1735
  function analyticsClient(appId, apiKey, region, options) {
1587
1736
  if (!appId || typeof appId !== 'string') {
1588
1737
  throw new Error('`appId` is missing.');