@algolia/client-analytics 5.2.4 → 5.2.5

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 (142) hide show
  1. package/dist/browser.d.ts +1399 -0
  2. package/dist/builds/browser.js +1115 -0
  3. package/dist/builds/browser.js.map +1 -0
  4. package/dist/builds/browser.min.js +2 -0
  5. package/dist/builds/browser.min.js.map +1 -0
  6. package/dist/builds/browser.umd.js +12 -0
  7. package/dist/builds/node.cjs +1133 -0
  8. package/dist/builds/node.cjs.map +1 -0
  9. package/dist/builds/node.js +1113 -0
  10. package/dist/builds/node.js.map +1 -0
  11. package/dist/node.d.cts +1399 -0
  12. package/dist/node.d.ts +1399 -0
  13. package/dist/src/analyticsClient.cjs +1100 -0
  14. package/dist/src/analyticsClient.cjs.map +1 -0
  15. package/dist/src/{analyticsClient.d.ts → analyticsClient.js} +739 -58
  16. package/dist/src/analyticsClient.js.map +1 -0
  17. package/index.d.ts +1 -1
  18. package/index.js +1 -1
  19. package/package.json +28 -25
  20. package/dist/builds/browser.d.ts +0 -40
  21. package/dist/builds/browser.d.ts.map +0 -1
  22. package/dist/builds/node.d.ts +0 -40
  23. package/dist/builds/node.d.ts.map +0 -1
  24. package/dist/client-analytics.cjs +0 -1089
  25. package/dist/client-analytics.esm.browser.js +0 -1763
  26. package/dist/client-analytics.esm.node.js +0 -1086
  27. package/dist/client-analytics.umd.js +0 -2
  28. package/dist/model/clickPosition.d.ts +0 -14
  29. package/dist/model/clickPosition.d.ts.map +0 -1
  30. package/dist/model/clientMethodProps.d.ts +0 -579
  31. package/dist/model/clientMethodProps.d.ts.map +0 -1
  32. package/dist/model/currencyCode.d.ts +0 -14
  33. package/dist/model/currencyCode.d.ts.map +0 -1
  34. package/dist/model/dailyAddToCartRates.d.ts +0 -19
  35. package/dist/model/dailyAddToCartRates.d.ts.map +0 -1
  36. package/dist/model/dailyAverageClicks.d.ts +0 -15
  37. package/dist/model/dailyAverageClicks.d.ts.map +0 -1
  38. package/dist/model/dailyClickThroughRates.d.ts +0 -19
  39. package/dist/model/dailyClickThroughRates.d.ts.map +0 -1
  40. package/dist/model/dailyConversionRates.d.ts +0 -19
  41. package/dist/model/dailyConversionRates.d.ts.map +0 -1
  42. package/dist/model/dailyNoClickRates.d.ts +0 -19
  43. package/dist/model/dailyNoClickRates.d.ts.map +0 -1
  44. package/dist/model/dailyNoResultsRates.d.ts +0 -19
  45. package/dist/model/dailyNoResultsRates.d.ts.map +0 -1
  46. package/dist/model/dailyPurchaseRates.d.ts +0 -19
  47. package/dist/model/dailyPurchaseRates.d.ts.map +0 -1
  48. package/dist/model/dailyRevenue.d.ts +0 -12
  49. package/dist/model/dailyRevenue.d.ts.map +0 -1
  50. package/dist/model/dailySearches.d.ts +0 -11
  51. package/dist/model/dailySearches.d.ts.map +0 -1
  52. package/dist/model/dailySearchesNoClicks.d.ts +0 -15
  53. package/dist/model/dailySearchesNoClicks.d.ts.map +0 -1
  54. package/dist/model/dailySearchesNoResults.d.ts +0 -15
  55. package/dist/model/dailySearchesNoResults.d.ts.map +0 -1
  56. package/dist/model/dailyUsers.d.ts +0 -11
  57. package/dist/model/dailyUsers.d.ts.map +0 -1
  58. package/dist/model/direction.d.ts +0 -2
  59. package/dist/model/direction.d.ts.map +0 -1
  60. package/dist/model/errorBase.d.ts +0 -7
  61. package/dist/model/errorBase.d.ts.map +0 -1
  62. package/dist/model/getAddToCartRateResponse.d.ts +0 -20
  63. package/dist/model/getAddToCartRateResponse.d.ts.map +0 -1
  64. package/dist/model/getAverageClickPositionResponse.d.ts +0 -16
  65. package/dist/model/getAverageClickPositionResponse.d.ts.map +0 -1
  66. package/dist/model/getClickPositionsResponse.d.ts +0 -8
  67. package/dist/model/getClickPositionsResponse.d.ts.map +0 -1
  68. package/dist/model/getClickThroughRateResponse.d.ts +0 -20
  69. package/dist/model/getClickThroughRateResponse.d.ts.map +0 -1
  70. package/dist/model/getConversionRateResponse.d.ts +0 -20
  71. package/dist/model/getConversionRateResponse.d.ts.map +0 -1
  72. package/dist/model/getNoClickRateResponse.d.ts +0 -20
  73. package/dist/model/getNoClickRateResponse.d.ts.map +0 -1
  74. package/dist/model/getNoResultsRateResponse.d.ts +0 -20
  75. package/dist/model/getNoResultsRateResponse.d.ts.map +0 -1
  76. package/dist/model/getPurchaseRateResponse.d.ts +0 -20
  77. package/dist/model/getPurchaseRateResponse.d.ts.map +0 -1
  78. package/dist/model/getRevenue.d.ts +0 -13
  79. package/dist/model/getRevenue.d.ts.map +0 -1
  80. package/dist/model/getSearchesCountResponse.d.ts +0 -12
  81. package/dist/model/getSearchesCountResponse.d.ts.map +0 -1
  82. package/dist/model/getSearchesNoClicksResponse.d.ts +0 -8
  83. package/dist/model/getSearchesNoClicksResponse.d.ts.map +0 -1
  84. package/dist/model/getSearchesNoResultsResponse.d.ts +0 -8
  85. package/dist/model/getSearchesNoResultsResponse.d.ts.map +0 -1
  86. package/dist/model/getStatusResponse.d.ts +0 -7
  87. package/dist/model/getStatusResponse.d.ts.map +0 -1
  88. package/dist/model/getTopCountriesResponse.d.ts +0 -8
  89. package/dist/model/getTopCountriesResponse.d.ts.map +0 -1
  90. package/dist/model/getTopFilterAttribute.d.ts +0 -11
  91. package/dist/model/getTopFilterAttribute.d.ts.map +0 -1
  92. package/dist/model/getTopFilterAttributesResponse.d.ts +0 -8
  93. package/dist/model/getTopFilterAttributesResponse.d.ts.map +0 -1
  94. package/dist/model/getTopFilterForAttribute.d.ts +0 -17
  95. package/dist/model/getTopFilterForAttribute.d.ts.map +0 -1
  96. package/dist/model/getTopFilterForAttributeResponse.d.ts +0 -8
  97. package/dist/model/getTopFilterForAttributeResponse.d.ts.map +0 -1
  98. package/dist/model/getTopFiltersNoResultsResponse.d.ts +0 -8
  99. package/dist/model/getTopFiltersNoResultsResponse.d.ts.map +0 -1
  100. package/dist/model/getTopFiltersNoResultsValue.d.ts +0 -13
  101. package/dist/model/getTopFiltersNoResultsValue.d.ts.map +0 -1
  102. package/dist/model/getTopFiltersNoResultsValues.d.ts +0 -12
  103. package/dist/model/getTopFiltersNoResultsValues.d.ts.map +0 -1
  104. package/dist/model/getTopHitsResponse.d.ts +0 -5
  105. package/dist/model/getTopHitsResponse.d.ts.map +0 -1
  106. package/dist/model/getTopSearchesResponse.d.ts +0 -5
  107. package/dist/model/getTopSearchesResponse.d.ts.map +0 -1
  108. package/dist/model/getUsersCountResponse.d.ts +0 -12
  109. package/dist/model/getUsersCountResponse.d.ts.map +0 -1
  110. package/dist/model/index.d.ts +0 -57
  111. package/dist/model/index.d.ts.map +0 -1
  112. package/dist/model/operator.d.ts +0 -5
  113. package/dist/model/operator.d.ts.map +0 -1
  114. package/dist/model/orderBy.d.ts +0 -5
  115. package/dist/model/orderBy.d.ts.map +0 -1
  116. package/dist/model/topCountry.d.ts +0 -11
  117. package/dist/model/topCountry.d.ts.map +0 -1
  118. package/dist/model/topHit.d.ts +0 -11
  119. package/dist/model/topHit.d.ts.map +0 -1
  120. package/dist/model/topHitWithAnalytics.d.ts +0 -31
  121. package/dist/model/topHitWithAnalytics.d.ts.map +0 -1
  122. package/dist/model/topHitWithRevenueAnalytics.d.ts +0 -52
  123. package/dist/model/topHitWithRevenueAnalytics.d.ts.map +0 -1
  124. package/dist/model/topHitsResponse.d.ts +0 -8
  125. package/dist/model/topHitsResponse.d.ts.map +0 -1
  126. package/dist/model/topHitsResponseWithAnalytics.d.ts +0 -8
  127. package/dist/model/topHitsResponseWithAnalytics.d.ts.map +0 -1
  128. package/dist/model/topHitsResponseWithRevenueAnalytics.d.ts +0 -8
  129. package/dist/model/topHitsResponseWithRevenueAnalytics.d.ts.map +0 -1
  130. package/dist/model/topSearch.d.ts +0 -15
  131. package/dist/model/topSearch.d.ts.map +0 -1
  132. package/dist/model/topSearchWithAnalytics.d.ts +0 -44
  133. package/dist/model/topSearchWithAnalytics.d.ts.map +0 -1
  134. package/dist/model/topSearchWithRevenueAnalytics.d.ts +0 -65
  135. package/dist/model/topSearchWithRevenueAnalytics.d.ts.map +0 -1
  136. package/dist/model/topSearchesResponse.d.ts +0 -8
  137. package/dist/model/topSearchesResponse.d.ts.map +0 -1
  138. package/dist/model/topSearchesResponseWithAnalytics.d.ts +0 -8
  139. package/dist/model/topSearchesResponseWithAnalytics.d.ts.map +0 -1
  140. package/dist/model/topSearchesResponseWithRevenueAnalytics.d.ts +0 -8
  141. package/dist/model/topSearchesResponseWithRevenueAnalytics.d.ts.map +0 -1
  142. package/dist/src/analyticsClient.d.ts.map +0 -1
@@ -1,51 +1,65 @@
1
- import type { CreateClientOptions, RequestOptions } from '@algolia/client-common';
2
- import type { CustomDeleteProps, CustomGetProps, CustomPostProps, CustomPutProps, GetAddToCartRateProps, GetAverageClickPositionProps, GetClickPositionsProps, GetClickThroughRateProps, GetConversionRateProps, GetNoClickRateProps, GetNoResultsRateProps, GetPurchaseRateProps, GetRevenueProps, GetSearchesCountProps, GetSearchesNoClicksProps, GetSearchesNoResultsProps, GetStatusProps, GetTopCountriesProps, GetTopFilterAttributesProps, GetTopFilterForAttributeProps, GetTopFiltersNoResultsProps, GetTopHitsProps, GetTopSearchesProps, GetUsersCountProps } from '../model/clientMethodProps';
3
- import type { GetAddToCartRateResponse } from '../model/getAddToCartRateResponse';
4
- import type { GetAverageClickPositionResponse } from '../model/getAverageClickPositionResponse';
5
- import type { GetClickPositionsResponse } from '../model/getClickPositionsResponse';
6
- import type { GetClickThroughRateResponse } from '../model/getClickThroughRateResponse';
7
- import type { GetConversionRateResponse } from '../model/getConversionRateResponse';
8
- import type { GetNoClickRateResponse } from '../model/getNoClickRateResponse';
9
- import type { GetNoResultsRateResponse } from '../model/getNoResultsRateResponse';
10
- import type { GetPurchaseRateResponse } from '../model/getPurchaseRateResponse';
11
- import type { GetRevenue } from '../model/getRevenue';
12
- import type { GetSearchesCountResponse } from '../model/getSearchesCountResponse';
13
- import type { GetSearchesNoClicksResponse } from '../model/getSearchesNoClicksResponse';
14
- import type { GetSearchesNoResultsResponse } from '../model/getSearchesNoResultsResponse';
15
- import type { GetStatusResponse } from '../model/getStatusResponse';
16
- import type { GetTopCountriesResponse } from '../model/getTopCountriesResponse';
17
- import type { GetTopFilterAttributesResponse } from '../model/getTopFilterAttributesResponse';
18
- import type { GetTopFilterForAttributeResponse } from '../model/getTopFilterForAttributeResponse';
19
- import type { GetTopFiltersNoResultsResponse } from '../model/getTopFiltersNoResultsResponse';
20
- import type { GetTopHitsResponse } from '../model/getTopHitsResponse';
21
- import type { GetTopSearchesResponse } from '../model/getTopSearchesResponse';
22
- import type { GetUsersCountResponse } from '../model/getUsersCountResponse';
23
- export declare const apiClientVersion = "5.2.4";
24
- export declare const REGIONS: readonly ["de", "us"];
25
- export type Region = (typeof REGIONS)[number];
26
- export declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }: CreateClientOptions & {
27
- region?: Region;
28
- }): {
29
- transporter: import("@algolia/client-common").Transporter;
1
+ // src/analyticsClient.ts
2
+ import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common";
3
+ var apiClientVersion = "5.2.5";
4
+ var REGIONS = ["de", "us"];
5
+ function getDefaultHosts(region) {
6
+ const url = !region ? "analytics.algolia.com" : "analytics.{region}.algolia.com".replace("{region}", region);
7
+ return [{ url, accept: "readWrite", protocol: "https" }];
8
+ }
9
+ function createAnalyticsClient({
10
+ appId: appIdOption,
11
+ apiKey: apiKeyOption,
12
+ authMode,
13
+ algoliaAgents,
14
+ region: regionOption,
15
+ ...options
16
+ }) {
17
+ const auth = createAuth(appIdOption, apiKeyOption, authMode);
18
+ const transporter = createTransporter({
19
+ hosts: getDefaultHosts(regionOption),
20
+ ...options,
21
+ algoliaAgent: getAlgoliaAgent({
22
+ algoliaAgents,
23
+ client: "Analytics",
24
+ version: apiClientVersion
25
+ }),
26
+ baseHeaders: {
27
+ "content-type": "text/plain",
28
+ ...auth.headers(),
29
+ ...options.baseHeaders
30
+ },
31
+ baseQueryParameters: {
32
+ ...auth.queryParameters(),
33
+ ...options.baseQueryParameters
34
+ }
35
+ });
36
+ return {
37
+ transporter,
30
38
  /**
31
39
  * The `appId` currently in use.
32
40
  */
33
- appId: string;
41
+ appId: appIdOption,
34
42
  /**
35
43
  * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
36
44
  */
37
- clearCache(): Promise<void>;
45
+ clearCache() {
46
+ return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0);
47
+ },
38
48
  /**
39
49
  * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
40
50
  */
41
- readonly _ua: string;
51
+ get _ua() {
52
+ return transporter.algoliaAgent.value;
53
+ },
42
54
  /**
43
55
  * Adds a `segment` to the `x-algolia-agent` sent with every requests.
44
56
  *
45
57
  * @param segment - The algolia agent (user-agent) segment to add.
46
58
  * @param version - The version of the agent.
47
59
  */
48
- addAlgoliaAgent(segment: string, version?: string): void;
60
+ addAlgoliaAgent(segment, version) {
61
+ transporter.algoliaAgent.add({ segment, version });
62
+ },
49
63
  /**
50
64
  * This method allow you to send requests to the Algolia REST API.
51
65
  *
@@ -54,7 +68,21 @@ export declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiK
54
68
  * @param customDelete.parameters - Query parameters to apply to the current query.
55
69
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
56
70
  */
57
- customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
71
+ customDelete({ path, parameters }, requestOptions) {
72
+ if (!path) {
73
+ throw new Error("Parameter `path` is required when calling `customDelete`.");
74
+ }
75
+ const requestPath = "/{path}".replace("{path}", path);
76
+ const headers = {};
77
+ const queryParameters = parameters ? parameters : {};
78
+ const request = {
79
+ method: "DELETE",
80
+ path: requestPath,
81
+ queryParameters,
82
+ headers
83
+ };
84
+ return transporter.request(request, requestOptions);
85
+ },
58
86
  /**
59
87
  * This method allow you to send requests to the Algolia REST API.
60
88
  *
@@ -63,7 +91,21 @@ export declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiK
63
91
  * @param customGet.parameters - Query parameters to apply to the current query.
64
92
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
65
93
  */
66
- customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
94
+ customGet({ path, parameters }, requestOptions) {
95
+ if (!path) {
96
+ throw new Error("Parameter `path` is required when calling `customGet`.");
97
+ }
98
+ const requestPath = "/{path}".replace("{path}", path);
99
+ const headers = {};
100
+ const queryParameters = parameters ? parameters : {};
101
+ const request = {
102
+ method: "GET",
103
+ path: requestPath,
104
+ queryParameters,
105
+ headers
106
+ };
107
+ return transporter.request(request, requestOptions);
108
+ },
67
109
  /**
68
110
  * This method allow you to send requests to the Algolia REST API.
69
111
  *
@@ -73,7 +115,22 @@ export declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiK
73
115
  * @param customPost.body - Parameters to send with the custom request.
74
116
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
75
117
  */
76
- customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
118
+ customPost({ path, parameters, body }, requestOptions) {
119
+ if (!path) {
120
+ throw new Error("Parameter `path` is required when calling `customPost`.");
121
+ }
122
+ const requestPath = "/{path}".replace("{path}", path);
123
+ const headers = {};
124
+ const queryParameters = parameters ? parameters : {};
125
+ const request = {
126
+ method: "POST",
127
+ path: requestPath,
128
+ queryParameters,
129
+ headers,
130
+ data: body ? body : {}
131
+ };
132
+ return transporter.request(request, requestOptions);
133
+ },
77
134
  /**
78
135
  * This method allow you to send requests to the Algolia REST API.
79
136
  *
@@ -83,7 +140,22 @@ export declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiK
83
140
  * @param customPut.body - Parameters to send with the custom request.
84
141
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
85
142
  */
86
- customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
143
+ customPut({ path, parameters, body }, requestOptions) {
144
+ if (!path) {
145
+ throw new Error("Parameter `path` is required when calling `customPut`.");
146
+ }
147
+ const requestPath = "/{path}".replace("{path}", path);
148
+ const headers = {};
149
+ const queryParameters = parameters ? parameters : {};
150
+ const request = {
151
+ method: "PUT",
152
+ path: requestPath,
153
+ queryParameters,
154
+ headers,
155
+ data: body ? body : {}
156
+ };
157
+ return transporter.request(request, requestOptions);
158
+ },
87
159
  /**
88
160
  * 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.
89
161
  *
@@ -97,7 +169,33 @@ export declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiK
97
169
  * @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/).
98
170
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
99
171
  */
100
- getAddToCartRate({ index, startDate, endDate, tags }: GetAddToCartRateProps, requestOptions?: RequestOptions): Promise<GetAddToCartRateResponse>;
172
+ getAddToCartRate({ index, startDate, endDate, tags }, requestOptions) {
173
+ if (!index) {
174
+ throw new Error("Parameter `index` is required when calling `getAddToCartRate`.");
175
+ }
176
+ const requestPath = "/2/conversions/addToCartRate";
177
+ const headers = {};
178
+ const queryParameters = {};
179
+ if (index !== void 0) {
180
+ queryParameters.index = index.toString();
181
+ }
182
+ if (startDate !== void 0) {
183
+ queryParameters.startDate = startDate.toString();
184
+ }
185
+ if (endDate !== void 0) {
186
+ queryParameters.endDate = endDate.toString();
187
+ }
188
+ if (tags !== void 0) {
189
+ queryParameters.tags = tags.toString();
190
+ }
191
+ const request = {
192
+ method: "GET",
193
+ path: requestPath,
194
+ queryParameters,
195
+ headers
196
+ };
197
+ return transporter.request(request, requestOptions);
198
+ },
101
199
  /**
102
200
  * 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.
103
201
  *
@@ -111,7 +209,33 @@ export declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiK
111
209
  * @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/).
112
210
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
113
211
  */
114
- getAverageClickPosition({ index, startDate, endDate, tags }: GetAverageClickPositionProps, requestOptions?: RequestOptions): Promise<GetAverageClickPositionResponse>;
212
+ getAverageClickPosition({ index, startDate, endDate, tags }, requestOptions) {
213
+ if (!index) {
214
+ throw new Error("Parameter `index` is required when calling `getAverageClickPosition`.");
215
+ }
216
+ const requestPath = "/2/clicks/averageClickPosition";
217
+ const headers = {};
218
+ const queryParameters = {};
219
+ if (index !== void 0) {
220
+ queryParameters.index = index.toString();
221
+ }
222
+ if (startDate !== void 0) {
223
+ queryParameters.startDate = startDate.toString();
224
+ }
225
+ if (endDate !== void 0) {
226
+ queryParameters.endDate = endDate.toString();
227
+ }
228
+ if (tags !== void 0) {
229
+ queryParameters.tags = tags.toString();
230
+ }
231
+ const request = {
232
+ method: "GET",
233
+ path: requestPath,
234
+ queryParameters,
235
+ headers
236
+ };
237
+ return transporter.request(request, requestOptions);
238
+ },
115
239
  /**
116
240
  * 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.
117
241
  *
@@ -125,7 +249,33 @@ export declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiK
125
249
  * @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/).
126
250
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
127
251
  */
128
- getClickPositions({ index, startDate, endDate, tags }: GetClickPositionsProps, requestOptions?: RequestOptions): Promise<GetClickPositionsResponse>;
252
+ getClickPositions({ index, startDate, endDate, tags }, requestOptions) {
253
+ if (!index) {
254
+ throw new Error("Parameter `index` is required when calling `getClickPositions`.");
255
+ }
256
+ const requestPath = "/2/clicks/positions";
257
+ const headers = {};
258
+ const queryParameters = {};
259
+ if (index !== void 0) {
260
+ queryParameters.index = index.toString();
261
+ }
262
+ if (startDate !== void 0) {
263
+ queryParameters.startDate = startDate.toString();
264
+ }
265
+ if (endDate !== void 0) {
266
+ queryParameters.endDate = endDate.toString();
267
+ }
268
+ if (tags !== void 0) {
269
+ queryParameters.tags = tags.toString();
270
+ }
271
+ const request = {
272
+ method: "GET",
273
+ path: requestPath,
274
+ queryParameters,
275
+ headers
276
+ };
277
+ return transporter.request(request, requestOptions);
278
+ },
129
279
  /**
130
280
  * 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.
131
281
  *
@@ -139,7 +289,33 @@ export declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiK
139
289
  * @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/).
140
290
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
141
291
  */
142
- getClickThroughRate({ index, startDate, endDate, tags }: GetClickThroughRateProps, requestOptions?: RequestOptions): Promise<GetClickThroughRateResponse>;
292
+ getClickThroughRate({ index, startDate, endDate, tags }, requestOptions) {
293
+ if (!index) {
294
+ throw new Error("Parameter `index` is required when calling `getClickThroughRate`.");
295
+ }
296
+ const requestPath = "/2/clicks/clickThroughRate";
297
+ const headers = {};
298
+ const queryParameters = {};
299
+ if (index !== void 0) {
300
+ queryParameters.index = index.toString();
301
+ }
302
+ if (startDate !== void 0) {
303
+ queryParameters.startDate = startDate.toString();
304
+ }
305
+ if (endDate !== void 0) {
306
+ queryParameters.endDate = endDate.toString();
307
+ }
308
+ if (tags !== void 0) {
309
+ queryParameters.tags = tags.toString();
310
+ }
311
+ const request = {
312
+ method: "GET",
313
+ path: requestPath,
314
+ queryParameters,
315
+ headers
316
+ };
317
+ return transporter.request(request, requestOptions);
318
+ },
143
319
  /**
144
320
  * 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.
145
321
  *
@@ -153,7 +329,33 @@ export declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiK
153
329
  * @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/).
154
330
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
155
331
  */
156
- getConversionRate({ index, startDate, endDate, tags }: GetConversionRateProps, requestOptions?: RequestOptions): Promise<GetConversionRateResponse>;
332
+ getConversionRate({ index, startDate, endDate, tags }, requestOptions) {
333
+ if (!index) {
334
+ throw new Error("Parameter `index` is required when calling `getConversionRate`.");
335
+ }
336
+ const requestPath = "/2/conversions/conversionRate";
337
+ const headers = {};
338
+ const queryParameters = {};
339
+ if (index !== void 0) {
340
+ queryParameters.index = index.toString();
341
+ }
342
+ if (startDate !== void 0) {
343
+ queryParameters.startDate = startDate.toString();
344
+ }
345
+ if (endDate !== void 0) {
346
+ queryParameters.endDate = endDate.toString();
347
+ }
348
+ if (tags !== void 0) {
349
+ queryParameters.tags = tags.toString();
350
+ }
351
+ const request = {
352
+ method: "GET",
353
+ path: requestPath,
354
+ queryParameters,
355
+ headers
356
+ };
357
+ return transporter.request(request, requestOptions);
358
+ },
157
359
  /**
158
360
  * 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.
159
361
  *
@@ -167,7 +369,33 @@ export declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiK
167
369
  * @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/).
168
370
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
169
371
  */
170
- getNoClickRate({ index, startDate, endDate, tags }: GetNoClickRateProps, requestOptions?: RequestOptions): Promise<GetNoClickRateResponse>;
372
+ getNoClickRate({ index, startDate, endDate, tags }, requestOptions) {
373
+ if (!index) {
374
+ throw new Error("Parameter `index` is required when calling `getNoClickRate`.");
375
+ }
376
+ const requestPath = "/2/searches/noClickRate";
377
+ const headers = {};
378
+ const queryParameters = {};
379
+ if (index !== void 0) {
380
+ queryParameters.index = index.toString();
381
+ }
382
+ if (startDate !== void 0) {
383
+ queryParameters.startDate = startDate.toString();
384
+ }
385
+ if (endDate !== void 0) {
386
+ queryParameters.endDate = endDate.toString();
387
+ }
388
+ if (tags !== void 0) {
389
+ queryParameters.tags = tags.toString();
390
+ }
391
+ const request = {
392
+ method: "GET",
393
+ path: requestPath,
394
+ queryParameters,
395
+ headers
396
+ };
397
+ return transporter.request(request, requestOptions);
398
+ },
171
399
  /**
172
400
  * 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.
173
401
  *
@@ -181,7 +409,33 @@ export declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiK
181
409
  * @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/).
182
410
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
183
411
  */
184
- getNoResultsRate({ index, startDate, endDate, tags }: GetNoResultsRateProps, requestOptions?: RequestOptions): Promise<GetNoResultsRateResponse>;
412
+ getNoResultsRate({ index, startDate, endDate, tags }, requestOptions) {
413
+ if (!index) {
414
+ throw new Error("Parameter `index` is required when calling `getNoResultsRate`.");
415
+ }
416
+ const requestPath = "/2/searches/noResultRate";
417
+ const headers = {};
418
+ const queryParameters = {};
419
+ if (index !== void 0) {
420
+ queryParameters.index = index.toString();
421
+ }
422
+ if (startDate !== void 0) {
423
+ queryParameters.startDate = startDate.toString();
424
+ }
425
+ if (endDate !== void 0) {
426
+ queryParameters.endDate = endDate.toString();
427
+ }
428
+ if (tags !== void 0) {
429
+ queryParameters.tags = tags.toString();
430
+ }
431
+ const request = {
432
+ method: "GET",
433
+ path: requestPath,
434
+ queryParameters,
435
+ headers
436
+ };
437
+ return transporter.request(request, requestOptions);
438
+ },
185
439
  /**
186
440
  * 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.
187
441
  *
@@ -195,7 +449,33 @@ export declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiK
195
449
  * @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/).
196
450
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
197
451
  */
198
- getPurchaseRate({ index, startDate, endDate, tags }: GetPurchaseRateProps, requestOptions?: RequestOptions): Promise<GetPurchaseRateResponse>;
452
+ getPurchaseRate({ index, startDate, endDate, tags }, requestOptions) {
453
+ if (!index) {
454
+ throw new Error("Parameter `index` is required when calling `getPurchaseRate`.");
455
+ }
456
+ const requestPath = "/2/conversions/purchaseRate";
457
+ const headers = {};
458
+ const queryParameters = {};
459
+ if (index !== void 0) {
460
+ queryParameters.index = index.toString();
461
+ }
462
+ if (startDate !== void 0) {
463
+ queryParameters.startDate = startDate.toString();
464
+ }
465
+ if (endDate !== void 0) {
466
+ queryParameters.endDate = endDate.toString();
467
+ }
468
+ if (tags !== void 0) {
469
+ queryParameters.tags = tags.toString();
470
+ }
471
+ const request = {
472
+ method: "GET",
473
+ path: requestPath,
474
+ queryParameters,
475
+ headers
476
+ };
477
+ return transporter.request(request, requestOptions);
478
+ },
199
479
  /**
200
480
  * 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.
201
481
  *
@@ -209,7 +489,33 @@ export declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiK
209
489
  * @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/).
210
490
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
211
491
  */
212
- getRevenue({ index, startDate, endDate, tags }: GetRevenueProps, requestOptions?: RequestOptions): Promise<GetRevenue>;
492
+ getRevenue({ index, startDate, endDate, tags }, requestOptions) {
493
+ if (!index) {
494
+ throw new Error("Parameter `index` is required when calling `getRevenue`.");
495
+ }
496
+ const requestPath = "/2/conversions/revenue";
497
+ const headers = {};
498
+ const queryParameters = {};
499
+ if (index !== void 0) {
500
+ queryParameters.index = index.toString();
501
+ }
502
+ if (startDate !== void 0) {
503
+ queryParameters.startDate = startDate.toString();
504
+ }
505
+ if (endDate !== void 0) {
506
+ queryParameters.endDate = endDate.toString();
507
+ }
508
+ if (tags !== void 0) {
509
+ queryParameters.tags = tags.toString();
510
+ }
511
+ const request = {
512
+ method: "GET",
513
+ path: requestPath,
514
+ queryParameters,
515
+ headers
516
+ };
517
+ return transporter.request(request, requestOptions);
518
+ },
213
519
  /**
214
520
  * 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.
215
521
  *
@@ -223,7 +529,33 @@ export declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiK
223
529
  * @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/).
224
530
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
225
531
  */
226
- getSearchesCount({ index, startDate, endDate, tags }: GetSearchesCountProps, requestOptions?: RequestOptions): Promise<GetSearchesCountResponse>;
532
+ getSearchesCount({ index, startDate, endDate, tags }, requestOptions) {
533
+ if (!index) {
534
+ throw new Error("Parameter `index` is required when calling `getSearchesCount`.");
535
+ }
536
+ const requestPath = "/2/searches/count";
537
+ const headers = {};
538
+ const queryParameters = {};
539
+ if (index !== void 0) {
540
+ queryParameters.index = index.toString();
541
+ }
542
+ if (startDate !== void 0) {
543
+ queryParameters.startDate = startDate.toString();
544
+ }
545
+ if (endDate !== void 0) {
546
+ queryParameters.endDate = endDate.toString();
547
+ }
548
+ if (tags !== void 0) {
549
+ queryParameters.tags = tags.toString();
550
+ }
551
+ const request = {
552
+ method: "GET",
553
+ path: requestPath,
554
+ queryParameters,
555
+ headers
556
+ };
557
+ return transporter.request(request, requestOptions);
558
+ },
227
559
  /**
228
560
  * Retrieves the most popular searches that didn\'t lead to any clicks, from the 1,000 most frequent searches.
229
561
  *
@@ -239,7 +571,39 @@ export declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiK
239
571
  * @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/).
240
572
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
241
573
  */
242
- getSearchesNoClicks({ index, startDate, endDate, limit, offset, tags }: GetSearchesNoClicksProps, requestOptions?: RequestOptions): Promise<GetSearchesNoClicksResponse>;
574
+ getSearchesNoClicks({ index, startDate, endDate, limit, offset, tags }, requestOptions) {
575
+ if (!index) {
576
+ throw new Error("Parameter `index` is required when calling `getSearchesNoClicks`.");
577
+ }
578
+ const requestPath = "/2/searches/noClicks";
579
+ const headers = {};
580
+ const queryParameters = {};
581
+ if (index !== void 0) {
582
+ queryParameters.index = index.toString();
583
+ }
584
+ if (startDate !== void 0) {
585
+ queryParameters.startDate = startDate.toString();
586
+ }
587
+ if (endDate !== void 0) {
588
+ queryParameters.endDate = endDate.toString();
589
+ }
590
+ if (limit !== void 0) {
591
+ queryParameters.limit = limit.toString();
592
+ }
593
+ if (offset !== void 0) {
594
+ queryParameters.offset = offset.toString();
595
+ }
596
+ if (tags !== void 0) {
597
+ queryParameters.tags = tags.toString();
598
+ }
599
+ const request = {
600
+ method: "GET",
601
+ path: requestPath,
602
+ queryParameters,
603
+ headers
604
+ };
605
+ return transporter.request(request, requestOptions);
606
+ },
243
607
  /**
244
608
  * Retrieves the most popular searches that didn\'t return any results.
245
609
  *
@@ -255,7 +619,39 @@ export declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiK
255
619
  * @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/).
256
620
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
257
621
  */
258
- getSearchesNoResults({ index, startDate, endDate, limit, offset, tags }: GetSearchesNoResultsProps, requestOptions?: RequestOptions): Promise<GetSearchesNoResultsResponse>;
622
+ getSearchesNoResults({ index, startDate, endDate, limit, offset, tags }, requestOptions) {
623
+ if (!index) {
624
+ throw new Error("Parameter `index` is required when calling `getSearchesNoResults`.");
625
+ }
626
+ const requestPath = "/2/searches/noResults";
627
+ const headers = {};
628
+ const queryParameters = {};
629
+ if (index !== void 0) {
630
+ queryParameters.index = index.toString();
631
+ }
632
+ if (startDate !== void 0) {
633
+ queryParameters.startDate = startDate.toString();
634
+ }
635
+ if (endDate !== void 0) {
636
+ queryParameters.endDate = endDate.toString();
637
+ }
638
+ if (limit !== void 0) {
639
+ queryParameters.limit = limit.toString();
640
+ }
641
+ if (offset !== void 0) {
642
+ queryParameters.offset = offset.toString();
643
+ }
644
+ if (tags !== void 0) {
645
+ queryParameters.tags = tags.toString();
646
+ }
647
+ const request = {
648
+ method: "GET",
649
+ path: requestPath,
650
+ queryParameters,
651
+ headers
652
+ };
653
+ return transporter.request(request, requestOptions);
654
+ },
259
655
  /**
260
656
  * Retrieves the time when the Analytics data for the specified index was last updated. The Analytics data is updated every 5 minutes.
261
657
  *
@@ -266,7 +662,24 @@ export declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiK
266
662
  * @param getStatus.index - Index name.
267
663
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
268
664
  */
269
- getStatus({ index }: GetStatusProps, requestOptions?: RequestOptions): Promise<GetStatusResponse>;
665
+ getStatus({ index }, requestOptions) {
666
+ if (!index) {
667
+ throw new Error("Parameter `index` is required when calling `getStatus`.");
668
+ }
669
+ const requestPath = "/2/status";
670
+ const headers = {};
671
+ const queryParameters = {};
672
+ if (index !== void 0) {
673
+ queryParameters.index = index.toString();
674
+ }
675
+ const request = {
676
+ method: "GET",
677
+ path: requestPath,
678
+ queryParameters,
679
+ headers
680
+ };
681
+ return transporter.request(request, requestOptions);
682
+ },
270
683
  /**
271
684
  * Retrieves the countries with the most searches to your index.
272
685
  *
@@ -282,7 +695,39 @@ export declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiK
282
695
  * @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/).
283
696
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
284
697
  */
285
- getTopCountries({ index, startDate, endDate, limit, offset, tags }: GetTopCountriesProps, requestOptions?: RequestOptions): Promise<GetTopCountriesResponse>;
698
+ getTopCountries({ index, startDate, endDate, limit, offset, tags }, requestOptions) {
699
+ if (!index) {
700
+ throw new Error("Parameter `index` is required when calling `getTopCountries`.");
701
+ }
702
+ const requestPath = "/2/countries";
703
+ const headers = {};
704
+ const queryParameters = {};
705
+ if (index !== void 0) {
706
+ queryParameters.index = index.toString();
707
+ }
708
+ if (startDate !== void 0) {
709
+ queryParameters.startDate = startDate.toString();
710
+ }
711
+ if (endDate !== void 0) {
712
+ queryParameters.endDate = endDate.toString();
713
+ }
714
+ if (limit !== void 0) {
715
+ queryParameters.limit = limit.toString();
716
+ }
717
+ if (offset !== void 0) {
718
+ queryParameters.offset = offset.toString();
719
+ }
720
+ if (tags !== void 0) {
721
+ queryParameters.tags = tags.toString();
722
+ }
723
+ const request = {
724
+ method: "GET",
725
+ path: requestPath,
726
+ queryParameters,
727
+ headers
728
+ };
729
+ return transporter.request(request, requestOptions);
730
+ },
286
731
  /**
287
732
  * Retrieves the most frequently used filter attributes. These are attributes of your records that you included in the `attributesForFaceting` setting.
288
733
  *
@@ -299,7 +744,42 @@ export declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiK
299
744
  * @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/).
300
745
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
301
746
  */
302
- getTopFilterAttributes({ index, search, startDate, endDate, limit, offset, tags }: GetTopFilterAttributesProps, requestOptions?: RequestOptions): Promise<GetTopFilterAttributesResponse>;
747
+ getTopFilterAttributes({ index, search, startDate, endDate, limit, offset, tags }, requestOptions) {
748
+ if (!index) {
749
+ throw new Error("Parameter `index` is required when calling `getTopFilterAttributes`.");
750
+ }
751
+ const requestPath = "/2/filters";
752
+ const headers = {};
753
+ const queryParameters = {};
754
+ if (index !== void 0) {
755
+ queryParameters.index = index.toString();
756
+ }
757
+ if (search !== void 0) {
758
+ queryParameters.search = search.toString();
759
+ }
760
+ if (startDate !== void 0) {
761
+ queryParameters.startDate = startDate.toString();
762
+ }
763
+ if (endDate !== void 0) {
764
+ queryParameters.endDate = endDate.toString();
765
+ }
766
+ if (limit !== void 0) {
767
+ queryParameters.limit = limit.toString();
768
+ }
769
+ if (offset !== void 0) {
770
+ queryParameters.offset = offset.toString();
771
+ }
772
+ if (tags !== void 0) {
773
+ queryParameters.tags = tags.toString();
774
+ }
775
+ const request = {
776
+ method: "GET",
777
+ path: requestPath,
778
+ queryParameters,
779
+ headers
780
+ };
781
+ return transporter.request(request, requestOptions);
782
+ },
303
783
  /**
304
784
  * Retrieves the most frequent filter (facet) values for a filter attribute. These are attributes of your records that you included in the `attributesForFaceting` setting.
305
785
  *
@@ -317,7 +797,45 @@ export declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiK
317
797
  * @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/).
318
798
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
319
799
  */
320
- getTopFilterForAttribute({ attribute, index, search, startDate, endDate, limit, offset, tags }: GetTopFilterForAttributeProps, requestOptions?: RequestOptions): Promise<GetTopFilterForAttributeResponse>;
800
+ getTopFilterForAttribute({ attribute, index, search, startDate, endDate, limit, offset, tags }, requestOptions) {
801
+ if (!attribute) {
802
+ throw new Error("Parameter `attribute` is required when calling `getTopFilterForAttribute`.");
803
+ }
804
+ if (!index) {
805
+ throw new Error("Parameter `index` is required when calling `getTopFilterForAttribute`.");
806
+ }
807
+ const requestPath = "/2/filters/{attribute}".replace("{attribute}", encodeURIComponent(attribute));
808
+ const headers = {};
809
+ const queryParameters = {};
810
+ if (index !== void 0) {
811
+ queryParameters.index = index.toString();
812
+ }
813
+ if (search !== void 0) {
814
+ queryParameters.search = search.toString();
815
+ }
816
+ if (startDate !== void 0) {
817
+ queryParameters.startDate = startDate.toString();
818
+ }
819
+ if (endDate !== void 0) {
820
+ queryParameters.endDate = endDate.toString();
821
+ }
822
+ if (limit !== void 0) {
823
+ queryParameters.limit = limit.toString();
824
+ }
825
+ if (offset !== void 0) {
826
+ queryParameters.offset = offset.toString();
827
+ }
828
+ if (tags !== void 0) {
829
+ queryParameters.tags = tags.toString();
830
+ }
831
+ const request = {
832
+ method: "GET",
833
+ path: requestPath,
834
+ queryParameters,
835
+ headers
836
+ };
837
+ return transporter.request(request, requestOptions);
838
+ },
321
839
  /**
322
840
  * 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.
323
841
  *
@@ -334,7 +852,42 @@ export declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiK
334
852
  * @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/).
335
853
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
336
854
  */
337
- getTopFiltersNoResults({ index, search, startDate, endDate, limit, offset, tags }: GetTopFiltersNoResultsProps, requestOptions?: RequestOptions): Promise<GetTopFiltersNoResultsResponse>;
855
+ getTopFiltersNoResults({ index, search, startDate, endDate, limit, offset, tags }, requestOptions) {
856
+ if (!index) {
857
+ throw new Error("Parameter `index` is required when calling `getTopFiltersNoResults`.");
858
+ }
859
+ const requestPath = "/2/filters/noResults";
860
+ const headers = {};
861
+ const queryParameters = {};
862
+ if (index !== void 0) {
863
+ queryParameters.index = index.toString();
864
+ }
865
+ if (search !== void 0) {
866
+ queryParameters.search = search.toString();
867
+ }
868
+ if (startDate !== void 0) {
869
+ queryParameters.startDate = startDate.toString();
870
+ }
871
+ if (endDate !== void 0) {
872
+ queryParameters.endDate = endDate.toString();
873
+ }
874
+ if (limit !== void 0) {
875
+ queryParameters.limit = limit.toString();
876
+ }
877
+ if (offset !== void 0) {
878
+ queryParameters.offset = offset.toString();
879
+ }
880
+ if (tags !== void 0) {
881
+ queryParameters.tags = tags.toString();
882
+ }
883
+ const request = {
884
+ method: "GET",
885
+ path: requestPath,
886
+ queryParameters,
887
+ headers
888
+ };
889
+ return transporter.request(request, requestOptions);
890
+ },
338
891
  /**
339
892
  * Retrieves the object IDs of the most frequent search results.
340
893
  *
@@ -353,7 +906,48 @@ export declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiK
353
906
  * @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/).
354
907
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
355
908
  */
356
- getTopHits({ index, search, clickAnalytics, revenueAnalytics, startDate, endDate, limit, offset, tags }: GetTopHitsProps, requestOptions?: RequestOptions): Promise<GetTopHitsResponse>;
909
+ getTopHits({ index, search, clickAnalytics, revenueAnalytics, startDate, endDate, limit, offset, tags }, requestOptions) {
910
+ if (!index) {
911
+ throw new Error("Parameter `index` is required when calling `getTopHits`.");
912
+ }
913
+ const requestPath = "/2/hits";
914
+ const headers = {};
915
+ const queryParameters = {};
916
+ if (index !== void 0) {
917
+ queryParameters.index = index.toString();
918
+ }
919
+ if (search !== void 0) {
920
+ queryParameters.search = search.toString();
921
+ }
922
+ if (clickAnalytics !== void 0) {
923
+ queryParameters.clickAnalytics = clickAnalytics.toString();
924
+ }
925
+ if (revenueAnalytics !== void 0) {
926
+ queryParameters.revenueAnalytics = revenueAnalytics.toString();
927
+ }
928
+ if (startDate !== void 0) {
929
+ queryParameters.startDate = startDate.toString();
930
+ }
931
+ if (endDate !== void 0) {
932
+ queryParameters.endDate = endDate.toString();
933
+ }
934
+ if (limit !== void 0) {
935
+ queryParameters.limit = limit.toString();
936
+ }
937
+ if (offset !== void 0) {
938
+ queryParameters.offset = offset.toString();
939
+ }
940
+ if (tags !== void 0) {
941
+ queryParameters.tags = tags.toString();
942
+ }
943
+ const request = {
944
+ method: "GET",
945
+ path: requestPath,
946
+ queryParameters,
947
+ headers
948
+ };
949
+ return transporter.request(request, requestOptions);
950
+ },
357
951
  /**
358
952
  * Returns the most popular search terms.
359
953
  *
@@ -373,7 +967,62 @@ export declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiK
373
967
  * @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/).
374
968
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
375
969
  */
376
- getTopSearches({ index, clickAnalytics, revenueAnalytics, startDate, endDate, orderBy, direction, limit, offset, tags, }: GetTopSearchesProps, requestOptions?: RequestOptions): Promise<GetTopSearchesResponse>;
970
+ getTopSearches({
971
+ index,
972
+ clickAnalytics,
973
+ revenueAnalytics,
974
+ startDate,
975
+ endDate,
976
+ orderBy,
977
+ direction,
978
+ limit,
979
+ offset,
980
+ tags
981
+ }, requestOptions) {
982
+ if (!index) {
983
+ throw new Error("Parameter `index` is required when calling `getTopSearches`.");
984
+ }
985
+ const requestPath = "/2/searches";
986
+ const headers = {};
987
+ const queryParameters = {};
988
+ if (index !== void 0) {
989
+ queryParameters.index = index.toString();
990
+ }
991
+ if (clickAnalytics !== void 0) {
992
+ queryParameters.clickAnalytics = clickAnalytics.toString();
993
+ }
994
+ if (revenueAnalytics !== void 0) {
995
+ queryParameters.revenueAnalytics = revenueAnalytics.toString();
996
+ }
997
+ if (startDate !== void 0) {
998
+ queryParameters.startDate = startDate.toString();
999
+ }
1000
+ if (endDate !== void 0) {
1001
+ queryParameters.endDate = endDate.toString();
1002
+ }
1003
+ if (orderBy !== void 0) {
1004
+ queryParameters.orderBy = orderBy.toString();
1005
+ }
1006
+ if (direction !== void 0) {
1007
+ queryParameters.direction = direction.toString();
1008
+ }
1009
+ if (limit !== void 0) {
1010
+ queryParameters.limit = limit.toString();
1011
+ }
1012
+ if (offset !== void 0) {
1013
+ queryParameters.offset = offset.toString();
1014
+ }
1015
+ if (tags !== void 0) {
1016
+ queryParameters.tags = tags.toString();
1017
+ }
1018
+ const request = {
1019
+ method: "GET",
1020
+ path: requestPath,
1021
+ queryParameters,
1022
+ headers
1023
+ };
1024
+ return transporter.request(request, requestOptions);
1025
+ },
377
1026
  /**
378
1027
  * 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.
379
1028
  *
@@ -387,6 +1036,38 @@ export declare function createAnalyticsClient({ appId: appIdOption, apiKey: apiK
387
1036
  * @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/).
388
1037
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
389
1038
  */
390
- getUsersCount({ index, startDate, endDate, tags }: GetUsersCountProps, requestOptions?: RequestOptions): Promise<GetUsersCountResponse>;
1039
+ getUsersCount({ index, startDate, endDate, tags }, requestOptions) {
1040
+ if (!index) {
1041
+ throw new Error("Parameter `index` is required when calling `getUsersCount`.");
1042
+ }
1043
+ const requestPath = "/2/users/count";
1044
+ const headers = {};
1045
+ const queryParameters = {};
1046
+ if (index !== void 0) {
1047
+ queryParameters.index = index.toString();
1048
+ }
1049
+ if (startDate !== void 0) {
1050
+ queryParameters.startDate = startDate.toString();
1051
+ }
1052
+ if (endDate !== void 0) {
1053
+ queryParameters.endDate = endDate.toString();
1054
+ }
1055
+ if (tags !== void 0) {
1056
+ queryParameters.tags = tags.toString();
1057
+ }
1058
+ const request = {
1059
+ method: "GET",
1060
+ path: requestPath,
1061
+ queryParameters,
1062
+ headers
1063
+ };
1064
+ return transporter.request(request, requestOptions);
1065
+ }
1066
+ };
1067
+ }
1068
+ export {
1069
+ REGIONS,
1070
+ apiClientVersion,
1071
+ createAnalyticsClient
391
1072
  };
392
- //# sourceMappingURL=analyticsClient.d.ts.map
1073
+ //# sourceMappingURL=analyticsClient.js.map