@algolia/client-query-suggestions 5.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builds/browser.d.ts +6 -0
- package/dist/builds/browser.d.ts.map +1 -0
- package/dist/builds/node.d.ts +6 -0
- package/dist/builds/node.d.ts.map +1 -0
- package/dist/client-query-suggestions.cjs.js +353 -0
- package/dist/client-query-suggestions.esm.browser.js +1062 -0
- package/dist/client-query-suggestions.esm.node.js +348 -0
- package/dist/client-query-suggestions.umd.js +2 -0
- package/dist/model/clientMethodProps.d.ts +108 -0
- package/dist/model/clientMethodProps.d.ts.map +1 -0
- package/dist/model/errorBase.d.ts +7 -0
- package/dist/model/errorBase.d.ts.map +1 -0
- package/dist/model/index.d.ts +14 -0
- package/dist/model/index.d.ts.map +1 -0
- package/dist/model/indexName.d.ts +7 -0
- package/dist/model/indexName.d.ts.map +1 -0
- package/dist/model/logFile.d.ts +17 -0
- package/dist/model/logFile.d.ts.map +1 -0
- package/dist/model/logLevel.d.ts +5 -0
- package/dist/model/logLevel.d.ts.map +1 -0
- package/dist/model/querySuggestionsIndex.d.ts +20 -0
- package/dist/model/querySuggestionsIndex.d.ts.map +1 -0
- package/dist/model/querySuggestionsIndexParam.d.ts +16 -0
- package/dist/model/querySuggestionsIndexParam.d.ts.map +1 -0
- package/dist/model/querySuggestionsIndexWithIndexParam.d.ts +4 -0
- package/dist/model/querySuggestionsIndexWithIndexParam.d.ts.map +1 -0
- package/dist/model/sourceIndex.d.ts +32 -0
- package/dist/model/sourceIndex.d.ts.map +1 -0
- package/dist/model/sourceIndexExternal.d.ts +11 -0
- package/dist/model/sourceIndexExternal.d.ts.map +1 -0
- package/dist/model/sourceIndexWithReplicas.d.ts +39 -0
- package/dist/model/sourceIndexWithReplicas.d.ts.map +1 -0
- package/dist/model/status.d.ts +15 -0
- package/dist/model/status.d.ts.map +1 -0
- package/dist/model/successResponse.d.ts +11 -0
- package/dist/model/successResponse.d.ts.map +1 -0
- package/dist/src/querySuggestionsClient.d.ts +131 -0
- package/dist/src/querySuggestionsClient.d.ts.map +1 -0
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/model/clientMethodProps.ts +118 -0
- package/model/errorBase.ts +8 -0
- package/model/index.ts +15 -0
- package/model/indexName.ts +8 -0
- package/model/logFile.ts +19 -0
- package/model/logLevel.ts +6 -0
- package/model/querySuggestionsIndex.ts +22 -0
- package/model/querySuggestionsIndexParam.ts +18 -0
- package/model/querySuggestionsIndexWithIndexParam.ts +7 -0
- package/model/sourceIndex.ts +34 -0
- package/model/sourceIndexExternal.ts +12 -0
- package/model/sourceIndexWithReplicas.ts +41 -0
- package/model/status.ts +16 -0
- package/model/successResponse.ts +12 -0
- package/package.json +35 -0
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
import { createAuth, createTransporter, getAlgoliaAgent, DEFAULT_CONNECT_TIMEOUT_NODE, DEFAULT_READ_TIMEOUT_NODE, DEFAULT_WRITE_TIMEOUT_NODE, createNullCache, createMemoryCache } from '@algolia/client-common';
|
|
2
|
+
import { createHttpRequester } from '@algolia/requester-node-http';
|
|
3
|
+
|
|
4
|
+
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
|
|
5
|
+
const apiClientVersion = '5.0.0-alpha.1';
|
|
6
|
+
const REGIONS = ['eu', 'us'];
|
|
7
|
+
function getDefaultHosts(region) {
|
|
8
|
+
const url = 'query-suggestions.{region}.algolia.com'.replace('{region}', region);
|
|
9
|
+
return [{ url, accept: 'readWrite', protocol: 'https' }];
|
|
10
|
+
}
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
12
|
+
function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }) {
|
|
13
|
+
const auth = createAuth(appIdOption, apiKeyOption, authMode);
|
|
14
|
+
const transporter = createTransporter({
|
|
15
|
+
hosts: getDefaultHosts(regionOption),
|
|
16
|
+
...options,
|
|
17
|
+
algoliaAgent: getAlgoliaAgent({
|
|
18
|
+
algoliaAgents,
|
|
19
|
+
client: 'QuerySuggestions',
|
|
20
|
+
version: apiClientVersion,
|
|
21
|
+
}),
|
|
22
|
+
baseHeaders: {
|
|
23
|
+
'content-type': 'text/plain',
|
|
24
|
+
...auth.headers(),
|
|
25
|
+
...options.baseHeaders,
|
|
26
|
+
},
|
|
27
|
+
baseQueryParameters: {
|
|
28
|
+
...auth.queryParameters(),
|
|
29
|
+
...options.baseQueryParameters,
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
return {
|
|
33
|
+
transporter,
|
|
34
|
+
/**
|
|
35
|
+
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
36
|
+
*/
|
|
37
|
+
get _ua() {
|
|
38
|
+
return transporter.algoliaAgent.value;
|
|
39
|
+
},
|
|
40
|
+
/**
|
|
41
|
+
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
|
42
|
+
*
|
|
43
|
+
* @param segment - The algolia agent (user-agent) segment to add.
|
|
44
|
+
* @param version - The version of the agent.
|
|
45
|
+
*/
|
|
46
|
+
addAlgoliaAgent(segment, version) {
|
|
47
|
+
transporter.algoliaAgent.add({ segment, version });
|
|
48
|
+
},
|
|
49
|
+
/**
|
|
50
|
+
* Create a configuration of a Query Suggestions index. There\'s a limit of 100 configurations per application.
|
|
51
|
+
*
|
|
52
|
+
* @summary Create a configuration.
|
|
53
|
+
* @param querySuggestionsIndexWithIndexParam - The querySuggestionsIndexWithIndexParam object.
|
|
54
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
55
|
+
*/
|
|
56
|
+
createConfig(querySuggestionsIndexWithIndexParam, requestOptions) {
|
|
57
|
+
if (!querySuggestionsIndexWithIndexParam) {
|
|
58
|
+
throw new Error('Parameter `querySuggestionsIndexWithIndexParam` is required when calling `createConfig`.');
|
|
59
|
+
}
|
|
60
|
+
const requestPath = '/1/configs';
|
|
61
|
+
const headers = {};
|
|
62
|
+
const queryParameters = {};
|
|
63
|
+
const request = {
|
|
64
|
+
method: 'POST',
|
|
65
|
+
path: requestPath,
|
|
66
|
+
queryParameters,
|
|
67
|
+
headers,
|
|
68
|
+
data: querySuggestionsIndexWithIndexParam,
|
|
69
|
+
};
|
|
70
|
+
return transporter.request(request, requestOptions);
|
|
71
|
+
},
|
|
72
|
+
/**
|
|
73
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
74
|
+
*
|
|
75
|
+
* @summary Send requests to the Algolia REST API.
|
|
76
|
+
* @param del - The del object.
|
|
77
|
+
* @param del.path - The path of the API endpoint to target, anything after the /1 needs to be specified.
|
|
78
|
+
* @param del.parameters - Query parameters to be applied to the current query.
|
|
79
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
80
|
+
*/
|
|
81
|
+
del({ path, parameters }, requestOptions) {
|
|
82
|
+
if (!path) {
|
|
83
|
+
throw new Error('Parameter `path` is required when calling `del`.');
|
|
84
|
+
}
|
|
85
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
86
|
+
const headers = {};
|
|
87
|
+
const queryParameters = parameters ? parameters : {};
|
|
88
|
+
const request = {
|
|
89
|
+
method: 'DELETE',
|
|
90
|
+
path: requestPath,
|
|
91
|
+
queryParameters,
|
|
92
|
+
headers,
|
|
93
|
+
};
|
|
94
|
+
return transporter.request(request, requestOptions);
|
|
95
|
+
},
|
|
96
|
+
/**
|
|
97
|
+
* Delete a configuration of a Query Suggestion\'s index. By deleting a configuration, you stop all updates to the underlying query suggestion index. Note that when doing this, the underlying index does not change - existing suggestions remain untouched.
|
|
98
|
+
*
|
|
99
|
+
* @summary Delete a configuration.
|
|
100
|
+
* @param deleteConfig - The deleteConfig object.
|
|
101
|
+
* @param deleteConfig.indexName - The index in which to perform the request.
|
|
102
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
103
|
+
*/
|
|
104
|
+
deleteConfig({ indexName }, requestOptions) {
|
|
105
|
+
if (!indexName) {
|
|
106
|
+
throw new Error('Parameter `indexName` is required when calling `deleteConfig`.');
|
|
107
|
+
}
|
|
108
|
+
const requestPath = '/1/configs/{indexName}'.replace('{indexName}', encodeURIComponent(indexName));
|
|
109
|
+
const headers = {};
|
|
110
|
+
const queryParameters = {};
|
|
111
|
+
const request = {
|
|
112
|
+
method: 'DELETE',
|
|
113
|
+
path: requestPath,
|
|
114
|
+
queryParameters,
|
|
115
|
+
headers,
|
|
116
|
+
};
|
|
117
|
+
return transporter.request(request, requestOptions);
|
|
118
|
+
},
|
|
119
|
+
/**
|
|
120
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
121
|
+
*
|
|
122
|
+
* @summary Send requests to the Algolia REST API.
|
|
123
|
+
* @param get - The get object.
|
|
124
|
+
* @param get.path - The path of the API endpoint to target, anything after the /1 needs to be specified.
|
|
125
|
+
* @param get.parameters - Query parameters to be applied to the current query.
|
|
126
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
127
|
+
*/
|
|
128
|
+
get({ path, parameters }, requestOptions) {
|
|
129
|
+
if (!path) {
|
|
130
|
+
throw new Error('Parameter `path` is required when calling `get`.');
|
|
131
|
+
}
|
|
132
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
133
|
+
const headers = {};
|
|
134
|
+
const queryParameters = parameters ? parameters : {};
|
|
135
|
+
const request = {
|
|
136
|
+
method: 'GET',
|
|
137
|
+
path: requestPath,
|
|
138
|
+
queryParameters,
|
|
139
|
+
headers,
|
|
140
|
+
};
|
|
141
|
+
return transporter.request(request, requestOptions);
|
|
142
|
+
},
|
|
143
|
+
/**
|
|
144
|
+
* Get all the configurations of Query Suggestions. For each index, you get a block of JSON with a list of its configuration settings.
|
|
145
|
+
*
|
|
146
|
+
* @summary List configurations.
|
|
147
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
148
|
+
*/
|
|
149
|
+
getAllConfigs(requestOptions) {
|
|
150
|
+
const requestPath = '/1/configs';
|
|
151
|
+
const headers = {};
|
|
152
|
+
const queryParameters = {};
|
|
153
|
+
const request = {
|
|
154
|
+
method: 'GET',
|
|
155
|
+
path: requestPath,
|
|
156
|
+
queryParameters,
|
|
157
|
+
headers,
|
|
158
|
+
};
|
|
159
|
+
return transporter.request(request, requestOptions);
|
|
160
|
+
},
|
|
161
|
+
/**
|
|
162
|
+
* Get the configuration of a single Query Suggestions index.
|
|
163
|
+
*
|
|
164
|
+
* @summary Get a single configuration.
|
|
165
|
+
* @param getConfig - The getConfig object.
|
|
166
|
+
* @param getConfig.indexName - The index in which to perform the request.
|
|
167
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
168
|
+
*/
|
|
169
|
+
getConfig({ indexName }, requestOptions) {
|
|
170
|
+
if (!indexName) {
|
|
171
|
+
throw new Error('Parameter `indexName` is required when calling `getConfig`.');
|
|
172
|
+
}
|
|
173
|
+
const requestPath = '/1/configs/{indexName}'.replace('{indexName}', encodeURIComponent(indexName));
|
|
174
|
+
const headers = {};
|
|
175
|
+
const queryParameters = {};
|
|
176
|
+
const request = {
|
|
177
|
+
method: 'GET',
|
|
178
|
+
path: requestPath,
|
|
179
|
+
queryParameters,
|
|
180
|
+
headers,
|
|
181
|
+
};
|
|
182
|
+
return transporter.request(request, requestOptions);
|
|
183
|
+
},
|
|
184
|
+
/**
|
|
185
|
+
* Get the status of a Query Suggestion\'s index. The status includes whether the Query Suggestions index is currently in the process of being built, and the last build time.
|
|
186
|
+
*
|
|
187
|
+
* @summary Get configuration status.
|
|
188
|
+
* @param getConfigStatus - The getConfigStatus object.
|
|
189
|
+
* @param getConfigStatus.indexName - The index in which to perform the request.
|
|
190
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
191
|
+
*/
|
|
192
|
+
getConfigStatus({ indexName }, requestOptions) {
|
|
193
|
+
if (!indexName) {
|
|
194
|
+
throw new Error('Parameter `indexName` is required when calling `getConfigStatus`.');
|
|
195
|
+
}
|
|
196
|
+
const requestPath = '/1/configs/{indexName}/status'.replace('{indexName}', encodeURIComponent(indexName));
|
|
197
|
+
const headers = {};
|
|
198
|
+
const queryParameters = {};
|
|
199
|
+
const request = {
|
|
200
|
+
method: 'GET',
|
|
201
|
+
path: requestPath,
|
|
202
|
+
queryParameters,
|
|
203
|
+
headers,
|
|
204
|
+
};
|
|
205
|
+
return transporter.request(request, requestOptions);
|
|
206
|
+
},
|
|
207
|
+
/**
|
|
208
|
+
* Get the log file of the last build of a single Query Suggestion index.
|
|
209
|
+
*
|
|
210
|
+
* @summary Get a log file.
|
|
211
|
+
* @param getLogFile - The getLogFile object.
|
|
212
|
+
* @param getLogFile.indexName - The index in which to perform the request.
|
|
213
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
214
|
+
*/
|
|
215
|
+
getLogFile({ indexName }, requestOptions) {
|
|
216
|
+
if (!indexName) {
|
|
217
|
+
throw new Error('Parameter `indexName` is required when calling `getLogFile`.');
|
|
218
|
+
}
|
|
219
|
+
const requestPath = '/1/logs/{indexName}'.replace('{indexName}', encodeURIComponent(indexName));
|
|
220
|
+
const headers = {};
|
|
221
|
+
const queryParameters = {};
|
|
222
|
+
const request = {
|
|
223
|
+
method: 'GET',
|
|
224
|
+
path: requestPath,
|
|
225
|
+
queryParameters,
|
|
226
|
+
headers,
|
|
227
|
+
};
|
|
228
|
+
return transporter.request(request, requestOptions);
|
|
229
|
+
},
|
|
230
|
+
/**
|
|
231
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
232
|
+
*
|
|
233
|
+
* @summary Send requests to the Algolia REST API.
|
|
234
|
+
* @param post - The post object.
|
|
235
|
+
* @param post.path - The path of the API endpoint to target, anything after the /1 needs to be specified.
|
|
236
|
+
* @param post.parameters - Query parameters to be applied to the current query.
|
|
237
|
+
* @param post.body - The parameters to send with the custom request.
|
|
238
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
239
|
+
*/
|
|
240
|
+
post({ path, parameters, body }, requestOptions) {
|
|
241
|
+
if (!path) {
|
|
242
|
+
throw new Error('Parameter `path` is required when calling `post`.');
|
|
243
|
+
}
|
|
244
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
245
|
+
const headers = {};
|
|
246
|
+
const queryParameters = parameters ? parameters : {};
|
|
247
|
+
const request = {
|
|
248
|
+
method: 'POST',
|
|
249
|
+
path: requestPath,
|
|
250
|
+
queryParameters,
|
|
251
|
+
headers,
|
|
252
|
+
data: body ? body : {},
|
|
253
|
+
};
|
|
254
|
+
return transporter.request(request, requestOptions);
|
|
255
|
+
},
|
|
256
|
+
/**
|
|
257
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
258
|
+
*
|
|
259
|
+
* @summary Send requests to the Algolia REST API.
|
|
260
|
+
* @param put - The put object.
|
|
261
|
+
* @param put.path - The path of the API endpoint to target, anything after the /1 needs to be specified.
|
|
262
|
+
* @param put.parameters - Query parameters to be applied to the current query.
|
|
263
|
+
* @param put.body - The parameters to send with the custom request.
|
|
264
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
265
|
+
*/
|
|
266
|
+
put({ path, parameters, body }, requestOptions) {
|
|
267
|
+
if (!path) {
|
|
268
|
+
throw new Error('Parameter `path` is required when calling `put`.');
|
|
269
|
+
}
|
|
270
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
271
|
+
const headers = {};
|
|
272
|
+
const queryParameters = parameters ? parameters : {};
|
|
273
|
+
const request = {
|
|
274
|
+
method: 'PUT',
|
|
275
|
+
path: requestPath,
|
|
276
|
+
queryParameters,
|
|
277
|
+
headers,
|
|
278
|
+
data: body ? body : {},
|
|
279
|
+
};
|
|
280
|
+
return transporter.request(request, requestOptions);
|
|
281
|
+
},
|
|
282
|
+
/**
|
|
283
|
+
* Update the configuration of a Query Suggestions index.
|
|
284
|
+
*
|
|
285
|
+
* @summary Update a configuration.
|
|
286
|
+
* @param updateConfig - The updateConfig object.
|
|
287
|
+
* @param updateConfig.indexName - The index in which to perform the request.
|
|
288
|
+
* @param updateConfig.querySuggestionsIndexParam - The querySuggestionsIndexParam object.
|
|
289
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
290
|
+
*/
|
|
291
|
+
updateConfig({ indexName, querySuggestionsIndexParam }, requestOptions) {
|
|
292
|
+
if (!indexName) {
|
|
293
|
+
throw new Error('Parameter `indexName` is required when calling `updateConfig`.');
|
|
294
|
+
}
|
|
295
|
+
if (!querySuggestionsIndexParam) {
|
|
296
|
+
throw new Error('Parameter `querySuggestionsIndexParam` is required when calling `updateConfig`.');
|
|
297
|
+
}
|
|
298
|
+
if (!querySuggestionsIndexParam.sourceIndices) {
|
|
299
|
+
throw new Error('Parameter `querySuggestionsIndexParam.sourceIndices` is required when calling `updateConfig`.');
|
|
300
|
+
}
|
|
301
|
+
const requestPath = '/1/configs/{indexName}'.replace('{indexName}', encodeURIComponent(indexName));
|
|
302
|
+
const headers = {};
|
|
303
|
+
const queryParameters = {};
|
|
304
|
+
const request = {
|
|
305
|
+
method: 'PUT',
|
|
306
|
+
path: requestPath,
|
|
307
|
+
queryParameters,
|
|
308
|
+
headers,
|
|
309
|
+
data: querySuggestionsIndexParam,
|
|
310
|
+
};
|
|
311
|
+
return transporter.request(request, requestOptions);
|
|
312
|
+
},
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
|
|
317
|
+
function querySuggestionsClient(appId, apiKey, region, options) {
|
|
318
|
+
if (!appId || typeof appId !== 'string') {
|
|
319
|
+
throw new Error('`appId` is missing.');
|
|
320
|
+
}
|
|
321
|
+
if (!apiKey || typeof apiKey !== 'string') {
|
|
322
|
+
throw new Error('`apiKey` is missing.');
|
|
323
|
+
}
|
|
324
|
+
if (!region) {
|
|
325
|
+
throw new Error('`region` is missing.');
|
|
326
|
+
}
|
|
327
|
+
if (region && (typeof region !== 'string' || !REGIONS.includes(region))) {
|
|
328
|
+
throw new Error(`\`region\` must be one of the following: ${REGIONS.join(', ')}`);
|
|
329
|
+
}
|
|
330
|
+
return createQuerySuggestionsClient({
|
|
331
|
+
appId,
|
|
332
|
+
apiKey,
|
|
333
|
+
region,
|
|
334
|
+
timeouts: {
|
|
335
|
+
connect: DEFAULT_CONNECT_TIMEOUT_NODE,
|
|
336
|
+
read: DEFAULT_READ_TIMEOUT_NODE,
|
|
337
|
+
write: DEFAULT_WRITE_TIMEOUT_NODE,
|
|
338
|
+
},
|
|
339
|
+
requester: createHttpRequester(),
|
|
340
|
+
algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
|
|
341
|
+
responsesCache: createNullCache(),
|
|
342
|
+
requestsCache: createNullCache(),
|
|
343
|
+
hostsCache: createMemoryCache(),
|
|
344
|
+
...options,
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
export { apiClientVersion, querySuggestionsClient };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! client-query-suggestions.umd.js | 5.0.0-alpha.1 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/client-query-suggestions"]={})}(this,(function(e){"use strict";function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r(e){let t;const r=`algolia-client-js-${e.key}`;function n(){return void 0===t&&(t=e.localStorage||window.localStorage),t}function a(){return JSON.parse(n().getItem(r)||"{}")}return{get:(e,t,r={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>{const r=JSON.stringify(e),n=a()[r];return Promise.all([n||t(),void 0!==n])})).then((([e,t])=>Promise.all([e,t||r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve().then((()=>{const s=a();return s[JSON.stringify(e)]=t,n().setItem(r,JSON.stringify(s)),t})),delete:e=>Promise.resolve().then((()=>{const t=a();delete t[JSON.stringify(e)],n().setItem(r,JSON.stringify(t))})),clear:()=>Promise.resolve().then((()=>{n().removeItem(r)}))}}function n(e){const t=[...e.caches],r=t.shift();return void 0===r?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then((e=>Promise.all([e,r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,a,s={miss:()=>Promise.resolve()})=>r.get(e,a,s).catch((()=>n({caches:t}).get(e,a,s))),set:(e,a)=>r.set(e,a).catch((()=>n({caches:t}).set(e,a))),delete:e=>r.delete(e).catch((()=>n({caches:t}).delete(e))),clear:()=>r.clear().catch((()=>n({caches:t}).clear()))}}function a(e={serializable:!0}){let t={};return{get(r,n,a={miss:()=>Promise.resolve()}){const s=JSON.stringify(r);if(s in t)return Promise.resolve(e.serializable?JSON.parse(t[s]):t[s]);const o=n();return o.then((e=>a.miss(e))).then((()=>o))},set:(r,n)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(n):n,Promise.resolve(n)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}const s=12e4;function o(e,t="up"){const r=Date.now();return{...e,status:t,lastUpdate:r,isUp:function(){return"up"===t||Date.now()-r>s},isTimedOut:function(){return"timed out"===t&&Date.now()-r<=s}}}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class c extends Error{constructor(e,t){super(e),i(this,"name","AlgoliaError"),t&&(this.name=t)}}class u extends c{constructor(e,t,r){super(e,r),i(this,"stackTrace",void 0),this.stackTrace=t}}class l extends u{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",e,"RetryError")}}class d extends u{constructor(e,t,r){super(e,r,"ApiError"),i(this,"status",void 0),this.status=t}}class h extends c{constructor(e,t){super(e,"DeserializationError"),i(this,"response",void 0),this.response=t}}function m(e,t,r){const n=function(e){const t=e=>"[object Object]"===Object.prototype.toString.call(e)||"[object Array]"===Object.prototype.toString.call(e);return Object.keys(e).map((r=>`${r}=${t(e[r])?JSON.stringify(e[r]):e[r]}`)).join("&")}(r);let a=`${e.protocol}://${e.url}/${"/"===t.charAt(0)?t.substr(1):t}`;return n.length&&(a+=`?${n}`),a}function p(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function g({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:n,algoliaAgent:a,timeouts:s,requester:i,requestsCache:c,responsesCache:u}){async function g(c,u,g=!0){const f=[],y=function(e,t){if("GET"===e.method||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(c,u),P=function(e,t,r){const n={Accept:"application/json",...e,...t,...r},a={};return Object.keys(n).forEach((e=>{const t=n[e];a[e.toLowerCase()]=t})),a}(r,c.headers,u.headers),w="GET"===c.method?{...c.data,...u.data}:{},O={"x-algolia-agent":a.value,...n,...c.queryParameters,...w};if(u&&u.queryParameters)for(const e of Object.keys(u.queryParameters))u.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(u.queryParameters[e])?O[e]=u.queryParameters[e].toString():O[e]=u.queryParameters[e];let b=0;const v=async(e,r)=>{const n=e.pop();if(void 0===n)throw new l(function(e){return e.map((e=>p(e)))}(f));let a=u.timeout;void 0===a&&(a=g?s.read:s.write);const w={data:y,headers:P,method:c.method,url:m(n,c.path,O),connectTimeout:r(b,s.connect),responseTimeout:r(b,a)},q=t=>{const r={request:w,response:t,host:n,triesLeft:e.length};return f.push(r),r},j=await i.send(w);if(function({isTimedOut:e,status:t}){return e||function({isTimedOut:e,status:t}){return!e&&0==~~t}({isTimedOut:e,status:t})||2!=~~(t/100)&&4!=~~(t/100)}(j)){const a=q(j);return j.isTimedOut&&b++,console.log("Retryable failure",p(a)),await t.set(n,o(n,j.isTimedOut?"timed out":"down")),v(e,r)}if(function({status:e}){return 2==~~(e/100)}(j))return function(e){try{return JSON.parse(e.content)}catch(t){throw new h(t.message,e)}}(j);throw q(j),function({content:e,status:t},r){let n=e;try{n=JSON.parse(e).message}catch(e){}return new d(n,t,r)}(j,f)},q=e.filter((e=>"readWrite"===e.accept||(g?"read"===e.accept:"write"===e.accept))),j=await async function(e){const r=await Promise.all(e.map((e=>t.get(e,(()=>Promise.resolve(o(e))))))),n=r.filter((e=>e.isUp())),a=r.filter((e=>e.isTimedOut())),s=[...n,...a];return{hosts:s.length>0?s:e,getTimeout:(e,t)=>(0===a.length&&0===e?1:a.length+3+e)*t}}(q);return v([...j.hosts].reverse(),j.getTimeout)}return{hostsCache:t,requester:i,timeouts:s,algoliaAgent:a,baseHeaders:r,baseQueryParameters:n,hosts:e,request:function(e,t={}){const a=e.useReadTransporter||"GET"===e.method;if(!a)return g(e,t,a);const s=()=>g(e,t);if(!0!==(t.cacheable||e.cacheable))return s();const o={request:e,requestOptions:t,transporter:{queryParameters:n,headers:r}};return u.get(o,(()=>c.get(o,(()=>c.set(o,s()).then((e=>Promise.all([c.delete(o),e])),(e=>Promise.all([c.delete(o),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>u.set(o,e)})},requestsCache:c,responsesCache:u}}function f({algoliaAgents:e,client:t,version:r}){const n=function(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}(r).add({segment:t,version:r});return e.forEach((e=>n.add(e))),n}function y(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var P=["appId","apiKey","authMode","algoliaAgents","region"];function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?w(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var b="5.0.0-alpha.1",v=["eu","us"];function q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}e.apiClientVersion=b,e.querySuggestionsClient=function(e,s,o,i){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!s||"string"!=typeof s)throw new Error("`apiKey` is missing.");if(!o)throw new Error("`region` is missing.");if(o&&("string"!=typeof o||!v.includes(o)))throw new Error("`region` must be one of the following: ".concat(v.join(", ")));return function(e){var t,r=e.appId,n=e.apiKey,a=e.authMode,s=e.algoliaAgents,o=e.region,i=y(e,P),c=function(e,t,r="WithinHeaders"){const n={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===r?n:{},queryParameters:()=>"WithinQueryParameters"===r?n:{}}}(r,n,a),u=g(O(O({hosts:(t=o,[{url:"query-suggestions.{region}.algolia.com".replace("{region}",t),accept:"readWrite",protocol:"https"}])},i),{},{algoliaAgent:f({algoliaAgents:s,client:"QuerySuggestions",version:b}),baseHeaders:O(O({"content-type":"text/plain"},c.headers()),i.baseHeaders),baseQueryParameters:O(O({},c.queryParameters()),i.baseQueryParameters)}));return{transporter:u,get _ua(){return u.algoliaAgent.value},addAlgoliaAgent:function(e,t){u.algoliaAgent.add({segment:e,version:t})},createConfig:function(e,t){if(!e)throw new Error("Parameter `querySuggestionsIndexWithIndexParam` is required when calling `createConfig`.");var r={method:"POST",path:"/1/configs",queryParameters:{},headers:{},data:e};return u.request(r,t)},del:function(e,t){var r=e.path,n=e.parameters;if(!r)throw new Error("Parameter `path` is required when calling `del`.");var a={method:"DELETE",path:"/1{path}".replace("{path}",r),queryParameters:n||{},headers:{}};return u.request(a,t)},deleteConfig:function(e,t){var r=e.indexName;if(!r)throw new Error("Parameter `indexName` is required when calling `deleteConfig`.");var n={method:"DELETE",path:"/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{}};return u.request(n,t)},get:function(e,t){var r=e.path,n=e.parameters;if(!r)throw new Error("Parameter `path` is required when calling `get`.");var a={method:"GET",path:"/1{path}".replace("{path}",r),queryParameters:n||{},headers:{}};return u.request(a,t)},getAllConfigs:function(e){var t={method:"GET",path:"/1/configs",queryParameters:{},headers:{}};return u.request(t,e)},getConfig:function(e,t){var r=e.indexName;if(!r)throw new Error("Parameter `indexName` is required when calling `getConfig`.");var n={method:"GET",path:"/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{}};return u.request(n,t)},getConfigStatus:function(e,t){var r=e.indexName;if(!r)throw new Error("Parameter `indexName` is required when calling `getConfigStatus`.");var n={method:"GET",path:"/1/configs/{indexName}/status".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{}};return u.request(n,t)},getLogFile:function(e,t){var r=e.indexName;if(!r)throw new Error("Parameter `indexName` is required when calling `getLogFile`.");var n={method:"GET",path:"/1/logs/{indexName}".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{}};return u.request(n,t)},post:function(e,t){var r=e.path,n=e.parameters,a=e.body;if(!r)throw new Error("Parameter `path` is required when calling `post`.");var s={method:"POST",path:"/1{path}".replace("{path}",r),queryParameters:n||{},headers:{},data:a||{}};return u.request(s,t)},put:function(e,t){var r=e.path,n=e.parameters,a=e.body;if(!r)throw new Error("Parameter `path` is required when calling `put`.");var s={method:"PUT",path:"/1{path}".replace("{path}",r),queryParameters:n||{},headers:{},data:a||{}};return u.request(s,t)},updateConfig:function(e,t){var r=e.indexName,n=e.querySuggestionsIndexParam;if(!r)throw new Error("Parameter `indexName` is required when calling `updateConfig`.");if(!n)throw new Error("Parameter `querySuggestionsIndexParam` is required when calling `updateConfig`.");if(!n.sourceIndices)throw new Error("Parameter `querySuggestionsIndexParam.sourceIndices` is required when calling `updateConfig`.");var a={method:"PUT",path:"/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{},data:n};return u.request(a,t)}}}(function(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?q(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({appId:e,apiKey:s,region:o,timeouts:{connect:1e3,read:2e3,write:3e4},requester:{send:function(e){return new Promise((t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((t=>r.setRequestHeader(t,e.headers[t])));const n=(e,n)=>setTimeout((()=>{r.abort(),t({status:0,content:n,isTimedOut:!0})}),e),a=n(e.connectTimeout,"Connection timeout");let s;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===s&&(clearTimeout(a),s=n(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(a),clearTimeout(s),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(a),clearTimeout(s),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:a(),requestsCache:a({serializable:!1}),hostsCache:n({caches:[r({key:"".concat(b,"-").concat(e)}),a()]})},i))}}));
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import type { QuerySuggestionsIndexParam } from './querySuggestionsIndexParam';
|
|
2
|
+
/**
|
|
3
|
+
* Properties for the `del` method.
|
|
4
|
+
*/
|
|
5
|
+
export declare type DelProps = {
|
|
6
|
+
/**
|
|
7
|
+
* The path of the API endpoint to target, anything after the /1 needs to be specified.
|
|
8
|
+
*/
|
|
9
|
+
path: string;
|
|
10
|
+
/**
|
|
11
|
+
* Query parameters to be applied to the current query.
|
|
12
|
+
*/
|
|
13
|
+
parameters?: Record<string, any>;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Properties for the `deleteConfig` method.
|
|
17
|
+
*/
|
|
18
|
+
export declare type DeleteConfigProps = {
|
|
19
|
+
/**
|
|
20
|
+
* The index in which to perform the request.
|
|
21
|
+
*/
|
|
22
|
+
indexName: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Properties for the `get` method.
|
|
26
|
+
*/
|
|
27
|
+
export declare type GetProps = {
|
|
28
|
+
/**
|
|
29
|
+
* The path of the API endpoint to target, anything after the /1 needs to be specified.
|
|
30
|
+
*/
|
|
31
|
+
path: string;
|
|
32
|
+
/**
|
|
33
|
+
* Query parameters to be applied to the current query.
|
|
34
|
+
*/
|
|
35
|
+
parameters?: Record<string, any>;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Properties for the `getConfig` method.
|
|
39
|
+
*/
|
|
40
|
+
export declare type GetConfigProps = {
|
|
41
|
+
/**
|
|
42
|
+
* The index in which to perform the request.
|
|
43
|
+
*/
|
|
44
|
+
indexName: string;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Properties for the `getConfigStatus` method.
|
|
48
|
+
*/
|
|
49
|
+
export declare type GetConfigStatusProps = {
|
|
50
|
+
/**
|
|
51
|
+
* The index in which to perform the request.
|
|
52
|
+
*/
|
|
53
|
+
indexName: string;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Properties for the `getLogFile` method.
|
|
57
|
+
*/
|
|
58
|
+
export declare type GetLogFileProps = {
|
|
59
|
+
/**
|
|
60
|
+
* The index in which to perform the request.
|
|
61
|
+
*/
|
|
62
|
+
indexName: string;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Properties for the `post` method.
|
|
66
|
+
*/
|
|
67
|
+
export declare type PostProps = {
|
|
68
|
+
/**
|
|
69
|
+
* The path of the API endpoint to target, anything after the /1 needs to be specified.
|
|
70
|
+
*/
|
|
71
|
+
path: string;
|
|
72
|
+
/**
|
|
73
|
+
* Query parameters to be applied to the current query.
|
|
74
|
+
*/
|
|
75
|
+
parameters?: Record<string, any>;
|
|
76
|
+
/**
|
|
77
|
+
* The parameters to send with the custom request.
|
|
78
|
+
*/
|
|
79
|
+
body?: Record<string, any>;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Properties for the `put` method.
|
|
83
|
+
*/
|
|
84
|
+
export declare type PutProps = {
|
|
85
|
+
/**
|
|
86
|
+
* The path of the API endpoint to target, anything after the /1 needs to be specified.
|
|
87
|
+
*/
|
|
88
|
+
path: string;
|
|
89
|
+
/**
|
|
90
|
+
* Query parameters to be applied to the current query.
|
|
91
|
+
*/
|
|
92
|
+
parameters?: Record<string, any>;
|
|
93
|
+
/**
|
|
94
|
+
* The parameters to send with the custom request.
|
|
95
|
+
*/
|
|
96
|
+
body?: Record<string, any>;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Properties for the `updateConfig` method.
|
|
100
|
+
*/
|
|
101
|
+
export declare type UpdateConfigProps = {
|
|
102
|
+
/**
|
|
103
|
+
* The index in which to perform the request.
|
|
104
|
+
*/
|
|
105
|
+
indexName: string;
|
|
106
|
+
querySuggestionsIndexParam: QuerySuggestionsIndexParam;
|
|
107
|
+
};
|
|
108
|
+
//# sourceMappingURL=clientMethodProps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientMethodProps.d.ts","sourceRoot":"","sources":["../../../../packages/client-query-suggestions/model/clientMethodProps.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAE/E;;GAEG;AACH,oBAAY,QAAQ,GAAG;IACrB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC,CAAC;AAEF;;GAEG;AACH,oBAAY,iBAAiB,GAAG;IAC9B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,oBAAY,QAAQ,GAAG;IACrB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC,CAAC;AAEF;;GAEG;AACH,oBAAY,cAAc,GAAG;IAC3B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,oBAAY,oBAAoB,GAAG;IACjC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,oBAAY,eAAe,GAAG;IAC5B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS,GAAG;IACtB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC5B,CAAC;AAEF;;GAEG;AACH,oBAAY,QAAQ,GAAG;IACrB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC5B,CAAC;AAEF;;GAEG;AACH,oBAAY,iBAAiB,GAAG;IAC9B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,0BAA0B,EAAE,0BAA0B,CAAC;CACxD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errorBase.d.ts","sourceRoot":"","sources":["../../../../packages/client-query-suggestions/model/errorBase.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,oBAAY,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './errorBase';
|
|
2
|
+
export * from './indexName';
|
|
3
|
+
export * from './logFile';
|
|
4
|
+
export * from './logLevel';
|
|
5
|
+
export * from './querySuggestionsIndex';
|
|
6
|
+
export * from './querySuggestionsIndexParam';
|
|
7
|
+
export * from './querySuggestionsIndexWithIndexParam';
|
|
8
|
+
export * from './sourceIndex';
|
|
9
|
+
export * from './sourceIndexExternal';
|
|
10
|
+
export * from './sourceIndexWithReplicas';
|
|
11
|
+
export * from './status';
|
|
12
|
+
export * from './successResponse';
|
|
13
|
+
export * from './clientMethodProps';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/client-query-suggestions/model/index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uCAAuC,CAAC;AACtD,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"indexName.d.ts","sourceRoot":"","sources":["../../../../packages/client-query-suggestions/model/indexName.ts"],"names":[],"mappings":"AAEA,oBAAY,SAAS,GAAG;IACtB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { LogLevel } from './logLevel';
|
|
2
|
+
export declare type LogFile = {
|
|
3
|
+
/**
|
|
4
|
+
* Date and time of creation of the record.
|
|
5
|
+
*/
|
|
6
|
+
timestamp: string;
|
|
7
|
+
level: LogLevel;
|
|
8
|
+
/**
|
|
9
|
+
* Detailed description of what happened.
|
|
10
|
+
*/
|
|
11
|
+
message: string;
|
|
12
|
+
/**
|
|
13
|
+
* Indicates the hierarchy of the records. For example, a record with contextLevel=1 belongs to a preceding record with contextLevel=0.
|
|
14
|
+
*/
|
|
15
|
+
contextLevel: number;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=logFile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logFile.d.ts","sourceRoot":"","sources":["../../../../packages/client-query-suggestions/model/logFile.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,oBAAY,OAAO,GAAG;IACpB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,QAAQ,CAAC;IAChB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logLevel.d.ts","sourceRoot":"","sources":["../../../../packages/client-query-suggestions/model/logLevel.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,oBAAY,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { SourceIndexWithReplicas } from './sourceIndexWithReplicas';
|
|
2
|
+
export declare type QuerySuggestionsIndex = {
|
|
3
|
+
/**
|
|
4
|
+
* Index name to target.
|
|
5
|
+
*/
|
|
6
|
+
indexName: string;
|
|
7
|
+
/**
|
|
8
|
+
* List of source indices used to generate a Query Suggestions index.
|
|
9
|
+
*/
|
|
10
|
+
sourceIndices: SourceIndexWithReplicas[];
|
|
11
|
+
/**
|
|
12
|
+
* De-duplicate singular and plural suggestions. For example, let\'s say your index contains English content, and that two suggestions “shoe” and “shoes” end up in your Query Suggestions index. If the English language is configured, only the most popular of those two suggestions would remain.
|
|
13
|
+
*/
|
|
14
|
+
languages: string[];
|
|
15
|
+
/**
|
|
16
|
+
* List of words and patterns to exclude from the Query Suggestions index.
|
|
17
|
+
*/
|
|
18
|
+
exclude: string[];
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=querySuggestionsIndex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"querySuggestionsIndex.d.ts","sourceRoot":"","sources":["../../../../packages/client-query-suggestions/model/querySuggestionsIndex.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEzE,oBAAY,qBAAqB,GAAG;IAClC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,aAAa,EAAE,uBAAuB,EAAE,CAAC;IACzC;;OAEG;IACH,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { SourceIndex } from './sourceIndex';
|
|
2
|
+
export declare type QuerySuggestionsIndexParam = {
|
|
3
|
+
/**
|
|
4
|
+
* List of source indices used to generate a Query Suggestions index.
|
|
5
|
+
*/
|
|
6
|
+
sourceIndices: SourceIndex[];
|
|
7
|
+
/**
|
|
8
|
+
* De-duplicate singular and plural suggestions. For example, let\'s say your index contains English content, and that two suggestions “shoe” and “shoes” end up in your Query Suggestions index. If the English language is configured, only the most popular of those two suggestions would remain.
|
|
9
|
+
*/
|
|
10
|
+
languages?: string[];
|
|
11
|
+
/**
|
|
12
|
+
* List of words and patterns to exclude from the Query Suggestions index.
|
|
13
|
+
*/
|
|
14
|
+
exclude?: string[];
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=querySuggestionsIndexParam.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"querySuggestionsIndexParam.d.ts","sourceRoot":"","sources":["../../../../packages/client-query-suggestions/model/querySuggestionsIndexParam.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,oBAAY,0BAA0B,GAAG;IACvC;;OAEG;IACH,aAAa,EAAE,WAAW,EAAE,CAAC;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { IndexName } from './indexName';
|
|
2
|
+
import type { QuerySuggestionsIndexParam } from './querySuggestionsIndexParam';
|
|
3
|
+
export declare type QuerySuggestionsIndexWithIndexParam = IndexName & QuerySuggestionsIndexParam;
|
|
4
|
+
//# sourceMappingURL=querySuggestionsIndexWithIndexParam.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"querySuggestionsIndexWithIndexParam.d.ts","sourceRoot":"","sources":["../../../../packages/client-query-suggestions/model/querySuggestionsIndexWithIndexParam.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAE/E,oBAAY,mCAAmC,GAAG,SAAS,GACzD,0BAA0B,CAAC"}
|