@algolia/client-query-suggestions 5.0.0-alpha.53 → 5.0.0-alpha.55

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.
Files changed (36) hide show
  1. package/dist/builds/browser.d.ts +5 -5
  2. package/dist/builds/node.d.ts +5 -5
  3. package/dist/client-query-suggestions.cjs.js +351 -351
  4. package/dist/client-query-suggestions.esm.browser.js +475 -475
  5. package/dist/client-query-suggestions.esm.node.js +351 -351
  6. package/dist/client-query-suggestions.umd.js +2 -2
  7. package/dist/model/clientMethodProps.d.ts +107 -107
  8. package/dist/model/errorBase.d.ts +6 -6
  9. package/dist/model/index.d.ts +13 -13
  10. package/dist/model/indexName.d.ts +6 -6
  11. package/dist/model/logFile.d.ts +16 -16
  12. package/dist/model/logLevel.d.ts +4 -4
  13. package/dist/model/querySuggestionsIndex.d.ts +19 -19
  14. package/dist/model/querySuggestionsIndexParam.d.ts +15 -15
  15. package/dist/model/querySuggestionsIndexWithIndexParam.d.ts +3 -3
  16. package/dist/model/sourceIndex.d.ts +31 -31
  17. package/dist/model/sourceIndexExternal.d.ts +10 -10
  18. package/dist/model/sourceIndexWithReplicas.d.ts +38 -38
  19. package/dist/model/status.d.ts +14 -14
  20. package/dist/model/successResponse.d.ts +10 -10
  21. package/dist/src/querySuggestionsClient.d.ts +141 -141
  22. package/model/clientMethodProps.ts +1 -1
  23. package/model/errorBase.ts +1 -1
  24. package/model/index.ts +1 -1
  25. package/model/indexName.ts +1 -1
  26. package/model/logFile.ts +1 -1
  27. package/model/logLevel.ts +1 -1
  28. package/model/querySuggestionsIndex.ts +1 -1
  29. package/model/querySuggestionsIndexParam.ts +1 -1
  30. package/model/querySuggestionsIndexWithIndexParam.ts +1 -1
  31. package/model/sourceIndex.ts +1 -1
  32. package/model/sourceIndexExternal.ts +1 -1
  33. package/model/sourceIndexWithReplicas.ts +1 -1
  34. package/model/status.ts +1 -1
  35. package/model/successResponse.ts +1 -1
  36. package/package.json +6 -6
@@ -1,2 +1,2 @@
1
- /*! client-query-suggestions.umd.js | 5.0.0-alpha.53 | © 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)||"{}")}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 m 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=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 g({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:s,algoliaAgent:a,timeouts:o,requester:i,requestsCache:u,responsesCache:g}){async function f(u,g,f=!0){const y=[],P=function(e,t){if("GET"===e.method||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(u,g),w=function(e,t,r){const s={Accept:"application/json",...e,...t,...r},a={};return Object.keys(s).forEach((e=>{const t=s[e];a[e.toLowerCase()]=t})),a}(r,u.headers,g.headers),q="GET"===u.method?{...u.data,...g.data}:{},v={...s,...u.queryParameters,...q};if(a.value&&(v["x-algolia-agent"]=a.value),g&&g.queryParameters)for(const e of Object.keys(g.queryParameters))g.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(g.queryParameters[e])?v[e]=g.queryParameters[e].toString():v[e]=g.queryParameters[e];let b=0;const T=async(e,r)=>{const s=e.pop();if(void 0===s)throw new c(function(e){return e.map((e=>p(e)))}(y));let a=g.timeout;void 0===a&&(a=f?o.read:o.write);const q={data:P,headers:w,method:u.method,url:h(s,u.path,v),connectTimeout:r(b,o.connect),responseTimeout:r(b,a)},x=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=x(E);return E.isTimedOut&&b++,console.log("Retryable failure",p(a)),await t.set(s,n(s,E.isTimedOut?"timed out":"down")),T(e,r)}if(function({status:e}){return 2==~~(e/100)}(E))return function(e){try{return JSON.parse(e.content)}catch(t){throw new d(t.message,e)}}(E);throw x(E),function({content:e,status:t},r){try{const s=JSON.parse(e);return"error"in s?new m(s.message,t,s.error,r):new l(s.message,t,r)}catch(e){}return new l(e,t,r)}(E,y)},x=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}}(x);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 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=1e3,P=2e3,w=3e4;const q="5.0.0-alpha.53",v=["eu","us"];e.apiClientVersion=q,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||!v.includes(n)))throw new Error(`\`region\` is required and must be one of the following: ${v.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:q}),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 `querySuggestionsIndexWithIndexParam` 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,querySuggestionsIndexParam:t},r){if(!e)throw new Error("Parameter `indexName` is required when calling `updateConfig`.");if(!t)throw new Error("Parameter `querySuggestionsIndexParam` is required when calling `updateConfig`.");if(!t.sourceIndices)throw new Error("Parameter `querySuggestionsIndexParam.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:y,read:P,write:w},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:`${q}-${e}`}),s()]}),...o})}}));
1
+ /*! client-query-suggestions.umd.js | 5.0.0-alpha.55 | © 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)||"{}")}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 m 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=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 g({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:s,algoliaAgent:a,timeouts:o,requester:i,requestsCache:u,responsesCache:g}){async function f(u,g,f=!0){const y=[],P=function(e,t){if("GET"===e.method||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(u,g),w=function(e,t,r){const s={Accept:"application/json",...e,...t,...r},a={};return Object.keys(s).forEach((e=>{const t=s[e];a[e.toLowerCase()]=t})),a}(r,u.headers,g.headers),q="GET"===u.method?{...u.data,...g.data}:{},v={...s,...u.queryParameters,...q};if(a.value&&(v["x-algolia-agent"]=a.value),g&&g.queryParameters)for(const e of Object.keys(g.queryParameters))g.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(g.queryParameters[e])?v[e]=g.queryParameters[e].toString():v[e]=g.queryParameters[e];let b=0;const T=async(e,r)=>{const s=e.pop();if(void 0===s)throw new c(function(e){return e.map((e=>p(e)))}(y));let a=g.timeout;void 0===a&&(a=f?o.read:o.write);const q={data:P,headers:w,method:u.method,url:h(s,u.path,v),connectTimeout:r(b,o.connect),responseTimeout:r(b,a)},x=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=x(E);return E.isTimedOut&&b++,console.log("Retryable failure",p(a)),await t.set(s,n(s,E.isTimedOut?"timed out":"down")),T(e,r)}if(function({status:e}){return 2==~~(e/100)}(E))return function(e){try{return JSON.parse(e.content)}catch(t){throw new d(t.message,e)}}(E);throw x(E),function({content:e,status:t},r){try{const s=JSON.parse(e);return"error"in s?new m(s.message,t,s.error,r):new l(s.message,t,r)}catch(e){}return new l(e,t,r)}(E,y)},x=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}}(x);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 g.get(o,(()=>u.get(o,(()=>u.set(o,n()).then((e=>Promise.all([u.delete(o),e])),(e=>Promise.all([u.delete(o),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>g.set(o,e)})},requestsCache:u,responsesCache:g}}function f({algoliaAgents:e,client:t,version:r}){const s=function(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}(r).add({segment:t,version:r});return e.forEach((e=>s.add(e))),s}const y="5.0.0-alpha.55",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 `querySuggestionsIndexWithIndexParam` 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,querySuggestionsIndexParam:t},r){if(!e)throw new Error("Parameter `indexName` is required when calling `updateConfig`.");if(!t)throw new Error("Parameter `querySuggestionsIndexParam` is required when calling `updateConfig`.");if(!t.sourceIndices)throw new Error("Parameter `querySuggestionsIndexParam.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,108 +1,108 @@
1
- import type { QuerySuggestionsIndexParam } from './querySuggestionsIndexParam';
2
- /**
3
- * Properties for the `del` method.
4
- */
5
- export type DelProps = {
6
- /**
7
- * The path of the API endpoint to target, anything after the /1 needs to be specified.
8
- */
9
- path: string;
10
- /**
11
- * Query parameters to be applied to the current query.
12
- */
13
- parameters?: Record<string, any>;
14
- };
15
- /**
16
- * Properties for the `deleteConfig` method.
17
- */
18
- export type DeleteConfigProps = {
19
- /**
20
- * The index in which to perform the request.
21
- */
22
- indexName: string;
23
- };
24
- /**
25
- * Properties for the `get` method.
26
- */
27
- export type GetProps = {
28
- /**
29
- * The path of the API endpoint to target, anything after the /1 needs to be specified.
30
- */
31
- path: string;
32
- /**
33
- * Query parameters to be applied to the current query.
34
- */
35
- parameters?: Record<string, any>;
36
- };
37
- /**
38
- * Properties for the `getConfig` method.
39
- */
40
- export type GetConfigProps = {
41
- /**
42
- * The index in which to perform the request.
43
- */
44
- indexName: string;
45
- };
46
- /**
47
- * Properties for the `getConfigStatus` method.
48
- */
49
- export type GetConfigStatusProps = {
50
- /**
51
- * The index in which to perform the request.
52
- */
53
- indexName: string;
54
- };
55
- /**
56
- * Properties for the `getLogFile` method.
57
- */
58
- export type GetLogFileProps = {
59
- /**
60
- * The index in which to perform the request.
61
- */
62
- indexName: string;
63
- };
64
- /**
65
- * Properties for the `post` method.
66
- */
67
- export type PostProps = {
68
- /**
69
- * The path of the API endpoint to target, anything after the /1 needs to be specified.
70
- */
71
- path: string;
72
- /**
73
- * Query parameters to be applied to the current query.
74
- */
75
- parameters?: Record<string, any>;
76
- /**
77
- * The parameters to send with the custom request.
78
- */
79
- body?: Record<string, any>;
80
- };
81
- /**
82
- * Properties for the `put` method.
83
- */
84
- export type PutProps = {
85
- /**
86
- * The path of the API endpoint to target, anything after the /1 needs to be specified.
87
- */
88
- path: string;
89
- /**
90
- * Query parameters to be applied to the current query.
91
- */
92
- parameters?: Record<string, any>;
93
- /**
94
- * The parameters to send with the custom request.
95
- */
96
- body?: Record<string, any>;
97
- };
98
- /**
99
- * Properties for the `updateConfig` method.
100
- */
101
- export type UpdateConfigProps = {
102
- /**
103
- * The index in which to perform the request.
104
- */
105
- indexName: string;
106
- querySuggestionsIndexParam: QuerySuggestionsIndexParam;
107
- };
1
+ import type { QuerySuggestionsIndexParam } from './querySuggestionsIndexParam';
2
+ /**
3
+ * Properties for the `del` method.
4
+ */
5
+ export type DelProps = {
6
+ /**
7
+ * The path of the API endpoint to target, anything after the /1 needs to be specified.
8
+ */
9
+ path: string;
10
+ /**
11
+ * Query parameters to be applied to the current query.
12
+ */
13
+ parameters?: Record<string, any>;
14
+ };
15
+ /**
16
+ * Properties for the `deleteConfig` method.
17
+ */
18
+ export type DeleteConfigProps = {
19
+ /**
20
+ * The index in which to perform the request.
21
+ */
22
+ indexName: string;
23
+ };
24
+ /**
25
+ * Properties for the `get` method.
26
+ */
27
+ export type GetProps = {
28
+ /**
29
+ * The path of the API endpoint to target, anything after the /1 needs to be specified.
30
+ */
31
+ path: string;
32
+ /**
33
+ * Query parameters to be applied to the current query.
34
+ */
35
+ parameters?: Record<string, any>;
36
+ };
37
+ /**
38
+ * Properties for the `getConfig` method.
39
+ */
40
+ export type GetConfigProps = {
41
+ /**
42
+ * The index in which to perform the request.
43
+ */
44
+ indexName: string;
45
+ };
46
+ /**
47
+ * Properties for the `getConfigStatus` method.
48
+ */
49
+ export type GetConfigStatusProps = {
50
+ /**
51
+ * The index in which to perform the request.
52
+ */
53
+ indexName: string;
54
+ };
55
+ /**
56
+ * Properties for the `getLogFile` method.
57
+ */
58
+ export type GetLogFileProps = {
59
+ /**
60
+ * The index in which to perform the request.
61
+ */
62
+ indexName: string;
63
+ };
64
+ /**
65
+ * Properties for the `post` method.
66
+ */
67
+ export type PostProps = {
68
+ /**
69
+ * The path of the API endpoint to target, anything after the /1 needs to be specified.
70
+ */
71
+ path: string;
72
+ /**
73
+ * Query parameters to be applied to the current query.
74
+ */
75
+ parameters?: Record<string, any>;
76
+ /**
77
+ * The parameters to send with the custom request.
78
+ */
79
+ body?: Record<string, any>;
80
+ };
81
+ /**
82
+ * Properties for the `put` method.
83
+ */
84
+ export type PutProps = {
85
+ /**
86
+ * The path of the API endpoint to target, anything after the /1 needs to be specified.
87
+ */
88
+ path: string;
89
+ /**
90
+ * Query parameters to be applied to the current query.
91
+ */
92
+ parameters?: Record<string, any>;
93
+ /**
94
+ * The parameters to send with the custom request.
95
+ */
96
+ body?: Record<string, any>;
97
+ };
98
+ /**
99
+ * Properties for the `updateConfig` method.
100
+ */
101
+ export type UpdateConfigProps = {
102
+ /**
103
+ * The index in which to perform the request.
104
+ */
105
+ indexName: string;
106
+ querySuggestionsIndexParam: QuerySuggestionsIndexParam;
107
+ };
108
108
  //# sourceMappingURL=clientMethodProps.d.ts.map
@@ -1,7 +1,7 @@
1
- /**
2
- * Error.
3
- */
4
- export type ErrorBase = Record<string, any> & {
5
- message?: string;
6
- };
1
+ /**
2
+ * Error.
3
+ */
4
+ export type ErrorBase = Record<string, any> & {
5
+ message?: string;
6
+ };
7
7
  //# sourceMappingURL=errorBase.d.ts.map
@@ -1,14 +1,14 @@
1
- export * from './errorBase';
2
- export * from './indexName';
3
- export * from './logFile';
4
- export * from './logLevel';
5
- export * from './querySuggestionsIndex';
6
- export * from './querySuggestionsIndexParam';
7
- export * from './querySuggestionsIndexWithIndexParam';
8
- export * from './sourceIndex';
9
- export * from './sourceIndexExternal';
10
- export * from './sourceIndexWithReplicas';
11
- export * from './status';
12
- export * from './successResponse';
13
- export * from './clientMethodProps';
1
+ export * from './errorBase';
2
+ export * from './indexName';
3
+ export * from './logFile';
4
+ export * from './logLevel';
5
+ export * from './querySuggestionsIndex';
6
+ export * from './querySuggestionsIndexParam';
7
+ export * from './querySuggestionsIndexWithIndexParam';
8
+ export * from './sourceIndex';
9
+ export * from './sourceIndexExternal';
10
+ export * from './sourceIndexWithReplicas';
11
+ export * from './status';
12
+ export * from './successResponse';
13
+ export * from './clientMethodProps';
14
14
  //# sourceMappingURL=index.d.ts.map
@@ -1,7 +1,7 @@
1
- export type IndexName = {
2
- /**
3
- * Index name to target.
4
- */
5
- indexName: string;
6
- };
1
+ export type IndexName = {
2
+ /**
3
+ * Index name to target.
4
+ */
5
+ indexName: string;
6
+ };
7
7
  //# sourceMappingURL=indexName.d.ts.map
@@ -1,17 +1,17 @@
1
- import type { LogLevel } from './logLevel';
2
- export type LogFile = {
3
- /**
4
- * Date and time of creation of the record.
5
- */
6
- timestamp: string;
7
- level: LogLevel;
8
- /**
9
- * Detailed description of what happened.
10
- */
11
- message: string;
12
- /**
13
- * Indicates the hierarchy of the records. For example, a record with contextLevel=1 belongs to a preceding record with contextLevel=0.
14
- */
15
- contextLevel: number;
16
- };
1
+ import type { LogLevel } from './logLevel';
2
+ export type LogFile = {
3
+ /**
4
+ * Date and time of creation of the record.
5
+ */
6
+ timestamp: string;
7
+ level: LogLevel;
8
+ /**
9
+ * Detailed description of what happened.
10
+ */
11
+ message: string;
12
+ /**
13
+ * Indicates the hierarchy of the records. For example, a record with contextLevel=1 belongs to a preceding record with contextLevel=0.
14
+ */
15
+ contextLevel: number;
16
+ };
17
17
  //# sourceMappingURL=logFile.d.ts.map
@@ -1,5 +1,5 @@
1
- /**
2
- * Type of the record, can be one of three values (INFO, SKIP or ERROR).
3
- */
4
- export type LogLevel = 'ERROR' | 'INFO' | 'SKIP';
1
+ /**
2
+ * Type of the record, can be one of three values (INFO, SKIP or ERROR).
3
+ */
4
+ export type LogLevel = 'ERROR' | 'INFO' | 'SKIP';
5
5
  //# sourceMappingURL=logLevel.d.ts.map
@@ -1,20 +1,20 @@
1
- import type { SourceIndexWithReplicas } from './sourceIndexWithReplicas';
2
- export type QuerySuggestionsIndex = {
3
- /**
4
- * Index name to target.
5
- */
6
- indexName: string;
7
- /**
8
- * List of source indices used to generate a Query Suggestions index.
9
- */
10
- sourceIndices: SourceIndexWithReplicas[];
11
- /**
12
- * De-duplicate singular and plural suggestions. For example, let\'s say your index contains English content, and that two suggestions “shoe” and “shoes” end up in your Query Suggestions index. If the English language is configured, only the most popular of those two suggestions would remain.
13
- */
14
- languages: string[];
15
- /**
16
- * List of words and patterns to exclude from the Query Suggestions index.
17
- */
18
- exclude: string[];
19
- };
1
+ import type { SourceIndexWithReplicas } from './sourceIndexWithReplicas';
2
+ export type QuerySuggestionsIndex = {
3
+ /**
4
+ * Index name to target.
5
+ */
6
+ indexName: string;
7
+ /**
8
+ * List of source indices used to generate a Query Suggestions index.
9
+ */
10
+ sourceIndices: SourceIndexWithReplicas[];
11
+ /**
12
+ * De-duplicate singular and plural suggestions. For example, let\'s say your index contains English content, and that two suggestions “shoe” and “shoes” end up in your Query Suggestions index. If the English language is configured, only the most popular of those two suggestions would remain.
13
+ */
14
+ languages: string[];
15
+ /**
16
+ * List of words and patterns to exclude from the Query Suggestions index.
17
+ */
18
+ exclude: string[];
19
+ };
20
20
  //# sourceMappingURL=querySuggestionsIndex.d.ts.map
@@ -1,16 +1,16 @@
1
- import type { SourceIndex } from './sourceIndex';
2
- export type QuerySuggestionsIndexParam = {
3
- /**
4
- * List of source indices used to generate a Query Suggestions index.
5
- */
6
- sourceIndices: SourceIndex[];
7
- /**
8
- * De-duplicate singular and plural suggestions. For example, let\'s say your index contains English content, and that two suggestions “shoe” and “shoes” end up in your Query Suggestions index. If the English language is configured, only the most popular of those two suggestions would remain.
9
- */
10
- languages?: string[];
11
- /**
12
- * List of words and patterns to exclude from the Query Suggestions index.
13
- */
14
- exclude?: string[];
15
- };
1
+ import type { SourceIndex } from './sourceIndex';
2
+ export type QuerySuggestionsIndexParam = {
3
+ /**
4
+ * List of source indices used to generate a Query Suggestions index.
5
+ */
6
+ sourceIndices: SourceIndex[];
7
+ /**
8
+ * De-duplicate singular and plural suggestions. For example, let\'s say your index contains English content, and that two suggestions “shoe” and “shoes” end up in your Query Suggestions index. If the English language is configured, only the most popular of those two suggestions would remain.
9
+ */
10
+ languages?: string[];
11
+ /**
12
+ * List of words and patterns to exclude from the Query Suggestions index.
13
+ */
14
+ exclude?: string[];
15
+ };
16
16
  //# sourceMappingURL=querySuggestionsIndexParam.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { IndexName } from './indexName';
2
- import type { QuerySuggestionsIndexParam } from './querySuggestionsIndexParam';
3
- export type QuerySuggestionsIndexWithIndexParam = IndexName & QuerySuggestionsIndexParam;
1
+ import type { IndexName } from './indexName';
2
+ import type { QuerySuggestionsIndexParam } from './querySuggestionsIndexParam';
3
+ export type QuerySuggestionsIndexWithIndexParam = IndexName & QuerySuggestionsIndexParam;
4
4
  //# sourceMappingURL=querySuggestionsIndexWithIndexParam.d.ts.map
@@ -1,32 +1,32 @@
1
- import type { SourceIndexExternal } from './sourceIndexExternal';
2
- export type SourceIndex = {
3
- /**
4
- * Source index name.
5
- */
6
- indexName: string;
7
- /**
8
- * List of analytics tags to filter the popular searches per tag.
9
- */
10
- analyticsTags?: string[];
11
- /**
12
- * List of facets to define as categories for the query suggestions.
13
- */
14
- facets?: Array<Record<string, any>>;
15
- /**
16
- * Minimum number of hits (e.g., matching records in the source index) to generate a suggestions.
17
- */
18
- minHits?: number;
19
- /**
20
- * Minimum number of required letters for a suggestion to remain.
21
- */
22
- minLetters?: number;
23
- /**
24
- * List of facet attributes used to generate Query Suggestions. The resulting suggestions are every combination of the facets in the nested list (e.g., (facetA and facetB) and facetC).
25
- */
26
- generate?: string[][];
27
- /**
28
- * List of external indices to use to generate custom Query Suggestions.
29
- */
30
- external?: SourceIndexExternal[];
31
- };
1
+ import type { SourceIndexExternal } from './sourceIndexExternal';
2
+ export type SourceIndex = {
3
+ /**
4
+ * Source index name.
5
+ */
6
+ indexName: string;
7
+ /**
8
+ * List of analytics tags to filter the popular searches per tag.
9
+ */
10
+ analyticsTags?: string[];
11
+ /**
12
+ * List of facets to define as categories for the query suggestions.
13
+ */
14
+ facets?: Array<Record<string, any>>;
15
+ /**
16
+ * Minimum number of hits (e.g., matching records in the source index) to generate a suggestions.
17
+ */
18
+ minHits?: number;
19
+ /**
20
+ * Minimum number of required letters for a suggestion to remain.
21
+ */
22
+ minLetters?: number;
23
+ /**
24
+ * List of facet attributes used to generate Query Suggestions. The resulting suggestions are every combination of the facets in the nested list (e.g., (facetA and facetB) and facetC).
25
+ */
26
+ generate?: string[][];
27
+ /**
28
+ * List of external indices to use to generate custom Query Suggestions.
29
+ */
30
+ external?: SourceIndexExternal[];
31
+ };
32
32
  //# sourceMappingURL=sourceIndex.d.ts.map
@@ -1,11 +1,11 @@
1
- export type SourceIndexExternal = {
2
- /**
3
- * The suggestion you would like to add.
4
- */
5
- query: string;
6
- /**
7
- * The measure of the suggestion relative popularity.
8
- */
9
- count: number;
10
- };
1
+ export type SourceIndexExternal = {
2
+ /**
3
+ * The suggestion you would like to add.
4
+ */
5
+ query: string;
6
+ /**
7
+ * The measure of the suggestion relative popularity.
8
+ */
9
+ count: number;
10
+ };
11
11
  //# sourceMappingURL=sourceIndexExternal.d.ts.map
@@ -1,39 +1,39 @@
1
- import type { SourceIndexExternal } from './sourceIndexExternal';
2
- /**
3
- * Source index with replicas used to generate a Query Suggestions index.
4
- */
5
- export type SourceIndexWithReplicas = {
6
- /**
7
- * True if the Query Suggestions index is a replicas.
8
- */
9
- replicas: boolean;
10
- /**
11
- * Source index name.
12
- */
13
- indexName: string;
14
- /**
15
- * List of analytics tags to filter the popular searches per tag.
16
- */
17
- analyticsTags: string[];
18
- /**
19
- * List of facets to define as categories for the query suggestions.
20
- */
21
- facets: Array<Record<string, any>>;
22
- /**
23
- * Minimum number of hits (e.g., matching records in the source index) to generate a suggestions.
24
- */
25
- minHits: number;
26
- /**
27
- * Minimum number of required letters for a suggestion to remain.
28
- */
29
- minLetters: number;
30
- /**
31
- * List of facet attributes used to generate Query Suggestions. The resulting suggestions are every combination of the facets in the nested list (e.g., (facetA and facetB) and facetC).
32
- */
33
- generate: string[][];
34
- /**
35
- * List of external indices to use to generate custom Query Suggestions.
36
- */
37
- external: SourceIndexExternal[];
38
- };
1
+ import type { SourceIndexExternal } from './sourceIndexExternal';
2
+ /**
3
+ * Source index with replicas used to generate a Query Suggestions index.
4
+ */
5
+ export type SourceIndexWithReplicas = {
6
+ /**
7
+ * True if the Query Suggestions index is a replicas.
8
+ */
9
+ replicas: boolean;
10
+ /**
11
+ * Source index name.
12
+ */
13
+ indexName: string;
14
+ /**
15
+ * List of analytics tags to filter the popular searches per tag.
16
+ */
17
+ analyticsTags: string[];
18
+ /**
19
+ * List of facets to define as categories for the query suggestions.
20
+ */
21
+ facets: Array<Record<string, any>>;
22
+ /**
23
+ * Minimum number of hits (e.g., matching records in the source index) to generate a suggestions.
24
+ */
25
+ minHits: number;
26
+ /**
27
+ * Minimum number of required letters for a suggestion to remain.
28
+ */
29
+ minLetters: number;
30
+ /**
31
+ * List of facet attributes used to generate Query Suggestions. The resulting suggestions are every combination of the facets in the nested list (e.g., (facetA and facetB) and facetC).
32
+ */
33
+ generate: string[][];
34
+ /**
35
+ * List of external indices to use to generate custom Query Suggestions.
36
+ */
37
+ external: SourceIndexExternal[];
38
+ };
39
39
  //# sourceMappingURL=sourceIndexWithReplicas.d.ts.map