@algolia/client-search 5.55.2 → 5.57.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 +861 -6
- package/dist/builds/browser.js +1933 -87
- package/dist/builds/browser.js.map +1 -1
- package/dist/builds/browser.min.js +5 -5
- package/dist/builds/browser.min.js.map +1 -1
- package/dist/builds/browser.umd.js +7 -7
- package/dist/builds/fetch.js +1983 -123
- package/dist/builds/fetch.js.map +1 -1
- package/dist/builds/node.cjs +1978 -121
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +1983 -123
- package/dist/builds/node.js.map +1 -1
- package/dist/builds/worker.js +1933 -87
- package/dist/builds/worker.js.map +1 -1
- package/dist/fetch.d.ts +861 -6
- package/dist/node.d.cts +861 -6
- package/dist/node.d.ts +861 -6
- package/dist/src/searchClient.cjs +1929 -86
- package/dist/src/searchClient.cjs.map +1 -1
- package/dist/src/searchClient.js +1932 -87
- package/dist/src/searchClient.js.map +1 -1
- package/dist/worker.d.ts +861 -6
- package/package.json +10 -10
|
@@ -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
|
|
8
|
-
`&&(r=1));r<t.length;){let
|
|
9
|
-
`,r);if(
|
|
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.2";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})}
|
|
7
|
+
function ie(c){let d,p=`algolia-client-js-${c.key}`;function h(){return d===void 0&&(d=c.localStorage||window.localStorage),d}function l(){return JSON.parse(h().getItem(p)||"{}")}function f(t){h().setItem(p,JSON.stringify(t));}function u(){return new Promise(t=>setTimeout(t,0))}function e(){let t=c.timeToLive?c.timeToLive*1e3:null,r=l(),o=new Date().getTime(),a=false;return {namespace:Object.fromEntries(Object.entries(r).filter(([,i])=>!i||i.timestamp===void 0||t&&i.timestamp+t<o?(a=true,false):true)),changed:a}}return {get(t,r,o={miss:()=>Promise.resolve()}){return u().then(()=>{let{namespace:a,changed:s}=e(),i=a[JSON.stringify(t)];return s&&f(a),i?i.value:r().then(m=>o.miss(m).then(()=>m))})},set(t,r){return u().then(()=>{let o=l();return o[JSON.stringify(t)]={timestamp:new Date().getTime(),value:r},h().setItem(p,JSON.stringify(o)),r})},delete(t){return u().then(()=>{let r=l();delete r[JSON.stringify(t)],h().setItem(p,JSON.stringify(r));})},clear(){return Promise.resolve().then(()=>{h().removeItem(p);})}}}function Ie(){return {get(c,d,p={miss:()=>Promise.resolve()}){return d().then(l=>Promise.all([l,p.miss(l)])).then(([l])=>l)},set(c,d){return Promise.resolve(d)},delete(c){return Promise.resolve()},clear(){return Promise.resolve()}}}function C(c){let d=[...c.caches],p=d.shift();return p===void 0?Ie():{get(h,l,f={miss:()=>Promise.resolve()}){return p.get(h,l,f).catch(()=>C({caches:d}).get(h,l,f))},set(h,l){return p.set(h,l).catch(()=>C({caches:d}).set(h,l))},delete(h){return p.delete(h).catch(()=>C({caches:d}).delete(h))},clear(){return p.clear().catch(()=>C({caches:d}).clear())}}}function K(c={serializable:true}){let d={};return {get(p,h,l={miss:()=>Promise.resolve()}){let f=JSON.stringify(p);if(f in d)return Promise.resolve(c.serializable?JSON.parse(d[f]):d[f]);let u=h();return u.then(e=>l.miss(e)).then(()=>u)},set(p,h){return d[JSON.stringify(p)]=c.serializable?JSON.stringify(h):h,Promise.resolve(h)},delete(p){return delete d[JSON.stringify(p)],Promise.resolve()},clear(){return d={},Promise.resolve()}}}var ue=800;function ge(c){let d={value:`Algolia for JavaScript (${c})`,add(p){let h=`; ${p.segment}${p.version!==void 0?` (${p.version})`:""}`;return d.value.indexOf(h)===-1&&(d.value=`${d.value}${h}`),d}};return d}function ce(c,d,p="WithinHeaders"){let h={"x-algolia-api-key":d,"x-algolia-application-id":c};return {headers(){return p==="WithinHeaders"?h:{}},queryParameters(){return p==="WithinQueryParameters"?h:{}}}}function v({func:c,validate:d,aggregator:p,error:h,timeout:l=()=>0}){let f=u=>new Promise((e,t)=>{c(u).then(async r=>(p&&await p(r),await d(r)?e(r):h&&await h.validate(r)?t(new Error(await h.message(r))):setTimeout(()=>{f(r).then(e).catch(t);},await l()))).catch(r=>{t(r);});});return f()}function de({algoliaAgents:c,client:d,version:p}){let h=ge(p).add({segment:d,version:p});return c.forEach(l=>h.add(l)),h}function pe(){return {debug(c,d){return Promise.resolve()},info(c,d){return Promise.resolve()},error(c,d){return Promise.resolve()}}}function me(c,d){c.warn?Promise.resolve(c.warn(d)).catch(()=>{}):console.warn(d);}var xe=10*1024*1024;async function*He(c){let d=c.getReader();try{for(;;){let{done:p,value:h}=await d.read();if(p)return;yield h;}}finally{d.releaseLock();}}function Se(c){return Symbol.asyncIterator in c?c:He(c)}async function*Oe(c){let d=new TextDecoder("utf-8"),p=[],h=0,l=false,f=true;for await(let e of Se(c)){let t=d.decode(e,{stream:true}),r=0;for(l&&(l=false,t.length>0&&t[0]===`
|
|
8
|
+
`&&(r=1));r<t.length;){let o=t.indexOf("\r",r),a=t.indexOf(`
|
|
9
|
+
`,r);if(o===-1&&a===-1){let O=t.slice(r);if(p.push(O),h+=O.length,h>xe)throw new Error("SSE line buffer exceeded 10MB");break}let s,i;o!==-1&&(a===-1||o<a)?(s=o,o+1<t.length?i=t[o+1]===`
|
|
10
|
+
`?2:1:(l=true,i=1)):(s=a,i=1);let m=t.slice(r,s);p.push(m);let P=p.length===1?p[0]:p.join("");p.length=0,h=0,f&&(P.startsWith("\uFEFF")&&(P=P.slice(1)),f=false),yield P,r=s+i;}}let u=d.decode();if(u&&p.push(u),p.length>0){let e=p.join("");f&&e.startsWith("\uFEFF")&&(e=e.slice(1)),yield e;}}var be=class{data=[];eventType="";lastEventId=null;retry=null;decode(c){if(c==="")return this.dispatch();if(c[0]===":")return null;let d=c.indexOf(":"),p,h;switch(d===-1?(p=c,h=""):(p=c.slice(0,d),h=c.slice(d+1),h[0]===" "&&(h=h.slice(1))),p){case "data":this.data.push(h);break;case "event":this.eventType=h;break;case "id":h.includes("\0")||(this.lastEventId=h);break;case "retry":/^[0-9]+$/.test(h)&&(this.retry=parseInt(h,10));break}return null}dispatch(){let c=this.eventType;if(this.eventType="",this.data.length===0)return null;let d={data:this.data.join(`
|
|
11
|
+
`),event:c,id:this.lastEventId,retry:this.retry};return this.data=[],d}};async function*Ae(c){let d=new be;for await(let p of Oe(c)){let h=d.decode(p);h!==null&&(yield h);}}var Ue=750,Z=120*1e3;function ee(c,d="up"){let p=Date.now();function h(){return d==="up"||Date.now()-p>Z}function l(){return d==="timed out"&&Date.now()-p<=Z}return {...c,status:d,lastUpdate:p,isUp:h,isTimedOut:l}}var he=class extends Error{name="AlgoliaError";constructor(c,d){super(c),d&&(this.name=d);}};var Pe=class extends he{stackTrace;correlationId;constructor(c,d,p,h){super(h?`${c} (Correlation-ID: ${h})`:c,p),this.stackTrace=d,this.correlationId=h;}},te=class extends Pe{constructor(c,d){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",c,"RetryError",d);}},w=class extends Pe{status;constructor(c,d,p,h="ApiError",l){super(c,p,h,l),this.status=d;}},We=class extends he{response;correlationId;constructor(c,d,p){super(p?`${c} (Correlation-ID: ${p})`:c,"DeserializationError"),this.response=d,this.correlationId=p;}},Ee=class extends w{error;constructor(c,d,p,h,l){super(c,d,h,"DetailedApiError",l),this.error=p;}};function le(c){let d=c;for(let p=c.length-1;p>0;p--){let h=Math.floor(Math.random()*(p+1)),l=c[p];d[p]=c[h],d[h]=l;}return d}function re(c,d,p){let h=De(p),l=`${c.protocol}://${c.url}${c.port?`:${c.port}`:""}/${d.charAt(0)==="/"?d.substring(1):d}`;return h.length&&(l+=`?${h}`),l}function De(c){return Object.keys(c).filter(d=>c[d]!==void 0).sort().map(d=>`${d}=${encodeURIComponent(Object.prototype.toString.call(c[d])==="[object Array]"?c[d].join(","):c[d]).replace(/\+/g,"%20")}`).join("&")}function se(c,d){if(c.method==="GET"||c.data===void 0&&d.data===void 0)return;let p=Array.isArray(c.data)?c.data:{...c.data,...d.data};return JSON.stringify(p)}function oe(c,d,p){let h={Accept:"application/json",...c,...d,...p},l={};return Object.keys(h).forEach(f=>{let u=h[f];l[f.toLowerCase()]=u;}),l}function qe(c){if(!(c.status===204||c.content.length===0))try{return JSON.parse(c.content)}catch(d){throw new We(d.message,c,z(c.headers))}}function ve(c){return {status:c.status,headers:c.headers,content:c.content,data:qe(c)}}function z(c){if(!c)return;if(c["correlation-id"]!==void 0)return c["correlation-id"];let d=Object.keys(c).find(p=>p.toLowerCase()==="correlation-id");return d===void 0?void 0:c[d]}function Ce(c){for(let d=c.length-1;d>=0;d--){let p=z(c[d].response.headers);if(p!==void 0)return p}}function je(c,d){let{content:p,status:h}=c,l=z(c.headers);try{let f=JSON.parse(p);return "error"in f?new Ee(f.message,h,f.error,d,l):new w(f.message,h,d,"ApiError",l)}catch{}return new w(p,h,d,"ApiError",l)}var G="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",ae=11;function L(){var c;let d="";if(typeof((c=globalThis.crypto)==null?void 0:c.getRandomValues)=="function"){let p=new Uint8Array(ae);globalThis.crypto.getRandomValues(p);for(let h of p)d+=G[h%G.length];return d}for(let p=0;p<ae;p++)d+=G[Math.floor(Math.random()*G.length)];return d}function ne(c,d){return c!==void 0&&Object.keys(c).some(p=>p.toLowerCase()==="request-id")||d!==void 0&&Object.keys(d).some(p=>p.toLowerCase()==="x-algolia-request-id")}function U(c,d){return c.requestIdChannel===void 0||ne(c.baseHeaders,c.baseQueryParameters)||ne(d?.headers,d?.queryParameters)?d:c.requestIdChannel==="headers"?{...d,headers:{...d?.headers,"request-id":L()}}:{...d,queryParameters:{...d?.queryParameters,"x-algolia-request-id":L()}}}function Ne({isTimedOut:c,status:d}){return !c&&~~d===0}function we({isTimedOut:c,status:d}){return c||Ne({isTimedOut:c,status:d})||~~(d/100)!==2&&~~(d/100)!==4}function ke({status:c}){return ~~(c/100)===2}function Qe(c){return c.map(d=>ye(d))}function ye(c){let d=c.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return {...c,request:{...c.request,headers:{...c.request.headers,...d}}}}function fe({hosts:c,hostsCache:d,baseHeaders:p,logger:h,baseQueryParameters:l,algoliaAgent:f,timeouts:u,requester:e,requestsCache:t,responsesCache:r,compress:o,compression:a,requestIdChannel:s}){function i(q,y){s===void 0||q["request-id"]!==void 0||Object.keys(y).some(H=>H.toLowerCase()==="x-algolia-request-id")||(s==="headers"?q["request-id"]=L():y["x-algolia-request-id"]=L());}async function m(q){let y=await Promise.all(q.map(R=>d.get(R,()=>Promise.resolve(ee(R))))),H=y.filter(R=>R.isUp()),I=y.filter(R=>R.isTimedOut()),b=[...H,...I];return {hosts:b.length>0?b:q,getTimeout(R,E){return (I.length===0&&R===0?1:I.length+3+R)*E}}}async function P(q,y,H){let I=[],b=se(q,y),T=oe(p,q.headers,y.headers),R=a==="gzip"&&b!==void 0&&b.length>Ue&&(q.method==="POST"||q.method==="PUT");R&&o===void 0&&h.info("Compression is disabled because no compress method is available.");let E=R&&o!==void 0,F=E?await o(b):b;E&&(T["content-encoding"]="gzip");let k=q.method==="GET"?{...q.data,...y.data}:{},A={...l,...q.queryParameters,...k};if(f.value&&(A["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]"?A[g]=y.queryParameters[g]:A[g]=y.queryParameters[g].toString();i(T,A);let j=0,Q=async(g,_)=>{let N=g.pop();if(N===void 0)throw new te(Qe(I),Ce(I));let M={...u,...y.timeouts},V={data:F,headers:T,method:q.method,url:re(N,q.path,A),connectTimeout:_(j,M.connect),responseTimeout:_(j,H?M.read:M.write)},X=$=>{let Y={request:V,response:$,host:N,triesLeft:g.length};return I.push(Y),Y},D=await e.send(V);if(we(D)){let $=X(D);return D.isTimedOut&&j++,h.info("Retryable failure",ye($)),await d.set(N,ee(N,D.isTimedOut?"timed out":"down")),Q(g,_)}if(ke(D))return D;throw X(D),je(D,I)},S=c.filter(g=>g.accept==="readWrite"||(H?g.accept==="read":g.accept==="write")),J=await m(S);return Q([...J.hosts].reverse(),J.getTimeout)}function O(q,y={}){let H=()=>P(q,y,I).then(R=>qe(R)),I=q.useReadTransporter||q.method==="GET";if((y.cacheable||q.cacheable)!==true)return H();let T={request:q,requestOptions:y,transporter:{queryParameters:l,headers:p}};return r.get(T,()=>t.get(T,()=>t.set(T,H()).then(R=>Promise.all([t.delete(T),R]),R=>Promise.all([t.delete(T),Promise.reject(R)])).then(([R,E])=>E)),{miss:R=>r.set(T,R)})}function x(q,y={}){let H=q.useReadTransporter||q.method==="GET";return P(q,y,H).then(I=>ve(I))}async function*W(q,y={}){if(!e.sendStream)throw new Error("This requester does not support streaming");let H=se(q,y),I=oe(p,q.headers,y.headers);I.accept="text/event-stream";let b=q.method==="GET"?{...q.data,...y.data}:{},T={...l,...q.queryParameters,...b};if(f.value&&(T["x-algolia-agent"]=f.value),y&&y.queryParameters)for(let S of Object.keys(y.queryParameters))!y.queryParameters[S]||Object.prototype.toString.call(y.queryParameters[S])==="[object Object]"?T[S]=y.queryParameters[S]:T[S]=y.queryParameters[S].toString();i(I,T);let R=q.useReadTransporter||q.method==="GET",E=c.filter(S=>S.accept==="readWrite"||(R?S.accept==="read":S.accept==="write")),k=(await m(E)).hosts[0];if(!k)throw new te([]);let A={...u,...y.timeouts},j={data:H,headers:I,method:q.method,url:re(k,q.path,T),connectTimeout:A.connect,responseTimeout:R?A.read:A.write},Q=await e.sendStream(j);yield*Ae(Q);}return {hostsCache:d,requester:e,timeouts:u,logger:h,algoliaAgent:f,baseHeaders:p,baseQueryParameters:l,requestIdChannel:s,hosts:c,request:O,requestWithHttpInfo:x,requestStream:W,requestsCache:t,responsesCache:r}}function n(c,d,p){if(p==null||typeof p=="string"&&p.length===0)throw new Error(`Parameter \`${c}\` is required when calling \`${d}\`.`)}function Ge(c){let d={};for(let p of c.trim().split(/[\r\n]+/)){let h=p.indexOf(": ");h>0&&(d[p.slice(0,h).toLowerCase()]=p.slice(h+2));}return d}function Re(){function c(d){return new Promise(p=>{let h=new XMLHttpRequest;h.open(d.method,d.url,true),Object.keys(d.headers).forEach(e=>h.setRequestHeader(e,d.headers[e]));let l=(e,t)=>setTimeout(()=>{h.abort(),p({status:0,content:t,isTimedOut:true});},e),f=l(d.connectTimeout,"Connection timeout"),u;h.onreadystatechange=()=>{h.readyState>h.OPENED&&u===void 0&&(clearTimeout(f),u=l(d.responseTimeout,"Socket timeout"));},h.onerror=()=>{h.status===0&&(clearTimeout(f),clearTimeout(u),p({content:h.responseText||"Network request failed",status:h.status,isTimedOut:false}));},h.onload=()=>{clearTimeout(f),clearTimeout(u),p({content:h.responseText,headers:Ge(h.getAllResponseHeaders()),status:h.status,isTimedOut:false});},h.send(d.data);})}return {send:c}}var B="5.57.0";function Le(c){return [{url:`${c}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${c}.algolia.net`,accept:"write",protocol:"https"}].concat(le([{url:`${c}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${c}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${c}-3.algolianet.com`,accept:"readWrite",protocol:"https"}]))}function Te({appId:c,apiKey:d,authMode:p,algoliaAgents:h,...l}){let f=ce(c,d,p),u=fe({hosts:Le(c),...l,algoliaAgent:de({algoliaAgents:h,client:"Search",version:B}),baseHeaders:{"content-type":"text/plain",...f.headers(),...l.baseHeaders},baseQueryParameters:{...f.queryParameters(),...l.baseQueryParameters}});return {transporter:u,appId:c,apiKey:d,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}){!p||p==="WithinHeaders"?u.baseHeaders["x-algolia-api-key"]=e:u.baseQueryParameters["x-algolia-api-key"]=e;},waitForTask({indexName:e,taskID:t,maxRetries:r=100,timeout:o=s=>Math.min(s*200,5e3)},a){a=U(u,a);let s=0;return v({func:()=>this.getTask({indexName:e,taskID:t},a),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:()=>o(s)})},waitForAppTask({taskID:e,maxRetries:t=100,timeout:r=a=>Math.min(a*200,5e3)},o){o=U(u,o);let a=0;return v({func:()=>this.getAppTask({taskID:e},o),validate:s=>s.status==="published",aggregator:()=>a+=1,error:{validate:()=>a>=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(a)})},waitForApiKey({operation:e,key:t,apiKey:r,maxRetries:o=100,timeout:a=i=>Math.min(i*200,5e3)},s){s=U(u,s);let i=0,m={aggregator:()=>i+=1,error:{validate:()=>i>=o,message:()=>`Stopped waiting for the API key operation after ${o} 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(i)};if(e==="update"){if(!r)throw new Error("`apiKey` is required when waiting for an `update` operation.");return v({...m,func:()=>this.getApiKey({key:t},s),validate:P=>{for(let O of Object.keys(r)){let x=r[O],W=P[O];if(Array.isArray(x)&&Array.isArray(W)){if(x.length!==W.length||x.some((q,y)=>q!==W[y]))return false}else if(x!==W)return false}return true}})}return v({...m,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},o){return o=U(u,o),v({func:a=>this.browse({indexName:e,browseParams:{cursor:a?a.cursor:void 0,hitsPerPage:1e3,...t}},o),validate:a=>a.cursor===void 0,...r})},browseRules({indexName:e,searchRulesParams:t,...r},o){o=U(u,o);let a={...t,hitsPerPage:t?.hitsPerPage||1e3};return v({func:s=>this.searchRules({indexName:e,searchRulesParams:{...a,page:s?s.page+1:a.page||0}},o),validate:s=>s.hits.length<a.hitsPerPage,...r})},browseSynonyms({indexName:e,searchSynonymsParams:t,...r},o){o=U(u,o);let a={...t,page:t?.page||0,hitsPerPage:1e3};return v({func:s=>{let i=this.searchSynonyms({indexName:e,searchSynonymsParams:{...a,page:a.page}},o);return a.page+=1,i},validate:s=>s.hits.length<a.hitsPerPage,...r})},async chunkedBatch({indexName:e,objects:t,action:r="addObject",waitForTasks:o,batchSize:a=1e3,maxRetries:s=100},i){i=U(u,i);let m=[],P=[],O=t.entries();for(let[x,W]of O)m.push({action:r,body:W}),(m.length===a||x===t.length-1)&&(P.push(await this.batch({indexName:e,batchWriteParams:{requests:m}},i)),m=[]);if(o)for(let x of P)await this.waitForTask({indexName:e,taskID:x.taskID,maxRetries:s},i);return P},async saveObjects({indexName:e,objects:t,waitForTasks:r,batchSize:o,maxRetries:a},s){return await this.chunkedBatch({indexName:e,objects:t,action:"addObject",waitForTasks:r,batchSize:o,maxRetries:a},s)},async deleteObjects({indexName:e,objectIDs:t,waitForTasks:r,batchSize:o,maxRetries:a},s){return await this.chunkedBatch({indexName:e,objects:t.map(i=>({objectID:i})),action:"deleteObject",waitForTasks:r,batchSize:o,maxRetries:a},s)},async partialUpdateObjects({indexName:e,objects:t,createIfNotExists:r,waitForTasks:o,batchSize:a,maxRetries:s},i){return await this.chunkedBatch({indexName:e,objects:t,action:r?"partialUpdateObject":"partialUpdateObjectNoCreate",batchSize:a,waitForTasks:o,maxRetries:s},i)},async replaceAllObjects({indexName:e,objects:t,batchSize:r,scopes:o,maxRetries:a=ue},s){s=U(u,s),t.length===0&&me(u.logger,`replaceAllObjects was called with an empty list of objects, which will delete all records currently in the "${e}" index.`);let i=Math.floor(Math.random()*1e6)+1e5,m=`${e}_tmp_${i}`;o===void 0&&(o=["settings","rules","synonyms"]);try{let P=await this.operationIndex({indexName:e,operationIndexParams:{operation:"copy",destination:m,scope:o}},s),O=await this.chunkedBatch({indexName:m,objects:t,waitForTasks:!0,batchSize:r,maxRetries:a},s);await this.waitForTask({indexName:m,taskID:P.taskID,maxRetries:a},s),P=await this.operationIndex({indexName:e,operationIndexParams:{operation:"copy",destination:m,scope:o}},s),await this.waitForTask({indexName:m,taskID:P.taskID,maxRetries:a},s);let x=await this.operationIndex({indexName:m,operationIndexParams:{operation:"move",destination:e}},s);return await this.waitForTask({indexName:m,taskID:x.taskID,maxRetries:a},s),{copyOperationResponse:P,batchResponses:O,moveOperationResponse:x}}catch(P){throw await this.deleteIndex({indexName:m},s),P}},async indexExists({indexName:e},t){try{await this.getSettings({indexName:e},t);}catch(r){if(r instanceof w&&r.status===404)return false;throw r}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},o){n("indexName","addOrUpdateObject",e),n("objectID","addOrUpdateObject",t),n("body","addOrUpdateObject",r);let m={method:"PUT",path:"/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),queryParameters:{},headers:{},data:r};return u.request(m,o)},addOrUpdateObjectWithHTTPInfo({indexName:e,objectID:t,body:r},o){n("indexName","addOrUpdateObjectWithHTTPInfo",e),n("objectID","addOrUpdateObjectWithHTTPInfo",t),n("body","addOrUpdateObjectWithHTTPInfo",r);let m={method:"PUT",path:"/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),queryParameters:{},headers:{},data:r};return u.requestWithHttpInfo(m,o)},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 o="/1/clusters/mapping",a={},s={};e!==void 0&&(a["X-Algolia-User-ID"]=e.toString());let i={method:"POST",path:o,queryParameters:s,headers:a,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 o="/1/clusters/mapping",a={},s={};e!==void 0&&(a["X-Algolia-User-ID"]=e.toString());let i={method:"POST",path:o,queryParameters:s,headers:a,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 o="/1/clusters/mapping/batch",a={},s={};e!==void 0&&(a["X-Algolia-User-ID"]=e.toString());let i={method:"POST",path:o,queryParameters:s,headers:a,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 o="/1/clusters/mapping/batch",a={},s={};e!==void 0&&(a["X-Algolia-User-ID"]=e.toString());let i={method:"POST",path:o,queryParameters:s,headers:a,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 o="/1/indexes/{indexName}/rules/clear".replace("{indexName}",encodeURIComponent(e)),a={},s={};t!==void 0&&(s.forwardToReplicas=t.toString());let i={method:"POST",path:o,queryParameters:s,headers:a};return u.request(i,r)},clearRulesWithHTTPInfo({indexName:e,forwardToReplicas:t},r){n("indexName","clearRulesWithHTTPInfo",e);let o="/1/indexes/{indexName}/rules/clear".replace("{indexName}",encodeURIComponent(e)),a={},s={};t!==void 0&&(s.forwardToReplicas=t.toString());let i={method:"POST",path:o,queryParameters:s,headers:a};return u.requestWithHttpInfo(i,r)},clearSynonyms({indexName:e,forwardToReplicas:t},r){n("indexName","clearSynonyms",e);let o="/1/indexes/{indexName}/synonyms/clear".replace("{indexName}",encodeURIComponent(e)),a={},s={};t!==void 0&&(s.forwardToReplicas=t.toString());let i={method:"POST",path:o,queryParameters:s,headers:a};return u.request(i,r)},clearSynonymsWithHTTPInfo({indexName:e,forwardToReplicas:t},r){n("indexName","clearSynonymsWithHTTPInfo",e);let o="/1/indexes/{indexName}/synonyms/clear".replace("{indexName}",encodeURIComponent(e)),a={},s={};t!==void 0&&(s.forwardToReplicas=t.toString());let i={method:"POST",path:o,queryParameters:s,headers:a};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},o){n("path","customPost",e);let m={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return u.request(m,o)},customPostWithHTTPInfo({path:e,parameters:t,body:r},o){n("path","customPostWithHTTPInfo",e);let m={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return u.requestWithHttpInfo(m,o)},customPut({path:e,parameters:t,body:r},o){n("path","customPut",e);let m={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return u.request(m,o)},customPutWithHTTPInfo({path:e,parameters:t,body:r},o){n("path","customPutWithHTTPInfo",e);let m={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return u.requestWithHttpInfo(m,o)},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},o){n("indexName","deleteRule",e),n("objectID","deleteRule",t);let a="/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),s={},i={};r!==void 0&&(i.forwardToReplicas=r.toString());let m={method:"DELETE",path:a,queryParameters:i,headers:s};return u.request(m,o)},deleteRuleWithHTTPInfo({indexName:e,objectID:t,forwardToReplicas:r},o){n("indexName","deleteRuleWithHTTPInfo",e),n("objectID","deleteRuleWithHTTPInfo",t);let a="/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),s={},i={};r!==void 0&&(i.forwardToReplicas=r.toString());let m={method:"DELETE",path:a,queryParameters:i,headers:s};return u.requestWithHttpInfo(m,o)},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},o){n("indexName","deleteSynonym",e),n("objectID","deleteSynonym",t);let a="/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),s={},i={};r!==void 0&&(i.forwardToReplicas=r.toString());let m={method:"DELETE",path:a,queryParameters:i,headers:s};return u.request(m,o)},deleteSynonymWithHTTPInfo({indexName:e,objectID:t,forwardToReplicas:r},o){n("indexName","deleteSynonymWithHTTPInfo",e),n("objectID","deleteSynonymWithHTTPInfo",t);let a="/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),s={},i={};r!==void 0&&(i.forwardToReplicas=r.toString());let m={method:"DELETE",path:a,queryParameters:i,headers:s};return u.requestWithHttpInfo(m,o)},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 a={method:"GET",path:"/1/dictionaries/*/languages",queryParameters:{},headers:{}};return u.request(a,e)},getDictionaryLanguagesWithHTTPInfo(e){let a={method:"GET",path:"/1/dictionaries/*/languages",queryParameters:{},headers:{}};return u.requestWithHttpInfo(a,e)},getDictionarySettings(e){let a={method:"GET",path:"/1/dictionaries/*/settings",queryParameters:{},headers:{}};return u.request(a,e)},getDictionarySettingsWithHTTPInfo(e){let a={method:"GET",path:"/1/dictionaries/*/settings",queryParameters:{},headers:{}};return u.requestWithHttpInfo(a,e)},getLogs({offset:e,length:t,indexName:r,type:o}={},a=void 0){let s="/1/logs",i={},m={};e!==void 0&&(m.offset=e.toString()),t!==void 0&&(m.length=t.toString()),r!==void 0&&(m.indexName=r.toString()),o!==void 0&&(m.type=o.toString());let P={method:"GET",path:s,queryParameters:m,headers:i};return u.request(P,a)},getLogsWithHTTPInfo({offset:e,length:t,indexName:r,type:o}={},a=void 0){let s="/1/logs",i={},m={};e!==void 0&&(m.offset=e.toString()),t!==void 0&&(m.length=t.toString()),r!==void 0&&(m.indexName=r.toString()),o!==void 0&&(m.type=o.toString());let P={method:"GET",path:s,queryParameters:m,headers:i};return u.requestWithHttpInfo(P,a)},getObject({indexName:e,objectID:t,attributesToRetrieve:r},o){n("indexName","getObject",e),n("objectID","getObject",t);let a="/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),s={},i={};r!==void 0&&(i.attributesToRetrieve=r.toString());let m={method:"GET",path:a,queryParameters:i,headers:s};return u.request(m,o)},getObjectWithHTTPInfo({indexName:e,objectID:t,attributesToRetrieve:r},o){n("indexName","getObjectWithHTTPInfo",e),n("objectID","getObjectWithHTTPInfo",t);let a="/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),s={},i={};r!==void 0&&(i.attributesToRetrieve=r.toString());let m={method:"GET",path:a,queryParameters:i,headers:s};return u.requestWithHttpInfo(m,o)},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 o="/1/indexes/{indexName}/settings".replace("{indexName}",encodeURIComponent(e)),a={},s={};t!==void 0&&(s.getVersion=t.toString());let i={method:"GET",path:o,queryParameters:s,headers:a};return u.request(i,r)},getSettingsWithHTTPInfo({indexName:e,getVersion:t},r){n("indexName","getSettingsWithHTTPInfo",e);let o="/1/indexes/{indexName}/settings".replace("{indexName}",encodeURIComponent(e)),a={},s={};t!==void 0&&(s.getVersion=t.toString());let i={method:"GET",path:o,queryParameters:s,headers:a};return u.requestWithHttpInfo(i,r)},getSources(e){let a={method:"GET",path:"/1/security/sources",queryParameters:{},headers:{}};return u.request(a,e)},getSourcesWithHTTPInfo(e){let a={method:"GET",path:"/1/security/sources",queryParameters:{},headers:{}};return u.requestWithHttpInfo(a,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 a={method:"GET",path:"/1/clusters/mapping/top",queryParameters:{},headers:{}};return u.request(a,e)},getTopUserIdsWithHTTPInfo(e){let a={method:"GET",path:"/1/clusters/mapping/top",queryParameters:{},headers:{}};return u.requestWithHttpInfo(a,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",o={},a={};e!==void 0&&(a.getClusters=e.toString());let s={method:"GET",path:r,queryParameters:a,headers:o};return u.request(s,t)},hasPendingMappingsWithHTTPInfo({getClusters:e}={},t=void 0){let r="/1/clusters/mapping/pending",o={},a={};e!==void 0&&(a.getClusters=e.toString());let s={method:"GET",path:r,queryParameters:a,headers:o};return u.requestWithHttpInfo(s,t)},listApiKeys(e){let a={method:"GET",path:"/1/keys",queryParameters:{},headers:{}};return u.request(a,e)},listApiKeysWithHTTPInfo(e){let a={method:"GET",path:"/1/keys",queryParameters:{},headers:{}};return u.requestWithHttpInfo(a,e)},listClusters(e){let a={method:"GET",path:"/1/clusters",queryParameters:{},headers:{}};return u.request(a,e)},listClustersWithHTTPInfo(e){let a={method:"GET",path:"/1/clusters",queryParameters:{},headers:{}};return u.requestWithHttpInfo(a,e)},listIndices({page:e,hitsPerPage:t}={},r=void 0){let o="/1/indexes",a={},s={};e!==void 0&&(s.page=e.toString()),t!==void 0&&(s.hitsPerPage=t.toString());let i={method:"GET",path:o,queryParameters:s,headers:a};return u.request(i,r)},listIndicesWithHTTPInfo({page:e,hitsPerPage:t}={},r=void 0){let o="/1/indexes",a={},s={};e!==void 0&&(s.page=e.toString()),t!==void 0&&(s.hitsPerPage=t.toString());let i={method:"GET",path:o,queryParameters:s,headers:a};return u.requestWithHttpInfo(i,r)},listUserIds({page:e,hitsPerPage:t}={},r=void 0){let o="/1/clusters/mapping",a={},s={};e!==void 0&&(s.page=e.toString()),t!==void 0&&(s.hitsPerPage=t.toString());let i={method:"GET",path:o,queryParameters:s,headers:a};return u.request(i,r)},listUserIdsWithHTTPInfo({page:e,hitsPerPage:t}={},r=void 0){let o="/1/clusters/mapping",a={},s={};e!==void 0&&(s.page=e.toString()),t!==void 0&&(s.hitsPerPage=t.toString());let i={method:"GET",path:o,queryParameters:s,headers:a};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:o},a){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={},m={};o!==void 0&&(m.createIfNotExists=o.toString());let P={method:"POST",path:s,queryParameters:m,headers:i,data:r};return u.request(P,a)},partialUpdateObjectWithHTTPInfo({indexName:e,objectID:t,attributesToUpdate:r,createIfNotExists:o},a){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={},m={};o!==void 0&&(m.createIfNotExists=o.toString());let P={method:"POST",path:s,queryParameters:m,headers:i,data:r};return u.requestWithHttpInfo(P,a)},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:o},a){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={},m={};o!==void 0&&(m.forwardToReplicas=o.toString());let P={method:"PUT",path:s,queryParameters:m,headers:i,data:r};return u.request(P,a)},saveRuleWithHTTPInfo({indexName:e,objectID:t,rule:r,forwardToReplicas:o},a){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={},m={};o!==void 0&&(m.forwardToReplicas=o.toString());let P={method:"PUT",path:s,queryParameters:m,headers:i,data:r};return u.requestWithHttpInfo(P,a)},saveRules({indexName:e,rules:t,forwardToReplicas:r,clearExistingRules:o},a){n("indexName","saveRules",e),n("rules","saveRules",t);let s="/1/indexes/{indexName}/rules/batch".replace("{indexName}",encodeURIComponent(e)),i={},m={};r!==void 0&&(m.forwardToReplicas=r.toString()),o!==void 0&&(m.clearExistingRules=o.toString());let P={method:"POST",path:s,queryParameters:m,headers:i,data:t};return u.request(P,a)},saveRulesWithHTTPInfo({indexName:e,rules:t,forwardToReplicas:r,clearExistingRules:o},a){n("indexName","saveRulesWithHTTPInfo",e),n("rules","saveRulesWithHTTPInfo",t);let s="/1/indexes/{indexName}/rules/batch".replace("{indexName}",encodeURIComponent(e)),i={},m={};r!==void 0&&(m.forwardToReplicas=r.toString()),o!==void 0&&(m.clearExistingRules=o.toString());let P={method:"POST",path:s,queryParameters:m,headers:i,data:t};return u.requestWithHttpInfo(P,a)},saveSynonym({indexName:e,objectID:t,synonymHit:r,forwardToReplicas:o},a){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={},m={};o!==void 0&&(m.forwardToReplicas=o.toString());let P={method:"PUT",path:s,queryParameters:m,headers:i,data:r};return u.request(P,a)},saveSynonymWithHTTPInfo({indexName:e,objectID:t,synonymHit:r,forwardToReplicas:o},a){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={},m={};o!==void 0&&(m.forwardToReplicas=o.toString());let P={method:"PUT",path:s,queryParameters:m,headers:i,data:r};return u.requestWithHttpInfo(P,a)},saveSynonyms({indexName:e,synonymHit:t,forwardToReplicas:r,replaceExistingSynonyms:o},a){n("indexName","saveSynonyms",e),n("synonymHit","saveSynonyms",t);let s="/1/indexes/{indexName}/synonyms/batch".replace("{indexName}",encodeURIComponent(e)),i={},m={};r!==void 0&&(m.forwardToReplicas=r.toString()),o!==void 0&&(m.replaceExistingSynonyms=o.toString());let P={method:"POST",path:s,queryParameters:m,headers:i,data:t};return u.request(P,a)},saveSynonymsWithHTTPInfo({indexName:e,synonymHit:t,forwardToReplicas:r,replaceExistingSynonyms:o},a){n("indexName","saveSynonymsWithHTTPInfo",e),n("synonymHit","saveSynonymsWithHTTPInfo",t);let s="/1/indexes/{indexName}/synonyms/batch".replace("{indexName}",encodeURIComponent(e)),i={},m={};r!==void 0&&(m.forwardToReplicas=r.toString()),o!==void 0&&(m.replaceExistingSynonyms=o.toString());let P={method:"POST",path:s,queryParameters:m,headers:i,data:t};return u.requestWithHttpInfo(P,a)},search(e,t){e&&Array.isArray(e)&&(e={requests:e.map(({params:m,...P})=>P.type==="facet"?{...P,...m,type:"facet"}:{...P,...m,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:m,...P})=>P.type==="facet"?{...P,...m,type:"facet"}:{...P,...m,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},o){n("indexName","searchForFacetValues",e),n("facetName","searchForFacetValues",t);let m={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(m,o)},searchForFacetValuesWithHTTPInfo({indexName:e,facetName:t,searchForFacetValuesRequest:r},o){n("indexName","searchForFacetValuesWithHTTPInfo",e),n("facetName","searchForFacetValuesWithHTTPInfo",t);let m={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(m,o)},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},o){n("indexName","setSettings",e),n("indexSettings","setSettings",t);let a="/1/indexes/{indexName}/settings".replace("{indexName}",encodeURIComponent(e)),s={},i={};r!==void 0&&(i.forwardToReplicas=r.toString());let m={method:"PUT",path:a,queryParameters:i,headers:s,data:t};return u.request(m,o)},setSettingsWithHTTPInfo({indexName:e,indexSettings:t,forwardToReplicas:r},o){n("indexName","setSettingsWithHTTPInfo",e),n("indexSettings","setSettingsWithHTTPInfo",t);let a="/1/indexes/{indexName}/settings".replace("{indexName}",encodeURIComponent(e)),s={},i={};r!==void 0&&(i.forwardToReplicas=r.toString());let m={method:"PUT",path:a,queryParameters:i,headers:s,data:t};return u.requestWithHttpInfo(m,o)},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 Ko(c,d,p){if(!c||typeof c!="string")throw new Error("`appId` is missing.");if(!d||typeof d!="string")throw new Error("`apiKey` is missing.");let{compression:h,...l}=p||{};return Te({appId:c,apiKey:d,timeouts:{connect:1e3,read:2e3,write:3e4},logger:pe(),requester:Re(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",requestIdChannel:"queryParameters",responsesCache:K(),requestsCache:K({serializable:false}),hostsCache:C({caches:[ie({key:`${B}-${c}`}),K()]}),...l})}
|
|
12
12
|
|
|
13
|
-
exports.apiClientVersion =
|
|
14
|
-
exports.searchClient =
|
|
13
|
+
exports.apiClientVersion = B;
|
|
14
|
+
exports.searchClient = Ko;
|
|
15
15
|
|
|
16
16
|
}));
|