@algolia/client-query-suggestions 5.6.1 → 5.8.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/README.md +5 -7
- package/dist/browser.d.ts +90 -94
- package/dist/builds/browser.js +12 -23
- 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 +2 -2
- package/dist/builds/fetch.js +9 -20
- package/dist/builds/fetch.js.map +1 -1
- package/dist/builds/node.cjs +9 -20
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +10 -21
- package/dist/builds/node.js.map +1 -1
- package/dist/fetch.d.ts +89 -92
- package/dist/node.d.cts +89 -92
- package/dist/node.d.ts +89 -92
- package/dist/src/querySuggestionsClient.cjs +8 -19
- package/dist/src/querySuggestionsClient.cjs.map +1 -1
- package/dist/src/querySuggestionsClient.js +8 -19
- package/dist/src/querySuggestionsClient.js.map +1 -1
- package/index.js +1 -1
- package/model/clientMethodProps.ts +5 -5
- package/model/configuration.ts +2 -2
- package/model/configurationWithIndex.ts +1 -1
- package/model/index.ts +1 -1
- package/model/languages.ts +1 -1
- package/model/logLevel.ts +1 -1
- package/model/sourceIndex.ts +4 -4
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -32,19 +32,17 @@
|
|
|
32
32
|
|
|
33
33
|
## 💡 Getting Started
|
|
34
34
|
|
|
35
|
-
|
|
36
35
|
To get started, you first need to install @algolia/client-query-suggestions (or any other available API client package).
|
|
37
36
|
All of our clients comes with type definition, and are available for both browser and node environments.
|
|
38
37
|
|
|
39
38
|
### With a package manager
|
|
40
39
|
|
|
41
|
-
|
|
42
40
|
```bash
|
|
43
|
-
yarn add @algolia/client-query-suggestions@5.
|
|
41
|
+
yarn add @algolia/client-query-suggestions@5.8.0
|
|
44
42
|
# or
|
|
45
|
-
npm install @algolia/client-query-suggestions@5.
|
|
43
|
+
npm install @algolia/client-query-suggestions@5.8.0
|
|
46
44
|
# or
|
|
47
|
-
pnpm add @algolia/client-query-suggestions@5.
|
|
45
|
+
pnpm add @algolia/client-query-suggestions@5.8.0
|
|
48
46
|
```
|
|
49
47
|
|
|
50
48
|
### Without a package manager
|
|
@@ -52,7 +50,7 @@ pnpm add @algolia/client-query-suggestions@5.6.1
|
|
|
52
50
|
Add the following JavaScript snippet to the <head> of your website:
|
|
53
51
|
|
|
54
52
|
```html
|
|
55
|
-
<script src="https://cdn.jsdelivr.net/npm/@algolia/client-query-suggestions@5.
|
|
53
|
+
<script src="https://cdn.jsdelivr.net/npm/@algolia/client-query-suggestions@5.8.0/dist/builds/browser.umd.js"></script>
|
|
56
54
|
```
|
|
57
55
|
|
|
58
56
|
### Usage
|
|
@@ -73,4 +71,4 @@ Encountering an issue? Before reaching out to support, we recommend heading to o
|
|
|
73
71
|
|
|
74
72
|
## 📄 License
|
|
75
73
|
|
|
76
|
-
The Algolia JavaScript API Client is an open-sourced software licensed under the [MIT license](LICENSE).
|
|
74
|
+
The Algolia JavaScript API Client is an open-sourced software licensed under the [MIT license](LICENSE).
|
package/dist/browser.d.ts
CHANGED
|
@@ -12,10 +12,40 @@ type BaseResponse = {
|
|
|
12
12
|
message?: string;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
+
type ConfigStatus = {
|
|
16
|
+
/**
|
|
17
|
+
* Name of the Query Suggestions index (case-sensitive).
|
|
18
|
+
*/
|
|
19
|
+
indexName?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Whether the creation or update of the Query Suggestions index is in progress.
|
|
22
|
+
*/
|
|
23
|
+
isRunning?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Date and time when the Query Suggestions index was last built, in RFC 3339 format.
|
|
26
|
+
*/
|
|
27
|
+
lastBuiltAt?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Date and time when the Query Suggestions index was last updated successfully.
|
|
30
|
+
*/
|
|
31
|
+
lastSuccessfulBuiltAt?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Duration of the last successful build in seconds.
|
|
34
|
+
*/
|
|
35
|
+
lastSuccessfulBuildDuration?: string;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
type AppID = {
|
|
39
|
+
/**
|
|
40
|
+
* Algolia application ID to which this Query Suggestions configuration belongs.
|
|
41
|
+
*/
|
|
42
|
+
appID?: string;
|
|
43
|
+
};
|
|
44
|
+
|
|
15
45
|
/**
|
|
16
46
|
* Languages for deduplicating singular and plural suggestions. If specified, only the more popular form is included.
|
|
17
47
|
*/
|
|
18
|
-
type Languages = string
|
|
48
|
+
type Languages = Array<string> | boolean;
|
|
19
49
|
|
|
20
50
|
/**
|
|
21
51
|
* Facet to use as category.
|
|
@@ -43,8 +73,8 @@ type SourceIndex = {
|
|
|
43
73
|
* If true, Query Suggestions uses all replica indices to find popular searches. If false, only the primary index is used.
|
|
44
74
|
*/
|
|
45
75
|
replicas?: boolean;
|
|
46
|
-
analyticsTags?: string
|
|
47
|
-
facets?: Facet
|
|
76
|
+
analyticsTags?: Array<string> | null;
|
|
77
|
+
facets?: Array<Facet> | null;
|
|
48
78
|
/**
|
|
49
79
|
* Minimum number of hits required to be included as a suggestion. A search query must at least generate `minHits` search results to be included in the Query Suggestions index.
|
|
50
80
|
*/
|
|
@@ -53,8 +83,8 @@ type SourceIndex = {
|
|
|
53
83
|
* Minimum letters required to be included as a suggestion. A search query must be at least `minLetters` long to be included in the Query Suggestions index.
|
|
54
84
|
*/
|
|
55
85
|
minLetters?: number;
|
|
56
|
-
generate?: string
|
|
57
|
-
external?: string
|
|
86
|
+
generate?: Array<Array<string>> | null;
|
|
87
|
+
external?: Array<string> | null;
|
|
58
88
|
};
|
|
59
89
|
|
|
60
90
|
/**
|
|
@@ -64,9 +94,9 @@ type Configuration = {
|
|
|
64
94
|
/**
|
|
65
95
|
* Algolia indices from which to get the popular searches for query suggestions.
|
|
66
96
|
*/
|
|
67
|
-
sourceIndices: SourceIndex
|
|
97
|
+
sourceIndices: Array<SourceIndex>;
|
|
68
98
|
languages?: Languages;
|
|
69
|
-
exclude?: string
|
|
99
|
+
exclude?: Array<string> | null;
|
|
70
100
|
/**
|
|
71
101
|
* Whether to turn on personalized query suggestions.
|
|
72
102
|
*/
|
|
@@ -77,6 +107,37 @@ type Configuration = {
|
|
|
77
107
|
allowSpecialCharacters?: boolean;
|
|
78
108
|
};
|
|
79
109
|
|
|
110
|
+
/**
|
|
111
|
+
* Query Suggestions configuration.
|
|
112
|
+
*/
|
|
113
|
+
type ConfigurationWithIndex = Record<string, unknown> & Configuration;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* API response for retrieving Query Suggestions configurations.
|
|
117
|
+
*/
|
|
118
|
+
type ConfigurationResponse = AppID & ConfigurationWithIndex;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* 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.
|
|
122
|
+
*/
|
|
123
|
+
type LogLevel = 'SKIP' | 'INFO' | 'ERROR';
|
|
124
|
+
|
|
125
|
+
type LogFile = {
|
|
126
|
+
/**
|
|
127
|
+
* Date and time of the log entry, in RFC 3339 format.
|
|
128
|
+
*/
|
|
129
|
+
timestamp?: string;
|
|
130
|
+
level?: LogLevel;
|
|
131
|
+
/**
|
|
132
|
+
* Details about this log entry.
|
|
133
|
+
*/
|
|
134
|
+
message?: string;
|
|
135
|
+
/**
|
|
136
|
+
* 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.
|
|
137
|
+
*/
|
|
138
|
+
contextLevel?: number;
|
|
139
|
+
};
|
|
140
|
+
|
|
80
141
|
/**
|
|
81
142
|
* Properties for the `customDelete` method.
|
|
82
143
|
*/
|
|
@@ -88,7 +149,9 @@ type CustomDeleteProps = {
|
|
|
88
149
|
/**
|
|
89
150
|
* Query parameters to apply to the current query.
|
|
90
151
|
*/
|
|
91
|
-
parameters?:
|
|
152
|
+
parameters?: {
|
|
153
|
+
[key: string]: any;
|
|
154
|
+
};
|
|
92
155
|
};
|
|
93
156
|
/**
|
|
94
157
|
* Properties for the `customGet` method.
|
|
@@ -101,7 +164,9 @@ type CustomGetProps = {
|
|
|
101
164
|
/**
|
|
102
165
|
* Query parameters to apply to the current query.
|
|
103
166
|
*/
|
|
104
|
-
parameters?:
|
|
167
|
+
parameters?: {
|
|
168
|
+
[key: string]: any;
|
|
169
|
+
};
|
|
105
170
|
};
|
|
106
171
|
/**
|
|
107
172
|
* Properties for the `customPost` method.
|
|
@@ -114,7 +179,9 @@ type CustomPostProps = {
|
|
|
114
179
|
/**
|
|
115
180
|
* Query parameters to apply to the current query.
|
|
116
181
|
*/
|
|
117
|
-
parameters?:
|
|
182
|
+
parameters?: {
|
|
183
|
+
[key: string]: any;
|
|
184
|
+
};
|
|
118
185
|
/**
|
|
119
186
|
* Parameters to send with the custom request.
|
|
120
187
|
*/
|
|
@@ -131,7 +198,9 @@ type CustomPutProps = {
|
|
|
131
198
|
/**
|
|
132
199
|
* Query parameters to apply to the current query.
|
|
133
200
|
*/
|
|
134
|
-
parameters?:
|
|
201
|
+
parameters?: {
|
|
202
|
+
[key: string]: any;
|
|
203
|
+
};
|
|
135
204
|
/**
|
|
136
205
|
* Parameters to send with the custom request.
|
|
137
206
|
*/
|
|
@@ -184,68 +253,7 @@ type UpdateConfigProps = {
|
|
|
184
253
|
configuration: Configuration;
|
|
185
254
|
};
|
|
186
255
|
|
|
187
|
-
|
|
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>;
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* API response for retrieving Query Suggestions configurations.
|
|
224
|
-
*/
|
|
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.6.1";
|
|
256
|
+
declare const apiClientVersion = "5.8.0";
|
|
249
257
|
declare const REGIONS: readonly ["eu", "us"];
|
|
250
258
|
type Region = (typeof REGIONS)[number];
|
|
251
259
|
declare function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }: CreateClientOptions & {
|
|
@@ -284,15 +292,13 @@ declare function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiK
|
|
|
284
292
|
* Creates a new Query Suggestions configuration. You can have up to 100 configurations per Algolia application.
|
|
285
293
|
*
|
|
286
294
|
* Required API Key ACLs:
|
|
287
|
-
*
|
|
288
|
-
*
|
|
295
|
+
* - editSettings
|
|
289
296
|
* @param configurationWithIndex - The configurationWithIndex object.
|
|
290
297
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
291
298
|
*/
|
|
292
299
|
createConfig(configurationWithIndex: ConfigurationWithIndex, requestOptions?: RequestOptions): Promise<BaseResponse>;
|
|
293
300
|
/**
|
|
294
301
|
* This method allow you to send requests to the Algolia REST API.
|
|
295
|
-
*
|
|
296
302
|
* @param customDelete - The customDelete object.
|
|
297
303
|
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
298
304
|
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
@@ -301,7 +307,6 @@ declare function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiK
|
|
|
301
307
|
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
302
308
|
/**
|
|
303
309
|
* This method allow you to send requests to the Algolia REST API.
|
|
304
|
-
*
|
|
305
310
|
* @param customGet - The customGet object.
|
|
306
311
|
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
307
312
|
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
@@ -310,7 +315,6 @@ declare function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiK
|
|
|
310
315
|
customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
311
316
|
/**
|
|
312
317
|
* This method allow you to send requests to the Algolia REST API.
|
|
313
|
-
*
|
|
314
318
|
* @param customPost - The customPost object.
|
|
315
319
|
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
316
320
|
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
@@ -320,7 +324,6 @@ declare function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiK
|
|
|
320
324
|
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
321
325
|
/**
|
|
322
326
|
* This method allow you to send requests to the Algolia REST API.
|
|
323
|
-
*
|
|
324
327
|
* @param customPut - The customPut object.
|
|
325
328
|
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
326
329
|
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
@@ -332,8 +335,7 @@ declare function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiK
|
|
|
332
335
|
* 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
336
|
*
|
|
334
337
|
* Required API Key ACLs:
|
|
335
|
-
*
|
|
336
|
-
*
|
|
338
|
+
* - editSettings
|
|
337
339
|
* @param deleteConfig - The deleteConfig object.
|
|
338
340
|
* @param deleteConfig.indexName - Query Suggestions index name.
|
|
339
341
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -343,17 +345,15 @@ declare function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiK
|
|
|
343
345
|
* Retrieves all Query Suggestions configurations of your Algolia application.
|
|
344
346
|
*
|
|
345
347
|
* Required API Key ACLs:
|
|
346
|
-
*
|
|
347
|
-
*
|
|
348
|
+
* - settings
|
|
348
349
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
349
350
|
*/
|
|
350
|
-
getAllConfigs(requestOptions?: RequestOptions): Promise<ConfigurationResponse
|
|
351
|
+
getAllConfigs(requestOptions?: RequestOptions): Promise<Array<ConfigurationResponse>>;
|
|
351
352
|
/**
|
|
352
353
|
* Retrieves a single Query Suggestions configuration by its index name.
|
|
353
354
|
*
|
|
354
355
|
* Required API Key ACLs:
|
|
355
|
-
*
|
|
356
|
-
*
|
|
356
|
+
* - settings
|
|
357
357
|
* @param getConfig - The getConfig object.
|
|
358
358
|
* @param getConfig.indexName - Query Suggestions index name.
|
|
359
359
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -363,8 +363,7 @@ declare function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiK
|
|
|
363
363
|
* Reports the status of a Query Suggestions index.
|
|
364
364
|
*
|
|
365
365
|
* Required API Key ACLs:
|
|
366
|
-
*
|
|
367
|
-
*
|
|
366
|
+
* - settings
|
|
368
367
|
* @param getConfigStatus - The getConfigStatus object.
|
|
369
368
|
* @param getConfigStatus.indexName - Query Suggestions index name.
|
|
370
369
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -374,8 +373,7 @@ declare function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiK
|
|
|
374
373
|
* Retrieves the logs for a single Query Suggestions index.
|
|
375
374
|
*
|
|
376
375
|
* Required API Key ACLs:
|
|
377
|
-
*
|
|
378
|
-
*
|
|
376
|
+
* - settings
|
|
379
377
|
* @param getLogFile - The getLogFile object.
|
|
380
378
|
* @param getLogFile.indexName - Query Suggestions index name.
|
|
381
379
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -385,8 +383,7 @@ declare function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiK
|
|
|
385
383
|
* Updates a QuerySuggestions configuration.
|
|
386
384
|
*
|
|
387
385
|
* Required API Key ACLs:
|
|
388
|
-
*
|
|
389
|
-
*
|
|
386
|
+
* - editSettings
|
|
390
387
|
* @param updateConfig - The updateConfig object.
|
|
391
388
|
* @param updateConfig.indexName - Query Suggestions index name.
|
|
392
389
|
* @param updateConfig.configuration - The configuration object.
|
|
@@ -402,8 +399,7 @@ type ErrorBase = Record<string, any> & {
|
|
|
402
399
|
message?: string;
|
|
403
400
|
};
|
|
404
401
|
|
|
405
|
-
type QuerySuggestionsClient = ReturnType<typeof createQuerySuggestionsClient>;
|
|
406
|
-
|
|
407
402
|
declare function querySuggestionsClient(appId: string, apiKey: string, region: Region, options?: ClientOptions): QuerySuggestionsClient;
|
|
403
|
+
type QuerySuggestionsClient = ReturnType<typeof createQuerySuggestionsClient>;
|
|
408
404
|
|
|
409
405
|
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/builds/browser.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
// builds/browser.ts
|
|
2
|
+
import { createXhrRequester } from "@algolia/requester-browser-xhr";
|
|
2
3
|
import {
|
|
3
|
-
createNullLogger,
|
|
4
|
-
createMemoryCache,
|
|
5
|
-
createFallbackableCache,
|
|
6
4
|
createBrowserLocalStorageCache,
|
|
5
|
+
createFallbackableCache,
|
|
6
|
+
createMemoryCache,
|
|
7
|
+
createNullLogger,
|
|
7
8
|
DEFAULT_CONNECT_TIMEOUT_BROWSER,
|
|
8
9
|
DEFAULT_READ_TIMEOUT_BROWSER,
|
|
9
10
|
DEFAULT_WRITE_TIMEOUT_BROWSER
|
|
10
11
|
} from "@algolia/client-common";
|
|
11
|
-
import { createXhrRequester } from "@algolia/requester-browser-xhr";
|
|
12
12
|
|
|
13
13
|
// src/querySuggestionsClient.ts
|
|
14
14
|
import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common";
|
|
15
|
-
var apiClientVersion = "5.
|
|
15
|
+
var apiClientVersion = "5.8.0";
|
|
16
16
|
var REGIONS = ["eu", "us"];
|
|
17
17
|
function getDefaultHosts(region) {
|
|
18
18
|
const url = "query-suggestions.{region}.algolia.com".replace("{region}", region);
|
|
@@ -89,8 +89,7 @@ function createQuerySuggestionsClient({
|
|
|
89
89
|
* Creates a new Query Suggestions configuration. You can have up to 100 configurations per Algolia application.
|
|
90
90
|
*
|
|
91
91
|
* Required API Key ACLs:
|
|
92
|
-
*
|
|
93
|
-
*
|
|
92
|
+
* - editSettings
|
|
94
93
|
* @param configurationWithIndex - The configurationWithIndex object.
|
|
95
94
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
96
95
|
*/
|
|
@@ -112,7 +111,6 @@ function createQuerySuggestionsClient({
|
|
|
112
111
|
},
|
|
113
112
|
/**
|
|
114
113
|
* This method allow you to send requests to the Algolia REST API.
|
|
115
|
-
*
|
|
116
114
|
* @param customDelete - The customDelete object.
|
|
117
115
|
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
118
116
|
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
@@ -135,7 +133,6 @@ function createQuerySuggestionsClient({
|
|
|
135
133
|
},
|
|
136
134
|
/**
|
|
137
135
|
* This method allow you to send requests to the Algolia REST API.
|
|
138
|
-
*
|
|
139
136
|
* @param customGet - The customGet object.
|
|
140
137
|
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
141
138
|
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
@@ -158,7 +155,6 @@ function createQuerySuggestionsClient({
|
|
|
158
155
|
},
|
|
159
156
|
/**
|
|
160
157
|
* This method allow you to send requests to the Algolia REST API.
|
|
161
|
-
*
|
|
162
158
|
* @param customPost - The customPost object.
|
|
163
159
|
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
164
160
|
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
@@ -183,7 +179,6 @@ function createQuerySuggestionsClient({
|
|
|
183
179
|
},
|
|
184
180
|
/**
|
|
185
181
|
* This method allow you to send requests to the Algolia REST API.
|
|
186
|
-
*
|
|
187
182
|
* @param customPut - The customPut object.
|
|
188
183
|
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
189
184
|
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
@@ -210,8 +205,7 @@ function createQuerySuggestionsClient({
|
|
|
210
205
|
* 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.
|
|
211
206
|
*
|
|
212
207
|
* Required API Key ACLs:
|
|
213
|
-
*
|
|
214
|
-
*
|
|
208
|
+
* - editSettings
|
|
215
209
|
* @param deleteConfig - The deleteConfig object.
|
|
216
210
|
* @param deleteConfig.indexName - Query Suggestions index name.
|
|
217
211
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -235,8 +229,7 @@ function createQuerySuggestionsClient({
|
|
|
235
229
|
* Retrieves all Query Suggestions configurations of your Algolia application.
|
|
236
230
|
*
|
|
237
231
|
* Required API Key ACLs:
|
|
238
|
-
*
|
|
239
|
-
*
|
|
232
|
+
* - settings
|
|
240
233
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
241
234
|
*/
|
|
242
235
|
getAllConfigs(requestOptions) {
|
|
@@ -255,8 +248,7 @@ function createQuerySuggestionsClient({
|
|
|
255
248
|
* Retrieves a single Query Suggestions configuration by its index name.
|
|
256
249
|
*
|
|
257
250
|
* Required API Key ACLs:
|
|
258
|
-
*
|
|
259
|
-
*
|
|
251
|
+
* - settings
|
|
260
252
|
* @param getConfig - The getConfig object.
|
|
261
253
|
* @param getConfig.indexName - Query Suggestions index name.
|
|
262
254
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -280,8 +272,7 @@ function createQuerySuggestionsClient({
|
|
|
280
272
|
* Reports the status of a Query Suggestions index.
|
|
281
273
|
*
|
|
282
274
|
* Required API Key ACLs:
|
|
283
|
-
*
|
|
284
|
-
*
|
|
275
|
+
* - settings
|
|
285
276
|
* @param getConfigStatus - The getConfigStatus object.
|
|
286
277
|
* @param getConfigStatus.indexName - Query Suggestions index name.
|
|
287
278
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -305,8 +296,7 @@ function createQuerySuggestionsClient({
|
|
|
305
296
|
* Retrieves the logs for a single Query Suggestions index.
|
|
306
297
|
*
|
|
307
298
|
* Required API Key ACLs:
|
|
308
|
-
*
|
|
309
|
-
*
|
|
299
|
+
* - settings
|
|
310
300
|
* @param getLogFile - The getLogFile object.
|
|
311
301
|
* @param getLogFile.indexName - Query Suggestions index name.
|
|
312
302
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -330,8 +320,7 @@ function createQuerySuggestionsClient({
|
|
|
330
320
|
* Updates a QuerySuggestions configuration.
|
|
331
321
|
*
|
|
332
322
|
* Required API Key ACLs:
|
|
333
|
-
*
|
|
334
|
-
*
|
|
323
|
+
* - editSettings
|
|
335
324
|
* @param updateConfig - The updateConfig object.
|
|
336
325
|
* @param updateConfig.indexName - Query Suggestions index name.
|
|
337
326
|
* @param updateConfig.configuration - The configuration object.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../builds/browser.ts","../../src/querySuggestionsClient.ts"],"sourcesContent":["// 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.\n\nimport type { ClientOptions } from '@algolia/client-common';\nimport {\n createNullLogger,\n createMemoryCache,\n createFallbackableCache,\n createBrowserLocalStorageCache,\n DEFAULT_CONNECT_TIMEOUT_BROWSER,\n DEFAULT_READ_TIMEOUT_BROWSER,\n DEFAULT_WRITE_TIMEOUT_BROWSER,\n} from '@algolia/client-common';\nimport { createXhrRequester } from '@algolia/requester-browser-xhr';\n\nimport type { Region } from '../src/querySuggestionsClient';\nimport { createQuerySuggestionsClient, apiClientVersion, REGIONS } from '../src/querySuggestionsClient';\n\nexport type QuerySuggestionsClient = ReturnType<typeof createQuerySuggestionsClient>;\n\nexport { apiClientVersion, Region } from '../src/querySuggestionsClient';\nexport * from '../model';\n\nexport function querySuggestionsClient(\n appId: string,\n apiKey: string,\n region: Region,\n options?: ClientOptions,\n): QuerySuggestionsClient {\n if (!appId || typeof appId !== 'string') {\n throw new Error('`appId` is missing.');\n }\n\n if (!apiKey || typeof apiKey !== 'string') {\n throw new Error('`apiKey` is missing.');\n }\n\n if (!region || (region && (typeof region !== 'string' || !REGIONS.includes(region)))) {\n throw new Error(`\\`region\\` is required and must be one of the following: ${REGIONS.join(', ')}`);\n }\n\n return createQuerySuggestionsClient({\n appId,\n apiKey,\n region,\n timeouts: {\n connect: DEFAULT_CONNECT_TIMEOUT_BROWSER,\n read: DEFAULT_READ_TIMEOUT_BROWSER,\n write: DEFAULT_WRITE_TIMEOUT_BROWSER,\n },\n logger: createNullLogger(),\n requester: createXhrRequester(),\n algoliaAgents: [{ segment: 'Browser' }],\n authMode: 'WithinQueryParameters',\n responsesCache: createMemoryCache(),\n requestsCache: createMemoryCache({ serializable: false }),\n hostsCache: createFallbackableCache({\n caches: [createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }), createMemoryCache()],\n }),\n ...options,\n });\n}\n","// 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.\n\nimport { createAuth, createTransporter, getAlgoliaAgent } from '@algolia/client-common';\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\n\nimport type { BaseResponse } from '../model/baseResponse';\nimport type {\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteConfigProps,\n GetConfigProps,\n GetConfigStatusProps,\n GetLogFileProps,\n UpdateConfigProps,\n} from '../model/clientMethodProps';\nimport type { ConfigStatus } from '../model/configStatus';\nimport type { ConfigurationResponse } from '../model/configurationResponse';\nimport type { ConfigurationWithIndex } from '../model/configurationWithIndex';\nimport type { LogFile } from '../model/logFile';\n\nexport const apiClientVersion = '5.6.1';\n\nexport const REGIONS = ['eu', 'us'] as const;\nexport type Region = (typeof REGIONS)[number];\n\nfunction getDefaultHosts(region: Region): Host[] {\n const url = 'query-suggestions.{region}.algolia.com'.replace('{region}', region);\n\n return [{ url, accept: 'readWrite', protocol: 'https' }];\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function createQuerySuggestionsClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n region: regionOption,\n ...options\n}: CreateClientOptions & { region: Region }) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(regionOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'QuerySuggestions',\n version: apiClientVersion,\n }),\n baseHeaders: {\n 'content-type': 'text/plain',\n ...auth.headers(),\n ...options.baseHeaders,\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters,\n },\n });\n\n return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * Helper method to switch the API key used to authenticate the requests.\n *\n * @param params - Method params.\n * @param params.apiKey - The new API Key to use.\n */\n setClientApiKey({ apiKey }: { apiKey: string }): void {\n if (!authMode || authMode === 'WithinHeaders') {\n transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n } else {\n transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;\n }\n },\n\n /**\n * Creates a new Query Suggestions configuration. You can have up to 100 configurations per Algolia application.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param configurationWithIndex - The configurationWithIndex object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n createConfig(\n configurationWithIndex: ConfigurationWithIndex,\n requestOptions?: RequestOptions,\n ): Promise<BaseResponse> {\n if (!configurationWithIndex) {\n throw new Error('Parameter `configurationWithIndex` is required when calling `createConfig`.');\n }\n\n const requestPath = '/1/configs';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: configurationWithIndex,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customDelete.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customDelete(\n { path, parameters }: CustomDeleteProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customDelete`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customGet.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customGet`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPut.parameters - Query parameters to apply to the current query.\n * @param customPut.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPut(\n { path, parameters, body }: CustomPutProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPut`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * 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.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param deleteConfig - The deleteConfig object.\n * @param deleteConfig.indexName - Query Suggestions index name.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteConfig({ indexName }: DeleteConfigProps, requestOptions?: RequestOptions): Promise<BaseResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `deleteConfig`.');\n }\n\n const requestPath = '/1/configs/{indexName}'.replace('{indexName}', encodeURIComponent(indexName));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves all Query Suggestions configurations of your Algolia application.\n *\n * Required API Key ACLs:\n * - settings.\n *\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getAllConfigs(requestOptions?: RequestOptions): Promise<ConfigurationResponse[]> {\n const requestPath = '/1/configs';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves a single Query Suggestions configuration by its index name.\n *\n * Required API Key ACLs:\n * - settings.\n *\n * @param getConfig - The getConfig object.\n * @param getConfig.indexName - Query Suggestions index name.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getConfig({ indexName }: GetConfigProps, requestOptions?: RequestOptions): Promise<ConfigurationResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `getConfig`.');\n }\n\n const requestPath = '/1/configs/{indexName}'.replace('{indexName}', encodeURIComponent(indexName));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Reports the status of a Query Suggestions index.\n *\n * Required API Key ACLs:\n * - settings.\n *\n * @param getConfigStatus - The getConfigStatus object.\n * @param getConfigStatus.indexName - Query Suggestions index name.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getConfigStatus({ indexName }: GetConfigStatusProps, requestOptions?: RequestOptions): Promise<ConfigStatus> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `getConfigStatus`.');\n }\n\n const requestPath = '/1/configs/{indexName}/status'.replace('{indexName}', encodeURIComponent(indexName));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves the logs for a single Query Suggestions index.\n *\n * Required API Key ACLs:\n * - settings.\n *\n * @param getLogFile - The getLogFile object.\n * @param getLogFile.indexName - Query Suggestions index name.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getLogFile({ indexName }: GetLogFileProps, requestOptions?: RequestOptions): Promise<LogFile> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `getLogFile`.');\n }\n\n const requestPath = '/1/logs/{indexName}'.replace('{indexName}', encodeURIComponent(indexName));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Updates a QuerySuggestions configuration.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param updateConfig - The updateConfig object.\n * @param updateConfig.indexName - Query Suggestions index name.\n * @param updateConfig.configuration - The configuration object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n updateConfig(\n { indexName, configuration }: UpdateConfigProps,\n requestOptions?: RequestOptions,\n ): Promise<BaseResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `updateConfig`.');\n }\n\n if (!configuration) {\n throw new Error('Parameter `configuration` is required when calling `updateConfig`.');\n }\n\n if (!configuration.sourceIndices) {\n throw new Error('Parameter `configuration.sourceIndices` is required when calling `updateConfig`.');\n }\n\n const requestPath = '/1/configs/{indexName}'.replace('{indexName}', encodeURIComponent(indexName));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: configuration,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";AAGA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,0BAA0B;;;ACVnC,SAAS,YAAY,mBAAmB,uBAAuB;AA2BxD,IAAM,mBAAmB;AAEzB,IAAM,UAAU,CAAC,MAAM,IAAI;AAGlC,SAAS,gBAAgB,QAAwB;AAC/C,QAAM,MAAM,yCAAyC,QAAQ,YAAY,MAAM;AAE/E,SAAO,CAAC,EAAE,KAAK,QAAQ,aAAa,UAAU,QAAQ,CAAC;AACzD;AAGO,SAAS,6BAA6B;AAAA,EAC3C,OAAO;AAAA,EACP,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,QAAQ;AAA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AAQ,KAAK,IAAI,CAAC,EAAE;AAAA,EAClG;AAEA,SAAO,6BAA6B;AAAA,IAClC;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,MACR,SAAS;AAAA,MACT,MAAM;AAAA,MACN,OAAO;AAAA,IACT;AAAA,IACA,QAAQ,iBAAiB;AAAA,IACzB,WAAW,mBAAmB;AAAA,IAC9B,eAAe,CAAC,EAAE,SAAS,UAAU,CAAC;AAAA,IACtC,UAAU;AAAA,IACV,gBAAgB,kBAAkB;AAAA,IAClC,eAAe,kBAAkB,EAAE,cAAc,MAAM,CAAC;AAAA,IACxD,YAAY,wBAAwB;AAAA,MAClC,QAAQ,CAAC,+BAA+B,EAAE,KAAK,GAAG,gBAAgB,IAAI,KAAK,GAAG,CAAC,GAAG,kBAAkB,CAAC;AAAA,IACvG,CAAC;AAAA,IACD,GAAG;AAAA,EACL,CAAC;AACH;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../builds/browser.ts","../../src/querySuggestionsClient.ts"],"sourcesContent":["// 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.\n\nimport { createXhrRequester } from '@algolia/requester-browser-xhr';\n\nimport {\n ClientOptions,\n createBrowserLocalStorageCache,\n createFallbackableCache,\n createMemoryCache,\n createNullLogger,\n DEFAULT_CONNECT_TIMEOUT_BROWSER,\n DEFAULT_READ_TIMEOUT_BROWSER,\n DEFAULT_WRITE_TIMEOUT_BROWSER,\n} from '@algolia/client-common';\n\nimport { apiClientVersion, createQuerySuggestionsClient } from '../src/querySuggestionsClient';\n\nimport { Region, REGIONS } from '../src/querySuggestionsClient';\n\nexport * from '../model';\nexport { apiClientVersion, Region } from '../src/querySuggestionsClient';\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function querySuggestionsClient(\n appId: string,\n apiKey: string,\n region: Region,\n options?: ClientOptions,\n): QuerySuggestionsClient {\n if (!appId || typeof appId !== 'string') {\n throw new Error('`appId` is missing.');\n }\n\n if (!apiKey || typeof apiKey !== 'string') {\n throw new Error('`apiKey` is missing.');\n }\n\n if (!region || (region && (typeof region !== 'string' || !REGIONS.includes(region)))) {\n throw new Error(`\\`region\\` is required and must be one of the following: ${REGIONS.join(', ')}`);\n }\n\n return createQuerySuggestionsClient({\n appId,\n apiKey,\n region,\n timeouts: {\n connect: DEFAULT_CONNECT_TIMEOUT_BROWSER,\n read: DEFAULT_READ_TIMEOUT_BROWSER,\n write: DEFAULT_WRITE_TIMEOUT_BROWSER,\n },\n logger: createNullLogger(),\n requester: createXhrRequester(),\n algoliaAgents: [{ segment: 'Browser' }],\n authMode: 'WithinQueryParameters',\n responsesCache: createMemoryCache(),\n requestsCache: createMemoryCache({ serializable: false }),\n hostsCache: createFallbackableCache({\n caches: [createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }), createMemoryCache()],\n }),\n ...options,\n });\n}\n\nexport type QuerySuggestionsClient = ReturnType<typeof createQuerySuggestionsClient>;\n","// 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.\n\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\nimport { createAuth, createTransporter, getAlgoliaAgent } from '@algolia/client-common';\n\nimport type { BaseResponse } from '../model/baseResponse';\nimport type { ConfigStatus } from '../model/configStatus';\n\nimport type { ConfigurationResponse } from '../model/configurationResponse';\nimport type { ConfigurationWithIndex } from '../model/configurationWithIndex';\n\nimport type { LogFile } from '../model/logFile';\n\nimport type {\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteConfigProps,\n GetConfigProps,\n GetConfigStatusProps,\n GetLogFileProps,\n UpdateConfigProps,\n} from '../model/clientMethodProps';\n\nexport const apiClientVersion = '5.8.0';\n\nexport const REGIONS = ['eu', 'us'] as const;\nexport type Region = (typeof REGIONS)[number];\n\nfunction getDefaultHosts(region: Region): Host[] {\n const url = 'query-suggestions.{region}.algolia.com'.replace('{region}', region);\n\n return [{ url, accept: 'readWrite', protocol: 'https' }];\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function createQuerySuggestionsClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n region: regionOption,\n ...options\n}: CreateClientOptions & { region: Region }) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(regionOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'QuerySuggestions',\n version: apiClientVersion,\n }),\n baseHeaders: {\n 'content-type': 'text/plain',\n ...auth.headers(),\n ...options.baseHeaders,\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters,\n },\n });\n\n return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * Helper method to switch the API key used to authenticate the requests.\n *\n * @param params - Method params.\n * @param params.apiKey - The new API Key to use.\n */\n setClientApiKey({ apiKey }: { apiKey: string }): void {\n if (!authMode || authMode === 'WithinHeaders') {\n transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n } else {\n transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;\n }\n },\n\n /**\n * Creates a new Query Suggestions configuration. You can have up to 100 configurations per Algolia application.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param configurationWithIndex - The configurationWithIndex object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n createConfig(\n configurationWithIndex: ConfigurationWithIndex,\n requestOptions?: RequestOptions,\n ): Promise<BaseResponse> {\n if (!configurationWithIndex) {\n throw new Error('Parameter `configurationWithIndex` is required when calling `createConfig`.');\n }\n\n const requestPath = '/1/configs';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: configurationWithIndex,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customDelete.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customDelete(\n { path, parameters }: CustomDeleteProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customDelete`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customGet.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customGet`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPut.parameters - Query parameters to apply to the current query.\n * @param customPut.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPut(\n { path, parameters, body }: CustomPutProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPut`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * 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.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param deleteConfig - The deleteConfig object.\n * @param deleteConfig.indexName - Query Suggestions index name.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteConfig({ indexName }: DeleteConfigProps, requestOptions?: RequestOptions): Promise<BaseResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `deleteConfig`.');\n }\n\n const requestPath = '/1/configs/{indexName}'.replace('{indexName}', encodeURIComponent(indexName));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves all Query Suggestions configurations of your Algolia application.\n *\n * Required API Key ACLs:\n * - settings\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getAllConfigs(requestOptions?: RequestOptions): Promise<Array<ConfigurationResponse>> {\n const requestPath = '/1/configs';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves a single Query Suggestions configuration by its index name.\n *\n * Required API Key ACLs:\n * - settings\n * @param getConfig - The getConfig object.\n * @param getConfig.indexName - Query Suggestions index name.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getConfig({ indexName }: GetConfigProps, requestOptions?: RequestOptions): Promise<ConfigurationResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `getConfig`.');\n }\n\n const requestPath = '/1/configs/{indexName}'.replace('{indexName}', encodeURIComponent(indexName));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Reports the status of a Query Suggestions index.\n *\n * Required API Key ACLs:\n * - settings\n * @param getConfigStatus - The getConfigStatus object.\n * @param getConfigStatus.indexName - Query Suggestions index name.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getConfigStatus({ indexName }: GetConfigStatusProps, requestOptions?: RequestOptions): Promise<ConfigStatus> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `getConfigStatus`.');\n }\n\n const requestPath = '/1/configs/{indexName}/status'.replace('{indexName}', encodeURIComponent(indexName));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves the logs for a single Query Suggestions index.\n *\n * Required API Key ACLs:\n * - settings\n * @param getLogFile - The getLogFile object.\n * @param getLogFile.indexName - Query Suggestions index name.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getLogFile({ indexName }: GetLogFileProps, requestOptions?: RequestOptions): Promise<LogFile> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `getLogFile`.');\n }\n\n const requestPath = '/1/logs/{indexName}'.replace('{indexName}', encodeURIComponent(indexName));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Updates a QuerySuggestions configuration.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param updateConfig - The updateConfig object.\n * @param updateConfig.indexName - Query Suggestions index name.\n * @param updateConfig.configuration - The configuration object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n updateConfig(\n { indexName, configuration }: UpdateConfigProps,\n requestOptions?: RequestOptions,\n ): Promise<BaseResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `updateConfig`.');\n }\n\n if (!configuration) {\n throw new Error('Parameter `configuration` is required when calling `updateConfig`.');\n }\n\n if (!configuration.sourceIndices) {\n throw new Error('Parameter `configuration.sourceIndices` is required when calling `updateConfig`.');\n }\n\n const requestPath = '/1/configs/{indexName}'.replace('{indexName}', encodeURIComponent(indexName));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: configuration,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";AAEA,SAAS,0BAA0B;AAEnC;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACHP,SAAS,YAAY,mBAAmB,uBAAuB;AAsBxD,IAAM,mBAAmB;AAEzB,IAAM,UAAU,CAAC,MAAM,IAAI;AAGlC,SAAS,gBAAgB,QAAwB;AAC/C,QAAM,MAAM,yCAAyC,QAAQ,YAAY,MAAM;AAE/E,SAAO,CAAC,EAAE,KAAK,QAAQ,aAAa,UAAU,QAAQ,CAAC;AACzD;AAGO,SAAS,6BAA6B;AAAA,EAC3C,OAAO;AAAA,EACP,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,GAAG;AACL,GAA6C;AAC3C,QAAM,OAAO,WAAW,aAAa,cAAc,QAAQ;AAC3D,QAAM,cAAc,kBAAkB;AAAA,IACpC,OAAO,gBAAgB,YAAY;AAAA,IACnC,GAAG;AAAA,IACH,cAAc,gBAAgB;AAAA,MAC5B;AAAA,MACA,QAAQ;AAAA,MACR,SAAS;AAAA,IACX,CAAC;AAAA,IACD,aAAa;AAAA,MACX,gBAAgB;AAAA,MAChB,GAAG,KAAK,QAAQ;AAAA,MAChB,GAAG,QAAQ;AAAA,IACb;AAAA,IACA,qBAAqB;AAAA,MACnB,GAAG,KAAK,gBAAgB;AAAA,MACxB,GAAG,QAAQ;AAAA,IACb;AAAA,EACF,CAAC;AAED,SAAO;AAAA,IACL;AAAA;AAAA;AAAA;AAAA,IAKA,OAAO;AAAA;AAAA;AAAA;A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