@algolia/client-analytics 5.0.0-alpha.73 → 5.0.0-alpha.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client-analytics.cjs.js +114 -116
- package/dist/client-analytics.esm.browser.js +114 -114
- package/dist/client-analytics.esm.node.js +114 -114
- package/dist/client-analytics.umd.js +2 -2
- package/dist/model/averageClickEvent.d.ts +3 -3
- package/dist/model/clickPosition.d.ts +2 -2
- package/dist/model/clickThroughRateEvent.d.ts +4 -4
- package/dist/model/clientMethodProps.d.ts +91 -91
- package/dist/model/conversionRateEvent.d.ts +4 -4
- package/dist/model/getAverageClickPositionResponse.d.ts +3 -3
- package/dist/model/getClickPositionsResponse.d.ts +1 -1
- package/dist/model/getClickThroughRateResponse.d.ts +4 -4
- package/dist/model/getConversationRateResponse.d.ts +4 -4
- package/dist/model/getNoClickRateResponse.d.ts +4 -4
- package/dist/model/getNoResultsRateResponse.d.ts +4 -4
- package/dist/model/getSearchesCountResponse.d.ts +2 -2
- package/dist/model/getSearchesNoClicksResponse.d.ts +1 -1
- package/dist/model/getSearchesNoResultsResponse.d.ts +1 -1
- package/dist/model/getStatusResponse.d.ts +1 -1
- package/dist/model/getTopCountriesResponse.d.ts +1 -1
- package/dist/model/getTopFilterAttribute.d.ts +2 -2
- package/dist/model/getTopFilterAttributesResponse.d.ts +1 -1
- package/dist/model/getTopFilterForAttribute.d.ts +4 -4
- package/dist/model/getTopFilterForAttributeResponse.d.ts +1 -1
- package/dist/model/getTopFiltersNoResultsResponse.d.ts +1 -1
- package/dist/model/getTopFiltersNoResultsValue.d.ts +3 -3
- package/dist/model/getTopFiltersNoResultsValues.d.ts +2 -2
- package/dist/model/getUsersCountResponse.d.ts +2 -2
- package/dist/model/noClickRateEvent.d.ts +4 -4
- package/dist/model/noResultsRateEvent.d.ts +4 -4
- package/dist/model/orderBy.d.ts +3 -0
- package/dist/model/orderBy.d.ts.map +1 -1
- package/dist/model/searchEvent.d.ts +2 -2
- package/dist/model/searchNoClickEvent.d.ts +3 -3
- package/dist/model/searchNoResultEvent.d.ts +3 -3
- package/dist/model/topCountry.d.ts +2 -2
- package/dist/model/topHit.d.ts +2 -2
- package/dist/model/topHitWithAnalytics.d.ts +7 -7
- package/dist/model/topHitsResponse.d.ts +1 -1
- package/dist/model/topHitsResponseWithAnalytics.d.ts +1 -1
- package/dist/model/topSearch.d.ts +3 -3
- package/dist/model/topSearchWithAnalytics.d.ts +9 -9
- package/dist/model/topSearchesResponse.d.ts +1 -1
- package/dist/model/topSearchesResponseWithAnalytics.d.ts +1 -1
- package/dist/model/userWithDate.d.ts +2 -2
- package/dist/src/analyticsClient.d.ts +114 -114
- package/model/averageClickEvent.ts +3 -3
- package/model/clickPosition.ts +2 -2
- package/model/clickThroughRateEvent.ts +4 -4
- package/model/clientMethodProps.ts +91 -91
- package/model/conversionRateEvent.ts +4 -4
- package/model/getAverageClickPositionResponse.ts +3 -3
- package/model/getClickPositionsResponse.ts +1 -1
- package/model/getClickThroughRateResponse.ts +4 -4
- package/model/getConversationRateResponse.ts +4 -4
- package/model/getNoClickRateResponse.ts +4 -4
- package/model/getNoResultsRateResponse.ts +4 -4
- package/model/getSearchesCountResponse.ts +2 -2
- package/model/getSearchesNoClicksResponse.ts +1 -1
- package/model/getSearchesNoResultsResponse.ts +1 -1
- package/model/getStatusResponse.ts +1 -1
- package/model/getTopCountriesResponse.ts +1 -1
- package/model/getTopFilterAttribute.ts +2 -2
- package/model/getTopFilterAttributesResponse.ts +1 -1
- package/model/getTopFilterForAttribute.ts +4 -4
- package/model/getTopFilterForAttributeResponse.ts +1 -1
- package/model/getTopFiltersNoResultsResponse.ts +1 -1
- package/model/getTopFiltersNoResultsValue.ts +3 -3
- package/model/getTopFiltersNoResultsValues.ts +2 -2
- package/model/getUsersCountResponse.ts +2 -2
- package/model/noClickRateEvent.ts +4 -4
- package/model/noResultsRateEvent.ts +4 -4
- package/model/orderBy.ts +3 -0
- package/model/searchEvent.ts +2 -2
- package/model/searchNoClickEvent.ts +3 -3
- package/model/searchNoResultEvent.ts +3 -3
- package/model/topCountry.ts +2 -2
- package/model/topHit.ts +2 -2
- package/model/topHitWithAnalytics.ts +7 -7
- package/model/topHitsResponse.ts +1 -1
- package/model/topHitsResponseWithAnalytics.ts +1 -1
- package/model/topSearch.ts +3 -3
- package/model/topSearchWithAnalytics.ts +9 -9
- package/model/topSearchesResponse.ts +1 -1
- package/model/topSearchesResponseWithAnalytics.ts +1 -1
- package/model/userWithDate.ts +2 -2
- package/package.json +8 -7
|
@@ -2,7 +2,7 @@ import { createAuth, createTransporter, getAlgoliaAgent, DEFAULT_CONNECT_TIMEOUT
|
|
|
2
2
|
import { createHttpRequester } from '@algolia/requester-node-http';
|
|
3
3
|
|
|
4
4
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
|
5
|
-
const apiClientVersion = '5.0.0-alpha.
|
|
5
|
+
const apiClientVersion = '5.0.0-alpha.76';
|
|
6
6
|
const REGIONS = ['de', 'us'];
|
|
7
7
|
function getDefaultHosts(region) {
|
|
8
8
|
const url = !region
|
|
@@ -66,8 +66,8 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
66
66
|
*
|
|
67
67
|
* @summary Send requests to the Algolia REST API.
|
|
68
68
|
* @param del - The del object.
|
|
69
|
-
* @param del.path -
|
|
70
|
-
* @param del.parameters - Query parameters to
|
|
69
|
+
* @param del.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
70
|
+
* @param del.parameters - Query parameters to apply to the current query.
|
|
71
71
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
72
72
|
*/
|
|
73
73
|
del({ path, parameters }, requestOptions) {
|
|
@@ -90,8 +90,8 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
90
90
|
*
|
|
91
91
|
* @summary Send requests to the Algolia REST API.
|
|
92
92
|
* @param get - The get object.
|
|
93
|
-
* @param get.path -
|
|
94
|
-
* @param get.parameters - Query parameters to
|
|
93
|
+
* @param get.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
94
|
+
* @param get.parameters - Query parameters to apply to the current query.
|
|
95
95
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
96
96
|
*/
|
|
97
97
|
get({ path, parameters }, requestOptions) {
|
|
@@ -110,14 +110,14 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
110
110
|
return transporter.request(request, requestOptions);
|
|
111
111
|
},
|
|
112
112
|
/**
|
|
113
|
-
*
|
|
113
|
+
* 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`.
|
|
114
114
|
*
|
|
115
115
|
* @summary Get average click position.
|
|
116
116
|
* @param getAverageClickPosition - The getAverageClickPosition object.
|
|
117
|
-
* @param getAverageClickPosition.index -
|
|
118
|
-
* @param getAverageClickPosition.startDate -
|
|
119
|
-
* @param getAverageClickPosition.endDate -
|
|
120
|
-
* @param getAverageClickPosition.tags - Filter
|
|
117
|
+
* @param getAverageClickPosition.index - Index name to target.
|
|
118
|
+
* @param getAverageClickPosition.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
119
|
+
* @param getAverageClickPosition.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
120
|
+
* @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.
|
|
121
121
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
122
122
|
*/
|
|
123
123
|
getAverageClickPosition({ index, startDate, endDate, tags }, requestOptions) {
|
|
@@ -148,14 +148,14 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
148
148
|
return transporter.request(request, requestOptions);
|
|
149
149
|
},
|
|
150
150
|
/**
|
|
151
|
-
*
|
|
151
|
+
* 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`.
|
|
152
152
|
*
|
|
153
|
-
* @summary Get
|
|
153
|
+
* @summary Get click positions.
|
|
154
154
|
* @param getClickPositions - The getClickPositions object.
|
|
155
|
-
* @param getClickPositions.index -
|
|
156
|
-
* @param getClickPositions.startDate -
|
|
157
|
-
* @param getClickPositions.endDate -
|
|
158
|
-
* @param getClickPositions.tags - Filter
|
|
155
|
+
* @param getClickPositions.index - Index name to target.
|
|
156
|
+
* @param getClickPositions.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
157
|
+
* @param getClickPositions.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
158
|
+
* @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.
|
|
159
159
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
160
160
|
*/
|
|
161
161
|
getClickPositions({ index, startDate, endDate, tags }, requestOptions) {
|
|
@@ -186,14 +186,14 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
186
186
|
return transporter.request(request, requestOptions);
|
|
187
187
|
},
|
|
188
188
|
/**
|
|
189
|
-
* Returns a click-through rate (CTR).
|
|
189
|
+
* Returns a [click-through rate (CTR)](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#click-through-rate).
|
|
190
190
|
*
|
|
191
191
|
* @summary Get click-through rate (CTR).
|
|
192
192
|
* @param getClickThroughRate - The getClickThroughRate object.
|
|
193
|
-
* @param getClickThroughRate.index -
|
|
194
|
-
* @param getClickThroughRate.startDate -
|
|
195
|
-
* @param getClickThroughRate.endDate -
|
|
196
|
-
* @param getClickThroughRate.tags - Filter
|
|
193
|
+
* @param getClickThroughRate.index - Index name to target.
|
|
194
|
+
* @param getClickThroughRate.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
195
|
+
* @param getClickThroughRate.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
196
|
+
* @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.
|
|
197
197
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
198
198
|
*/
|
|
199
199
|
getClickThroughRate({ index, startDate, endDate, tags }, requestOptions) {
|
|
@@ -224,14 +224,14 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
224
224
|
return transporter.request(request, requestOptions);
|
|
225
225
|
},
|
|
226
226
|
/**
|
|
227
|
-
*
|
|
227
|
+
* Return a [conversion rate](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#conversion-rate).
|
|
228
228
|
*
|
|
229
229
|
* @summary Get conversion rate (CR).
|
|
230
230
|
* @param getConversationRate - The getConversationRate object.
|
|
231
|
-
* @param getConversationRate.index -
|
|
232
|
-
* @param getConversationRate.startDate -
|
|
233
|
-
* @param getConversationRate.endDate -
|
|
234
|
-
* @param getConversationRate.tags - Filter
|
|
231
|
+
* @param getConversationRate.index - Index name to target.
|
|
232
|
+
* @param getConversationRate.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
233
|
+
* @param getConversationRate.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
234
|
+
* @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.
|
|
235
235
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
236
236
|
*/
|
|
237
237
|
getConversationRate({ index, startDate, endDate, tags }, requestOptions) {
|
|
@@ -262,14 +262,14 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
262
262
|
return transporter.request(request, requestOptions);
|
|
263
263
|
},
|
|
264
264
|
/**
|
|
265
|
-
* Returns the rate at which searches
|
|
265
|
+
* 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.
|
|
266
266
|
*
|
|
267
267
|
* @summary Get no click rate.
|
|
268
268
|
* @param getNoClickRate - The getNoClickRate object.
|
|
269
|
-
* @param getNoClickRate.index -
|
|
270
|
-
* @param getNoClickRate.startDate -
|
|
271
|
-
* @param getNoClickRate.endDate -
|
|
272
|
-
* @param getNoClickRate.tags - Filter
|
|
269
|
+
* @param getNoClickRate.index - Index name to target.
|
|
270
|
+
* @param getNoClickRate.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
271
|
+
* @param getNoClickRate.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
272
|
+
* @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.
|
|
273
273
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
274
274
|
*/
|
|
275
275
|
getNoClickRate({ index, startDate, endDate, tags }, requestOptions) {
|
|
@@ -300,14 +300,14 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
300
300
|
return transporter.request(request, requestOptions);
|
|
301
301
|
},
|
|
302
302
|
/**
|
|
303
|
-
* Returns the rate at which searches didn\'t return any results.
|
|
303
|
+
* Returns the rate at which searches didn\'t return any results.
|
|
304
304
|
*
|
|
305
305
|
* @summary Get no results rate.
|
|
306
306
|
* @param getNoResultsRate - The getNoResultsRate object.
|
|
307
|
-
* @param getNoResultsRate.index -
|
|
308
|
-
* @param getNoResultsRate.startDate -
|
|
309
|
-
* @param getNoResultsRate.endDate -
|
|
310
|
-
* @param getNoResultsRate.tags - Filter
|
|
307
|
+
* @param getNoResultsRate.index - Index name to target.
|
|
308
|
+
* @param getNoResultsRate.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
309
|
+
* @param getNoResultsRate.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
310
|
+
* @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.
|
|
311
311
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
312
312
|
*/
|
|
313
313
|
getNoResultsRate({ index, startDate, endDate, tags }, requestOptions) {
|
|
@@ -338,14 +338,14 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
338
338
|
return transporter.request(request, requestOptions);
|
|
339
339
|
},
|
|
340
340
|
/**
|
|
341
|
-
* Returns the number of searches
|
|
341
|
+
* Returns the number of searches within a time range.
|
|
342
342
|
*
|
|
343
|
-
* @summary Get searches
|
|
343
|
+
* @summary Get number of searches.
|
|
344
344
|
* @param getSearchesCount - The getSearchesCount object.
|
|
345
|
-
* @param getSearchesCount.index -
|
|
346
|
-
* @param getSearchesCount.startDate -
|
|
347
|
-
* @param getSearchesCount.endDate -
|
|
348
|
-
* @param getSearchesCount.tags - Filter
|
|
345
|
+
* @param getSearchesCount.index - Index name to target.
|
|
346
|
+
* @param getSearchesCount.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
347
|
+
* @param getSearchesCount.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
348
|
+
* @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.
|
|
349
349
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
350
350
|
*/
|
|
351
351
|
getSearchesCount({ index, startDate, endDate, tags }, requestOptions) {
|
|
@@ -376,16 +376,16 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
376
376
|
return transporter.request(request, requestOptions);
|
|
377
377
|
},
|
|
378
378
|
/**
|
|
379
|
-
*
|
|
379
|
+
* Return the most popular of the last 1,000 searches that didn\'t lead to any clicks.
|
|
380
380
|
*
|
|
381
381
|
* @summary Get top searches with no clicks.
|
|
382
382
|
* @param getSearchesNoClicks - The getSearchesNoClicks object.
|
|
383
|
-
* @param getSearchesNoClicks.index -
|
|
384
|
-
* @param getSearchesNoClicks.startDate -
|
|
385
|
-
* @param getSearchesNoClicks.endDate -
|
|
386
|
-
* @param getSearchesNoClicks.limit - Number of records to return
|
|
383
|
+
* @param getSearchesNoClicks.index - Index name to target.
|
|
384
|
+
* @param getSearchesNoClicks.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
385
|
+
* @param getSearchesNoClicks.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
386
|
+
* @param getSearchesNoClicks.limit - Number of records to return (page size).
|
|
387
387
|
* @param getSearchesNoClicks.offset - Position of the starting record. Used for paging. 0 is the first record.
|
|
388
|
-
* @param getSearchesNoClicks.tags - Filter
|
|
388
|
+
* @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.
|
|
389
389
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
390
390
|
*/
|
|
391
391
|
getSearchesNoClicks({ index, startDate, endDate, limit, offset, tags, }, requestOptions) {
|
|
@@ -422,16 +422,16 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
422
422
|
return transporter.request(request, requestOptions);
|
|
423
423
|
},
|
|
424
424
|
/**
|
|
425
|
-
* Returns
|
|
425
|
+
* Returns the most popular of the latest 1,000 searches that didn\'t return any results.
|
|
426
426
|
*
|
|
427
427
|
* @summary Get top searches with no results.
|
|
428
428
|
* @param getSearchesNoResults - The getSearchesNoResults object.
|
|
429
|
-
* @param getSearchesNoResults.index -
|
|
430
|
-
* @param getSearchesNoResults.startDate -
|
|
431
|
-
* @param getSearchesNoResults.endDate -
|
|
432
|
-
* @param getSearchesNoResults.limit - Number of records to return
|
|
429
|
+
* @param getSearchesNoResults.index - Index name to target.
|
|
430
|
+
* @param getSearchesNoResults.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
431
|
+
* @param getSearchesNoResults.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
432
|
+
* @param getSearchesNoResults.limit - Number of records to return (page size).
|
|
433
433
|
* @param getSearchesNoResults.offset - Position of the starting record. Used for paging. 0 is the first record.
|
|
434
|
-
* @param getSearchesNoResults.tags - Filter
|
|
434
|
+
* @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.
|
|
435
435
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
436
436
|
*/
|
|
437
437
|
getSearchesNoResults({ index, startDate, endDate, limit, offset, tags, }, requestOptions) {
|
|
@@ -468,11 +468,11 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
468
468
|
return transporter.request(request, requestOptions);
|
|
469
469
|
},
|
|
470
470
|
/**
|
|
471
|
-
*
|
|
471
|
+
* 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.
|
|
472
472
|
*
|
|
473
473
|
* @summary Get Analytics API status.
|
|
474
474
|
* @param getStatus - The getStatus object.
|
|
475
|
-
* @param getStatus.index -
|
|
475
|
+
* @param getStatus.index - Index name to target.
|
|
476
476
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
477
477
|
*/
|
|
478
478
|
getStatus({ index }, requestOptions) {
|
|
@@ -494,16 +494,16 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
494
494
|
return transporter.request(request, requestOptions);
|
|
495
495
|
},
|
|
496
496
|
/**
|
|
497
|
-
* Returns top countries. Limited to the
|
|
497
|
+
* Returns top countries. Limited to the 1,000 most frequent ones.
|
|
498
498
|
*
|
|
499
499
|
* @summary Get top countries.
|
|
500
500
|
* @param getTopCountries - The getTopCountries object.
|
|
501
|
-
* @param getTopCountries.index -
|
|
502
|
-
* @param getTopCountries.startDate -
|
|
503
|
-
* @param getTopCountries.endDate -
|
|
504
|
-
* @param getTopCountries.limit - Number of records to return
|
|
501
|
+
* @param getTopCountries.index - Index name to target.
|
|
502
|
+
* @param getTopCountries.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
503
|
+
* @param getTopCountries.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
504
|
+
* @param getTopCountries.limit - Number of records to return (page size).
|
|
505
505
|
* @param getTopCountries.offset - Position of the starting record. Used for paging. 0 is the first record.
|
|
506
|
-
* @param getTopCountries.tags - Filter
|
|
506
|
+
* @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.
|
|
507
507
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
508
508
|
*/
|
|
509
509
|
getTopCountries({ index, startDate, endDate, limit, offset, tags }, requestOptions) {
|
|
@@ -540,17 +540,17 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
540
540
|
return transporter.request(request, requestOptions);
|
|
541
541
|
},
|
|
542
542
|
/**
|
|
543
|
-
*
|
|
543
|
+
* 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.
|
|
544
544
|
*
|
|
545
|
-
* @summary Get top
|
|
545
|
+
* @summary Get top filterable attributes.
|
|
546
546
|
* @param getTopFilterAttributes - The getTopFilterAttributes object.
|
|
547
|
-
* @param getTopFilterAttributes.index -
|
|
548
|
-
* @param getTopFilterAttributes.search -
|
|
549
|
-
* @param getTopFilterAttributes.startDate -
|
|
550
|
-
* @param getTopFilterAttributes.endDate -
|
|
551
|
-
* @param getTopFilterAttributes.limit - Number of records to return
|
|
547
|
+
* @param getTopFilterAttributes.index - Index name to target.
|
|
548
|
+
* @param getTopFilterAttributes.search - User query.
|
|
549
|
+
* @param getTopFilterAttributes.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
550
|
+
* @param getTopFilterAttributes.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
551
|
+
* @param getTopFilterAttributes.limit - Number of records to return (page size).
|
|
552
552
|
* @param getTopFilterAttributes.offset - Position of the starting record. Used for paging. 0 is the first record.
|
|
553
|
-
* @param getTopFilterAttributes.tags - Filter
|
|
553
|
+
* @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.
|
|
554
554
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
555
555
|
*/
|
|
556
556
|
getTopFilterAttributes({ index, search, startDate, endDate, limit, offset, tags, }, requestOptions) {
|
|
@@ -590,18 +590,18 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
590
590
|
return transporter.request(request, requestOptions);
|
|
591
591
|
},
|
|
592
592
|
/**
|
|
593
|
-
* Returns
|
|
593
|
+
* Returns the most popular filter values for an attribute in the 1,000 most recently used filters.
|
|
594
594
|
*
|
|
595
|
-
* @summary Get top
|
|
595
|
+
* @summary Get top filter values for an attribute.
|
|
596
596
|
* @param getTopFilterForAttribute - The getTopFilterForAttribute object.
|
|
597
|
-
* @param getTopFilterForAttribute.attribute -
|
|
598
|
-
* @param getTopFilterForAttribute.index -
|
|
599
|
-
* @param getTopFilterForAttribute.search -
|
|
600
|
-
* @param getTopFilterForAttribute.startDate -
|
|
601
|
-
* @param getTopFilterForAttribute.endDate -
|
|
602
|
-
* @param getTopFilterForAttribute.limit - Number of records to return
|
|
597
|
+
* @param getTopFilterForAttribute.attribute - Attribute name.
|
|
598
|
+
* @param getTopFilterForAttribute.index - Index name to target.
|
|
599
|
+
* @param getTopFilterForAttribute.search - User query.
|
|
600
|
+
* @param getTopFilterForAttribute.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
601
|
+
* @param getTopFilterForAttribute.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
602
|
+
* @param getTopFilterForAttribute.limit - Number of records to return (page size).
|
|
603
603
|
* @param getTopFilterForAttribute.offset - Position of the starting record. Used for paging. 0 is the first record.
|
|
604
|
-
* @param getTopFilterForAttribute.tags - Filter
|
|
604
|
+
* @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.
|
|
605
605
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
606
606
|
*/
|
|
607
607
|
getTopFilterForAttribute({ attribute, index, search, startDate, endDate, limit, offset, tags, }, requestOptions) {
|
|
@@ -644,17 +644,17 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
644
644
|
return transporter.request(request, requestOptions);
|
|
645
645
|
},
|
|
646
646
|
/**
|
|
647
|
-
* Returns top filters
|
|
647
|
+
* Returns top filters for filter-enabled searches that don\'t return results. Limited to the 1,000 most recently used filters.
|
|
648
648
|
*
|
|
649
649
|
* @summary Get top filters for a no result search.
|
|
650
650
|
* @param getTopFiltersNoResults - The getTopFiltersNoResults object.
|
|
651
|
-
* @param getTopFiltersNoResults.index -
|
|
652
|
-
* @param getTopFiltersNoResults.search -
|
|
653
|
-
* @param getTopFiltersNoResults.startDate -
|
|
654
|
-
* @param getTopFiltersNoResults.endDate -
|
|
655
|
-
* @param getTopFiltersNoResults.limit - Number of records to return
|
|
651
|
+
* @param getTopFiltersNoResults.index - Index name to target.
|
|
652
|
+
* @param getTopFiltersNoResults.search - User query.
|
|
653
|
+
* @param getTopFiltersNoResults.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
654
|
+
* @param getTopFiltersNoResults.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
655
|
+
* @param getTopFiltersNoResults.limit - Number of records to return (page size).
|
|
656
656
|
* @param getTopFiltersNoResults.offset - Position of the starting record. Used for paging. 0 is the first record.
|
|
657
|
-
* @param getTopFiltersNoResults.tags - Filter
|
|
657
|
+
* @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.
|
|
658
658
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
659
659
|
*/
|
|
660
660
|
getTopFiltersNoResults({ index, search, startDate, endDate, limit, offset, tags, }, requestOptions) {
|
|
@@ -694,18 +694,18 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
694
694
|
return transporter.request(request, requestOptions);
|
|
695
695
|
},
|
|
696
696
|
/**
|
|
697
|
-
*
|
|
697
|
+
* Return the most popular clicked results in the last 1,000 searches.
|
|
698
698
|
*
|
|
699
699
|
* @summary Get top hits.
|
|
700
700
|
* @param getTopHits - The getTopHits object.
|
|
701
|
-
* @param getTopHits.index -
|
|
702
|
-
* @param getTopHits.search -
|
|
703
|
-
* @param getTopHits.clickAnalytics - Whether to include
|
|
704
|
-
* @param getTopHits.startDate -
|
|
705
|
-
* @param getTopHits.endDate -
|
|
706
|
-
* @param getTopHits.limit - Number of records to return
|
|
701
|
+
* @param getTopHits.index - Index name to target.
|
|
702
|
+
* @param getTopHits.search - User query.
|
|
703
|
+
* @param getTopHits.clickAnalytics - Whether to include [click and conversion](https://www.algolia.com/doc/guides/sending-events/getting-started/) rates for a search.
|
|
704
|
+
* @param getTopHits.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
705
|
+
* @param getTopHits.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
706
|
+
* @param getTopHits.limit - Number of records to return (page size).
|
|
707
707
|
* @param getTopHits.offset - Position of the starting record. Used for paging. 0 is the first record.
|
|
708
|
-
* @param getTopHits.tags - Filter
|
|
708
|
+
* @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.
|
|
709
709
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
710
710
|
*/
|
|
711
711
|
getTopHits({ index, search, clickAnalytics, startDate, endDate, limit, offset, tags, }, requestOptions) {
|
|
@@ -748,19 +748,19 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
748
748
|
return transporter.request(request, requestOptions);
|
|
749
749
|
},
|
|
750
750
|
/**
|
|
751
|
-
* Returns
|
|
751
|
+
* Returns the most popular of the latest 1,000 searches. For each search, also returns the number of hits.
|
|
752
752
|
*
|
|
753
753
|
* @summary Get top searches.
|
|
754
754
|
* @param getTopSearches - The getTopSearches object.
|
|
755
|
-
* @param getTopSearches.index -
|
|
756
|
-
* @param getTopSearches.clickAnalytics - Whether to include
|
|
757
|
-
* @param getTopSearches.startDate -
|
|
758
|
-
* @param getTopSearches.endDate -
|
|
755
|
+
* @param getTopSearches.index - Index name to target.
|
|
756
|
+
* @param getTopSearches.clickAnalytics - Whether to include [click and conversion](https://www.algolia.com/doc/guides/sending-events/getting-started/) rates for a search.
|
|
757
|
+
* @param getTopSearches.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
758
|
+
* @param getTopSearches.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
759
759
|
* @param getTopSearches.orderBy - Reorder the results.
|
|
760
|
-
* @param getTopSearches.direction -
|
|
761
|
-
* @param getTopSearches.limit - Number of records to return
|
|
760
|
+
* @param getTopSearches.direction - Sorting direction of the results: ascending or descending.
|
|
761
|
+
* @param getTopSearches.limit - Number of records to return (page size).
|
|
762
762
|
* @param getTopSearches.offset - Position of the starting record. Used for paging. 0 is the first record.
|
|
763
|
-
* @param getTopSearches.tags - Filter
|
|
763
|
+
* @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.
|
|
764
764
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
765
765
|
*/
|
|
766
766
|
getTopSearches({ index, clickAnalytics, startDate, endDate, orderBy, direction, limit, offset, tags, }, requestOptions) {
|
|
@@ -806,14 +806,14 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
806
806
|
return transporter.request(request, requestOptions);
|
|
807
807
|
},
|
|
808
808
|
/**
|
|
809
|
-
*
|
|
809
|
+
* Return the count of unique users.
|
|
810
810
|
*
|
|
811
|
-
* @summary Get
|
|
811
|
+
* @summary Get user count.
|
|
812
812
|
* @param getUsersCount - The getUsersCount object.
|
|
813
|
-
* @param getUsersCount.index -
|
|
814
|
-
* @param getUsersCount.startDate -
|
|
815
|
-
* @param getUsersCount.endDate -
|
|
816
|
-
* @param getUsersCount.tags - Filter
|
|
813
|
+
* @param getUsersCount.index - Index name to target.
|
|
814
|
+
* @param getUsersCount.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
815
|
+
* @param getUsersCount.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
816
|
+
* @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.
|
|
817
817
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
818
818
|
*/
|
|
819
819
|
getUsersCount({ index, startDate, endDate, tags }, requestOptions) {
|
|
@@ -848,9 +848,9 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
848
848
|
*
|
|
849
849
|
* @summary Send requests to the Algolia REST API.
|
|
850
850
|
* @param post - The post object.
|
|
851
|
-
* @param post.path -
|
|
852
|
-
* @param post.parameters - Query parameters to
|
|
853
|
-
* @param post.body -
|
|
851
|
+
* @param post.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
852
|
+
* @param post.parameters - Query parameters to apply to the current query.
|
|
853
|
+
* @param post.body - Parameters to send with the custom request.
|
|
854
854
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
855
855
|
*/
|
|
856
856
|
post({ path, parameters, body }, requestOptions) {
|
|
@@ -874,9 +874,9 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
874
874
|
*
|
|
875
875
|
* @summary Send requests to the Algolia REST API.
|
|
876
876
|
* @param put - The put object.
|
|
877
|
-
* @param put.path -
|
|
878
|
-
* @param put.parameters - Query parameters to
|
|
879
|
-
* @param put.body -
|
|
877
|
+
* @param put.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
878
|
+
* @param put.parameters - Query parameters to apply to the current query.
|
|
879
|
+
* @param put.body - Parameters to send with the custom request.
|
|
880
880
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
881
881
|
*/
|
|
882
882
|
put({ path, parameters, body }, requestOptions) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! client-analytics.umd.js | 5.0.0-alpha.
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/client-analytics"]={})}(this,(function(e){"use strict";function t(e){let t;const r=`algolia-client-js-${e.key}`;function i(){return void 0===t&&(t=e.localStorage||window.localStorage),t}function o(){return JSON.parse(i().getItem(r)||"{}")}return{get:(e,t,r={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>{const r=JSON.stringify(e),i=o()[r];return Promise.all([i||t(),void 0!==i])})).then((([e,t])=>Promise.all([e,t||r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve().then((()=>{const s=o();return s[JSON.stringify(e)]=t,i().setItem(r,JSON.stringify(s)),t})),delete:e=>Promise.resolve().then((()=>{const t=o();delete t[JSON.stringify(e)],i().setItem(r,JSON.stringify(t))})),clear:()=>Promise.resolve().then((()=>{i().removeItem(r)}))}}function r(e){const t=[...e.caches],i=t.shift();return void 0===i?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then((e=>Promise.all([e,r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,o,s={miss:()=>Promise.resolve()})=>i.get(e,o,s).catch((()=>r({caches:t}).get(e,o,s))),set:(e,o)=>i.set(e,o).catch((()=>r({caches:t}).set(e,o))),delete:e=>i.delete(e).catch((()=>r({caches:t}).delete(e))),clear:()=>i.clear().catch((()=>r({caches:t}).clear()))}}function i(e={serializable:!0}){let t={};return{get(r,i,o={miss:()=>Promise.resolve()}){const s=JSON.stringify(r);if(s in t)return Promise.resolve(e.serializable?JSON.parse(t[s]):t[s]);const a=i();return a.then((e=>o.miss(e))).then((()=>a))},set:(r,i)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(i):i,Promise.resolve(i)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}const o=12e4;function s(e,t="up"){const r=Date.now();return{...e,status:t,lastUpdate:r,isUp:function(){return"up"===t||Date.now()-r>o},isTimedOut:function(){return"timed out"===t&&Date.now()-r<=o}}}function a(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class n extends Error{constructor(e,t){super(e),a(this,"name","AlgoliaError"),t&&(this.name=t)}}class d extends n{constructor(e,t,r){super(e,r),a(this,"stackTrace",void 0),this.stackTrace=t}}class c extends d{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",e,"RetryError")}}class u extends d{constructor(e,t,r,i="ApiError"){super(e,r,i),a(this,"status",void 0),this.status=t}}class l extends n{constructor(e,t){super(e,"DeserializationError"),a(this,"response",void 0),this.response=t}}class g extends u{constructor(e,t,r,i){super(e,t,i,"DetailedApiError"),a(this,"error",void 0),this.error=r}}function h(e,t,r){const i=function(e){const t=e=>"[object Object]"===Object.prototype.toString.call(e)||"[object Array]"===Object.prototype.toString.call(e);return Object.keys(e).map((r=>`${r}=${encodeURIComponent(t(e[r])?JSON.stringify(e[r]):e[r])}`)).join("&")}(r);let o=`${e.protocol}://${e.url}/${"/"===t.charAt(0)?t.substr(1):t}`;return i.length&&(o+=`?${i}`),o}function m(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function p({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:i,algoliaAgent:o,timeouts:a,requester:n,requestsCache:d,responsesCache:p}){async function f(d,p,f=!0){const v=[],S=function(e,t){if("GET"===e.method||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(d,p),y=function(e,t,r){const i={Accept:"application/json",...e,...t,...r},o={};return Object.keys(i).forEach((e=>{const t=i[e];o[e.toLowerCase()]=t})),o}(r,d.headers,p.headers),w="GET"===d.method?{...d.data,...p.data}:{},P={...i,...d.queryParameters,...w};if(o.value&&(P["x-algolia-agent"]=o.value),p&&p.queryParameters)for(const e of Object.keys(p.queryParameters))p.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(p.queryParameters[e])?P[e]=p.queryParameters[e].toString():P[e]=p.queryParameters[e];let q=0;const D=async(e,r)=>{const i=e.pop();if(void 0===i)throw new c(function(e){return e.map((e=>m(e)))}(v));let o=p.timeout;void 0===o&&(o=f?a.read:a.write);const w={data:S,headers:y,method:d.method,url:h(i,d.path,P),connectTimeout:r(q,a.connect),responseTimeout:r(q,o)},T=t=>{const r={request:w,response:t,host:i,triesLeft:e.length};return v.push(r),r},x=await n.send(w);if(function({isTimedOut:e,status:t}){return e||function({isTimedOut:e,status:t}){return!e&&0==~~t}({isTimedOut:e,status:t})||2!=~~(t/100)&&4!=~~(t/100)}(x)){const o=T(x);return x.isTimedOut&&q++,console.log("Retryable failure",m(o)),await t.set(i,s(i,x.isTimedOut?"timed out":"down")),D(e,r)}if(function({status:e}){return 2==~~(e/100)}(x))return function(e){try{return JSON.parse(e.content)}catch(t){throw new l(t.message,e)}}(x);throw T(x),function({content:e,status:t},r){try{const i=JSON.parse(e);return"error"in i?new g(i.message,t,i.error,r):new u(i.message,t,r)}catch(e){}return new u(e,t,r)}(x,v)},T=e.filter((e=>"readWrite"===e.accept||(f?"read"===e.accept:"write"===e.accept))),x=await async function(e){const r=await Promise.all(e.map((e=>t.get(e,(()=>Promise.resolve(s(e))))))),i=r.filter((e=>e.isUp())),o=r.filter((e=>e.isTimedOut())),a=[...i,...o];return{hosts:a.length>0?a:e,getTimeout:(e,t)=>(0===o.length&&0===e?1:o.length+3+e)*t}}(T);return D([...x.hosts].reverse(),x.getTimeout)}return{hostsCache:t,requester:n,timeouts:a,algoliaAgent:o,baseHeaders:r,baseQueryParameters:i,hosts:e,request:function(e,t={}){const o=e.useReadTransporter||"GET"===e.method;if(!o)return f(e,t,o);const s=()=>f(e,t);if(!0!==(t.cacheable||e.cacheable))return s();const a={request:e,requestOptions:t,transporter:{queryParameters:i,headers:r}};return p.get(a,(()=>d.get(a,(()=>d.set(a,s()).then((e=>Promise.all([d.delete(a),e])),(e=>Promise.all([d.delete(a),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>p.set(a,e)})},requestsCache:d,responsesCache:p}}function f({algoliaAgents:e,client:t,version:r}){const i=function(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}(r).add({segment:t,version:r});return e.forEach((e=>i.add(e))),i}const v="5.0.0-alpha.73",S=["de","us"];e.analyticsClient=function(e,o,s,a){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!o||"string"!=typeof o)throw new Error("`apiKey` is missing.");if(s&&("string"!=typeof s||!S.includes(s)))throw new Error(`\`region\` must be one of the following: ${S.join(", ")}`);return function({appId:e,apiKey:t,authMode:r,algoliaAgents:i,region:o,...s}){const a=function(e,t,r="WithinHeaders"){const i={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===r?i:{},queryParameters:()=>"WithinQueryParameters"===r?i:{}}}(e,t,r),n=p({hosts:(d=o,[{url:d?"analytics.{region}.algolia.com".replace("{region}",d):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]),...s,algoliaAgent:f({algoliaAgents:i,client:"Analytics",version:v}),baseHeaders:{"content-type":"text/plain",...a.headers(),...s.baseHeaders},baseQueryParameters:{...a.queryParameters(),...s.baseQueryParameters}});var d;return{transporter:n,appId:e,clearCache:()=>Promise.all([n.requestsCache.clear(),n.responsesCache.clear()]).then((()=>{})),get _ua(){return n.algoliaAgent.value},addAlgoliaAgent(e,t){n.algoliaAgent.add({segment:e,version:t})},del({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `del`.");const i={method:"DELETE",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return n.request(i,r)},get({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `get`.");const i={method:"GET",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return n.request(i,r)},getAverageClickPosition({index:e,startDate:t,endDate:r,tags:i},o){if(!e)throw new Error("Parameter `index` is required when calling `getAverageClickPosition`.");const s={};void 0!==e&&(s.index=e.toString()),void 0!==t&&(s.startDate=t.toString()),void 0!==r&&(s.endDate=r.toString()),void 0!==i&&(s.tags=i.toString());const a={method:"GET",path:"/2/clicks/averageClickPosition",queryParameters:s,headers:{}};return n.request(a,o)},getClickPositions({index:e,startDate:t,endDate:r,tags:i},o){if(!e)throw new Error("Parameter `index` is required when calling `getClickPositions`.");const s={};void 0!==e&&(s.index=e.toString()),void 0!==t&&(s.startDate=t.toString()),void 0!==r&&(s.endDate=r.toString()),void 0!==i&&(s.tags=i.toString());const a={method:"GET",path:"/2/clicks/positions",queryParameters:s,headers:{}};return n.request(a,o)},getClickThroughRate({index:e,startDate:t,endDate:r,tags:i},o){if(!e)throw new Error("Parameter `index` is required when calling `getClickThroughRate`.");const s={};void 0!==e&&(s.index=e.toString()),void 0!==t&&(s.startDate=t.toString()),void 0!==r&&(s.endDate=r.toString()),void 0!==i&&(s.tags=i.toString());const a={method:"GET",path:"/2/clicks/clickThroughRate",queryParameters:s,headers:{}};return n.request(a,o)},getConversationRate({index:e,startDate:t,endDate:r,tags:i},o){if(!e)throw new Error("Parameter `index` is required when calling `getConversationRate`.");const s={};void 0!==e&&(s.index=e.toString()),void 0!==t&&(s.startDate=t.toString()),void 0!==r&&(s.endDate=r.toString()),void 0!==i&&(s.tags=i.toString());const a={method:"GET",path:"/2/conversions/conversionRate",queryParameters:s,headers:{}};return n.request(a,o)},getNoClickRate({index:e,startDate:t,endDate:r,tags:i},o){if(!e)throw new Error("Parameter `index` is required when calling `getNoClickRate`.");const s={};void 0!==e&&(s.index=e.toString()),void 0!==t&&(s.startDate=t.toString()),void 0!==r&&(s.endDate=r.toString()),void 0!==i&&(s.tags=i.toString());const a={method:"GET",path:"/2/searches/noClickRate",queryParameters:s,headers:{}};return n.request(a,o)},getNoResultsRate({index:e,startDate:t,endDate:r,tags:i},o){if(!e)throw new Error("Parameter `index` is required when calling `getNoResultsRate`.");const s={};void 0!==e&&(s.index=e.toString()),void 0!==t&&(s.startDate=t.toString()),void 0!==r&&(s.endDate=r.toString()),void 0!==i&&(s.tags=i.toString());const a={method:"GET",path:"/2/searches/noResultRate",queryParameters:s,headers:{}};return n.request(a,o)},getSearchesCount({index:e,startDate:t,endDate:r,tags:i},o){if(!e)throw new Error("Parameter `index` is required when calling `getSearchesCount`.");const s={};void 0!==e&&(s.index=e.toString()),void 0!==t&&(s.startDate=t.toString()),void 0!==r&&(s.endDate=r.toString()),void 0!==i&&(s.tags=i.toString());const a={method:"GET",path:"/2/searches/count",queryParameters:s,headers:{}};return n.request(a,o)},getSearchesNoClicks({index:e,startDate:t,endDate:r,limit:i,offset:o,tags:s},a){if(!e)throw new Error("Parameter `index` is required when calling `getSearchesNoClicks`.");const d={};void 0!==e&&(d.index=e.toString()),void 0!==t&&(d.startDate=t.toString()),void 0!==r&&(d.endDate=r.toString()),void 0!==i&&(d.limit=i.toString()),void 0!==o&&(d.offset=o.toString()),void 0!==s&&(d.tags=s.toString());const c={method:"GET",path:"/2/searches/noClicks",queryParameters:d,headers:{}};return n.request(c,a)},getSearchesNoResults({index:e,startDate:t,endDate:r,limit:i,offset:o,tags:s},a){if(!e)throw new Error("Parameter `index` is required when calling `getSearchesNoResults`.");const d={};void 0!==e&&(d.index=e.toString()),void 0!==t&&(d.startDate=t.toString()),void 0!==r&&(d.endDate=r.toString()),void 0!==i&&(d.limit=i.toString()),void 0!==o&&(d.offset=o.toString()),void 0!==s&&(d.tags=s.toString());const c={method:"GET",path:"/2/searches/noResults",queryParameters:d,headers:{}};return n.request(c,a)},getStatus({index:e},t){if(!e)throw new Error("Parameter `index` is required when calling `getStatus`.");const r={};void 0!==e&&(r.index=e.toString());const i={method:"GET",path:"/2/status",queryParameters:r,headers:{}};return n.request(i,t)},getTopCountries({index:e,startDate:t,endDate:r,limit:i,offset:o,tags:s},a){if(!e)throw new Error("Parameter `index` is required when calling `getTopCountries`.");const d={};void 0!==e&&(d.index=e.toString()),void 0!==t&&(d.startDate=t.toString()),void 0!==r&&(d.endDate=r.toString()),void 0!==i&&(d.limit=i.toString()),void 0!==o&&(d.offset=o.toString()),void 0!==s&&(d.tags=s.toString());const c={method:"GET",path:"/2/countries",queryParameters:d,headers:{}};return n.request(c,a)},getTopFilterAttributes({index:e,search:t,startDate:r,endDate:i,limit:o,offset:s,tags:a},d){if(!e)throw new Error("Parameter `index` is required when calling `getTopFilterAttributes`.");const c={};void 0!==e&&(c.index=e.toString()),void 0!==t&&(c.search=t.toString()),void 0!==r&&(c.startDate=r.toString()),void 0!==i&&(c.endDate=i.toString()),void 0!==o&&(c.limit=o.toString()),void 0!==s&&(c.offset=s.toString()),void 0!==a&&(c.tags=a.toString());const u={method:"GET",path:"/2/filters",queryParameters:c,headers:{}};return n.request(u,d)},getTopFilterForAttribute({attribute:e,index:t,search:r,startDate:i,endDate:o,limit:s,offset:a,tags:d},c){if(!e)throw new Error("Parameter `attribute` is required when calling `getTopFilterForAttribute`.");if(!t)throw new Error("Parameter `index` is required when calling `getTopFilterForAttribute`.");const u="/2/filters/{attribute}".replace("{attribute}",encodeURIComponent(e)),l={};void 0!==t&&(l.index=t.toString()),void 0!==r&&(l.search=r.toString()),void 0!==i&&(l.startDate=i.toString()),void 0!==o&&(l.endDate=o.toString()),void 0!==s&&(l.limit=s.toString()),void 0!==a&&(l.offset=a.toString()),void 0!==d&&(l.tags=d.toString());const g={method:"GET",path:u,queryParameters:l,headers:{}};return n.request(g,c)},getTopFiltersNoResults({index:e,search:t,startDate:r,endDate:i,limit:o,offset:s,tags:a},d){if(!e)throw new Error("Parameter `index` is required when calling `getTopFiltersNoResults`.");const c={};void 0!==e&&(c.index=e.toString()),void 0!==t&&(c.search=t.toString()),void 0!==r&&(c.startDate=r.toString()),void 0!==i&&(c.endDate=i.toString()),void 0!==o&&(c.limit=o.toString()),void 0!==s&&(c.offset=s.toString()),void 0!==a&&(c.tags=a.toString());const u={method:"GET",path:"/2/filters/noResults",queryParameters:c,headers:{}};return n.request(u,d)},getTopHits({index:e,search:t,clickAnalytics:r,startDate:i,endDate:o,limit:s,offset:a,tags:d},c){if(!e)throw new Error("Parameter `index` is required when calling `getTopHits`.");const u={};void 0!==e&&(u.index=e.toString()),void 0!==t&&(u.search=t.toString()),void 0!==r&&(u.clickAnalytics=r.toString()),void 0!==i&&(u.startDate=i.toString()),void 0!==o&&(u.endDate=o.toString()),void 0!==s&&(u.limit=s.toString()),void 0!==a&&(u.offset=a.toString()),void 0!==d&&(u.tags=d.toString());const l={method:"GET",path:"/2/hits",queryParameters:u,headers:{}};return n.request(l,c)},getTopSearches({index:e,clickAnalytics:t,startDate:r,endDate:i,orderBy:o,direction:s,limit:a,offset:d,tags:c},u){if(!e)throw new Error("Parameter `index` is required when calling `getTopSearches`.");const l={};void 0!==e&&(l.index=e.toString()),void 0!==t&&(l.clickAnalytics=t.toString()),void 0!==r&&(l.startDate=r.toString()),void 0!==i&&(l.endDate=i.toString()),void 0!==o&&(l.orderBy=o.toString()),void 0!==s&&(l.direction=s.toString()),void 0!==a&&(l.limit=a.toString()),void 0!==d&&(l.offset=d.toString()),void 0!==c&&(l.tags=c.toString());const g={method:"GET",path:"/2/searches",queryParameters:l,headers:{}};return n.request(g,u)},getUsersCount({index:e,startDate:t,endDate:r,tags:i},o){if(!e)throw new Error("Parameter `index` is required when calling `getUsersCount`.");const s={};void 0!==e&&(s.index=e.toString()),void 0!==t&&(s.startDate=t.toString()),void 0!==r&&(s.endDate=r.toString()),void 0!==i&&(s.tags=i.toString());const a={method:"GET",path:"/2/users/count",queryParameters:s,headers:{}};return n.request(a,o)},post({path:e,parameters:t,body:r},i){if(!e)throw new Error("Parameter `path` is required when calling `post`.");const o={method:"POST",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return n.request(o,i)},put({path:e,parameters:t,body:r},i){if(!e)throw new Error("Parameter `path` is required when calling `put`.");const o={method:"PUT",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return n.request(o,i)}}}({appId:e,apiKey:o,region:s,timeouts:{connect:1e3,read:2e3,write:3e4},requester:{send:function(e){return new Promise((t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((t=>r.setRequestHeader(t,e.headers[t])));const i=(e,i)=>setTimeout((()=>{r.abort(),t({status:0,content:i,isTimedOut:!0})}),e),o=i(e.connectTimeout,"Connection timeout");let s;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===s&&(clearTimeout(o),s=i(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(o),clearTimeout(s),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(o),clearTimeout(s),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:i(),requestsCache:i({serializable:!1}),hostsCache:r({caches:[t({key:`${v}-${e}`}),i()]}),...a})},e.apiClientVersion=v}));
|
|
1
|
+
/*! client-analytics.umd.js | 5.0.0-alpha.76 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/client-analytics"]={})}(this,(function(e){"use strict";function t(e){let t;const r=`algolia-client-js-${e.key}`;function i(){return void 0===t&&(t=e.localStorage||window.localStorage),t}function o(){return JSON.parse(i().getItem(r)||"{}")}return{get:(e,t,r={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>{const r=JSON.stringify(e),i=o()[r];return Promise.all([i||t(),void 0!==i])})).then((([e,t])=>Promise.all([e,t||r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve().then((()=>{const s=o();return s[JSON.stringify(e)]=t,i().setItem(r,JSON.stringify(s)),t})),delete:e=>Promise.resolve().then((()=>{const t=o();delete t[JSON.stringify(e)],i().setItem(r,JSON.stringify(t))})),clear:()=>Promise.resolve().then((()=>{i().removeItem(r)}))}}function r(e){const t=[...e.caches],i=t.shift();return void 0===i?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then((e=>Promise.all([e,r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,o,s={miss:()=>Promise.resolve()})=>i.get(e,o,s).catch((()=>r({caches:t}).get(e,o,s))),set:(e,o)=>i.set(e,o).catch((()=>r({caches:t}).set(e,o))),delete:e=>i.delete(e).catch((()=>r({caches:t}).delete(e))),clear:()=>i.clear().catch((()=>r({caches:t}).clear()))}}function i(e={serializable:!0}){let t={};return{get(r,i,o={miss:()=>Promise.resolve()}){const s=JSON.stringify(r);if(s in t)return Promise.resolve(e.serializable?JSON.parse(t[s]):t[s]);const a=i();return a.then((e=>o.miss(e))).then((()=>a))},set:(r,i)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(i):i,Promise.resolve(i)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}const o=12e4;function s(e,t="up"){const r=Date.now();return{...e,status:t,lastUpdate:r,isUp:function(){return"up"===t||Date.now()-r>o},isTimedOut:function(){return"timed out"===t&&Date.now()-r<=o}}}function a(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class n extends Error{constructor(e,t){super(e),a(this,"name","AlgoliaError"),t&&(this.name=t)}}class d extends n{constructor(e,t,r){super(e,r),a(this,"stackTrace",void 0),this.stackTrace=t}}class c extends d{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",e,"RetryError")}}class u extends d{constructor(e,t,r,i="ApiError"){super(e,r,i),a(this,"status",void 0),this.status=t}}class l extends n{constructor(e,t){super(e,"DeserializationError"),a(this,"response",void 0),this.response=t}}class g extends u{constructor(e,t,r,i){super(e,t,i,"DetailedApiError"),a(this,"error",void 0),this.error=r}}function h(e,t,r){const i=function(e){const t=e=>"[object Object]"===Object.prototype.toString.call(e)||"[object Array]"===Object.prototype.toString.call(e);return Object.keys(e).map((r=>`${r}=${encodeURIComponent(t(e[r])?JSON.stringify(e[r]):e[r])}`)).join("&")}(r);let o=`${e.protocol}://${e.url}/${"/"===t.charAt(0)?t.substr(1):t}`;return i.length&&(o+=`?${i}`),o}function m(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function p({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:i,algoliaAgent:o,timeouts:a,requester:n,requestsCache:d,responsesCache:p}){async function f(d,p,f=!0){const v=[],S=function(e,t){if("GET"===e.method||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(d,p),y=function(e,t,r){const i={Accept:"application/json",...e,...t,...r},o={};return Object.keys(i).forEach((e=>{const t=i[e];o[e.toLowerCase()]=t})),o}(r,d.headers,p.headers),w="GET"===d.method?{...d.data,...p.data}:{},P={...i,...d.queryParameters,...w};if(o.value&&(P["x-algolia-agent"]=o.value),p&&p.queryParameters)for(const e of Object.keys(p.queryParameters))p.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(p.queryParameters[e])?P[e]=p.queryParameters[e].toString():P[e]=p.queryParameters[e];let q=0;const D=async(e,r)=>{const i=e.pop();if(void 0===i)throw new c(function(e){return e.map((e=>m(e)))}(v));let o=p.timeout;void 0===o&&(o=f?a.read:a.write);const w={data:S,headers:y,method:d.method,url:h(i,d.path,P),connectTimeout:r(q,a.connect),responseTimeout:r(q,o)},T=t=>{const r={request:w,response:t,host:i,triesLeft:e.length};return v.push(r),r},x=await n.send(w);if(function({isTimedOut:e,status:t}){return e||function({isTimedOut:e,status:t}){return!e&&0==~~t}({isTimedOut:e,status:t})||2!=~~(t/100)&&4!=~~(t/100)}(x)){const o=T(x);return x.isTimedOut&&q++,console.log("Retryable failure",m(o)),await t.set(i,s(i,x.isTimedOut?"timed out":"down")),D(e,r)}if(function({status:e}){return 2==~~(e/100)}(x))return function(e){try{return JSON.parse(e.content)}catch(t){throw new l(t.message,e)}}(x);throw T(x),function({content:e,status:t},r){try{const i=JSON.parse(e);return"error"in i?new g(i.message,t,i.error,r):new u(i.message,t,r)}catch(e){}return new u(e,t,r)}(x,v)},T=e.filter((e=>"readWrite"===e.accept||(f?"read"===e.accept:"write"===e.accept))),x=await async function(e){const r=await Promise.all(e.map((e=>t.get(e,(()=>Promise.resolve(s(e))))))),i=r.filter((e=>e.isUp())),o=r.filter((e=>e.isTimedOut())),a=[...i,...o];return{hosts:a.length>0?a:e,getTimeout:(e,t)=>(0===o.length&&0===e?1:o.length+3+e)*t}}(T);return D([...x.hosts].reverse(),x.getTimeout)}return{hostsCache:t,requester:n,timeouts:a,algoliaAgent:o,baseHeaders:r,baseQueryParameters:i,hosts:e,request:function(e,t={}){const o=e.useReadTransporter||"GET"===e.method;if(!o)return f(e,t,o);const s=()=>f(e,t);if(!0!==(t.cacheable||e.cacheable))return s();const a={request:e,requestOptions:t,transporter:{queryParameters:i,headers:r}};return p.get(a,(()=>d.get(a,(()=>d.set(a,s()).then((e=>Promise.all([d.delete(a),e])),(e=>Promise.all([d.delete(a),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>p.set(a,e)})},requestsCache:d,responsesCache:p}}function f({algoliaAgents:e,client:t,version:r}){const i=function(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}(r).add({segment:t,version:r});return e.forEach((e=>i.add(e))),i}const v="5.0.0-alpha.76",S=["de","us"];e.analyticsClient=function(e,o,s,a){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!o||"string"!=typeof o)throw new Error("`apiKey` is missing.");if(s&&("string"!=typeof s||!S.includes(s)))throw new Error(`\`region\` must be one of the following: ${S.join(", ")}`);return function({appId:e,apiKey:t,authMode:r,algoliaAgents:i,region:o,...s}){const a=function(e,t,r="WithinHeaders"){const i={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===r?i:{},queryParameters:()=>"WithinQueryParameters"===r?i:{}}}(e,t,r),n=p({hosts:(d=o,[{url:d?"analytics.{region}.algolia.com".replace("{region}",d):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]),...s,algoliaAgent:f({algoliaAgents:i,client:"Analytics",version:v}),baseHeaders:{"content-type":"text/plain",...a.headers(),...s.baseHeaders},baseQueryParameters:{...a.queryParameters(),...s.baseQueryParameters}});var d;return{transporter:n,appId:e,clearCache:()=>Promise.all([n.requestsCache.clear(),n.responsesCache.clear()]).then((()=>{})),get _ua(){return n.algoliaAgent.value},addAlgoliaAgent(e,t){n.algoliaAgent.add({segment:e,version:t})},del({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `del`.");const i={method:"DELETE",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return n.request(i,r)},get({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `get`.");const i={method:"GET",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return n.request(i,r)},getAverageClickPosition({index:e,startDate:t,endDate:r,tags:i},o){if(!e)throw new Error("Parameter `index` is required when calling `getAverageClickPosition`.");const s={};void 0!==e&&(s.index=e.toString()),void 0!==t&&(s.startDate=t.toString()),void 0!==r&&(s.endDate=r.toString()),void 0!==i&&(s.tags=i.toString());const a={method:"GET",path:"/2/clicks/averageClickPosition",queryParameters:s,headers:{}};return n.request(a,o)},getClickPositions({index:e,startDate:t,endDate:r,tags:i},o){if(!e)throw new Error("Parameter `index` is required when calling `getClickPositions`.");const s={};void 0!==e&&(s.index=e.toString()),void 0!==t&&(s.startDate=t.toString()),void 0!==r&&(s.endDate=r.toString()),void 0!==i&&(s.tags=i.toString());const a={method:"GET",path:"/2/clicks/positions",queryParameters:s,headers:{}};return n.request(a,o)},getClickThroughRate({index:e,startDate:t,endDate:r,tags:i},o){if(!e)throw new Error("Parameter `index` is required when calling `getClickThroughRate`.");const s={};void 0!==e&&(s.index=e.toString()),void 0!==t&&(s.startDate=t.toString()),void 0!==r&&(s.endDate=r.toString()),void 0!==i&&(s.tags=i.toString());const a={method:"GET",path:"/2/clicks/clickThroughRate",queryParameters:s,headers:{}};return n.request(a,o)},getConversationRate({index:e,startDate:t,endDate:r,tags:i},o){if(!e)throw new Error("Parameter `index` is required when calling `getConversationRate`.");const s={};void 0!==e&&(s.index=e.toString()),void 0!==t&&(s.startDate=t.toString()),void 0!==r&&(s.endDate=r.toString()),void 0!==i&&(s.tags=i.toString());const a={method:"GET",path:"/2/conversions/conversionRate",queryParameters:s,headers:{}};return n.request(a,o)},getNoClickRate({index:e,startDate:t,endDate:r,tags:i},o){if(!e)throw new Error("Parameter `index` is required when calling `getNoClickRate`.");const s={};void 0!==e&&(s.index=e.toString()),void 0!==t&&(s.startDate=t.toString()),void 0!==r&&(s.endDate=r.toString()),void 0!==i&&(s.tags=i.toString());const a={method:"GET",path:"/2/searches/noClickRate",queryParameters:s,headers:{}};return n.request(a,o)},getNoResultsRate({index:e,startDate:t,endDate:r,tags:i},o){if(!e)throw new Error("Parameter `index` is required when calling `getNoResultsRate`.");const s={};void 0!==e&&(s.index=e.toString()),void 0!==t&&(s.startDate=t.toString()),void 0!==r&&(s.endDate=r.toString()),void 0!==i&&(s.tags=i.toString());const a={method:"GET",path:"/2/searches/noResultRate",queryParameters:s,headers:{}};return n.request(a,o)},getSearchesCount({index:e,startDate:t,endDate:r,tags:i},o){if(!e)throw new Error("Parameter `index` is required when calling `getSearchesCount`.");const s={};void 0!==e&&(s.index=e.toString()),void 0!==t&&(s.startDate=t.toString()),void 0!==r&&(s.endDate=r.toString()),void 0!==i&&(s.tags=i.toString());const a={method:"GET",path:"/2/searches/count",queryParameters:s,headers:{}};return n.request(a,o)},getSearchesNoClicks({index:e,startDate:t,endDate:r,limit:i,offset:o,tags:s},a){if(!e)throw new Error("Parameter `index` is required when calling `getSearchesNoClicks`.");const d={};void 0!==e&&(d.index=e.toString()),void 0!==t&&(d.startDate=t.toString()),void 0!==r&&(d.endDate=r.toString()),void 0!==i&&(d.limit=i.toString()),void 0!==o&&(d.offset=o.toString()),void 0!==s&&(d.tags=s.toString());const c={method:"GET",path:"/2/searches/noClicks",queryParameters:d,headers:{}};return n.request(c,a)},getSearchesNoResults({index:e,startDate:t,endDate:r,limit:i,offset:o,tags:s},a){if(!e)throw new Error("Parameter `index` is required when calling `getSearchesNoResults`.");const d={};void 0!==e&&(d.index=e.toString()),void 0!==t&&(d.startDate=t.toString()),void 0!==r&&(d.endDate=r.toString()),void 0!==i&&(d.limit=i.toString()),void 0!==o&&(d.offset=o.toString()),void 0!==s&&(d.tags=s.toString());const c={method:"GET",path:"/2/searches/noResults",queryParameters:d,headers:{}};return n.request(c,a)},getStatus({index:e},t){if(!e)throw new Error("Parameter `index` is required when calling `getStatus`.");const r={};void 0!==e&&(r.index=e.toString());const i={method:"GET",path:"/2/status",queryParameters:r,headers:{}};return n.request(i,t)},getTopCountries({index:e,startDate:t,endDate:r,limit:i,offset:o,tags:s},a){if(!e)throw new Error("Parameter `index` is required when calling `getTopCountries`.");const d={};void 0!==e&&(d.index=e.toString()),void 0!==t&&(d.startDate=t.toString()),void 0!==r&&(d.endDate=r.toString()),void 0!==i&&(d.limit=i.toString()),void 0!==o&&(d.offset=o.toString()),void 0!==s&&(d.tags=s.toString());const c={method:"GET",path:"/2/countries",queryParameters:d,headers:{}};return n.request(c,a)},getTopFilterAttributes({index:e,search:t,startDate:r,endDate:i,limit:o,offset:s,tags:a},d){if(!e)throw new Error("Parameter `index` is required when calling `getTopFilterAttributes`.");const c={};void 0!==e&&(c.index=e.toString()),void 0!==t&&(c.search=t.toString()),void 0!==r&&(c.startDate=r.toString()),void 0!==i&&(c.endDate=i.toString()),void 0!==o&&(c.limit=o.toString()),void 0!==s&&(c.offset=s.toString()),void 0!==a&&(c.tags=a.toString());const u={method:"GET",path:"/2/filters",queryParameters:c,headers:{}};return n.request(u,d)},getTopFilterForAttribute({attribute:e,index:t,search:r,startDate:i,endDate:o,limit:s,offset:a,tags:d},c){if(!e)throw new Error("Parameter `attribute` is required when calling `getTopFilterForAttribute`.");if(!t)throw new Error("Parameter `index` is required when calling `getTopFilterForAttribute`.");const u="/2/filters/{attribute}".replace("{attribute}",encodeURIComponent(e)),l={};void 0!==t&&(l.index=t.toString()),void 0!==r&&(l.search=r.toString()),void 0!==i&&(l.startDate=i.toString()),void 0!==o&&(l.endDate=o.toString()),void 0!==s&&(l.limit=s.toString()),void 0!==a&&(l.offset=a.toString()),void 0!==d&&(l.tags=d.toString());const g={method:"GET",path:u,queryParameters:l,headers:{}};return n.request(g,c)},getTopFiltersNoResults({index:e,search:t,startDate:r,endDate:i,limit:o,offset:s,tags:a},d){if(!e)throw new Error("Parameter `index` is required when calling `getTopFiltersNoResults`.");const c={};void 0!==e&&(c.index=e.toString()),void 0!==t&&(c.search=t.toString()),void 0!==r&&(c.startDate=r.toString()),void 0!==i&&(c.endDate=i.toString()),void 0!==o&&(c.limit=o.toString()),void 0!==s&&(c.offset=s.toString()),void 0!==a&&(c.tags=a.toString());const u={method:"GET",path:"/2/filters/noResults",queryParameters:c,headers:{}};return n.request(u,d)},getTopHits({index:e,search:t,clickAnalytics:r,startDate:i,endDate:o,limit:s,offset:a,tags:d},c){if(!e)throw new Error("Parameter `index` is required when calling `getTopHits`.");const u={};void 0!==e&&(u.index=e.toString()),void 0!==t&&(u.search=t.toString()),void 0!==r&&(u.clickAnalytics=r.toString()),void 0!==i&&(u.startDate=i.toString()),void 0!==o&&(u.endDate=o.toString()),void 0!==s&&(u.limit=s.toString()),void 0!==a&&(u.offset=a.toString()),void 0!==d&&(u.tags=d.toString());const l={method:"GET",path:"/2/hits",queryParameters:u,headers:{}};return n.request(l,c)},getTopSearches({index:e,clickAnalytics:t,startDate:r,endDate:i,orderBy:o,direction:s,limit:a,offset:d,tags:c},u){if(!e)throw new Error("Parameter `index` is required when calling `getTopSearches`.");const l={};void 0!==e&&(l.index=e.toString()),void 0!==t&&(l.clickAnalytics=t.toString()),void 0!==r&&(l.startDate=r.toString()),void 0!==i&&(l.endDate=i.toString()),void 0!==o&&(l.orderBy=o.toString()),void 0!==s&&(l.direction=s.toString()),void 0!==a&&(l.limit=a.toString()),void 0!==d&&(l.offset=d.toString()),void 0!==c&&(l.tags=c.toString());const g={method:"GET",path:"/2/searches",queryParameters:l,headers:{}};return n.request(g,u)},getUsersCount({index:e,startDate:t,endDate:r,tags:i},o){if(!e)throw new Error("Parameter `index` is required when calling `getUsersCount`.");const s={};void 0!==e&&(s.index=e.toString()),void 0!==t&&(s.startDate=t.toString()),void 0!==r&&(s.endDate=r.toString()),void 0!==i&&(s.tags=i.toString());const a={method:"GET",path:"/2/users/count",queryParameters:s,headers:{}};return n.request(a,o)},post({path:e,parameters:t,body:r},i){if(!e)throw new Error("Parameter `path` is required when calling `post`.");const o={method:"POST",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return n.request(o,i)},put({path:e,parameters:t,body:r},i){if(!e)throw new Error("Parameter `path` is required when calling `put`.");const o={method:"PUT",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return n.request(o,i)}}}({appId:e,apiKey:o,region:s,timeouts:{connect:1e3,read:2e3,write:3e4},requester:{send:function(e){return new Promise((t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((t=>r.setRequestHeader(t,e.headers[t])));const i=(e,i)=>setTimeout((()=>{r.abort(),t({status:0,content:i,isTimedOut:!0})}),e),o=i(e.connectTimeout,"Connection timeout");let s;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===s&&(clearTimeout(o),s=i(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(o),clearTimeout(s),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(o),clearTimeout(s),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:i(),requestsCache:i({serializable:!1}),hostsCache:r({caches:[t({key:`${v}-${e}`}),i()]}),...a})},e.apiClientVersion=v}));
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export type AverageClickEvent = {
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Average count of all click events.
|
|
4
4
|
*/
|
|
5
5
|
average: number;
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Number of click events.
|
|
8
8
|
*/
|
|
9
9
|
clickCount: number;
|
|
10
10
|
/**
|
|
11
|
-
* Date of the event.
|
|
11
|
+
* Date of the event in the format YYYY-MM-DD.
|
|
12
12
|
*/
|
|
13
13
|
date: string;
|
|
14
14
|
};
|