@algolia/client-query-suggestions 5.2.5 → 5.3.0
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/browser.d.ts +213 -86
- package/dist/builds/browser.js +44 -34
- package/dist/builds/browser.js.map +1 -1
- package/dist/builds/browser.min.js +1 -1
- package/dist/builds/browser.min.js.map +1 -1
- package/dist/builds/browser.umd.js +1 -1
- package/dist/builds/node.cjs +44 -34
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +44 -34
- package/dist/builds/node.js.map +1 -1
- package/dist/node.d.cts +214 -87
- package/dist/node.d.ts +214 -87
- package/dist/src/querySuggestionsClient.cjs +44 -34
- package/dist/src/querySuggestionsClient.cjs.map +1 -1
- package/dist/src/querySuggestionsClient.js +44 -34
- package/dist/src/querySuggestionsClient.js.map +1 -1
- package/package.json +4 -4
package/dist/node.d.cts
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import * as _algolia_client_common from '@algolia/client-common';
|
|
2
|
-
import { ClientOptions } from '@algolia/client-common';
|
|
3
|
-
|
|
4
|
-
type AppID = {
|
|
5
|
-
/**
|
|
6
|
-
* Algolia application ID to which this Query Suggestions configuration belongs.
|
|
7
|
-
*/
|
|
8
|
-
appID?: string;
|
|
9
|
-
};
|
|
2
|
+
import { CreateClientOptions, RequestOptions, ClientOptions } from '@algolia/client-common';
|
|
10
3
|
|
|
11
4
|
type BaseResponse = {
|
|
12
5
|
/**
|
|
@@ -19,29 +12,6 @@ type BaseResponse = {
|
|
|
19
12
|
message?: string;
|
|
20
13
|
};
|
|
21
14
|
|
|
22
|
-
type ConfigStatus = {
|
|
23
|
-
/**
|
|
24
|
-
* Name of the Query Suggestions index (case-sensitive).
|
|
25
|
-
*/
|
|
26
|
-
indexName?: string;
|
|
27
|
-
/**
|
|
28
|
-
* Whether the creation or update of the Query Suggestions index is in progress.
|
|
29
|
-
*/
|
|
30
|
-
isRunning?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Date and time when the Query Suggestions index was last built, in RFC 3339 format.
|
|
33
|
-
*/
|
|
34
|
-
lastBuiltAt?: string;
|
|
35
|
-
/**
|
|
36
|
-
* Date and time when the Query Suggestions index was last updated successfully.
|
|
37
|
-
*/
|
|
38
|
-
lastSuccessfulBuiltAt?: string;
|
|
39
|
-
/**
|
|
40
|
-
* Duration of the last successful build in seconds.
|
|
41
|
-
*/
|
|
42
|
-
lastSuccessfulBuildDuration?: string;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
15
|
/**
|
|
46
16
|
* Languages for deduplicating singular and plural suggestions. If specified, only the more popular form is included.
|
|
47
17
|
*/
|
|
@@ -107,44 +77,6 @@ type Configuration = {
|
|
|
107
77
|
allowSpecialCharacters?: boolean;
|
|
108
78
|
};
|
|
109
79
|
|
|
110
|
-
/**
|
|
111
|
-
* Query Suggestions configuration.
|
|
112
|
-
*/
|
|
113
|
-
type ConfigurationWithIndex = Configuration & Record<string, unknown>;
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* API response for retrieving Query Suggestions configurations.
|
|
117
|
-
*/
|
|
118
|
-
type ConfigurationResponse = AppID & ConfigurationWithIndex;
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Error.
|
|
122
|
-
*/
|
|
123
|
-
type ErrorBase = Record<string, any> & {
|
|
124
|
-
message?: string;
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Type of log entry. - `SKIP`. A query is skipped because it doesn\'t match the conditions for successful inclusion. For example, when a query doesn\'t generate enough search results. - `INFO`. An informative log entry. - `ERROR`. The Query Suggestions process encountered an error.
|
|
129
|
-
*/
|
|
130
|
-
type LogLevel = 'ERROR' | 'INFO' | 'SKIP';
|
|
131
|
-
|
|
132
|
-
type LogFile = {
|
|
133
|
-
/**
|
|
134
|
-
* Date and time of the log entry, in RFC 3339 format.
|
|
135
|
-
*/
|
|
136
|
-
timestamp?: string;
|
|
137
|
-
level?: LogLevel;
|
|
138
|
-
/**
|
|
139
|
-
* Details about this log entry.
|
|
140
|
-
*/
|
|
141
|
-
message?: string;
|
|
142
|
-
/**
|
|
143
|
-
* Level indicating the position of a suggestion in a hierarchy of records. For example, a `contextLevel` of 1 indicates that this suggestion belongs to a previous suggestion with `contextLevel` 0.
|
|
144
|
-
*/
|
|
145
|
-
contextLevel?: number;
|
|
146
|
-
};
|
|
147
|
-
|
|
148
80
|
/**
|
|
149
81
|
* Properties for the `customDelete` method.
|
|
150
82
|
*/
|
|
@@ -252,31 +184,226 @@ type UpdateConfigProps = {
|
|
|
252
184
|
configuration: Configuration;
|
|
253
185
|
};
|
|
254
186
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
187
|
+
type ConfigStatus = {
|
|
188
|
+
/**
|
|
189
|
+
* Name of the Query Suggestions index (case-sensitive).
|
|
190
|
+
*/
|
|
191
|
+
indexName?: string;
|
|
192
|
+
/**
|
|
193
|
+
* Whether the creation or update of the Query Suggestions index is in progress.
|
|
194
|
+
*/
|
|
195
|
+
isRunning?: boolean;
|
|
196
|
+
/**
|
|
197
|
+
* Date and time when the Query Suggestions index was last built, in RFC 3339 format.
|
|
198
|
+
*/
|
|
199
|
+
lastBuiltAt?: string;
|
|
200
|
+
/**
|
|
201
|
+
* Date and time when the Query Suggestions index was last updated successfully.
|
|
202
|
+
*/
|
|
203
|
+
lastSuccessfulBuiltAt?: string;
|
|
204
|
+
/**
|
|
205
|
+
* Duration of the last successful build in seconds.
|
|
206
|
+
*/
|
|
207
|
+
lastSuccessfulBuildDuration?: string;
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
type AppID = {
|
|
211
|
+
/**
|
|
212
|
+
* Algolia application ID to which this Query Suggestions configuration belongs.
|
|
213
|
+
*/
|
|
214
|
+
appID?: string;
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Query Suggestions configuration.
|
|
219
|
+
*/
|
|
220
|
+
type ConfigurationWithIndex = Configuration & Record<string, unknown>;
|
|
258
221
|
|
|
259
222
|
/**
|
|
260
|
-
*
|
|
223
|
+
* API response for retrieving Query Suggestions configurations.
|
|
261
224
|
*/
|
|
262
|
-
type
|
|
263
|
-
|
|
225
|
+
type ConfigurationResponse = AppID & ConfigurationWithIndex;
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Type of log entry. - `SKIP`. A query is skipped because it doesn\'t match the conditions for successful inclusion. For example, when a query doesn\'t generate enough search results. - `INFO`. An informative log entry. - `ERROR`. The Query Suggestions process encountered an error.
|
|
229
|
+
*/
|
|
230
|
+
type LogLevel = 'ERROR' | 'INFO' | 'SKIP';
|
|
231
|
+
|
|
232
|
+
type LogFile = {
|
|
233
|
+
/**
|
|
234
|
+
* Date and time of the log entry, in RFC 3339 format.
|
|
235
|
+
*/
|
|
236
|
+
timestamp?: string;
|
|
237
|
+
level?: LogLevel;
|
|
238
|
+
/**
|
|
239
|
+
* Details about this log entry.
|
|
240
|
+
*/
|
|
241
|
+
message?: string;
|
|
242
|
+
/**
|
|
243
|
+
* Level indicating the position of a suggestion in a hierarchy of records. For example, a `contextLevel` of 1 indicates that this suggestion belongs to a previous suggestion with `contextLevel` 0.
|
|
244
|
+
*/
|
|
245
|
+
contextLevel?: number;
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
declare const apiClientVersion = "5.3.0";
|
|
249
|
+
declare const REGIONS: readonly ["eu", "us"];
|
|
250
|
+
type Region = (typeof REGIONS)[number];
|
|
251
|
+
declare function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }: CreateClientOptions & {
|
|
252
|
+
region: Region;
|
|
253
|
+
}): {
|
|
264
254
|
transporter: _algolia_client_common.Transporter;
|
|
255
|
+
/**
|
|
256
|
+
* The `appId` currently in use.
|
|
257
|
+
*/
|
|
265
258
|
appId: string;
|
|
259
|
+
/**
|
|
260
|
+
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
261
|
+
*/
|
|
266
262
|
clearCache(): Promise<void>;
|
|
267
|
-
|
|
263
|
+
/**
|
|
264
|
+
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
265
|
+
*/
|
|
266
|
+
readonly _ua: string;
|
|
267
|
+
/**
|
|
268
|
+
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
|
269
|
+
*
|
|
270
|
+
* @param segment - The algolia agent (user-agent) segment to add.
|
|
271
|
+
* @param version - The version of the agent.
|
|
272
|
+
*/
|
|
268
273
|
addAlgoliaAgent(segment: string, version?: string): void;
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
274
|
+
/**
|
|
275
|
+
* Helper method to switch the API key used to authenticate the requests.
|
|
276
|
+
*
|
|
277
|
+
* @param params - Method params.
|
|
278
|
+
* @param params.apiKey - The new API Key to use.
|
|
279
|
+
*/
|
|
280
|
+
setClientApiKey({ apiKey }: {
|
|
281
|
+
apiKey: string;
|
|
282
|
+
}): void;
|
|
283
|
+
/**
|
|
284
|
+
* Creates a new Query Suggestions configuration. You can have up to 100 configurations per Algolia application.
|
|
285
|
+
*
|
|
286
|
+
* Required API Key ACLs:
|
|
287
|
+
* - editSettings.
|
|
288
|
+
*
|
|
289
|
+
* @param configurationWithIndex - The configurationWithIndex object.
|
|
290
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
291
|
+
*/
|
|
292
|
+
createConfig(configurationWithIndex: ConfigurationWithIndex, requestOptions?: RequestOptions): Promise<BaseResponse>;
|
|
293
|
+
/**
|
|
294
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
295
|
+
*
|
|
296
|
+
* @param customDelete - The customDelete object.
|
|
297
|
+
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
298
|
+
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
299
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
300
|
+
*/
|
|
301
|
+
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
302
|
+
/**
|
|
303
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
304
|
+
*
|
|
305
|
+
* @param customGet - The customGet object.
|
|
306
|
+
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
307
|
+
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
308
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
309
|
+
*/
|
|
310
|
+
customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
311
|
+
/**
|
|
312
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
313
|
+
*
|
|
314
|
+
* @param customPost - The customPost object.
|
|
315
|
+
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
316
|
+
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
317
|
+
* @param customPost.body - Parameters to send with the custom request.
|
|
318
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
319
|
+
*/
|
|
320
|
+
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
321
|
+
/**
|
|
322
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
323
|
+
*
|
|
324
|
+
* @param customPut - The customPut object.
|
|
325
|
+
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
326
|
+
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
327
|
+
* @param customPut.body - Parameters to send with the custom request.
|
|
328
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
329
|
+
*/
|
|
330
|
+
customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
331
|
+
/**
|
|
332
|
+
* Deletes a Query Suggestions configuration. Deleting only removes the configuration and stops updates to the Query Suggestions index. To delete the Query Suggestions index itself, use the Search API and the `Delete an index` operation.
|
|
333
|
+
*
|
|
334
|
+
* Required API Key ACLs:
|
|
335
|
+
* - editSettings.
|
|
336
|
+
*
|
|
337
|
+
* @param deleteConfig - The deleteConfig object.
|
|
338
|
+
* @param deleteConfig.indexName - Query Suggestions index name.
|
|
339
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
340
|
+
*/
|
|
341
|
+
deleteConfig({ indexName }: DeleteConfigProps, requestOptions?: RequestOptions): Promise<BaseResponse>;
|
|
342
|
+
/**
|
|
343
|
+
* Retrieves all Query Suggestions configurations of your Algolia application.
|
|
344
|
+
*
|
|
345
|
+
* Required API Key ACLs:
|
|
346
|
+
* - settings.
|
|
347
|
+
*
|
|
348
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
349
|
+
*/
|
|
350
|
+
getAllConfigs(requestOptions?: RequestOptions): Promise<ConfigurationResponse[]>;
|
|
351
|
+
/**
|
|
352
|
+
* Retrieves a single Query Suggestions configuration by its index name.
|
|
353
|
+
*
|
|
354
|
+
* Required API Key ACLs:
|
|
355
|
+
* - settings.
|
|
356
|
+
*
|
|
357
|
+
* @param getConfig - The getConfig object.
|
|
358
|
+
* @param getConfig.indexName - Query Suggestions index name.
|
|
359
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
360
|
+
*/
|
|
361
|
+
getConfig({ indexName }: GetConfigProps, requestOptions?: RequestOptions): Promise<ConfigurationResponse>;
|
|
362
|
+
/**
|
|
363
|
+
* Reports the status of a Query Suggestions index.
|
|
364
|
+
*
|
|
365
|
+
* Required API Key ACLs:
|
|
366
|
+
* - settings.
|
|
367
|
+
*
|
|
368
|
+
* @param getConfigStatus - The getConfigStatus object.
|
|
369
|
+
* @param getConfigStatus.indexName - Query Suggestions index name.
|
|
370
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
371
|
+
*/
|
|
372
|
+
getConfigStatus({ indexName }: GetConfigStatusProps, requestOptions?: RequestOptions): Promise<ConfigStatus>;
|
|
373
|
+
/**
|
|
374
|
+
* Retrieves the logs for a single Query Suggestions index.
|
|
375
|
+
*
|
|
376
|
+
* Required API Key ACLs:
|
|
377
|
+
* - settings.
|
|
378
|
+
*
|
|
379
|
+
* @param getLogFile - The getLogFile object.
|
|
380
|
+
* @param getLogFile.indexName - Query Suggestions index name.
|
|
381
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
382
|
+
*/
|
|
383
|
+
getLogFile({ indexName }: GetLogFileProps, requestOptions?: RequestOptions): Promise<LogFile>;
|
|
384
|
+
/**
|
|
385
|
+
* Updates a QuerySuggestions configuration.
|
|
386
|
+
*
|
|
387
|
+
* Required API Key ACLs:
|
|
388
|
+
* - editSettings.
|
|
389
|
+
*
|
|
390
|
+
* @param updateConfig - The updateConfig object.
|
|
391
|
+
* @param updateConfig.indexName - Query Suggestions index name.
|
|
392
|
+
* @param updateConfig.configuration - The configuration object.
|
|
393
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
394
|
+
*/
|
|
395
|
+
updateConfig({ indexName, configuration }: UpdateConfigProps, requestOptions?: RequestOptions): Promise<BaseResponse>;
|
|
280
396
|
};
|
|
281
397
|
|
|
398
|
+
/**
|
|
399
|
+
* Error.
|
|
400
|
+
*/
|
|
401
|
+
type ErrorBase = Record<string, any> & {
|
|
402
|
+
message?: string;
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
type QuerySuggestionsClient = ReturnType<typeof createQuerySuggestionsClient>;
|
|
406
|
+
|
|
407
|
+
declare function querySuggestionsClient(appId: string, apiKey: string, region: Region, options?: ClientOptions): QuerySuggestionsClient;
|
|
408
|
+
|
|
282
409
|
export { type AppID, type BaseResponse, type ConfigStatus, type Configuration, type ConfigurationResponse, type ConfigurationWithIndex, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type DeleteConfigProps, type ErrorBase, type Facet, type GetConfigProps, type GetConfigStatusProps, type GetLogFileProps, type Languages, type LogFile, type LogLevel, type QuerySuggestionsClient, type Region, type SourceIndex, type UpdateConfigProps, apiClientVersion, querySuggestionsClient };
|
package/dist/node.d.ts
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import * as _algolia_client_common from '@algolia/client-common';
|
|
2
|
-
import { ClientOptions } from '@algolia/client-common';
|
|
3
|
-
|
|
4
|
-
type AppID = {
|
|
5
|
-
/**
|
|
6
|
-
* Algolia application ID to which this Query Suggestions configuration belongs.
|
|
7
|
-
*/
|
|
8
|
-
appID?: string;
|
|
9
|
-
};
|
|
2
|
+
import { CreateClientOptions, RequestOptions, ClientOptions } from '@algolia/client-common';
|
|
10
3
|
|
|
11
4
|
type BaseResponse = {
|
|
12
5
|
/**
|
|
@@ -19,29 +12,6 @@ type BaseResponse = {
|
|
|
19
12
|
message?: string;
|
|
20
13
|
};
|
|
21
14
|
|
|
22
|
-
type ConfigStatus = {
|
|
23
|
-
/**
|
|
24
|
-
* Name of the Query Suggestions index (case-sensitive).
|
|
25
|
-
*/
|
|
26
|
-
indexName?: string;
|
|
27
|
-
/**
|
|
28
|
-
* Whether the creation or update of the Query Suggestions index is in progress.
|
|
29
|
-
*/
|
|
30
|
-
isRunning?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Date and time when the Query Suggestions index was last built, in RFC 3339 format.
|
|
33
|
-
*/
|
|
34
|
-
lastBuiltAt?: string;
|
|
35
|
-
/**
|
|
36
|
-
* Date and time when the Query Suggestions index was last updated successfully.
|
|
37
|
-
*/
|
|
38
|
-
lastSuccessfulBuiltAt?: string;
|
|
39
|
-
/**
|
|
40
|
-
* Duration of the last successful build in seconds.
|
|
41
|
-
*/
|
|
42
|
-
lastSuccessfulBuildDuration?: string;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
15
|
/**
|
|
46
16
|
* Languages for deduplicating singular and plural suggestions. If specified, only the more popular form is included.
|
|
47
17
|
*/
|
|
@@ -107,44 +77,6 @@ type Configuration = {
|
|
|
107
77
|
allowSpecialCharacters?: boolean;
|
|
108
78
|
};
|
|
109
79
|
|
|
110
|
-
/**
|
|
111
|
-
* Query Suggestions configuration.
|
|
112
|
-
*/
|
|
113
|
-
type ConfigurationWithIndex = Configuration & Record<string, unknown>;
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* API response for retrieving Query Suggestions configurations.
|
|
117
|
-
*/
|
|
118
|
-
type ConfigurationResponse = AppID & ConfigurationWithIndex;
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Error.
|
|
122
|
-
*/
|
|
123
|
-
type ErrorBase = Record<string, any> & {
|
|
124
|
-
message?: string;
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Type of log entry. - `SKIP`. A query is skipped because it doesn\'t match the conditions for successful inclusion. For example, when a query doesn\'t generate enough search results. - `INFO`. An informative log entry. - `ERROR`. The Query Suggestions process encountered an error.
|
|
129
|
-
*/
|
|
130
|
-
type LogLevel = 'ERROR' | 'INFO' | 'SKIP';
|
|
131
|
-
|
|
132
|
-
type LogFile = {
|
|
133
|
-
/**
|
|
134
|
-
* Date and time of the log entry, in RFC 3339 format.
|
|
135
|
-
*/
|
|
136
|
-
timestamp?: string;
|
|
137
|
-
level?: LogLevel;
|
|
138
|
-
/**
|
|
139
|
-
* Details about this log entry.
|
|
140
|
-
*/
|
|
141
|
-
message?: string;
|
|
142
|
-
/**
|
|
143
|
-
* Level indicating the position of a suggestion in a hierarchy of records. For example, a `contextLevel` of 1 indicates that this suggestion belongs to a previous suggestion with `contextLevel` 0.
|
|
144
|
-
*/
|
|
145
|
-
contextLevel?: number;
|
|
146
|
-
};
|
|
147
|
-
|
|
148
80
|
/**
|
|
149
81
|
* Properties for the `customDelete` method.
|
|
150
82
|
*/
|
|
@@ -252,31 +184,226 @@ type UpdateConfigProps = {
|
|
|
252
184
|
configuration: Configuration;
|
|
253
185
|
};
|
|
254
186
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
187
|
+
type ConfigStatus = {
|
|
188
|
+
/**
|
|
189
|
+
* Name of the Query Suggestions index (case-sensitive).
|
|
190
|
+
*/
|
|
191
|
+
indexName?: string;
|
|
192
|
+
/**
|
|
193
|
+
* Whether the creation or update of the Query Suggestions index is in progress.
|
|
194
|
+
*/
|
|
195
|
+
isRunning?: boolean;
|
|
196
|
+
/**
|
|
197
|
+
* Date and time when the Query Suggestions index was last built, in RFC 3339 format.
|
|
198
|
+
*/
|
|
199
|
+
lastBuiltAt?: string;
|
|
200
|
+
/**
|
|
201
|
+
* Date and time when the Query Suggestions index was last updated successfully.
|
|
202
|
+
*/
|
|
203
|
+
lastSuccessfulBuiltAt?: string;
|
|
204
|
+
/**
|
|
205
|
+
* Duration of the last successful build in seconds.
|
|
206
|
+
*/
|
|
207
|
+
lastSuccessfulBuildDuration?: string;
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
type AppID = {
|
|
211
|
+
/**
|
|
212
|
+
* Algolia application ID to which this Query Suggestions configuration belongs.
|
|
213
|
+
*/
|
|
214
|
+
appID?: string;
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Query Suggestions configuration.
|
|
219
|
+
*/
|
|
220
|
+
type ConfigurationWithIndex = Configuration & Record<string, unknown>;
|
|
258
221
|
|
|
259
222
|
/**
|
|
260
|
-
*
|
|
223
|
+
* API response for retrieving Query Suggestions configurations.
|
|
261
224
|
*/
|
|
262
|
-
type
|
|
263
|
-
|
|
225
|
+
type ConfigurationResponse = AppID & ConfigurationWithIndex;
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Type of log entry. - `SKIP`. A query is skipped because it doesn\'t match the conditions for successful inclusion. For example, when a query doesn\'t generate enough search results. - `INFO`. An informative log entry. - `ERROR`. The Query Suggestions process encountered an error.
|
|
229
|
+
*/
|
|
230
|
+
type LogLevel = 'ERROR' | 'INFO' | 'SKIP';
|
|
231
|
+
|
|
232
|
+
type LogFile = {
|
|
233
|
+
/**
|
|
234
|
+
* Date and time of the log entry, in RFC 3339 format.
|
|
235
|
+
*/
|
|
236
|
+
timestamp?: string;
|
|
237
|
+
level?: LogLevel;
|
|
238
|
+
/**
|
|
239
|
+
* Details about this log entry.
|
|
240
|
+
*/
|
|
241
|
+
message?: string;
|
|
242
|
+
/**
|
|
243
|
+
* Level indicating the position of a suggestion in a hierarchy of records. For example, a `contextLevel` of 1 indicates that this suggestion belongs to a previous suggestion with `contextLevel` 0.
|
|
244
|
+
*/
|
|
245
|
+
contextLevel?: number;
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
declare const apiClientVersion = "5.3.0";
|
|
249
|
+
declare const REGIONS: readonly ["eu", "us"];
|
|
250
|
+
type Region = (typeof REGIONS)[number];
|
|
251
|
+
declare function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }: CreateClientOptions & {
|
|
252
|
+
region: Region;
|
|
253
|
+
}): {
|
|
264
254
|
transporter: _algolia_client_common.Transporter;
|
|
255
|
+
/**
|
|
256
|
+
* The `appId` currently in use.
|
|
257
|
+
*/
|
|
265
258
|
appId: string;
|
|
259
|
+
/**
|
|
260
|
+
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
261
|
+
*/
|
|
266
262
|
clearCache(): Promise<void>;
|
|
267
|
-
|
|
263
|
+
/**
|
|
264
|
+
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
265
|
+
*/
|
|
266
|
+
readonly _ua: string;
|
|
267
|
+
/**
|
|
268
|
+
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
|
269
|
+
*
|
|
270
|
+
* @param segment - The algolia agent (user-agent) segment to add.
|
|
271
|
+
* @param version - The version of the agent.
|
|
272
|
+
*/
|
|
268
273
|
addAlgoliaAgent(segment: string, version?: string): void;
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
274
|
+
/**
|
|
275
|
+
* Helper method to switch the API key used to authenticate the requests.
|
|
276
|
+
*
|
|
277
|
+
* @param params - Method params.
|
|
278
|
+
* @param params.apiKey - The new API Key to use.
|
|
279
|
+
*/
|
|
280
|
+
setClientApiKey({ apiKey }: {
|
|
281
|
+
apiKey: string;
|
|
282
|
+
}): void;
|
|
283
|
+
/**
|
|
284
|
+
* Creates a new Query Suggestions configuration. You can have up to 100 configurations per Algolia application.
|
|
285
|
+
*
|
|
286
|
+
* Required API Key ACLs:
|
|
287
|
+
* - editSettings.
|
|
288
|
+
*
|
|
289
|
+
* @param configurationWithIndex - The configurationWithIndex object.
|
|
290
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
291
|
+
*/
|
|
292
|
+
createConfig(configurationWithIndex: ConfigurationWithIndex, requestOptions?: RequestOptions): Promise<BaseResponse>;
|
|
293
|
+
/**
|
|
294
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
295
|
+
*
|
|
296
|
+
* @param customDelete - The customDelete object.
|
|
297
|
+
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
298
|
+
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
299
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
300
|
+
*/
|
|
301
|
+
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
302
|
+
/**
|
|
303
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
304
|
+
*
|
|
305
|
+
* @param customGet - The customGet object.
|
|
306
|
+
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
307
|
+
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
308
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
309
|
+
*/
|
|
310
|
+
customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
311
|
+
/**
|
|
312
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
313
|
+
*
|
|
314
|
+
* @param customPost - The customPost object.
|
|
315
|
+
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
316
|
+
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
317
|
+
* @param customPost.body - Parameters to send with the custom request.
|
|
318
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
319
|
+
*/
|
|
320
|
+
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
321
|
+
/**
|
|
322
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
323
|
+
*
|
|
324
|
+
* @param customPut - The customPut object.
|
|
325
|
+
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
326
|
+
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
327
|
+
* @param customPut.body - Parameters to send with the custom request.
|
|
328
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
329
|
+
*/
|
|
330
|
+
customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
331
|
+
/**
|
|
332
|
+
* Deletes a Query Suggestions configuration. Deleting only removes the configuration and stops updates to the Query Suggestions index. To delete the Query Suggestions index itself, use the Search API and the `Delete an index` operation.
|
|
333
|
+
*
|
|
334
|
+
* Required API Key ACLs:
|
|
335
|
+
* - editSettings.
|
|
336
|
+
*
|
|
337
|
+
* @param deleteConfig - The deleteConfig object.
|
|
338
|
+
* @param deleteConfig.indexName - Query Suggestions index name.
|
|
339
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
340
|
+
*/
|
|
341
|
+
deleteConfig({ indexName }: DeleteConfigProps, requestOptions?: RequestOptions): Promise<BaseResponse>;
|
|
342
|
+
/**
|
|
343
|
+
* Retrieves all Query Suggestions configurations of your Algolia application.
|
|
344
|
+
*
|
|
345
|
+
* Required API Key ACLs:
|
|
346
|
+
* - settings.
|
|
347
|
+
*
|
|
348
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
349
|
+
*/
|
|
350
|
+
getAllConfigs(requestOptions?: RequestOptions): Promise<ConfigurationResponse[]>;
|
|
351
|
+
/**
|
|
352
|
+
* Retrieves a single Query Suggestions configuration by its index name.
|
|
353
|
+
*
|
|
354
|
+
* Required API Key ACLs:
|
|
355
|
+
* - settings.
|
|
356
|
+
*
|
|
357
|
+
* @param getConfig - The getConfig object.
|
|
358
|
+
* @param getConfig.indexName - Query Suggestions index name.
|
|
359
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
360
|
+
*/
|
|
361
|
+
getConfig({ indexName }: GetConfigProps, requestOptions?: RequestOptions): Promise<ConfigurationResponse>;
|
|
362
|
+
/**
|
|
363
|
+
* Reports the status of a Query Suggestions index.
|
|
364
|
+
*
|
|
365
|
+
* Required API Key ACLs:
|
|
366
|
+
* - settings.
|
|
367
|
+
*
|
|
368
|
+
* @param getConfigStatus - The getConfigStatus object.
|
|
369
|
+
* @param getConfigStatus.indexName - Query Suggestions index name.
|
|
370
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
371
|
+
*/
|
|
372
|
+
getConfigStatus({ indexName }: GetConfigStatusProps, requestOptions?: RequestOptions): Promise<ConfigStatus>;
|
|
373
|
+
/**
|
|
374
|
+
* Retrieves the logs for a single Query Suggestions index.
|
|
375
|
+
*
|
|
376
|
+
* Required API Key ACLs:
|
|
377
|
+
* - settings.
|
|
378
|
+
*
|
|
379
|
+
* @param getLogFile - The getLogFile object.
|
|
380
|
+
* @param getLogFile.indexName - Query Suggestions index name.
|
|
381
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
382
|
+
*/
|
|
383
|
+
getLogFile({ indexName }: GetLogFileProps, requestOptions?: RequestOptions): Promise<LogFile>;
|
|
384
|
+
/**
|
|
385
|
+
* Updates a QuerySuggestions configuration.
|
|
386
|
+
*
|
|
387
|
+
* Required API Key ACLs:
|
|
388
|
+
* - editSettings.
|
|
389
|
+
*
|
|
390
|
+
* @param updateConfig - The updateConfig object.
|
|
391
|
+
* @param updateConfig.indexName - Query Suggestions index name.
|
|
392
|
+
* @param updateConfig.configuration - The configuration object.
|
|
393
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
394
|
+
*/
|
|
395
|
+
updateConfig({ indexName, configuration }: UpdateConfigProps, requestOptions?: RequestOptions): Promise<BaseResponse>;
|
|
280
396
|
};
|
|
281
397
|
|
|
398
|
+
/**
|
|
399
|
+
* Error.
|
|
400
|
+
*/
|
|
401
|
+
type ErrorBase = Record<string, any> & {
|
|
402
|
+
message?: string;
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
type QuerySuggestionsClient = ReturnType<typeof createQuerySuggestionsClient>;
|
|
406
|
+
|
|
407
|
+
declare function querySuggestionsClient(appId: string, apiKey: string, region: Region, options?: ClientOptions): QuerySuggestionsClient;
|
|
408
|
+
|
|
282
409
|
export { type AppID, type BaseResponse, type ConfigStatus, type Configuration, type ConfigurationResponse, type ConfigurationWithIndex, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type DeleteConfigProps, type ErrorBase, type Facet, type GetConfigProps, type GetConfigStatusProps, type GetLogFileProps, type Languages, type LogFile, type LogLevel, type QuerySuggestionsClient, type Region, type SourceIndex, type UpdateConfigProps, apiClientVersion, querySuggestionsClient };
|