@algolia/client-search 5.60.0 → 5.61.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 +4 -4
- package/dist/builds/browser.js +3 -3
- 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 +4 -4
- package/dist/builds/fetch.js +3 -3
- package/dist/builds/fetch.js.map +1 -1
- package/dist/builds/node.cjs +3 -3
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +3 -3
- package/dist/builds/node.js.map +1 -1
- package/dist/builds/worker.js +3 -3
- package/dist/builds/worker.js.map +1 -1
- package/dist/fetch.d.ts +4 -4
- package/dist/node.d.cts +4 -4
- package/dist/node.d.ts +4 -4
- package/dist/src/searchClient.cjs +3 -3
- package/dist/src/searchClient.cjs.map +1 -1
- package/dist/src/searchClient.js +3 -3
- package/dist/src/searchClient.js.map +1 -1
- package/dist/worker.d.ts +4 -4
- package/package.json +6 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
function
|
|
1
|
+
function Pe(u){let d,p=`algolia-client-js-${u.key}`;function m(){return d===void 0&&(d=u.localStorage||window.localStorage),d}function l(){return JSON.parse(m().getItem(p)||"{}")}function y(t){m().setItem(p,JSON.stringify(t))}function c(){return new Promise(t=>setTimeout(t,0))}function e(){let t=u.timeToLive?u.timeToLive*1e3:null,r=l(),o=new Date().getTime(),a=!1;return{namespace:Object.fromEntries(Object.entries(r).filter(([,i])=>!i||i.timestamp===void 0||t&&i.timestamp+t<o?(a=!0,!1):!0)),changed:a}}return{get(t,r,o={miss:()=>Promise.resolve()}){return c().then(()=>{let{namespace:a,changed:s}=e(),i=a[JSON.stringify(t)];return s&&y(a),i?i.value:r().then(h=>o.miss(h).then(()=>h))})},set(t,r){return c().then(()=>{let o=l();return o[JSON.stringify(t)]={timestamp:new Date().getTime(),value:r},m().setItem(p,JSON.stringify(o)),r})},delete(t){return c().then(()=>{let r=l();delete r[JSON.stringify(t)],m().setItem(p,JSON.stringify(r))})},clear(){return Promise.resolve().then(()=>{m().removeItem(p)})}}}function be(){return{get(u,d,p={miss:()=>Promise.resolve()}){return d().then(l=>Promise.all([l,p.miss(l)])).then(([l])=>l)},set(u,d){return Promise.resolve(d)},delete(u){return Promise.resolve()},clear(){return Promise.resolve()}}}function w(u){let d=[...u.caches],p=d.shift();return p===void 0?be():{get(m,l,y={miss:()=>Promise.resolve()}){return p.get(m,l,y).catch(()=>w({caches:d}).get(m,l,y))},set(m,l){return p.set(m,l).catch(()=>w({caches:d}).set(m,l))},delete(m){return p.delete(m).catch(()=>w({caches:d}).delete(m))},clear(){return p.clear().catch(()=>w({caches:d}).clear())}}}function $(u={serializable:!0}){let d={};return{get(p,m,l={miss:()=>Promise.resolve()}){let y=JSON.stringify(p);if(y in d)return Promise.resolve(u.serializable?JSON.parse(d[y]):d[y]);let c=m();return c.then(e=>l.miss(e)).then(()=>c)},set(p,m){return d[JSON.stringify(p)]=u.serializable?JSON.stringify(m):m,Promise.resolve(m)},delete(p){return delete d[JSON.stringify(p)],Promise.resolve()},clear(){return d={},Promise.resolve()}}}var le=800;function Ue(u){let d={value:`Algolia for JavaScript (${u})`,add(p){let m=`; ${p.segment}${p.version!==void 0?` (${p.version})`:""}`;return d.value.indexOf(m)===-1&&(d.value=`${d.value}${m}`),d}};return d}function qe(u,d,p="WithinHeaders"){let m={"x-algolia-api-key":d,"x-algolia-application-id":u};return{headers(){return p==="WithinHeaders"?m:{}},queryParameters(){return p==="WithinQueryParameters"?m:{}}}}function D({func:u,validate:d,aggregator:p,error:m,timeout:l=()=>0}){let y=c=>new Promise((e,t)=>{u(c).then(async r=>(p&&await p(r),await d(r)?e(r):m&&await m.validate(r)?t(new Error(await m.message(r))):setTimeout(()=>{y(r).then(e).catch(t)},await l()))).catch(r=>{t(r)})});return y()}function fe({algoliaAgents:u,client:d,version:p}){let m=Ue(p).add({segment:d,version:p});return u.forEach(l=>m.add(l)),m}function ye(){return{debug(u,d){return Promise.resolve()},info(u,d){return Promise.resolve()},error(u,d){return Promise.resolve()}}}function Re(u,d){u.warn?Promise.resolve(u.warn(d)).catch(()=>{}):console.warn(d)}var We=10*1024*1024;async function*Ee(u){let d=u.getReader();try{for(;;){let{done:p,value:m}=await d.read();if(p)return;yield m}}finally{d.releaseLock()}}function ve(u){return Symbol.asyncIterator in u?u:Ee(u)}async function*De(u){let d=new TextDecoder("utf-8"),p=[],m=0,l=!1,y=!0;for await(let e of ve(u)){let t=d.decode(e,{stream:!0}),r=0;for(l&&(l=!1,t.length>0&&t[0]===`
|
|
2
2
|
`&&(r=1));r<t.length;){let o=t.indexOf("\r",r),a=t.indexOf(`
|
|
3
|
-
`,r);if(o===-1&&a===-1){let O=t.slice(r);if(p.push(O),m+=O.length,m>
|
|
4
|
-
`?2:1:(l=!0,i=1)):(s=a,i=1);let h=t.slice(r,s);p.push(h);let P=p.length===1?p[0]:p.join("");p.length=0,m=0,y&&(P.startsWith("\uFEFF")&&(P=P.slice(1)),y=!1),yield P,r=s+i}}let c=d.decode();if(c&&p.push(c),p.length>0){let e=p.join("");y&&e.startsWith("\uFEFF")&&(e=e.slice(1)),yield e}}var
|
|
5
|
-
`),event:u,id:this.lastEventId,retry:this.retry};return this.data=[],d}};async function*Ce(u){let d=new De;for await(let p of ve(u)){let m=d.decode(p);m!==null&&(yield m)}}var je=750,oe=120*1e3;function ae(u,d="up"){let p=Date.now();function m(){return d==="up"||Date.now()-p>oe}function l(){return d==="timed out"&&Date.now()-p<=oe}return{...u,status:d,lastUpdate:p,isUp:m,isTimedOut:l}}var Re=class extends Error{name="AlgoliaError";constructor(u,d){super(u),d&&(this.name=d)}};var Te=class extends Re{stackTrace;correlationId;constructor(u,d,p,m){super(m?`${u} (Correlation-ID: ${m})`:u,p),this.stackTrace=d,this.correlationId=m}},ne=class extends Te{constructor(u,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",u,"RetryError",d)}},B=class extends Te{status;constructor(u,d,p,m="ApiError",l){super(u,p,m,l),this.status=d}};var we=class extends Re{response;correlationId;constructor(u,d,p){super(p?`${u} (Correlation-ID: ${p})`:u,"DeserializationError"),this.response=d,this.correlationId=p}},Ne=class extends B{error;constructor(u,d,p,m,l){super(u,d,m,"DetailedApiError",l),this.error=p}};function Ie(u){let d=u;for(let p=u.length-1;p>0;p--){let m=Math.floor(Math.random()*(p+1)),l=u[p];d[p]=u[m],d[m]=l}return d}function ie(u,d,p){let m=ke(p),l=`${u.protocol}://${u.url}${u.port?`:${u.port}`:""}/${d.charAt(0)==="/"?d.substring(1):d}`;return m.length&&(l+=`?${m}`),l}function ke(u){return Object.keys(u).filter(d=>u[d]!==void 0).sort().map(d=>`${d}=${encodeURIComponent(Object.prototype.toString.call(u[d])==="[object Array]"?u[d].join(","):u[d]).replace(/\+/g,"%20")}`).join("&")}function ue(u,d){if(u.method==="GET"||u.data===void 0&&d.data===void 0)return;let p=Array.isArray(u.data)?u.data:{...u.data,...d.data};return JSON.stringify(p)}function ce(u,d,p){let m={Accept:"application/json",...u,...d,...p},l={};return Object.keys(m).forEach(y=>{let c=m[y];l[y.toLowerCase()]=c}),l}function ge(u){if(!(u.status===204||u.content.length===0))try{return JSON.parse(u.content)}catch(d){throw new we(d.message,u,re(u.headers))}}function Qe(u){return{status:u.status,headers:u.headers,content:u.content,data:ge(u)}}function re(u){if(!u)return;if(u["correlation-id"]!==void 0)return u["correlation-id"];let d=Object.keys(u).find(p=>p.toLowerCase()==="correlation-id");return d===void 0?void 0:u[d]}function Ge(u){for(let d=u.length-1;d>=0;d--){let p=re(u[d].response.headers);if(p!==void 0)return p}}function Le(u,d){let{content:p,status:m}=u,l=re(u.headers);try{let y=JSON.parse(p);return"error"in y?new Ne(y.message,m,y.error,d,l):new B(y.message,m,d,"ApiError",l)}catch{}return new B(p,m,d,"ApiError",l)}var _="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",de=11;function M(){var u;let d="";if(typeof((u=globalThis.crypto)==null?void 0:u.getRandomValues)=="function"){let p=new Uint8Array(de);globalThis.crypto.getRandomValues(p);for(let m of p)d+=_[m%_.length];return d}for(let p=0;p<de;p++)d+=_[Math.floor(Math.random()*_.length)];return d}function pe(u,d){return u!==void 0&&Object.keys(u).some(p=>p.toLowerCase()==="request-id")||d!==void 0&&Object.keys(d).some(p=>p.toLowerCase()==="x-algolia-request-id")}function W(u,d){return u.requestIdChannel===void 0||pe(u.baseHeaders,u.baseQueryParameters)||pe(d?.headers,d?.queryParameters)?d:u.requestIdChannel==="headers"?{...d,headers:{...d?.headers,"request-id":M()}}:{...d,queryParameters:{...d?.queryParameters,"x-algolia-request-id":M()}}}var ee=1e3;function Ke({isTimedOut:u,status:d}){return!u&&~~d===0}function Be({isTimedOut:u,status:d}){return u||Ke({isTimedOut:u,status:d})||~~(d/100)!==2&&~~(d/100)!==4}function Fe({status:u}){return~~(u/100)===2}function xe({status:u}){return~~u===429}var _e=/^HTTP 429(?:\D|$)/;function Me(u){return typeof u=="object"&&u!==null&&"status"in u?xe(u):u instanceof Error&&_e.test(u.message)}function $e(u){if(typeof u=="object"&&u!==null&&"headers"in u)return u.headers}function me(u){var d;let p=(d=u?.["retry-after"])==null?void 0:d.trim();if(p===void 0||p.length===0||!/^\d+$/.test(p))return ee;let m=Number.parseInt(p,10);return m<=0?ee:m*1e3}function ze(u){return u.map(d=>te(d))}function te(u){let d=u.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...u,request:{...u.request,headers:{...u.request.headers,...d}}}}function He({hosts:u,hostsCache:d,baseHeaders:p,logger:m,baseQueryParameters:l,algoliaAgent:y,timeouts:c,requester:e,requestsCache:t,responsesCache:r,compress:o,compression:a,requestIdChannel:s,maxRateLimitRetries:i=3}){function h(q,f){s===void 0||q["request-id"]!==void 0||Object.keys(f).some(S=>S.toLowerCase()==="x-algolia-request-id")||(s==="headers"?q["request-id"]=M():f["x-algolia-request-id"]=M())}let P=q=>new Promise(f=>{setTimeout(f,q)});async function O(q){let f=await Promise.all(q.map(R=>d.get(R,()=>Promise.resolve(ae(R))))),S=f.filter(R=>R.isUp()),g=f.filter(R=>R.isTimedOut()),b=[...S,...g];return{hosts:b.length>0?b:q,getTimeout(R,v){return(g.length===0&&R===0?1:g.length+3+R)*v}}}async function H(q,f,S){let g=[],b=ue(q,f),T=ce(p,q.headers,f.headers),R=a==="gzip"&&b!==void 0&&b.length>je&&(q.method==="POST"||q.method==="PUT");R&&o===void 0&&m.info("Compression is disabled because no compress method is available.");let v=R&&o!==void 0,X=v?await o(b):b;v&&(T["content-encoding"]="gzip");let N=q.method==="GET"?{...q.data,...f.data}:{},U={...l,...q.queryParameters,...N};if(y.value&&(U["x-algolia-agent"]=y.value),f&&f.queryParameters)for(let x of Object.keys(f.queryParameters))!f.queryParameters[x]||Object.prototype.toString.call(f.queryParameters[x])==="[object Object]"?U[x]=f.queryParameters[x]:U[x]=f.queryParameters[x].toString();h(T,U);let k=0,C=i,I=async(x,F)=>{let j=x.pop();if(j===void 0)throw new ne(ze(g),Ge(g));let Y={...c,...f.timeouts},se={data:X,headers:T,method:q.method,url:ie(j,q.path,U),connectTimeout:F(k,Y.connect),responseTimeout:F(k,S?Y.read:Y.write)},Z=L=>{let K={request:se,response:L,host:j,triesLeft:x.length};return g.push(K),K},A=await e.send(se);if(xe(A)&&C>0){C--,x.push(j);let L=Z(A),K=me(A.headers);return m.info("Retryable failure",{...te(L),wait:K,rateLimitRetriesLeft:C}),await P(K),I(x,F)}if(Be(A)){let L=Z(A);return A.isTimedOut&&k++,m.info("Retryable failure",te(L)),await d.set(j,ae(j,A.isTimedOut?"timed out":"down")),I(x,F)}if(Fe(A))return A;throw Z(A),Le(A,g)},Q=u.filter(x=>x.accept==="readWrite"||(S?x.accept==="read":x.accept==="write")),G=await O(Q);return I([...G.hosts].reverse(),G.getTimeout)}function E(q,f={}){let S=()=>H(q,f,g).then(R=>ge(R)),g=q.useReadTransporter||q.method==="GET";if((f.cacheable||q.cacheable)!==!0)return S();let T={request:q,requestOptions:f,transporter:{queryParameters:l,headers:p}};return r.get(T,()=>t.get(T,()=>t.set(T,S()).then(R=>Promise.all([t.delete(T),R]),R=>Promise.all([t.delete(T),Promise.reject(R)])).then(([R,v])=>v)),{miss:R=>r.set(T,R)})}function J(q,f={}){let S=q.useReadTransporter||q.method==="GET";return H(q,f,S).then(g=>Qe(g))}async function*V(q,f={}){if(!e.sendStream)throw new Error("This requester does not support streaming");let S=ue(q,f),g=ce(p,q.headers,f.headers);g.accept="text/event-stream";let b=q.method==="GET"?{...q.data,...f.data}:{},T={...l,...q.queryParameters,...b};if(y.value&&(T["x-algolia-agent"]=y.value),f&&f.queryParameters)for(let I of Object.keys(f.queryParameters))!f.queryParameters[I]||Object.prototype.toString.call(f.queryParameters[I])==="[object Object]"?T[I]=f.queryParameters[I]:T[I]=f.queryParameters[I].toString();h(g,T);let R=q.useReadTransporter||q.method==="GET",v=u.filter(I=>I.accept==="readWrite"||(R?I.accept==="read":I.accept==="write")),N=(await O(v)).hosts[0];if(!N)throw new ne([]);let U={...c,...f.timeouts},k={data:S,headers:g,method:q.method,url:ie(N,q.path,T),connectTimeout:U.connect,responseTimeout:R?U.read:U.write},C=i;for(;;){let I;try{I=await e.sendStream(k)}catch(Q){if(Me(Q)&&C>0){C--;let G=me($e(Q));m.info("Retryable failure",{wait:G,rateLimitRetriesLeft:C,host:N}),await P(G);continue}throw Q}yield*Ce(I);return}}return{hostsCache:d,requester:e,timeouts:c,logger:m,algoliaAgent:y,baseHeaders:p,baseQueryParameters:l,requestIdChannel:s,hosts:u,maxRateLimitRetries:i,request:E,requestWithHttpInfo:J,requestStream:V,requestsCache:t,responsesCache:r}}function n(u,d,p){if(p==null||typeof p=="string"&&p.length===0)throw new Error(`Parameter \`${u}\` is required when calling \`${d}\`.`)}function Je(u){let d={};for(let p of u.trim().split(/[\r\n]+/)){let m=p.indexOf(": ");m>0&&(d[p.slice(0,m).toLowerCase()]=p.slice(m+2))}return d}function Se(){function u(d){return new Promise(p=>{let m=new XMLHttpRequest;m.open(d.method,d.url,!0),Object.keys(d.headers).forEach(e=>m.setRequestHeader(e,d.headers[e]));let l=(e,t)=>setTimeout(()=>{m.abort(),p({status:0,content:t,isTimedOut:!0})},e),y=l(d.connectTimeout,"Connection timeout"),c;m.onreadystatechange=()=>{m.readyState>m.OPENED&&c===void 0&&(clearTimeout(y),c=l(d.responseTimeout,"Socket timeout"))},m.onerror=()=>{m.status===0&&(clearTimeout(y),clearTimeout(c),p({content:m.responseText||"Network request failed",status:m.status,isTimedOut:!1}))},m.onload=()=>{clearTimeout(y),clearTimeout(c),p({content:m.responseText,headers:Je(m.getAllResponseHeaders()),status:m.status,isTimedOut:!1})},m.send(d.data)})}return{send:u}}var z="5.60.0";function Ve(u){return[{url:`${u}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${u}.algolia.net`,accept:"write",protocol:"https"}].concat(Ie([{url:`${u}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${u}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${u}-3.algolianet.com`,accept:"readWrite",protocol:"https"}]))}function Oe({appId:u,apiKey:d,authMode:p,algoliaAgents:m,...l}){let y=le(u,d,p),c=He({hosts:Ve(u),...l,algoliaAgent:qe({algoliaAgents:m,client:"Search",version:z}),baseHeaders:{"content-type":"text/plain",...y.headers(),...l.baseHeaders},baseQueryParameters:{...y.queryParameters(),...l.baseQueryParameters}});return{transporter:c,appId:u,apiKey:d,clearCache(){return Promise.all([c.requestsCache.clear(),c.responsesCache.clear()]).then(()=>{})},get _ua(){return c.algoliaAgent.value},addAlgoliaAgent(e,t){c.algoliaAgent.add({segment:e,version:t})},setClientApiKey({apiKey:e}){!p||p==="WithinHeaders"?c.baseHeaders["x-algolia-api-key"]=e:c.baseQueryParameters["x-algolia-api-key"]=e},waitForTask({indexName:e,taskID:t,maxRetries:r=100,timeout:o=s=>Math.min(s*200,5e3)},a){a=W(c,a);let s=0;return D({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=W(c,o);let a=0;return D({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=W(c,s);let i=0,h={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 D({...h,func:()=>this.getApiKey({key:t},s),validate:P=>{for(let O of Object.keys(r)){let H=r[O],E=P[O];if(Array.isArray(H)&&Array.isArray(E)){if(H.length!==E.length||H.some((J,V)=>J!==E[V]))return!1}else if(H!==E)return!1}return!0}})}return D({...h,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=W(c,o),D({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=W(c,o);let a={...t,hitsPerPage:t?.hitsPerPage||1e3};return D({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=W(c,o);let a={...t,page:t?.page||0,hitsPerPage:1e3};return D({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=W(c,i);let h=[],P=[],O=t.entries();for(let[H,E]of O)h.push({action:r,body:E}),(h.length===a||H===t.length-1)&&(P.push(await this.batch({indexName:e,batchWriteParams:{requests:h}},i)),h=[]);if(o)for(let H of P)await this.waitForTask({indexName:e,taskID:H.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=Pe},s){s=W(c,s),t.length===0&&ye(c.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,h=`${e}_tmp_${i}`;o===void 0&&(o=["settings","rules","synonyms"]);try{let P=await this.operationIndex({indexName:e,operationIndexParams:{operation:"copy",destination:h,scope:o}},s),O=await this.chunkedBatch({indexName:h,objects:t,waitForTasks:!0,batchSize:r,maxRetries:a},s);await this.waitForTask({indexName:h,taskID:P.taskID,maxRetries:a},s),P=await this.operationIndex({indexName:e,operationIndexParams:{operation:"copy",destination:h,scope:o}},s),await this.waitForTask({indexName:h,taskID:P.taskID,maxRetries:a},s);let H=await this.operationIndex({indexName:h,operationIndexParams:{operation:"move",destination:e}},s);return await this.waitForTask({indexName:h,taskID:H.taskID,maxRetries:a},s),{copyOperationResponse:P,batchResponses:O,moveOperationResponse:H}}catch(P){throw await this.deleteIndex({indexName:h},s),P}},async indexExists({indexName:e},t){try{await this.getSettings({indexName:e},t)}catch(r){if(r instanceof B&&r.status===404)return!1;throw r}return!0},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 c.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 c.requestWithHttpInfo(s,t)},addOrUpdateObject({indexName:e,objectID:t,body:r},o){n("indexName","addOrUpdateObject",e),n("objectID","addOrUpdateObject",t),n("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 c.request(h,o)},addOrUpdateObjectWithHTTPInfo({indexName:e,objectID:t,body:r},o){n("indexName","addOrUpdateObjectWithHTTPInfo",e),n("objectID","addOrUpdateObjectWithHTTPInfo",t),n("body","addOrUpdateObjectWithHTTPInfo",r);let h={method:"PUT",path:"/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),queryParameters:{},headers:{},data:r};return c.requestWithHttpInfo(h,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 c.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 c.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 c.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 c.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 c.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 c.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 c.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 c.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 c.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 c.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:!0};return c.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:!0};return c.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 c.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 c.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 c.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 c.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 c.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 c.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 c.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 c.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 c.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 c.requestWithHttpInfo(i,r)},customPost({path:e,parameters:t,body:r},o){n("path","customPost",e);let h={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return c.request(h,o)},customPostWithHTTPInfo({path:e,parameters:t,body:r},o){n("path","customPostWithHTTPInfo",e);let h={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return c.requestWithHttpInfo(h,o)},customPut({path:e,parameters:t,body:r},o){n("path","customPut",e);let h={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return c.request(h,o)},customPutWithHTTPInfo({path:e,parameters:t,body:r},o){n("path","customPutWithHTTPInfo",e);let h={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return c.requestWithHttpInfo(h,o)},deleteApiKey({key:e},t){n("key","deleteApiKey",e);let s={method:"DELETE",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(e)),queryParameters:{},headers:{}};return c.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 c.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 c.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 c.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 c.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 c.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 c.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 c.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 h={method:"DELETE",path:a,queryParameters:i,headers:s};return c.request(h,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 h={method:"DELETE",path:a,queryParameters:i,headers:s};return c.requestWithHttpInfo(h,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 c.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 c.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 h={method:"DELETE",path:a,queryParameters:i,headers:s};return c.request(h,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 h={method:"DELETE",path:a,queryParameters:i,headers:s};return c.requestWithHttpInfo(h,o)},getApiKey({key:e},t){n("key","getApiKey",e);let s={method:"GET",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(e)),queryParameters:{},headers:{}};return c.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 c.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 c.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 c.requestWithHttpInfo(s,t)},getDictionaryLanguages(e){let a={method:"GET",path:"/1/dictionaries/*/languages",queryParameters:{},headers:{}};return c.request(a,e)},getDictionaryLanguagesWithHTTPInfo(e){let a={method:"GET",path:"/1/dictionaries/*/languages",queryParameters:{},headers:{}};return c.requestWithHttpInfo(a,e)},getDictionarySettings(e){let a={method:"GET",path:"/1/dictionaries/*/settings",queryParameters:{},headers:{}};return c.request(a,e)},getDictionarySettingsWithHTTPInfo(e){let a={method:"GET",path:"/1/dictionaries/*/settings",queryParameters:{},headers:{}};return c.requestWithHttpInfo(a,e)},getLogs({offset:e,length:t,indexName:r,type:o}={},a=void 0){let s="/1/logs",i={},h={};e!==void 0&&(h.offset=e.toString()),t!==void 0&&(h.length=t.toString()),r!==void 0&&(h.indexName=r.toString()),o!==void 0&&(h.type=o.toString());let P={method:"GET",path:s,queryParameters:h,headers:i};return c.request(P,a)},getLogsWithHTTPInfo({offset:e,length:t,indexName:r,type:o}={},a=void 0){let s="/1/logs",i={},h={};e!==void 0&&(h.offset=e.toString()),t!==void 0&&(h.length=t.toString()),r!==void 0&&(h.indexName=r.toString()),o!==void 0&&(h.type=o.toString());let P={method:"GET",path:s,queryParameters:h,headers:i};return c.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 h={method:"GET",path:a,queryParameters:i,headers:s};return c.request(h,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 h={method:"GET",path:a,queryParameters:i,headers:s};return c.requestWithHttpInfo(h,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:!0,cacheable:!0};return c.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:!0,cacheable:!0};return c.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 c.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 c.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 c.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 c.requestWithHttpInfo(i,r)},getSources(e){let a={method:"GET",path:"/1/security/sources",queryParameters:{},headers:{}};return c.request(a,e)},getSourcesWithHTTPInfo(e){let a={method:"GET",path:"/1/security/sources",queryParameters:{},headers:{}};return c.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 c.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 c.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 c.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 c.requestWithHttpInfo(i,r)},getTopUserIds(e){let a={method:"GET",path:"/1/clusters/mapping/top",queryParameters:{},headers:{}};return c.request(a,e)},getTopUserIdsWithHTTPInfo(e){let a={method:"GET",path:"/1/clusters/mapping/top",queryParameters:{},headers:{}};return c.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 c.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 c.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 c.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 c.requestWithHttpInfo(s,t)},listApiKeys(e){let a={method:"GET",path:"/1/keys",queryParameters:{},headers:{}};return c.request(a,e)},listApiKeysWithHTTPInfo(e){let a={method:"GET",path:"/1/keys",queryParameters:{},headers:{}};return c.requestWithHttpInfo(a,e)},listClusters(e){let a={method:"GET",path:"/1/clusters",queryParameters:{},headers:{}};return c.request(a,e)},listClustersWithHTTPInfo(e){let a={method:"GET",path:"/1/clusters",queryParameters:{},headers:{}};return c.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 c.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 c.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 c.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 c.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 c.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 c.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 c.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 c.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={},h={};o!==void 0&&(h.createIfNotExists=o.toString());let P={method:"POST",path:s,queryParameters:h,headers:i,data:r};return c.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={},h={};o!==void 0&&(h.createIfNotExists=o.toString());let P={method:"POST",path:s,queryParameters:h,headers:i,data:r};return c.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 c.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 c.requestWithHttpInfo(s,t)},replaceSources({source:e},t){n("source","replaceSources",e);let s={method:"PUT",path:"/1/security/sources",queryParameters:{},headers:{},data:e};return c.request(s,t)},replaceSourcesWithHTTPInfo({source:e},t){n("source","replaceSourcesWithHTTPInfo",e);let s={method:"PUT",path:"/1/security/sources",queryParameters:{},headers:{},data:e};return c.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 c.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 c.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 c.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 c.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={},h={};o!==void 0&&(h.forwardToReplicas=o.toString());let P={method:"PUT",path:s,queryParameters:h,headers:i,data:r};return c.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={},h={};o!==void 0&&(h.forwardToReplicas=o.toString());let P={method:"PUT",path:s,queryParameters:h,headers:i,data:r};return c.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={},h={};r!==void 0&&(h.forwardToReplicas=r.toString()),o!==void 0&&(h.clearExistingRules=o.toString());let P={method:"POST",path:s,queryParameters:h,headers:i,data:t};return c.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={},h={};r!==void 0&&(h.forwardToReplicas=r.toString()),o!==void 0&&(h.clearExistingRules=o.toString());let P={method:"POST",path:s,queryParameters:h,headers:i,data:t};return c.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={},h={};o!==void 0&&(h.forwardToReplicas=o.toString());let P={method:"PUT",path:s,queryParameters:h,headers:i,data:r};return c.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={},h={};o!==void 0&&(h.forwardToReplicas=o.toString());let P={method:"PUT",path:s,queryParameters:h,headers:i,data:r};return c.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={},h={};r!==void 0&&(h.forwardToReplicas=r.toString()),o!==void 0&&(h.replaceExistingSynonyms=o.toString());let P={method:"POST",path:s,queryParameters:h,headers:i,data:t};return c.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={},h={};r!==void 0&&(h.forwardToReplicas=r.toString()),o!==void 0&&(h.replaceExistingSynonyms=o.toString());let P={method:"POST",path:s,queryParameters:h,headers:i,data:t};return c.requestWithHttpInfo(P,a)},search(e,t){e&&Array.isArray(e)&&(e={requests:e.map(({params:h,...P})=>P.type==="facet"?{...P,...h,type:"facet"}:{...P,...h,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:!0,cacheable:!0};return c.request(s,t)},searchWithHTTPInfo(e,t){e&&Array.isArray(e)&&(e={requests:e.map(({params:h,...P})=>P.type==="facet"?{...P,...h,type:"facet"}:{...P,...h,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:!0,cacheable:!0};return c.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:!0,cacheable:!0};return c.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:!0,cacheable:!0};return c.requestWithHttpInfo(i,r)},searchForFacetValues({indexName:e,facetName:t,searchForFacetValuesRequest:r},o){n("indexName","searchForFacetValues",e),n("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:!0,cacheable:!0};return c.request(h,o)},searchForFacetValuesWithHTTPInfo({indexName:e,facetName:t,searchForFacetValuesRequest:r},o){n("indexName","searchForFacetValuesWithHTTPInfo",e),n("facetName","searchForFacetValuesWithHTTPInfo",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:!0,cacheable:!0};return c.requestWithHttpInfo(h,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:!0,cacheable:!0};return c.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:!0,cacheable:!0};return c.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:!0,cacheable:!0};return c.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:!0,cacheable:!0};return c.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:!0,cacheable:!0};return c.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:!0,cacheable:!0};return c.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:!0,cacheable:!0};return c.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:!0,cacheable:!0};return c.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 c.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 c.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 h={method:"PUT",path:a,queryParameters:i,headers:s,data:t};return c.request(h,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 h={method:"PUT",path:a,queryParameters:i,headers:s,data:t};return c.requestWithHttpInfo(h,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 c.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 c.requestWithHttpInfo(i,r)}}}function Zo(u,d,p){if(!u||typeof u!="string")throw new Error("`appId` is missing.");if(!d||typeof d!="string")throw new Error("`apiKey` is missing.");let{compression:m,...l}=p||{};return Oe({appId:u,apiKey:d,timeouts:{connect:1e3,read:2e3,write:3e4},logger:fe(),requester:Se(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",requestIdChannel:"queryParameters",responsesCache:$(),requestsCache:$({serializable:!1}),hostsCache:w({caches:[he({key:`${z}-${u}`}),$()]}),...l})}export{z as apiClientVersion,Zo as searchClient};
|
|
3
|
+
`,r);if(o===-1&&a===-1){let O=t.slice(r);if(p.push(O),m+=O.length,m>We)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]===`
|
|
4
|
+
`?2:1:(l=!0,i=1)):(s=a,i=1);let h=t.slice(r,s);p.push(h);let P=p.length===1?p[0]:p.join("");p.length=0,m=0,y&&(P.startsWith("\uFEFF")&&(P=P.slice(1)),y=!1),yield P,r=s+i}}let c=d.decode();if(c&&p.push(c),p.length>0){let e=p.join("");y&&e.startsWith("\uFEFF")&&(e=e.slice(1)),yield e}}var Ce=class{data=[];eventType="";lastEventId=null;retry=null;decode(u){if(u==="")return this.dispatch();if(u[0]===":")return null;let d=u.indexOf(":"),p,m;switch(d===-1?(p=u,m=""):(p=u.slice(0,d),m=u.slice(d+1),m[0]===" "&&(m=m.slice(1))),p){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 u=this.eventType;if(this.eventType="",this.data.length===0)return null;let d={data:this.data.join(`
|
|
5
|
+
`),event:u,id:this.lastEventId,retry:this.retry};return this.data=[],d}};async function*je(u){let d=new Ce;for await(let p of De(u)){let m=d.decode(p);m!==null&&(yield m)}}var we=750,oe=120*1e3;function ae(u,d="up"){let p=Date.now();function m(){return d==="up"||Date.now()-p>oe}function l(){return d==="timed out"&&Date.now()-p<=oe}return{...u,status:d,lastUpdate:p,isUp:m,isTimedOut:l}}var Te=class extends Error{name="AlgoliaError";constructor(u,d){super(u),d&&(this.name=d)}};var Ie=class extends Te{stackTrace;correlationId;constructor(u,d,p,m){super(m?`${u} (Correlation-ID: ${m})`:u,p),this.stackTrace=d,this.correlationId=m}},ne=class extends Ie{constructor(u,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",u,"RetryError",d)}},B=class extends Ie{status;constructor(u,d,p,m="ApiError",l){super(u,p,m,l),this.status=d}};var Ne=class extends Te{response;correlationId;constructor(u,d,p){super(p?`${u} (Correlation-ID: ${p})`:u,"DeserializationError"),this.response=d,this.correlationId=p}},ke=class extends B{error;constructor(u,d,p,m,l){super(u,d,m,"DetailedApiError",l),this.error=p}};function ge(u){let d=u;for(let p=u.length-1;p>0;p--){let m=Math.floor(Math.random()*(p+1)),l=u[p];d[p]=u[m],d[m]=l}return d}function ie(u,d,p){let m=Qe(p),l=`${u.protocol}://${u.url}${u.port?`:${u.port}`:""}/${d.charAt(0)==="/"?d.substring(1):d}`;return m.length&&(l+=`?${m}`),l}function Qe(u){return Object.keys(u).filter(d=>u[d]!==void 0).sort().map(d=>`${d}=${encodeURIComponent(Object.prototype.toString.call(u[d])==="[object Array]"?u[d].join(","):u[d]).replace(/\+/g,"%20")}`).join("&")}function ue(u,d){if(u.method==="GET"||u.data===void 0&&d.data===void 0)return;let p=Array.isArray(u.data)?u.data:{...u.data,...d.data};return JSON.stringify(p)}function ce(u,d,p){let m={Accept:"application/json",...u,...d,...p},l={};return Object.keys(m).forEach(y=>{let c=m[y];l[y.toLowerCase()]=c}),l}function xe(u){if(!(u.status===204||u.content.length===0))try{return JSON.parse(u.content)}catch(d){throw new Ne(d.message,u,re(u.headers))}}function Ge(u){return{status:u.status,headers:u.headers,content:u.content,data:xe(u)}}function re(u){if(!u)return;if(u["correlation-id"]!==void 0)return u["correlation-id"];let d=Object.keys(u).find(p=>p.toLowerCase()==="correlation-id");return d===void 0?void 0:u[d]}function Le(u){for(let d=u.length-1;d>=0;d--){let p=re(u[d].response.headers);if(p!==void 0)return p}}function Ke(u,d){let{content:p,status:m}=u,l=re(u.headers);try{let y=JSON.parse(p);return"error"in y?new ke(y.message,m,y.error,d,l):new B(y.message,m,d,"ApiError",l)}catch{}return new B(p,m,d,"ApiError",l)}var _="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",de=11;function M(){var u;let d="";if(typeof((u=globalThis.crypto)==null?void 0:u.getRandomValues)=="function"){let p=new Uint8Array(de);globalThis.crypto.getRandomValues(p);for(let m of p)d+=_[m%_.length];return d}for(let p=0;p<de;p++)d+=_[Math.floor(Math.random()*_.length)];return d}function pe(u,d){return u!==void 0&&Object.keys(u).some(p=>p.toLowerCase()==="request-id")||d!==void 0&&Object.keys(d).some(p=>p.toLowerCase()==="x-algolia-request-id")}function W(u,d){return u.requestIdChannel===void 0||pe(u.baseHeaders,u.baseQueryParameters)||pe(d?.headers,d?.queryParameters)?d:u.requestIdChannel==="headers"?{...d,headers:{...d?.headers,"request-id":M()}}:{...d,queryParameters:{...d?.queryParameters,"x-algolia-request-id":M()}}}var ee=1e3;function Be({isTimedOut:u,status:d}){return!u&&~~d===0}function Fe({isTimedOut:u,status:d}){return u||Be({isTimedOut:u,status:d})||~~(d/100)!==2&&~~(d/100)!==4}function _e({status:u}){return~~(u/100)===2}function He({status:u}){return~~u===429}var Me=/^HTTP 429(?:\D|$)/;function $e(u){return typeof u=="object"&&u!==null&&"status"in u?He(u):u instanceof Error&&Me.test(u.message)}function ze(u){if(typeof u=="object"&&u!==null&&"headers"in u)return u.headers}function me(u){var d;let p=(d=u?.["retry-after"])==null?void 0:d.trim();if(p===void 0||p.length===0||!/^\d+$/.test(p))return ee;let m=Number.parseInt(p,10);return m<=0?ee:m*1e3}function he(u){return u.map(d=>te(d))}function te(u){let d=u.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...u,request:{...u.request,headers:{...u.request.headers,...d}}}}function Se({hosts:u,hostsCache:d,baseHeaders:p,logger:m,baseQueryParameters:l,algoliaAgent:y,timeouts:c,requester:e,requestsCache:t,responsesCache:r,compress:o,compression:a,requestIdChannel:s,maxRateLimitRetries:i=3}){function h(q,f){s===void 0||q["request-id"]!==void 0||Object.keys(f).some(S=>S.toLowerCase()==="x-algolia-request-id")||(s==="headers"?q["request-id"]=M():f["x-algolia-request-id"]=M())}let P=q=>new Promise(f=>{setTimeout(f,q)});async function O(q){let f=await Promise.all(q.map(R=>d.get(R,()=>Promise.resolve(ae(R))))),S=f.filter(R=>R.isUp()),g=f.filter(R=>R.isTimedOut()),b=[...S,...g];return{hosts:b.length>0?b:q,getTimeout(R,v){return(g.length===0&&R===0?1:g.length+3+R)*v}}}async function H(q,f,S){let g=[],b=ue(q,f),T=ce(p,q.headers,f.headers),R=a==="gzip"&&b!==void 0&&b.length>we&&(q.method==="POST"||q.method==="PUT");R&&o===void 0&&m.info("Compression is disabled because no compress method is available.");let v=R&&o!==void 0,X=v?await o(b):b;v&&(T["content-encoding"]="gzip");let N=q.method==="GET"?{...q.data,...f.data}:{},U={...l,...q.queryParameters,...N};if(y.value&&(U["x-algolia-agent"]=y.value),f&&f.queryParameters)for(let x of Object.keys(f.queryParameters))!f.queryParameters[x]||Object.prototype.toString.call(f.queryParameters[x])==="[object Object]"?U[x]=f.queryParameters[x]:U[x]=f.queryParameters[x].toString();h(T,U);let k=0,C=i,I=async(x,F)=>{let j=x.pop();if(j===void 0)throw new ne(he(g),Le(g));let Y={...c,...f.timeouts},se={data:X,headers:T,method:q.method,url:ie(j,q.path,U),connectTimeout:F(k,Y.connect),responseTimeout:F(k,S?Y.read:Y.write)},Z=L=>{let K={request:se,response:L,host:j,triesLeft:x.length};return g.push(K),K},A=await e.send(se);if(He(A)&&C>0){C--,x.push(j);let L=Z(A),K=me(A.headers);return m.info("Retryable failure",{...te(L),wait:K,rateLimitRetriesLeft:C}),await P(K),I(x,F)}if(Fe(A)){let L=Z(A);return A.isTimedOut&&k++,m.info("Retryable failure",te(L)),await d.set(j,ae(j,A.isTimedOut?"timed out":"down")),I(x,F)}if(_e(A))return A;throw Z(A),Ke(A,he(g))},Q=u.filter(x=>x.accept==="readWrite"||(S?x.accept==="read":x.accept==="write")),G=await O(Q);return I([...G.hosts].reverse(),G.getTimeout)}function E(q,f={}){let S=()=>H(q,f,g).then(R=>xe(R)),g=q.useReadTransporter||q.method==="GET";if((f.cacheable||q.cacheable)!==!0)return S();let T={request:q,requestOptions:f,transporter:{queryParameters:l,headers:p}};return r.get(T,()=>t.get(T,()=>t.set(T,S()).then(R=>Promise.all([t.delete(T),R]),R=>Promise.all([t.delete(T),Promise.reject(R)])).then(([R,v])=>v)),{miss:R=>r.set(T,R)})}function J(q,f={}){let S=q.useReadTransporter||q.method==="GET";return H(q,f,S).then(g=>Ge(g))}async function*V(q,f={}){if(!e.sendStream)throw new Error("This requester does not support streaming");let S=ue(q,f),g=ce(p,q.headers,f.headers);g.accept="text/event-stream";let b=q.method==="GET"?{...q.data,...f.data}:{},T={...l,...q.queryParameters,...b};if(y.value&&(T["x-algolia-agent"]=y.value),f&&f.queryParameters)for(let I of Object.keys(f.queryParameters))!f.queryParameters[I]||Object.prototype.toString.call(f.queryParameters[I])==="[object Object]"?T[I]=f.queryParameters[I]:T[I]=f.queryParameters[I].toString();h(g,T);let R=q.useReadTransporter||q.method==="GET",v=u.filter(I=>I.accept==="readWrite"||(R?I.accept==="read":I.accept==="write")),N=(await O(v)).hosts[0];if(!N)throw new ne([]);let U={...c,...f.timeouts},k={data:S,headers:g,method:q.method,url:ie(N,q.path,T),connectTimeout:U.connect,responseTimeout:R?U.read:U.write},C=i;for(;;){let I;try{I=await e.sendStream(k)}catch(Q){if($e(Q)&&C>0){C--;let G=me(ze(Q));m.info("Retryable failure",{wait:G,rateLimitRetriesLeft:C,host:N}),await P(G);continue}throw Q}yield*je(I);return}}return{hostsCache:d,requester:e,timeouts:c,logger:m,algoliaAgent:y,baseHeaders:p,baseQueryParameters:l,requestIdChannel:s,hosts:u,maxRateLimitRetries:i,request:E,requestWithHttpInfo:J,requestStream:V,requestsCache:t,responsesCache:r}}function n(u,d,p){if(p==null||typeof p=="string"&&p.length===0)throw new Error(`Parameter \`${u}\` is required when calling \`${d}\`.`)}function Je(u){let d={};for(let p of u.trim().split(/[\r\n]+/)){let m=p.indexOf(": ");m>0&&(d[p.slice(0,m).toLowerCase()]=p.slice(m+2))}return d}function Oe(){function u(d){return new Promise(p=>{let m=new XMLHttpRequest;m.open(d.method,d.url,!0),Object.keys(d.headers).forEach(e=>m.setRequestHeader(e,d.headers[e]));let l=(e,t)=>setTimeout(()=>{m.abort(),p({status:0,content:t,isTimedOut:!0})},e),y=l(d.connectTimeout,"Connection timeout"),c;m.onreadystatechange=()=>{m.readyState>m.OPENED&&c===void 0&&(clearTimeout(y),c=l(d.responseTimeout,"Socket timeout"))},m.onerror=()=>{m.status===0&&(clearTimeout(y),clearTimeout(c),p({content:m.responseText||"Network request failed",status:m.status,isTimedOut:!1}))},m.onload=()=>{clearTimeout(y),clearTimeout(c),p({content:m.responseText,headers:Je(m.getAllResponseHeaders()),status:m.status,isTimedOut:!1})},m.send(d.data)})}return{send:u}}var z="5.61.0";function Ve(u){return[{url:`${u}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${u}.algolia.net`,accept:"write",protocol:"https"}].concat(ge([{url:`${u}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${u}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${u}-3.algolianet.com`,accept:"readWrite",protocol:"https"}]))}function Ae({appId:u,apiKey:d,authMode:p,algoliaAgents:m,...l}){let y=qe(u,d,p),c=Se({hosts:Ve(u),...l,algoliaAgent:fe({algoliaAgents:m,client:"Search",version:z}),baseHeaders:{"content-type":"text/plain",...y.headers(),...l.baseHeaders},baseQueryParameters:{...y.queryParameters(),...l.baseQueryParameters}});return{transporter:c,appId:u,apiKey:d,clearCache(){return Promise.all([c.requestsCache.clear(),c.responsesCache.clear()]).then(()=>{})},get _ua(){return c.algoliaAgent.value},addAlgoliaAgent(e,t){c.algoliaAgent.add({segment:e,version:t})},setClientApiKey({apiKey:e}){!p||p==="WithinHeaders"?c.baseHeaders["x-algolia-api-key"]=e:c.baseQueryParameters["x-algolia-api-key"]=e},waitForTask({indexName:e,taskID:t,maxRetries:r=100,timeout:o=s=>Math.min(s*200,5e3)},a){a=W(c,a);let s=0;return D({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=W(c,o);let a=0;return D({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=W(c,s);let i=0,h={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 D({...h,func:()=>this.getApiKey({key:t},s),validate:P=>{for(let O of Object.keys(r)){let H=r[O],E=P[O];if(Array.isArray(H)&&Array.isArray(E)){if(H.length!==E.length||H.some((J,V)=>J!==E[V]))return!1}else if(H!==E)return!1}return!0}})}return D({...h,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=W(c,o),D({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=W(c,o);let a={...t,hitsPerPage:t?.hitsPerPage||1e3};return D({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=W(c,o);let a={...t,page:t?.page||0,hitsPerPage:1e3};return D({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=W(c,i);let h=[],P=[],O=t.entries();for(let[H,E]of O)h.push({action:r,body:E}),(h.length===a||H===t.length-1)&&(P.push(await this.batch({indexName:e,batchWriteParams:{requests:h}},i)),h=[]);if(o)for(let H of P)await this.waitForTask({indexName:e,taskID:H.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=le},s){s=W(c,s),t.length===0&&Re(c.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,h=`${e}_tmp_${i}`;o===void 0&&(o=["settings","rules","synonyms"]);try{let P=await this.operationIndex({indexName:e,operationIndexParams:{operation:"copy",destination:h,scope:o}},s),O=await this.chunkedBatch({indexName:h,objects:t,waitForTasks:!0,batchSize:r,maxRetries:a},s);await this.waitForTask({indexName:h,taskID:P.taskID,maxRetries:a},s),P=await this.operationIndex({indexName:e,operationIndexParams:{operation:"copy",destination:h,scope:o}},s),await this.waitForTask({indexName:h,taskID:P.taskID,maxRetries:a},s);let H=await this.operationIndex({indexName:h,operationIndexParams:{operation:"move",destination:e}},s);return await this.waitForTask({indexName:h,taskID:H.taskID,maxRetries:a},s),{copyOperationResponse:P,batchResponses:O,moveOperationResponse:H}}catch(P){throw await this.deleteIndex({indexName:h},s),P}},async indexExists({indexName:e},t){try{await this.getSettings({indexName:e},t)}catch(r){if(r instanceof B&&r.status===404)return!1;throw r}return!0},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 c.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 c.requestWithHttpInfo(s,t)},addOrUpdateObject({indexName:e,objectID:t,body:r},o){n("indexName","addOrUpdateObject",e),n("objectID","addOrUpdateObject",t),n("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 c.request(h,o)},addOrUpdateObjectWithHTTPInfo({indexName:e,objectID:t,body:r},o){n("indexName","addOrUpdateObjectWithHTTPInfo",e),n("objectID","addOrUpdateObjectWithHTTPInfo",t),n("body","addOrUpdateObjectWithHTTPInfo",r);let h={method:"PUT",path:"/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),queryParameters:{},headers:{},data:r};return c.requestWithHttpInfo(h,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 c.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 c.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 c.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 c.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 c.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 c.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 c.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 c.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 c.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 c.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:!0};return c.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:!0};return c.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 c.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 c.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 c.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 c.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 c.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 c.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 c.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 c.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 c.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 c.requestWithHttpInfo(i,r)},customPost({path:e,parameters:t,body:r},o){n("path","customPost",e);let h={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return c.request(h,o)},customPostWithHTTPInfo({path:e,parameters:t,body:r},o){n("path","customPostWithHTTPInfo",e);let h={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return c.requestWithHttpInfo(h,o)},customPut({path:e,parameters:t,body:r},o){n("path","customPut",e);let h={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return c.request(h,o)},customPutWithHTTPInfo({path:e,parameters:t,body:r},o){n("path","customPutWithHTTPInfo",e);let h={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return c.requestWithHttpInfo(h,o)},deleteApiKey({key:e},t){n("key","deleteApiKey",e);let s={method:"DELETE",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(e)),queryParameters:{},headers:{}};return c.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 c.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 c.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 c.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 c.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 c.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 c.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 c.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 h={method:"DELETE",path:a,queryParameters:i,headers:s};return c.request(h,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 h={method:"DELETE",path:a,queryParameters:i,headers:s};return c.requestWithHttpInfo(h,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 c.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 c.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 h={method:"DELETE",path:a,queryParameters:i,headers:s};return c.request(h,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 h={method:"DELETE",path:a,queryParameters:i,headers:s};return c.requestWithHttpInfo(h,o)},getApiKey({key:e},t){n("key","getApiKey",e);let s={method:"GET",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(e)),queryParameters:{},headers:{}};return c.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 c.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 c.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 c.requestWithHttpInfo(s,t)},getDictionaryLanguages(e){let a={method:"GET",path:"/1/dictionaries/*/languages",queryParameters:{},headers:{}};return c.request(a,e)},getDictionaryLanguagesWithHTTPInfo(e){let a={method:"GET",path:"/1/dictionaries/*/languages",queryParameters:{},headers:{}};return c.requestWithHttpInfo(a,e)},getDictionarySettings(e){let a={method:"GET",path:"/1/dictionaries/*/settings",queryParameters:{},headers:{}};return c.request(a,e)},getDictionarySettingsWithHTTPInfo(e){let a={method:"GET",path:"/1/dictionaries/*/settings",queryParameters:{},headers:{}};return c.requestWithHttpInfo(a,e)},getLogs({offset:e,length:t,indexName:r,type:o}={},a=void 0){let s="/1/logs",i={},h={};e!==void 0&&(h.offset=e.toString()),t!==void 0&&(h.length=t.toString()),r!==void 0&&(h.indexName=r.toString()),o!==void 0&&(h.type=o.toString());let P={method:"GET",path:s,queryParameters:h,headers:i};return c.request(P,a)},getLogsWithHTTPInfo({offset:e,length:t,indexName:r,type:o}={},a=void 0){let s="/1/logs",i={},h={};e!==void 0&&(h.offset=e.toString()),t!==void 0&&(h.length=t.toString()),r!==void 0&&(h.indexName=r.toString()),o!==void 0&&(h.type=o.toString());let P={method:"GET",path:s,queryParameters:h,headers:i};return c.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 h={method:"GET",path:a,queryParameters:i,headers:s};return c.request(h,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 h={method:"GET",path:a,queryParameters:i,headers:s};return c.requestWithHttpInfo(h,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:!0,cacheable:!0};return c.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:!0,cacheable:!0};return c.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 c.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 c.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 c.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 c.requestWithHttpInfo(i,r)},getSources(e){let a={method:"GET",path:"/1/security/sources",queryParameters:{},headers:{}};return c.request(a,e)},getSourcesWithHTTPInfo(e){let a={method:"GET",path:"/1/security/sources",queryParameters:{},headers:{}};return c.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 c.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 c.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 c.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 c.requestWithHttpInfo(i,r)},getTopUserIds(e){let a={method:"GET",path:"/1/clusters/mapping/top",queryParameters:{},headers:{}};return c.request(a,e)},getTopUserIdsWithHTTPInfo(e){let a={method:"GET",path:"/1/clusters/mapping/top",queryParameters:{},headers:{}};return c.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 c.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 c.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 c.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 c.requestWithHttpInfo(s,t)},listApiKeys(e){let a={method:"GET",path:"/1/keys",queryParameters:{},headers:{}};return c.request(a,e)},listApiKeysWithHTTPInfo(e){let a={method:"GET",path:"/1/keys",queryParameters:{},headers:{}};return c.requestWithHttpInfo(a,e)},listClusters(e){let a={method:"GET",path:"/1/clusters",queryParameters:{},headers:{}};return c.request(a,e)},listClustersWithHTTPInfo(e){let a={method:"GET",path:"/1/clusters",queryParameters:{},headers:{}};return c.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 c.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 c.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 c.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 c.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 c.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 c.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 c.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 c.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={},h={};o!==void 0&&(h.createIfNotExists=o.toString());let P={method:"POST",path:s,queryParameters:h,headers:i,data:r};return c.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={},h={};o!==void 0&&(h.createIfNotExists=o.toString());let P={method:"POST",path:s,queryParameters:h,headers:i,data:r};return c.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 c.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 c.requestWithHttpInfo(s,t)},replaceSources({source:e},t){n("source","replaceSources",e);let s={method:"PUT",path:"/1/security/sources",queryParameters:{},headers:{},data:e};return c.request(s,t)},replaceSourcesWithHTTPInfo({source:e},t){n("source","replaceSourcesWithHTTPInfo",e);let s={method:"PUT",path:"/1/security/sources",queryParameters:{},headers:{},data:e};return c.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 c.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 c.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 c.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 c.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={},h={};o!==void 0&&(h.forwardToReplicas=o.toString());let P={method:"PUT",path:s,queryParameters:h,headers:i,data:r};return c.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={},h={};o!==void 0&&(h.forwardToReplicas=o.toString());let P={method:"PUT",path:s,queryParameters:h,headers:i,data:r};return c.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={},h={};r!==void 0&&(h.forwardToReplicas=r.toString()),o!==void 0&&(h.clearExistingRules=o.toString());let P={method:"POST",path:s,queryParameters:h,headers:i,data:t};return c.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={},h={};r!==void 0&&(h.forwardToReplicas=r.toString()),o!==void 0&&(h.clearExistingRules=o.toString());let P={method:"POST",path:s,queryParameters:h,headers:i,data:t};return c.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={},h={};o!==void 0&&(h.forwardToReplicas=o.toString());let P={method:"PUT",path:s,queryParameters:h,headers:i,data:r};return c.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={},h={};o!==void 0&&(h.forwardToReplicas=o.toString());let P={method:"PUT",path:s,queryParameters:h,headers:i,data:r};return c.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={},h={};r!==void 0&&(h.forwardToReplicas=r.toString()),o!==void 0&&(h.replaceExistingSynonyms=o.toString());let P={method:"POST",path:s,queryParameters:h,headers:i,data:t};return c.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={},h={};r!==void 0&&(h.forwardToReplicas=r.toString()),o!==void 0&&(h.replaceExistingSynonyms=o.toString());let P={method:"POST",path:s,queryParameters:h,headers:i,data:t};return c.requestWithHttpInfo(P,a)},search(e,t){e&&Array.isArray(e)&&(e={requests:e.map(({params:h,...P})=>P.type==="facet"?{...P,...h,type:"facet"}:{...P,...h,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:!0,cacheable:!0};return c.request(s,t)},searchWithHTTPInfo(e,t){e&&Array.isArray(e)&&(e={requests:e.map(({params:h,...P})=>P.type==="facet"?{...P,...h,type:"facet"}:{...P,...h,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:!0,cacheable:!0};return c.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:!0,cacheable:!0};return c.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:!0,cacheable:!0};return c.requestWithHttpInfo(i,r)},searchForFacetValues({indexName:e,facetName:t,searchForFacetValuesRequest:r},o){n("indexName","searchForFacetValues",e),n("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:!0,cacheable:!0};return c.request(h,o)},searchForFacetValuesWithHTTPInfo({indexName:e,facetName:t,searchForFacetValuesRequest:r},o){n("indexName","searchForFacetValuesWithHTTPInfo",e),n("facetName","searchForFacetValuesWithHTTPInfo",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:!0,cacheable:!0};return c.requestWithHttpInfo(h,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:!0,cacheable:!0};return c.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:!0,cacheable:!0};return c.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:!0,cacheable:!0};return c.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:!0,cacheable:!0};return c.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:!0,cacheable:!0};return c.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:!0,cacheable:!0};return c.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:!0,cacheable:!0};return c.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:!0,cacheable:!0};return c.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 c.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 c.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 h={method:"PUT",path:a,queryParameters:i,headers:s,data:t};return c.request(h,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 h={method:"PUT",path:a,queryParameters:i,headers:s,data:t};return c.requestWithHttpInfo(h,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 c.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 c.requestWithHttpInfo(i,r)}}}function Zo(u,d,p){if(!u||typeof u!="string")throw new Error("`appId` is missing.");if(!d||typeof d!="string")throw new Error("`apiKey` is missing.");let{compression:m,...l}=p||{};return Ae({appId:u,apiKey:d,timeouts:{connect:1e3,read:2e3,write:3e4},logger:ye(),requester:Oe(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",requestIdChannel:"queryParameters",responsesCache:$(),requestsCache:$({serializable:!1}),hostsCache:w({caches:[Pe({key:`${z}-${u}`}),$()]}),...l})}export{z as apiClientVersion,Zo as searchClient};
|
|
6
6
|
//# sourceMappingURL=browser.min.js.map
|