@algolia/client-search 5.55.1 → 5.56.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/browser.d.ts +858 -5
- package/dist/builds/browser.js +1909 -91
- package/dist/builds/browser.js.map +1 -1
- package/dist/builds/browser.min.js +4 -4
- package/dist/builds/browser.min.js.map +1 -1
- package/dist/builds/browser.umd.js +6 -6
- package/dist/builds/fetch.js +1909 -91
- package/dist/builds/fetch.js.map +1 -1
- package/dist/builds/node.cjs +1909 -91
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +1909 -91
- package/dist/builds/node.js.map +1 -1
- package/dist/builds/worker.js +1909 -91
- package/dist/builds/worker.js.map +1 -1
- package/dist/fetch.d.ts +858 -5
- package/dist/node.d.cts +858 -5
- package/dist/node.d.ts +858 -5
- package/dist/src/searchClient.cjs +1909 -91
- package/dist/src/searchClient.cjs.map +1 -1
- package/dist/src/searchClient.js +1909 -91
- package/dist/src/searchClient.js.map +1 -1
- package/dist/worker.d.ts +858 -5
- package/package.json +9 -9
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@algolia/client-search"] = {}));
|
|
5
5
|
})(this, (function (exports) { 'use strict';
|
|
6
6
|
|
|
7
|
-
function
|
|
7
|
+
function Z(p){let c,h=`algolia-client-js-${p.key}`;function m(){return c===void 0&&(c=p.localStorage||window.localStorage),c}function l(){return JSON.parse(m().getItem(h)||"{}")}function f(t){m().setItem(h,JSON.stringify(t));}function u(){return new Promise(t=>setTimeout(t,0))}function e(){let t=p.timeToLive?p.timeToLive*1e3:null,r=l(),a=new Date().getTime(),o=false;return {namespace:Object.fromEntries(Object.entries(r).filter(([,i])=>!i||i.timestamp===void 0||t&&i.timestamp+t<a?(o=true,false):true)),changed:o}}return {get(t,r,a={miss:()=>Promise.resolve()}){return u().then(()=>{let{namespace:o,changed:s}=e(),i=o[JSON.stringify(t)];return s&&f(o),i?i.value:r().then(d=>a.miss(d).then(()=>d))})},set(t,r){return u().then(()=>{let a=l();return a[JSON.stringify(t)]={timestamp:new Date().getTime(),value:r},m().setItem(h,JSON.stringify(a)),r})},delete(t){return u().then(()=>{let r=l();delete r[JSON.stringify(t)],m().setItem(h,JSON.stringify(r));})},clear(){return Promise.resolve().then(()=>{m().removeItem(h);})}}}function me(){return {get(p,c,h={miss:()=>Promise.resolve()}){return c().then(l=>Promise.all([l,h.miss(l)])).then(([l])=>l)},set(p,c){return Promise.resolve(c)},delete(p){return Promise.resolve()},clear(){return Promise.resolve()}}}function E(p){let c=[...p.caches],h=c.shift();return h===void 0?me():{get(m,l,f={miss:()=>Promise.resolve()}){return h.get(m,l,f).catch(()=>E({caches:c}).get(m,l,f))},set(m,l){return h.set(m,l).catch(()=>E({caches:c}).set(m,l))},delete(m){return h.delete(m).catch(()=>E({caches:c}).delete(m))},clear(){return h.clear().catch(()=>E({caches:c}).clear())}}}function k(p={serializable:true}){let c={};return {get(h,m,l={miss:()=>Promise.resolve()}){let f=JSON.stringify(h);if(f in c)return Promise.resolve(p.serializable?JSON.parse(c[f]):c[f]);let u=m();return u.then(e=>l.miss(e)).then(()=>u)},set(h,m){return c[JSON.stringify(h)]=p.serializable?JSON.stringify(m):m,Promise.resolve(m)},delete(h){return delete c[JSON.stringify(h)],Promise.resolve()},clear(){return c={},Promise.resolve()}}}var ee=800;function he(p){let c={value:`Algolia for JavaScript (${p})`,add(h){let m=`; ${h.segment}${h.version!==void 0?` (${h.version})`:""}`;return c.value.indexOf(m)===-1&&(c.value=`${c.value}${m}`),c}};return c}function te(p,c,h="WithinHeaders"){let m={"x-algolia-api-key":c,"x-algolia-application-id":p};return {headers(){return h==="WithinHeaders"?m:{}},queryParameters(){return h==="WithinQueryParameters"?m:{}}}}function W({func:p,validate:c,aggregator:h,error:m,timeout:l=()=>0}){let f=u=>new Promise((e,t)=>{p(u).then(async r=>(h&&await h(r),await c(r)?e(r):m&&await m.validate(r)?t(new Error(await m.message(r))):setTimeout(()=>{f(r).then(e).catch(t);},await l()))).catch(r=>{t(r);});});return f()}function re({algoliaAgents:p,client:c,version:h}){let m=he(h).add({segment:c,version:h});return p.forEach(l=>m.add(l)),m}function se(){return {debug(p,c){return Promise.resolve()},info(p,c){return Promise.resolve()},error(p,c){return Promise.resolve()}}}var Pe=10*1024*1024;async function*le(p){let c=p.getReader();try{for(;;){let{done:h,value:m}=await c.read();if(h)return;yield m;}}finally{c.releaseLock();}}function qe(p){return Symbol.asyncIterator in p?p:le(p)}async function*ye(p){let c=new TextDecoder("utf-8"),h=[],m=0,l=false,f=true;for await(let e of qe(p)){let t=c.decode(e,{stream:true}),r=0;for(l&&(l=false,t.length>0&&t[0]===`
|
|
8
8
|
`&&(r=1));r<t.length;){let a=t.indexOf("\r",r),o=t.indexOf(`
|
|
9
|
-
`,r);if(a===-1&&o===-1){let
|
|
10
|
-
`?2:1:(l=true,
|
|
11
|
-
`),event:n,id:this.lastEventId,retry:this.retry};return this.data=[],i}};async function*fe(n){let i=new ye;for await(let d of Pe(n)){let p=i.decode(d);p!==null&&(yield p);}}var qe=750,$=120*1e3;function W(n,i="up"){let d=Date.now();function p(){return i==="up"||Date.now()-d>$}function l(){return i==="timed out"&&Date.now()-d<=$}return {...n,status:i,lastUpdate:d,isUp:p,isTimedOut:l}}var se=class extends Error{name="AlgoliaError";constructor(n,i){super(n),i&&(this.name=i);}};var oe=class extends se{stackTrace;constructor(n,i,d){super(n,d),this.stackTrace=i;}},J=class extends oe{constructor(n){super("Unreachable hosts - your application id may be incorrect. If the error persists, please visit our help center https://alg.li/support-unreachable-hosts or reach out to the Algolia Support team: https://alg.li/support",n,"RetryError");}},j=class extends oe{status;constructor(n,i,d,p="ApiError"){super(n,d,p),this.status=i;}},Re=class extends se{response;constructor(n,i){super(n,"DeserializationError"),this.response=i;}},xe=class extends j{error;constructor(n,i,d,p){super(n,i,p,"DetailedApiError"),this.error=d;}};function ae(n){let i=n;for(let d=n.length-1;d>0;d--){let p=Math.floor(Math.random()*(d+1)),l=n[d];i[d]=n[p],i[p]=l;}return i}function z(n,i,d){let p=ge(d),l=`${n.protocol}://${n.url}${n.port?`:${n.port}`:""}/${i.charAt(0)==="/"?i.substring(1):i}`;return p.length&&(l+=`?${p}`),l}function ge(n){return Object.keys(n).filter(i=>n[i]!==void 0).sort().map(i=>`${i}=${encodeURIComponent(Object.prototype.toString.call(n[i])==="[object Array]"?n[i].join(","):n[i]).replace(/\+/g,"%20")}`).join("&")}function V(n,i){if(n.method==="GET"||n.data===void 0&&i.data===void 0)return;let d=Array.isArray(n.data)?n.data:{...n.data,...i.data};return JSON.stringify(d)}function X(n,i,d){let p={Accept:"application/json",...n,...i,...d},l={};return Object.keys(p).forEach(q=>{let m=p[q];l[q.toLowerCase()]=m;}),l}function Se(n){if(!(n.status===204||n.content.length===0))try{return JSON.parse(n.content)}catch(i){throw new Re(i.message,n)}}function Oe({content:n,status:i},d){try{let p=JSON.parse(n);return "error"in p?new xe(p.message,i,p.error,d):new j(p.message,i,d)}catch{}return new j(n,i,d)}function Ie({isTimedOut:n,status:i}){return !n&&~~i===0}function Te({isTimedOut:n,status:i}){return n||Ie({isTimedOut:n,status:i})||~~(i/100)!==2&&~~(i/100)!==4}function be({status:n}){return ~~(n/100)===2}function Ae(n){return n.map(i=>ne(i))}function ne(n){let i=n.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return {...n,request:{...n.request,headers:{...n.request.headers,...i}}}}function ie({hosts:n,hostsCache:i,baseHeaders:d,logger:p,baseQueryParameters:l,algoliaAgent:q,timeouts:m,requester:e,requestsCache:t,responsesCache:r,compress:a,compression:o}){async function s(f){let P=await Promise.all(f.map(R=>i.get(R,()=>Promise.resolve(W(R))))),x=P.filter(R=>R.isUp()),S=P.filter(R=>R.isTimedOut()),I=[...x,...S];return {hosts:I.length>0?I:f,getTimeout(R,b){return (S.length===0&&R===0?1:S.length+3+R)*b}}}async function c(f,P,x){let S=[],I=V(f,P),g=X(d,f.headers,P.headers),R=o==="gzip"&&I!==void 0&&I.length>qe&&(f.method==="POST"||f.method==="PUT");R&&a===void 0&&p.info("Compression is disabled because no compress method is available.");let b=R&&a!==void 0,Q=b?await a(I):I;b&&(g["content-encoding"]="gzip");let C=f.method==="GET"?{...f.data,...P.data}:{},A={...l,...f.queryParameters,...C};if(q.value&&(A["x-algolia-agent"]=q.value),P&&P.queryParameters)for(let O of Object.keys(P.queryParameters))!P.queryParameters[O]||Object.prototype.toString.call(P.queryParameters[O])==="[object Object]"?A[O]=P.queryParameters[O]:A[O]=P.queryParameters[O].toString();let D=0,k=async(O,G)=>{let w=O.pop();if(w===void 0)throw new J(Ae(S));let L={...m,...P.timeouts},K={data:Q,headers:g,method:f.method,url:z(w,f.path,A),connectTimeout:G(D,L.connect),responseTimeout:G(D,x?L.read:L.write)},_=B=>{let M={request:K,response:B,host:w,triesLeft:O.length};return S.push(M),M},U=await e.send(K);if(Te(U)){let B=_(U);return U.isTimedOut&&D++,p.info("Retryable failure",ne(B)),await i.set(w,W(w,U.isTimedOut?"timed out":"down")),k(O,G)}if(be(U))return Se(U);throw _(U),Oe(U,S)},T=n.filter(O=>O.accept==="readWrite"||(x?O.accept==="read":O.accept==="write")),F=await s(T);return k([...F.hosts].reverse(),F.getTimeout)}function h(f,P={}){let x=()=>c(f,P,S),S=f.useReadTransporter||f.method==="GET";if((P.cacheable||f.cacheable)!==true)return x();let g={request:f,requestOptions:P,transporter:{queryParameters:l,headers:d}};return r.get(g,()=>t.get(g,()=>t.set(g,x()).then(R=>Promise.all([t.delete(g),R]),R=>Promise.all([t.delete(g),Promise.reject(R)])).then(([R,b])=>b)),{miss:R=>r.set(g,R)})}async function*y(f,P={}){if(!e.sendStream)throw new Error("This requester does not support streaming");let x=V(f,P),S=X(d,f.headers,P.headers);S.accept="text/event-stream";let I=f.method==="GET"?{...f.data,...P.data}:{},g={...l,...f.queryParameters,...I};if(q.value&&(g["x-algolia-agent"]=q.value),P&&P.queryParameters)for(let T of Object.keys(P.queryParameters))!P.queryParameters[T]||Object.prototype.toString.call(P.queryParameters[T])==="[object Object]"?g[T]=P.queryParameters[T]:g[T]=P.queryParameters[T].toString();let R=f.useReadTransporter||f.method==="GET",b=n.filter(T=>T.accept==="readWrite"||(R?T.accept==="read":T.accept==="write")),C=(await s(b)).hosts[0];if(!C)throw new J([]);let A={...m,...P.timeouts},D={data:x,headers:S,method:f.method,url:z(C,f.path,g),connectTimeout:A.connect,responseTimeout:R?A.read:A.write},k=await e.sendStream(D);yield*fe(k);}return {hostsCache:i,requester:e,timeouts:m,logger:p,algoliaAgent:q,baseHeaders:d,baseQueryParameters:l,hosts:n,request:h,requestStream:y,requestsCache:t,responsesCache:r}}function u(n,i,d){if(d==null||typeof d=="string"&&d.length===0)throw new Error(`Parameter \`${n}\` is required when calling \`${i}\`.`)}function ce(){function n(i){return new Promise(d=>{let p=new XMLHttpRequest;p.open(i.method,i.url,true),Object.keys(i.headers).forEach(e=>p.setRequestHeader(e,i.headers[e]));let l=(e,t)=>setTimeout(()=>{p.abort(),d({status:0,content:t,isTimedOut:true});},e),q=l(i.connectTimeout,"Connection timeout"),m;p.onreadystatechange=()=>{p.readyState>p.OPENED&&m===void 0&&(clearTimeout(q),m=l(i.responseTimeout,"Socket timeout"));},p.onerror=()=>{p.status===0&&(clearTimeout(q),clearTimeout(m),d({content:p.responseText||"Network request failed",status:p.status,isTimedOut:false}));},p.onload=()=>{clearTimeout(q),clearTimeout(m),d({content:p.responseText,status:p.status,isTimedOut:false});},p.send(i.data);})}return {send:n}}var H="5.55.1";function Ue(n){return [{url:`${n}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${n}.algolia.net`,accept:"write",protocol:"https"}].concat(ae([{url:`${n}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${n}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${n}-3.algolianet.com`,accept:"readWrite",protocol:"https"}]))}function ue({appId:n,apiKey:i,authMode:d,algoliaAgents:p,...l}){let q=ee(n,i,d),m=ie({hosts:Ue(n),...l,algoliaAgent:te({algoliaAgents:p,client:"Search",version:H}),baseHeaders:{"content-type":"text/plain",...q.headers(),...l.baseHeaders},baseQueryParameters:{...q.queryParameters(),...l.baseQueryParameters}});return {transporter:m,appId:n,apiKey:i,clearCache(){return Promise.all([m.requestsCache.clear(),m.responsesCache.clear()]).then(()=>{})},get _ua(){return m.algoliaAgent.value},addAlgoliaAgent(e,t){m.algoliaAgent.add({segment:e,version:t});},setClientApiKey({apiKey:e}){!d||d==="WithinHeaders"?m.baseHeaders["x-algolia-api-key"]=e:m.baseQueryParameters["x-algolia-api-key"]=e;},waitForTask({indexName:e,taskID:t,maxRetries:r=100,timeout:a=s=>Math.min(s*200,5e3)},o){let s=0;return E({func:()=>this.getTask({indexName:e,taskID:t},o),validate:c=>c.status==="published",aggregator:()=>s+=1,error:{validate:()=>s>=r,message:()=>`Stopped waiting for the task after ${r} retries. This does not mean the operation failed; it may still complete. If you need to keep polling, retry with a higher maxRetries.`},timeout:()=>a(s)})},waitForAppTask({taskID:e,maxRetries:t=100,timeout:r=o=>Math.min(o*200,5e3)},a){let o=0;return E({func:()=>this.getAppTask({taskID:e},a),validate:s=>s.status==="published",aggregator:()=>o+=1,error:{validate:()=>o>=t,message:()=>`Stopped waiting for the task after ${t} retries. This does not mean the operation failed; it may still complete. If you need to keep polling, retry with a higher maxRetries.`},timeout:()=>r(o)})},waitForApiKey({operation:e,key:t,apiKey:r,maxRetries:a=100,timeout:o=c=>Math.min(c*200,5e3)},s){let c=0,h={aggregator:()=>c+=1,error:{validate:()=>c>=a,message:()=>`Stopped waiting for the API key operation after ${a} retries. This does not mean the operation failed; it may still complete. If you need to keep polling, retry with a higher maxRetries.`},timeout:()=>o(c)};if(e==="update"){if(!r)throw new Error("`apiKey` is required when waiting for an `update` operation.");return E({...h,func:()=>this.getApiKey({key:t},s),validate:y=>{for(let f of Object.keys(r)){let P=r[f],x=y[f];if(Array.isArray(P)&&Array.isArray(x)){if(P.length!==x.length||P.some((S,I)=>S!==x[I]))return false}else if(P!==x)return false}return true}})}return E({...h,func:()=>this.getApiKey({key:t},s).catch(y=>{if(y.status!==404)throw y}),validate:y=>e==="add"?y!==void 0:y===void 0})},browseObjects({indexName:e,browseParams:t,...r},a){return E({func:o=>this.browse({indexName:e,browseParams:{cursor:o?o.cursor:void 0,hitsPerPage:1e3,...t}},a),validate:o=>o.cursor===void 0,...r})},browseRules({indexName:e,searchRulesParams:t,...r},a){let o={...t,hitsPerPage:t?.hitsPerPage||1e3};return E({func:s=>this.searchRules({indexName:e,searchRulesParams:{...o,page:s?s.page+1:o.page||0}},a),validate:s=>s.hits.length<o.hitsPerPage,...r})},browseSynonyms({indexName:e,searchSynonymsParams:t,...r},a){let o={...t,page:t?.page||0,hitsPerPage:1e3};return E({func:s=>{let c=this.searchSynonyms({indexName:e,searchSynonymsParams:{...o,page:o.page}},a);return o.page+=1,c},validate:s=>s.hits.length<o.hitsPerPage,...r})},async chunkedBatch({indexName:e,objects:t,action:r="addObject",waitForTasks:a,batchSize:o=1e3,maxRetries:s=100},c){let h=[],y=[],f=t.entries();for(let[P,x]of f)h.push({action:r,body:x}),(h.length===o||P===t.length-1)&&(y.push(await this.batch({indexName:e,batchWriteParams:{requests:h}},c)),h=[]);if(a)for(let P of y)await this.waitForTask({indexName:e,taskID:P.taskID,maxRetries:s});return y},async saveObjects({indexName:e,objects:t,waitForTasks:r,batchSize:a,maxRetries:o},s){return await this.chunkedBatch({indexName:e,objects:t,action:"addObject",waitForTasks:r,batchSize:a,maxRetries:o},s)},async deleteObjects({indexName:e,objectIDs:t,waitForTasks:r,batchSize:a,maxRetries:o},s){return await this.chunkedBatch({indexName:e,objects:t.map(c=>({objectID:c})),action:"deleteObject",waitForTasks:r,batchSize:a,maxRetries:o},s)},async partialUpdateObjects({indexName:e,objects:t,createIfNotExists:r,waitForTasks:a,batchSize:o,maxRetries:s},c){return await this.chunkedBatch({indexName:e,objects:t,action:r?"partialUpdateObject":"partialUpdateObjectNoCreate",batchSize:o,waitForTasks:a,maxRetries:s},c)},async replaceAllObjects({indexName:e,objects:t,batchSize:r,scopes:a,maxRetries:o=Z},s){let c=Math.floor(Math.random()*1e6)+1e5,h=`${e}_tmp_${c}`;a===void 0&&(a=["settings","rules","synonyms"]);try{let y=await this.operationIndex({indexName:e,operationIndexParams:{operation:"copy",destination:h,scope:a}},s),f=await this.chunkedBatch({indexName:h,objects:t,waitForTasks:!0,batchSize:r,maxRetries:o},s);await this.waitForTask({indexName:h,taskID:y.taskID,maxRetries:o}),y=await this.operationIndex({indexName:e,operationIndexParams:{operation:"copy",destination:h,scope:a}},s),await this.waitForTask({indexName:h,taskID:y.taskID,maxRetries:o});let P=await this.operationIndex({indexName:h,operationIndexParams:{operation:"move",destination:e}},s);return await this.waitForTask({indexName:h,taskID:P.taskID,maxRetries:o}),{copyOperationResponse:y,batchResponses:f,moveOperationResponse:P}}catch(y){throw await this.deleteIndex({indexName:h}),y}},async indexExists({indexName:e}){try{await this.getSettings({indexName:e});}catch(t){if(t instanceof j&&t.status===404)return false;throw t}return true},searchForHits(e,t){return this.search(e,t)},searchForFacets(e,t){return this.search(e,t)},addApiKey(e,t){u("apiKey","addApiKey",e),u("apiKey.acl","addApiKey",e.acl);let s={method:"POST",path:"/1/keys",queryParameters:{},headers:{},data:e};return m.request(s,t)},addOrUpdateObject({indexName:e,objectID:t,body:r},a){u("indexName","addOrUpdateObject",e),u("objectID","addOrUpdateObject",t),u("body","addOrUpdateObject",r);let h={method:"PUT",path:"/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),queryParameters:{},headers:{},data:r};return m.request(h,a)},appendSource(e,t){u("source","appendSource",e),u("source.source","appendSource",e.source);let s={method:"POST",path:"/1/security/sources/append",queryParameters:{},headers:{},data:e};return m.request(s,t)},assignUserId({xAlgoliaUserID:e,assignUserIdParams:t},r){u("xAlgoliaUserID","assignUserId",e),u("assignUserIdParams","assignUserId",t),u("assignUserIdParams.cluster","assignUserId",t.cluster);let a="/1/clusters/mapping",o={},s={};e!==void 0&&(o["X-Algolia-User-ID"]=e.toString());let c={method:"POST",path:a,queryParameters:s,headers:o,data:t};return m.request(c,r)},batch({indexName:e,batchWriteParams:t},r){u("indexName","batch",e),u("batchWriteParams","batch",t),u("batchWriteParams.requests","batch",t.requests);let c={method:"POST",path:"/1/indexes/{indexName}/batch".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return m.request(c,r)},batchAssignUserIds({xAlgoliaUserID:e,batchAssignUserIdsParams:t},r){u("xAlgoliaUserID","batchAssignUserIds",e),u("batchAssignUserIdsParams","batchAssignUserIds",t),u("batchAssignUserIdsParams.cluster","batchAssignUserIds",t.cluster),u("batchAssignUserIdsParams.users","batchAssignUserIds",t.users);let a="/1/clusters/mapping/batch",o={},s={};e!==void 0&&(o["X-Algolia-User-ID"]=e.toString());let c={method:"POST",path:a,queryParameters:s,headers:o,data:t};return m.request(c,r)},batchDictionaryEntries({dictionaryName:e,batchDictionaryEntriesParams:t},r){u("dictionaryName","batchDictionaryEntries",e),u("batchDictionaryEntriesParams","batchDictionaryEntries",t),u("batchDictionaryEntriesParams.requests","batchDictionaryEntries",t.requests);let c={method:"POST",path:"/1/dictionaries/{dictionaryName}/batch".replace("{dictionaryName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return m.request(c,r)},browse({indexName:e,browseParams:t},r){u("indexName","browse",e);let c={method:"POST",path:"/1/indexes/{indexName}/browse".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t||{},useReadTransporter:true};return m.request(c,r)},clearObjects({indexName:e},t){u("indexName","clearObjects",e);let s={method:"POST",path:"/1/indexes/{indexName}/clear".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return m.request(s,t)},clearRules({indexName:e,forwardToReplicas:t},r){u("indexName","clearRules",e);let a="/1/indexes/{indexName}/rules/clear".replace("{indexName}",encodeURIComponent(e)),o={},s={};t!==void 0&&(s.forwardToReplicas=t.toString());let c={method:"POST",path:a,queryParameters:s,headers:o};return m.request(c,r)},clearSynonyms({indexName:e,forwardToReplicas:t},r){u("indexName","clearSynonyms",e);let a="/1/indexes/{indexName}/synonyms/clear".replace("{indexName}",encodeURIComponent(e)),o={},s={};t!==void 0&&(s.forwardToReplicas=t.toString());let c={method:"POST",path:a,queryParameters:s,headers:o};return m.request(c,r)},customDelete({path:e,parameters:t},r){u("path","customDelete",e);let c={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return m.request(c,r)},customGet({path:e,parameters:t},r){u("path","customGet",e);let c={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return m.request(c,r)},customPost({path:e,parameters:t,body:r},a){u("path","customPost",e);let h={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return m.request(h,a)},customPut({path:e,parameters:t,body:r},a){u("path","customPut",e);let h={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return m.request(h,a)},deleteApiKey({key:e},t){u("key","deleteApiKey",e);let s={method:"DELETE",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(e)),queryParameters:{},headers:{}};return m.request(s,t)},deleteBy({indexName:e,deleteByParams:t},r){u("indexName","deleteBy",e),u("deleteByParams","deleteBy",t);let c={method:"POST",path:"/1/indexes/{indexName}/deleteByQuery".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return m.request(c,r)},deleteIndex({indexName:e},t){u("indexName","deleteIndex",e);let s={method:"DELETE",path:"/1/indexes/{indexName}".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return m.request(s,t)},deleteObject({indexName:e,objectID:t},r){u("indexName","deleteObject",e),u("objectID","deleteObject",t);let c={method:"DELETE",path:"/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return m.request(c,r)},deleteRule({indexName:e,objectID:t,forwardToReplicas:r},a){u("indexName","deleteRule",e),u("objectID","deleteRule",t);let o="/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),s={},c={};r!==void 0&&(c.forwardToReplicas=r.toString());let h={method:"DELETE",path:o,queryParameters:c,headers:s};return m.request(h,a)},deleteSource({source:e},t){u("source","deleteSource",e);let s={method:"DELETE",path:"/1/security/sources/{source}".replace("{source}",encodeURIComponent(e)),queryParameters:{},headers:{}};return m.request(s,t)},deleteSynonym({indexName:e,objectID:t,forwardToReplicas:r},a){u("indexName","deleteSynonym",e),u("objectID","deleteSynonym",t);let o="/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),s={},c={};r!==void 0&&(c.forwardToReplicas=r.toString());let h={method:"DELETE",path:o,queryParameters:c,headers:s};return m.request(h,a)},getApiKey({key:e},t){u("key","getApiKey",e);let s={method:"GET",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(e)),queryParameters:{},headers:{}};return m.request(s,t)},getAppTask({taskID:e},t){u("taskID","getAppTask",e);let s={method:"GET",path:"/1/task/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return m.request(s,t)},getDictionaryLanguages(e){let o={method:"GET",path:"/1/dictionaries/*/languages",queryParameters:{},headers:{}};return m.request(o,e)},getDictionarySettings(e){let o={method:"GET",path:"/1/dictionaries/*/settings",queryParameters:{},headers:{}};return m.request(o,e)},getLogs({offset:e,length:t,indexName:r,type:a}={},o=void 0){let s="/1/logs",c={},h={};e!==void 0&&(h.offset=e.toString()),t!==void 0&&(h.length=t.toString()),r!==void 0&&(h.indexName=r.toString()),a!==void 0&&(h.type=a.toString());let y={method:"GET",path:s,queryParameters:h,headers:c};return m.request(y,o)},getObject({indexName:e,objectID:t,attributesToRetrieve:r},a){u("indexName","getObject",e),u("objectID","getObject",t);let o="/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),s={},c={};r!==void 0&&(c.attributesToRetrieve=r.toString());let h={method:"GET",path:o,queryParameters:c,headers:s};return m.request(h,a)},getObjects(e,t){u("getObjectsParams","getObjects",e),u("getObjectsParams.requests","getObjects",e.requests);let s={method:"POST",path:"/1/indexes/*/objects",queryParameters:{},headers:{},data:e,useReadTransporter:true,cacheable:true};return m.request(s,t)},getRule({indexName:e,objectID:t},r){u("indexName","getRule",e),u("objectID","getRule",t);let c={method:"GET",path:"/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return m.request(c,r)},getSettings({indexName:e,getVersion:t},r){u("indexName","getSettings",e);let a="/1/indexes/{indexName}/settings".replace("{indexName}",encodeURIComponent(e)),o={},s={};t!==void 0&&(s.getVersion=t.toString());let c={method:"GET",path:a,queryParameters:s,headers:o};return m.request(c,r)},getSources(e){let o={method:"GET",path:"/1/security/sources",queryParameters:{},headers:{}};return m.request(o,e)},getSynonym({indexName:e,objectID:t},r){u("indexName","getSynonym",e),u("objectID","getSynonym",t);let c={method:"GET",path:"/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return m.request(c,r)},getTask({indexName:e,taskID:t},r){u("indexName","getTask",e),u("taskID","getTask",t);let c={method:"GET",path:"/1/indexes/{indexName}/task/{taskID}".replace("{indexName}",encodeURIComponent(e)).replace("{taskID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return m.request(c,r)},getTopUserIds(e){let o={method:"GET",path:"/1/clusters/mapping/top",queryParameters:{},headers:{}};return m.request(o,e)},getUserId({userID:e},t){u("userID","getUserId",e);let s={method:"GET",path:"/1/clusters/mapping/{userID}".replace("{userID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return m.request(s,t)},hasPendingMappings({getClusters:e}={},t=void 0){let r="/1/clusters/mapping/pending",a={},o={};e!==void 0&&(o.getClusters=e.toString());let s={method:"GET",path:r,queryParameters:o,headers:a};return m.request(s,t)},listApiKeys(e){let o={method:"GET",path:"/1/keys",queryParameters:{},headers:{}};return m.request(o,e)},listClusters(e){let o={method:"GET",path:"/1/clusters",queryParameters:{},headers:{}};return m.request(o,e)},listIndices({page:e,hitsPerPage:t}={},r=void 0){let a="/1/indexes",o={},s={};e!==void 0&&(s.page=e.toString()),t!==void 0&&(s.hitsPerPage=t.toString());let c={method:"GET",path:a,queryParameters:s,headers:o};return m.request(c,r)},listUserIds({page:e,hitsPerPage:t}={},r=void 0){let a="/1/clusters/mapping",o={},s={};e!==void 0&&(s.page=e.toString()),t!==void 0&&(s.hitsPerPage=t.toString());let c={method:"GET",path:a,queryParameters:s,headers:o};return m.request(c,r)},multipleBatch(e,t){u("batchParams","multipleBatch",e),u("batchParams.requests","multipleBatch",e.requests);let s={method:"POST",path:"/1/indexes/*/batch",queryParameters:{},headers:{},data:e};return m.request(s,t)},operationIndex({indexName:e,operationIndexParams:t},r){u("indexName","operationIndex",e),u("operationIndexParams","operationIndex",t),u("operationIndexParams.operation","operationIndex",t.operation),u("operationIndexParams.destination","operationIndex",t.destination);let c={method:"POST",path:"/1/indexes/{indexName}/operation".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return m.request(c,r)},partialUpdateObject({indexName:e,objectID:t,attributesToUpdate:r,createIfNotExists:a},o){u("indexName","partialUpdateObject",e),u("objectID","partialUpdateObject",t),u("attributesToUpdate","partialUpdateObject",r);let s="/1/indexes/{indexName}/{objectID}/partial".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),c={},h={};a!==void 0&&(h.createIfNotExists=a.toString());let y={method:"POST",path:s,queryParameters:h,headers:c,data:r};return m.request(y,o)},removeUserId({userID:e},t){u("userID","removeUserId",e);let s={method:"DELETE",path:"/1/clusters/mapping/{userID}".replace("{userID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return m.request(s,t)},replaceSources({source:e},t){u("source","replaceSources",e);let s={method:"PUT",path:"/1/security/sources",queryParameters:{},headers:{},data:e};return m.request(s,t)},restoreApiKey({key:e},t){u("key","restoreApiKey",e);let s={method:"POST",path:"/1/keys/{key}/restore".replace("{key}",encodeURIComponent(e)),queryParameters:{},headers:{}};return m.request(s,t)},saveObject({indexName:e,body:t},r){u("indexName","saveObject",e),u("body","saveObject",t);let c={method:"POST",path:"/1/indexes/{indexName}".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return m.request(c,r)},saveRule({indexName:e,objectID:t,rule:r,forwardToReplicas:a},o){u("indexName","saveRule",e),u("objectID","saveRule",t),u("rule","saveRule",r),u("rule.objectID","saveRule",r.objectID),u("rule.consequence","saveRule",r.consequence);let s="/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),c={},h={};a!==void 0&&(h.forwardToReplicas=a.toString());let y={method:"PUT",path:s,queryParameters:h,headers:c,data:r};return m.request(y,o)},saveRules({indexName:e,rules:t,forwardToReplicas:r,clearExistingRules:a},o){u("indexName","saveRules",e),u("rules","saveRules",t);let s="/1/indexes/{indexName}/rules/batch".replace("{indexName}",encodeURIComponent(e)),c={},h={};r!==void 0&&(h.forwardToReplicas=r.toString()),a!==void 0&&(h.clearExistingRules=a.toString());let y={method:"POST",path:s,queryParameters:h,headers:c,data:t};return m.request(y,o)},saveSynonym({indexName:e,objectID:t,synonymHit:r,forwardToReplicas:a},o){u("indexName","saveSynonym",e),u("objectID","saveSynonym",t),u("synonymHit","saveSynonym",r),u("synonymHit.objectID","saveSynonym",r.objectID),u("synonymHit.type","saveSynonym",r.type);let s="/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),c={},h={};a!==void 0&&(h.forwardToReplicas=a.toString());let y={method:"PUT",path:s,queryParameters:h,headers:c,data:r};return m.request(y,o)},saveSynonyms({indexName:e,synonymHit:t,forwardToReplicas:r,replaceExistingSynonyms:a},o){u("indexName","saveSynonyms",e),u("synonymHit","saveSynonyms",t);let s="/1/indexes/{indexName}/synonyms/batch".replace("{indexName}",encodeURIComponent(e)),c={},h={};r!==void 0&&(h.forwardToReplicas=r.toString()),a!==void 0&&(h.replaceExistingSynonyms=a.toString());let y={method:"POST",path:s,queryParameters:h,headers:c,data:t};return m.request(y,o)},search(e,t){e&&Array.isArray(e)&&(e={requests:e.map(({params:h,...y})=>y.type==="facet"?{...y,...h,type:"facet"}:{...y,...h,facet:void 0,maxFacetHits:void 0,facetQuery:void 0})}),u("searchMethodParams","search",e),u("searchMethodParams.requests","search",e.requests);let s={method:"POST",path:"/1/indexes/*/queries",queryParameters:{},headers:{},data:e,useReadTransporter:true,cacheable:true};return m.request(s,t)},searchDictionaryEntries({dictionaryName:e,searchDictionaryEntriesParams:t},r){u("dictionaryName","searchDictionaryEntries",e),u("searchDictionaryEntriesParams","searchDictionaryEntries",t),u("searchDictionaryEntriesParams.query","searchDictionaryEntries",t.query);let c={method:"POST",path:"/1/dictionaries/{dictionaryName}/search".replace("{dictionaryName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t,useReadTransporter:true,cacheable:true};return m.request(c,r)},searchForFacetValues({indexName:e,facetName:t,searchForFacetValuesRequest:r},a){u("indexName","searchForFacetValues",e),u("facetName","searchForFacetValues",t);let h={method:"POST",path:"/1/indexes/{indexName}/facets/{facetName}/query".replace("{indexName}",encodeURIComponent(e)).replace("{facetName}",encodeURIComponent(t)),queryParameters:{},headers:{},data:r||{},useReadTransporter:true,cacheable:true};return m.request(h,a)},searchRules({indexName:e,searchRulesParams:t},r){u("indexName","searchRules",e);let c={method:"POST",path:"/1/indexes/{indexName}/rules/search".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t||{},useReadTransporter:true,cacheable:true};return m.request(c,r)},searchSingleIndex({indexName:e,searchParams:t},r){u("indexName","searchSingleIndex",e);let c={method:"POST",path:"/1/indexes/{indexName}/query".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t||{},useReadTransporter:true,cacheable:true};return m.request(c,r)},searchSynonyms({indexName:e,searchSynonymsParams:t},r){u("indexName","searchSynonyms",e);let c={method:"POST",path:"/1/indexes/{indexName}/synonyms/search".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t||{},useReadTransporter:true,cacheable:true};return m.request(c,r)},searchUserIds(e,t){u("searchUserIdsParams","searchUserIds",e),u("searchUserIdsParams.query","searchUserIds",e.query);let s={method:"POST",path:"/1/clusters/mapping/search",queryParameters:{},headers:{},data:e,useReadTransporter:true,cacheable:true};return m.request(s,t)},setDictionarySettings(e,t){u("dictionarySettingsParams","setDictionarySettings",e),u("dictionarySettingsParams.disableStandardEntries","setDictionarySettings",e.disableStandardEntries);let s={method:"PUT",path:"/1/dictionaries/*/settings",queryParameters:{},headers:{},data:e};return m.request(s,t)},setSettings({indexName:e,indexSettings:t,forwardToReplicas:r},a){u("indexName","setSettings",e),u("indexSettings","setSettings",t);let o="/1/indexes/{indexName}/settings".replace("{indexName}",encodeURIComponent(e)),s={},c={};r!==void 0&&(c.forwardToReplicas=r.toString());let h={method:"PUT",path:o,queryParameters:c,headers:s,data:t};return m.request(h,a)},updateApiKey({key:e,apiKey:t},r){u("key","updateApiKey",e),u("apiKey","updateApiKey",t),u("apiKey.acl","updateApiKey",t.acl);let c={method:"PUT",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return m.request(c,r)}}}function Eo(n,i,d){if(!n||typeof n!="string")throw new Error("`appId` is missing.");if(!i||typeof i!="string")throw new Error("`apiKey` is missing.");let{compression:p,...l}=d||{};return ue({appId:n,apiKey:i,timeouts:{connect:1e3,read:2e3,write:3e4},logger:re(),requester:ce(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:N(),requestsCache:N({serializable:false}),hostsCache:v({caches:[Y({key:`${H}-${n}`}),N()]}),...l})}
|
|
9
|
+
`,r);if(a===-1&&o===-1){let S=t.slice(r);if(h.push(S),m+=S.length,m>Pe)throw new Error("SSE line buffer exceeded 10MB");break}let s,i;a!==-1&&(o===-1||a<o)?(s=a,a+1<t.length?i=t[a+1]===`
|
|
10
|
+
`?2:1:(l=true,i=1)):(s=o,i=1);let d=t.slice(r,s);h.push(d);let P=h.length===1?h[0]:h.join("");h.length=0,m=0,f&&(P.startsWith("\uFEFF")&&(P=P.slice(1)),f=false),yield P,r=s+i;}}let u=c.decode();if(u&&h.push(u),h.length>0){let e=h.join("");f&&e.startsWith("\uFEFF")&&(e=e.slice(1)),yield e;}}var fe=class{data=[];eventType="";lastEventId=null;retry=null;decode(p){if(p==="")return this.dispatch();if(p[0]===":")return null;let c=p.indexOf(":"),h,m;switch(c===-1?(h=p,m=""):(h=p.slice(0,c),m=p.slice(c+1),m[0]===" "&&(m=m.slice(1))),h){case "data":this.data.push(m);break;case "event":this.eventType=m;break;case "id":m.includes("\0")||(this.lastEventId=m);break;case "retry":/^[0-9]+$/.test(m)&&(this.retry=parseInt(m,10));break}return null}dispatch(){let p=this.eventType;if(this.eventType="",this.data.length===0)return null;let c={data:this.data.join(`
|
|
11
|
+
`),event:p,id:this.lastEventId,retry:this.retry};return this.data=[],c}};async function*Re(p){let c=new fe;for await(let h of ye(p)){let m=c.decode(h);m!==null&&(yield m);}}var Te=750,$=120*1e3;function z(p,c="up"){let h=Date.now();function m(){return c==="up"||Date.now()-h>$}function l(){return c==="timed out"&&Date.now()-h<=$}return {...p,status:c,lastUpdate:h,isUp:m,isTimedOut:l}}var oe=class extends Error{name="AlgoliaError";constructor(p,c){super(p),c&&(this.name=c);}};var ae=class extends oe{stackTrace;constructor(p,c,h){super(p,h),this.stackTrace=c;}},J=class extends ae{constructor(p){super("Unreachable hosts - your application id may be incorrect. If the error persists, please visit our help center https://alg.li/support-unreachable-hosts or reach out to the Algolia Support team: https://alg.li/support",p,"RetryError");}},C=class extends ae{status;constructor(p,c,h,m="ApiError"){super(p,h,m),this.status=c;}},Ie=class extends oe{response;constructor(p,c){super(p,"DeserializationError"),this.response=c;}},ge=class extends C{error;constructor(p,c,h,m){super(p,c,m,"DetailedApiError"),this.error=h;}};function ne(p){let c=p;for(let h=p.length-1;h>0;h--){let m=Math.floor(Math.random()*(h+1)),l=p[h];c[h]=p[m],c[m]=l;}return c}function V(p,c,h){let m=xe(h),l=`${p.protocol}://${p.url}${p.port?`:${p.port}`:""}/${c.charAt(0)==="/"?c.substring(1):c}`;return m.length&&(l+=`?${m}`),l}function xe(p){return Object.keys(p).filter(c=>p[c]!==void 0).sort().map(c=>`${c}=${encodeURIComponent(Object.prototype.toString.call(p[c])==="[object Array]"?p[c].join(","):p[c]).replace(/\+/g,"%20")}`).join("&")}function X(p,c){if(p.method==="GET"||p.data===void 0&&c.data===void 0)return;let h=Array.isArray(p.data)?p.data:{...p.data,...c.data};return JSON.stringify(h)}function Y(p,c,h){let m={Accept:"application/json",...p,...c,...h},l={};return Object.keys(m).forEach(f=>{let u=m[f];l[f.toLowerCase()]=u;}),l}function ie(p){if(!(p.status===204||p.content.length===0))try{return JSON.parse(p.content)}catch(c){throw new Ie(c.message,p)}}function He(p){return {status:p.status,headers:p.headers,content:p.content,data:ie(p)}}function Se({content:p,status:c},h){try{let m=JSON.parse(p);return "error"in m?new ge(m.message,c,m.error,h):new C(m.message,c,h)}catch{}return new C(p,c,h)}function Oe({isTimedOut:p,status:c}){return !p&&~~c===0}function Ae({isTimedOut:p,status:c}){return p||Oe({isTimedOut:p,status:c})||~~(c/100)!==2&&~~(c/100)!==4}function be({status:p}){return ~~(p/100)===2}function Ue(p){return p.map(c=>ue(c))}function ue(p){let c=p.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return {...p,request:{...p.request,headers:{...p.request.headers,...c}}}}function pe({hosts:p,hostsCache:c,baseHeaders:h,logger:m,baseQueryParameters:l,algoliaAgent:f,timeouts:u,requester:e,requestsCache:t,responsesCache:r,compress:a,compression:o}){async function s(q){let y=await Promise.all(q.map(R=>c.get(R,()=>Promise.resolve(z(R))))),x=y.filter(R=>R.isUp()),T=y.filter(R=>R.isTimedOut()),O=[...x,...T];return {hosts:O.length>0?O:q,getTimeout(R,A){return (T.length===0&&R===0?1:T.length+3+R)*A}}}async function i(q,y,x){let T=[],O=X(q,y),I=Y(h,q.headers,y.headers),R=o==="gzip"&&O!==void 0&&O.length>Te&&(q.method==="POST"||q.method==="PUT");R&&a===void 0&&m.info("Compression is disabled because no compress method is available.");let A=R&&a!==void 0,Q=A?await a(O):O;A&&(I["content-encoding"]="gzip");let j=q.method==="GET"?{...q.data,...y.data}:{},b={...l,...q.queryParameters,...j};if(f.value&&(b["x-algolia-agent"]=f.value),y&&y.queryParameters)for(let g of Object.keys(y.queryParameters))!y.queryParameters[g]||Object.prototype.toString.call(y.queryParameters[g])==="[object Object]"?b[g]=y.queryParameters[g]:b[g]=y.queryParameters[g].toString();let D=0,N=async(g,G)=>{let v=g.pop();if(v===void 0)throw new J(Ue(T));let L={...u,...y.timeouts},F={data:Q,headers:I,method:q.method,url:V(v,q.path,b),connectTimeout:G(D,L.connect),responseTimeout:G(D,x?L.read:L.write)},_=K=>{let M={request:F,response:K,host:v,triesLeft:g.length};return T.push(M),M},U=await e.send(F);if(Ae(U)){let K=_(U);return U.isTimedOut&&D++,m.info("Retryable failure",ue(K)),await c.set(v,z(v,U.isTimedOut?"timed out":"down")),N(g,G)}if(be(U))return U;throw _(U),Se(U,T)},H=p.filter(g=>g.accept==="readWrite"||(x?g.accept==="read":g.accept==="write")),B=await s(H);return N([...B.hosts].reverse(),B.getTimeout)}function d(q,y={}){let x=()=>i(q,y,T).then(R=>ie(R)),T=q.useReadTransporter||q.method==="GET";if((y.cacheable||q.cacheable)!==true)return x();let I={request:q,requestOptions:y,transporter:{queryParameters:l,headers:h}};return r.get(I,()=>t.get(I,()=>t.set(I,x()).then(R=>Promise.all([t.delete(I),R]),R=>Promise.all([t.delete(I),Promise.reject(R)])).then(([R,A])=>A)),{miss:R=>r.set(I,R)})}function P(q,y={}){let x=q.useReadTransporter||q.method==="GET";return i(q,y,x).then(T=>He(T))}async function*S(q,y={}){if(!e.sendStream)throw new Error("This requester does not support streaming");let x=X(q,y),T=Y(h,q.headers,y.headers);T.accept="text/event-stream";let O=q.method==="GET"?{...q.data,...y.data}:{},I={...l,...q.queryParameters,...O};if(f.value&&(I["x-algolia-agent"]=f.value),y&&y.queryParameters)for(let H of Object.keys(y.queryParameters))!y.queryParameters[H]||Object.prototype.toString.call(y.queryParameters[H])==="[object Object]"?I[H]=y.queryParameters[H]:I[H]=y.queryParameters[H].toString();let R=q.useReadTransporter||q.method==="GET",A=p.filter(H=>H.accept==="readWrite"||(R?H.accept==="read":H.accept==="write")),j=(await s(A)).hosts[0];if(!j)throw new J([]);let b={...u,...y.timeouts},D={data:x,headers:T,method:q.method,url:V(j,q.path,I),connectTimeout:b.connect,responseTimeout:R?b.read:b.write},N=await e.sendStream(D);yield*Re(N);}return {hostsCache:c,requester:e,timeouts:u,logger:m,algoliaAgent:f,baseHeaders:h,baseQueryParameters:l,hosts:p,request:d,requestWithHttpInfo:P,requestStream:S,requestsCache:t,responsesCache:r}}function n(p,c,h){if(h==null||typeof h=="string"&&h.length===0)throw new Error(`Parameter \`${p}\` is required when calling \`${c}\`.`)}function We(p){let c={};for(let h of p.trim().split(/[\r\n]+/)){let m=h.indexOf(": ");m>0&&(c[h.slice(0,m).toLowerCase()]=h.slice(m+2));}return c}function ce(){function p(c){return new Promise(h=>{let m=new XMLHttpRequest;m.open(c.method,c.url,true),Object.keys(c.headers).forEach(e=>m.setRequestHeader(e,c.headers[e]));let l=(e,t)=>setTimeout(()=>{m.abort(),h({status:0,content:t,isTimedOut:true});},e),f=l(c.connectTimeout,"Connection timeout"),u;m.onreadystatechange=()=>{m.readyState>m.OPENED&&u===void 0&&(clearTimeout(f),u=l(c.responseTimeout,"Socket timeout"));},m.onerror=()=>{m.status===0&&(clearTimeout(f),clearTimeout(u),h({content:m.responseText||"Network request failed",status:m.status,isTimedOut:false}));},m.onload=()=>{clearTimeout(f),clearTimeout(u),h({content:m.responseText,headers:We(m.getAllResponseHeaders()),status:m.status,isTimedOut:false});},m.send(c.data);})}return {send:p}}var w="5.56.0";function Ee(p){return [{url:`${p}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${p}.algolia.net`,accept:"write",protocol:"https"}].concat(ne([{url:`${p}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${p}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${p}-3.algolianet.com`,accept:"readWrite",protocol:"https"}]))}function de({appId:p,apiKey:c,authMode:h,algoliaAgents:m,...l}){let f=te(p,c,h),u=pe({hosts:Ee(p),...l,algoliaAgent:re({algoliaAgents:m,client:"Search",version:w}),baseHeaders:{"content-type":"text/plain",...f.headers(),...l.baseHeaders},baseQueryParameters:{...f.queryParameters(),...l.baseQueryParameters}});return {transporter:u,appId:p,apiKey:c,clearCache(){return Promise.all([u.requestsCache.clear(),u.responsesCache.clear()]).then(()=>{})},get _ua(){return u.algoliaAgent.value},addAlgoliaAgent(e,t){u.algoliaAgent.add({segment:e,version:t});},setClientApiKey({apiKey:e}){!h||h==="WithinHeaders"?u.baseHeaders["x-algolia-api-key"]=e:u.baseQueryParameters["x-algolia-api-key"]=e;},waitForTask({indexName:e,taskID:t,maxRetries:r=100,timeout:a=s=>Math.min(s*200,5e3)},o){let s=0;return W({func:()=>this.getTask({indexName:e,taskID:t},o),validate:i=>i.status==="published",aggregator:()=>s+=1,error:{validate:()=>s>=r,message:()=>`Stopped waiting for the task after ${r} retries. This does not mean the operation failed; it may still complete. If you need to keep polling, retry with a higher maxRetries.`},timeout:()=>a(s)})},waitForAppTask({taskID:e,maxRetries:t=100,timeout:r=o=>Math.min(o*200,5e3)},a){let o=0;return W({func:()=>this.getAppTask({taskID:e},a),validate:s=>s.status==="published",aggregator:()=>o+=1,error:{validate:()=>o>=t,message:()=>`Stopped waiting for the task after ${t} retries. This does not mean the operation failed; it may still complete. If you need to keep polling, retry with a higher maxRetries.`},timeout:()=>r(o)})},waitForApiKey({operation:e,key:t,apiKey:r,maxRetries:a=100,timeout:o=i=>Math.min(i*200,5e3)},s){let i=0,d={aggregator:()=>i+=1,error:{validate:()=>i>=a,message:()=>`Stopped waiting for the API key operation after ${a} retries. This does not mean the operation failed; it may still complete. If you need to keep polling, retry with a higher maxRetries.`},timeout:()=>o(i)};if(e==="update"){if(!r)throw new Error("`apiKey` is required when waiting for an `update` operation.");return W({...d,func:()=>this.getApiKey({key:t},s),validate:P=>{for(let S of Object.keys(r)){let q=r[S],y=P[S];if(Array.isArray(q)&&Array.isArray(y)){if(q.length!==y.length||q.some((x,T)=>x!==y[T]))return false}else if(q!==y)return false}return true}})}return W({...d,func:()=>this.getApiKey({key:t},s).catch(P=>{if(P.status!==404)throw P}),validate:P=>e==="add"?P!==void 0:P===void 0})},browseObjects({indexName:e,browseParams:t,...r},a){return W({func:o=>this.browse({indexName:e,browseParams:{cursor:o?o.cursor:void 0,hitsPerPage:1e3,...t}},a),validate:o=>o.cursor===void 0,...r})},browseRules({indexName:e,searchRulesParams:t,...r},a){let o={...t,hitsPerPage:t?.hitsPerPage||1e3};return W({func:s=>this.searchRules({indexName:e,searchRulesParams:{...o,page:s?s.page+1:o.page||0}},a),validate:s=>s.hits.length<o.hitsPerPage,...r})},browseSynonyms({indexName:e,searchSynonymsParams:t,...r},a){let o={...t,page:t?.page||0,hitsPerPage:1e3};return W({func:s=>{let i=this.searchSynonyms({indexName:e,searchSynonymsParams:{...o,page:o.page}},a);return o.page+=1,i},validate:s=>s.hits.length<o.hitsPerPage,...r})},async chunkedBatch({indexName:e,objects:t,action:r="addObject",waitForTasks:a,batchSize:o=1e3,maxRetries:s=100},i){let d=[],P=[],S=t.entries();for(let[q,y]of S)d.push({action:r,body:y}),(d.length===o||q===t.length-1)&&(P.push(await this.batch({indexName:e,batchWriteParams:{requests:d}},i)),d=[]);if(a)for(let q of P)await this.waitForTask({indexName:e,taskID:q.taskID,maxRetries:s});return P},async saveObjects({indexName:e,objects:t,waitForTasks:r,batchSize:a,maxRetries:o},s){return await this.chunkedBatch({indexName:e,objects:t,action:"addObject",waitForTasks:r,batchSize:a,maxRetries:o},s)},async deleteObjects({indexName:e,objectIDs:t,waitForTasks:r,batchSize:a,maxRetries:o},s){return await this.chunkedBatch({indexName:e,objects:t.map(i=>({objectID:i})),action:"deleteObject",waitForTasks:r,batchSize:a,maxRetries:o},s)},async partialUpdateObjects({indexName:e,objects:t,createIfNotExists:r,waitForTasks:a,batchSize:o,maxRetries:s},i){return await this.chunkedBatch({indexName:e,objects:t,action:r?"partialUpdateObject":"partialUpdateObjectNoCreate",batchSize:o,waitForTasks:a,maxRetries:s},i)},async replaceAllObjects({indexName:e,objects:t,batchSize:r,scopes:a,maxRetries:o=ee},s){let i=Math.floor(Math.random()*1e6)+1e5,d=`${e}_tmp_${i}`;a===void 0&&(a=["settings","rules","synonyms"]);try{let P=await this.operationIndex({indexName:e,operationIndexParams:{operation:"copy",destination:d,scope:a}},s),S=await this.chunkedBatch({indexName:d,objects:t,waitForTasks:!0,batchSize:r,maxRetries:o},s);await this.waitForTask({indexName:d,taskID:P.taskID,maxRetries:o}),P=await this.operationIndex({indexName:e,operationIndexParams:{operation:"copy",destination:d,scope:a}},s),await this.waitForTask({indexName:d,taskID:P.taskID,maxRetries:o});let q=await this.operationIndex({indexName:d,operationIndexParams:{operation:"move",destination:e}},s);return await this.waitForTask({indexName:d,taskID:q.taskID,maxRetries:o}),{copyOperationResponse:P,batchResponses:S,moveOperationResponse:q}}catch(P){throw await this.deleteIndex({indexName:d}),P}},async indexExists({indexName:e}){try{await this.getSettings({indexName:e});}catch(t){if(t instanceof C&&t.status===404)return false;throw t}return true},searchForHits(e,t){return this.search(e,t)},searchForFacets(e,t){return this.search(e,t)},addApiKey(e,t){n("apiKey","addApiKey",e),n("apiKey.acl","addApiKey",e.acl);let s={method:"POST",path:"/1/keys",queryParameters:{},headers:{},data:e};return u.request(s,t)},addApiKeyWithHTTPInfo(e,t){n("apiKey","addApiKeyWithHTTPInfo",e),n("apiKey.acl","addApiKeyWithHTTPInfo",e.acl);let s={method:"POST",path:"/1/keys",queryParameters:{},headers:{},data:e};return u.requestWithHttpInfo(s,t)},addOrUpdateObject({indexName:e,objectID:t,body:r},a){n("indexName","addOrUpdateObject",e),n("objectID","addOrUpdateObject",t),n("body","addOrUpdateObject",r);let d={method:"PUT",path:"/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),queryParameters:{},headers:{},data:r};return u.request(d,a)},addOrUpdateObjectWithHTTPInfo({indexName:e,objectID:t,body:r},a){n("indexName","addOrUpdateObjectWithHTTPInfo",e),n("objectID","addOrUpdateObjectWithHTTPInfo",t),n("body","addOrUpdateObjectWithHTTPInfo",r);let d={method:"PUT",path:"/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),queryParameters:{},headers:{},data:r};return u.requestWithHttpInfo(d,a)},appendSource(e,t){n("source","appendSource",e),n("source.source","appendSource",e.source);let s={method:"POST",path:"/1/security/sources/append",queryParameters:{},headers:{},data:e};return u.request(s,t)},appendSourceWithHTTPInfo(e,t){n("source","appendSourceWithHTTPInfo",e),n("source.source","appendSourceWithHTTPInfo",e.source);let s={method:"POST",path:"/1/security/sources/append",queryParameters:{},headers:{},data:e};return u.requestWithHttpInfo(s,t)},assignUserId({xAlgoliaUserID:e,assignUserIdParams:t},r){n("xAlgoliaUserID","assignUserId",e),n("assignUserIdParams","assignUserId",t),n("assignUserIdParams.cluster","assignUserId",t.cluster);let a="/1/clusters/mapping",o={},s={};e!==void 0&&(o["X-Algolia-User-ID"]=e.toString());let i={method:"POST",path:a,queryParameters:s,headers:o,data:t};return u.request(i,r)},assignUserIdWithHTTPInfo({xAlgoliaUserID:e,assignUserIdParams:t},r){n("xAlgoliaUserID","assignUserIdWithHTTPInfo",e),n("assignUserIdParams","assignUserIdWithHTTPInfo",t),n("assignUserIdParams.cluster","assignUserIdWithHTTPInfo",t.cluster);let a="/1/clusters/mapping",o={},s={};e!==void 0&&(o["X-Algolia-User-ID"]=e.toString());let i={method:"POST",path:a,queryParameters:s,headers:o,data:t};return u.requestWithHttpInfo(i,r)},batch({indexName:e,batchWriteParams:t},r){n("indexName","batch",e),n("batchWriteParams","batch",t),n("batchWriteParams.requests","batch",t.requests);let i={method:"POST",path:"/1/indexes/{indexName}/batch".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return u.request(i,r)},batchWithHTTPInfo({indexName:e,batchWriteParams:t},r){n("indexName","batchWithHTTPInfo",e),n("batchWriteParams","batchWithHTTPInfo",t),n("batchWriteParams.requests","batchWithHTTPInfo",t.requests);let i={method:"POST",path:"/1/indexes/{indexName}/batch".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return u.requestWithHttpInfo(i,r)},batchAssignUserIds({xAlgoliaUserID:e,batchAssignUserIdsParams:t},r){n("xAlgoliaUserID","batchAssignUserIds",e),n("batchAssignUserIdsParams","batchAssignUserIds",t),n("batchAssignUserIdsParams.cluster","batchAssignUserIds",t.cluster),n("batchAssignUserIdsParams.users","batchAssignUserIds",t.users);let a="/1/clusters/mapping/batch",o={},s={};e!==void 0&&(o["X-Algolia-User-ID"]=e.toString());let i={method:"POST",path:a,queryParameters:s,headers:o,data:t};return u.request(i,r)},batchAssignUserIdsWithHTTPInfo({xAlgoliaUserID:e,batchAssignUserIdsParams:t},r){n("xAlgoliaUserID","batchAssignUserIdsWithHTTPInfo",e),n("batchAssignUserIdsParams","batchAssignUserIdsWithHTTPInfo",t),n("batchAssignUserIdsParams.cluster","batchAssignUserIdsWithHTTPInfo",t.cluster),n("batchAssignUserIdsParams.users","batchAssignUserIdsWithHTTPInfo",t.users);let a="/1/clusters/mapping/batch",o={},s={};e!==void 0&&(o["X-Algolia-User-ID"]=e.toString());let i={method:"POST",path:a,queryParameters:s,headers:o,data:t};return u.requestWithHttpInfo(i,r)},batchDictionaryEntries({dictionaryName:e,batchDictionaryEntriesParams:t},r){n("dictionaryName","batchDictionaryEntries",e),n("batchDictionaryEntriesParams","batchDictionaryEntries",t),n("batchDictionaryEntriesParams.requests","batchDictionaryEntries",t.requests);let i={method:"POST",path:"/1/dictionaries/{dictionaryName}/batch".replace("{dictionaryName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return u.request(i,r)},batchDictionaryEntriesWithHTTPInfo({dictionaryName:e,batchDictionaryEntriesParams:t},r){n("dictionaryName","batchDictionaryEntriesWithHTTPInfo",e),n("batchDictionaryEntriesParams","batchDictionaryEntriesWithHTTPInfo",t),n("batchDictionaryEntriesParams.requests","batchDictionaryEntriesWithHTTPInfo",t.requests);let i={method:"POST",path:"/1/dictionaries/{dictionaryName}/batch".replace("{dictionaryName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return u.requestWithHttpInfo(i,r)},browse({indexName:e,browseParams:t},r){n("indexName","browse",e);let i={method:"POST",path:"/1/indexes/{indexName}/browse".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t||{},useReadTransporter:true};return u.request(i,r)},browseWithHTTPInfo({indexName:e,browseParams:t},r){n("indexName","browseWithHTTPInfo",e);let i={method:"POST",path:"/1/indexes/{indexName}/browse".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t||{},useReadTransporter:true};return u.requestWithHttpInfo(i,r)},clearObjects({indexName:e},t){n("indexName","clearObjects",e);let s={method:"POST",path:"/1/indexes/{indexName}/clear".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return u.request(s,t)},clearObjectsWithHTTPInfo({indexName:e},t){n("indexName","clearObjectsWithHTTPInfo",e);let s={method:"POST",path:"/1/indexes/{indexName}/clear".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return u.requestWithHttpInfo(s,t)},clearRules({indexName:e,forwardToReplicas:t},r){n("indexName","clearRules",e);let a="/1/indexes/{indexName}/rules/clear".replace("{indexName}",encodeURIComponent(e)),o={},s={};t!==void 0&&(s.forwardToReplicas=t.toString());let i={method:"POST",path:a,queryParameters:s,headers:o};return u.request(i,r)},clearRulesWithHTTPInfo({indexName:e,forwardToReplicas:t},r){n("indexName","clearRulesWithHTTPInfo",e);let a="/1/indexes/{indexName}/rules/clear".replace("{indexName}",encodeURIComponent(e)),o={},s={};t!==void 0&&(s.forwardToReplicas=t.toString());let i={method:"POST",path:a,queryParameters:s,headers:o};return u.requestWithHttpInfo(i,r)},clearSynonyms({indexName:e,forwardToReplicas:t},r){n("indexName","clearSynonyms",e);let a="/1/indexes/{indexName}/synonyms/clear".replace("{indexName}",encodeURIComponent(e)),o={},s={};t!==void 0&&(s.forwardToReplicas=t.toString());let i={method:"POST",path:a,queryParameters:s,headers:o};return u.request(i,r)},clearSynonymsWithHTTPInfo({indexName:e,forwardToReplicas:t},r){n("indexName","clearSynonymsWithHTTPInfo",e);let a="/1/indexes/{indexName}/synonyms/clear".replace("{indexName}",encodeURIComponent(e)),o={},s={};t!==void 0&&(s.forwardToReplicas=t.toString());let i={method:"POST",path:a,queryParameters:s,headers:o};return u.requestWithHttpInfo(i,r)},customDelete({path:e,parameters:t},r){n("path","customDelete",e);let i={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return u.request(i,r)},customDeleteWithHTTPInfo({path:e,parameters:t},r){n("path","customDeleteWithHTTPInfo",e);let i={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return u.requestWithHttpInfo(i,r)},customGet({path:e,parameters:t},r){n("path","customGet",e);let i={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return u.request(i,r)},customGetWithHTTPInfo({path:e,parameters:t},r){n("path","customGetWithHTTPInfo",e);let i={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return u.requestWithHttpInfo(i,r)},customPost({path:e,parameters:t,body:r},a){n("path","customPost",e);let d={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return u.request(d,a)},customPostWithHTTPInfo({path:e,parameters:t,body:r},a){n("path","customPostWithHTTPInfo",e);let d={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return u.requestWithHttpInfo(d,a)},customPut({path:e,parameters:t,body:r},a){n("path","customPut",e);let d={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return u.request(d,a)},customPutWithHTTPInfo({path:e,parameters:t,body:r},a){n("path","customPutWithHTTPInfo",e);let d={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return u.requestWithHttpInfo(d,a)},deleteApiKey({key:e},t){n("key","deleteApiKey",e);let s={method:"DELETE",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(e)),queryParameters:{},headers:{}};return u.request(s,t)},deleteApiKeyWithHTTPInfo({key:e},t){n("key","deleteApiKeyWithHTTPInfo",e);let s={method:"DELETE",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(e)),queryParameters:{},headers:{}};return u.requestWithHttpInfo(s,t)},deleteBy({indexName:e,deleteByParams:t},r){n("indexName","deleteBy",e),n("deleteByParams","deleteBy",t);let i={method:"POST",path:"/1/indexes/{indexName}/deleteByQuery".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return u.request(i,r)},deleteByWithHTTPInfo({indexName:e,deleteByParams:t},r){n("indexName","deleteByWithHTTPInfo",e),n("deleteByParams","deleteByWithHTTPInfo",t);let i={method:"POST",path:"/1/indexes/{indexName}/deleteByQuery".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return u.requestWithHttpInfo(i,r)},deleteIndex({indexName:e},t){n("indexName","deleteIndex",e);let s={method:"DELETE",path:"/1/indexes/{indexName}".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return u.request(s,t)},deleteIndexWithHTTPInfo({indexName:e},t){n("indexName","deleteIndexWithHTTPInfo",e);let s={method:"DELETE",path:"/1/indexes/{indexName}".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return u.requestWithHttpInfo(s,t)},deleteObject({indexName:e,objectID:t},r){n("indexName","deleteObject",e),n("objectID","deleteObject",t);let i={method:"DELETE",path:"/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return u.request(i,r)},deleteObjectWithHTTPInfo({indexName:e,objectID:t},r){n("indexName","deleteObjectWithHTTPInfo",e),n("objectID","deleteObjectWithHTTPInfo",t);let i={method:"DELETE",path:"/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return u.requestWithHttpInfo(i,r)},deleteRule({indexName:e,objectID:t,forwardToReplicas:r},a){n("indexName","deleteRule",e),n("objectID","deleteRule",t);let o="/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),s={},i={};r!==void 0&&(i.forwardToReplicas=r.toString());let d={method:"DELETE",path:o,queryParameters:i,headers:s};return u.request(d,a)},deleteRuleWithHTTPInfo({indexName:e,objectID:t,forwardToReplicas:r},a){n("indexName","deleteRuleWithHTTPInfo",e),n("objectID","deleteRuleWithHTTPInfo",t);let o="/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),s={},i={};r!==void 0&&(i.forwardToReplicas=r.toString());let d={method:"DELETE",path:o,queryParameters:i,headers:s};return u.requestWithHttpInfo(d,a)},deleteSource({source:e},t){n("source","deleteSource",e);let s={method:"DELETE",path:"/1/security/sources/{source}".replace("{source}",encodeURIComponent(e)),queryParameters:{},headers:{}};return u.request(s,t)},deleteSourceWithHTTPInfo({source:e},t){n("source","deleteSourceWithHTTPInfo",e);let s={method:"DELETE",path:"/1/security/sources/{source}".replace("{source}",encodeURIComponent(e)),queryParameters:{},headers:{}};return u.requestWithHttpInfo(s,t)},deleteSynonym({indexName:e,objectID:t,forwardToReplicas:r},a){n("indexName","deleteSynonym",e),n("objectID","deleteSynonym",t);let o="/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),s={},i={};r!==void 0&&(i.forwardToReplicas=r.toString());let d={method:"DELETE",path:o,queryParameters:i,headers:s};return u.request(d,a)},deleteSynonymWithHTTPInfo({indexName:e,objectID:t,forwardToReplicas:r},a){n("indexName","deleteSynonymWithHTTPInfo",e),n("objectID","deleteSynonymWithHTTPInfo",t);let o="/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),s={},i={};r!==void 0&&(i.forwardToReplicas=r.toString());let d={method:"DELETE",path:o,queryParameters:i,headers:s};return u.requestWithHttpInfo(d,a)},getApiKey({key:e},t){n("key","getApiKey",e);let s={method:"GET",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(e)),queryParameters:{},headers:{}};return u.request(s,t)},getApiKeyWithHTTPInfo({key:e},t){n("key","getApiKeyWithHTTPInfo",e);let s={method:"GET",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(e)),queryParameters:{},headers:{}};return u.requestWithHttpInfo(s,t)},getAppTask({taskID:e},t){n("taskID","getAppTask",e);let s={method:"GET",path:"/1/task/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return u.request(s,t)},getAppTaskWithHTTPInfo({taskID:e},t){n("taskID","getAppTaskWithHTTPInfo",e);let s={method:"GET",path:"/1/task/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return u.requestWithHttpInfo(s,t)},getDictionaryLanguages(e){let o={method:"GET",path:"/1/dictionaries/*/languages",queryParameters:{},headers:{}};return u.request(o,e)},getDictionaryLanguagesWithHTTPInfo(e){let o={method:"GET",path:"/1/dictionaries/*/languages",queryParameters:{},headers:{}};return u.requestWithHttpInfo(o,e)},getDictionarySettings(e){let o={method:"GET",path:"/1/dictionaries/*/settings",queryParameters:{},headers:{}};return u.request(o,e)},getDictionarySettingsWithHTTPInfo(e){let o={method:"GET",path:"/1/dictionaries/*/settings",queryParameters:{},headers:{}};return u.requestWithHttpInfo(o,e)},getLogs({offset:e,length:t,indexName:r,type:a}={},o=void 0){let s="/1/logs",i={},d={};e!==void 0&&(d.offset=e.toString()),t!==void 0&&(d.length=t.toString()),r!==void 0&&(d.indexName=r.toString()),a!==void 0&&(d.type=a.toString());let P={method:"GET",path:s,queryParameters:d,headers:i};return u.request(P,o)},getLogsWithHTTPInfo({offset:e,length:t,indexName:r,type:a}={},o=void 0){let s="/1/logs",i={},d={};e!==void 0&&(d.offset=e.toString()),t!==void 0&&(d.length=t.toString()),r!==void 0&&(d.indexName=r.toString()),a!==void 0&&(d.type=a.toString());let P={method:"GET",path:s,queryParameters:d,headers:i};return u.requestWithHttpInfo(P,o)},getObject({indexName:e,objectID:t,attributesToRetrieve:r},a){n("indexName","getObject",e),n("objectID","getObject",t);let o="/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),s={},i={};r!==void 0&&(i.attributesToRetrieve=r.toString());let d={method:"GET",path:o,queryParameters:i,headers:s};return u.request(d,a)},getObjectWithHTTPInfo({indexName:e,objectID:t,attributesToRetrieve:r},a){n("indexName","getObjectWithHTTPInfo",e),n("objectID","getObjectWithHTTPInfo",t);let o="/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),s={},i={};r!==void 0&&(i.attributesToRetrieve=r.toString());let d={method:"GET",path:o,queryParameters:i,headers:s};return u.requestWithHttpInfo(d,a)},getObjects(e,t){n("getObjectsParams","getObjects",e),n("getObjectsParams.requests","getObjects",e.requests);let s={method:"POST",path:"/1/indexes/*/objects",queryParameters:{},headers:{},data:e,useReadTransporter:true,cacheable:true};return u.request(s,t)},getObjectsWithHTTPInfo(e,t){n("getObjectsParams","getObjectsWithHTTPInfo",e),n("getObjectsParams.requests","getObjectsWithHTTPInfo",e.requests);let s={method:"POST",path:"/1/indexes/*/objects",queryParameters:{},headers:{},data:e,useReadTransporter:true,cacheable:true};return u.requestWithHttpInfo(s,t)},getRule({indexName:e,objectID:t},r){n("indexName","getRule",e),n("objectID","getRule",t);let i={method:"GET",path:"/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return u.request(i,r)},getRuleWithHTTPInfo({indexName:e,objectID:t},r){n("indexName","getRuleWithHTTPInfo",e),n("objectID","getRuleWithHTTPInfo",t);let i={method:"GET",path:"/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return u.requestWithHttpInfo(i,r)},getSettings({indexName:e,getVersion:t},r){n("indexName","getSettings",e);let a="/1/indexes/{indexName}/settings".replace("{indexName}",encodeURIComponent(e)),o={},s={};t!==void 0&&(s.getVersion=t.toString());let i={method:"GET",path:a,queryParameters:s,headers:o};return u.request(i,r)},getSettingsWithHTTPInfo({indexName:e,getVersion:t},r){n("indexName","getSettingsWithHTTPInfo",e);let a="/1/indexes/{indexName}/settings".replace("{indexName}",encodeURIComponent(e)),o={},s={};t!==void 0&&(s.getVersion=t.toString());let i={method:"GET",path:a,queryParameters:s,headers:o};return u.requestWithHttpInfo(i,r)},getSources(e){let o={method:"GET",path:"/1/security/sources",queryParameters:{},headers:{}};return u.request(o,e)},getSourcesWithHTTPInfo(e){let o={method:"GET",path:"/1/security/sources",queryParameters:{},headers:{}};return u.requestWithHttpInfo(o,e)},getSynonym({indexName:e,objectID:t},r){n("indexName","getSynonym",e),n("objectID","getSynonym",t);let i={method:"GET",path:"/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return u.request(i,r)},getSynonymWithHTTPInfo({indexName:e,objectID:t},r){n("indexName","getSynonymWithHTTPInfo",e),n("objectID","getSynonymWithHTTPInfo",t);let i={method:"GET",path:"/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return u.requestWithHttpInfo(i,r)},getTask({indexName:e,taskID:t},r){n("indexName","getTask",e),n("taskID","getTask",t);let i={method:"GET",path:"/1/indexes/{indexName}/task/{taskID}".replace("{indexName}",encodeURIComponent(e)).replace("{taskID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return u.request(i,r)},getTaskWithHTTPInfo({indexName:e,taskID:t},r){n("indexName","getTaskWithHTTPInfo",e),n("taskID","getTaskWithHTTPInfo",t);let i={method:"GET",path:"/1/indexes/{indexName}/task/{taskID}".replace("{indexName}",encodeURIComponent(e)).replace("{taskID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return u.requestWithHttpInfo(i,r)},getTopUserIds(e){let o={method:"GET",path:"/1/clusters/mapping/top",queryParameters:{},headers:{}};return u.request(o,e)},getTopUserIdsWithHTTPInfo(e){let o={method:"GET",path:"/1/clusters/mapping/top",queryParameters:{},headers:{}};return u.requestWithHttpInfo(o,e)},getUserId({userID:e},t){n("userID","getUserId",e);let s={method:"GET",path:"/1/clusters/mapping/{userID}".replace("{userID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return u.request(s,t)},getUserIdWithHTTPInfo({userID:e},t){n("userID","getUserIdWithHTTPInfo",e);let s={method:"GET",path:"/1/clusters/mapping/{userID}".replace("{userID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return u.requestWithHttpInfo(s,t)},hasPendingMappings({getClusters:e}={},t=void 0){let r="/1/clusters/mapping/pending",a={},o={};e!==void 0&&(o.getClusters=e.toString());let s={method:"GET",path:r,queryParameters:o,headers:a};return u.request(s,t)},hasPendingMappingsWithHTTPInfo({getClusters:e}={},t=void 0){let r="/1/clusters/mapping/pending",a={},o={};e!==void 0&&(o.getClusters=e.toString());let s={method:"GET",path:r,queryParameters:o,headers:a};return u.requestWithHttpInfo(s,t)},listApiKeys(e){let o={method:"GET",path:"/1/keys",queryParameters:{},headers:{}};return u.request(o,e)},listApiKeysWithHTTPInfo(e){let o={method:"GET",path:"/1/keys",queryParameters:{},headers:{}};return u.requestWithHttpInfo(o,e)},listClusters(e){let o={method:"GET",path:"/1/clusters",queryParameters:{},headers:{}};return u.request(o,e)},listClustersWithHTTPInfo(e){let o={method:"GET",path:"/1/clusters",queryParameters:{},headers:{}};return u.requestWithHttpInfo(o,e)},listIndices({page:e,hitsPerPage:t}={},r=void 0){let a="/1/indexes",o={},s={};e!==void 0&&(s.page=e.toString()),t!==void 0&&(s.hitsPerPage=t.toString());let i={method:"GET",path:a,queryParameters:s,headers:o};return u.request(i,r)},listIndicesWithHTTPInfo({page:e,hitsPerPage:t}={},r=void 0){let a="/1/indexes",o={},s={};e!==void 0&&(s.page=e.toString()),t!==void 0&&(s.hitsPerPage=t.toString());let i={method:"GET",path:a,queryParameters:s,headers:o};return u.requestWithHttpInfo(i,r)},listUserIds({page:e,hitsPerPage:t}={},r=void 0){let a="/1/clusters/mapping",o={},s={};e!==void 0&&(s.page=e.toString()),t!==void 0&&(s.hitsPerPage=t.toString());let i={method:"GET",path:a,queryParameters:s,headers:o};return u.request(i,r)},listUserIdsWithHTTPInfo({page:e,hitsPerPage:t}={},r=void 0){let a="/1/clusters/mapping",o={},s={};e!==void 0&&(s.page=e.toString()),t!==void 0&&(s.hitsPerPage=t.toString());let i={method:"GET",path:a,queryParameters:s,headers:o};return u.requestWithHttpInfo(i,r)},multipleBatch(e,t){n("batchParams","multipleBatch",e),n("batchParams.requests","multipleBatch",e.requests);let s={method:"POST",path:"/1/indexes/*/batch",queryParameters:{},headers:{},data:e};return u.request(s,t)},multipleBatchWithHTTPInfo(e,t){n("batchParams","multipleBatchWithHTTPInfo",e),n("batchParams.requests","multipleBatchWithHTTPInfo",e.requests);let s={method:"POST",path:"/1/indexes/*/batch",queryParameters:{},headers:{},data:e};return u.requestWithHttpInfo(s,t)},operationIndex({indexName:e,operationIndexParams:t},r){n("indexName","operationIndex",e),n("operationIndexParams","operationIndex",t),n("operationIndexParams.operation","operationIndex",t.operation),n("operationIndexParams.destination","operationIndex",t.destination);let i={method:"POST",path:"/1/indexes/{indexName}/operation".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return u.request(i,r)},operationIndexWithHTTPInfo({indexName:e,operationIndexParams:t},r){n("indexName","operationIndexWithHTTPInfo",e),n("operationIndexParams","operationIndexWithHTTPInfo",t),n("operationIndexParams.operation","operationIndexWithHTTPInfo",t.operation),n("operationIndexParams.destination","operationIndexWithHTTPInfo",t.destination);let i={method:"POST",path:"/1/indexes/{indexName}/operation".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return u.requestWithHttpInfo(i,r)},partialUpdateObject({indexName:e,objectID:t,attributesToUpdate:r,createIfNotExists:a},o){n("indexName","partialUpdateObject",e),n("objectID","partialUpdateObject",t),n("attributesToUpdate","partialUpdateObject",r);let s="/1/indexes/{indexName}/{objectID}/partial".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),i={},d={};a!==void 0&&(d.createIfNotExists=a.toString());let P={method:"POST",path:s,queryParameters:d,headers:i,data:r};return u.request(P,o)},partialUpdateObjectWithHTTPInfo({indexName:e,objectID:t,attributesToUpdate:r,createIfNotExists:a},o){n("indexName","partialUpdateObjectWithHTTPInfo",e),n("objectID","partialUpdateObjectWithHTTPInfo",t),n("attributesToUpdate","partialUpdateObjectWithHTTPInfo",r);let s="/1/indexes/{indexName}/{objectID}/partial".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),i={},d={};a!==void 0&&(d.createIfNotExists=a.toString());let P={method:"POST",path:s,queryParameters:d,headers:i,data:r};return u.requestWithHttpInfo(P,o)},removeUserId({userID:e},t){n("userID","removeUserId",e);let s={method:"DELETE",path:"/1/clusters/mapping/{userID}".replace("{userID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return u.request(s,t)},removeUserIdWithHTTPInfo({userID:e},t){n("userID","removeUserIdWithHTTPInfo",e);let s={method:"DELETE",path:"/1/clusters/mapping/{userID}".replace("{userID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return u.requestWithHttpInfo(s,t)},replaceSources({source:e},t){n("source","replaceSources",e);let s={method:"PUT",path:"/1/security/sources",queryParameters:{},headers:{},data:e};return u.request(s,t)},replaceSourcesWithHTTPInfo({source:e},t){n("source","replaceSourcesWithHTTPInfo",e);let s={method:"PUT",path:"/1/security/sources",queryParameters:{},headers:{},data:e};return u.requestWithHttpInfo(s,t)},restoreApiKey({key:e},t){n("key","restoreApiKey",e);let s={method:"POST",path:"/1/keys/{key}/restore".replace("{key}",encodeURIComponent(e)),queryParameters:{},headers:{}};return u.request(s,t)},restoreApiKeyWithHTTPInfo({key:e},t){n("key","restoreApiKeyWithHTTPInfo",e);let s={method:"POST",path:"/1/keys/{key}/restore".replace("{key}",encodeURIComponent(e)),queryParameters:{},headers:{}};return u.requestWithHttpInfo(s,t)},saveObject({indexName:e,body:t},r){n("indexName","saveObject",e),n("body","saveObject",t);let i={method:"POST",path:"/1/indexes/{indexName}".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return u.request(i,r)},saveObjectWithHTTPInfo({indexName:e,body:t},r){n("indexName","saveObjectWithHTTPInfo",e),n("body","saveObjectWithHTTPInfo",t);let i={method:"POST",path:"/1/indexes/{indexName}".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return u.requestWithHttpInfo(i,r)},saveRule({indexName:e,objectID:t,rule:r,forwardToReplicas:a},o){n("indexName","saveRule",e),n("objectID","saveRule",t),n("rule","saveRule",r),n("rule.objectID","saveRule",r.objectID),n("rule.consequence","saveRule",r.consequence);let s="/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),i={},d={};a!==void 0&&(d.forwardToReplicas=a.toString());let P={method:"PUT",path:s,queryParameters:d,headers:i,data:r};return u.request(P,o)},saveRuleWithHTTPInfo({indexName:e,objectID:t,rule:r,forwardToReplicas:a},o){n("indexName","saveRuleWithHTTPInfo",e),n("objectID","saveRuleWithHTTPInfo",t),n("rule","saveRuleWithHTTPInfo",r),n("rule.objectID","saveRuleWithHTTPInfo",r.objectID),n("rule.consequence","saveRuleWithHTTPInfo",r.consequence);let s="/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),i={},d={};a!==void 0&&(d.forwardToReplicas=a.toString());let P={method:"PUT",path:s,queryParameters:d,headers:i,data:r};return u.requestWithHttpInfo(P,o)},saveRules({indexName:e,rules:t,forwardToReplicas:r,clearExistingRules:a},o){n("indexName","saveRules",e),n("rules","saveRules",t);let s="/1/indexes/{indexName}/rules/batch".replace("{indexName}",encodeURIComponent(e)),i={},d={};r!==void 0&&(d.forwardToReplicas=r.toString()),a!==void 0&&(d.clearExistingRules=a.toString());let P={method:"POST",path:s,queryParameters:d,headers:i,data:t};return u.request(P,o)},saveRulesWithHTTPInfo({indexName:e,rules:t,forwardToReplicas:r,clearExistingRules:a},o){n("indexName","saveRulesWithHTTPInfo",e),n("rules","saveRulesWithHTTPInfo",t);let s="/1/indexes/{indexName}/rules/batch".replace("{indexName}",encodeURIComponent(e)),i={},d={};r!==void 0&&(d.forwardToReplicas=r.toString()),a!==void 0&&(d.clearExistingRules=a.toString());let P={method:"POST",path:s,queryParameters:d,headers:i,data:t};return u.requestWithHttpInfo(P,o)},saveSynonym({indexName:e,objectID:t,synonymHit:r,forwardToReplicas:a},o){n("indexName","saveSynonym",e),n("objectID","saveSynonym",t),n("synonymHit","saveSynonym",r),n("synonymHit.objectID","saveSynonym",r.objectID),n("synonymHit.type","saveSynonym",r.type);let s="/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),i={},d={};a!==void 0&&(d.forwardToReplicas=a.toString());let P={method:"PUT",path:s,queryParameters:d,headers:i,data:r};return u.request(P,o)},saveSynonymWithHTTPInfo({indexName:e,objectID:t,synonymHit:r,forwardToReplicas:a},o){n("indexName","saveSynonymWithHTTPInfo",e),n("objectID","saveSynonymWithHTTPInfo",t),n("synonymHit","saveSynonymWithHTTPInfo",r),n("synonymHit.objectID","saveSynonymWithHTTPInfo",r.objectID),n("synonymHit.type","saveSynonymWithHTTPInfo",r.type);let s="/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),i={},d={};a!==void 0&&(d.forwardToReplicas=a.toString());let P={method:"PUT",path:s,queryParameters:d,headers:i,data:r};return u.requestWithHttpInfo(P,o)},saveSynonyms({indexName:e,synonymHit:t,forwardToReplicas:r,replaceExistingSynonyms:a},o){n("indexName","saveSynonyms",e),n("synonymHit","saveSynonyms",t);let s="/1/indexes/{indexName}/synonyms/batch".replace("{indexName}",encodeURIComponent(e)),i={},d={};r!==void 0&&(d.forwardToReplicas=r.toString()),a!==void 0&&(d.replaceExistingSynonyms=a.toString());let P={method:"POST",path:s,queryParameters:d,headers:i,data:t};return u.request(P,o)},saveSynonymsWithHTTPInfo({indexName:e,synonymHit:t,forwardToReplicas:r,replaceExistingSynonyms:a},o){n("indexName","saveSynonymsWithHTTPInfo",e),n("synonymHit","saveSynonymsWithHTTPInfo",t);let s="/1/indexes/{indexName}/synonyms/batch".replace("{indexName}",encodeURIComponent(e)),i={},d={};r!==void 0&&(d.forwardToReplicas=r.toString()),a!==void 0&&(d.replaceExistingSynonyms=a.toString());let P={method:"POST",path:s,queryParameters:d,headers:i,data:t};return u.requestWithHttpInfo(P,o)},search(e,t){e&&Array.isArray(e)&&(e={requests:e.map(({params:d,...P})=>P.type==="facet"?{...P,...d,type:"facet"}:{...P,...d,facet:void 0,maxFacetHits:void 0,facetQuery:void 0})}),n("searchMethodParams","search",e),n("searchMethodParams.requests","search",e.requests);let s={method:"POST",path:"/1/indexes/*/queries",queryParameters:{},headers:{},data:e,useReadTransporter:true,cacheable:true};return u.request(s,t)},searchWithHTTPInfo(e,t){e&&Array.isArray(e)&&(e={requests:e.map(({params:d,...P})=>P.type==="facet"?{...P,...d,type:"facet"}:{...P,...d,facet:void 0,maxFacetHits:void 0,facetQuery:void 0})}),n("searchMethodParams","searchWithHTTPInfo",e),n("searchMethodParams.requests","searchWithHTTPInfo",e.requests);let s={method:"POST",path:"/1/indexes/*/queries",queryParameters:{},headers:{},data:e,useReadTransporter:true,cacheable:true};return u.requestWithHttpInfo(s,t)},searchDictionaryEntries({dictionaryName:e,searchDictionaryEntriesParams:t},r){n("dictionaryName","searchDictionaryEntries",e),n("searchDictionaryEntriesParams","searchDictionaryEntries",t),n("searchDictionaryEntriesParams.query","searchDictionaryEntries",t.query);let i={method:"POST",path:"/1/dictionaries/{dictionaryName}/search".replace("{dictionaryName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t,useReadTransporter:true,cacheable:true};return u.request(i,r)},searchDictionaryEntriesWithHTTPInfo({dictionaryName:e,searchDictionaryEntriesParams:t},r){n("dictionaryName","searchDictionaryEntriesWithHTTPInfo",e),n("searchDictionaryEntriesParams","searchDictionaryEntriesWithHTTPInfo",t),n("searchDictionaryEntriesParams.query","searchDictionaryEntriesWithHTTPInfo",t.query);let i={method:"POST",path:"/1/dictionaries/{dictionaryName}/search".replace("{dictionaryName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t,useReadTransporter:true,cacheable:true};return u.requestWithHttpInfo(i,r)},searchForFacetValues({indexName:e,facetName:t,searchForFacetValuesRequest:r},a){n("indexName","searchForFacetValues",e),n("facetName","searchForFacetValues",t);let d={method:"POST",path:"/1/indexes/{indexName}/facets/{facetName}/query".replace("{indexName}",encodeURIComponent(e)).replace("{facetName}",encodeURIComponent(t)),queryParameters:{},headers:{},data:r||{},useReadTransporter:true,cacheable:true};return u.request(d,a)},searchForFacetValuesWithHTTPInfo({indexName:e,facetName:t,searchForFacetValuesRequest:r},a){n("indexName","searchForFacetValuesWithHTTPInfo",e),n("facetName","searchForFacetValuesWithHTTPInfo",t);let d={method:"POST",path:"/1/indexes/{indexName}/facets/{facetName}/query".replace("{indexName}",encodeURIComponent(e)).replace("{facetName}",encodeURIComponent(t)),queryParameters:{},headers:{},data:r||{},useReadTransporter:true,cacheable:true};return u.requestWithHttpInfo(d,a)},searchRules({indexName:e,searchRulesParams:t},r){n("indexName","searchRules",e);let i={method:"POST",path:"/1/indexes/{indexName}/rules/search".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t||{},useReadTransporter:true,cacheable:true};return u.request(i,r)},searchRulesWithHTTPInfo({indexName:e,searchRulesParams:t},r){n("indexName","searchRulesWithHTTPInfo",e);let i={method:"POST",path:"/1/indexes/{indexName}/rules/search".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t||{},useReadTransporter:true,cacheable:true};return u.requestWithHttpInfo(i,r)},searchSingleIndex({indexName:e,searchParams:t},r){n("indexName","searchSingleIndex",e);let i={method:"POST",path:"/1/indexes/{indexName}/query".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t||{},useReadTransporter:true,cacheable:true};return u.request(i,r)},searchSingleIndexWithHTTPInfo({indexName:e,searchParams:t},r){n("indexName","searchSingleIndexWithHTTPInfo",e);let i={method:"POST",path:"/1/indexes/{indexName}/query".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t||{},useReadTransporter:true,cacheable:true};return u.requestWithHttpInfo(i,r)},searchSynonyms({indexName:e,searchSynonymsParams:t},r){n("indexName","searchSynonyms",e);let i={method:"POST",path:"/1/indexes/{indexName}/synonyms/search".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t||{},useReadTransporter:true,cacheable:true};return u.request(i,r)},searchSynonymsWithHTTPInfo({indexName:e,searchSynonymsParams:t},r){n("indexName","searchSynonymsWithHTTPInfo",e);let i={method:"POST",path:"/1/indexes/{indexName}/synonyms/search".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t||{},useReadTransporter:true,cacheable:true};return u.requestWithHttpInfo(i,r)},searchUserIds(e,t){n("searchUserIdsParams","searchUserIds",e),n("searchUserIdsParams.query","searchUserIds",e.query);let s={method:"POST",path:"/1/clusters/mapping/search",queryParameters:{},headers:{},data:e,useReadTransporter:true,cacheable:true};return u.request(s,t)},searchUserIdsWithHTTPInfo(e,t){n("searchUserIdsParams","searchUserIdsWithHTTPInfo",e),n("searchUserIdsParams.query","searchUserIdsWithHTTPInfo",e.query);let s={method:"POST",path:"/1/clusters/mapping/search",queryParameters:{},headers:{},data:e,useReadTransporter:true,cacheable:true};return u.requestWithHttpInfo(s,t)},setDictionarySettings(e,t){n("dictionarySettingsParams","setDictionarySettings",e),n("dictionarySettingsParams.disableStandardEntries","setDictionarySettings",e.disableStandardEntries);let s={method:"PUT",path:"/1/dictionaries/*/settings",queryParameters:{},headers:{},data:e};return u.request(s,t)},setDictionarySettingsWithHTTPInfo(e,t){n("dictionarySettingsParams","setDictionarySettingsWithHTTPInfo",e),n("dictionarySettingsParams.disableStandardEntries","setDictionarySettingsWithHTTPInfo",e.disableStandardEntries);let s={method:"PUT",path:"/1/dictionaries/*/settings",queryParameters:{},headers:{},data:e};return u.requestWithHttpInfo(s,t)},setSettings({indexName:e,indexSettings:t,forwardToReplicas:r},a){n("indexName","setSettings",e),n("indexSettings","setSettings",t);let o="/1/indexes/{indexName}/settings".replace("{indexName}",encodeURIComponent(e)),s={},i={};r!==void 0&&(i.forwardToReplicas=r.toString());let d={method:"PUT",path:o,queryParameters:i,headers:s,data:t};return u.request(d,a)},setSettingsWithHTTPInfo({indexName:e,indexSettings:t,forwardToReplicas:r},a){n("indexName","setSettingsWithHTTPInfo",e),n("indexSettings","setSettingsWithHTTPInfo",t);let o="/1/indexes/{indexName}/settings".replace("{indexName}",encodeURIComponent(e)),s={},i={};r!==void 0&&(i.forwardToReplicas=r.toString());let d={method:"PUT",path:o,queryParameters:i,headers:s,data:t};return u.requestWithHttpInfo(d,a)},updateApiKey({key:e,apiKey:t},r){n("key","updateApiKey",e),n("apiKey","updateApiKey",t),n("apiKey.acl","updateApiKey",t.acl);let i={method:"PUT",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return u.request(i,r)},updateApiKeyWithHTTPInfo({key:e,apiKey:t},r){n("key","updateApiKeyWithHTTPInfo",e),n("apiKey","updateApiKeyWithHTTPInfo",t),n("apiKey.acl","updateApiKeyWithHTTPInfo",t.acl);let i={method:"PUT",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return u.requestWithHttpInfo(i,r)}}}function Do(p,c,h){if(!p||typeof p!="string")throw new Error("`appId` is missing.");if(!c||typeof c!="string")throw new Error("`apiKey` is missing.");let{compression:m,...l}=h||{};return de({appId:p,apiKey:c,timeouts:{connect:1e3,read:2e3,write:3e4},logger:se(),requester:ce(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:k(),requestsCache:k({serializable:false}),hostsCache:E({caches:[Z({key:`${w}-${p}`}),k()]}),...l})}
|
|
12
12
|
|
|
13
|
-
exports.apiClientVersion =
|
|
14
|
-
exports.searchClient =
|
|
13
|
+
exports.apiClientVersion = w;
|
|
14
|
+
exports.searchClient = Do;
|
|
15
15
|
|
|
16
16
|
}));
|