Socket
Socket
Sign inDemoInstall

@algolia/client-query-suggestions

Package Overview
Dependencies
Maintainers
83
Versions
153
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@algolia/client-query-suggestions - npm Package Compare versions

Comparing version 5.0.0-alpha.91 to 5.0.0-alpha.97

210

dist/client-query-suggestions.esm.browser.js

@@ -29,2 +29,22 @@ function createAuth(appId, apiKey, authMode = 'WithinHeaders') {

}
function setNamespace(namespace) {
getStorage().setItem(namespaceKey, JSON.stringify(namespace));
}
function removeOutdatedCacheItems() {
const timeToLive = options.timeToLive ? options.timeToLive * 1000 : null;
const namespace = getNamespace();
const filteredNamespaceWithoutOldFormattedCacheItems = Object.fromEntries(Object.entries(namespace).filter(([, cacheItem]) => {
return cacheItem.timestamp !== undefined;
}));
setNamespace(filteredNamespaceWithoutOldFormattedCacheItems);
if (!timeToLive) {
return;
}
const filteredNamespaceWithoutExpiredItems = Object.fromEntries(Object.entries(filteredNamespaceWithoutOldFormattedCacheItems).filter(([, cacheItem]) => {
const currentTimestamp = new Date().getTime();
const isExpired = cacheItem.timestamp + timeToLive < currentTimestamp;
return !isExpired;
}));
setNamespace(filteredNamespaceWithoutExpiredItems);
}
return {

@@ -35,5 +55,6 @@ get(key, defaultValue, events = {

return Promise.resolve().then(() => {
const keyAsString = JSON.stringify(key);
const value = getNamespace()[keyAsString];
return Promise.all([value || defaultValue(), value !== undefined]);
removeOutdatedCacheItems();
return getNamespace()[JSON.stringify(key)];
}).then(value => {
return Promise.all([value ? value.value : defaultValue(), value !== undefined]);
}).then(([value, exists]) => {

@@ -46,3 +67,6 @@ return Promise.all([value, exists || events.miss(value)]);

const namespace = getNamespace();
namespace[JSON.stringify(key)] = value;
namespace[JSON.stringify(key)] = {
timestamp: new Date().getTime(),
value
};
getStorage().setItem(namespaceKey, JSON.stringify(namespace));

@@ -177,2 +201,16 @@ return value;

function _toPrimitive(t, r) {
if ("object" != typeof t || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != typeof i) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function _toPropertyKey(t) {
var i = _toPrimitive(t, "string");
return "symbol" == typeof i ? i : String(i);
}
function _defineProperty(obj, key, value) {

@@ -192,16 +230,2 @@ key = _toPropertyKey(key);

}
function _toPrimitive(input, hint) {
if (typeof input !== "object" || input === null) return input;
var prim = input[Symbol.toPrimitive];
if (prim !== undefined) {
var res = prim.call(input, hint || "default");
if (typeof res !== "object") return res;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
}
function _toPropertyKey(arg) {
var key = _toPrimitive(arg, "string");
return typeof key === "symbol" ? key : String(key);
}

@@ -227,3 +251,3 @@ class AlgoliaError extends Error {

constructor(stackTrace) {
super('Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.', stackTrace, 'RetryError');
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.', stackTrace, 'RetryError');
}

@@ -671,3 +695,3 @@ }

// 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.
const apiClientVersion = '5.0.0-alpha.91';
const apiClientVersion = '5.0.0-alpha.97';
const REGIONS = ['eu', 'us'];

@@ -756,10 +780,10 @@ function getDefaultHosts(region) {

* @summary Send requests to the Algolia REST API.
* @param del - The del object.
* @param del.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param del.parameters - Query parameters to apply to the current query.
* @param customDelete - The customDelete object.
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param customDelete.parameters - Query parameters to apply to the current query.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
del({ path, parameters }, requestOptions) {
customDelete({ path, parameters }, requestOptions) {
if (!path) {
throw new Error('Parameter `path` is required when calling `del`.');
throw new Error('Parameter `path` is required when calling `customDelete`.');
}

@@ -778,18 +802,19 @@ const requestPath = '/1{path}'.replace('{path}', path);

/**
* Delete a Query Suggestions configuration. Deleting only removes the configuration and stops updates to the Query Suggestions index. The Query Suggestions index itself is not deleted.
* This method allow you to send requests to the Algolia REST API.
*
* @summary Delete a configuration.
* @param deleteConfig - The deleteConfig object.
* @param deleteConfig.indexName - Query Suggestions index name.
* @summary Send requests to the Algolia REST API.
* @param customGet - The customGet object.
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param customGet.parameters - Query parameters to apply to the current query.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
deleteConfig({ indexName }, requestOptions) {
if (!indexName) {
throw new Error('Parameter `indexName` is required when calling `deleteConfig`.');
customGet({ path, parameters }, requestOptions) {
if (!path) {
throw new Error('Parameter `path` is required when calling `customGet`.');
}
const requestPath = '/1/configs/{indexName}'.replace('{indexName}', encodeURIComponent(indexName));
const requestPath = '/1{path}'.replace('{path}', path);
const headers = {};
const queryParameters = {};
const queryParameters = parameters ? parameters : {};
const request = {
method: 'DELETE',
method: 'GET',
path: requestPath,

@@ -805,10 +830,11 @@ queryParameters,

* @summary Send requests to the Algolia REST API.
* @param get - The get object.
* @param get.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param get.parameters - Query parameters to apply to the current query.
* @param customPost - The customPost object.
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param customPost.parameters - Query parameters to apply to the current query.
* @param customPost.body - Parameters to send with the custom request.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
get({ path, parameters }, requestOptions) {
customPost({ path, parameters, body }, requestOptions) {
if (!path) {
throw new Error('Parameter `path` is required when calling `get`.');
throw new Error('Parameter `path` is required when calling `customPost`.');
}

@@ -819,6 +845,7 @@ const requestPath = '/1{path}'.replace('{path}', path);

const request = {
method: 'GET',
method: 'POST',
path: requestPath,
queryParameters,
headers,
data: body ? body : {},
};

@@ -828,2 +855,51 @@ return transporter.request(request, requestOptions);

/**
* This method allow you to send requests to the Algolia REST API.
*
* @summary Send requests to the Algolia REST API.
* @param customPut - The customPut object.
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param customPut.parameters - Query parameters to apply to the current query.
* @param customPut.body - Parameters to send with the custom request.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
customPut({ path, parameters, body }, requestOptions) {
if (!path) {
throw new Error('Parameter `path` is required when calling `customPut`.');
}
const requestPath = '/1{path}'.replace('{path}', path);
const headers = {};
const queryParameters = parameters ? parameters : {};
const request = {
method: 'PUT',
path: requestPath,
queryParameters,
headers,
data: body ? body : {},
};
return transporter.request(request, requestOptions);
},
/**
* Delete a Query Suggestions configuration. Deleting only removes the configuration and stops updates to the Query Suggestions index. The Query Suggestions index itself is not deleted.
*
* @summary Delete a configuration.
* @param deleteConfig - The deleteConfig object.
* @param deleteConfig.indexName - Query Suggestions index name.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
deleteConfig({ indexName }, requestOptions) {
if (!indexName) {
throw new Error('Parameter `indexName` is required when calling `deleteConfig`.');
}
const requestPath = '/1/configs/{indexName}'.replace('{indexName}', encodeURIComponent(indexName));
const headers = {};
const queryParameters = {};
const request = {
method: 'DELETE',
path: requestPath,
queryParameters,
headers,
};
return transporter.request(request, requestOptions);
},
/**
* List all Query Suggestions configurations of your Algolia application.

@@ -916,54 +992,2 @@ *

/**
* This method allow you to send requests to the Algolia REST API.
*
* @summary Send requests to the Algolia REST API.
* @param post - The post object.
* @param post.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param post.parameters - Query parameters to apply to the current query.
* @param post.body - Parameters to send with the custom request.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
post({ path, parameters, body }, requestOptions) {
if (!path) {
throw new Error('Parameter `path` is required when calling `post`.');
}
const requestPath = '/1{path}'.replace('{path}', path);
const headers = {};
const queryParameters = parameters ? parameters : {};
const request = {
method: 'POST',
path: requestPath,
queryParameters,
headers,
data: body ? body : {},
};
return transporter.request(request, requestOptions);
},
/**
* This method allow you to send requests to the Algolia REST API.
*
* @summary Send requests to the Algolia REST API.
* @param put - The put object.
* @param put.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param put.parameters - Query parameters to apply to the current query.
* @param put.body - Parameters to send with the custom request.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
put({ path, parameters, body }, requestOptions) {
if (!path) {
throw new Error('Parameter `path` is required when calling `put`.');
}
const requestPath = '/1{path}'.replace('{path}', path);
const headers = {};
const queryParameters = parameters ? parameters : {};
const request = {
method: 'PUT',
path: requestPath,
queryParameters,
headers,
data: body ? body : {},
};
return transporter.request(request, requestOptions);
},
/**
* Update a QuerySuggestions configuration.

@@ -970,0 +994,0 @@ *

@@ -5,3 +5,3 @@ import { createAuth, createTransporter, getAlgoliaAgent, DEFAULT_CONNECT_TIMEOUT_NODE, DEFAULT_READ_TIMEOUT_NODE, DEFAULT_WRITE_TIMEOUT_NODE, createNullCache, createMemoryCache } from '@algolia/client-common';

// 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.
const apiClientVersion = '5.0.0-alpha.91';
const apiClientVersion = '5.0.0-alpha.97';
const REGIONS = ['eu', 'us'];

@@ -90,10 +90,10 @@ function getDefaultHosts(region) {

* @summary Send requests to the Algolia REST API.
* @param del - The del object.
* @param del.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param del.parameters - Query parameters to apply to the current query.
* @param customDelete - The customDelete object.
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param customDelete.parameters - Query parameters to apply to the current query.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
del({ path, parameters }, requestOptions) {
customDelete({ path, parameters }, requestOptions) {
if (!path) {
throw new Error('Parameter `path` is required when calling `del`.');
throw new Error('Parameter `path` is required when calling `customDelete`.');
}

@@ -112,18 +112,19 @@ const requestPath = '/1{path}'.replace('{path}', path);

/**
* Delete a Query Suggestions configuration. Deleting only removes the configuration and stops updates to the Query Suggestions index. The Query Suggestions index itself is not deleted.
* This method allow you to send requests to the Algolia REST API.
*
* @summary Delete a configuration.
* @param deleteConfig - The deleteConfig object.
* @param deleteConfig.indexName - Query Suggestions index name.
* @summary Send requests to the Algolia REST API.
* @param customGet - The customGet object.
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param customGet.parameters - Query parameters to apply to the current query.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
deleteConfig({ indexName }, requestOptions) {
if (!indexName) {
throw new Error('Parameter `indexName` is required when calling `deleteConfig`.');
customGet({ path, parameters }, requestOptions) {
if (!path) {
throw new Error('Parameter `path` is required when calling `customGet`.');
}
const requestPath = '/1/configs/{indexName}'.replace('{indexName}', encodeURIComponent(indexName));
const requestPath = '/1{path}'.replace('{path}', path);
const headers = {};
const queryParameters = {};
const queryParameters = parameters ? parameters : {};
const request = {
method: 'DELETE',
method: 'GET',
path: requestPath,

@@ -139,10 +140,11 @@ queryParameters,

* @summary Send requests to the Algolia REST API.
* @param get - The get object.
* @param get.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param get.parameters - Query parameters to apply to the current query.
* @param customPost - The customPost object.
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param customPost.parameters - Query parameters to apply to the current query.
* @param customPost.body - Parameters to send with the custom request.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
get({ path, parameters }, requestOptions) {
customPost({ path, parameters, body }, requestOptions) {
if (!path) {
throw new Error('Parameter `path` is required when calling `get`.');
throw new Error('Parameter `path` is required when calling `customPost`.');
}

@@ -153,6 +155,7 @@ const requestPath = '/1{path}'.replace('{path}', path);

const request = {
method: 'GET',
method: 'POST',
path: requestPath,
queryParameters,
headers,
data: body ? body : {},
};

@@ -162,2 +165,51 @@ return transporter.request(request, requestOptions);

/**
* This method allow you to send requests to the Algolia REST API.
*
* @summary Send requests to the Algolia REST API.
* @param customPut - The customPut object.
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param customPut.parameters - Query parameters to apply to the current query.
* @param customPut.body - Parameters to send with the custom request.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
customPut({ path, parameters, body }, requestOptions) {
if (!path) {
throw new Error('Parameter `path` is required when calling `customPut`.');
}
const requestPath = '/1{path}'.replace('{path}', path);
const headers = {};
const queryParameters = parameters ? parameters : {};
const request = {
method: 'PUT',
path: requestPath,
queryParameters,
headers,
data: body ? body : {},
};
return transporter.request(request, requestOptions);
},
/**
* Delete a Query Suggestions configuration. Deleting only removes the configuration and stops updates to the Query Suggestions index. The Query Suggestions index itself is not deleted.
*
* @summary Delete a configuration.
* @param deleteConfig - The deleteConfig object.
* @param deleteConfig.indexName - Query Suggestions index name.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
deleteConfig({ indexName }, requestOptions) {
if (!indexName) {
throw new Error('Parameter `indexName` is required when calling `deleteConfig`.');
}
const requestPath = '/1/configs/{indexName}'.replace('{indexName}', encodeURIComponent(indexName));
const headers = {};
const queryParameters = {};
const request = {
method: 'DELETE',
path: requestPath,
queryParameters,
headers,
};
return transporter.request(request, requestOptions);
},
/**
* List all Query Suggestions configurations of your Algolia application.

@@ -250,54 +302,2 @@ *

/**
* This method allow you to send requests to the Algolia REST API.
*
* @summary Send requests to the Algolia REST API.
* @param post - The post object.
* @param post.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param post.parameters - Query parameters to apply to the current query.
* @param post.body - Parameters to send with the custom request.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
post({ path, parameters, body }, requestOptions) {
if (!path) {
throw new Error('Parameter `path` is required when calling `post`.');
}
const requestPath = '/1{path}'.replace('{path}', path);
const headers = {};
const queryParameters = parameters ? parameters : {};
const request = {
method: 'POST',
path: requestPath,
queryParameters,
headers,
data: body ? body : {},
};
return transporter.request(request, requestOptions);
},
/**
* This method allow you to send requests to the Algolia REST API.
*
* @summary Send requests to the Algolia REST API.
* @param put - The put object.
* @param put.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param put.parameters - Query parameters to apply to the current query.
* @param put.body - Parameters to send with the custom request.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
put({ path, parameters, body }, requestOptions) {
if (!path) {
throw new Error('Parameter `path` is required when calling `put`.');
}
const requestPath = '/1{path}'.replace('{path}', path);
const headers = {};
const queryParameters = parameters ? parameters : {};
const request = {
method: 'PUT',
path: requestPath,
queryParameters,
headers,
data: body ? body : {},
};
return transporter.request(request, requestOptions);
},
/**
* Update a QuerySuggestions configuration.

@@ -304,0 +304,0 @@ *

@@ -1,2 +0,2 @@

/*! client-query-suggestions.umd.js | 5.0.0-alpha.91 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */
!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)||"{}")}return{get:(e,t,r={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>{const r=JSON.stringify(e),s=a()[r];return Promise.all([s||t(),void 0!==s])})).then((([e,t])=>Promise.all([e,t||r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve().then((()=>{const n=a();return n[JSON.stringify(e)]=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||null===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:String(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, contact support@algolia.com.",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 d extends i{constructor(e,t){super(e,"DeserializationError"),o(this,"response",void 0),this.response=t}}class h extends l{constructor(e,t,r,s){super(e,t,s,"DetailedApiError"),o(this,"error",void 0),this.error=r}}function m(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])}`)).join("&")}(r);let a=`${e.protocol}://${e.url}/${"/"===t.charAt(0)?t.substr(1):t}`;return s.length&&(a+=`?${s}`),a}function g(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 p({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:s,algoliaAgent:a,timeouts:o,requester:i,requestsCache:u,responsesCache:p}){async function f(u,p,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,p),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,p.headers),q="GET"===u.method?{...u.data,...p.data}:{},v={...s,...u.queryParameters,...q};if(a.value&&(v["x-algolia-agent"]=a.value),p&&p.queryParameters)for(const e of Object.keys(p.queryParameters))p.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(p.queryParameters[e])?v[e]=p.queryParameters[e].toString():v[e]=p.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=>g(e)))}(y));let a=p.timeout;void 0===a&&(a=f?o.read:o.write);const q={data:w,headers:P,method:u.method,url:m(s,u.path,v),connectTimeout:r(b,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&&0==~~t}({isTimedOut:e,status:t})||2!=~~(t/100)&&4!=~~(t/100)}(O)){const a=E(O);return O.isTimedOut&&b++,console.log("Retryable failure",g(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 d(t.message,e)}}(O);throw E(O),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 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 p.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=>p.set(o,e)})},requestsCache:u,responsesCache:p}}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-alpha.91",w=["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||!w.includes(n)))throw new Error(`\`region\` is required and must be one of the following: ${w.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=p({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 `querySuggestionsConfigurationWithIndex` is required when calling `createConfig`.");const r={method:"POST",path:"/1/configs",queryParameters:{},headers:{},data:e};return i.request(r,t)},del({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `del`.");const s={method:"DELETE",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(s,r)},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)},get({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `get`.");const s={method:"GET",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(s,r)},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)},post({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `post`.");const a={method:"POST",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return i.request(a,s)},put({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `put`.");const a={method:"PUT",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return i.request(a,s)},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:`${y}-${e}`}),s()]}),...o})}}));
/*! client-query-suggestions.umd.js | 5.0.0-alpha.97 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */
!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:String(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 d extends c{constructor(e,t,r,s="ApiError"){super(e,r,s),i(this,"status",void 0),this.status=t}}class m extends u{constructor(e,t){super(e,"DeserializationError"),i(this,"response",void 0),this.response=t}}class h extends d{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])}`)).join("&")}(r);let a=`${e.protocol}://${e.url}/${"/"===t.charAt(0)?t.substr(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=[],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,c),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,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=c.timeout;void 0===a&&(a=f?o.read:o.write);const q={data:P,headers:w,method:u.method,url:g(s,u.path,v),connectTimeout:r(b,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&&0==~~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 m(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 d(s.message,t,r)}catch(e){}return new d(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 P="5.0.0-alpha.97",w=["eu","us"];e.apiClientVersion=P,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||!w.includes(n)))throw new Error(`\`region\` is required and must be one of the following: ${w.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:P}),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:"/1{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:"/1{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:"/1{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:"/1{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:`${P}-${e}`}),s()]}),...o})}}));
import type { QuerySuggestionsConfiguration } from './querySuggestionsConfiguration';
/**
* Properties for the `del` method.
* Properties for the `customDelete` method.
*/
export type DelProps = {
export type CustomDeleteProps = {
/**

@@ -16,14 +16,18 @@ * Path of the endpoint, anything after \"/1\" must be specified.

/**
* Properties for the `deleteConfig` method.
* Properties for the `customGet` method.
*/
export type DeleteConfigProps = {
export type CustomGetProps = {
/**
* Query Suggestions index name.
* Path of the endpoint, anything after \"/1\" must be specified.
*/
indexName: string;
path: string;
/**
* Query parameters to apply to the current query.
*/
parameters?: Record<string, any>;
};
/**
* Properties for the `get` method.
* Properties for the `customPost` method.
*/
export type GetProps = {
export type CustomPostProps = {
/**

@@ -37,16 +41,28 @@ * Path of the endpoint, anything after \"/1\" must be specified.

parameters?: Record<string, any>;
/**
* Parameters to send with the custom request.
*/
body?: Record<string, any>;
};
/**
* Properties for the `getConfig` method.
* Properties for the `customPut` method.
*/
export type GetConfigProps = {
export type CustomPutProps = {
/**
* Query Suggestions index name.
* Path of the endpoint, anything after \"/1\" must be specified.
*/
indexName: string;
path: string;
/**
* Query parameters to apply to the current query.
*/
parameters?: Record<string, any>;
/**
* Parameters to send with the custom request.
*/
body?: Record<string, any>;
};
/**
* Properties for the `getConfigStatus` method.
* Properties for the `deleteConfig` method.
*/
export type GetConfigStatusProps = {
export type DeleteConfigProps = {
/**

@@ -58,5 +74,5 @@ * Query Suggestions index name.

/**
* Properties for the `getLogFile` method.
* Properties for the `getConfig` method.
*/
export type GetLogFileProps = {
export type GetConfigProps = {
/**

@@ -68,34 +84,18 @@ * Query Suggestions index name.

/**
* Properties for the `post` method.
* Properties for the `getConfigStatus` method.
*/
export type PostProps = {
export type GetConfigStatusProps = {
/**
* Path of the endpoint, anything after \"/1\" must be specified.
* Query Suggestions index name.
*/
path: string;
/**
* Query parameters to apply to the current query.
*/
parameters?: Record<string, any>;
/**
* Parameters to send with the custom request.
*/
body?: Record<string, any>;
indexName: string;
};
/**
* Properties for the `put` method.
* Properties for the `getLogFile` method.
*/
export type PutProps = {
export type GetLogFileProps = {
/**
* Path of the endpoint, anything after \"/1\" must be specified.
* Query Suggestions index name.
*/
path: string;
/**
* Query parameters to apply to the current query.
*/
parameters?: Record<string, any>;
/**
* Parameters to send with the custom request.
*/
body?: Record<string, any>;
indexName: string;
};

@@ -102,0 +102,0 @@ /**

import type { CreateClientOptions, RequestOptions } from '@algolia/client-common';
import type { BaseResponse } from '../model/baseResponse';
import type { DelProps, DeleteConfigProps, GetProps, GetConfigProps, GetConfigStatusProps, GetLogFileProps, PostProps, PutProps, UpdateConfigProps } from '../model/clientMethodProps';
import type { CustomDeleteProps, CustomGetProps, CustomPostProps, CustomPutProps, DeleteConfigProps, GetConfigProps, GetConfigStatusProps, GetLogFileProps, UpdateConfigProps } from '../model/clientMethodProps';
import type { GetConfigStatus200Response } from '../model/getConfigStatus200Response';

@@ -8,3 +8,3 @@ import type { GetLogFile200Response } from '../model/getLogFile200Response';

import type { QuerySuggestionsConfigurationWithIndex } from '../model/querySuggestionsConfigurationWithIndex';
export declare const apiClientVersion = "5.0.0-alpha.91";
export declare const apiClientVersion = "5.0.0-alpha.97";
export declare const REGIONS: readonly ["eu", "us"];

@@ -47,17 +47,18 @@ export type Region = (typeof REGIONS)[number];

* @summary Send requests to the Algolia REST API.
* @param del - The del object.
* @param del.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param del.parameters - Query parameters to apply to the current query.
* @param customDelete - The customDelete object.
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param customDelete.parameters - Query parameters to apply to the current query.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
del({ path, parameters }: DelProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
/**
* Delete a Query Suggestions configuration. Deleting only removes the configuration and stops updates to the Query Suggestions index. The Query Suggestions index itself is not deleted.
* This method allow you to send requests to the Algolia REST API.
*
* @summary Delete a configuration.
* @param deleteConfig - The deleteConfig object.
* @param deleteConfig.indexName - Query Suggestions index name.
* @summary Send requests to the Algolia REST API.
* @param customGet - The customGet object.
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param customGet.parameters - Query parameters to apply to the current query.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
deleteConfig({ indexName }: DeleteConfigProps, requestOptions?: RequestOptions): Promise<BaseResponse>;
customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
/**

@@ -67,9 +68,30 @@ * This method allow you to send requests to the Algolia REST API.

* @summary Send requests to the Algolia REST API.
* @param get - The get object.
* @param get.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param get.parameters - Query parameters to apply to the current query.
* @param customPost - The customPost object.
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param customPost.parameters - Query parameters to apply to the current query.
* @param customPost.body - Parameters to send with the custom request.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
get({ path, parameters }: GetProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
/**
* This method allow you to send requests to the Algolia REST API.
*
* @summary Send requests to the Algolia REST API.
* @param customPut - The customPut object.
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param customPut.parameters - Query parameters to apply to the current query.
* @param customPut.body - Parameters to send with the custom request.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
/**
* Delete a Query Suggestions configuration. Deleting only removes the configuration and stops updates to the Query Suggestions index. The Query Suggestions index itself is not deleted.
*
* @summary Delete a configuration.
* @param deleteConfig - The deleteConfig object.
* @param deleteConfig.indexName - Query Suggestions index name.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
deleteConfig({ indexName }: DeleteConfigProps, requestOptions?: RequestOptions): Promise<BaseResponse>;
/**
* List all Query Suggestions configurations of your Algolia application.

@@ -109,24 +131,2 @@ *

/**
* This method allow you to send requests to the Algolia REST API.
*
* @summary Send requests to the Algolia REST API.
* @param post - The post object.
* @param post.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param post.parameters - Query parameters to apply to the current query.
* @param post.body - Parameters to send with the custom request.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
post({ path, parameters, body }: PostProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
/**
* This method allow you to send requests to the Algolia REST API.
*
* @summary Send requests to the Algolia REST API.
* @param put - The put object.
* @param put.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param put.parameters - Query parameters to apply to the current query.
* @param put.body - Parameters to send with the custom request.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
put({ path, parameters, body }: PutProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
/**
* Update a QuerySuggestions configuration.

@@ -133,0 +133,0 @@ *

@@ -6,5 +6,5 @@ // 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.

/**
* Properties for the `del` method.
* Properties for the `customDelete` method.
*/
export type DelProps = {
export type CustomDeleteProps = {
/**

@@ -21,15 +21,19 @@ * Path of the endpoint, anything after \"/1\" must be specified.

/**
* Properties for the `deleteConfig` method.
* Properties for the `customGet` method.
*/
export type DeleteConfigProps = {
export type CustomGetProps = {
/**
* Query Suggestions index name.
* Path of the endpoint, anything after \"/1\" must be specified.
*/
indexName: string;
path: string;
/**
* Query parameters to apply to the current query.
*/
parameters?: Record<string, any>;
};
/**
* Properties for the `get` method.
* Properties for the `customPost` method.
*/
export type GetProps = {
export type CustomPostProps = {
/**

@@ -43,18 +47,30 @@ * Path of the endpoint, anything after \"/1\" must be specified.

parameters?: Record<string, any>;
/**
* Parameters to send with the custom request.
*/
body?: Record<string, any>;
};
/**
* Properties for the `getConfig` method.
* Properties for the `customPut` method.
*/
export type GetConfigProps = {
export type CustomPutProps = {
/**
* Query Suggestions index name.
* Path of the endpoint, anything after \"/1\" must be specified.
*/
indexName: string;
path: string;
/**
* Query parameters to apply to the current query.
*/
parameters?: Record<string, any>;
/**
* Parameters to send with the custom request.
*/
body?: Record<string, any>;
};
/**
* Properties for the `getConfigStatus` method.
* Properties for the `deleteConfig` method.
*/
export type GetConfigStatusProps = {
export type DeleteConfigProps = {
/**

@@ -67,5 +83,5 @@ * Query Suggestions index name.

/**
* Properties for the `getLogFile` method.
* Properties for the `getConfig` method.
*/
export type GetLogFileProps = {
export type GetConfigProps = {
/**

@@ -78,35 +94,19 @@ * Query Suggestions index name.

/**
* Properties for the `post` method.
* Properties for the `getConfigStatus` method.
*/
export type PostProps = {
export type GetConfigStatusProps = {
/**
* Path of the endpoint, anything after \"/1\" must be specified.
* Query Suggestions index name.
*/
path: string;
/**
* Query parameters to apply to the current query.
*/
parameters?: Record<string, any>;
/**
* Parameters to send with the custom request.
*/
body?: Record<string, any>;
indexName: string;
};
/**
* Properties for the `put` method.
* Properties for the `getLogFile` method.
*/
export type PutProps = {
export type GetLogFileProps = {
/**
* Path of the endpoint, anything after \"/1\" must be specified.
* Query Suggestions index name.
*/
path: string;
/**
* Query parameters to apply to the current query.
*/
parameters?: Record<string, any>;
/**
* Parameters to send with the custom request.
*/
body?: Record<string, any>;
indexName: string;
};

@@ -113,0 +113,0 @@

{
"name": "@algolia/client-query-suggestions",
"version": "5.0.0-alpha.91",
"version": "5.0.0-alpha.97",
"description": "JavaScript client for client-query-suggestions",

@@ -42,10 +42,10 @@ "repository": "algolia/algoliasearch-client-javascript",

"dependencies": {
"@algolia/client-common": "5.0.0-alpha.92",
"@algolia/requester-browser-xhr": "5.0.0-alpha.92",
"@algolia/requester-node-http": "5.0.0-alpha.92"
"@algolia/client-common": "5.0.0-alpha.98",
"@algolia/requester-browser-xhr": "5.0.0-alpha.98",
"@algolia/requester-node-http": "5.0.0-alpha.98"
},
"devDependencies": {
"@types/node": "20.9.0",
"rollup": "4.3.0",
"typescript": "5.2.2"
"@types/node": "20.11.1",
"rollup": "4.9.5",
"typescript": "5.3.3"
},

@@ -52,0 +52,0 @@ "engines": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc