@algolia/client-query-suggestions 5.0.0-beta.1 → 5.0.0-beta.11
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/LICENSE +21 -0
- package/dist/builds/browser.d.ts +12 -12
- package/dist/builds/node.d.ts +12 -12
- package/dist/client-query-suggestions.cjs +13 -13
- package/dist/client-query-suggestions.esm.browser.js +23 -30
- package/dist/client-query-suggestions.esm.node.js +13 -13
- package/dist/client-query-suggestions.umd.js +2 -2
- package/dist/model/clientMethodProps.d.ts +2 -2
- package/dist/model/clientMethodProps.d.ts.map +1 -1
- package/dist/model/{querySuggestionsConfiguration.d.ts → configuration.d.ts} +2 -2
- package/dist/model/configuration.d.ts.map +1 -0
- package/dist/model/configurationResponse.d.ts +7 -0
- package/dist/model/configurationResponse.d.ts.map +1 -0
- package/dist/model/configurationWithIndex.d.ts +6 -0
- package/dist/model/configurationWithIndex.d.ts.map +1 -0
- package/dist/model/index.d.ts +3 -3
- package/dist/model/index.d.ts.map +1 -1
- package/dist/src/querySuggestionsClient.d.ts +9 -9
- package/dist/src/querySuggestionsClient.d.ts.map +1 -1
- package/model/clientMethodProps.ts +2 -2
- package/model/{querySuggestionsConfiguration.ts → configuration.ts} +1 -1
- package/model/{querySuggestionsConfigurationResponse.ts → configurationResponse.ts} +2 -3
- package/model/{querySuggestionsConfigurationWithIndex.ts → configurationWithIndex.ts} +2 -3
- package/model/index.ts +3 -3
- package/package.json +11 -8
- package/dist/model/querySuggestionsConfiguration.d.ts.map +0 -1
- package/dist/model/querySuggestionsConfigurationResponse.d.ts +0 -7
- package/dist/model/querySuggestionsConfigurationResponse.d.ts.map +0 -1
- package/dist/model/querySuggestionsConfigurationWithIndex.d.ts +0 -6
- package/dist/model/querySuggestionsConfigurationWithIndex.d.ts.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2013-Present Algolia
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/builds/browser.d.ts
CHANGED
|
@@ -11,17 +11,17 @@ export declare function querySuggestionsClient(appId: string, apiKey: string, re
|
|
|
11
11
|
appId: string;
|
|
12
12
|
clearCache(): Promise<void>;
|
|
13
13
|
readonly _ua: string;
|
|
14
|
-
addAlgoliaAgent(segment: string, version?: string
|
|
15
|
-
createConfig(
|
|
16
|
-
customDelete({ path, parameters }: import("../model").CustomDeleteProps, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
17
|
-
customGet({ path, parameters }: import("../model").CustomGetProps, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
18
|
-
customPost({ path, parameters, body }: import("../model").CustomPostProps, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
19
|
-
customPut({ path, parameters, body }: import("../model").CustomPutProps, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
20
|
-
deleteConfig({ indexName }: import("../model").DeleteConfigProps, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
21
|
-
getAllConfigs(requestOptions?: import("@algolia/client-common").RequestOptions
|
|
22
|
-
getConfig({ indexName }: import("../model").GetConfigProps, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
23
|
-
getConfigStatus({ indexName }: import("../model").GetConfigStatusProps, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
24
|
-
getLogFile({ indexName }: import("../model").GetLogFileProps, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
25
|
-
updateConfig({ indexName,
|
|
14
|
+
addAlgoliaAgent(segment: string, version?: string): void;
|
|
15
|
+
createConfig(configurationWithIndex: import("../model").ConfigurationWithIndex, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").BaseResponse>;
|
|
16
|
+
customDelete({ path, parameters }: import("../model").CustomDeleteProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
|
|
17
|
+
customGet({ path, parameters }: import("../model").CustomGetProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
|
|
18
|
+
customPost({ path, parameters, body }: import("../model").CustomPostProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
|
|
19
|
+
customPut({ path, parameters, body }: import("../model").CustomPutProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
|
|
20
|
+
deleteConfig({ indexName }: import("../model").DeleteConfigProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").BaseResponse>;
|
|
21
|
+
getAllConfigs(requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").ConfigurationResponse[]>;
|
|
22
|
+
getConfig({ indexName }: import("../model").GetConfigProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").ConfigurationResponse>;
|
|
23
|
+
getConfigStatus({ indexName }: import("../model").GetConfigStatusProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").GetConfigStatus200Response>;
|
|
24
|
+
getLogFile({ indexName }: import("../model").GetLogFileProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").GetLogFile200Response>;
|
|
25
|
+
updateConfig({ indexName, configuration }: import("../model").UpdateConfigProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").BaseResponse>;
|
|
26
26
|
};
|
|
27
27
|
//# sourceMappingURL=browser.d.ts.map
|
package/dist/builds/node.d.ts
CHANGED
|
@@ -11,17 +11,17 @@ export declare function querySuggestionsClient(appId: string, apiKey: string, re
|
|
|
11
11
|
appId: string;
|
|
12
12
|
clearCache(): Promise<void>;
|
|
13
13
|
_ua: string;
|
|
14
|
-
addAlgoliaAgent(segment: string, version?: string
|
|
15
|
-
createConfig(
|
|
16
|
-
customDelete({ path, parameters }: import("../model").CustomDeleteProps, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
17
|
-
customGet({ path, parameters }: import("../model").CustomGetProps, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
18
|
-
customPost({ path, parameters, body }: import("../model").CustomPostProps, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
19
|
-
customPut({ path, parameters, body }: import("../model").CustomPutProps, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
20
|
-
deleteConfig({ indexName }: import("../model").DeleteConfigProps, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
21
|
-
getAllConfigs(requestOptions?: import("@algolia/client-common").RequestOptions
|
|
22
|
-
getConfig({ indexName }: import("../model").GetConfigProps, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
23
|
-
getConfigStatus({ indexName }: import("../model").GetConfigStatusProps, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
24
|
-
getLogFile({ indexName }: import("../model").GetLogFileProps, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
25
|
-
updateConfig({ indexName,
|
|
14
|
+
addAlgoliaAgent(segment: string, version?: string): void;
|
|
15
|
+
createConfig(configurationWithIndex: import("../model").ConfigurationWithIndex, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").BaseResponse>;
|
|
16
|
+
customDelete({ path, parameters }: import("../model").CustomDeleteProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
|
|
17
|
+
customGet({ path, parameters }: import("../model").CustomGetProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
|
|
18
|
+
customPost({ path, parameters, body }: import("../model").CustomPostProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
|
|
19
|
+
customPut({ path, parameters, body }: import("../model").CustomPutProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
|
|
20
|
+
deleteConfig({ indexName }: import("../model").DeleteConfigProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").BaseResponse>;
|
|
21
|
+
getAllConfigs(requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").ConfigurationResponse[]>;
|
|
22
|
+
getConfig({ indexName }: import("../model").GetConfigProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").ConfigurationResponse>;
|
|
23
|
+
getConfigStatus({ indexName }: import("../model").GetConfigStatusProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").GetConfigStatus200Response>;
|
|
24
|
+
getLogFile({ indexName }: import("../model").GetLogFileProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").GetLogFile200Response>;
|
|
25
|
+
updateConfig({ indexName, configuration }: import("../model").UpdateConfigProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").BaseResponse>;
|
|
26
26
|
};
|
|
27
27
|
//# sourceMappingURL=node.d.ts.map
|
|
@@ -4,7 +4,7 @@ var clientCommon = require('@algolia/client-common');
|
|
|
4
4
|
var requesterNodeHttp = require('@algolia/requester-node-http');
|
|
5
5
|
|
|
6
6
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
|
7
|
-
const apiClientVersion = '5.0.0-beta.
|
|
7
|
+
const apiClientVersion = '5.0.0-beta.11';
|
|
8
8
|
const REGIONS = ['eu', 'us'];
|
|
9
9
|
function getDefaultHosts(region) {
|
|
10
10
|
const url = 'query-suggestions.{region}.algolia.com'.replace('{region}', region);
|
|
@@ -67,12 +67,12 @@ function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
67
67
|
* Required API Key ACLs:
|
|
68
68
|
* - editSettings.
|
|
69
69
|
*
|
|
70
|
-
* @param
|
|
70
|
+
* @param configurationWithIndex - The configurationWithIndex object.
|
|
71
71
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
72
72
|
*/
|
|
73
|
-
createConfig(
|
|
74
|
-
if (!
|
|
75
|
-
throw new Error('Parameter `
|
|
73
|
+
createConfig(configurationWithIndex, requestOptions) {
|
|
74
|
+
if (!configurationWithIndex) {
|
|
75
|
+
throw new Error('Parameter `configurationWithIndex` is required when calling `createConfig`.');
|
|
76
76
|
}
|
|
77
77
|
const requestPath = '/1/configs';
|
|
78
78
|
const headers = {};
|
|
@@ -82,7 +82,7 @@ function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
82
82
|
path: requestPath,
|
|
83
83
|
queryParameters,
|
|
84
84
|
headers,
|
|
85
|
-
data:
|
|
85
|
+
data: configurationWithIndex,
|
|
86
86
|
};
|
|
87
87
|
return transporter.request(request, requestOptions);
|
|
88
88
|
},
|
|
@@ -310,18 +310,18 @@ function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
310
310
|
*
|
|
311
311
|
* @param updateConfig - The updateConfig object.
|
|
312
312
|
* @param updateConfig.indexName - Query Suggestions index name.
|
|
313
|
-
* @param updateConfig.
|
|
313
|
+
* @param updateConfig.configuration - The configuration object.
|
|
314
314
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
315
315
|
*/
|
|
316
|
-
updateConfig({ indexName,
|
|
316
|
+
updateConfig({ indexName, configuration }, requestOptions) {
|
|
317
317
|
if (!indexName) {
|
|
318
318
|
throw new Error('Parameter `indexName` is required when calling `updateConfig`.');
|
|
319
319
|
}
|
|
320
|
-
if (!
|
|
321
|
-
throw new Error('Parameter `
|
|
320
|
+
if (!configuration) {
|
|
321
|
+
throw new Error('Parameter `configuration` is required when calling `updateConfig`.');
|
|
322
322
|
}
|
|
323
|
-
if (!
|
|
324
|
-
throw new Error('Parameter `
|
|
323
|
+
if (!configuration.sourceIndices) {
|
|
324
|
+
throw new Error('Parameter `configuration.sourceIndices` is required when calling `updateConfig`.');
|
|
325
325
|
}
|
|
326
326
|
const requestPath = '/1/configs/{indexName}'.replace('{indexName}', encodeURIComponent(indexName));
|
|
327
327
|
const headers = {};
|
|
@@ -331,7 +331,7 @@ function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
331
331
|
path: requestPath,
|
|
332
332
|
queryParameters,
|
|
333
333
|
headers,
|
|
334
|
-
data:
|
|
334
|
+
data: configuration,
|
|
335
335
|
};
|
|
336
336
|
return transporter.request(request, requestOptions);
|
|
337
337
|
},
|
|
@@ -195,6 +195,14 @@ function createStatefulHost(host, status = 'up') {
|
|
|
195
195
|
};
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
+
function _defineProperty(e, r, t) {
|
|
199
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
200
|
+
value: t,
|
|
201
|
+
enumerable: !0,
|
|
202
|
+
configurable: !0,
|
|
203
|
+
writable: !0
|
|
204
|
+
}) : e[r] = t, e;
|
|
205
|
+
}
|
|
198
206
|
function _toPrimitive(t, r) {
|
|
199
207
|
if ("object" != typeof t || !t) return t;
|
|
200
208
|
var e = t[Symbol.toPrimitive];
|
|
@@ -209,20 +217,6 @@ function _toPropertyKey(t) {
|
|
|
209
217
|
var i = _toPrimitive(t, "string");
|
|
210
218
|
return "symbol" == typeof i ? i : i + "";
|
|
211
219
|
}
|
|
212
|
-
function _defineProperty(obj, key, value) {
|
|
213
|
-
key = _toPropertyKey(key);
|
|
214
|
-
if (key in obj) {
|
|
215
|
-
Object.defineProperty(obj, key, {
|
|
216
|
-
value: value,
|
|
217
|
-
enumerable: true,
|
|
218
|
-
configurable: true,
|
|
219
|
-
writable: true
|
|
220
|
-
});
|
|
221
|
-
} else {
|
|
222
|
-
obj[key] = value;
|
|
223
|
-
}
|
|
224
|
-
return obj;
|
|
225
|
-
}
|
|
226
220
|
|
|
227
221
|
class AlgoliaError extends Error {
|
|
228
222
|
constructor(message, name) {
|
|
@@ -243,7 +237,7 @@ class ErrorWithStackTrace extends AlgoliaError {
|
|
|
243
237
|
}
|
|
244
238
|
class RetryError extends ErrorWithStackTrace {
|
|
245
239
|
constructor(stackTrace) {
|
|
246
|
-
super('Unreachable hosts - your application id may be incorrect. If the error persists, please
|
|
240
|
+
super('Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.', stackTrace, 'RetryError');
|
|
247
241
|
}
|
|
248
242
|
}
|
|
249
243
|
class ApiError extends ErrorWithStackTrace {
|
|
@@ -277,8 +271,7 @@ function serializeUrl(host, path, queryParameters) {
|
|
|
277
271
|
return url;
|
|
278
272
|
}
|
|
279
273
|
function serializeQueryParameters(parameters) {
|
|
280
|
-
|
|
281
|
-
return Object.keys(parameters).map(key => `${key}=${encodeURIComponent(isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key]).replaceAll('+', '%20')}`).join('&');
|
|
274
|
+
return Object.keys(parameters).filter(key => parameters[key] !== undefined).sort().map(key => `${key}=${encodeURIComponent(Object.prototype.toString.call(parameters[key]) === '[object Array]' ? parameters[key].join(',') : parameters[key]).replaceAll('+', '%20')}`).join('&');
|
|
282
275
|
}
|
|
283
276
|
function serializeData(request, requestOptions) {
|
|
284
277
|
if (request.method === 'GET' || request.data === undefined && requestOptions.data === undefined) {
|
|
@@ -683,7 +676,7 @@ function createXhrRequester() {
|
|
|
683
676
|
}
|
|
684
677
|
|
|
685
678
|
// 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.
|
|
686
|
-
const apiClientVersion = '5.0.0-beta.
|
|
679
|
+
const apiClientVersion = '5.0.0-beta.11';
|
|
687
680
|
const REGIONS = ['eu', 'us'];
|
|
688
681
|
function getDefaultHosts(region) {
|
|
689
682
|
const url = 'query-suggestions.{region}.algolia.com'.replace('{region}', region);
|
|
@@ -746,12 +739,12 @@ function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
746
739
|
* Required API Key ACLs:
|
|
747
740
|
* - editSettings.
|
|
748
741
|
*
|
|
749
|
-
* @param
|
|
742
|
+
* @param configurationWithIndex - The configurationWithIndex object.
|
|
750
743
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
751
744
|
*/
|
|
752
|
-
createConfig(
|
|
753
|
-
if (!
|
|
754
|
-
throw new Error('Parameter `
|
|
745
|
+
createConfig(configurationWithIndex, requestOptions) {
|
|
746
|
+
if (!configurationWithIndex) {
|
|
747
|
+
throw new Error('Parameter `configurationWithIndex` is required when calling `createConfig`.');
|
|
755
748
|
}
|
|
756
749
|
const requestPath = '/1/configs';
|
|
757
750
|
const headers = {};
|
|
@@ -761,7 +754,7 @@ function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
761
754
|
path: requestPath,
|
|
762
755
|
queryParameters,
|
|
763
756
|
headers,
|
|
764
|
-
data:
|
|
757
|
+
data: configurationWithIndex,
|
|
765
758
|
};
|
|
766
759
|
return transporter.request(request, requestOptions);
|
|
767
760
|
},
|
|
@@ -989,18 +982,18 @@ function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
989
982
|
*
|
|
990
983
|
* @param updateConfig - The updateConfig object.
|
|
991
984
|
* @param updateConfig.indexName - Query Suggestions index name.
|
|
992
|
-
* @param updateConfig.
|
|
985
|
+
* @param updateConfig.configuration - The configuration object.
|
|
993
986
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
994
987
|
*/
|
|
995
|
-
updateConfig({ indexName,
|
|
988
|
+
updateConfig({ indexName, configuration }, requestOptions) {
|
|
996
989
|
if (!indexName) {
|
|
997
990
|
throw new Error('Parameter `indexName` is required when calling `updateConfig`.');
|
|
998
991
|
}
|
|
999
|
-
if (!
|
|
1000
|
-
throw new Error('Parameter `
|
|
992
|
+
if (!configuration) {
|
|
993
|
+
throw new Error('Parameter `configuration` is required when calling `updateConfig`.');
|
|
1001
994
|
}
|
|
1002
|
-
if (!
|
|
1003
|
-
throw new Error('Parameter `
|
|
995
|
+
if (!configuration.sourceIndices) {
|
|
996
|
+
throw new Error('Parameter `configuration.sourceIndices` is required when calling `updateConfig`.');
|
|
1004
997
|
}
|
|
1005
998
|
const requestPath = '/1/configs/{indexName}'.replace('{indexName}', encodeURIComponent(indexName));
|
|
1006
999
|
const headers = {};
|
|
@@ -1010,7 +1003,7 @@ function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
1010
1003
|
path: requestPath,
|
|
1011
1004
|
queryParameters,
|
|
1012
1005
|
headers,
|
|
1013
|
-
data:
|
|
1006
|
+
data: configuration,
|
|
1014
1007
|
};
|
|
1015
1008
|
return transporter.request(request, requestOptions);
|
|
1016
1009
|
},
|
|
@@ -2,7 +2,7 @@ import { createAuth, createTransporter, getAlgoliaAgent, DEFAULT_CONNECT_TIMEOUT
|
|
|
2
2
|
import { createHttpRequester } from '@algolia/requester-node-http';
|
|
3
3
|
|
|
4
4
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
|
5
|
-
const apiClientVersion = '5.0.0-beta.
|
|
5
|
+
const apiClientVersion = '5.0.0-beta.11';
|
|
6
6
|
const REGIONS = ['eu', 'us'];
|
|
7
7
|
function getDefaultHosts(region) {
|
|
8
8
|
const url = 'query-suggestions.{region}.algolia.com'.replace('{region}', region);
|
|
@@ -65,12 +65,12 @@ function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
65
65
|
* Required API Key ACLs:
|
|
66
66
|
* - editSettings.
|
|
67
67
|
*
|
|
68
|
-
* @param
|
|
68
|
+
* @param configurationWithIndex - The configurationWithIndex object.
|
|
69
69
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
70
70
|
*/
|
|
71
|
-
createConfig(
|
|
72
|
-
if (!
|
|
73
|
-
throw new Error('Parameter `
|
|
71
|
+
createConfig(configurationWithIndex, requestOptions) {
|
|
72
|
+
if (!configurationWithIndex) {
|
|
73
|
+
throw new Error('Parameter `configurationWithIndex` is required when calling `createConfig`.');
|
|
74
74
|
}
|
|
75
75
|
const requestPath = '/1/configs';
|
|
76
76
|
const headers = {};
|
|
@@ -80,7 +80,7 @@ function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
80
80
|
path: requestPath,
|
|
81
81
|
queryParameters,
|
|
82
82
|
headers,
|
|
83
|
-
data:
|
|
83
|
+
data: configurationWithIndex,
|
|
84
84
|
};
|
|
85
85
|
return transporter.request(request, requestOptions);
|
|
86
86
|
},
|
|
@@ -308,18 +308,18 @@ function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
308
308
|
*
|
|
309
309
|
* @param updateConfig - The updateConfig object.
|
|
310
310
|
* @param updateConfig.indexName - Query Suggestions index name.
|
|
311
|
-
* @param updateConfig.
|
|
311
|
+
* @param updateConfig.configuration - The configuration object.
|
|
312
312
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
313
313
|
*/
|
|
314
|
-
updateConfig({ indexName,
|
|
314
|
+
updateConfig({ indexName, configuration }, requestOptions) {
|
|
315
315
|
if (!indexName) {
|
|
316
316
|
throw new Error('Parameter `indexName` is required when calling `updateConfig`.');
|
|
317
317
|
}
|
|
318
|
-
if (!
|
|
319
|
-
throw new Error('Parameter `
|
|
318
|
+
if (!configuration) {
|
|
319
|
+
throw new Error('Parameter `configuration` is required when calling `updateConfig`.');
|
|
320
320
|
}
|
|
321
|
-
if (!
|
|
322
|
-
throw new Error('Parameter `
|
|
321
|
+
if (!configuration.sourceIndices) {
|
|
322
|
+
throw new Error('Parameter `configuration.sourceIndices` is required when calling `updateConfig`.');
|
|
323
323
|
}
|
|
324
324
|
const requestPath = '/1/configs/{indexName}'.replace('{indexName}', encodeURIComponent(indexName));
|
|
325
325
|
const headers = {};
|
|
@@ -329,7 +329,7 @@ function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
329
329
|
path: requestPath,
|
|
330
330
|
queryParameters,
|
|
331
331
|
headers,
|
|
332
|
-
data:
|
|
332
|
+
data: configuration,
|
|
333
333
|
};
|
|
334
334
|
return transporter.request(request, requestOptions);
|
|
335
335
|
},
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! client-query-suggestions.umd.js | 5.0.0-beta.
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/client-query-suggestions"]={})}(this,(function(e){"use strict";function t(e){let t;const r=`algolia-client-js-${e.key}`;function s(){return void 0===t&&(t=e.localStorage||window.localStorage),t}function a(){return JSON.parse(s().getItem(r)||"{}")}function n(e){s().setItem(r,JSON.stringify(e))}return{get:(t,r,s={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>(function(){const t=e.timeToLive?1e3*e.timeToLive:null,r=a(),s=Object.fromEntries(Object.entries(r).filter((([,e])=>void 0!==e.timestamp)));if(n(s),!t)return;n(Object.fromEntries(Object.entries(s).filter((([,e])=>{const r=(new Date).getTime();return!(e.timestamp+t<r)}))))}(),a()[JSON.stringify(t)]))).then((e=>Promise.all([e?e.value:r(),void 0!==e]))).then((([e,t])=>Promise.all([e,t||s.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve().then((()=>{const n=a();return n[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:t},s().setItem(r,JSON.stringify(n)),t})),delete:e=>Promise.resolve().then((()=>{const t=a();delete t[JSON.stringify(e)],s().setItem(r,JSON.stringify(t))})),clear:()=>Promise.resolve().then((()=>{s().removeItem(r)}))}}function r(e){const t=[...e.caches],s=t.shift();return void 0===s?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then((e=>Promise.all([e,r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,a,n={miss:()=>Promise.resolve()})=>s.get(e,a,n).catch((()=>r({caches:t}).get(e,a,n))),set:(e,a)=>s.set(e,a).catch((()=>r({caches:t}).set(e,a))),delete:e=>s.delete(e).catch((()=>r({caches:t}).delete(e))),clear:()=>s.clear().catch((()=>r({caches:t}).clear()))}}function s(e={serializable:!0}){let t={};return{get(r,s,a={miss:()=>Promise.resolve()}){const n=JSON.stringify(r);if(n in t)return Promise.resolve(e.serializable?JSON.parse(t[n]):t[n]);const o=s();return o.then((e=>a.miss(e))).then((()=>o))},set:(r,s)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(s):s,Promise.resolve(s)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}const a=12e4;function n(e,t="up"){const r=Date.now();return{...e,status:t,lastUpdate:r,isUp:function(){return"up"===t||Date.now()-r>a},isTimedOut:function(){return"timed out"===t&&Date.now()-r<=a}}}function o(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var s=r.call(e,t||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function i(e,t,r){return(t=o(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class u extends Error{constructor(e,t){super(e),i(this,"name","AlgoliaError"),t&&(this.name=t)}}class c extends u{constructor(e,t,r){super(e,r),i(this,"stackTrace",void 0),this.stackTrace=t}}class l extends c{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, please create a ticket at https://support.algolia.com/ sharing steps we can use to reproduce the issue.",e,"RetryError")}}class m extends c{constructor(e,t,r,s="ApiError"){super(e,r,s),i(this,"status",void 0),this.status=t}}class d extends u{constructor(e,t){super(e,"DeserializationError"),i(this,"response",void 0),this.response=t}}class h extends m{constructor(e,t,r,s){super(e,t,s,"DetailedApiError"),i(this,"error",void 0),this.error=r}}function g(e,t,r){const s=function(e){const t=e=>"[object Object]"===Object.prototype.toString.call(e)||"[object Array]"===Object.prototype.toString.call(e);return Object.keys(e).map((r=>`${r}=${encodeURIComponent(t(e[r])?JSON.stringify(e[r]):e[r]).replaceAll("+","%20")}`)).join("&")}(r);let a=`${e.protocol}://${e.url}${e.port?`:${e.port}`:""}/${"/"===t.charAt(0)?t.substring(1):t}`;return s.length&&(a+=`?${s}`),a}function p(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function f({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:s,algoliaAgent:a,timeouts:o,requester:i,requestsCache:u,responsesCache:c}){async function f(u,c,f=!0){const y=[],w=function(e,t){if("GET"===e.method||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(u,c),P=function(e,t,r){const s={Accept:"application/json",...e,...t,...r},a={};return Object.keys(s).forEach((e=>{const t=s[e];a[e.toLowerCase()]=t})),a}(r,u.headers,c.headers),q="GET"===u.method?{...u.data,...c.data}:{},v={...s,...u.queryParameters,...q};if(a.value&&(v["x-algolia-agent"]=a.value),c&&c.queryParameters)for(const e of Object.keys(c.queryParameters))c.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(c.queryParameters[e])?v[e]=c.queryParameters[e].toString():v[e]=c.queryParameters[e];let b=0;const T=async(e,r)=>{const s=e.pop();if(void 0===s)throw new l(function(e){return e.map((e=>p(e)))}(y));let a=f?c.timeouts?.read||o.read:c.timeouts?.write||o.write;const q={data:w,headers:P,method:u.method,url:g(s,u.path,v),connectTimeout:r(b,c.timeouts?.connect||o.connect),responseTimeout:r(b,a)},O=t=>{const r={request:q,response:t,host:s,triesLeft:e.length};return y.push(r),r},E=await i.send(q);if(function({isTimedOut:e,status:t}){return e||function({isTimedOut:e,status:t}){return!e&&!~~t}({isTimedOut:e,status:t})||2!=~~(t/100)&&4!=~~(t/100)}(E)){const a=O(E);return E.isTimedOut&&b++,console.log("Retryable failure",p(a)),await t.set(s,n(s,E.isTimedOut?"timed out":"down")),T(e,r)}if(function({status:e}){return 2==~~(e/100)}(E))return function(e){try{return JSON.parse(e.content)}catch(t){throw new d(t.message,e)}}(E);throw O(E),function({content:e,status:t},r){try{const s=JSON.parse(e);return"error"in s?new h(s.message,t,s.error,r):new m(s.message,t,r)}catch(e){}return new m(e,t,r)}(E,y)},O=e.filter((e=>"readWrite"===e.accept||(f?"read"===e.accept:"write"===e.accept))),E=await async function(e){const r=await Promise.all(e.map((e=>t.get(e,(()=>Promise.resolve(n(e))))))),s=r.filter((e=>e.isUp())),a=r.filter((e=>e.isTimedOut())),o=[...s,...a];return{hosts:o.length>0?o:e,getTimeout:(e,t)=>(0===a.length&&0===e?1:a.length+3+e)*t}}(O);return T([...E.hosts].reverse(),E.getTimeout)}return{hostsCache:t,requester:i,timeouts:o,algoliaAgent:a,baseHeaders:r,baseQueryParameters:s,hosts:e,request:function(e,t={}){const a=e.useReadTransporter||"GET"===e.method;if(!a)return f(e,t,a);const n=()=>f(e,t);if(!0!==(t.cacheable||e.cacheable))return n();const o={request:e,requestOptions:t,transporter:{queryParameters:s,headers:r}};return c.get(o,(()=>u.get(o,(()=>u.set(o,n()).then((e=>Promise.all([u.delete(o),e])),(e=>Promise.all([u.delete(o),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>c.set(o,e)})},requestsCache:u,responsesCache:c}}function y({algoliaAgents:e,client:t,version:r}){const s=function(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}(r).add({segment:t,version:r});return e.forEach((e=>s.add(e))),s}const w="5.0.0-beta.1",P=["eu","us"];e.apiClientVersion=w,e.querySuggestionsClient=function(e,a,n,o){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!a||"string"!=typeof a)throw new Error("`apiKey` is missing.");if(!n||n&&("string"!=typeof n||!P.includes(n)))throw new Error(`\`region\` is required and must be one of the following: ${P.join(", ")}`);return function({appId:e,apiKey:t,authMode:r,algoliaAgents:s,region:a,...n}){const o=function(e,t,r="WithinHeaders"){const s={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===r?s:{},queryParameters:()=>"WithinQueryParameters"===r?s:{}}}(e,t,r),i=f({hosts:(u=a,[{url:"query-suggestions.{region}.algolia.com".replace("{region}",u),accept:"readWrite",protocol:"https"}]),...n,algoliaAgent:y({algoliaAgents:s,client:"QuerySuggestions",version:w}),baseHeaders:{"content-type":"text/plain",...o.headers(),...n.baseHeaders},baseQueryParameters:{...o.queryParameters(),...n.baseQueryParameters}});var u;return{transporter:i,appId:e,clearCache:()=>Promise.all([i.requestsCache.clear(),i.responsesCache.clear()]).then((()=>{})),get _ua(){return i.algoliaAgent.value},addAlgoliaAgent(e,t){i.algoliaAgent.add({segment:e,version:t})},createConfig(e,t){if(!e)throw new Error("Parameter `querySuggestionsConfigurationWithIndex` is required when calling `createConfig`.");const r={method:"POST",path:"/1/configs",queryParameters:{},headers:{},data:e};return i.request(r,t)},customDelete({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");const s={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(s,r)},customGet({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");const s={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(s,r)},customPost({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");const a={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return i.request(a,s)},customPut({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");const a={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return i.request(a,s)},deleteConfig({indexName:e},t){if(!e)throw new Error("Parameter `indexName` is required when calling `deleteConfig`.");const r={method:"DELETE",path:"/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},getAllConfigs(e){const t={method:"GET",path:"/1/configs",queryParameters:{},headers:{}};return i.request(t,e)},getConfig({indexName:e},t){if(!e)throw new Error("Parameter `indexName` is required when calling `getConfig`.");const r={method:"GET",path:"/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},getConfigStatus({indexName:e},t){if(!e)throw new Error("Parameter `indexName` is required when calling `getConfigStatus`.");const r={method:"GET",path:"/1/configs/{indexName}/status".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},getLogFile({indexName:e},t){if(!e)throw new Error("Parameter `indexName` is required when calling `getLogFile`.");const r={method:"GET",path:"/1/logs/{indexName}".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},updateConfig({indexName:e,querySuggestionsConfiguration:t},r){if(!e)throw new Error("Parameter `indexName` is required when calling `updateConfig`.");if(!t)throw new Error("Parameter `querySuggestionsConfiguration` is required when calling `updateConfig`.");if(!t.sourceIndices)throw new Error("Parameter `querySuggestionsConfiguration.sourceIndices` is required when calling `updateConfig`.");const s={method:"PUT",path:"/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return i.request(s,r)}}}({appId:e,apiKey:a,region:n,timeouts:{connect:1e3,read:2e3,write:3e4},requester:{send:function(e){return new Promise((t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((t=>r.setRequestHeader(t,e.headers[t])));const s=(e,s)=>setTimeout((()=>{r.abort(),t({status:0,content:s,isTimedOut:!0})}),e),a=s(e.connectTimeout,"Connection timeout");let n;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===n&&(clearTimeout(a),n=s(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(a),clearTimeout(n),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(a),clearTimeout(n),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:s(),requestsCache:s({serializable:!1}),hostsCache:r({caches:[t({key:`${w}-${e}`}),s()]}),...o})}}));
|
|
1
|
+
/*! client-query-suggestions.umd.js | 5.0.0-beta.11 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/client-query-suggestions"]={})}(this,(function(e){"use strict";function t(e){let t;const r=`algolia-client-js-${e.key}`;function s(){return void 0===t&&(t=e.localStorage||window.localStorage),t}function a(){return JSON.parse(s().getItem(r)||"{}")}function n(e){s().setItem(r,JSON.stringify(e))}return{get:(t,r,s={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>(function(){const t=e.timeToLive?1e3*e.timeToLive:null,r=a(),s=Object.fromEntries(Object.entries(r).filter((([,e])=>void 0!==e.timestamp)));if(n(s),!t)return;n(Object.fromEntries(Object.entries(s).filter((([,e])=>{const r=(new Date).getTime();return!(e.timestamp+t<r)}))))}(),a()[JSON.stringify(t)]))).then((e=>Promise.all([e?e.value:r(),void 0!==e]))).then((([e,t])=>Promise.all([e,t||s.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve().then((()=>{const n=a();return n[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:t},s().setItem(r,JSON.stringify(n)),t})),delete:e=>Promise.resolve().then((()=>{const t=a();delete t[JSON.stringify(e)],s().setItem(r,JSON.stringify(t))})),clear:()=>Promise.resolve().then((()=>{s().removeItem(r)}))}}function r(e){const t=[...e.caches],s=t.shift();return void 0===s?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then((e=>Promise.all([e,r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,a,n={miss:()=>Promise.resolve()})=>s.get(e,a,n).catch((()=>r({caches:t}).get(e,a,n))),set:(e,a)=>s.set(e,a).catch((()=>r({caches:t}).set(e,a))),delete:e=>s.delete(e).catch((()=>r({caches:t}).delete(e))),clear:()=>s.clear().catch((()=>r({caches:t}).clear()))}}function s(e={serializable:!0}){let t={};return{get(r,s,a={miss:()=>Promise.resolve()}){const n=JSON.stringify(r);if(n in t)return Promise.resolve(e.serializable?JSON.parse(t[n]):t[n]);const o=s();return o.then((e=>a.miss(e))).then((()=>o))},set:(r,s)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(s):s,Promise.resolve(s)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}const a=12e4;function n(e,t="up"){const r=Date.now();return{...e,status:t,lastUpdate:r,isUp:function(){return"up"===t||Date.now()-r>a},isTimedOut:function(){return"timed out"===t&&Date.now()-r<=a}}}function o(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var s=r.call(e,t||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class i extends Error{constructor(e,t){super(e),o(this,"name","AlgoliaError"),t&&(this.name=t)}}class u extends i{constructor(e,t,r){super(e,r),o(this,"stackTrace",void 0),this.stackTrace=t}}class c extends u{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.",e,"RetryError")}}class l extends u{constructor(e,t,r,s="ApiError"){super(e,r,s),o(this,"status",void 0),this.status=t}}class m extends i{constructor(e,t){super(e,"DeserializationError"),o(this,"response",void 0),this.response=t}}class d extends l{constructor(e,t,r,s){super(e,t,s,"DetailedApiError"),o(this,"error",void 0),this.error=r}}function h(e,t,r){const s=(a=r,Object.keys(a).filter((e=>void 0!==a[e])).sort().map((e=>`${e}=${encodeURIComponent("[object Array]"===Object.prototype.toString.call(a[e])?a[e].join(","):a[e]).replaceAll("+","%20")}`)).join("&"));var a;let n=`${e.protocol}://${e.url}${e.port?`:${e.port}`:""}/${"/"===t.charAt(0)?t.substring(1):t}`;return s.length&&(n+=`?${s}`),n}function p(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function g({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:s,algoliaAgent:a,timeouts:o,requester:i,requestsCache:u,responsesCache:g}){async function f(u,g,f=!0){const y=[],P=function(e,t){if("GET"===e.method||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(u,g),w=function(e,t,r){const s={Accept:"application/json",...e,...t,...r},a={};return Object.keys(s).forEach((e=>{const t=s[e];a[e.toLowerCase()]=t})),a}(r,u.headers,g.headers),q="GET"===u.method?{...u.data,...g.data}:{},v={...s,...u.queryParameters,...q};if(a.value&&(v["x-algolia-agent"]=a.value),g&&g.queryParameters)for(const e of Object.keys(g.queryParameters))g.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(g.queryParameters[e])?v[e]=g.queryParameters[e].toString():v[e]=g.queryParameters[e];let b=0;const T=async(e,r)=>{const s=e.pop();if(void 0===s)throw new c(function(e){return e.map((e=>p(e)))}(y));let a=f?g.timeouts?.read||o.read:g.timeouts?.write||o.write;const q={data:P,headers:w,method:u.method,url:h(s,u.path,v),connectTimeout:r(b,g.timeouts?.connect||o.connect),responseTimeout:r(b,a)},E=t=>{const r={request:q,response:t,host:s,triesLeft:e.length};return y.push(r),r},O=await i.send(q);if(function({isTimedOut:e,status:t}){return e||function({isTimedOut:e,status:t}){return!e&&!~~t}({isTimedOut:e,status:t})||2!=~~(t/100)&&4!=~~(t/100)}(O)){const a=E(O);return O.isTimedOut&&b++,console.log("Retryable failure",p(a)),await t.set(s,n(s,O.isTimedOut?"timed out":"down")),T(e,r)}if(function({status:e}){return 2==~~(e/100)}(O))return function(e){try{return JSON.parse(e.content)}catch(t){throw new m(t.message,e)}}(O);throw E(O),function({content:e,status:t},r){try{const s=JSON.parse(e);return"error"in s?new d(s.message,t,s.error,r):new l(s.message,t,r)}catch(e){}return new l(e,t,r)}(O,y)},E=e.filter((e=>"readWrite"===e.accept||(f?"read"===e.accept:"write"===e.accept))),O=await async function(e){const r=await Promise.all(e.map((e=>t.get(e,(()=>Promise.resolve(n(e))))))),s=r.filter((e=>e.isUp())),a=r.filter((e=>e.isTimedOut())),o=[...s,...a];return{hosts:o.length>0?o:e,getTimeout:(e,t)=>(0===a.length&&0===e?1:a.length+3+e)*t}}(E);return T([...O.hosts].reverse(),O.getTimeout)}return{hostsCache:t,requester:i,timeouts:o,algoliaAgent:a,baseHeaders:r,baseQueryParameters:s,hosts:e,request:function(e,t={}){const a=e.useReadTransporter||"GET"===e.method;if(!a)return f(e,t,a);const n=()=>f(e,t);if(!0!==(t.cacheable||e.cacheable))return n();const o={request:e,requestOptions:t,transporter:{queryParameters:s,headers:r}};return g.get(o,(()=>u.get(o,(()=>u.set(o,n()).then((e=>Promise.all([u.delete(o),e])),(e=>Promise.all([u.delete(o),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>g.set(o,e)})},requestsCache:u,responsesCache:g}}function f({algoliaAgents:e,client:t,version:r}){const s=function(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}(r).add({segment:t,version:r});return e.forEach((e=>s.add(e))),s}const y="5.0.0-beta.11",P=["eu","us"];e.apiClientVersion=y,e.querySuggestionsClient=function(e,a,n,o){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!a||"string"!=typeof a)throw new Error("`apiKey` is missing.");if(!n||n&&("string"!=typeof n||!P.includes(n)))throw new Error(`\`region\` is required and must be one of the following: ${P.join(", ")}`);return function({appId:e,apiKey:t,authMode:r,algoliaAgents:s,region:a,...n}){const o=function(e,t,r="WithinHeaders"){const s={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===r?s:{},queryParameters:()=>"WithinQueryParameters"===r?s:{}}}(e,t,r),i=g({hosts:(u=a,[{url:"query-suggestions.{region}.algolia.com".replace("{region}",u),accept:"readWrite",protocol:"https"}]),...n,algoliaAgent:f({algoliaAgents:s,client:"QuerySuggestions",version:y}),baseHeaders:{"content-type":"text/plain",...o.headers(),...n.baseHeaders},baseQueryParameters:{...o.queryParameters(),...n.baseQueryParameters}});var u;return{transporter:i,appId:e,clearCache:()=>Promise.all([i.requestsCache.clear(),i.responsesCache.clear()]).then((()=>{})),get _ua(){return i.algoliaAgent.value},addAlgoliaAgent(e,t){i.algoliaAgent.add({segment:e,version:t})},createConfig(e,t){if(!e)throw new Error("Parameter `configurationWithIndex` is required when calling `createConfig`.");const r={method:"POST",path:"/1/configs",queryParameters:{},headers:{},data:e};return i.request(r,t)},customDelete({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");const s={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(s,r)},customGet({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");const s={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(s,r)},customPost({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");const a={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return i.request(a,s)},customPut({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");const a={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return i.request(a,s)},deleteConfig({indexName:e},t){if(!e)throw new Error("Parameter `indexName` is required when calling `deleteConfig`.");const r={method:"DELETE",path:"/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},getAllConfigs(e){const t={method:"GET",path:"/1/configs",queryParameters:{},headers:{}};return i.request(t,e)},getConfig({indexName:e},t){if(!e)throw new Error("Parameter `indexName` is required when calling `getConfig`.");const r={method:"GET",path:"/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},getConfigStatus({indexName:e},t){if(!e)throw new Error("Parameter `indexName` is required when calling `getConfigStatus`.");const r={method:"GET",path:"/1/configs/{indexName}/status".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},getLogFile({indexName:e},t){if(!e)throw new Error("Parameter `indexName` is required when calling `getLogFile`.");const r={method:"GET",path:"/1/logs/{indexName}".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},updateConfig({indexName:e,configuration:t},r){if(!e)throw new Error("Parameter `indexName` is required when calling `updateConfig`.");if(!t)throw new Error("Parameter `configuration` is required when calling `updateConfig`.");if(!t.sourceIndices)throw new Error("Parameter `configuration.sourceIndices` is required when calling `updateConfig`.");const s={method:"PUT",path:"/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return i.request(s,r)}}}({appId:e,apiKey:a,region:n,timeouts:{connect:1e3,read:2e3,write:3e4},requester:{send:function(e){return new Promise((t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((t=>r.setRequestHeader(t,e.headers[t])));const s=(e,s)=>setTimeout((()=>{r.abort(),t({status:0,content:s,isTimedOut:!0})}),e),a=s(e.connectTimeout,"Connection timeout");let n;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===n&&(clearTimeout(a),n=s(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(a),clearTimeout(n),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(a),clearTimeout(n),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:s(),requestsCache:s({serializable:!1}),hostsCache:r({caches:[t({key:`${y}-${e}`}),s()]}),...o})}}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Configuration } from './configuration';
|
|
2
2
|
/**
|
|
3
3
|
* Properties for the `customDelete` method.
|
|
4
4
|
*/
|
|
@@ -103,6 +103,6 @@ export type UpdateConfigProps = {
|
|
|
103
103
|
* Query Suggestions index name.
|
|
104
104
|
*/
|
|
105
105
|
indexName: string;
|
|
106
|
-
|
|
106
|
+
configuration: Configuration;
|
|
107
107
|
};
|
|
108
108
|
//# sourceMappingURL=clientMethodProps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientMethodProps.d.ts","sourceRoot":"","sources":["../../model/clientMethodProps.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"clientMethodProps.d.ts","sourceRoot":"","sources":["../../model/clientMethodProps.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC5B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC5B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,aAAa,CAAC;CAC9B,CAAC"}
|
|
@@ -3,7 +3,7 @@ import type { SourceIndex } from './sourceIndex';
|
|
|
3
3
|
/**
|
|
4
4
|
* Query Suggestions configuration.
|
|
5
5
|
*/
|
|
6
|
-
export type
|
|
6
|
+
export type Configuration = {
|
|
7
7
|
/**
|
|
8
8
|
* Algolia indices from which to get the popular searches for query suggestions.
|
|
9
9
|
*/
|
|
@@ -19,4 +19,4 @@ export type QuerySuggestionsConfiguration = {
|
|
|
19
19
|
*/
|
|
20
20
|
allowSpecialCharacters?: boolean;
|
|
21
21
|
};
|
|
22
|
-
//# sourceMappingURL=
|
|
22
|
+
//# sourceMappingURL=configuration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../model/configuration.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,aAAa,EAAE,WAAW,EAAE,CAAC;IAE7B,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAE1B;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;OAEG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AppID } from './appID';
|
|
2
|
+
import type { ConfigurationWithIndex } from './configurationWithIndex';
|
|
3
|
+
/**
|
|
4
|
+
* API response for retrieving Query Suggestions configurations.
|
|
5
|
+
*/
|
|
6
|
+
export type ConfigurationResponse = AppID & ConfigurationWithIndex;
|
|
7
|
+
//# sourceMappingURL=configurationResponse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurationResponse.d.ts","sourceRoot":"","sources":["../../model/configurationResponse.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAEvE;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,KAAK,GAAG,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurationWithIndex.d.ts","sourceRoot":"","sources":["../../model/configurationWithIndex.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC"}
|
package/dist/model/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export * from './appID';
|
|
2
2
|
export * from './baseResponse';
|
|
3
|
+
export * from './configuration';
|
|
4
|
+
export * from './configurationResponse';
|
|
5
|
+
export * from './configurationWithIndex';
|
|
3
6
|
export * from './errorBase';
|
|
4
7
|
export * from './facet';
|
|
5
8
|
export * from './getConfigStatus200Response';
|
|
6
9
|
export * from './getLogFile200Response';
|
|
7
10
|
export * from './languages';
|
|
8
11
|
export * from './logLevel';
|
|
9
|
-
export * from './querySuggestionsConfiguration';
|
|
10
|
-
export * from './querySuggestionsConfigurationResponse';
|
|
11
|
-
export * from './querySuggestionsConfigurationWithIndex';
|
|
12
12
|
export * from './sourceIndex';
|
|
13
13
|
export * from './clientMethodProps';
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../model/index.ts"],"names":[],"mappings":"AAEA,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../model/index.ts"],"names":[],"mappings":"AAEA,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { CreateClientOptions, RequestOptions } from '@algolia/client-common';
|
|
2
2
|
import type { BaseResponse } from '../model/baseResponse';
|
|
3
3
|
import type { CustomDeleteProps, CustomGetProps, CustomPostProps, CustomPutProps, DeleteConfigProps, GetConfigProps, GetConfigStatusProps, GetLogFileProps, UpdateConfigProps } from '../model/clientMethodProps';
|
|
4
|
+
import type { ConfigurationResponse } from '../model/configurationResponse';
|
|
5
|
+
import type { ConfigurationWithIndex } from '../model/configurationWithIndex';
|
|
4
6
|
import type { GetConfigStatus200Response } from '../model/getConfigStatus200Response';
|
|
5
7
|
import type { GetLogFile200Response } from '../model/getLogFile200Response';
|
|
6
|
-
|
|
7
|
-
import type { QuerySuggestionsConfigurationWithIndex } from '../model/querySuggestionsConfigurationWithIndex';
|
|
8
|
-
export declare const apiClientVersion = "5.0.0-beta.1";
|
|
8
|
+
export declare const apiClientVersion = "5.0.0-beta.11";
|
|
9
9
|
export declare const REGIONS: readonly ["eu", "us"];
|
|
10
10
|
export type Region = (typeof REGIONS)[number];
|
|
11
11
|
export declare function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }: CreateClientOptions & {
|
|
@@ -37,10 +37,10 @@ export declare function createQuerySuggestionsClient({ appId: appIdOption, apiKe
|
|
|
37
37
|
* Required API Key ACLs:
|
|
38
38
|
* - editSettings.
|
|
39
39
|
*
|
|
40
|
-
* @param
|
|
40
|
+
* @param configurationWithIndex - The configurationWithIndex object.
|
|
41
41
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
42
42
|
*/
|
|
43
|
-
createConfig(
|
|
43
|
+
createConfig(configurationWithIndex: ConfigurationWithIndex, requestOptions?: RequestOptions): Promise<BaseResponse>;
|
|
44
44
|
/**
|
|
45
45
|
* This method allow you to send requests to the Algolia REST API.
|
|
46
46
|
*
|
|
@@ -98,7 +98,7 @@ export declare function createQuerySuggestionsClient({ appId: appIdOption, apiKe
|
|
|
98
98
|
*
|
|
99
99
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
100
100
|
*/
|
|
101
|
-
getAllConfigs(requestOptions?: RequestOptions): Promise<
|
|
101
|
+
getAllConfigs(requestOptions?: RequestOptions): Promise<ConfigurationResponse[]>;
|
|
102
102
|
/**
|
|
103
103
|
* Retrieves a single Query Suggestions configuration by its index name.
|
|
104
104
|
*
|
|
@@ -109,7 +109,7 @@ export declare function createQuerySuggestionsClient({ appId: appIdOption, apiKe
|
|
|
109
109
|
* @param getConfig.indexName - Query Suggestions index name.
|
|
110
110
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
111
111
|
*/
|
|
112
|
-
getConfig({ indexName }: GetConfigProps, requestOptions?: RequestOptions): Promise<
|
|
112
|
+
getConfig({ indexName }: GetConfigProps, requestOptions?: RequestOptions): Promise<ConfigurationResponse>;
|
|
113
113
|
/**
|
|
114
114
|
* Reports the status of a Query Suggestions index.
|
|
115
115
|
*
|
|
@@ -140,9 +140,9 @@ export declare function createQuerySuggestionsClient({ appId: appIdOption, apiKe
|
|
|
140
140
|
*
|
|
141
141
|
* @param updateConfig - The updateConfig object.
|
|
142
142
|
* @param updateConfig.indexName - Query Suggestions index name.
|
|
143
|
-
* @param updateConfig.
|
|
143
|
+
* @param updateConfig.configuration - The configuration object.
|
|
144
144
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
145
145
|
*/
|
|
146
|
-
updateConfig({ indexName,
|
|
146
|
+
updateConfig({ indexName, configuration }: UpdateConfigProps, requestOptions?: RequestOptions): Promise<BaseResponse>;
|
|
147
147
|
};
|
|
148
148
|
//# sourceMappingURL=querySuggestionsClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"querySuggestionsClient.d.ts","sourceRoot":"","sources":["../../src/querySuggestionsClient.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,mBAAmB,EAKnB,cAAc,EACf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EAClB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"querySuggestionsClient.d.ts","sourceRoot":"","sources":["../../src/querySuggestionsClient.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,mBAAmB,EAKnB,cAAc,EACf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EAClB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACtF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAE5E,eAAO,MAAM,gBAAgB,kBAAkB,CAAC;AAEhD,eAAO,MAAM,OAAO,uBAAwB,CAAC;AAC7C,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAY9C,wBAAgB,4BAA4B,CAAC,EAC3C,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,YAAY,EACpB,QAAQ,EACR,aAAa,EACb,MAAM,EAAE,YAAY,EACpB,GAAG,OAAO,EACX,EAAE,mBAAmB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE;;IAwBvC;;OAEG;;IAGH;;OAEG;kBACW,OAAO,CAAC,IAAI,CAAC;IAO3B;;OAEG;;IAKH;;;;;OAKG;6BACsB,MAAM,YAAY,MAAM,GAAG,IAAI;IAIxD;;;;;;;;OAQG;yCAEuB,sBAAsB,mBAC7B,cAAc,GAC9B,OAAO,CAAC,YAAY,CAAC;IAsBxB;;;;;;;OAOG;uCAEqB,iBAAiB,mBACtB,cAAc,GAC9B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAqB/B;;;;;;;OAOG;oCAEqB,cAAc,mBACnB,cAAc,GAC9B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAqB/B;;;;;;;;OAQG;2CAE2B,eAAe,mBAC1B,cAAc,GAC9B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAsB/B;;;;;;;;OAQG;0CAE2B,cAAc,mBACzB,cAAc,GAC9B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAsB/B;;;;;;;;;OASG;gCAEc,iBAAiB,mBACf,cAAc,GAC9B,OAAO,CAAC,YAAY,CAAC;IAwBxB;;;;;;;OAOG;mCAEgB,cAAc,GAC9B,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAenC;;;;;;;;;OASG;6BAEc,cAAc,mBACZ,cAAc,GAC9B,OAAO,CAAC,qBAAqB,CAAC;IAwBjC;;;;;;;;;OASG;mCAEc,oBAAoB,mBAClB,cAAc,GAC9B,OAAO,CAAC,0BAA0B,CAAC;IAwBtC;;;;;;;;;OASG;8BAEc,eAAe,mBACb,cAAc,GAC9B,OAAO,CAAC,qBAAqB,CAAC;IAwBjC;;;;;;;;;;OAUG;+CAE6B,iBAAiB,mBAC9B,cAAc,GAC9B,OAAO,CAAC,YAAY,CAAC;EAqC3B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// 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.
|
|
2
2
|
|
|
3
|
-
import type {
|
|
3
|
+
import type { Configuration } from './configuration';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Properties for the `customDelete` method.
|
|
@@ -114,5 +114,5 @@ export type UpdateConfigProps = {
|
|
|
114
114
|
* Query Suggestions index name.
|
|
115
115
|
*/
|
|
116
116
|
indexName: string;
|
|
117
|
-
|
|
117
|
+
configuration: Configuration;
|
|
118
118
|
};
|
|
@@ -6,7 +6,7 @@ import type { SourceIndex } from './sourceIndex';
|
|
|
6
6
|
/**
|
|
7
7
|
* Query Suggestions configuration.
|
|
8
8
|
*/
|
|
9
|
-
export type
|
|
9
|
+
export type Configuration = {
|
|
10
10
|
/**
|
|
11
11
|
* Algolia indices from which to get the popular searches for query suggestions.
|
|
12
12
|
*/
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
// 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.
|
|
2
2
|
|
|
3
3
|
import type { AppID } from './appID';
|
|
4
|
-
import type {
|
|
4
|
+
import type { ConfigurationWithIndex } from './configurationWithIndex';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* API response for retrieving Query Suggestions configurations.
|
|
8
8
|
*/
|
|
9
|
-
export type
|
|
10
|
-
QuerySuggestionsConfigurationWithIndex;
|
|
9
|
+
export type ConfigurationResponse = AppID & ConfigurationWithIndex;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
// 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.
|
|
2
2
|
|
|
3
|
-
import type {
|
|
3
|
+
import type { Configuration } from './configuration';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Query Suggestions configuration.
|
|
7
7
|
*/
|
|
8
|
-
export type
|
|
9
|
-
QuerySuggestionsConfiguration & Record<string, any>;
|
|
8
|
+
export type ConfigurationWithIndex = Configuration & Record<string, any>;
|
package/model/index.ts
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
export * from './appID';
|
|
4
4
|
export * from './baseResponse';
|
|
5
|
+
export * from './configuration';
|
|
6
|
+
export * from './configurationResponse';
|
|
7
|
+
export * from './configurationWithIndex';
|
|
5
8
|
export * from './errorBase';
|
|
6
9
|
export * from './facet';
|
|
7
10
|
export * from './getConfigStatus200Response';
|
|
8
11
|
export * from './getLogFile200Response';
|
|
9
12
|
export * from './languages';
|
|
10
13
|
export * from './logLevel';
|
|
11
|
-
export * from './querySuggestionsConfiguration';
|
|
12
|
-
export * from './querySuggestionsConfigurationResponse';
|
|
13
|
-
export * from './querySuggestionsConfigurationWithIndex';
|
|
14
14
|
export * from './sourceIndex';
|
|
15
15
|
export * from './clientMethodProps';
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@algolia/client-query-suggestions",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.11",
|
|
4
4
|
"description": "JavaScript client for client-query-suggestions",
|
|
5
|
-
"repository":
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/algolia/algoliasearch-client-javascript.git"
|
|
8
|
+
},
|
|
6
9
|
"license": "MIT",
|
|
7
10
|
"author": "Algolia",
|
|
8
11
|
"type": "module",
|
|
@@ -39,14 +42,14 @@
|
|
|
39
42
|
"clean": "rm -rf ./dist || true"
|
|
40
43
|
},
|
|
41
44
|
"dependencies": {
|
|
42
|
-
"@algolia/client-common": "5.0.0-beta.
|
|
43
|
-
"@algolia/requester-browser-xhr": "5.0.0-beta.
|
|
44
|
-
"@algolia/requester-node-http": "5.0.0-beta.
|
|
45
|
+
"@algolia/client-common": "5.0.0-beta.12",
|
|
46
|
+
"@algolia/requester-browser-xhr": "5.0.0-beta.12",
|
|
47
|
+
"@algolia/requester-node-http": "5.0.0-beta.12"
|
|
45
48
|
},
|
|
46
49
|
"devDependencies": {
|
|
47
|
-
"@types/node": "20.
|
|
48
|
-
"rollup": "4.
|
|
49
|
-
"typescript": "5.
|
|
50
|
+
"@types/node": "20.14.10",
|
|
51
|
+
"rollup": "4.18.1",
|
|
52
|
+
"typescript": "5.5.3"
|
|
50
53
|
},
|
|
51
54
|
"engines": {
|
|
52
55
|
"node": ">= 14.0.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"querySuggestionsConfiguration.d.ts","sourceRoot":"","sources":["../../model/querySuggestionsConfiguration.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C;;OAEG;IACH,aAAa,EAAE,WAAW,EAAE,CAAC;IAE7B,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAE1B;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;OAEG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { AppID } from './appID';
|
|
2
|
-
import type { QuerySuggestionsConfigurationWithIndex } from './querySuggestionsConfigurationWithIndex';
|
|
3
|
-
/**
|
|
4
|
-
* API response for retrieving Query Suggestions configurations.
|
|
5
|
-
*/
|
|
6
|
-
export type QuerySuggestionsConfigurationResponse = AppID & QuerySuggestionsConfigurationWithIndex;
|
|
7
|
-
//# sourceMappingURL=querySuggestionsConfigurationResponse.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"querySuggestionsConfigurationResponse.d.ts","sourceRoot":"","sources":["../../model/querySuggestionsConfigurationResponse.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EAAE,sCAAsC,EAAE,MAAM,0CAA0C,CAAC;AAEvG;;GAEG;AACH,MAAM,MAAM,qCAAqC,GAAG,KAAK,GACvD,sCAAsC,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { QuerySuggestionsConfiguration } from './querySuggestionsConfiguration';
|
|
2
|
-
/**
|
|
3
|
-
* Query Suggestions configuration.
|
|
4
|
-
*/
|
|
5
|
-
export type QuerySuggestionsConfigurationWithIndex = QuerySuggestionsConfiguration & Record<string, any>;
|
|
6
|
-
//# sourceMappingURL=querySuggestionsConfigurationWithIndex.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"querySuggestionsConfigurationWithIndex.d.ts","sourceRoot":"","sources":["../../model/querySuggestionsConfigurationWithIndex.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAErF;;GAEG;AACH,MAAM,MAAM,sCAAsC,GAChD,6BAA6B,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC"}
|