@algolia/client-personalization 5.55.2 → 5.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,13 +4,13 @@
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@algolia/client-personalization"] = {}));
5
5
  })(this, (function (exports) { 'use strict';
6
6
 
7
- function Y(t){let e,s=`algolia-client-js-${t.key}`;function r(){return e===void 0&&(e=t.localStorage||window.localStorage),e}function a(){return JSON.parse(r().getItem(s)||"{}")}function c(n){r().setItem(s,JSON.stringify(n));}function m(){return new Promise(n=>setTimeout(n,0))}function i(){let n=t.timeToLive?t.timeToLive*1e3:null,o=a(),l=new Date().getTime(),p=false;return {namespace:Object.fromEntries(Object.entries(o).filter(([,f])=>!f||f.timestamp===void 0||n&&f.timestamp+n<l?(p=true,false):true)),changed:p}}return {get(n,o,l={miss:()=>Promise.resolve()}){return m().then(()=>{let{namespace:p,changed:g}=i(),f=p[JSON.stringify(n)];return g&&c(p),f?f.value:o().then(T=>l.miss(T).then(()=>T))})},set(n,o){return m().then(()=>{let l=a();return l[JSON.stringify(n)]={timestamp:new Date().getTime(),value:o},r().setItem(s,JSON.stringify(l)),o})},delete(n){return m().then(()=>{let o=a();delete o[JSON.stringify(n)],r().setItem(s,JSON.stringify(o));})},clear(){return Promise.resolve().then(()=>{r().removeItem(s);})}}}function ce(){return {get(t,e,s={miss:()=>Promise.resolve()}){return e().then(a=>Promise.all([a,s.miss(a)])).then(([a])=>a)},set(t,e){return Promise.resolve(e)},delete(t){return Promise.resolve()},clear(){return Promise.resolve()}}}function q(t){let e=[...t.caches],s=e.shift();return s===void 0?ce():{get(r,a,c={miss:()=>Promise.resolve()}){return s.get(r,a,c).catch(()=>q({caches:e}).get(r,a,c))},set(r,a){return s.set(r,a).catch(()=>q({caches:e}).set(r,a))},delete(r){return s.delete(r).catch(()=>q({caches:e}).delete(r))},clear(){return s.clear().catch(()=>q({caches:e}).clear())}}}function D(t={serializable:true}){let e={};return {get(s,r,a={miss:()=>Promise.resolve()}){let c=JSON.stringify(s);if(c in e)return Promise.resolve(t.serializable?JSON.parse(e[c]):e[c]);let m=r();return m.then(i=>a.miss(i)).then(()=>m)},set(s,r){return e[JSON.stringify(s)]=t.serializable?JSON.stringify(r):r,Promise.resolve(r)},delete(s){return delete e[JSON.stringify(s)],Promise.resolve()},clear(){return e={},Promise.resolve()}}}function le(t){let e={value:`Algolia for JavaScript (${t})`,add(s){let r=`; ${s.segment}${s.version!==void 0?` (${s.version})`:""}`;return e.value.indexOf(r)===-1&&(e.value=`${e.value}${r}`),e}};return e}function Z(t,e,s="WithinHeaders"){let r={"x-algolia-api-key":e,"x-algolia-application-id":t};return {headers(){return s==="WithinHeaders"?r:{}},queryParameters(){return s==="WithinQueryParameters"?r:{}}}}function ee({algoliaAgents:t,client:e,version:s}){let r=le(s).add({segment:e,version:s});return t.forEach(a=>r.add(a)),r}function te(){return {debug(t,e){return Promise.resolve()},info(t,e){return Promise.resolve()},error(t,e){return Promise.resolve()}}}var ue=10*1024*1024;async function*de(t){let e=t.getReader();try{for(;;){let{done:s,value:r}=await e.read();if(s)return;yield r;}}finally{e.releaseLock();}}function me(t){return Symbol.asyncIterator in t?t:de(t)}async function*pe(t){let e=new TextDecoder("utf-8"),s=[],r=0,a=false,c=true;for await(let i of me(t)){let n=e.decode(i,{stream:true}),o=0;for(a&&(a=false,n.length>0&&n[0]===`
8
- `&&(o=1));o<n.length;){let l=n.indexOf("\r",o),p=n.indexOf(`
9
- `,o);if(l===-1&&p===-1){let u=n.slice(o);if(s.push(u),r+=u.length,r>ue)throw new Error("SSE line buffer exceeded 10MB");break}let g,f;l!==-1&&(p===-1||l<p)?(g=l,l+1<n.length?f=n[l+1]===`
10
- `?2:1:(a=true,f=1)):(g=p,f=1);let T=n.slice(o,g);s.push(T);let S=s.length===1?s[0]:s.join("");s.length=0,r=0,c&&(S.startsWith("\uFEFF")&&(S=S.slice(1)),c=false),yield S,o=g+f;}}let m=e.decode();if(m&&s.push(m),s.length>0){let i=s.join("");c&&i.startsWith("\uFEFF")&&(i=i.slice(1)),yield i;}}var fe=class{data=[];eventType="";lastEventId=null;retry=null;decode(t){if(t==="")return this.dispatch();if(t[0]===":")return null;let e=t.indexOf(":"),s,r;switch(e===-1?(s=t,r=""):(s=t.slice(0,e),r=t.slice(e+1),r[0]===" "&&(r=r.slice(1))),s){case "data":this.data.push(r);break;case "event":this.eventType=r;break;case "id":r.includes("\0")||(this.lastEventId=r);break;case "retry":/^[0-9]+$/.test(r)&&(this.retry=parseInt(r,10));break}return null}dispatch(){let t=this.eventType;if(this.eventType="",this.data.length===0)return null;let e={data:this.data.join(`
11
- `),event:t,id:this.lastEventId,retry:this.retry};return this.data=[],e}};async function*he(t){let e=new fe;for await(let s of pe(t)){let r=e.decode(s);r!==null&&(yield r);}}var ge=750,M=120*1e3;function Q(t,e="up"){let s=Date.now();function r(){return e==="up"||Date.now()-s>M}function a(){return e==="timed out"&&Date.now()-s<=M}return {...t,status:e,lastUpdate:s,isUp:r,isTimedOut:a}}var re=class extends Error{name="AlgoliaError";constructor(t,e){super(t),e&&(this.name=e);}};var se=class extends re{stackTrace;constructor(t,e,s){super(t,s),this.stackTrace=e;}},B=class extends se{constructor(t){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",t,"RetryError");}},$=class extends se{status;constructor(t,e,s,r="ApiError"){super(t,s,r),this.status=e;}},Pe=class extends re{response;constructor(t,e){super(t,"DeserializationError"),this.response=e;}},ye=class extends ${error;constructor(t,e,s,r){super(t,e,r,"DetailedApiError"),this.error=s;}};function X(t,e,s){let r=Te(s),a=`${t.protocol}://${t.url}${t.port?`:${t.port}`:""}/${e.charAt(0)==="/"?e.substring(1):e}`;return r.length&&(a+=`?${r}`),a}function Te(t){return Object.keys(t).filter(e=>t[e]!==void 0).sort().map(e=>`${e}=${encodeURIComponent(Object.prototype.toString.call(t[e])==="[object Array]"?t[e].join(","):t[e]).replace(/\+/g,"%20")}`).join("&")}function K(t,e){if(t.method==="GET"||t.data===void 0&&e.data===void 0)return;let s=Array.isArray(t.data)?t.data:{...t.data,...e.data};return JSON.stringify(s)}function V(t,e,s){let r={Accept:"application/json",...t,...e,...s},a={};return Object.keys(r).forEach(c=>{let m=r[c];a[c.toLowerCase()]=m;}),a}function Ee(t){if(!(t.status===204||t.content.length===0))try{return JSON.parse(t.content)}catch(e){throw new Pe(e.message,t)}}function ve({content:t,status:e},s){try{let r=JSON.parse(t);return "error"in r?new ye(r.message,e,r.error,s):new $(r.message,e,s)}catch{}return new $(t,e,s)}function Re({isTimedOut:t,status:e}){return !t&&~~e===0}function Se({isTimedOut:t,status:e}){return t||Re({isTimedOut:t,status:e})||~~(e/100)!==2&&~~(e/100)!==4}function we({status:t}){return ~~(t/100)===2}function xe(t){return t.map(e=>ne(e))}function ne(t){let e=t.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return {...t,request:{...t.request,headers:{...t.request.headers,...e}}}}function oe({hosts:t,hostsCache:e,baseHeaders:s,logger:r,baseQueryParameters:a,algoliaAgent:c,timeouts:m,requester:i,requestsCache:n,responsesCache:o,compress:l,compression:p}){async function g(u){let d=await Promise.all(u.map(h=>e.get(h,()=>Promise.resolve(Q(h))))),x=d.filter(h=>h.isUp()),E=d.filter(h=>h.isTimedOut()),w=[...x,...E];return {hosts:w.length>0?w:u,getTimeout(h,b){return (E.length===0&&h===0?1:E.length+3+h)*b}}}async function f(u,d,x){let E=[],w=K(u,d),P=V(s,u.headers,d.headers),h=p==="gzip"&&w!==void 0&&w.length>ge&&(u.method==="POST"||u.method==="PUT");h&&l===void 0&&r.info("Compression is disabled because no compress method is available.");let b=h&&l!==void 0,_=b?await l(w):w;b&&(P["content-encoding"]="gzip");let k=u.method==="GET"?{...u.data,...d.data}:{},O={...a,...u.queryParameters,...k};if(c.value&&(O["x-algolia-agent"]=c.value),d&&d.queryParameters)for(let y of Object.keys(d.queryParameters))!d.queryParameters[y]||Object.prototype.toString.call(d.queryParameters[y])==="[object Object]"?O[y]=d.queryParameters[y]:O[y]=d.queryParameters[y].toString();let C=0,z=async(y,N)=>{let I=y.pop();if(I===void 0)throw new B(xe(E));let L={...m,...d.timeouts},G={data:_,headers:P,method:u.method,url:X(I,u.path,O),connectTimeout:N(C,L.connect),responseTimeout:N(C,x?L.read:L.write)},W=H=>{let J={request:G,response:H,host:I,triesLeft:y.length};return E.push(J),J},A=await i.send(G);if(Se(A)){let H=W(A);return A.isTimedOut&&C++,r.info("Retryable failure",ne(H)),await e.set(I,Q(I,A.isTimedOut?"timed out":"down")),z(y,N)}if(we(A))return Ee(A);throw W(A),ve(A,E)},v=t.filter(y=>y.accept==="readWrite"||(x?y.accept==="read":y.accept==="write")),F=await g(v);return z([...F.hosts].reverse(),F.getTimeout)}function T(u,d={}){let x=()=>f(u,d,E),E=u.useReadTransporter||u.method==="GET";if((d.cacheable||u.cacheable)!==true)return x();let P={request:u,requestOptions:d,transporter:{queryParameters:a,headers:s}};return o.get(P,()=>n.get(P,()=>n.set(P,x()).then(h=>Promise.all([n.delete(P),h]),h=>Promise.all([n.delete(P),Promise.reject(h)])).then(([h,b])=>b)),{miss:h=>o.set(P,h)})}async function*S(u,d={}){if(!i.sendStream)throw new Error("This requester does not support streaming");let x=K(u,d),E=V(s,u.headers,d.headers);E.accept="text/event-stream";let w=u.method==="GET"?{...u.data,...d.data}:{},P={...a,...u.queryParameters,...w};if(c.value&&(P["x-algolia-agent"]=c.value),d&&d.queryParameters)for(let v of Object.keys(d.queryParameters))!d.queryParameters[v]||Object.prototype.toString.call(d.queryParameters[v])==="[object Object]"?P[v]=d.queryParameters[v]:P[v]=d.queryParameters[v].toString();let h=u.useReadTransporter||u.method==="GET",b=t.filter(v=>v.accept==="readWrite"||(h?v.accept==="read":v.accept==="write")),k=(await g(b)).hosts[0];if(!k)throw new B([]);let O={...m,...d.timeouts},C={data:x,headers:E,method:u.method,url:X(k,u.path,P),connectTimeout:O.connect,responseTimeout:h?O.read:O.write},z=await i.sendStream(C);yield*he(z);}return {hostsCache:e,requester:i,timeouts:m,logger:r,algoliaAgent:c,baseHeaders:s,baseQueryParameters:a,hosts:t,request:T,requestStream:S,requestsCache:n,responsesCache:o}}function R(t,e,s){if(s==null||typeof s=="string"&&s.length===0)throw new Error(`Parameter \`${t}\` is required when calling \`${e}\`.`)}function ae(){function t(e){return new Promise(s=>{let r=new XMLHttpRequest;r.open(e.method,e.url,true),Object.keys(e.headers).forEach(i=>r.setRequestHeader(i,e.headers[i]));let a=(i,n)=>setTimeout(()=>{r.abort(),s({status:0,content:n,isTimedOut:true});},i),c=a(e.connectTimeout,"Connection timeout"),m;r.onreadystatechange=()=>{r.readyState>r.OPENED&&m===void 0&&(clearTimeout(c),m=a(e.responseTimeout,"Socket timeout"));},r.onerror=()=>{r.status===0&&(clearTimeout(c),clearTimeout(m),s({content:r.responseText||"Network request failed",status:r.status,isTimedOut:false}));},r.onload=()=>{clearTimeout(c),clearTimeout(m),s({content:r.responseText,status:r.status,isTimedOut:false});},r.send(e.data);})}return {send:t}}var U="5.55.2",j=["eu","us"];function be(t){return [{url:"personalization.{region}.algolia.com".replace("{region}",t),accept:"readWrite",protocol:"https"}]}function ie({appId:t,apiKey:e,authMode:s,algoliaAgents:r,region:a,...c}){let m=Z(t,e,s),i=oe({hosts:be(a),...c,algoliaAgent:ee({algoliaAgents:r,client:"Personalization",version:U}),baseHeaders:{"content-type":"text/plain",...m.headers(),...c.baseHeaders},baseQueryParameters:{...m.queryParameters(),...c.baseQueryParameters}});return {transporter:i,appId:t,apiKey:e,clearCache(){return Promise.all([i.requestsCache.clear(),i.responsesCache.clear()]).then(()=>{})},get _ua(){return i.algoliaAgent.value},addAlgoliaAgent(n,o){i.algoliaAgent.add({segment:n,version:o});},setClientApiKey({apiKey:n}){!s||s==="WithinHeaders"?i.baseHeaders["x-algolia-api-key"]=n:i.baseQueryParameters["x-algolia-api-key"]=n;},customDelete({path:n,parameters:o},l){R("path","customDelete",n);let T={method:"DELETE",path:"/{path}".replace("{path}",n),queryParameters:o||{},headers:{}};return i.request(T,l)},customGet({path:n,parameters:o},l){R("path","customGet",n);let T={method:"GET",path:"/{path}".replace("{path}",n),queryParameters:o||{},headers:{}};return i.request(T,l)},customPost({path:n,parameters:o,body:l},p){R("path","customPost",n);let S={method:"POST",path:"/{path}".replace("{path}",n),queryParameters:o||{},headers:{},data:l||{}};return i.request(S,p)},customPut({path:n,parameters:o,body:l},p){R("path","customPut",n);let S={method:"PUT",path:"/{path}".replace("{path}",n),queryParameters:o||{},headers:{},data:l||{}};return i.request(S,p)},deleteUserProfile({userToken:n},o){R("userToken","deleteUserProfile",n);let f={method:"DELETE",path:"/1/profiles/{userToken}".replace("{userToken}",encodeURIComponent(n)),queryParameters:{},headers:{}};return i.request(f,o)},getPersonalizationStrategy(n){let g={method:"GET",path:"/1/strategies/personalization",queryParameters:{},headers:{}};return i.request(g,n)},getUserTokenProfile({userToken:n},o){R("userToken","getUserTokenProfile",n);let f={method:"GET",path:"/1/profiles/personalization/{userToken}".replace("{userToken}",encodeURIComponent(n)),queryParameters:{},headers:{}};return i.request(f,o)},setPersonalizationStrategy(n,o){R("personalizationStrategyParams","setPersonalizationStrategy",n),R("personalizationStrategyParams.eventsScoring","setPersonalizationStrategy",n.eventsScoring),R("personalizationStrategyParams.facetsScoring","setPersonalizationStrategy",n.facetsScoring),R("personalizationStrategyParams.personalizationImpact","setPersonalizationStrategy",n.personalizationImpact);let f={method:"POST",path:"/1/strategies/personalization",queryParameters:{},headers:{},data:n};return i.request(f,o)}}}function Ve(t,e,s,r){if(!t||typeof t!="string")throw new Error("`appId` is missing.");if(!e||typeof e!="string")throw new Error("`apiKey` is missing.");if(!s||s&&(typeof s!="string"||!j.includes(s)))throw new Error(`\`region\` is required and must be one of the following: ${j.join(", ")}`);let{compression:a,...c}=r||{};return ie({appId:t,apiKey:e,region:s,timeouts:{connect:1e3,read:2e3,write:3e4},logger:te(),requester:ae(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:D(),requestsCache:D({serializable:false}),hostsCache:q({caches:[Y({key:`${U}-${t}`}),D()]}),...c})}
7
+ function Z(e){let t,s=`algolia-client-js-${e.key}`;function r(){return t===void 0&&(t=e.localStorage||window.localStorage),t}function c(){return JSON.parse(r().getItem(s)||"{}")}function h(o){r().setItem(s,JSON.stringify(o));}function P(){return new Promise(o=>setTimeout(o,0))}function i(){let o=e.timeToLive?e.timeToLive*1e3:null,a=c(),n=new Date().getTime(),l=false;return {namespace:Object.fromEntries(Object.entries(a).filter(([,u])=>!u||u.timestamp===void 0||o&&u.timestamp+o<n?(l=true,false):true)),changed:l}}return {get(o,a,n={miss:()=>Promise.resolve()}){return P().then(()=>{let{namespace:l,changed:p}=i(),u=l[JSON.stringify(o)];return p&&h(l),u?u.value:a().then(y=>n.miss(y).then(()=>y))})},set(o,a){return P().then(()=>{let n=c();return n[JSON.stringify(o)]={timestamp:new Date().getTime(),value:a},r().setItem(s,JSON.stringify(n)),a})},delete(o){return P().then(()=>{let a=c();delete a[JSON.stringify(o)],r().setItem(s,JSON.stringify(a));})},clear(){return Promise.resolve().then(()=>{r().removeItem(s);})}}}function le(){return {get(e,t,s={miss:()=>Promise.resolve()}){return t().then(c=>Promise.all([c,s.miss(c)])).then(([c])=>c)},set(e,t){return Promise.resolve(t)},delete(e){return Promise.resolve()},clear(){return Promise.resolve()}}}function A(e){let t=[...e.caches],s=t.shift();return s===void 0?le():{get(r,c,h={miss:()=>Promise.resolve()}){return s.get(r,c,h).catch(()=>A({caches:t}).get(r,c,h))},set(r,c){return s.set(r,c).catch(()=>A({caches:t}).set(r,c))},delete(r){return s.delete(r).catch(()=>A({caches:t}).delete(r))},clear(){return s.clear().catch(()=>A({caches:t}).clear())}}}function U(e={serializable:true}){let t={};return {get(s,r,c={miss:()=>Promise.resolve()}){let h=JSON.stringify(s);if(h in t)return Promise.resolve(e.serializable?JSON.parse(t[h]):t[h]);let P=r();return P.then(i=>c.miss(i)).then(()=>P)},set(s,r){return t[JSON.stringify(s)]=e.serializable?JSON.stringify(r):r,Promise.resolve(r)},delete(s){return delete t[JSON.stringify(s)],Promise.resolve()},clear(){return t={},Promise.resolve()}}}function de(e){let t={value:`Algolia for JavaScript (${e})`,add(s){let r=`; ${s.segment}${s.version!==void 0?` (${s.version})`:""}`;return t.value.indexOf(r)===-1&&(t.value=`${t.value}${r}`),t}};return t}function ee(e,t,s="WithinHeaders"){let r={"x-algolia-api-key":t,"x-algolia-application-id":e};return {headers(){return s==="WithinHeaders"?r:{}},queryParameters(){return s==="WithinQueryParameters"?r:{}}}}function te({algoliaAgents:e,client:t,version:s}){let r=de(s).add({segment:t,version:s});return e.forEach(c=>r.add(c)),r}function re(){return {debug(e,t){return Promise.resolve()},info(e,t){return Promise.resolve()},error(e,t){return Promise.resolve()}}}var me=10*1024*1024;async function*he(e){let t=e.getReader();try{for(;;){let{done:s,value:r}=await t.read();if(s)return;yield r;}}finally{t.releaseLock();}}function pe(e){return Symbol.asyncIterator in e?e:he(e)}async function*fe(e){let t=new TextDecoder("utf-8"),s=[],r=0,c=false,h=true;for await(let i of pe(e)){let o=t.decode(i,{stream:true}),a=0;for(c&&(c=false,o.length>0&&o[0]===`
8
+ `&&(a=1));a<o.length;){let n=o.indexOf("\r",a),l=o.indexOf(`
9
+ `,a);if(n===-1&&l===-1){let b=o.slice(a);if(s.push(b),r+=b.length,r>me)throw new Error("SSE line buffer exceeded 10MB");break}let p,u;n!==-1&&(l===-1||n<l)?(p=n,n+1<o.length?u=o[n+1]===`
10
+ `?2:1:(c=true,u=1)):(p=l,u=1);let y=o.slice(a,p);s.push(y);let R=s.length===1?s[0]:s.join("");s.length=0,r=0,h&&(R.startsWith("\uFEFF")&&(R=R.slice(1)),h=false),yield R,a=p+u;}}let P=t.decode();if(P&&s.push(P),s.length>0){let i=s.join("");h&&i.startsWith("\uFEFF")&&(i=i.slice(1)),yield i;}}var Pe=class{data=[];eventType="";lastEventId=null;retry=null;decode(e){if(e==="")return this.dispatch();if(e[0]===":")return null;let t=e.indexOf(":"),s,r;switch(t===-1?(s=e,r=""):(s=e.slice(0,t),r=e.slice(t+1),r[0]===" "&&(r=r.slice(1))),s){case "data":this.data.push(r);break;case "event":this.eventType=r;break;case "id":r.includes("\0")||(this.lastEventId=r);break;case "retry":/^[0-9]+$/.test(r)&&(this.retry=parseInt(r,10));break}return null}dispatch(){let e=this.eventType;if(this.eventType="",this.data.length===0)return null;let t={data:this.data.join(`
11
+ `),event:e,id:this.lastEventId,retry:this.retry};return this.data=[],t}};async function*ge(e){let t=new Pe;for await(let s of fe(e)){let r=t.decode(s);r!==null&&(yield r);}}var ye=750,M=120*1e3;function B(e,t="up"){let s=Date.now();function r(){return t==="up"||Date.now()-s>M}function c(){return t==="timed out"&&Date.now()-s<=M}return {...e,status:t,lastUpdate:s,isUp:r,isTimedOut:c}}var se=class extends Error{name="AlgoliaError";constructor(e,t){super(e),t&&(this.name=t);}};var oe=class extends se{stackTrace;constructor(e,t,s){super(e,s),this.stackTrace=t;}},X=class extends oe{constructor(e){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",e,"RetryError");}},G=class extends oe{status;constructor(e,t,s,r="ApiError"){super(e,s,r),this.status=t;}},Te=class extends se{response;constructor(e,t){super(e,"DeserializationError"),this.response=t;}},Re=class extends G{error;constructor(e,t,s,r){super(e,t,r,"DetailedApiError"),this.error=s;}};function K(e,t,s){let r=qe(s),c=`${e.protocol}://${e.url}${e.port?`:${e.port}`:""}/${t.charAt(0)==="/"?t.substring(1):t}`;return r.length&&(c+=`?${r}`),c}function qe(e){return Object.keys(e).filter(t=>e[t]!==void 0).sort().map(t=>`${t}=${encodeURIComponent(Object.prototype.toString.call(e[t])==="[object Array]"?e[t].join(","):e[t]).replace(/\+/g,"%20")}`).join("&")}function V(e,t){if(e.method==="GET"||e.data===void 0&&t.data===void 0)return;let s=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(s)}function Y(e,t,s){let r={Accept:"application/json",...e,...t,...s},c={};return Object.keys(r).forEach(h=>{let P=r[h];c[h.toLowerCase()]=P;}),c}function ae(e){if(!(e.status===204||e.content.length===0))try{return JSON.parse(e.content)}catch(t){throw new Te(t.message,e)}}function Ee(e){return {status:e.status,headers:e.headers,content:e.content,data:ae(e)}}function Se({content:e,status:t},s){try{let r=JSON.parse(e);return "error"in r?new Re(r.message,t,r.error,s):new G(r.message,t,s)}catch{}return new G(e,t,s)}function ve({isTimedOut:e,status:t}){return !e&&~~t===0}function Ie({isTimedOut:e,status:t}){return e||ve({isTimedOut:e,status:t})||~~(t/100)!==2&&~~(t/100)!==4}function we({status:e}){return ~~(e/100)===2}function He(e){return e.map(t=>ne(t))}function ne(e){let t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return {...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function ie({hosts:e,hostsCache:t,baseHeaders:s,logger:r,baseQueryParameters:c,algoliaAgent:h,timeouts:P,requester:i,requestsCache:o,responsesCache:a,compress:n,compression:l}){async function p(d){let m=await Promise.all(d.map(f=>t.get(f,()=>Promise.resolve(B(f))))),v=m.filter(f=>f.isUp()),q=m.filter(f=>f.isTimedOut()),I=[...v,...q];return {hosts:I.length>0?I:d,getTimeout(f,w){return (q.length===0&&f===0?1:q.length+3+f)*w}}}async function u(d,m,v){let q=[],I=V(d,m),T=Y(s,d.headers,m.headers),f=l==="gzip"&&I!==void 0&&I.length>ye&&(d.method==="POST"||d.method==="PUT");f&&n===void 0&&r.info("Compression is disabled because no compress method is available.");let w=f&&n!==void 0,W=w?await n(I):I;w&&(T["content-encoding"]="gzip");let k=d.method==="GET"?{...d.data,...m.data}:{},H={...c,...d.queryParameters,...k};if(h.value&&(H["x-algolia-agent"]=h.value),m&&m.queryParameters)for(let E of Object.keys(m.queryParameters))!m.queryParameters[E]||Object.prototype.toString.call(m.queryParameters[E])==="[object Object]"?H[E]=m.queryParameters[E]:H[E]=m.queryParameters[E].toString();let x=0,C=async(E,_)=>{let z=E.pop();if(z===void 0)throw new X(He(q));let N={...P,...m.timeouts},Q={data:W,headers:T,method:d.method,url:K(z,d.path,H),connectTimeout:_(x,N.connect),responseTimeout:_(x,v?N.read:N.write)},F=L=>{let J={request:Q,response:L,host:z,triesLeft:E.length};return q.push(J),J},O=await i.send(Q);if(Ie(O)){let L=F(O);return O.isTimedOut&&x++,r.info("Retryable failure",ne(L)),await t.set(z,B(z,O.isTimedOut?"timed out":"down")),C(E,_)}if(we(O))return O;throw F(O),Se(O,q)},S=e.filter(E=>E.accept==="readWrite"||(v?E.accept==="read":E.accept==="write")),j=await p(S);return C([...j.hosts].reverse(),j.getTimeout)}function y(d,m={}){let v=()=>u(d,m,q).then(f=>ae(f)),q=d.useReadTransporter||d.method==="GET";if((m.cacheable||d.cacheable)!==true)return v();let T={request:d,requestOptions:m,transporter:{queryParameters:c,headers:s}};return a.get(T,()=>o.get(T,()=>o.set(T,v()).then(f=>Promise.all([o.delete(T),f]),f=>Promise.all([o.delete(T),Promise.reject(f)])).then(([f,w])=>w)),{miss:f=>a.set(T,f)})}function R(d,m={}){let v=d.useReadTransporter||d.method==="GET";return u(d,m,v).then(q=>Ee(q))}async function*b(d,m={}){if(!i.sendStream)throw new Error("This requester does not support streaming");let v=V(d,m),q=Y(s,d.headers,m.headers);q.accept="text/event-stream";let I=d.method==="GET"?{...d.data,...m.data}:{},T={...c,...d.queryParameters,...I};if(h.value&&(T["x-algolia-agent"]=h.value),m&&m.queryParameters)for(let S of Object.keys(m.queryParameters))!m.queryParameters[S]||Object.prototype.toString.call(m.queryParameters[S])==="[object Object]"?T[S]=m.queryParameters[S]:T[S]=m.queryParameters[S].toString();let f=d.useReadTransporter||d.method==="GET",w=e.filter(S=>S.accept==="readWrite"||(f?S.accept==="read":S.accept==="write")),k=(await p(w)).hosts[0];if(!k)throw new X([]);let H={...P,...m.timeouts},x={data:v,headers:q,method:d.method,url:K(k,d.path,T),connectTimeout:H.connect,responseTimeout:f?H.read:H.write},C=await i.sendStream(x);yield*ge(C);}return {hostsCache:t,requester:i,timeouts:P,logger:r,algoliaAgent:h,baseHeaders:s,baseQueryParameters:c,hosts:e,request:y,requestWithHttpInfo:R,requestStream:b,requestsCache:o,responsesCache:a}}function g(e,t,s){if(s==null||typeof s=="string"&&s.length===0)throw new Error(`Parameter \`${e}\` is required when calling \`${t}\`.`)}function Oe(e){let t={};for(let s of e.trim().split(/[\r\n]+/)){let r=s.indexOf(": ");r>0&&(t[s.slice(0,r).toLowerCase()]=s.slice(r+2));}return t}function ce(){function e(t){return new Promise(s=>{let r=new XMLHttpRequest;r.open(t.method,t.url,true),Object.keys(t.headers).forEach(i=>r.setRequestHeader(i,t.headers[i]));let c=(i,o)=>setTimeout(()=>{r.abort(),s({status:0,content:o,isTimedOut:true});},i),h=c(t.connectTimeout,"Connection timeout"),P;r.onreadystatechange=()=>{r.readyState>r.OPENED&&P===void 0&&(clearTimeout(h),P=c(t.responseTimeout,"Socket timeout"));},r.onerror=()=>{r.status===0&&(clearTimeout(h),clearTimeout(P),s({content:r.responseText||"Network request failed",status:r.status,isTimedOut:false}));},r.onload=()=>{clearTimeout(h),clearTimeout(P),s({content:r.responseText,headers:Oe(r.getAllResponseHeaders()),status:r.status,isTimedOut:false});},r.send(t.data);})}return {send:e}}var D="5.56.0",$=["eu","us"];function Ae(e){return [{url:"personalization.{region}.algolia.com".replace("{region}",e),accept:"readWrite",protocol:"https"}]}function ue({appId:e,apiKey:t,authMode:s,algoliaAgents:r,region:c,...h}){let P=ee(e,t,s),i=ie({hosts:Ae(c),...h,algoliaAgent:te({algoliaAgents:r,client:"Personalization",version:D}),baseHeaders:{"content-type":"text/plain",...P.headers(),...h.baseHeaders},baseQueryParameters:{...P.queryParameters(),...h.baseQueryParameters}});return {transporter:i,appId:e,apiKey:t,clearCache(){return Promise.all([i.requestsCache.clear(),i.responsesCache.clear()]).then(()=>{})},get _ua(){return i.algoliaAgent.value},addAlgoliaAgent(o,a){i.algoliaAgent.add({segment:o,version:a});},setClientApiKey({apiKey:o}){!s||s==="WithinHeaders"?i.baseHeaders["x-algolia-api-key"]=o:i.baseQueryParameters["x-algolia-api-key"]=o;},customDelete({path:o,parameters:a},n){g("path","customDelete",o);let y={method:"DELETE",path:"/{path}".replace("{path}",o),queryParameters:a||{},headers:{}};return i.request(y,n)},customDeleteWithHTTPInfo({path:o,parameters:a},n){g("path","customDeleteWithHTTPInfo",o);let y={method:"DELETE",path:"/{path}".replace("{path}",o),queryParameters:a||{},headers:{}};return i.requestWithHttpInfo(y,n)},customGet({path:o,parameters:a},n){g("path","customGet",o);let y={method:"GET",path:"/{path}".replace("{path}",o),queryParameters:a||{},headers:{}};return i.request(y,n)},customGetWithHTTPInfo({path:o,parameters:a},n){g("path","customGetWithHTTPInfo",o);let y={method:"GET",path:"/{path}".replace("{path}",o),queryParameters:a||{},headers:{}};return i.requestWithHttpInfo(y,n)},customPost({path:o,parameters:a,body:n},l){g("path","customPost",o);let R={method:"POST",path:"/{path}".replace("{path}",o),queryParameters:a||{},headers:{},data:n||{}};return i.request(R,l)},customPostWithHTTPInfo({path:o,parameters:a,body:n},l){g("path","customPostWithHTTPInfo",o);let R={method:"POST",path:"/{path}".replace("{path}",o),queryParameters:a||{},headers:{},data:n||{}};return i.requestWithHttpInfo(R,l)},customPut({path:o,parameters:a,body:n},l){g("path","customPut",o);let R={method:"PUT",path:"/{path}".replace("{path}",o),queryParameters:a||{},headers:{},data:n||{}};return i.request(R,l)},customPutWithHTTPInfo({path:o,parameters:a,body:n},l){g("path","customPutWithHTTPInfo",o);let R={method:"PUT",path:"/{path}".replace("{path}",o),queryParameters:a||{},headers:{},data:n||{}};return i.requestWithHttpInfo(R,l)},deleteUserProfile({userToken:o},a){g("userToken","deleteUserProfile",o);let u={method:"DELETE",path:"/1/profiles/{userToken}".replace("{userToken}",encodeURIComponent(o)),queryParameters:{},headers:{}};return i.request(u,a)},deleteUserProfileWithHTTPInfo({userToken:o},a){g("userToken","deleteUserProfileWithHTTPInfo",o);let u={method:"DELETE",path:"/1/profiles/{userToken}".replace("{userToken}",encodeURIComponent(o)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(u,a)},getPersonalizationStrategy(o){let p={method:"GET",path:"/1/strategies/personalization",queryParameters:{},headers:{}};return i.request(p,o)},getPersonalizationStrategyWithHTTPInfo(o){let p={method:"GET",path:"/1/strategies/personalization",queryParameters:{},headers:{}};return i.requestWithHttpInfo(p,o)},getUserTokenProfile({userToken:o},a){g("userToken","getUserTokenProfile",o);let u={method:"GET",path:"/1/profiles/personalization/{userToken}".replace("{userToken}",encodeURIComponent(o)),queryParameters:{},headers:{}};return i.request(u,a)},getUserTokenProfileWithHTTPInfo({userToken:o},a){g("userToken","getUserTokenProfileWithHTTPInfo",o);let u={method:"GET",path:"/1/profiles/personalization/{userToken}".replace("{userToken}",encodeURIComponent(o)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(u,a)},setPersonalizationStrategy(o,a){g("personalizationStrategyParams","setPersonalizationStrategy",o),g("personalizationStrategyParams.eventsScoring","setPersonalizationStrategy",o.eventsScoring),g("personalizationStrategyParams.facetsScoring","setPersonalizationStrategy",o.facetsScoring),g("personalizationStrategyParams.personalizationImpact","setPersonalizationStrategy",o.personalizationImpact);let u={method:"POST",path:"/1/strategies/personalization",queryParameters:{},headers:{},data:o};return i.request(u,a)},setPersonalizationStrategyWithHTTPInfo(o,a){g("personalizationStrategyParams","setPersonalizationStrategyWithHTTPInfo",o),g("personalizationStrategyParams.eventsScoring","setPersonalizationStrategyWithHTTPInfo",o.eventsScoring),g("personalizationStrategyParams.facetsScoring","setPersonalizationStrategyWithHTTPInfo",o.facetsScoring),g("personalizationStrategyParams.personalizationImpact","setPersonalizationStrategyWithHTTPInfo",o.personalizationImpact);let u={method:"POST",path:"/1/strategies/personalization",queryParameters:{},headers:{},data:o};return i.requestWithHttpInfo(u,a)}}}function et(e,t,s,r){if(!e||typeof e!="string")throw new Error("`appId` is missing.");if(!t||typeof t!="string")throw new Error("`apiKey` is missing.");if(!s||s&&(typeof s!="string"||!$.includes(s)))throw new Error(`\`region\` is required and must be one of the following: ${$.join(", ")}`);let{compression:c,...h}=r||{};return ue({appId:e,apiKey:t,region:s,timeouts:{connect:1e3,read:2e3,write:3e4},logger:re(),requester:ce(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:U(),requestsCache:U({serializable:false}),hostsCache:A({caches:[Z({key:`${D}-${e}`}),U()]}),...h})}
12
12
 
13
- exports.apiClientVersion = U;
14
- exports.personalizationClient = Ve;
13
+ exports.apiClientVersion = D;
14
+ exports.personalizationClient = et;
15
15
 
16
16
  }));
@@ -5,7 +5,7 @@ import { createFetchRequester } from "@algolia/requester-fetch";
5
5
 
6
6
  // src/personalizationClient.ts
7
7
  import { createAuth, createTransporter, getAlgoliaAgent, validateRequired } from "@algolia/client-common";
8
- var apiClientVersion = "5.55.2";
8
+ var apiClientVersion = "5.56.0";
9
9
  var REGIONS = ["eu", "us"];
10
10
  function getDefaultHosts(region) {
11
11
  const url = "personalization.{region}.algolia.com".replace("{region}", region);
@@ -102,6 +102,29 @@ function createPersonalizationClient({
102
102
  };
103
103
  return transporter.request(request, requestOptions);
104
104
  },
105
+ /**
106
+ * This method lets you send requests to the Algolia REST API.
107
+ *
108
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
109
+ * @param customDelete - The customDelete object.
110
+ * @param customDelete.path - Path of the endpoint, for example `1/newFeature`.
111
+ * @param customDelete.parameters - Query parameters to apply to the current query.
112
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
113
+ * @see customDelete for the plain version.
114
+ */
115
+ customDeleteWithHTTPInfo({ path, parameters }, requestOptions) {
116
+ validateRequired("path", "customDeleteWithHTTPInfo", path);
117
+ const requestPath = "/{path}".replace("{path}", path);
118
+ const headers = {};
119
+ const queryParameters = parameters ? parameters : {};
120
+ const request = {
121
+ method: "DELETE",
122
+ path: requestPath,
123
+ queryParameters,
124
+ headers
125
+ };
126
+ return transporter.requestWithHttpInfo(request, requestOptions);
127
+ },
105
128
  /**
106
129
  * This method lets you send requests to the Algolia REST API.
107
130
  * @param customGet - The customGet object.
@@ -122,6 +145,29 @@ function createPersonalizationClient({
122
145
  };
123
146
  return transporter.request(request, requestOptions);
124
147
  },
148
+ /**
149
+ * This method lets you send requests to the Algolia REST API.
150
+ *
151
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
152
+ * @param customGet - The customGet object.
153
+ * @param customGet.path - Path of the endpoint, for example `1/newFeature`.
154
+ * @param customGet.parameters - Query parameters to apply to the current query.
155
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
156
+ * @see customGet for the plain version.
157
+ */
158
+ customGetWithHTTPInfo({ path, parameters }, requestOptions) {
159
+ validateRequired("path", "customGetWithHTTPInfo", path);
160
+ const requestPath = "/{path}".replace("{path}", path);
161
+ const headers = {};
162
+ const queryParameters = parameters ? parameters : {};
163
+ const request = {
164
+ method: "GET",
165
+ path: requestPath,
166
+ queryParameters,
167
+ headers
168
+ };
169
+ return transporter.requestWithHttpInfo(request, requestOptions);
170
+ },
125
171
  /**
126
172
  * This method lets you send requests to the Algolia REST API.
127
173
  * @param customPost - The customPost object.
@@ -144,6 +190,31 @@ function createPersonalizationClient({
144
190
  };
145
191
  return transporter.request(request, requestOptions);
146
192
  },
193
+ /**
194
+ * This method lets you send requests to the Algolia REST API.
195
+ *
196
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
197
+ * @param customPost - The customPost object.
198
+ * @param customPost.path - Path of the endpoint, for example `1/newFeature`.
199
+ * @param customPost.parameters - Query parameters to apply to the current query.
200
+ * @param customPost.body - Parameters to send with the custom request.
201
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
202
+ * @see customPost for the plain version.
203
+ */
204
+ customPostWithHTTPInfo({ path, parameters, body }, requestOptions) {
205
+ validateRequired("path", "customPostWithHTTPInfo", path);
206
+ const requestPath = "/{path}".replace("{path}", path);
207
+ const headers = {};
208
+ const queryParameters = parameters ? parameters : {};
209
+ const request = {
210
+ method: "POST",
211
+ path: requestPath,
212
+ queryParameters,
213
+ headers,
214
+ data: body ? body : {}
215
+ };
216
+ return transporter.requestWithHttpInfo(request, requestOptions);
217
+ },
147
218
  /**
148
219
  * This method lets you send requests to the Algolia REST API.
149
220
  * @param customPut - The customPut object.
@@ -166,6 +237,31 @@ function createPersonalizationClient({
166
237
  };
167
238
  return transporter.request(request, requestOptions);
168
239
  },
240
+ /**
241
+ * This method lets you send requests to the Algolia REST API.
242
+ *
243
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
244
+ * @param customPut - The customPut object.
245
+ * @param customPut.path - Path of the endpoint, for example `1/newFeature`.
246
+ * @param customPut.parameters - Query parameters to apply to the current query.
247
+ * @param customPut.body - Parameters to send with the custom request.
248
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
249
+ * @see customPut for the plain version.
250
+ */
251
+ customPutWithHTTPInfo({ path, parameters, body }, requestOptions) {
252
+ validateRequired("path", "customPutWithHTTPInfo", path);
253
+ const requestPath = "/{path}".replace("{path}", path);
254
+ const headers = {};
255
+ const queryParameters = parameters ? parameters : {};
256
+ const request = {
257
+ method: "PUT",
258
+ path: requestPath,
259
+ queryParameters,
260
+ headers,
261
+ data: body ? body : {}
262
+ };
263
+ return transporter.requestWithHttpInfo(request, requestOptions);
264
+ },
169
265
  /**
170
266
  * Deletes a user profile. The response includes a date and time when the user profile can safely be considered deleted.
171
267
  *
@@ -188,6 +284,31 @@ function createPersonalizationClient({
188
284
  };
189
285
  return transporter.request(request, requestOptions);
190
286
  },
287
+ /**
288
+ * Deletes a user profile. The response includes a date and time when the user profile can safely be considered deleted.
289
+ *
290
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
291
+ *
292
+ * Required API Key ACLs:
293
+ * - recommendation
294
+ * @param deleteUserProfile - The deleteUserProfile object.
295
+ * @param deleteUserProfile.userToken - Unique identifier representing a user for which to fetch the personalization profile.
296
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
297
+ * @see deleteUserProfile for the plain version.
298
+ */
299
+ deleteUserProfileWithHTTPInfo({ userToken }, requestOptions) {
300
+ validateRequired("userToken", "deleteUserProfileWithHTTPInfo", userToken);
301
+ const requestPath = "/1/profiles/{userToken}".replace("{userToken}", encodeURIComponent(userToken));
302
+ const headers = {};
303
+ const queryParameters = {};
304
+ const request = {
305
+ method: "DELETE",
306
+ path: requestPath,
307
+ queryParameters,
308
+ headers
309
+ };
310
+ return transporter.requestWithHttpInfo(request, requestOptions);
311
+ },
191
312
  /**
192
313
  * Retrieves the current personalization strategy.
193
314
  *
@@ -207,6 +328,28 @@ function createPersonalizationClient({
207
328
  };
208
329
  return transporter.request(request, requestOptions);
209
330
  },
331
+ /**
332
+ * Retrieves the current personalization strategy.
333
+ *
334
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
335
+ *
336
+ * Required API Key ACLs:
337
+ * - recommendation
338
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
339
+ * @see getPersonalizationStrategy for the plain version.
340
+ */
341
+ getPersonalizationStrategyWithHTTPInfo(requestOptions) {
342
+ const requestPath = "/1/strategies/personalization";
343
+ const headers = {};
344
+ const queryParameters = {};
345
+ const request = {
346
+ method: "GET",
347
+ path: requestPath,
348
+ queryParameters,
349
+ headers
350
+ };
351
+ return transporter.requestWithHttpInfo(request, requestOptions);
352
+ },
210
353
  /**
211
354
  * Retrieves a user profile and their affinities for different facets.
212
355
  *
@@ -232,6 +375,34 @@ function createPersonalizationClient({
232
375
  };
233
376
  return transporter.request(request, requestOptions);
234
377
  },
378
+ /**
379
+ * Retrieves a user profile and their affinities for different facets.
380
+ *
381
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
382
+ *
383
+ * Required API Key ACLs:
384
+ * - recommendation
385
+ * @param getUserTokenProfile - The getUserTokenProfile object.
386
+ * @param getUserTokenProfile.userToken - Unique identifier representing a user for which to fetch the personalization profile.
387
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
388
+ * @see getUserTokenProfile for the plain version.
389
+ */
390
+ getUserTokenProfileWithHTTPInfo({ userToken }, requestOptions) {
391
+ validateRequired("userToken", "getUserTokenProfileWithHTTPInfo", userToken);
392
+ const requestPath = "/1/profiles/personalization/{userToken}".replace(
393
+ "{userToken}",
394
+ encodeURIComponent(userToken)
395
+ );
396
+ const headers = {};
397
+ const queryParameters = {};
398
+ const request = {
399
+ method: "GET",
400
+ path: requestPath,
401
+ queryParameters,
402
+ headers
403
+ };
404
+ return transporter.requestWithHttpInfo(request, requestOptions);
405
+ },
235
406
  /**
236
407
  * Creates a new personalization strategy.
237
408
  *
@@ -268,6 +439,50 @@ function createPersonalizationClient({
268
439
  data: personalizationStrategyParams
269
440
  };
270
441
  return transporter.request(request, requestOptions);
442
+ },
443
+ /**
444
+ * Creates a new personalization strategy.
445
+ *
446
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
447
+ *
448
+ * Required API Key ACLs:
449
+ * - recommendation
450
+ * @param personalizationStrategyParams - The personalizationStrategyParams object.
451
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
452
+ * @see setPersonalizationStrategy for the plain version.
453
+ */
454
+ setPersonalizationStrategyWithHTTPInfo(personalizationStrategyParams, requestOptions) {
455
+ validateRequired(
456
+ "personalizationStrategyParams",
457
+ "setPersonalizationStrategyWithHTTPInfo",
458
+ personalizationStrategyParams
459
+ );
460
+ validateRequired(
461
+ "personalizationStrategyParams.eventsScoring",
462
+ "setPersonalizationStrategyWithHTTPInfo",
463
+ personalizationStrategyParams.eventsScoring
464
+ );
465
+ validateRequired(
466
+ "personalizationStrategyParams.facetsScoring",
467
+ "setPersonalizationStrategyWithHTTPInfo",
468
+ personalizationStrategyParams.facetsScoring
469
+ );
470
+ validateRequired(
471
+ "personalizationStrategyParams.personalizationImpact",
472
+ "setPersonalizationStrategyWithHTTPInfo",
473
+ personalizationStrategyParams.personalizationImpact
474
+ );
475
+ const requestPath = "/1/strategies/personalization";
476
+ const headers = {};
477
+ const queryParameters = {};
478
+ const request = {
479
+ method: "POST",
480
+ path: requestPath,
481
+ queryParameters,
482
+ headers,
483
+ data: personalizationStrategyParams
484
+ };
485
+ return transporter.requestWithHttpInfo(request, requestOptions);
271
486
  }
272
487
  };
273
488
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../builds/fetch.ts","../../src/personalizationClient.ts"],"sourcesContent":["// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nexport type PersonalizationClient = ReturnType<typeof createPersonalizationClient>;\n\nimport { gzipSync } from 'node:zlib';\n\nimport { createMemoryCache, createNullCache, createNullLogger } from '@algolia/client-common';\nimport { createFetchRequester } from '@algolia/requester-fetch';\n\nimport type { ClientOptions } from '@algolia/client-common';\n\nimport { createPersonalizationClient } from '../src/personalizationClient';\n\nimport type { Region } from '../src/personalizationClient';\nimport { REGIONS } from '../src/personalizationClient';\n\nexport type { Region, RegionOptions } from '../src/personalizationClient';\n\nexport { apiClientVersion } from '../src/personalizationClient';\n\nexport * from '../model';\n\nexport function personalizationClient(\n appId: string,\n apiKey: string,\n region: Region,\n options?: ClientOptions | undefined,\n): PersonalizationClient {\n if (!appId || typeof appId !== 'string') {\n throw new Error('`appId` is missing.');\n }\n\n if (!apiKey || typeof apiKey !== 'string') {\n throw new Error('`apiKey` is missing.');\n }\n\n if (!region || (region && (typeof region !== 'string' || !REGIONS.includes(region)))) {\n throw new Error(`\\`region\\` is required and must be one of the following: ${REGIONS.join(', ')}`);\n }\n\n return {\n ...createPersonalizationClient({\n appId,\n apiKey,\n region,\n timeouts: {\n connect: 2000,\n read: 5000,\n write: 30000,\n },\n logger: createNullLogger(),\n requester: createFetchRequester(),\n algoliaAgents: [{ segment: 'Fetch' }],\n responsesCache: createNullCache(),\n requestsCache: createNullCache(),\n hostsCache: createMemoryCache(),\n compress: async (data: string): Promise<Uint8Array> => gzipSync(Buffer.from(data)),\n ...options,\n }),\n };\n}\n","// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\nimport { createAuth, createTransporter, getAlgoliaAgent, validateRequired } from '@algolia/client-common';\n\nimport type { DeleteUserProfileResponse } from '../model/deleteUserProfileResponse';\nimport type { GetUserTokenResponse } from '../model/getUserTokenResponse';\nimport type { PersonalizationStrategyParams } from '../model/personalizationStrategyParams';\nimport type { SetPersonalizationStrategyResponse } from '../model/setPersonalizationStrategyResponse';\n\nimport type {\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteUserProfileProps,\n GetUserTokenProfileProps,\n} from '../model/clientMethodProps';\n\nexport const apiClientVersion = '5.55.2';\n\nexport const REGIONS = ['eu', 'us'] as const;\nexport type Region = (typeof REGIONS)[number];\nexport type RegionOptions = { region: Region };\n\nfunction getDefaultHosts(region: Region): Host[] {\n const url = 'personalization.{region}.algolia.com'.replace('{region}', region);\n\n return [{ url, accept: 'readWrite', protocol: 'https' }];\n}\n\nexport function createPersonalizationClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n region: regionOption,\n ...options\n}: CreateClientOptions & RegionOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(regionOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Personalization',\n version: apiClientVersion,\n }),\n baseHeaders: {\n 'content-type': 'text/plain',\n ...auth.headers(),\n ...options.baseHeaders,\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters,\n },\n });\n\n return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * The `apiKey` currently in use.\n */\n apiKey: apiKeyOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string | undefined): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * Helper method to switch the API key used to authenticate the requests.\n *\n * @param params - Method params.\n * @param params.apiKey - The new API Key to use.\n */\n setClientApiKey({ apiKey }: { apiKey: string }): void {\n if (!authMode || authMode === 'WithinHeaders') {\n transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n } else {\n transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;\n }\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, for example `1/newFeature`.\n * @param customDelete.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customDelete(\n { path, parameters }: CustomDeleteProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n validateRequired('path', 'customDelete', path);\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, for example `1/newFeature`.\n * @param customGet.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>> {\n validateRequired('path', 'customGet', path);\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, for example `1/newFeature`.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n validateRequired('path', 'customPost', path);\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, for example `1/newFeature`.\n * @param customPut.parameters - Query parameters to apply to the current query.\n * @param customPut.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPut(\n { path, parameters, body }: CustomPutProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n validateRequired('path', 'customPut', path);\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Deletes a user profile. The response includes a date and time when the user profile can safely be considered deleted.\n *\n * Required API Key ACLs:\n * - recommendation\n * @param deleteUserProfile - The deleteUserProfile object.\n * @param deleteUserProfile.userToken - Unique identifier representing a user for which to fetch the personalization profile.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteUserProfile(\n { userToken }: DeleteUserProfileProps,\n requestOptions?: RequestOptions,\n ): Promise<DeleteUserProfileResponse> {\n validateRequired('userToken', 'deleteUserProfile', userToken);\n\n const requestPath = '/1/profiles/{userToken}'.replace('{userToken}', encodeURIComponent(userToken));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves the current personalization strategy.\n *\n * Required API Key ACLs:\n * - recommendation\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getPersonalizationStrategy(requestOptions?: RequestOptions | undefined): Promise<PersonalizationStrategyParams> {\n const requestPath = '/1/strategies/personalization';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves a user profile and their affinities for different facets.\n *\n * Required API Key ACLs:\n * - recommendation\n * @param getUserTokenProfile - The getUserTokenProfile object.\n * @param getUserTokenProfile.userToken - Unique identifier representing a user for which to fetch the personalization profile.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getUserTokenProfile(\n { userToken }: GetUserTokenProfileProps,\n requestOptions?: RequestOptions,\n ): Promise<GetUserTokenResponse> {\n validateRequired('userToken', 'getUserTokenProfile', userToken);\n\n const requestPath = '/1/profiles/personalization/{userToken}'.replace(\n '{userToken}',\n encodeURIComponent(userToken),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Creates a new personalization strategy.\n *\n * Required API Key ACLs:\n * - recommendation\n * @param personalizationStrategyParams - The personalizationStrategyParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n setPersonalizationStrategy(\n personalizationStrategyParams: PersonalizationStrategyParams,\n requestOptions?: RequestOptions,\n ): Promise<SetPersonalizationStrategyResponse> {\n validateRequired('personalizationStrategyParams', 'setPersonalizationStrategy', personalizationStrategyParams);\n\n validateRequired(\n 'personalizationStrategyParams.eventsScoring',\n 'setPersonalizationStrategy',\n personalizationStrategyParams.eventsScoring,\n );\n validateRequired(\n 'personalizationStrategyParams.facetsScoring',\n 'setPersonalizationStrategy',\n personalizationStrategyParams.facetsScoring,\n );\n validateRequired(\n 'personalizationStrategyParams.personalizationImpact',\n 'setPersonalizationStrategy',\n personalizationStrategyParams.personalizationImpact,\n );\n\n const requestPath = '/1/strategies/personalization';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: personalizationStrategyParams,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";AAIA,SAAS,gBAAgB;AA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AI,MAAM,sBAAsB;AAAA,EACxC;AAEA,MAAI,CAAC,UAAW,WAAW,OAAO,WAAW,YAAY,CAAC,QAAQ,SAAS,MAAM,IAAK;AACpF,UAAM,IAAI,MAAM,4DAA4D,QAAQ,KAAK,IAAI,CAAC,EAAE;AAAA,EAClG;AAEA,SAAO;AAAA,IACL,GAAG,4BAA4B;AAAA,MAC7B;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU;AAAA,QACR,SAAS;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MACT;AAAA,MACA,QAAQ,iBAAiB;AAAA,MACzB,WAAW,qBAAqB;AAAA,MAChC,eAAe,CAAC,EAAE,SAAS,QAAQ,CAAC;AAAA,MACpC,gBAAgB,gBAAgB;AAAA,MAChC,eAAe,gBAAgB;AAAA,MAC/B,YAAY,kBAAkB;AAAA,MAC9B,UAAU,OAAO,SAAsC,SAAS,OAAO,KAAK,IAAI,CAAC;AAAA,MACjF,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;","names":[]}
1
+ {"version":3,"sources":["../../builds/fetch.ts","../../src/personalizationClient.ts"],"sourcesContent":["// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nexport type PersonalizationClient = ReturnType<typeof createPersonalizationClient>;\n\nimport { gzipSync } from 'node:zlib';\n\nimport { createMemoryCache, createNullCache, createNullLogger } from '@algolia/client-common';\nimport { createFetchRequester } from '@algolia/requester-fetch';\n\nimport type { ClientOptions } from '@algolia/client-common';\n\nimport { createPersonalizationClient } from '../src/personalizationClient';\n\nimport type { Region } from '../src/personalizationClient';\nimport { REGIONS } from '../src/personalizationClient';\n\nexport type { Region, RegionOptions } from '../src/personalizationClient';\n\nexport { apiClientVersion } from '../src/personalizationClient';\n\nexport * from '../model';\n\nexport function personalizationClient(\n appId: string,\n apiKey: string,\n region: Region,\n options?: ClientOptions | undefined,\n): PersonalizationClient {\n if (!appId || typeof appId !== 'string') {\n throw new Error('`appId` is missing.');\n }\n\n if (!apiKey || typeof apiKey !== 'string') {\n throw new Error('`apiKey` is missing.');\n }\n\n if (!region || (region && (typeof region !== 'string' || !REGIONS.includes(region)))) {\n throw new Error(`\\`region\\` is required and must be one of the following: ${REGIONS.join(', ')}`);\n }\n\n return {\n ...createPersonalizationClient({\n appId,\n apiKey,\n region,\n timeouts: {\n connect: 2000,\n read: 5000,\n write: 30000,\n },\n logger: createNullLogger(),\n requester: createFetchRequester(),\n algoliaAgents: [{ segment: 'Fetch' }],\n responsesCache: createNullCache(),\n requestsCache: createNullCache(),\n hostsCache: createMemoryCache(),\n compress: async (data: string): Promise<Uint8Array> => gzipSync(Buffer.from(data)),\n ...options,\n }),\n };\n}\n","// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nimport type {\n AlgoliaHttpResponse,\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\nimport { createAuth, createTransporter, getAlgoliaAgent, validateRequired } from '@algolia/client-common';\n\nimport type { DeleteUserProfileResponse } from '../model/deleteUserProfileResponse';\nimport type { GetUserTokenResponse } from '../model/getUserTokenResponse';\nimport type { PersonalizationStrategyParams } from '../model/personalizationStrategyParams';\nimport type { SetPersonalizationStrategyResponse } from '../model/setPersonalizationStrategyResponse';\n\nimport type {\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteUserProfileProps,\n GetUserTokenProfileProps,\n} from '../model/clientMethodProps';\n\nexport const apiClientVersion = '5.56.0';\n\nexport const REGIONS = ['eu', 'us'] as const;\nexport type Region = (typeof REGIONS)[number];\nexport type RegionOptions = { region: Region };\n\nfunction getDefaultHosts(region: Region): Host[] {\n const url = 'personalization.{region}.algolia.com'.replace('{region}', region);\n\n return [{ url, accept: 'readWrite', protocol: 'https' }];\n}\n\nexport function createPersonalizationClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n region: regionOption,\n ...options\n}: CreateClientOptions & RegionOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(regionOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Personalization',\n version: apiClientVersion,\n }),\n baseHeaders: {\n 'content-type': 'text/plain',\n ...auth.headers(),\n ...options.baseHeaders,\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters,\n },\n });\n\n return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * The `apiKey` currently in use.\n */\n apiKey: apiKeyOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string | undefined): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * Helper method to switch the API key used to authenticate the requests.\n *\n * @param params - Method params.\n * @param params.apiKey - The new API Key to use.\n */\n setClientApiKey({ apiKey }: { apiKey: string }): void {\n if (!authMode || authMode === 'WithinHeaders') {\n transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n } else {\n transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;\n }\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, for example `1/newFeature`.\n * @param customDelete.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customDelete(\n { path, parameters }: CustomDeleteProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n validateRequired('path', 'customDelete', path);\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * This method lets you send requests to the Algolia REST API.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, for example `1/newFeature`.\n * @param customDelete.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see customDelete for the plain version.\n */\n customDeleteWithHTTPInfo(\n { path, parameters }: CustomDeleteProps,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<Record<string, unknown>>> {\n validateRequired('path', 'customDeleteWithHTTPInfo', path);\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, for example `1/newFeature`.\n * @param customGet.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>> {\n validateRequired('path', 'customGet', path);\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * This method lets you send requests to the Algolia REST API.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, for example `1/newFeature`.\n * @param customGet.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see customGet for the plain version.\n */\n customGetWithHTTPInfo(\n { path, parameters }: CustomGetProps,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<Record<string, unknown>>> {\n validateRequired('path', 'customGetWithHTTPInfo', path);\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, for example `1/newFeature`.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n validateRequired('path', 'customPost', path);\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * This method lets you send requests to the Algolia REST API.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, for example `1/newFeature`.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see customPost for the plain version.\n */\n customPostWithHTTPInfo(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<Record<string, unknown>>> {\n validateRequired('path', 'customPostWithHTTPInfo', path);\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, for example `1/newFeature`.\n * @param customPut.parameters - Query parameters to apply to the current query.\n * @param customPut.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPut(\n { path, parameters, body }: CustomPutProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n validateRequired('path', 'customPut', path);\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * This method lets you send requests to the Algolia REST API.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, for example `1/newFeature`.\n * @param customPut.parameters - Query parameters to apply to the current query.\n * @param customPut.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see customPut for the plain version.\n */\n customPutWithHTTPInfo(\n { path, parameters, body }: CustomPutProps,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<Record<string, unknown>>> {\n validateRequired('path', 'customPutWithHTTPInfo', path);\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * Deletes a user profile. The response includes a date and time when the user profile can safely be considered deleted.\n *\n * Required API Key ACLs:\n * - recommendation\n * @param deleteUserProfile - The deleteUserProfile object.\n * @param deleteUserProfile.userToken - Unique identifier representing a user for which to fetch the personalization profile.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteUserProfile(\n { userToken }: DeleteUserProfileProps,\n requestOptions?: RequestOptions,\n ): Promise<DeleteUserProfileResponse> {\n validateRequired('userToken', 'deleteUserProfile', userToken);\n\n const requestPath = '/1/profiles/{userToken}'.replace('{userToken}', encodeURIComponent(userToken));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * Deletes a user profile. The response includes a date and time when the user profile can safely be considered deleted.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n *\n * Required API Key ACLs:\n * - recommendation\n * @param deleteUserProfile - The deleteUserProfile object.\n * @param deleteUserProfile.userToken - Unique identifier representing a user for which to fetch the personalization profile.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see deleteUserProfile for the plain version.\n */\n deleteUserProfileWithHTTPInfo(\n { userToken }: DeleteUserProfileProps,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<DeleteUserProfileResponse>> {\n validateRequired('userToken', 'deleteUserProfileWithHTTPInfo', userToken);\n\n const requestPath = '/1/profiles/{userToken}'.replace('{userToken}', encodeURIComponent(userToken));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * Retrieves the current personalization strategy.\n *\n * Required API Key ACLs:\n * - recommendation\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getPersonalizationStrategy(requestOptions?: RequestOptions | undefined): Promise<PersonalizationStrategyParams> {\n const requestPath = '/1/strategies/personalization';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves the current personalization strategy.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n *\n * Required API Key ACLs:\n * - recommendation\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see getPersonalizationStrategy for the plain version.\n */\n getPersonalizationStrategyWithHTTPInfo(\n requestOptions?: RequestOptions | undefined,\n ): Promise<AlgoliaHttpResponse<PersonalizationStrategyParams>> {\n const requestPath = '/1/strategies/personalization';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * Retrieves a user profile and their affinities for different facets.\n *\n * Required API Key ACLs:\n * - recommendation\n * @param getUserTokenProfile - The getUserTokenProfile object.\n * @param getUserTokenProfile.userToken - Unique identifier representing a user for which to fetch the personalization profile.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getUserTokenProfile(\n { userToken }: GetUserTokenProfileProps,\n requestOptions?: RequestOptions,\n ): Promise<GetUserTokenResponse> {\n validateRequired('userToken', 'getUserTokenProfile', userToken);\n\n const requestPath = '/1/profiles/personalization/{userToken}'.replace(\n '{userToken}',\n encodeURIComponent(userToken),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves a user profile and their affinities for different facets.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n *\n * Required API Key ACLs:\n * - recommendation\n * @param getUserTokenProfile - The getUserTokenProfile object.\n * @param getUserTokenProfile.userToken - Unique identifier representing a user for which to fetch the personalization profile.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see getUserTokenProfile for the plain version.\n */\n getUserTokenProfileWithHTTPInfo(\n { userToken }: GetUserTokenProfileProps,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<GetUserTokenResponse>> {\n validateRequired('userToken', 'getUserTokenProfileWithHTTPInfo', userToken);\n\n const requestPath = '/1/profiles/personalization/{userToken}'.replace(\n '{userToken}',\n encodeURIComponent(userToken),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * Creates a new personalization strategy.\n *\n * Required API Key ACLs:\n * - recommendation\n * @param personalizationStrategyParams - The personalizationStrategyParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n setPersonalizationStrategy(\n personalizationStrategyParams: PersonalizationStrategyParams,\n requestOptions?: RequestOptions,\n ): Promise<SetPersonalizationStrategyResponse> {\n validateRequired('personalizationStrategyParams', 'setPersonalizationStrategy', personalizationStrategyParams);\n\n validateRequired(\n 'personalizationStrategyParams.eventsScoring',\n 'setPersonalizationStrategy',\n personalizationStrategyParams.eventsScoring,\n );\n validateRequired(\n 'personalizationStrategyParams.facetsScoring',\n 'setPersonalizationStrategy',\n personalizationStrategyParams.facetsScoring,\n );\n validateRequired(\n 'personalizationStrategyParams.personalizationImpact',\n 'setPersonalizationStrategy',\n personalizationStrategyParams.personalizationImpact,\n );\n\n const requestPath = '/1/strategies/personalization';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: personalizationStrategyParams,\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * Creates a new personalization strategy.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n *\n * Required API Key ACLs:\n * - recommendation\n * @param personalizationStrategyParams - The personalizationStrategyParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see setPersonalizationStrategy for the plain version.\n */\n setPersonalizationStrategyWithHTTPInfo(\n personalizationStrategyParams: PersonalizationStrategyParams,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<SetPersonalizationStrategyResponse>> {\n validateRequired(\n 'personalizationStrategyParams',\n 'setPersonalizationStrategyWithHTTPInfo',\n personalizationStrategyParams,\n );\n\n validateRequired(\n 'personalizationStrategyParams.eventsScoring',\n 'setPersonalizationStrategyWithHTTPInfo',\n personalizationStrategyParams.eventsScoring,\n );\n validateRequired(\n 'personalizationStrategyParams.facetsScoring',\n 'setPersonalizationStrategyWithHTTPInfo',\n personalizationStrategyParams.facetsScoring,\n );\n validateRequired(\n 'personalizationStrategyParams.personalizationImpact',\n 'setPersonalizationStrategyWithHTTPInfo',\n personalizationStrategyParams.personalizationImpact,\n );\n\n const requestPath = '/1/strategies/personalization';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: personalizationStrategyParams,\n };\n\n return transpor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