@algolia/client-query-suggestions 5.1.0 → 5.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/builds/browser.d.ts +4 -4
- package/dist/builds/browser.d.ts.map +1 -1
- package/dist/builds/node.d.ts +4 -4
- package/dist/builds/node.d.ts.map +1 -1
- package/dist/client-query-suggestions.cjs +3 -7
- package/dist/client-query-suggestions.esm.browser.js +12 -17
- package/dist/client-query-suggestions.esm.node.js +3 -7
- 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/configurationWithIndex.d.ts +1 -1
- package/dist/model/configurationWithIndex.d.ts.map +1 -1
- package/dist/src/querySuggestionsClient.d.ts +5 -5
- package/dist/src/querySuggestionsClient.d.ts.map +1 -1
- package/model/clientMethodProps.ts +2 -2
- package/model/configurationWithIndex.ts +1 -1
- package/package.json +10 -8
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
</p>
|
|
15
15
|
|
|
16
16
|
<p align="center">
|
|
17
|
-
<a href="https://www.algolia.com/doc/
|
|
17
|
+
<a href="https://www.algolia.com/doc/libraries/javascript/" target="_blank">Documentation</a> •
|
|
18
18
|
<a href="https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/" target="_blank">InstantSearch</a> •
|
|
19
19
|
<a href="https://discourse.algolia.com" target="_blank">Community Forum</a> •
|
|
20
20
|
<a href="http://stackoverflow.com/questions/tagged/algolia" target="_blank">Stack Overflow</a> •
|
|
@@ -58,7 +58,7 @@ import { querySuggestionsClient } from '@algolia/client-query-suggestions';
|
|
|
58
58
|
const client = querySuggestionsClient('YOUR_APP_ID', 'YOUR_API_KEY');
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
For full documentation, visit the **[Algolia JavaScript API Client](https://www.algolia.com/doc/
|
|
61
|
+
For full documentation, visit the **[Algolia JavaScript API Client](https://www.algolia.com/doc/libraries/javascript/)**.
|
|
62
62
|
|
|
63
63
|
## ❓ Troubleshooting
|
|
64
64
|
|
package/dist/builds/browser.d.ts
CHANGED
|
@@ -13,10 +13,10 @@ export declare function querySuggestionsClient(appId: string, apiKey: string, re
|
|
|
13
13
|
readonly _ua: string;
|
|
14
14
|
addAlgoliaAgent(segment: string, version?: string): void;
|
|
15
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,
|
|
17
|
-
customGet({ path, parameters }: import("../model").CustomGetProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string,
|
|
18
|
-
customPost({ path, parameters, body }: import("../model").CustomPostProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string,
|
|
19
|
-
customPut({ path, parameters, body }: import("../model").CustomPutProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string,
|
|
16
|
+
customDelete({ path, parameters }: import("../model").CustomDeleteProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, unknown>>;
|
|
17
|
+
customGet({ path, parameters }: import("../model").CustomGetProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, unknown>>;
|
|
18
|
+
customPost({ path, parameters, body }: import("../model").CustomPostProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, unknown>>;
|
|
19
|
+
customPut({ path, parameters, body }: import("../model").CustomPutProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, unknown>>;
|
|
20
20
|
deleteConfig({ indexName }: import("../model").DeleteConfigProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").BaseResponse>;
|
|
21
21
|
getAllConfigs(requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").ConfigurationResponse[]>;
|
|
22
22
|
getConfig({ indexName }: import("../model").GetConfigProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").ConfigurationResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../builds/browser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAW5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../builds/browser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAW5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAG5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACzE,cAAc,UAAU,CAAC;AAEzB;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAG/E,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa;;;;;;;;;;;;;;;;;EAgC5G"}
|
package/dist/builds/node.d.ts
CHANGED
|
@@ -13,10 +13,10 @@ export declare function querySuggestionsClient(appId: string, apiKey: string, re
|
|
|
13
13
|
_ua: string;
|
|
14
14
|
addAlgoliaAgent(segment: string, version?: string): void;
|
|
15
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,
|
|
17
|
-
customGet({ path, parameters }: import("../model").CustomGetProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string,
|
|
18
|
-
customPost({ path, parameters, body }: import("../model").CustomPostProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string,
|
|
19
|
-
customPut({ path, parameters, body }: import("../model").CustomPutProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string,
|
|
16
|
+
customDelete({ path, parameters }: import("../model").CustomDeleteProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, unknown>>;
|
|
17
|
+
customGet({ path, parameters }: import("../model").CustomGetProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, unknown>>;
|
|
18
|
+
customPost({ path, parameters, body }: import("../model").CustomPostProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, unknown>>;
|
|
19
|
+
customPut({ path, parameters, body }: import("../model").CustomPutProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, unknown>>;
|
|
20
20
|
deleteConfig({ indexName }: import("../model").DeleteConfigProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").BaseResponse>;
|
|
21
21
|
getAllConfigs(requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").ConfigurationResponse[]>;
|
|
22
22
|
getConfig({ indexName }: import("../model").GetConfigProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").ConfigurationResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../builds/node.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAU5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../builds/node.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAU5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAG5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACzE,cAAc,UAAU,CAAC;AAEzB;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAG/E,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa;;;;;;;;;;;;;;;;;EA+B5G"}
|
|
@@ -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.1
|
|
7
|
+
const apiClientVersion = '5.2.1';
|
|
8
8
|
const REGIONS = ['eu', 'us'];
|
|
9
9
|
function getDefaultHosts(region) {
|
|
10
10
|
const url = 'query-suggestions.{region}.algolia.com'.replace('{region}', region);
|
|
@@ -41,10 +41,7 @@ function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
41
41
|
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
42
42
|
*/
|
|
43
43
|
clearCache() {
|
|
44
|
-
return Promise.all([
|
|
45
|
-
transporter.requestsCache.clear(),
|
|
46
|
-
transporter.responsesCache.clear(),
|
|
47
|
-
]).then(() => undefined);
|
|
44
|
+
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);
|
|
48
45
|
},
|
|
49
46
|
/**
|
|
50
47
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
@@ -347,8 +344,7 @@ function querySuggestionsClient(appId, apiKey, region, options) {
|
|
|
347
344
|
if (!apiKey || typeof apiKey !== 'string') {
|
|
348
345
|
throw new Error('`apiKey` is missing.');
|
|
349
346
|
}
|
|
350
|
-
if (!region ||
|
|
351
|
-
(region && (typeof region !== 'string' || !REGIONS.includes(region)))) {
|
|
347
|
+
if (!region || (region && (typeof region !== 'string' || !REGIONS.includes(region)))) {
|
|
352
348
|
throw new Error(`\`region\` is required and must be one of the following: ${REGIONS.join(', ')}`);
|
|
353
349
|
}
|
|
354
350
|
return {
|
|
@@ -314,7 +314,7 @@ function deserializeFailure({
|
|
|
314
314
|
return new DetailedApiError(parsed.message, status, parsed.error, stackFrame);
|
|
315
315
|
}
|
|
316
316
|
return new ApiError(parsed.message, status, stackFrame);
|
|
317
|
-
} catch
|
|
317
|
+
} catch {
|
|
318
318
|
// ..
|
|
319
319
|
}
|
|
320
320
|
return new ApiError(content, status, stackFrame);
|
|
@@ -442,14 +442,17 @@ function createTransporter({
|
|
|
442
442
|
if (host === undefined) {
|
|
443
443
|
throw new RetryError(stackTraceWithoutCredentials(stackTrace));
|
|
444
444
|
}
|
|
445
|
-
|
|
445
|
+
const timeout = {
|
|
446
|
+
...timeouts,
|
|
447
|
+
...requestOptions.timeouts
|
|
448
|
+
};
|
|
446
449
|
const payload = {
|
|
447
450
|
data,
|
|
448
451
|
headers,
|
|
449
452
|
method: request.method,
|
|
450
453
|
url: serializeUrl(host, request.path, queryParameters),
|
|
451
|
-
connectTimeout: getTimeout(timeoutsCount,
|
|
452
|
-
responseTimeout: getTimeout(timeoutsCount,
|
|
454
|
+
connectTimeout: getTimeout(timeoutsCount, timeout.connect),
|
|
455
|
+
responseTimeout: getTimeout(timeoutsCount, isRead ? timeout.read : timeout.write)
|
|
453
456
|
};
|
|
454
457
|
/**
|
|
455
458
|
* The stackFrame is pushed to the stackTrace so we
|
|
@@ -642,8 +645,7 @@ function createXhrRequester() {
|
|
|
642
645
|
const connectTimeout = createTimeout(request.connectTimeout, 'Connection timeout');
|
|
643
646
|
let responseTimeout;
|
|
644
647
|
baseRequester.onreadystatechange = () => {
|
|
645
|
-
if (baseRequester.readyState > baseRequester.OPENED &&
|
|
646
|
-
responseTimeout === undefined) {
|
|
648
|
+
if (baseRequester.readyState > baseRequester.OPENED && responseTimeout === undefined) {
|
|
647
649
|
clearTimeout(connectTimeout);
|
|
648
650
|
responseTimeout = createTimeout(request.responseTimeout, 'Socket timeout');
|
|
649
651
|
}
|
|
@@ -676,7 +678,7 @@ function createXhrRequester() {
|
|
|
676
678
|
}
|
|
677
679
|
|
|
678
680
|
// 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.
|
|
679
|
-
const apiClientVersion = '5.1
|
|
681
|
+
const apiClientVersion = '5.2.1';
|
|
680
682
|
const REGIONS = ['eu', 'us'];
|
|
681
683
|
function getDefaultHosts(region) {
|
|
682
684
|
const url = 'query-suggestions.{region}.algolia.com'.replace('{region}', region);
|
|
@@ -713,10 +715,7 @@ function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
713
715
|
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
714
716
|
*/
|
|
715
717
|
clearCache() {
|
|
716
|
-
return Promise.all([
|
|
717
|
-
transporter.requestsCache.clear(),
|
|
718
|
-
transporter.responsesCache.clear(),
|
|
719
|
-
]).then(() => undefined);
|
|
718
|
+
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);
|
|
720
719
|
},
|
|
721
720
|
/**
|
|
722
721
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
@@ -1019,8 +1018,7 @@ function querySuggestionsClient(appId, apiKey, region, options) {
|
|
|
1019
1018
|
if (!apiKey || typeof apiKey !== 'string') {
|
|
1020
1019
|
throw new Error('`apiKey` is missing.');
|
|
1021
1020
|
}
|
|
1022
|
-
if (!region ||
|
|
1023
|
-
(region && (typeof region !== 'string' || !REGIONS.includes(region)))) {
|
|
1021
|
+
if (!region || (region && (typeof region !== 'string' || !REGIONS.includes(region)))) {
|
|
1024
1022
|
throw new Error(`\`region\` is required and must be one of the following: ${REGIONS.join(', ')}`);
|
|
1025
1023
|
}
|
|
1026
1024
|
return createQuerySuggestionsClient({
|
|
@@ -1038,10 +1036,7 @@ function querySuggestionsClient(appId, apiKey, region, options) {
|
|
|
1038
1036
|
responsesCache: createMemoryCache(),
|
|
1039
1037
|
requestsCache: createMemoryCache({ serializable: false }),
|
|
1040
1038
|
hostsCache: createFallbackableCache({
|
|
1041
|
-
caches: [
|
|
1042
|
-
createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }),
|
|
1043
|
-
createMemoryCache(),
|
|
1044
|
-
],
|
|
1039
|
+
caches: [createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }), createMemoryCache()],
|
|
1045
1040
|
}),
|
|
1046
1041
|
...options,
|
|
1047
1042
|
});
|
|
@@ -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.1
|
|
5
|
+
const apiClientVersion = '5.2.1';
|
|
6
6
|
const REGIONS = ['eu', 'us'];
|
|
7
7
|
function getDefaultHosts(region) {
|
|
8
8
|
const url = 'query-suggestions.{region}.algolia.com'.replace('{region}', region);
|
|
@@ -39,10 +39,7 @@ function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
39
39
|
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
40
40
|
*/
|
|
41
41
|
clearCache() {
|
|
42
|
-
return Promise.all([
|
|
43
|
-
transporter.requestsCache.clear(),
|
|
44
|
-
transporter.responsesCache.clear(),
|
|
45
|
-
]).then(() => undefined);
|
|
42
|
+
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);
|
|
46
43
|
},
|
|
47
44
|
/**
|
|
48
45
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
@@ -345,8 +342,7 @@ function querySuggestionsClient(appId, apiKey, region, options) {
|
|
|
345
342
|
if (!apiKey || typeof apiKey !== 'string') {
|
|
346
343
|
throw new Error('`apiKey` is missing.');
|
|
347
344
|
}
|
|
348
|
-
if (!region ||
|
|
349
|
-
(region && (typeof region !== 'string' || !REGIONS.includes(region)))) {
|
|
345
|
+
if (!region || (region && (typeof region !== 'string' || !REGIONS.includes(region)))) {
|
|
350
346
|
throw new Error(`\`region\` is required and must be one of the following: ${REGIONS.join(', ')}`);
|
|
351
347
|
}
|
|
352
348
|
return {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! client-query-suggestions.umd.js | 5.1
|
|
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 T=0;const b=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(T,g.timeouts?.connect||o.connect),responseTimeout:r(T,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&&T++,console.log("Retryable failure",p(a)),await t.set(s,n(s,O.isTimedOut?"timed out":"down")),b(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 b([...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.1.0",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
|
+
/*! client-query-suggestions.umd.js | 5.2.1 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/client-query-suggestions"]={})}(this,(function(e){"use strict";function t(e){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 T=0;const b=async(e,r)=>{const s=e.pop();if(void 0===s)throw new c(function(e){return e.map((e=>p(e)))}(y));const a={...o,...g.timeouts},q={data:P,headers:w,method:u.method,url:h(s,u.path,v),connectTimeout:r(T,a.connect),responseTimeout:r(T,f?a.read:a.write)},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&&T++,console.log("Retryable failure",p(a)),await t.set(s,n(s,O.isTimedOut?"timed out":"down")),b(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{}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 b([...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.2.1",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})}}));
|
|
@@ -40,7 +40,7 @@ export type CustomPostProps = {
|
|
|
40
40
|
/**
|
|
41
41
|
* Parameters to send with the custom request.
|
|
42
42
|
*/
|
|
43
|
-
body?: Record<string,
|
|
43
|
+
body?: Record<string, unknown>;
|
|
44
44
|
};
|
|
45
45
|
/**
|
|
46
46
|
* Properties for the `customPut` method.
|
|
@@ -57,7 +57,7 @@ export type CustomPutProps = {
|
|
|
57
57
|
/**
|
|
58
58
|
* Parameters to send with the custom request.
|
|
59
59
|
*/
|
|
60
|
-
body?: Record<string,
|
|
60
|
+
body?: Record<string, unknown>;
|
|
61
61
|
};
|
|
62
62
|
/**
|
|
63
63
|
* Properties for the `deleteConfig` method.
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,OAAO,CAAC,CAAC;CAChC,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,OAAO,CAAC,CAAC;CAChC,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"}
|
|
@@ -2,5 +2,5 @@ import type { Configuration } from './configuration';
|
|
|
2
2
|
/**
|
|
3
3
|
* Query Suggestions configuration.
|
|
4
4
|
*/
|
|
5
|
-
export type ConfigurationWithIndex = Configuration & Record<string,
|
|
5
|
+
export type ConfigurationWithIndex = Configuration & Record<string, unknown>;
|
|
6
6
|
//# sourceMappingURL=configurationWithIndex.d.ts.map
|
|
@@ -1 +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,
|
|
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,OAAO,CAAC,CAAC"}
|
|
@@ -5,7 +5,7 @@ import type { ConfigStatus } from '../model/configStatus';
|
|
|
5
5
|
import type { ConfigurationResponse } from '../model/configurationResponse';
|
|
6
6
|
import type { ConfigurationWithIndex } from '../model/configurationWithIndex';
|
|
7
7
|
import type { LogFile } from '../model/logFile';
|
|
8
|
-
export declare const apiClientVersion = "5.1
|
|
8
|
+
export declare const apiClientVersion = "5.2.1";
|
|
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 & {
|
|
@@ -49,7 +49,7 @@ export declare function createQuerySuggestionsClient({ appId: appIdOption, apiKe
|
|
|
49
49
|
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
50
50
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
51
51
|
*/
|
|
52
|
-
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string,
|
|
52
|
+
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
53
53
|
/**
|
|
54
54
|
* This method allow you to send requests to the Algolia REST API.
|
|
55
55
|
*
|
|
@@ -58,7 +58,7 @@ export declare function createQuerySuggestionsClient({ appId: appIdOption, apiKe
|
|
|
58
58
|
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
59
59
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
60
60
|
*/
|
|
61
|
-
customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string,
|
|
61
|
+
customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
62
62
|
/**
|
|
63
63
|
* This method allow you to send requests to the Algolia REST API.
|
|
64
64
|
*
|
|
@@ -68,7 +68,7 @@ export declare function createQuerySuggestionsClient({ appId: appIdOption, apiKe
|
|
|
68
68
|
* @param customPost.body - Parameters to send with the custom request.
|
|
69
69
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
70
70
|
*/
|
|
71
|
-
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string,
|
|
71
|
+
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
72
72
|
/**
|
|
73
73
|
* This method allow you to send requests to the Algolia REST API.
|
|
74
74
|
*
|
|
@@ -78,7 +78,7 @@ export declare function createQuerySuggestionsClient({ appId: appIdOption, apiKe
|
|
|
78
78
|
* @param customPut.body - Parameters to send with the custom request.
|
|
79
79
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
80
80
|
*/
|
|
81
|
-
customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string,
|
|
81
|
+
customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
82
82
|
/**
|
|
83
83
|
* 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](/specs/search#tag/Indices/operation/deleteIndex) operation.
|
|
84
84
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"querySuggestionsClient.d.ts","sourceRoot":"","sources":["../../src/querySuggestionsClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"querySuggestionsClient.d.ts","sourceRoot":"","sources":["../../src/querySuggestionsClient.ts"],"names":[],"mappings":"AAGA,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,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEhD,eAAO,MAAM,gBAAgB,UAAU,CAAC;AAExC,eAAO,MAAM,OAAO,uBAAwB,CAAC;AAC7C,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAS9C,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;IAI3B;;OAEG;;IAKH;;;;;OAKG;6BACsB,MAAM,YAAY,MAAM,GAAG,IAAI;IAIxD;;;;;;;;OAQG;yCAEuB,sBAAsB,mBAC7B,cAAc,GAC9B,OAAO,CAAC,YAAY,CAAC;IAoBxB;;;;;;;OAOG;uCAEqB,iBAAiB,mBACtB,cAAc,GAC9B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAmBnC;;;;;;;OAOG;oCAC6B,cAAc,mBAAmB,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAmBlH;;;;;;;;OAQG;2CAE2B,eAAe,mBAC1B,cAAc,GAC9B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAoBnC;;;;;;;;OAQG;0CAE2B,cAAc,mBACzB,cAAc,GAC9B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAoBnC;;;;;;;;;OASG;gCACyB,iBAAiB,mBAAmB,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;IAmBtG;;;;;;;OAOG;mCAC4B,cAAc,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAehF;;;;;;;;;OASG;6BACsB,cAAc,mBAAmB,cAAc,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAmBzG;;;;;;;;;OASG;mCAC4B,oBAAoB,mBAAmB,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;IAmB5G;;;;;;;;;OASG;8BACuB,eAAe,mBAAmB,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IAmB7F;;;;;;;;;;OAUG;+CAE6B,iBAAiB,mBAC9B,cAAc,GAC9B,OAAO,CAAC,YAAY,CAAC;EA4B3B"}
|
|
@@ -45,7 +45,7 @@ export type CustomPostProps = {
|
|
|
45
45
|
/**
|
|
46
46
|
* Parameters to send with the custom request.
|
|
47
47
|
*/
|
|
48
|
-
body?: Record<string,
|
|
48
|
+
body?: Record<string, unknown>;
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
/**
|
|
@@ -63,7 +63,7 @@ export type CustomPutProps = {
|
|
|
63
63
|
/**
|
|
64
64
|
* Parameters to send with the custom request.
|
|
65
65
|
*/
|
|
66
|
-
body?: Record<string,
|
|
66
|
+
body?: Record<string, unknown>;
|
|
67
67
|
};
|
|
68
68
|
|
|
69
69
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@algolia/client-query-suggestions",
|
|
3
|
-
"version": "5.1
|
|
3
|
+
"version": "5.2.1",
|
|
4
4
|
"description": "JavaScript client for client-query-suggestions",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,13 +15,15 @@
|
|
|
15
15
|
"import": "./dist/client-query-suggestions.esm.node.js",
|
|
16
16
|
"module": "./dist/client-query-suggestions.esm.node.js",
|
|
17
17
|
"require": "./dist/client-query-suggestions.cjs",
|
|
18
|
-
"default": "./dist/client-query-suggestions.cjs"
|
|
18
|
+
"default": "./dist/client-query-suggestions.cjs",
|
|
19
|
+
"types": "./dist/builds/node.d.ts"
|
|
19
20
|
},
|
|
20
21
|
"default": {
|
|
21
22
|
"umd": "./dist/client-query-suggestions.umd.js",
|
|
22
23
|
"module": "./dist/client-query-suggestions.esm.browser.js",
|
|
23
24
|
"import": "./dist/client-query-suggestions.esm.browser.js",
|
|
24
|
-
"default": "./dist/client-query-suggestions.umd.js"
|
|
25
|
+
"default": "./dist/client-query-suggestions.umd.js",
|
|
26
|
+
"types": "./dist/builds/browser.d.ts"
|
|
25
27
|
}
|
|
26
28
|
},
|
|
27
29
|
"./src/*": "./src/*.ts",
|
|
@@ -42,13 +44,13 @@
|
|
|
42
44
|
"clean": "rm -rf ./dist || true"
|
|
43
45
|
},
|
|
44
46
|
"dependencies": {
|
|
45
|
-
"@algolia/client-common": "5.1
|
|
46
|
-
"@algolia/requester-browser-xhr": "5.1
|
|
47
|
-
"@algolia/requester-node-http": "5.1
|
|
47
|
+
"@algolia/client-common": "5.2.1",
|
|
48
|
+
"@algolia/requester-browser-xhr": "5.2.1",
|
|
49
|
+
"@algolia/requester-node-http": "5.2.1"
|
|
48
50
|
},
|
|
49
51
|
"devDependencies": {
|
|
50
|
-
"@types/node": "22.
|
|
51
|
-
"rollup": "4.
|
|
52
|
+
"@types/node": "22.5.0",
|
|
53
|
+
"rollup": "4.21.0",
|
|
52
54
|
"typescript": "5.5.4"
|
|
53
55
|
},
|
|
54
56
|
"engines": {
|