@algolia/client-analytics 5.0.0-alpha.9 → 5.0.0-alpha.90
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/builds/browser.d.ts +5 -5
- package/dist/builds/browser.d.ts.map +1 -1
- package/dist/builds/node.d.ts +5 -5
- package/dist/builds/node.d.ts.map +1 -1
- package/dist/{client-analytics.cjs.js → client-analytics.cjs} +922 -924
- package/dist/client-analytics.esm.browser.js +1104 -1154
- package/dist/client-analytics.esm.node.js +922 -922
- package/dist/client-analytics.umd.js +2 -2
- package/dist/model/averageClickEvent.d.ts +14 -14
- package/dist/model/averageClickEvent.d.ts.map +1 -1
- package/dist/model/clickPosition.d.ts +10 -10
- package/dist/model/clickPosition.d.ts.map +1 -1
- package/dist/model/clickThroughRateEvent.d.ts +18 -18
- package/dist/model/clickThroughRateEvent.d.ts.map +1 -1
- package/dist/model/clientMethodProps.d.ts +507 -507
- package/dist/model/clientMethodProps.d.ts.map +1 -1
- package/dist/model/conversionRateEvent.d.ts +18 -18
- package/dist/model/conversionRateEvent.d.ts.map +1 -1
- package/dist/model/direction.d.ts +1 -1
- package/dist/model/direction.d.ts.map +1 -1
- package/dist/model/errorBase.d.ts +6 -6
- package/dist/model/errorBase.d.ts.map +1 -1
- package/dist/model/getAverageClickPositionResponse.d.ts +15 -15
- package/dist/model/getAverageClickPositionResponse.d.ts.map +1 -1
- package/dist/model/getClickPositionsResponse.d.ts +7 -7
- package/dist/model/getClickPositionsResponse.d.ts.map +1 -1
- package/dist/model/getClickThroughRateResponse.d.ts +19 -19
- package/dist/model/getClickThroughRateResponse.d.ts.map +1 -1
- package/dist/model/getConversationRateResponse.d.ts +19 -19
- package/dist/model/getConversationRateResponse.d.ts.map +1 -1
- package/dist/model/getNoClickRateResponse.d.ts +19 -19
- package/dist/model/getNoClickRateResponse.d.ts.map +1 -1
- package/dist/model/getNoResultsRateResponse.d.ts +19 -19
- package/dist/model/getNoResultsRateResponse.d.ts.map +1 -1
- package/dist/model/getSearchesCountResponse.d.ts +11 -11
- package/dist/model/getSearchesCountResponse.d.ts.map +1 -1
- package/dist/model/getSearchesNoClicksResponse.d.ts +7 -7
- package/dist/model/getSearchesNoClicksResponse.d.ts.map +1 -1
- package/dist/model/getSearchesNoResultsResponse.d.ts +7 -7
- package/dist/model/getSearchesNoResultsResponse.d.ts.map +1 -1
- package/dist/model/getStatusResponse.d.ts +6 -6
- package/dist/model/getStatusResponse.d.ts.map +1 -1
- package/dist/model/getTopCountriesResponse.d.ts +7 -7
- package/dist/model/getTopCountriesResponse.d.ts.map +1 -1
- package/dist/model/getTopFilterAttribute.d.ts +10 -10
- package/dist/model/getTopFilterAttribute.d.ts.map +1 -1
- package/dist/model/getTopFilterAttributesResponse.d.ts +7 -7
- package/dist/model/getTopFilterAttributesResponse.d.ts.map +1 -1
- package/dist/model/getTopFilterForAttribute.d.ts +18 -18
- package/dist/model/getTopFilterForAttribute.d.ts.map +1 -1
- package/dist/model/getTopFilterForAttributeResponse.d.ts +7 -7
- package/dist/model/getTopFilterForAttributeResponse.d.ts.map +1 -1
- package/dist/model/getTopFiltersNoResultsResponse.d.ts +7 -7
- package/dist/model/getTopFiltersNoResultsResponse.d.ts.map +1 -1
- package/dist/model/getTopFiltersNoResultsValue.d.ts +14 -14
- package/dist/model/getTopFiltersNoResultsValue.d.ts.map +1 -1
- package/dist/model/getTopFiltersNoResultsValues.d.ts +11 -11
- package/dist/model/getTopFiltersNoResultsValues.d.ts.map +1 -1
- package/dist/model/getTopHitsResponse.d.ts +3 -3
- package/dist/model/getTopHitsResponse.d.ts.map +1 -1
- package/dist/model/getTopSearchesResponse.d.ts +3 -3
- package/dist/model/getTopSearchesResponse.d.ts.map +1 -1
- package/dist/model/getUsersCountResponse.d.ts +11 -11
- package/dist/model/getUsersCountResponse.d.ts.map +1 -1
- package/dist/model/index.d.ts +44 -44
- package/dist/model/noClickRateEvent.d.ts +18 -18
- package/dist/model/noClickRateEvent.d.ts.map +1 -1
- package/dist/model/noResultsRateEvent.d.ts +18 -18
- package/dist/model/noResultsRateEvent.d.ts.map +1 -1
- package/dist/model/orderBy.d.ts +4 -1
- package/dist/model/orderBy.d.ts.map +1 -1
- package/dist/model/searchEvent.d.ts +10 -10
- package/dist/model/searchEvent.d.ts.map +1 -1
- package/dist/model/searchNoClickEvent.d.ts +14 -14
- package/dist/model/searchNoClickEvent.d.ts.map +1 -1
- package/dist/model/searchNoResultEvent.d.ts +14 -14
- package/dist/model/searchNoResultEvent.d.ts.map +1 -1
- package/dist/model/topCountry.d.ts +10 -10
- package/dist/model/topCountry.d.ts.map +1 -1
- package/dist/model/topHit.d.ts +10 -10
- package/dist/model/topHit.d.ts.map +1 -1
- package/dist/model/topHitWithAnalytics.d.ts +30 -30
- package/dist/model/topHitWithAnalytics.d.ts.map +1 -1
- package/dist/model/topHitsResponse.d.ts +7 -7
- package/dist/model/topHitsResponse.d.ts.map +1 -1
- package/dist/model/topHitsResponseWithAnalytics.d.ts +7 -7
- package/dist/model/topHitsResponseWithAnalytics.d.ts.map +1 -1
- package/dist/model/topSearch.d.ts +14 -14
- package/dist/model/topSearch.d.ts.map +1 -1
- package/dist/model/topSearchWithAnalytics.d.ts +38 -38
- package/dist/model/topSearchWithAnalytics.d.ts.map +1 -1
- package/dist/model/topSearchesResponse.d.ts +7 -7
- package/dist/model/topSearchesResponse.d.ts.map +1 -1
- package/dist/model/topSearchesResponseWithAnalytics.d.ts +7 -7
- package/dist/model/topSearchesResponseWithAnalytics.d.ts.map +1 -1
- package/dist/model/userWithDate.d.ts +10 -10
- package/dist/model/userWithDate.d.ts.map +1 -1
- package/dist/src/analyticsClient.d.ts +318 -318
- package/dist/src/analyticsClient.d.ts.map +1 -1
- package/index.js +1 -1
- package/model/averageClickEvent.ts +4 -4
- package/model/clickPosition.ts +3 -3
- package/model/clickThroughRateEvent.ts +5 -5
- package/model/clientMethodProps.ts +92 -92
- package/model/conversionRateEvent.ts +5 -5
- package/model/direction.ts +1 -1
- package/model/errorBase.ts +1 -1
- package/model/getAverageClickPositionResponse.ts +4 -4
- package/model/getClickPositionsResponse.ts +2 -2
- package/model/getClickThroughRateResponse.ts +5 -5
- package/model/getConversationRateResponse.ts +5 -5
- package/model/getNoClickRateResponse.ts +5 -5
- package/model/getNoResultsRateResponse.ts +5 -5
- package/model/getSearchesCountResponse.ts +3 -3
- package/model/getSearchesNoClicksResponse.ts +2 -2
- package/model/getSearchesNoResultsResponse.ts +2 -2
- package/model/getStatusResponse.ts +2 -2
- package/model/getTopCountriesResponse.ts +2 -2
- package/model/getTopFilterAttribute.ts +3 -3
- package/model/getTopFilterAttributesResponse.ts +2 -2
- package/model/getTopFilterForAttribute.ts +5 -5
- package/model/getTopFilterForAttributeResponse.ts +2 -2
- package/model/getTopFiltersNoResultsResponse.ts +2 -2
- package/model/getTopFiltersNoResultsValue.ts +4 -4
- package/model/getTopFiltersNoResultsValues.ts +3 -3
- package/model/getTopHitsResponse.ts +1 -1
- package/model/getTopSearchesResponse.ts +1 -1
- package/model/getUsersCountResponse.ts +3 -3
- package/model/index.ts +1 -1
- package/model/noClickRateEvent.ts +5 -5
- package/model/noResultsRateEvent.ts +5 -5
- package/model/orderBy.ts +4 -1
- package/model/searchEvent.ts +3 -3
- package/model/searchNoClickEvent.ts +4 -4
- package/model/searchNoResultEvent.ts +4 -4
- package/model/topCountry.ts +3 -3
- package/model/topHit.ts +3 -3
- package/model/topHitWithAnalytics.ts +8 -8
- package/model/topHitsResponse.ts +2 -2
- package/model/topHitsResponseWithAnalytics.ts +2 -2
- package/model/topSearch.ts +4 -4
- package/model/topSearchWithAnalytics.ts +10 -10
- package/model/topSearchesResponse.ts +2 -2
- package/model/topSearchesResponseWithAnalytics.ts +2 -2
- package/model/userWithDate.ts +3 -3
- package/package.json +30 -13
|
@@ -1,934 +1,932 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var clientCommon = require('@algolia/client-common');
|
|
6
4
|
var requesterNodeHttp = require('@algolia/requester-node-http');
|
|
7
5
|
|
|
8
|
-
//
|
|
9
|
-
const apiClientVersion = '5.0.0-alpha.
|
|
10
|
-
const REGIONS = ['de', 'us'];
|
|
11
|
-
function getDefaultHosts(region) {
|
|
12
|
-
const url = !region
|
|
13
|
-
? 'analytics.algolia.com'
|
|
14
|
-
: 'analytics.{region}.algolia.com'.replace('{region}', region);
|
|
15
|
-
return [{ url, accept: 'readWrite', protocol: 'https' }];
|
|
16
|
-
}
|
|
17
|
-
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
18
|
-
function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }) {
|
|
19
|
-
const auth = clientCommon.createAuth(appIdOption, apiKeyOption, authMode);
|
|
20
|
-
const transporter = clientCommon.createTransporter({
|
|
21
|
-
hosts: getDefaultHosts(regionOption),
|
|
22
|
-
...options,
|
|
23
|
-
algoliaAgent: clientCommon.getAlgoliaAgent({
|
|
24
|
-
algoliaAgents,
|
|
25
|
-
client: 'Analytics',
|
|
26
|
-
version: apiClientVersion,
|
|
27
|
-
}),
|
|
28
|
-
baseHeaders: {
|
|
29
|
-
'content-type': 'text/plain',
|
|
30
|
-
...auth.headers(),
|
|
31
|
-
...options.baseHeaders,
|
|
32
|
-
},
|
|
33
|
-
baseQueryParameters: {
|
|
34
|
-
...auth.queryParameters(),
|
|
35
|
-
...options.baseQueryParameters,
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
return {
|
|
39
|
-
transporter,
|
|
40
|
-
/**
|
|
41
|
-
* The `appId` currently in use.
|
|
42
|
-
*/
|
|
43
|
-
appId: appIdOption,
|
|
44
|
-
/**
|
|
45
|
-
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
46
|
-
*/
|
|
47
|
-
clearCache() {
|
|
48
|
-
return Promise.all([
|
|
49
|
-
transporter.requestsCache.clear(),
|
|
50
|
-
transporter.responsesCache.clear(),
|
|
51
|
-
]).then(() => undefined);
|
|
52
|
-
},
|
|
53
|
-
/**
|
|
54
|
-
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
55
|
-
*/
|
|
56
|
-
get _ua() {
|
|
57
|
-
return transporter.algoliaAgent.value;
|
|
58
|
-
},
|
|
59
|
-
/**
|
|
60
|
-
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
|
61
|
-
*
|
|
62
|
-
* @param segment - The algolia agent (user-agent) segment to add.
|
|
63
|
-
* @param version - The version of the agent.
|
|
64
|
-
*/
|
|
65
|
-
addAlgoliaAgent(segment, version) {
|
|
66
|
-
transporter.algoliaAgent.add({ segment, version });
|
|
67
|
-
},
|
|
68
|
-
/**
|
|
69
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
70
|
-
*
|
|
71
|
-
* @summary Send requests to the Algolia REST API.
|
|
72
|
-
* @param del - The del object.
|
|
73
|
-
* @param del.path -
|
|
74
|
-
* @param del.parameters - Query parameters to
|
|
75
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
76
|
-
*/
|
|
77
|
-
del({ path, parameters }, requestOptions) {
|
|
78
|
-
if (!path) {
|
|
79
|
-
throw new Error('Parameter `path` is required when calling `del`.');
|
|
80
|
-
}
|
|
81
|
-
const requestPath = '/1{path}'.replace('{path}', path);
|
|
82
|
-
const headers = {};
|
|
83
|
-
const queryParameters = parameters ? parameters : {};
|
|
84
|
-
const request = {
|
|
85
|
-
method: 'DELETE',
|
|
86
|
-
path: requestPath,
|
|
87
|
-
queryParameters,
|
|
88
|
-
headers,
|
|
89
|
-
};
|
|
90
|
-
return transporter.request(request, requestOptions);
|
|
91
|
-
},
|
|
92
|
-
/**
|
|
93
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
94
|
-
*
|
|
95
|
-
* @summary Send requests to the Algolia REST API.
|
|
96
|
-
* @param get - The get object.
|
|
97
|
-
* @param get.path -
|
|
98
|
-
* @param get.parameters - Query parameters to
|
|
99
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
100
|
-
*/
|
|
101
|
-
get({ path, parameters }, requestOptions) {
|
|
102
|
-
if (!path) {
|
|
103
|
-
throw new Error('Parameter `path` is required when calling `get`.');
|
|
104
|
-
}
|
|
105
|
-
const requestPath = '/1{path}'.replace('{path}', path);
|
|
106
|
-
const headers = {};
|
|
107
|
-
const queryParameters = parameters ? parameters : {};
|
|
108
|
-
const request = {
|
|
109
|
-
method: 'GET',
|
|
110
|
-
path: requestPath,
|
|
111
|
-
queryParameters,
|
|
112
|
-
headers,
|
|
113
|
-
};
|
|
114
|
-
return transporter.request(request, requestOptions);
|
|
115
|
-
},
|
|
116
|
-
/**
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
* @summary Get average click position.
|
|
120
|
-
* @param getAverageClickPosition - The getAverageClickPosition object.
|
|
121
|
-
* @param getAverageClickPosition.index -
|
|
122
|
-
* @param getAverageClickPosition.startDate -
|
|
123
|
-
* @param getAverageClickPosition.endDate -
|
|
124
|
-
* @param getAverageClickPosition.tags - Filter
|
|
125
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
126
|
-
*/
|
|
127
|
-
getAverageClickPosition({ index, startDate, endDate, tags }, requestOptions) {
|
|
128
|
-
if (!index) {
|
|
129
|
-
throw new Error('Parameter `index` is required when calling `getAverageClickPosition`.');
|
|
130
|
-
}
|
|
131
|
-
const requestPath = '/2/clicks/averageClickPosition';
|
|
132
|
-
const headers = {};
|
|
133
|
-
const queryParameters = {};
|
|
134
|
-
if (index !== undefined) {
|
|
135
|
-
queryParameters.index = index.toString();
|
|
136
|
-
}
|
|
137
|
-
if (startDate !== undefined) {
|
|
138
|
-
queryParameters.startDate = startDate.toString();
|
|
139
|
-
}
|
|
140
|
-
if (endDate !== undefined) {
|
|
141
|
-
queryParameters.endDate = endDate.toString();
|
|
142
|
-
}
|
|
143
|
-
if (tags !== undefined) {
|
|
144
|
-
queryParameters.tags = tags.toString();
|
|
145
|
-
}
|
|
146
|
-
const request = {
|
|
147
|
-
method: 'GET',
|
|
148
|
-
path: requestPath,
|
|
149
|
-
queryParameters,
|
|
150
|
-
headers,
|
|
151
|
-
};
|
|
152
|
-
return transporter.request(request, requestOptions);
|
|
153
|
-
},
|
|
154
|
-
/**
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
* @summary Get
|
|
158
|
-
* @param getClickPositions - The getClickPositions object.
|
|
159
|
-
* @param getClickPositions.index -
|
|
160
|
-
* @param getClickPositions.startDate -
|
|
161
|
-
* @param getClickPositions.endDate -
|
|
162
|
-
* @param getClickPositions.tags - Filter
|
|
163
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
164
|
-
*/
|
|
165
|
-
getClickPositions({ index, startDate, endDate, tags }, requestOptions) {
|
|
166
|
-
if (!index) {
|
|
167
|
-
throw new Error('Parameter `index` is required when calling `getClickPositions`.');
|
|
168
|
-
}
|
|
169
|
-
const requestPath = '/2/clicks/positions';
|
|
170
|
-
const headers = {};
|
|
171
|
-
const queryParameters = {};
|
|
172
|
-
if (index !== undefined) {
|
|
173
|
-
queryParameters.index = index.toString();
|
|
174
|
-
}
|
|
175
|
-
if (startDate !== undefined) {
|
|
176
|
-
queryParameters.startDate = startDate.toString();
|
|
177
|
-
}
|
|
178
|
-
if (endDate !== undefined) {
|
|
179
|
-
queryParameters.endDate = endDate.toString();
|
|
180
|
-
}
|
|
181
|
-
if (tags !== undefined) {
|
|
182
|
-
queryParameters.tags = tags.toString();
|
|
183
|
-
}
|
|
184
|
-
const request = {
|
|
185
|
-
method: 'GET',
|
|
186
|
-
path: requestPath,
|
|
187
|
-
queryParameters,
|
|
188
|
-
headers,
|
|
189
|
-
};
|
|
190
|
-
return transporter.request(request, requestOptions);
|
|
191
|
-
},
|
|
192
|
-
/**
|
|
193
|
-
* Returns a click-through rate (CTR).
|
|
194
|
-
*
|
|
195
|
-
* @summary Get click-through rate (CTR).
|
|
196
|
-
* @param getClickThroughRate - The getClickThroughRate object.
|
|
197
|
-
* @param getClickThroughRate.index -
|
|
198
|
-
* @param getClickThroughRate.startDate -
|
|
199
|
-
* @param getClickThroughRate.endDate -
|
|
200
|
-
* @param getClickThroughRate.tags - Filter
|
|
201
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
202
|
-
*/
|
|
203
|
-
getClickThroughRate({ index, startDate, endDate, tags }, requestOptions) {
|
|
204
|
-
if (!index) {
|
|
205
|
-
throw new Error('Parameter `index` is required when calling `getClickThroughRate`.');
|
|
206
|
-
}
|
|
207
|
-
const requestPath = '/2/clicks/clickThroughRate';
|
|
208
|
-
const headers = {};
|
|
209
|
-
const queryParameters = {};
|
|
210
|
-
if (index !== undefined) {
|
|
211
|
-
queryParameters.index = index.toString();
|
|
212
|
-
}
|
|
213
|
-
if (startDate !== undefined) {
|
|
214
|
-
queryParameters.startDate = startDate.toString();
|
|
215
|
-
}
|
|
216
|
-
if (endDate !== undefined) {
|
|
217
|
-
queryParameters.endDate = endDate.toString();
|
|
218
|
-
}
|
|
219
|
-
if (tags !== undefined) {
|
|
220
|
-
queryParameters.tags = tags.toString();
|
|
221
|
-
}
|
|
222
|
-
const request = {
|
|
223
|
-
method: 'GET',
|
|
224
|
-
path: requestPath,
|
|
225
|
-
queryParameters,
|
|
226
|
-
headers,
|
|
227
|
-
};
|
|
228
|
-
return transporter.request(request, requestOptions);
|
|
229
|
-
},
|
|
230
|
-
/**
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
* @summary Get conversion rate (CR).
|
|
234
|
-
* @param getConversationRate - The getConversationRate object.
|
|
235
|
-
* @param getConversationRate.index -
|
|
236
|
-
* @param getConversationRate.startDate -
|
|
237
|
-
* @param getConversationRate.endDate -
|
|
238
|
-
* @param getConversationRate.tags - Filter
|
|
239
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
240
|
-
*/
|
|
241
|
-
getConversationRate({ index, startDate, endDate, tags }, requestOptions) {
|
|
242
|
-
if (!index) {
|
|
243
|
-
throw new Error('Parameter `index` is required when calling `getConversationRate`.');
|
|
244
|
-
}
|
|
245
|
-
const requestPath = '/2/conversions/conversionRate';
|
|
246
|
-
const headers = {};
|
|
247
|
-
const queryParameters = {};
|
|
248
|
-
if (index !== undefined) {
|
|
249
|
-
queryParameters.index = index.toString();
|
|
250
|
-
}
|
|
251
|
-
if (startDate !== undefined) {
|
|
252
|
-
queryParameters.startDate = startDate.toString();
|
|
253
|
-
}
|
|
254
|
-
if (endDate !== undefined) {
|
|
255
|
-
queryParameters.endDate = endDate.toString();
|
|
256
|
-
}
|
|
257
|
-
if (tags !== undefined) {
|
|
258
|
-
queryParameters.tags = tags.toString();
|
|
259
|
-
}
|
|
260
|
-
const request = {
|
|
261
|
-
method: 'GET',
|
|
262
|
-
path: requestPath,
|
|
263
|
-
queryParameters,
|
|
264
|
-
headers,
|
|
265
|
-
};
|
|
266
|
-
return transporter.request(request, requestOptions);
|
|
267
|
-
},
|
|
268
|
-
/**
|
|
269
|
-
* Returns the rate at which searches
|
|
270
|
-
*
|
|
271
|
-
* @summary Get no click rate.
|
|
272
|
-
* @param getNoClickRate - The getNoClickRate object.
|
|
273
|
-
* @param getNoClickRate.index -
|
|
274
|
-
* @param getNoClickRate.startDate -
|
|
275
|
-
* @param getNoClickRate.endDate -
|
|
276
|
-
* @param getNoClickRate.tags - Filter
|
|
277
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
278
|
-
*/
|
|
279
|
-
getNoClickRate({ index, startDate, endDate, tags }, requestOptions) {
|
|
280
|
-
if (!index) {
|
|
281
|
-
throw new Error('Parameter `index` is required when calling `getNoClickRate`.');
|
|
282
|
-
}
|
|
283
|
-
const requestPath = '/2/searches/noClickRate';
|
|
284
|
-
const headers = {};
|
|
285
|
-
const queryParameters = {};
|
|
286
|
-
if (index !== undefined) {
|
|
287
|
-
queryParameters.index = index.toString();
|
|
288
|
-
}
|
|
289
|
-
if (startDate !== undefined) {
|
|
290
|
-
queryParameters.startDate = startDate.toString();
|
|
291
|
-
}
|
|
292
|
-
if (endDate !== undefined) {
|
|
293
|
-
queryParameters.endDate = endDate.toString();
|
|
294
|
-
}
|
|
295
|
-
if (tags !== undefined) {
|
|
296
|
-
queryParameters.tags = tags.toString();
|
|
297
|
-
}
|
|
298
|
-
const request = {
|
|
299
|
-
method: 'GET',
|
|
300
|
-
path: requestPath,
|
|
301
|
-
queryParameters,
|
|
302
|
-
headers,
|
|
303
|
-
};
|
|
304
|
-
return transporter.request(request, requestOptions);
|
|
305
|
-
},
|
|
306
|
-
/**
|
|
307
|
-
* Returns the rate at which searches didn\'t return any results.
|
|
308
|
-
*
|
|
309
|
-
* @summary Get no results rate.
|
|
310
|
-
* @param getNoResultsRate - The getNoResultsRate object.
|
|
311
|
-
* @param getNoResultsRate.index -
|
|
312
|
-
* @param getNoResultsRate.startDate -
|
|
313
|
-
* @param getNoResultsRate.endDate -
|
|
314
|
-
* @param getNoResultsRate.tags - Filter
|
|
315
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
316
|
-
*/
|
|
317
|
-
getNoResultsRate({ index, startDate, endDate, tags }, requestOptions) {
|
|
318
|
-
if (!index) {
|
|
319
|
-
throw new Error('Parameter `index` is required when calling `getNoResultsRate`.');
|
|
320
|
-
}
|
|
321
|
-
const requestPath = '/2/searches/noResultRate';
|
|
322
|
-
const headers = {};
|
|
323
|
-
const queryParameters = {};
|
|
324
|
-
if (index !== undefined) {
|
|
325
|
-
queryParameters.index = index.toString();
|
|
326
|
-
}
|
|
327
|
-
if (startDate !== undefined) {
|
|
328
|
-
queryParameters.startDate = startDate.toString();
|
|
329
|
-
}
|
|
330
|
-
if (endDate !== undefined) {
|
|
331
|
-
queryParameters.endDate = endDate.toString();
|
|
332
|
-
}
|
|
333
|
-
if (tags !== undefined) {
|
|
334
|
-
queryParameters.tags = tags.toString();
|
|
335
|
-
}
|
|
336
|
-
const request = {
|
|
337
|
-
method: 'GET',
|
|
338
|
-
path: requestPath,
|
|
339
|
-
queryParameters,
|
|
340
|
-
headers,
|
|
341
|
-
};
|
|
342
|
-
return transporter.request(request, requestOptions);
|
|
343
|
-
},
|
|
344
|
-
/**
|
|
345
|
-
* Returns the number of searches
|
|
346
|
-
*
|
|
347
|
-
* @summary Get searches
|
|
348
|
-
* @param getSearchesCount - The getSearchesCount object.
|
|
349
|
-
* @param getSearchesCount.index -
|
|
350
|
-
* @param getSearchesCount.startDate -
|
|
351
|
-
* @param getSearchesCount.endDate -
|
|
352
|
-
* @param getSearchesCount.tags - Filter
|
|
353
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
354
|
-
*/
|
|
355
|
-
getSearchesCount({ index, startDate, endDate, tags }, requestOptions) {
|
|
356
|
-
if (!index) {
|
|
357
|
-
throw new Error('Parameter `index` is required when calling `getSearchesCount`.');
|
|
358
|
-
}
|
|
359
|
-
const requestPath = '/2/searches/count';
|
|
360
|
-
const headers = {};
|
|
361
|
-
const queryParameters = {};
|
|
362
|
-
if (index !== undefined) {
|
|
363
|
-
queryParameters.index = index.toString();
|
|
364
|
-
}
|
|
365
|
-
if (startDate !== undefined) {
|
|
366
|
-
queryParameters.startDate = startDate.toString();
|
|
367
|
-
}
|
|
368
|
-
if (endDate !== undefined) {
|
|
369
|
-
queryParameters.endDate = endDate.toString();
|
|
370
|
-
}
|
|
371
|
-
if (tags !== undefined) {
|
|
372
|
-
queryParameters.tags = tags.toString();
|
|
373
|
-
}
|
|
374
|
-
const request = {
|
|
375
|
-
method: 'GET',
|
|
376
|
-
path: requestPath,
|
|
377
|
-
queryParameters,
|
|
378
|
-
headers,
|
|
379
|
-
};
|
|
380
|
-
return transporter.request(request, requestOptions);
|
|
381
|
-
},
|
|
382
|
-
/**
|
|
383
|
-
*
|
|
384
|
-
*
|
|
385
|
-
* @summary Get top searches with no clicks.
|
|
386
|
-
* @param getSearchesNoClicks - The getSearchesNoClicks object.
|
|
387
|
-
* @param getSearchesNoClicks.index -
|
|
388
|
-
* @param getSearchesNoClicks.startDate -
|
|
389
|
-
* @param getSearchesNoClicks.endDate -
|
|
390
|
-
* @param getSearchesNoClicks.limit - Number of records to return
|
|
391
|
-
* @param getSearchesNoClicks.offset - Position of the starting record. Used for paging. 0 is the first record.
|
|
392
|
-
* @param getSearchesNoClicks.tags - Filter
|
|
393
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
394
|
-
*/
|
|
395
|
-
getSearchesNoClicks({ index, startDate, endDate, limit, offset, tags, }, requestOptions) {
|
|
396
|
-
if (!index) {
|
|
397
|
-
throw new Error('Parameter `index` is required when calling `getSearchesNoClicks`.');
|
|
398
|
-
}
|
|
399
|
-
const requestPath = '/2/searches/noClicks';
|
|
400
|
-
const headers = {};
|
|
401
|
-
const queryParameters = {};
|
|
402
|
-
if (index !== undefined) {
|
|
403
|
-
queryParameters.index = index.toString();
|
|
404
|
-
}
|
|
405
|
-
if (startDate !== undefined) {
|
|
406
|
-
queryParameters.startDate = startDate.toString();
|
|
407
|
-
}
|
|
408
|
-
if (endDate !== undefined) {
|
|
409
|
-
queryParameters.endDate = endDate.toString();
|
|
410
|
-
}
|
|
411
|
-
if (limit !== undefined) {
|
|
412
|
-
queryParameters.limit = limit.toString();
|
|
413
|
-
}
|
|
414
|
-
if (offset !== undefined) {
|
|
415
|
-
queryParameters.offset = offset.toString();
|
|
416
|
-
}
|
|
417
|
-
if (tags !== undefined) {
|
|
418
|
-
queryParameters.tags = tags.toString();
|
|
419
|
-
}
|
|
420
|
-
const request = {
|
|
421
|
-
method: 'GET',
|
|
422
|
-
path: requestPath,
|
|
423
|
-
queryParameters,
|
|
424
|
-
headers,
|
|
425
|
-
};
|
|
426
|
-
return transporter.request(request, requestOptions);
|
|
427
|
-
},
|
|
428
|
-
/**
|
|
429
|
-
* Returns
|
|
430
|
-
*
|
|
431
|
-
* @summary Get top searches with no results.
|
|
432
|
-
* @param getSearchesNoResults - The getSearchesNoResults object.
|
|
433
|
-
* @param getSearchesNoResults.index -
|
|
434
|
-
* @param getSearchesNoResults.startDate -
|
|
435
|
-
* @param getSearchesNoResults.endDate -
|
|
436
|
-
* @param getSearchesNoResults.limit - Number of records to return
|
|
437
|
-
* @param getSearchesNoResults.offset - Position of the starting record. Used for paging. 0 is the first record.
|
|
438
|
-
* @param getSearchesNoResults.tags - Filter
|
|
439
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
440
|
-
*/
|
|
441
|
-
getSearchesNoResults({ index, startDate, endDate, limit, offset, tags, }, requestOptions) {
|
|
442
|
-
if (!index) {
|
|
443
|
-
throw new Error('Parameter `index` is required when calling `getSearchesNoResults`.');
|
|
444
|
-
}
|
|
445
|
-
const requestPath = '/2/searches/noResults';
|
|
446
|
-
const headers = {};
|
|
447
|
-
const queryParameters = {};
|
|
448
|
-
if (index !== undefined) {
|
|
449
|
-
queryParameters.index = index.toString();
|
|
450
|
-
}
|
|
451
|
-
if (startDate !== undefined) {
|
|
452
|
-
queryParameters.startDate = startDate.toString();
|
|
453
|
-
}
|
|
454
|
-
if (endDate !== undefined) {
|
|
455
|
-
queryParameters.endDate = endDate.toString();
|
|
456
|
-
}
|
|
457
|
-
if (limit !== undefined) {
|
|
458
|
-
queryParameters.limit = limit.toString();
|
|
459
|
-
}
|
|
460
|
-
if (offset !== undefined) {
|
|
461
|
-
queryParameters.offset = offset.toString();
|
|
462
|
-
}
|
|
463
|
-
if (tags !== undefined) {
|
|
464
|
-
queryParameters.tags = tags.toString();
|
|
465
|
-
}
|
|
466
|
-
const request = {
|
|
467
|
-
method: 'GET',
|
|
468
|
-
path: requestPath,
|
|
469
|
-
queryParameters,
|
|
470
|
-
headers,
|
|
471
|
-
};
|
|
472
|
-
return transporter.request(request, requestOptions);
|
|
473
|
-
},
|
|
474
|
-
/**
|
|
475
|
-
*
|
|
476
|
-
*
|
|
477
|
-
* @summary Get Analytics API status.
|
|
478
|
-
* @param getStatus - The getStatus object.
|
|
479
|
-
* @param getStatus.index -
|
|
480
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
481
|
-
*/
|
|
482
|
-
getStatus({ index }, requestOptions) {
|
|
483
|
-
if (!index) {
|
|
484
|
-
throw new Error('Parameter `index` is required when calling `getStatus`.');
|
|
485
|
-
}
|
|
486
|
-
const requestPath = '/2/status';
|
|
487
|
-
const headers = {};
|
|
488
|
-
const queryParameters = {};
|
|
489
|
-
if (index !== undefined) {
|
|
490
|
-
queryParameters.index = index.toString();
|
|
491
|
-
}
|
|
492
|
-
const request = {
|
|
493
|
-
method: 'GET',
|
|
494
|
-
path: requestPath,
|
|
495
|
-
queryParameters,
|
|
496
|
-
headers,
|
|
497
|
-
};
|
|
498
|
-
return transporter.request(request, requestOptions);
|
|
499
|
-
},
|
|
500
|
-
/**
|
|
501
|
-
* Returns top countries. Limited to the
|
|
502
|
-
*
|
|
503
|
-
* @summary Get top countries.
|
|
504
|
-
* @param getTopCountries - The getTopCountries object.
|
|
505
|
-
* @param getTopCountries.index -
|
|
506
|
-
* @param getTopCountries.startDate -
|
|
507
|
-
* @param getTopCountries.endDate -
|
|
508
|
-
* @param getTopCountries.limit - Number of records to return
|
|
509
|
-
* @param getTopCountries.offset - Position of the starting record. Used for paging. 0 is the first record.
|
|
510
|
-
* @param getTopCountries.tags - Filter
|
|
511
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
512
|
-
*/
|
|
513
|
-
getTopCountries({ index, startDate, endDate, limit, offset, tags }, requestOptions) {
|
|
514
|
-
if (!index) {
|
|
515
|
-
throw new Error('Parameter `index` is required when calling `getTopCountries`.');
|
|
516
|
-
}
|
|
517
|
-
const requestPath = '/2/countries';
|
|
518
|
-
const headers = {};
|
|
519
|
-
const queryParameters = {};
|
|
520
|
-
if (index !== undefined) {
|
|
521
|
-
queryParameters.index = index.toString();
|
|
522
|
-
}
|
|
523
|
-
if (startDate !== undefined) {
|
|
524
|
-
queryParameters.startDate = startDate.toString();
|
|
525
|
-
}
|
|
526
|
-
if (endDate !== undefined) {
|
|
527
|
-
queryParameters.endDate = endDate.toString();
|
|
528
|
-
}
|
|
529
|
-
if (limit !== undefined) {
|
|
530
|
-
queryParameters.limit = limit.toString();
|
|
531
|
-
}
|
|
532
|
-
if (offset !== undefined) {
|
|
533
|
-
queryParameters.offset = offset.toString();
|
|
534
|
-
}
|
|
535
|
-
if (tags !== undefined) {
|
|
536
|
-
queryParameters.tags = tags.toString();
|
|
537
|
-
}
|
|
538
|
-
const request = {
|
|
539
|
-
method: 'GET',
|
|
540
|
-
path: requestPath,
|
|
541
|
-
queryParameters,
|
|
542
|
-
headers,
|
|
543
|
-
};
|
|
544
|
-
return transporter.request(request, requestOptions);
|
|
545
|
-
},
|
|
546
|
-
/**
|
|
547
|
-
*
|
|
548
|
-
*
|
|
549
|
-
* @summary Get top
|
|
550
|
-
* @param getTopFilterAttributes - The getTopFilterAttributes object.
|
|
551
|
-
* @param getTopFilterAttributes.index -
|
|
552
|
-
* @param getTopFilterAttributes.search -
|
|
553
|
-
* @param getTopFilterAttributes.startDate -
|
|
554
|
-
* @param getTopFilterAttributes.endDate -
|
|
555
|
-
* @param getTopFilterAttributes.limit - Number of records to return
|
|
556
|
-
* @param getTopFilterAttributes.offset - Position of the starting record. Used for paging. 0 is the first record.
|
|
557
|
-
* @param getTopFilterAttributes.tags - Filter
|
|
558
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
559
|
-
*/
|
|
560
|
-
getTopFilterAttributes({ index, search, startDate, endDate, limit, offset, tags, }, requestOptions) {
|
|
561
|
-
if (!index) {
|
|
562
|
-
throw new Error('Parameter `index` is required when calling `getTopFilterAttributes`.');
|
|
563
|
-
}
|
|
564
|
-
const requestPath = '/2/filters';
|
|
565
|
-
const headers = {};
|
|
566
|
-
const queryParameters = {};
|
|
567
|
-
if (index !== undefined) {
|
|
568
|
-
queryParameters.index = index.toString();
|
|
569
|
-
}
|
|
570
|
-
if (search !== undefined) {
|
|
571
|
-
queryParameters.search = search.toString();
|
|
572
|
-
}
|
|
573
|
-
if (startDate !== undefined) {
|
|
574
|
-
queryParameters.startDate = startDate.toString();
|
|
575
|
-
}
|
|
576
|
-
if (endDate !== undefined) {
|
|
577
|
-
queryParameters.endDate = endDate.toString();
|
|
578
|
-
}
|
|
579
|
-
if (limit !== undefined) {
|
|
580
|
-
queryParameters.limit = limit.toString();
|
|
581
|
-
}
|
|
582
|
-
if (offset !== undefined) {
|
|
583
|
-
queryParameters.offset = offset.toString();
|
|
584
|
-
}
|
|
585
|
-
if (tags !== undefined) {
|
|
586
|
-
queryParameters.tags = tags.toString();
|
|
587
|
-
}
|
|
588
|
-
const request = {
|
|
589
|
-
method: 'GET',
|
|
590
|
-
path: requestPath,
|
|
591
|
-
queryParameters,
|
|
592
|
-
headers,
|
|
593
|
-
};
|
|
594
|
-
return transporter.request(request, requestOptions);
|
|
595
|
-
},
|
|
596
|
-
/**
|
|
597
|
-
* Returns
|
|
598
|
-
*
|
|
599
|
-
* @summary Get top
|
|
600
|
-
* @param getTopFilterForAttribute - The getTopFilterForAttribute object.
|
|
601
|
-
* @param getTopFilterForAttribute.attribute -
|
|
602
|
-
* @param getTopFilterForAttribute.index -
|
|
603
|
-
* @param getTopFilterForAttribute.search -
|
|
604
|
-
* @param getTopFilterForAttribute.startDate -
|
|
605
|
-
* @param getTopFilterForAttribute.endDate -
|
|
606
|
-
* @param getTopFilterForAttribute.limit - Number of records to return
|
|
607
|
-
* @param getTopFilterForAttribute.offset - Position of the starting record. Used for paging. 0 is the first record.
|
|
608
|
-
* @param getTopFilterForAttribute.tags - Filter
|
|
609
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
610
|
-
*/
|
|
611
|
-
getTopFilterForAttribute({ attribute, index, search, startDate, endDate, limit, offset, tags, }, requestOptions) {
|
|
612
|
-
if (!attribute) {
|
|
613
|
-
throw new Error('Parameter `attribute` is required when calling `getTopFilterForAttribute`.');
|
|
614
|
-
}
|
|
615
|
-
if (!index) {
|
|
616
|
-
throw new Error('Parameter `index` is required when calling `getTopFilterForAttribute`.');
|
|
617
|
-
}
|
|
618
|
-
const requestPath = '/2/filters/{attribute}'.replace('{attribute}', encodeURIComponent(attribute));
|
|
619
|
-
const headers = {};
|
|
620
|
-
const queryParameters = {};
|
|
621
|
-
if (index !== undefined) {
|
|
622
|
-
queryParameters.index = index.toString();
|
|
623
|
-
}
|
|
624
|
-
if (search !== undefined) {
|
|
625
|
-
queryParameters.search = search.toString();
|
|
626
|
-
}
|
|
627
|
-
if (startDate !== undefined) {
|
|
628
|
-
queryParameters.startDate = startDate.toString();
|
|
629
|
-
}
|
|
630
|
-
if (endDate !== undefined) {
|
|
631
|
-
queryParameters.endDate = endDate.toString();
|
|
632
|
-
}
|
|
633
|
-
if (limit !== undefined) {
|
|
634
|
-
queryParameters.limit = limit.toString();
|
|
635
|
-
}
|
|
636
|
-
if (offset !== undefined) {
|
|
637
|
-
queryParameters.offset = offset.toString();
|
|
638
|
-
}
|
|
639
|
-
if (tags !== undefined) {
|
|
640
|
-
queryParameters.tags = tags.toString();
|
|
641
|
-
}
|
|
642
|
-
const request = {
|
|
643
|
-
method: 'GET',
|
|
644
|
-
path: requestPath,
|
|
645
|
-
queryParameters,
|
|
646
|
-
headers,
|
|
647
|
-
};
|
|
648
|
-
return transporter.request(request, requestOptions);
|
|
649
|
-
},
|
|
650
|
-
/**
|
|
651
|
-
* Returns top filters
|
|
652
|
-
*
|
|
653
|
-
* @summary Get top filters for a no result search.
|
|
654
|
-
* @param getTopFiltersNoResults - The getTopFiltersNoResults object.
|
|
655
|
-
* @param getTopFiltersNoResults.index -
|
|
656
|
-
* @param getTopFiltersNoResults.search -
|
|
657
|
-
* @param getTopFiltersNoResults.startDate -
|
|
658
|
-
* @param getTopFiltersNoResults.endDate -
|
|
659
|
-
* @param getTopFiltersNoResults.limit - Number of records to return
|
|
660
|
-
* @param getTopFiltersNoResults.offset - Position of the starting record. Used for paging. 0 is the first record.
|
|
661
|
-
* @param getTopFiltersNoResults.tags - Filter
|
|
662
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
663
|
-
*/
|
|
664
|
-
getTopFiltersNoResults({ index, search, startDate, endDate, limit, offset, tags, }, requestOptions) {
|
|
665
|
-
if (!index) {
|
|
666
|
-
throw new Error('Parameter `index` is required when calling `getTopFiltersNoResults`.');
|
|
667
|
-
}
|
|
668
|
-
const requestPath = '/2/filters/noResults';
|
|
669
|
-
const headers = {};
|
|
670
|
-
const queryParameters = {};
|
|
671
|
-
if (index !== undefined) {
|
|
672
|
-
queryParameters.index = index.toString();
|
|
673
|
-
}
|
|
674
|
-
if (search !== undefined) {
|
|
675
|
-
queryParameters.search = search.toString();
|
|
676
|
-
}
|
|
677
|
-
if (startDate !== undefined) {
|
|
678
|
-
queryParameters.startDate = startDate.toString();
|
|
679
|
-
}
|
|
680
|
-
if (endDate !== undefined) {
|
|
681
|
-
queryParameters.endDate = endDate.toString();
|
|
682
|
-
}
|
|
683
|
-
if (limit !== undefined) {
|
|
684
|
-
queryParameters.limit = limit.toString();
|
|
685
|
-
}
|
|
686
|
-
if (offset !== undefined) {
|
|
687
|
-
queryParameters.offset = offset.toString();
|
|
688
|
-
}
|
|
689
|
-
if (tags !== undefined) {
|
|
690
|
-
queryParameters.tags = tags.toString();
|
|
691
|
-
}
|
|
692
|
-
const request = {
|
|
693
|
-
method: 'GET',
|
|
694
|
-
path: requestPath,
|
|
695
|
-
queryParameters,
|
|
696
|
-
headers,
|
|
697
|
-
};
|
|
698
|
-
return transporter.request(request, requestOptions);
|
|
699
|
-
},
|
|
700
|
-
/**
|
|
701
|
-
*
|
|
702
|
-
*
|
|
703
|
-
* @summary Get top hits.
|
|
704
|
-
* @param getTopHits - The getTopHits object.
|
|
705
|
-
* @param getTopHits.index -
|
|
706
|
-
* @param getTopHits.search -
|
|
707
|
-
* @param getTopHits.clickAnalytics - Whether to include
|
|
708
|
-
* @param getTopHits.startDate -
|
|
709
|
-
* @param getTopHits.endDate -
|
|
710
|
-
* @param getTopHits.limit - Number of records to return
|
|
711
|
-
* @param getTopHits.offset - Position of the starting record. Used for paging. 0 is the first record.
|
|
712
|
-
* @param getTopHits.tags - Filter
|
|
713
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
714
|
-
*/
|
|
715
|
-
getTopHits({ index, search, clickAnalytics, startDate, endDate, limit, offset, tags, }, requestOptions) {
|
|
716
|
-
if (!index) {
|
|
717
|
-
throw new Error('Parameter `index` is required when calling `getTopHits`.');
|
|
718
|
-
}
|
|
719
|
-
const requestPath = '/2/hits';
|
|
720
|
-
const headers = {};
|
|
721
|
-
const queryParameters = {};
|
|
722
|
-
if (index !== undefined) {
|
|
723
|
-
queryParameters.index = index.toString();
|
|
724
|
-
}
|
|
725
|
-
if (search !== undefined) {
|
|
726
|
-
queryParameters.search = search.toString();
|
|
727
|
-
}
|
|
728
|
-
if (clickAnalytics !== undefined) {
|
|
729
|
-
queryParameters.clickAnalytics = clickAnalytics.toString();
|
|
730
|
-
}
|
|
731
|
-
if (startDate !== undefined) {
|
|
732
|
-
queryParameters.startDate = startDate.toString();
|
|
733
|
-
}
|
|
734
|
-
if (endDate !== undefined) {
|
|
735
|
-
queryParameters.endDate = endDate.toString();
|
|
736
|
-
}
|
|
737
|
-
if (limit !== undefined) {
|
|
738
|
-
queryParameters.limit = limit.toString();
|
|
739
|
-
}
|
|
740
|
-
if (offset !== undefined) {
|
|
741
|
-
queryParameters.offset = offset.toString();
|
|
742
|
-
}
|
|
743
|
-
if (tags !== undefined) {
|
|
744
|
-
queryParameters.tags = tags.toString();
|
|
745
|
-
}
|
|
746
|
-
const request = {
|
|
747
|
-
method: 'GET',
|
|
748
|
-
path: requestPath,
|
|
749
|
-
queryParameters,
|
|
750
|
-
headers,
|
|
751
|
-
};
|
|
752
|
-
return transporter.request(request, requestOptions);
|
|
753
|
-
},
|
|
754
|
-
/**
|
|
755
|
-
* Returns
|
|
756
|
-
*
|
|
757
|
-
* @summary Get top searches.
|
|
758
|
-
* @param getTopSearches - The getTopSearches object.
|
|
759
|
-
* @param getTopSearches.index -
|
|
760
|
-
* @param getTopSearches.clickAnalytics - Whether to include
|
|
761
|
-
* @param getTopSearches.startDate -
|
|
762
|
-
* @param getTopSearches.endDate -
|
|
763
|
-
* @param getTopSearches.orderBy - Reorder the results.
|
|
764
|
-
* @param getTopSearches.direction -
|
|
765
|
-
* @param getTopSearches.limit - Number of records to return
|
|
766
|
-
* @param getTopSearches.offset - Position of the starting record. Used for paging. 0 is the first record.
|
|
767
|
-
* @param getTopSearches.tags - Filter
|
|
768
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
769
|
-
*/
|
|
770
|
-
getTopSearches({ index, clickAnalytics, startDate, endDate, orderBy, direction, limit, offset, tags, }, requestOptions) {
|
|
771
|
-
if (!index) {
|
|
772
|
-
throw new Error('Parameter `index` is required when calling `getTopSearches`.');
|
|
773
|
-
}
|
|
774
|
-
const requestPath = '/2/searches';
|
|
775
|
-
const headers = {};
|
|
776
|
-
const queryParameters = {};
|
|
777
|
-
if (index !== undefined) {
|
|
778
|
-
queryParameters.index = index.toString();
|
|
779
|
-
}
|
|
780
|
-
if (clickAnalytics !== undefined) {
|
|
781
|
-
queryParameters.clickAnalytics = clickAnalytics.toString();
|
|
782
|
-
}
|
|
783
|
-
if (startDate !== undefined) {
|
|
784
|
-
queryParameters.startDate = startDate.toString();
|
|
785
|
-
}
|
|
786
|
-
if (endDate !== undefined) {
|
|
787
|
-
queryParameters.endDate = endDate.toString();
|
|
788
|
-
}
|
|
789
|
-
if (orderBy !== undefined) {
|
|
790
|
-
queryParameters.orderBy = orderBy.toString();
|
|
791
|
-
}
|
|
792
|
-
if (direction !== undefined) {
|
|
793
|
-
queryParameters.direction = direction.toString();
|
|
794
|
-
}
|
|
795
|
-
if (limit !== undefined) {
|
|
796
|
-
queryParameters.limit = limit.toString();
|
|
797
|
-
}
|
|
798
|
-
if (offset !== undefined) {
|
|
799
|
-
queryParameters.offset = offset.toString();
|
|
800
|
-
}
|
|
801
|
-
if (tags !== undefined) {
|
|
802
|
-
queryParameters.tags = tags.toString();
|
|
803
|
-
}
|
|
804
|
-
const request = {
|
|
805
|
-
method: 'GET',
|
|
806
|
-
path: requestPath,
|
|
807
|
-
queryParameters,
|
|
808
|
-
headers,
|
|
809
|
-
};
|
|
810
|
-
return transporter.request(request, requestOptions);
|
|
811
|
-
},
|
|
812
|
-
/**
|
|
813
|
-
*
|
|
814
|
-
*
|
|
815
|
-
* @summary Get
|
|
816
|
-
* @param getUsersCount - The getUsersCount object.
|
|
817
|
-
* @param getUsersCount.index -
|
|
818
|
-
* @param getUsersCount.startDate -
|
|
819
|
-
* @param getUsersCount.endDate -
|
|
820
|
-
* @param getUsersCount.tags - Filter
|
|
821
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
822
|
-
*/
|
|
823
|
-
getUsersCount({ index, startDate, endDate, tags }, requestOptions) {
|
|
824
|
-
if (!index) {
|
|
825
|
-
throw new Error('Parameter `index` is required when calling `getUsersCount`.');
|
|
826
|
-
}
|
|
827
|
-
const requestPath = '/2/users/count';
|
|
828
|
-
const headers = {};
|
|
829
|
-
const queryParameters = {};
|
|
830
|
-
if (index !== undefined) {
|
|
831
|
-
queryParameters.index = index.toString();
|
|
832
|
-
}
|
|
833
|
-
if (startDate !== undefined) {
|
|
834
|
-
queryParameters.startDate = startDate.toString();
|
|
835
|
-
}
|
|
836
|
-
if (endDate !== undefined) {
|
|
837
|
-
queryParameters.endDate = endDate.toString();
|
|
838
|
-
}
|
|
839
|
-
if (tags !== undefined) {
|
|
840
|
-
queryParameters.tags = tags.toString();
|
|
841
|
-
}
|
|
842
|
-
const request = {
|
|
843
|
-
method: 'GET',
|
|
844
|
-
path: requestPath,
|
|
845
|
-
queryParameters,
|
|
846
|
-
headers,
|
|
847
|
-
};
|
|
848
|
-
return transporter.request(request, requestOptions);
|
|
849
|
-
},
|
|
850
|
-
/**
|
|
851
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
852
|
-
*
|
|
853
|
-
* @summary Send requests to the Algolia REST API.
|
|
854
|
-
* @param post - The post object.
|
|
855
|
-
* @param post.path -
|
|
856
|
-
* @param post.parameters - Query parameters to
|
|
857
|
-
* @param post.body -
|
|
858
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
859
|
-
*/
|
|
860
|
-
post({ path, parameters, body }, requestOptions) {
|
|
861
|
-
if (!path) {
|
|
862
|
-
throw new Error('Parameter `path` is required when calling `post`.');
|
|
863
|
-
}
|
|
864
|
-
const requestPath = '/1{path}'.replace('{path}', path);
|
|
865
|
-
const headers = {};
|
|
866
|
-
const queryParameters = parameters ? parameters : {};
|
|
867
|
-
const request = {
|
|
868
|
-
method: 'POST',
|
|
869
|
-
path: requestPath,
|
|
870
|
-
queryParameters,
|
|
871
|
-
headers,
|
|
872
|
-
data: body ? body : {},
|
|
873
|
-
};
|
|
874
|
-
return transporter.request(request, requestOptions);
|
|
875
|
-
},
|
|
876
|
-
/**
|
|
877
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
878
|
-
*
|
|
879
|
-
* @summary Send requests to the Algolia REST API.
|
|
880
|
-
* @param put - The put object.
|
|
881
|
-
* @param put.path -
|
|
882
|
-
* @param put.parameters - Query parameters to
|
|
883
|
-
* @param put.body -
|
|
884
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
885
|
-
*/
|
|
886
|
-
put({ path, parameters, body }, requestOptions) {
|
|
887
|
-
if (!path) {
|
|
888
|
-
throw new Error('Parameter `path` is required when calling `put`.');
|
|
889
|
-
}
|
|
890
|
-
const requestPath = '/1{path}'.replace('{path}', path);
|
|
891
|
-
const headers = {};
|
|
892
|
-
const queryParameters = parameters ? parameters : {};
|
|
893
|
-
const request = {
|
|
894
|
-
method: 'PUT',
|
|
895
|
-
path: requestPath,
|
|
896
|
-
queryParameters,
|
|
897
|
-
headers,
|
|
898
|
-
data: body ? body : {},
|
|
899
|
-
};
|
|
900
|
-
return transporter.request(request, requestOptions);
|
|
901
|
-
},
|
|
902
|
-
};
|
|
6
|
+
// 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.
|
|
7
|
+
const apiClientVersion = '5.0.0-alpha.90';
|
|
8
|
+
const REGIONS = ['de', 'us'];
|
|
9
|
+
function getDefaultHosts(region) {
|
|
10
|
+
const url = !region
|
|
11
|
+
? 'analytics.algolia.com'
|
|
12
|
+
: 'analytics.{region}.algolia.com'.replace('{region}', region);
|
|
13
|
+
return [{ url, accept: 'readWrite', protocol: 'https' }];
|
|
14
|
+
}
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
16
|
+
function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }) {
|
|
17
|
+
const auth = clientCommon.createAuth(appIdOption, apiKeyOption, authMode);
|
|
18
|
+
const transporter = clientCommon.createTransporter({
|
|
19
|
+
hosts: getDefaultHosts(regionOption),
|
|
20
|
+
...options,
|
|
21
|
+
algoliaAgent: clientCommon.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,
|
|
38
|
+
/**
|
|
39
|
+
* The `appId` currently in use.
|
|
40
|
+
*/
|
|
41
|
+
appId: appIdOption,
|
|
42
|
+
/**
|
|
43
|
+
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
44
|
+
*/
|
|
45
|
+
clearCache() {
|
|
46
|
+
return Promise.all([
|
|
47
|
+
transporter.requestsCache.clear(),
|
|
48
|
+
transporter.responsesCache.clear(),
|
|
49
|
+
]).then(() => undefined);
|
|
50
|
+
},
|
|
51
|
+
/**
|
|
52
|
+
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
53
|
+
*/
|
|
54
|
+
get _ua() {
|
|
55
|
+
return transporter.algoliaAgent.value;
|
|
56
|
+
},
|
|
57
|
+
/**
|
|
58
|
+
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
|
59
|
+
*
|
|
60
|
+
* @param segment - The algolia agent (user-agent) segment to add.
|
|
61
|
+
* @param version - The version of the agent.
|
|
62
|
+
*/
|
|
63
|
+
addAlgoliaAgent(segment, version) {
|
|
64
|
+
transporter.algoliaAgent.add({ segment, version });
|
|
65
|
+
},
|
|
66
|
+
/**
|
|
67
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
68
|
+
*
|
|
69
|
+
* @summary Send requests to the Algolia REST API.
|
|
70
|
+
* @param del - The del object.
|
|
71
|
+
* @param del.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
72
|
+
* @param del.parameters - Query parameters to apply to the current query.
|
|
73
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
74
|
+
*/
|
|
75
|
+
del({ path, parameters }, requestOptions) {
|
|
76
|
+
if (!path) {
|
|
77
|
+
throw new Error('Parameter `path` is required when calling `del`.');
|
|
78
|
+
}
|
|
79
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
80
|
+
const headers = {};
|
|
81
|
+
const queryParameters = parameters ? parameters : {};
|
|
82
|
+
const request = {
|
|
83
|
+
method: 'DELETE',
|
|
84
|
+
path: requestPath,
|
|
85
|
+
queryParameters,
|
|
86
|
+
headers,
|
|
87
|
+
};
|
|
88
|
+
return transporter.request(request, requestOptions);
|
|
89
|
+
},
|
|
90
|
+
/**
|
|
91
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
92
|
+
*
|
|
93
|
+
* @summary Send requests to the Algolia REST API.
|
|
94
|
+
* @param get - The get object.
|
|
95
|
+
* @param get.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
96
|
+
* @param get.parameters - Query parameters to apply to the current query.
|
|
97
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
98
|
+
*/
|
|
99
|
+
get({ path, parameters }, requestOptions) {
|
|
100
|
+
if (!path) {
|
|
101
|
+
throw new Error('Parameter `path` is required when calling `get`.');
|
|
102
|
+
}
|
|
103
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
104
|
+
const headers = {};
|
|
105
|
+
const queryParameters = parameters ? parameters : {};
|
|
106
|
+
const request = {
|
|
107
|
+
method: 'GET',
|
|
108
|
+
path: requestPath,
|
|
109
|
+
queryParameters,
|
|
110
|
+
headers,
|
|
111
|
+
};
|
|
112
|
+
return transporter.request(request, requestOptions);
|
|
113
|
+
},
|
|
114
|
+
/**
|
|
115
|
+
* 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`.
|
|
116
|
+
*
|
|
117
|
+
* @summary Get average click position.
|
|
118
|
+
* @param getAverageClickPosition - The getAverageClickPosition object.
|
|
119
|
+
* @param getAverageClickPosition.index - Index name to target.
|
|
120
|
+
* @param getAverageClickPosition.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
121
|
+
* @param getAverageClickPosition.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
122
|
+
* @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.
|
|
123
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
124
|
+
*/
|
|
125
|
+
getAverageClickPosition({ index, startDate, endDate, tags }, requestOptions) {
|
|
126
|
+
if (!index) {
|
|
127
|
+
throw new Error('Parameter `index` is required when calling `getAverageClickPosition`.');
|
|
128
|
+
}
|
|
129
|
+
const requestPath = '/2/clicks/averageClickPosition';
|
|
130
|
+
const headers = {};
|
|
131
|
+
const queryParameters = {};
|
|
132
|
+
if (index !== undefined) {
|
|
133
|
+
queryParameters.index = index.toString();
|
|
134
|
+
}
|
|
135
|
+
if (startDate !== undefined) {
|
|
136
|
+
queryParameters.startDate = startDate.toString();
|
|
137
|
+
}
|
|
138
|
+
if (endDate !== undefined) {
|
|
139
|
+
queryParameters.endDate = endDate.toString();
|
|
140
|
+
}
|
|
141
|
+
if (tags !== undefined) {
|
|
142
|
+
queryParameters.tags = tags.toString();
|
|
143
|
+
}
|
|
144
|
+
const request = {
|
|
145
|
+
method: 'GET',
|
|
146
|
+
path: requestPath,
|
|
147
|
+
queryParameters,
|
|
148
|
+
headers,
|
|
149
|
+
};
|
|
150
|
+
return transporter.request(request, requestOptions);
|
|
151
|
+
},
|
|
152
|
+
/**
|
|
153
|
+
* 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`.
|
|
154
|
+
*
|
|
155
|
+
* @summary Get click positions.
|
|
156
|
+
* @param getClickPositions - The getClickPositions object.
|
|
157
|
+
* @param getClickPositions.index - Index name to target.
|
|
158
|
+
* @param getClickPositions.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
159
|
+
* @param getClickPositions.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
160
|
+
* @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.
|
|
161
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
162
|
+
*/
|
|
163
|
+
getClickPositions({ index, startDate, endDate, tags }, requestOptions) {
|
|
164
|
+
if (!index) {
|
|
165
|
+
throw new Error('Parameter `index` is required when calling `getClickPositions`.');
|
|
166
|
+
}
|
|
167
|
+
const requestPath = '/2/clicks/positions';
|
|
168
|
+
const headers = {};
|
|
169
|
+
const queryParameters = {};
|
|
170
|
+
if (index !== undefined) {
|
|
171
|
+
queryParameters.index = index.toString();
|
|
172
|
+
}
|
|
173
|
+
if (startDate !== undefined) {
|
|
174
|
+
queryParameters.startDate = startDate.toString();
|
|
175
|
+
}
|
|
176
|
+
if (endDate !== undefined) {
|
|
177
|
+
queryParameters.endDate = endDate.toString();
|
|
178
|
+
}
|
|
179
|
+
if (tags !== undefined) {
|
|
180
|
+
queryParameters.tags = tags.toString();
|
|
181
|
+
}
|
|
182
|
+
const request = {
|
|
183
|
+
method: 'GET',
|
|
184
|
+
path: requestPath,
|
|
185
|
+
queryParameters,
|
|
186
|
+
headers,
|
|
187
|
+
};
|
|
188
|
+
return transporter.request(request, requestOptions);
|
|
189
|
+
},
|
|
190
|
+
/**
|
|
191
|
+
* Returns a [click-through rate (CTR)](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#click-through-rate).
|
|
192
|
+
*
|
|
193
|
+
* @summary Get click-through rate (CTR).
|
|
194
|
+
* @param getClickThroughRate - The getClickThroughRate object.
|
|
195
|
+
* @param getClickThroughRate.index - Index name to target.
|
|
196
|
+
* @param getClickThroughRate.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
197
|
+
* @param getClickThroughRate.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
198
|
+
* @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.
|
|
199
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
200
|
+
*/
|
|
201
|
+
getClickThroughRate({ index, startDate, endDate, tags }, requestOptions) {
|
|
202
|
+
if (!index) {
|
|
203
|
+
throw new Error('Parameter `index` is required when calling `getClickThroughRate`.');
|
|
204
|
+
}
|
|
205
|
+
const requestPath = '/2/clicks/clickThroughRate';
|
|
206
|
+
const headers = {};
|
|
207
|
+
const queryParameters = {};
|
|
208
|
+
if (index !== undefined) {
|
|
209
|
+
queryParameters.index = index.toString();
|
|
210
|
+
}
|
|
211
|
+
if (startDate !== undefined) {
|
|
212
|
+
queryParameters.startDate = startDate.toString();
|
|
213
|
+
}
|
|
214
|
+
if (endDate !== undefined) {
|
|
215
|
+
queryParameters.endDate = endDate.toString();
|
|
216
|
+
}
|
|
217
|
+
if (tags !== undefined) {
|
|
218
|
+
queryParameters.tags = tags.toString();
|
|
219
|
+
}
|
|
220
|
+
const request = {
|
|
221
|
+
method: 'GET',
|
|
222
|
+
path: requestPath,
|
|
223
|
+
queryParameters,
|
|
224
|
+
headers,
|
|
225
|
+
};
|
|
226
|
+
return transporter.request(request, requestOptions);
|
|
227
|
+
},
|
|
228
|
+
/**
|
|
229
|
+
* Return a [conversion rate](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#conversion-rate).
|
|
230
|
+
*
|
|
231
|
+
* @summary Get conversion rate (CR).
|
|
232
|
+
* @param getConversationRate - The getConversationRate object.
|
|
233
|
+
* @param getConversationRate.index - Index name to target.
|
|
234
|
+
* @param getConversationRate.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
235
|
+
* @param getConversationRate.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
236
|
+
* @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.
|
|
237
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
238
|
+
*/
|
|
239
|
+
getConversationRate({ index, startDate, endDate, tags }, requestOptions) {
|
|
240
|
+
if (!index) {
|
|
241
|
+
throw new Error('Parameter `index` is required when calling `getConversationRate`.');
|
|
242
|
+
}
|
|
243
|
+
const requestPath = '/2/conversions/conversionRate';
|
|
244
|
+
const headers = {};
|
|
245
|
+
const queryParameters = {};
|
|
246
|
+
if (index !== undefined) {
|
|
247
|
+
queryParameters.index = index.toString();
|
|
248
|
+
}
|
|
249
|
+
if (startDate !== undefined) {
|
|
250
|
+
queryParameters.startDate = startDate.toString();
|
|
251
|
+
}
|
|
252
|
+
if (endDate !== undefined) {
|
|
253
|
+
queryParameters.endDate = endDate.toString();
|
|
254
|
+
}
|
|
255
|
+
if (tags !== undefined) {
|
|
256
|
+
queryParameters.tags = tags.toString();
|
|
257
|
+
}
|
|
258
|
+
const request = {
|
|
259
|
+
method: 'GET',
|
|
260
|
+
path: requestPath,
|
|
261
|
+
queryParameters,
|
|
262
|
+
headers,
|
|
263
|
+
};
|
|
264
|
+
return transporter.request(request, requestOptions);
|
|
265
|
+
},
|
|
266
|
+
/**
|
|
267
|
+
* 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.
|
|
268
|
+
*
|
|
269
|
+
* @summary Get no click rate.
|
|
270
|
+
* @param getNoClickRate - The getNoClickRate object.
|
|
271
|
+
* @param getNoClickRate.index - Index name to target.
|
|
272
|
+
* @param getNoClickRate.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
273
|
+
* @param getNoClickRate.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
274
|
+
* @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.
|
|
275
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
276
|
+
*/
|
|
277
|
+
getNoClickRate({ index, startDate, endDate, tags }, requestOptions) {
|
|
278
|
+
if (!index) {
|
|
279
|
+
throw new Error('Parameter `index` is required when calling `getNoClickRate`.');
|
|
280
|
+
}
|
|
281
|
+
const requestPath = '/2/searches/noClickRate';
|
|
282
|
+
const headers = {};
|
|
283
|
+
const queryParameters = {};
|
|
284
|
+
if (index !== undefined) {
|
|
285
|
+
queryParameters.index = index.toString();
|
|
286
|
+
}
|
|
287
|
+
if (startDate !== undefined) {
|
|
288
|
+
queryParameters.startDate = startDate.toString();
|
|
289
|
+
}
|
|
290
|
+
if (endDate !== undefined) {
|
|
291
|
+
queryParameters.endDate = endDate.toString();
|
|
292
|
+
}
|
|
293
|
+
if (tags !== undefined) {
|
|
294
|
+
queryParameters.tags = tags.toString();
|
|
295
|
+
}
|
|
296
|
+
const request = {
|
|
297
|
+
method: 'GET',
|
|
298
|
+
path: requestPath,
|
|
299
|
+
queryParameters,
|
|
300
|
+
headers,
|
|
301
|
+
};
|
|
302
|
+
return transporter.request(request, requestOptions);
|
|
303
|
+
},
|
|
304
|
+
/**
|
|
305
|
+
* Returns the rate at which searches didn\'t return any results.
|
|
306
|
+
*
|
|
307
|
+
* @summary Get no results rate.
|
|
308
|
+
* @param getNoResultsRate - The getNoResultsRate object.
|
|
309
|
+
* @param getNoResultsRate.index - Index name to target.
|
|
310
|
+
* @param getNoResultsRate.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
311
|
+
* @param getNoResultsRate.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
312
|
+
* @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.
|
|
313
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
314
|
+
*/
|
|
315
|
+
getNoResultsRate({ index, startDate, endDate, tags }, requestOptions) {
|
|
316
|
+
if (!index) {
|
|
317
|
+
throw new Error('Parameter `index` is required when calling `getNoResultsRate`.');
|
|
318
|
+
}
|
|
319
|
+
const requestPath = '/2/searches/noResultRate';
|
|
320
|
+
const headers = {};
|
|
321
|
+
const queryParameters = {};
|
|
322
|
+
if (index !== undefined) {
|
|
323
|
+
queryParameters.index = index.toString();
|
|
324
|
+
}
|
|
325
|
+
if (startDate !== undefined) {
|
|
326
|
+
queryParameters.startDate = startDate.toString();
|
|
327
|
+
}
|
|
328
|
+
if (endDate !== undefined) {
|
|
329
|
+
queryParameters.endDate = endDate.toString();
|
|
330
|
+
}
|
|
331
|
+
if (tags !== undefined) {
|
|
332
|
+
queryParameters.tags = tags.toString();
|
|
333
|
+
}
|
|
334
|
+
const request = {
|
|
335
|
+
method: 'GET',
|
|
336
|
+
path: requestPath,
|
|
337
|
+
queryParameters,
|
|
338
|
+
headers,
|
|
339
|
+
};
|
|
340
|
+
return transporter.request(request, requestOptions);
|
|
341
|
+
},
|
|
342
|
+
/**
|
|
343
|
+
* Returns the number of searches within a time range.
|
|
344
|
+
*
|
|
345
|
+
* @summary Get number of searches.
|
|
346
|
+
* @param getSearchesCount - The getSearchesCount object.
|
|
347
|
+
* @param getSearchesCount.index - Index name to target.
|
|
348
|
+
* @param getSearchesCount.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
349
|
+
* @param getSearchesCount.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
350
|
+
* @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.
|
|
351
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
352
|
+
*/
|
|
353
|
+
getSearchesCount({ index, startDate, endDate, tags }, requestOptions) {
|
|
354
|
+
if (!index) {
|
|
355
|
+
throw new Error('Parameter `index` is required when calling `getSearchesCount`.');
|
|
356
|
+
}
|
|
357
|
+
const requestPath = '/2/searches/count';
|
|
358
|
+
const headers = {};
|
|
359
|
+
const queryParameters = {};
|
|
360
|
+
if (index !== undefined) {
|
|
361
|
+
queryParameters.index = index.toString();
|
|
362
|
+
}
|
|
363
|
+
if (startDate !== undefined) {
|
|
364
|
+
queryParameters.startDate = startDate.toString();
|
|
365
|
+
}
|
|
366
|
+
if (endDate !== undefined) {
|
|
367
|
+
queryParameters.endDate = endDate.toString();
|
|
368
|
+
}
|
|
369
|
+
if (tags !== undefined) {
|
|
370
|
+
queryParameters.tags = tags.toString();
|
|
371
|
+
}
|
|
372
|
+
const request = {
|
|
373
|
+
method: 'GET',
|
|
374
|
+
path: requestPath,
|
|
375
|
+
queryParameters,
|
|
376
|
+
headers,
|
|
377
|
+
};
|
|
378
|
+
return transporter.request(request, requestOptions);
|
|
379
|
+
},
|
|
380
|
+
/**
|
|
381
|
+
* Return the most popular of the last 1,000 searches that didn\'t lead to any clicks.
|
|
382
|
+
*
|
|
383
|
+
* @summary Get top searches with no clicks.
|
|
384
|
+
* @param getSearchesNoClicks - The getSearchesNoClicks object.
|
|
385
|
+
* @param getSearchesNoClicks.index - Index name to target.
|
|
386
|
+
* @param getSearchesNoClicks.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
387
|
+
* @param getSearchesNoClicks.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
388
|
+
* @param getSearchesNoClicks.limit - Number of records to return (page size).
|
|
389
|
+
* @param getSearchesNoClicks.offset - Position of the starting record. Used for paging. 0 is the first record.
|
|
390
|
+
* @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.
|
|
391
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
392
|
+
*/
|
|
393
|
+
getSearchesNoClicks({ index, startDate, endDate, limit, offset, tags, }, requestOptions) {
|
|
394
|
+
if (!index) {
|
|
395
|
+
throw new Error('Parameter `index` is required when calling `getSearchesNoClicks`.');
|
|
396
|
+
}
|
|
397
|
+
const requestPath = '/2/searches/noClicks';
|
|
398
|
+
const headers = {};
|
|
399
|
+
const queryParameters = {};
|
|
400
|
+
if (index !== undefined) {
|
|
401
|
+
queryParameters.index = index.toString();
|
|
402
|
+
}
|
|
403
|
+
if (startDate !== undefined) {
|
|
404
|
+
queryParameters.startDate = startDate.toString();
|
|
405
|
+
}
|
|
406
|
+
if (endDate !== undefined) {
|
|
407
|
+
queryParameters.endDate = endDate.toString();
|
|
408
|
+
}
|
|
409
|
+
if (limit !== undefined) {
|
|
410
|
+
queryParameters.limit = limit.toString();
|
|
411
|
+
}
|
|
412
|
+
if (offset !== undefined) {
|
|
413
|
+
queryParameters.offset = offset.toString();
|
|
414
|
+
}
|
|
415
|
+
if (tags !== undefined) {
|
|
416
|
+
queryParameters.tags = tags.toString();
|
|
417
|
+
}
|
|
418
|
+
const request = {
|
|
419
|
+
method: 'GET',
|
|
420
|
+
path: requestPath,
|
|
421
|
+
queryParameters,
|
|
422
|
+
headers,
|
|
423
|
+
};
|
|
424
|
+
return transporter.request(request, requestOptions);
|
|
425
|
+
},
|
|
426
|
+
/**
|
|
427
|
+
* Returns the most popular of the latest 1,000 searches that didn\'t return any results.
|
|
428
|
+
*
|
|
429
|
+
* @summary Get top searches with no results.
|
|
430
|
+
* @param getSearchesNoResults - The getSearchesNoResults object.
|
|
431
|
+
* @param getSearchesNoResults.index - Index name to target.
|
|
432
|
+
* @param getSearchesNoResults.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
433
|
+
* @param getSearchesNoResults.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
434
|
+
* @param getSearchesNoResults.limit - Number of records to return (page size).
|
|
435
|
+
* @param getSearchesNoResults.offset - Position of the starting record. Used for paging. 0 is the first record.
|
|
436
|
+
* @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.
|
|
437
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
438
|
+
*/
|
|
439
|
+
getSearchesNoResults({ index, startDate, endDate, limit, offset, tags, }, requestOptions) {
|
|
440
|
+
if (!index) {
|
|
441
|
+
throw new Error('Parameter `index` is required when calling `getSearchesNoResults`.');
|
|
442
|
+
}
|
|
443
|
+
const requestPath = '/2/searches/noResults';
|
|
444
|
+
const headers = {};
|
|
445
|
+
const queryParameters = {};
|
|
446
|
+
if (index !== undefined) {
|
|
447
|
+
queryParameters.index = index.toString();
|
|
448
|
+
}
|
|
449
|
+
if (startDate !== undefined) {
|
|
450
|
+
queryParameters.startDate = startDate.toString();
|
|
451
|
+
}
|
|
452
|
+
if (endDate !== undefined) {
|
|
453
|
+
queryParameters.endDate = endDate.toString();
|
|
454
|
+
}
|
|
455
|
+
if (limit !== undefined) {
|
|
456
|
+
queryParameters.limit = limit.toString();
|
|
457
|
+
}
|
|
458
|
+
if (offset !== undefined) {
|
|
459
|
+
queryParameters.offset = offset.toString();
|
|
460
|
+
}
|
|
461
|
+
if (tags !== undefined) {
|
|
462
|
+
queryParameters.tags = tags.toString();
|
|
463
|
+
}
|
|
464
|
+
const request = {
|
|
465
|
+
method: 'GET',
|
|
466
|
+
path: requestPath,
|
|
467
|
+
queryParameters,
|
|
468
|
+
headers,
|
|
469
|
+
};
|
|
470
|
+
return transporter.request(request, requestOptions);
|
|
471
|
+
},
|
|
472
|
+
/**
|
|
473
|
+
* 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.
|
|
474
|
+
*
|
|
475
|
+
* @summary Get Analytics API status.
|
|
476
|
+
* @param getStatus - The getStatus object.
|
|
477
|
+
* @param getStatus.index - Index name to target.
|
|
478
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
479
|
+
*/
|
|
480
|
+
getStatus({ index }, requestOptions) {
|
|
481
|
+
if (!index) {
|
|
482
|
+
throw new Error('Parameter `index` is required when calling `getStatus`.');
|
|
483
|
+
}
|
|
484
|
+
const requestPath = '/2/status';
|
|
485
|
+
const headers = {};
|
|
486
|
+
const queryParameters = {};
|
|
487
|
+
if (index !== undefined) {
|
|
488
|
+
queryParameters.index = index.toString();
|
|
489
|
+
}
|
|
490
|
+
const request = {
|
|
491
|
+
method: 'GET',
|
|
492
|
+
path: requestPath,
|
|
493
|
+
queryParameters,
|
|
494
|
+
headers,
|
|
495
|
+
};
|
|
496
|
+
return transporter.request(request, requestOptions);
|
|
497
|
+
},
|
|
498
|
+
/**
|
|
499
|
+
* Returns top countries. Limited to the 1,000 most frequent ones.
|
|
500
|
+
*
|
|
501
|
+
* @summary Get top countries.
|
|
502
|
+
* @param getTopCountries - The getTopCountries object.
|
|
503
|
+
* @param getTopCountries.index - Index name to target.
|
|
504
|
+
* @param getTopCountries.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
505
|
+
* @param getTopCountries.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
506
|
+
* @param getTopCountries.limit - Number of records to return (page size).
|
|
507
|
+
* @param getTopCountries.offset - Position of the starting record. Used for paging. 0 is the first record.
|
|
508
|
+
* @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.
|
|
509
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
510
|
+
*/
|
|
511
|
+
getTopCountries({ index, startDate, endDate, limit, offset, tags }, requestOptions) {
|
|
512
|
+
if (!index) {
|
|
513
|
+
throw new Error('Parameter `index` is required when calling `getTopCountries`.');
|
|
514
|
+
}
|
|
515
|
+
const requestPath = '/2/countries';
|
|
516
|
+
const headers = {};
|
|
517
|
+
const queryParameters = {};
|
|
518
|
+
if (index !== undefined) {
|
|
519
|
+
queryParameters.index = index.toString();
|
|
520
|
+
}
|
|
521
|
+
if (startDate !== undefined) {
|
|
522
|
+
queryParameters.startDate = startDate.toString();
|
|
523
|
+
}
|
|
524
|
+
if (endDate !== undefined) {
|
|
525
|
+
queryParameters.endDate = endDate.toString();
|
|
526
|
+
}
|
|
527
|
+
if (limit !== undefined) {
|
|
528
|
+
queryParameters.limit = limit.toString();
|
|
529
|
+
}
|
|
530
|
+
if (offset !== undefined) {
|
|
531
|
+
queryParameters.offset = offset.toString();
|
|
532
|
+
}
|
|
533
|
+
if (tags !== undefined) {
|
|
534
|
+
queryParameters.tags = tags.toString();
|
|
535
|
+
}
|
|
536
|
+
const request = {
|
|
537
|
+
method: 'GET',
|
|
538
|
+
path: requestPath,
|
|
539
|
+
queryParameters,
|
|
540
|
+
headers,
|
|
541
|
+
};
|
|
542
|
+
return transporter.request(request, requestOptions);
|
|
543
|
+
},
|
|
544
|
+
/**
|
|
545
|
+
* 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.
|
|
546
|
+
*
|
|
547
|
+
* @summary Get top filterable attributes.
|
|
548
|
+
* @param getTopFilterAttributes - The getTopFilterAttributes object.
|
|
549
|
+
* @param getTopFilterAttributes.index - Index name to target.
|
|
550
|
+
* @param getTopFilterAttributes.search - User query.
|
|
551
|
+
* @param getTopFilterAttributes.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
552
|
+
* @param getTopFilterAttributes.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
553
|
+
* @param getTopFilterAttributes.limit - Number of records to return (page size).
|
|
554
|
+
* @param getTopFilterAttributes.offset - Position of the starting record. Used for paging. 0 is the first record.
|
|
555
|
+
* @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.
|
|
556
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
557
|
+
*/
|
|
558
|
+
getTopFilterAttributes({ index, search, startDate, endDate, limit, offset, tags, }, requestOptions) {
|
|
559
|
+
if (!index) {
|
|
560
|
+
throw new Error('Parameter `index` is required when calling `getTopFilterAttributes`.');
|
|
561
|
+
}
|
|
562
|
+
const requestPath = '/2/filters';
|
|
563
|
+
const headers = {};
|
|
564
|
+
const queryParameters = {};
|
|
565
|
+
if (index !== undefined) {
|
|
566
|
+
queryParameters.index = index.toString();
|
|
567
|
+
}
|
|
568
|
+
if (search !== undefined) {
|
|
569
|
+
queryParameters.search = search.toString();
|
|
570
|
+
}
|
|
571
|
+
if (startDate !== undefined) {
|
|
572
|
+
queryParameters.startDate = startDate.toString();
|
|
573
|
+
}
|
|
574
|
+
if (endDate !== undefined) {
|
|
575
|
+
queryParameters.endDate = endDate.toString();
|
|
576
|
+
}
|
|
577
|
+
if (limit !== undefined) {
|
|
578
|
+
queryParameters.limit = limit.toString();
|
|
579
|
+
}
|
|
580
|
+
if (offset !== undefined) {
|
|
581
|
+
queryParameters.offset = offset.toString();
|
|
582
|
+
}
|
|
583
|
+
if (tags !== undefined) {
|
|
584
|
+
queryParameters.tags = tags.toString();
|
|
585
|
+
}
|
|
586
|
+
const request = {
|
|
587
|
+
method: 'GET',
|
|
588
|
+
path: requestPath,
|
|
589
|
+
queryParameters,
|
|
590
|
+
headers,
|
|
591
|
+
};
|
|
592
|
+
return transporter.request(request, requestOptions);
|
|
593
|
+
},
|
|
594
|
+
/**
|
|
595
|
+
* Returns the most popular filter values for an attribute in the 1,000 most recently used filters.
|
|
596
|
+
*
|
|
597
|
+
* @summary Get top filter values for an attribute.
|
|
598
|
+
* @param getTopFilterForAttribute - The getTopFilterForAttribute object.
|
|
599
|
+
* @param getTopFilterForAttribute.attribute - Attribute name.
|
|
600
|
+
* @param getTopFilterForAttribute.index - Index name to target.
|
|
601
|
+
* @param getTopFilterForAttribute.search - User query.
|
|
602
|
+
* @param getTopFilterForAttribute.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
603
|
+
* @param getTopFilterForAttribute.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
604
|
+
* @param getTopFilterForAttribute.limit - Number of records to return (page size).
|
|
605
|
+
* @param getTopFilterForAttribute.offset - Position of the starting record. Used for paging. 0 is the first record.
|
|
606
|
+
* @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.
|
|
607
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
608
|
+
*/
|
|
609
|
+
getTopFilterForAttribute({ attribute, index, search, startDate, endDate, limit, offset, tags, }, requestOptions) {
|
|
610
|
+
if (!attribute) {
|
|
611
|
+
throw new Error('Parameter `attribute` is required when calling `getTopFilterForAttribute`.');
|
|
612
|
+
}
|
|
613
|
+
if (!index) {
|
|
614
|
+
throw new Error('Parameter `index` is required when calling `getTopFilterForAttribute`.');
|
|
615
|
+
}
|
|
616
|
+
const requestPath = '/2/filters/{attribute}'.replace('{attribute}', encodeURIComponent(attribute));
|
|
617
|
+
const headers = {};
|
|
618
|
+
const queryParameters = {};
|
|
619
|
+
if (index !== undefined) {
|
|
620
|
+
queryParameters.index = index.toString();
|
|
621
|
+
}
|
|
622
|
+
if (search !== undefined) {
|
|
623
|
+
queryParameters.search = search.toString();
|
|
624
|
+
}
|
|
625
|
+
if (startDate !== undefined) {
|
|
626
|
+
queryParameters.startDate = startDate.toString();
|
|
627
|
+
}
|
|
628
|
+
if (endDate !== undefined) {
|
|
629
|
+
queryParameters.endDate = endDate.toString();
|
|
630
|
+
}
|
|
631
|
+
if (limit !== undefined) {
|
|
632
|
+
queryParameters.limit = limit.toString();
|
|
633
|
+
}
|
|
634
|
+
if (offset !== undefined) {
|
|
635
|
+
queryParameters.offset = offset.toString();
|
|
636
|
+
}
|
|
637
|
+
if (tags !== undefined) {
|
|
638
|
+
queryParameters.tags = tags.toString();
|
|
639
|
+
}
|
|
640
|
+
const request = {
|
|
641
|
+
method: 'GET',
|
|
642
|
+
path: requestPath,
|
|
643
|
+
queryParameters,
|
|
644
|
+
headers,
|
|
645
|
+
};
|
|
646
|
+
return transporter.request(request, requestOptions);
|
|
647
|
+
},
|
|
648
|
+
/**
|
|
649
|
+
* Returns top filters for filter-enabled searches that don\'t return results. Limited to the 1,000 most recently used filters.
|
|
650
|
+
*
|
|
651
|
+
* @summary Get top filters for a no result search.
|
|
652
|
+
* @param getTopFiltersNoResults - The getTopFiltersNoResults object.
|
|
653
|
+
* @param getTopFiltersNoResults.index - Index name to target.
|
|
654
|
+
* @param getTopFiltersNoResults.search - User query.
|
|
655
|
+
* @param getTopFiltersNoResults.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
656
|
+
* @param getTopFiltersNoResults.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
657
|
+
* @param getTopFiltersNoResults.limit - Number of records to return (page size).
|
|
658
|
+
* @param getTopFiltersNoResults.offset - Position of the starting record. Used for paging. 0 is the first record.
|
|
659
|
+
* @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.
|
|
660
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
661
|
+
*/
|
|
662
|
+
getTopFiltersNoResults({ index, search, startDate, endDate, limit, offset, tags, }, requestOptions) {
|
|
663
|
+
if (!index) {
|
|
664
|
+
throw new Error('Parameter `index` is required when calling `getTopFiltersNoResults`.');
|
|
665
|
+
}
|
|
666
|
+
const requestPath = '/2/filters/noResults';
|
|
667
|
+
const headers = {};
|
|
668
|
+
const queryParameters = {};
|
|
669
|
+
if (index !== undefined) {
|
|
670
|
+
queryParameters.index = index.toString();
|
|
671
|
+
}
|
|
672
|
+
if (search !== undefined) {
|
|
673
|
+
queryParameters.search = search.toString();
|
|
674
|
+
}
|
|
675
|
+
if (startDate !== undefined) {
|
|
676
|
+
queryParameters.startDate = startDate.toString();
|
|
677
|
+
}
|
|
678
|
+
if (endDate !== undefined) {
|
|
679
|
+
queryParameters.endDate = endDate.toString();
|
|
680
|
+
}
|
|
681
|
+
if (limit !== undefined) {
|
|
682
|
+
queryParameters.limit = limit.toString();
|
|
683
|
+
}
|
|
684
|
+
if (offset !== undefined) {
|
|
685
|
+
queryParameters.offset = offset.toString();
|
|
686
|
+
}
|
|
687
|
+
if (tags !== undefined) {
|
|
688
|
+
queryParameters.tags = tags.toString();
|
|
689
|
+
}
|
|
690
|
+
const request = {
|
|
691
|
+
method: 'GET',
|
|
692
|
+
path: requestPath,
|
|
693
|
+
queryParameters,
|
|
694
|
+
headers,
|
|
695
|
+
};
|
|
696
|
+
return transporter.request(request, requestOptions);
|
|
697
|
+
},
|
|
698
|
+
/**
|
|
699
|
+
* Return the most popular clicked results in the last 1,000 searches.
|
|
700
|
+
*
|
|
701
|
+
* @summary Get top hits.
|
|
702
|
+
* @param getTopHits - The getTopHits object.
|
|
703
|
+
* @param getTopHits.index - Index name to target.
|
|
704
|
+
* @param getTopHits.search - User query.
|
|
705
|
+
* @param getTopHits.clickAnalytics - Whether to include [click and conversion](https://www.algolia.com/doc/guides/sending-events/getting-started/) rates for a search.
|
|
706
|
+
* @param getTopHits.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
707
|
+
* @param getTopHits.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
708
|
+
* @param getTopHits.limit - Number of records to return (page size).
|
|
709
|
+
* @param getTopHits.offset - Position of the starting record. Used for paging. 0 is the first record.
|
|
710
|
+
* @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.
|
|
711
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
712
|
+
*/
|
|
713
|
+
getTopHits({ index, search, clickAnalytics, startDate, endDate, limit, offset, tags, }, requestOptions) {
|
|
714
|
+
if (!index) {
|
|
715
|
+
throw new Error('Parameter `index` is required when calling `getTopHits`.');
|
|
716
|
+
}
|
|
717
|
+
const requestPath = '/2/hits';
|
|
718
|
+
const headers = {};
|
|
719
|
+
const queryParameters = {};
|
|
720
|
+
if (index !== undefined) {
|
|
721
|
+
queryParameters.index = index.toString();
|
|
722
|
+
}
|
|
723
|
+
if (search !== undefined) {
|
|
724
|
+
queryParameters.search = search.toString();
|
|
725
|
+
}
|
|
726
|
+
if (clickAnalytics !== undefined) {
|
|
727
|
+
queryParameters.clickAnalytics = clickAnalytics.toString();
|
|
728
|
+
}
|
|
729
|
+
if (startDate !== undefined) {
|
|
730
|
+
queryParameters.startDate = startDate.toString();
|
|
731
|
+
}
|
|
732
|
+
if (endDate !== undefined) {
|
|
733
|
+
queryParameters.endDate = endDate.toString();
|
|
734
|
+
}
|
|
735
|
+
if (limit !== undefined) {
|
|
736
|
+
queryParameters.limit = limit.toString();
|
|
737
|
+
}
|
|
738
|
+
if (offset !== undefined) {
|
|
739
|
+
queryParameters.offset = offset.toString();
|
|
740
|
+
}
|
|
741
|
+
if (tags !== undefined) {
|
|
742
|
+
queryParameters.tags = tags.toString();
|
|
743
|
+
}
|
|
744
|
+
const request = {
|
|
745
|
+
method: 'GET',
|
|
746
|
+
path: requestPath,
|
|
747
|
+
queryParameters,
|
|
748
|
+
headers,
|
|
749
|
+
};
|
|
750
|
+
return transporter.request(request, requestOptions);
|
|
751
|
+
},
|
|
752
|
+
/**
|
|
753
|
+
* Returns the most popular of the latest 1,000 searches. For each search, also returns the number of hits.
|
|
754
|
+
*
|
|
755
|
+
* @summary Get top searches.
|
|
756
|
+
* @param getTopSearches - The getTopSearches object.
|
|
757
|
+
* @param getTopSearches.index - Index name to target.
|
|
758
|
+
* @param getTopSearches.clickAnalytics - Whether to include [click and conversion](https://www.algolia.com/doc/guides/sending-events/getting-started/) rates for a search.
|
|
759
|
+
* @param getTopSearches.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
760
|
+
* @param getTopSearches.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
761
|
+
* @param getTopSearches.orderBy - Reorder the results.
|
|
762
|
+
* @param getTopSearches.direction - Sorting direction of the results: ascending or descending.
|
|
763
|
+
* @param getTopSearches.limit - Number of records to return (page size).
|
|
764
|
+
* @param getTopSearches.offset - Position of the starting record. Used for paging. 0 is the first record.
|
|
765
|
+
* @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.
|
|
766
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
767
|
+
*/
|
|
768
|
+
getTopSearches({ index, clickAnalytics, startDate, endDate, orderBy, direction, limit, offset, tags, }, requestOptions) {
|
|
769
|
+
if (!index) {
|
|
770
|
+
throw new Error('Parameter `index` is required when calling `getTopSearches`.');
|
|
771
|
+
}
|
|
772
|
+
const requestPath = '/2/searches';
|
|
773
|
+
const headers = {};
|
|
774
|
+
const queryParameters = {};
|
|
775
|
+
if (index !== undefined) {
|
|
776
|
+
queryParameters.index = index.toString();
|
|
777
|
+
}
|
|
778
|
+
if (clickAnalytics !== undefined) {
|
|
779
|
+
queryParameters.clickAnalytics = clickAnalytics.toString();
|
|
780
|
+
}
|
|
781
|
+
if (startDate !== undefined) {
|
|
782
|
+
queryParameters.startDate = startDate.toString();
|
|
783
|
+
}
|
|
784
|
+
if (endDate !== undefined) {
|
|
785
|
+
queryParameters.endDate = endDate.toString();
|
|
786
|
+
}
|
|
787
|
+
if (orderBy !== undefined) {
|
|
788
|
+
queryParameters.orderBy = orderBy.toString();
|
|
789
|
+
}
|
|
790
|
+
if (direction !== undefined) {
|
|
791
|
+
queryParameters.direction = direction.toString();
|
|
792
|
+
}
|
|
793
|
+
if (limit !== undefined) {
|
|
794
|
+
queryParameters.limit = limit.toString();
|
|
795
|
+
}
|
|
796
|
+
if (offset !== undefined) {
|
|
797
|
+
queryParameters.offset = offset.toString();
|
|
798
|
+
}
|
|
799
|
+
if (tags !== undefined) {
|
|
800
|
+
queryParameters.tags = tags.toString();
|
|
801
|
+
}
|
|
802
|
+
const request = {
|
|
803
|
+
method: 'GET',
|
|
804
|
+
path: requestPath,
|
|
805
|
+
queryParameters,
|
|
806
|
+
headers,
|
|
807
|
+
};
|
|
808
|
+
return transporter.request(request, requestOptions);
|
|
809
|
+
},
|
|
810
|
+
/**
|
|
811
|
+
* Return the count of unique users.
|
|
812
|
+
*
|
|
813
|
+
* @summary Get user count.
|
|
814
|
+
* @param getUsersCount - The getUsersCount object.
|
|
815
|
+
* @param getUsersCount.index - Index name to target.
|
|
816
|
+
* @param getUsersCount.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
817
|
+
* @param getUsersCount.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
|
|
818
|
+
* @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.
|
|
819
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
820
|
+
*/
|
|
821
|
+
getUsersCount({ index, startDate, endDate, tags }, requestOptions) {
|
|
822
|
+
if (!index) {
|
|
823
|
+
throw new Error('Parameter `index` is required when calling `getUsersCount`.');
|
|
824
|
+
}
|
|
825
|
+
const requestPath = '/2/users/count';
|
|
826
|
+
const headers = {};
|
|
827
|
+
const queryParameters = {};
|
|
828
|
+
if (index !== undefined) {
|
|
829
|
+
queryParameters.index = index.toString();
|
|
830
|
+
}
|
|
831
|
+
if (startDate !== undefined) {
|
|
832
|
+
queryParameters.startDate = startDate.toString();
|
|
833
|
+
}
|
|
834
|
+
if (endDate !== undefined) {
|
|
835
|
+
queryParameters.endDate = endDate.toString();
|
|
836
|
+
}
|
|
837
|
+
if (tags !== undefined) {
|
|
838
|
+
queryParameters.tags = tags.toString();
|
|
839
|
+
}
|
|
840
|
+
const request = {
|
|
841
|
+
method: 'GET',
|
|
842
|
+
path: requestPath,
|
|
843
|
+
queryParameters,
|
|
844
|
+
headers,
|
|
845
|
+
};
|
|
846
|
+
return transporter.request(request, requestOptions);
|
|
847
|
+
},
|
|
848
|
+
/**
|
|
849
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
850
|
+
*
|
|
851
|
+
* @summary Send requests to the Algolia REST API.
|
|
852
|
+
* @param post - The post object.
|
|
853
|
+
* @param post.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
854
|
+
* @param post.parameters - Query parameters to apply to the current query.
|
|
855
|
+
* @param post.body - Parameters to send with the custom request.
|
|
856
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
857
|
+
*/
|
|
858
|
+
post({ path, parameters, body }, requestOptions) {
|
|
859
|
+
if (!path) {
|
|
860
|
+
throw new Error('Parameter `path` is required when calling `post`.');
|
|
861
|
+
}
|
|
862
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
863
|
+
const headers = {};
|
|
864
|
+
const queryParameters = parameters ? parameters : {};
|
|
865
|
+
const request = {
|
|
866
|
+
method: 'POST',
|
|
867
|
+
path: requestPath,
|
|
868
|
+
queryParameters,
|
|
869
|
+
headers,
|
|
870
|
+
data: body ? body : {},
|
|
871
|
+
};
|
|
872
|
+
return transporter.request(request, requestOptions);
|
|
873
|
+
},
|
|
874
|
+
/**
|
|
875
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
876
|
+
*
|
|
877
|
+
* @summary Send requests to the Algolia REST API.
|
|
878
|
+
* @param put - The put object.
|
|
879
|
+
* @param put.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
880
|
+
* @param put.parameters - Query parameters to apply to the current query.
|
|
881
|
+
* @param put.body - Parameters to send with the custom request.
|
|
882
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
883
|
+
*/
|
|
884
|
+
put({ path, parameters, body }, requestOptions) {
|
|
885
|
+
if (!path) {
|
|
886
|
+
throw new Error('Parameter `path` is required when calling `put`.');
|
|
887
|
+
}
|
|
888
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
889
|
+
const headers = {};
|
|
890
|
+
const queryParameters = parameters ? parameters : {};
|
|
891
|
+
const request = {
|
|
892
|
+
method: 'PUT',
|
|
893
|
+
path: requestPath,
|
|
894
|
+
queryParameters,
|
|
895
|
+
headers,
|
|
896
|
+
data: body ? body : {},
|
|
897
|
+
};
|
|
898
|
+
return transporter.request(request, requestOptions);
|
|
899
|
+
},
|
|
900
|
+
};
|
|
903
901
|
}
|
|
904
902
|
|
|
905
|
-
//
|
|
906
|
-
function analyticsClient(appId, apiKey, region, options) {
|
|
907
|
-
if (!appId || typeof appId !== 'string') {
|
|
908
|
-
throw new Error('`appId` is missing.');
|
|
909
|
-
}
|
|
910
|
-
if (!apiKey || typeof apiKey !== 'string') {
|
|
911
|
-
throw new Error('`apiKey` is missing.');
|
|
912
|
-
}
|
|
913
|
-
if (region && (typeof region !== 'string' || !REGIONS.includes(region))) {
|
|
914
|
-
throw new Error(`\`region\` must be one of the following: ${REGIONS.join(', ')}`);
|
|
915
|
-
}
|
|
916
|
-
return createAnalyticsClient({
|
|
917
|
-
appId,
|
|
918
|
-
apiKey,
|
|
919
|
-
region,
|
|
920
|
-
timeouts: {
|
|
921
|
-
connect: clientCommon.DEFAULT_CONNECT_TIMEOUT_NODE,
|
|
922
|
-
read: clientCommon.DEFAULT_READ_TIMEOUT_NODE,
|
|
923
|
-
write: clientCommon.DEFAULT_WRITE_TIMEOUT_NODE,
|
|
924
|
-
},
|
|
925
|
-
requester: requesterNodeHttp.createHttpRequester(),
|
|
926
|
-
algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
|
|
927
|
-
responsesCache: clientCommon.createNullCache(),
|
|
928
|
-
requestsCache: clientCommon.createNullCache(),
|
|
929
|
-
hostsCache: clientCommon.createMemoryCache(),
|
|
930
|
-
...options,
|
|
931
|
-
});
|
|
903
|
+
// 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.
|
|
904
|
+
function analyticsClient(appId, apiKey, region, options) {
|
|
905
|
+
if (!appId || typeof appId !== 'string') {
|
|
906
|
+
throw new Error('`appId` is missing.');
|
|
907
|
+
}
|
|
908
|
+
if (!apiKey || typeof apiKey !== 'string') {
|
|
909
|
+
throw new Error('`apiKey` is missing.');
|
|
910
|
+
}
|
|
911
|
+
if (region && (typeof region !== 'string' || !REGIONS.includes(region))) {
|
|
912
|
+
throw new Error(`\`region\` must be one of the following: ${REGIONS.join(', ')}`);
|
|
913
|
+
}
|
|
914
|
+
return createAnalyticsClient({
|
|
915
|
+
appId,
|
|
916
|
+
apiKey,
|
|
917
|
+
region,
|
|
918
|
+
timeouts: {
|
|
919
|
+
connect: clientCommon.DEFAULT_CONNECT_TIMEOUT_NODE,
|
|
920
|
+
read: clientCommon.DEFAULT_READ_TIMEOUT_NODE,
|
|
921
|
+
write: clientCommon.DEFAULT_WRITE_TIMEOUT_NODE,
|
|
922
|
+
},
|
|
923
|
+
requester: requesterNodeHttp.createHttpRequester(),
|
|
924
|
+
algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
|
|
925
|
+
responsesCache: clientCommon.createNullCache(),
|
|
926
|
+
requestsCache: clientCommon.createNullCache(),
|
|
927
|
+
hostsCache: clientCommon.createMemoryCache(),
|
|
928
|
+
...options,
|
|
929
|
+
});
|
|
932
930
|
}
|
|
933
931
|
|
|
934
932
|
exports.analyticsClient = analyticsClient;
|