@algolia/abtesting 1.25.0 → 1.27.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 +299 -21
- package/dist/builds/browser.js +192 -9
- package/dist/builds/browser.js.map +1 -1
- package/dist/builds/browser.min.js +5 -5
- package/dist/builds/browser.min.js.map +1 -1
- package/dist/builds/browser.umd.js +6 -6
- package/dist/builds/fetch.js +192 -9
- package/dist/builds/fetch.js.map +1 -1
- package/dist/builds/node.cjs +192 -9
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +192 -9
- package/dist/builds/node.js.map +1 -1
- package/dist/builds/worker.js +192 -9
- package/dist/builds/worker.js.map +1 -1
- package/dist/fetch.d.ts +299 -21
- package/dist/node.d.cts +299 -21
- package/dist/node.d.ts +299 -21
- package/dist/src/abtestingV3Client.cjs +192 -9
- package/dist/src/abtestingV3Client.cjs.map +1 -1
- package/dist/src/abtestingV3Client.js +192 -9
- package/dist/src/abtestingV3Client.js.map +1 -1
- package/dist/worker.d.ts +299 -21
- package/package.json +9 -9
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@algolia/abtesting"] = {}));
|
|
5
5
|
})(this, (function (exports) { 'use strict';
|
|
6
6
|
|
|
7
|
-
function
|
|
8
|
-
`&&(
|
|
9
|
-
`,
|
|
10
|
-
`?2:1:(
|
|
11
|
-
`),event:e,id:this.lastEventId,retry:this.retry};return this.data=[],t}};async function*be(e){let t=new He;for await(let s of Se(e)){let o=t.decode(s);o!==null&&(yield o);}}var xe=750,Z=120*1e3;function ee(e,t="up"){let s=Date.now();function o(){return t==="up"||Date.now()-s>Z}function c(){return t==="timed out"&&Date.now()-s<=Z}return {...e,status:t,lastUpdate:s,isUp:o,isTimedOut:c}}var me=class extends Error{name="AlgoliaError";constructor(e,t){super(e),t&&(this.name=t);}};var fe=class extends me{stackTrace;correlationId;constructor(e,t,s,o){super(o?`${e} (Correlation-ID: ${o})`:e,s),this.stackTrace=t,this.correlationId=o;}},te=class extends fe{constructor(e,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",e,"RetryError",t);}},J=class extends fe{status;constructor(e,t,s,o="ApiError",c){super(e,s,o,c),this.status=t;}};var Be=class extends me{response;correlationId;constructor(e,t,s){super(s?`${e} (Correlation-ID: ${s})`:e,"DeserializationError"),this.response=t,this.correlationId=s;}},Oe=class extends J{error;constructor(e,t,s,o,c){super(e,t,o,"DetailedApiError",c),this.error=s;}};function re(e,t,s){let o=Ce(s),c=`${e.protocol}://${e.url}${e.port?`:${e.port}`:""}/${t.charAt(0)==="/"?t.substring(1):t}`;return o.length&&(c+=`?${o}`),c}function Ce(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 se(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 oe(e,t,s){let o={Accept:"application/json",...e,...t,...s},c={};return Object.keys(o).forEach(h=>{let y=o[h];c[h.toLowerCase()]=y;}),c}function he(e){if(!(e.status===204||e.content.length===0))try{return JSON.parse(e.content)}catch(t){throw new Be(t.message,e,X(e.headers))}}function We(e){return {status:e.status,headers:e.headers,content:e.content,data:he(e)}}function X(e){if(!e)return;if(e["correlation-id"]!==void 0)return e["correlation-id"];let t=Object.keys(e).find(s=>s.toLowerCase()==="correlation-id");return t===void 0?void 0:e[t]}function Le(e){for(let t=e.length-1;t>=0;t--){let s=X(e[t].response.headers);if(s!==void 0)return s}}function _e(e,t){let{content:s,status:o}=e,c=X(e.headers);try{let h=JSON.parse(s);return "error"in h?new Oe(h.message,o,h.error,t,c):new J(h.message,o,t,"ApiError",c)}catch{}return new J(s,o,t,"ApiError",c)}var G="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",ne=11;function ae(){var e;let t="";if(typeof((e=globalThis.crypto)==null?void 0:e.getRandomValues)=="function"){let s=new Uint8Array(ne);globalThis.crypto.getRandomValues(s);for(let o of s)t+=G[o%G.length];return t}for(let s=0;s<ne;s++)t+=G[Math.floor(Math.random()*G.length)];return t}var z=1e3;function De({isTimedOut:e,status:t}){return !e&&~~t===0}function ke({isTimedOut:e,status:t}){return e||De({isTimedOut:e,status:t})||~~(t/100)!==2&&~~(t/100)!==4}function Ne({status:e}){return ~~(e/100)===2}function pe({status:e}){return ~~e===429}var Ue=/^HTTP 429(?:\D|$)/;function Ge(e){return typeof e=="object"&&e!==null&&"status"in e?pe(e):e instanceof Error&&Ue.test(e.message)}function Qe(e){if(typeof e=="object"&&e!==null&&"headers"in e)return e.headers}function ie(e){var t;let s=(t=e?.["retry-after"])==null?void 0:t.trim();if(s===void 0||s.length===0||!/^\d+$/.test(s))return z;let o=Number.parseInt(s,10);return o<=0?z:o*1e3}function $e(e){return e.map(t=>V(t))}function V(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 Pe({hosts:e,hostsCache:t,baseHeaders:s,logger:o,baseQueryParameters:c,algoliaAgent:h,timeouts:y,requester:u,requestsCache:r,responsesCache:n,compress:a,compression:d,requestIdChannel:l,maxRateLimitRetries:i=3}){function T(m,f){l===void 0||m["request-id"]!==void 0||Object.keys(f).some(I=>I.toLowerCase()==="x-algolia-request-id")||(l==="headers"?m["request-id"]=ae():f["x-algolia-request-id"]=ae());}let P=m=>new Promise(f=>{setTimeout(f,m);});async function q(m){let f=await Promise.all(m.map(g=>t.get(g,()=>Promise.resolve(ee(g))))),I=f.filter(g=>g.isUp()),E=f.filter(g=>g.isTimedOut()),S=[...I,...E];return {hosts:S.length>0?S:m,getTimeout(g,b){return (E.length===0&&g===0?1:E.length+3+g)*b}}}async function B(m,f,I){let E=[],S=se(m,f),R=oe(s,m.headers,f.headers),g=d==="gzip"&&S!==void 0&&S.length>xe&&(m.method==="POST"||m.method==="PUT");g&&a===void 0&&o.info("Compression is disabled because no compress method is available.");let b=g&&a!==void 0,j=b?await a(S):S;b&&(R["content-encoding"]="gzip");let W=m.method==="GET"?{...m.data,...f.data}:{},H={...c,...m.queryParameters,...W};if(h.value&&(H["x-algolia-agent"]=h.value),f&&f.queryParameters)for(let v of Object.keys(f.queryParameters))!f.queryParameters[v]||Object.prototype.toString.call(f.queryParameters[v])==="[object Object]"?H[v]=f.queryParameters[v]:H[v]=f.queryParameters[v].toString();T(R,H);let L=0,x=i,A=async(v,U)=>{let O=v.pop();if(O===void 0)throw new te($e(E),Le(E));let M={...y,...f.timeouts},Y={data:j,headers:R,method:m.method,url:re(O,m.path,H),connectTimeout:U(L,M.connect),responseTimeout:U(L,I?M.read:M.write)},F=k=>{let N={request:Y,response:k,host:O,triesLeft:v.length};return E.push(N),N},w=await u.send(Y);if(pe(w)&&x>0){x--,v.push(O);let k=F(w),N=ie(w.headers);return o.info("Retryable failure",{...V(k),wait:N,rateLimitRetriesLeft:x}),await P(N),A(v,U)}if(ke(w)){let k=F(w);return w.isTimedOut&&L++,o.info("Retryable failure",V(k)),await t.set(O,ee(O,w.isTimedOut?"timed out":"down")),A(v,U)}if(Ne(w))return w;throw F(w),_e(w,E)},_=e.filter(v=>v.accept==="readWrite"||(I?v.accept==="read":v.accept==="write")),D=await q(_);return A([...D.hosts].reverse(),D.getTimeout)}function ye(m,f={}){let I=()=>B(m,f,E).then(g=>he(g)),E=m.useReadTransporter||m.method==="GET";if((f.cacheable||m.cacheable)!==true)return I();let R={request:m,requestOptions:f,transporter:{queryParameters:c,headers:s}};return n.get(R,()=>r.get(R,()=>r.set(R,I()).then(g=>Promise.all([r.delete(R),g]),g=>Promise.all([r.delete(R),Promise.reject(g)])).then(([g,b])=>b)),{miss:g=>n.set(R,g)})}function qe(m,f={}){let I=m.useReadTransporter||m.method==="GET";return B(m,f,I).then(E=>We(E))}async function*Re(m,f={}){if(!u.sendStream)throw new Error("This requester does not support streaming");let I=se(m,f),E=oe(s,m.headers,f.headers);E.accept="text/event-stream";let S=m.method==="GET"?{...m.data,...f.data}:{},R={...c,...m.queryParameters,...S};if(h.value&&(R["x-algolia-agent"]=h.value),f&&f.queryParameters)for(let A of Object.keys(f.queryParameters))!f.queryParameters[A]||Object.prototype.toString.call(f.queryParameters[A])==="[object Object]"?R[A]=f.queryParameters[A]:R[A]=f.queryParameters[A].toString();T(E,R);let g=m.useReadTransporter||m.method==="GET",b=e.filter(A=>A.accept==="readWrite"||(g?A.accept==="read":A.accept==="write")),W=(await q(b)).hosts[0];if(!W)throw new te([]);let H={...y,...f.timeouts},L={data:I,headers:E,method:m.method,url:re(W,m.path,R),connectTimeout:H.connect,responseTimeout:g?H.read:H.write},x=i;for(;;){let A;try{A=await u.sendStream(L);}catch(_){if(Ge(_)&&x>0){x--;let D=ie(Qe(_));o.info("Retryable failure",{wait:D,rateLimitRetriesLeft:x,host:W}),await P(D);continue}throw _}yield*be(A);return}}return {hostsCache:t,requester:u,timeouts:y,logger:o,algoliaAgent:h,baseHeaders:s,baseQueryParameters:c,requestIdChannel:l,hosts:e,maxRateLimitRetries:i,request:ye,requestWithHttpInfo:qe,requestStream:Re,requestsCache:r,responsesCache:n}}function p(e,t,s){if(s==null||typeof s=="string"&&s.length===0)throw new Error(`Parameter \`${e}\` is required when calling \`${t}\`.`)}function je(e){let t={};for(let s of e.trim().split(/[\r\n]+/)){let o=s.indexOf(": ");o>0&&(t[s.slice(0,o).toLowerCase()]=s.slice(o+2));}return t}function Te(){function e(t){return new Promise(s=>{let o=new XMLHttpRequest;o.open(t.method,t.url,true),Object.keys(t.headers).forEach(u=>o.setRequestHeader(u,t.headers[u]));let c=(u,r)=>setTimeout(()=>{o.abort(),s({status:0,content:r,isTimedOut:true});},u),h=c(t.connectTimeout,"Connection timeout"),y;o.onreadystatechange=()=>{o.readyState>o.OPENED&&y===void 0&&(clearTimeout(h),y=c(t.responseTimeout,"Socket timeout"));},o.onerror=()=>{o.status===0&&(clearTimeout(h),clearTimeout(y),s({content:o.responseText||"Network request failed",status:o.status,isTimedOut:false}));},o.onload=()=>{clearTimeout(h),clearTimeout(y),s({content:o.responseText,headers:je(o.getAllResponseHeaders()),status:o.status,isTimedOut:false});},o.send(t.data);})}return {send:e}}var $="1.25.0",K=["de","us"];function Me(e){return [{url:e?"analytics.{region}.algolia.com".replace("{region}",e):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]}function ge({appId:e,apiKey:t,authMode:s,algoliaAgents:o,region:c,...h}){let y=ce(e,t,s),u=Pe({hosts:Me(c),...h,algoliaAgent:de({algoliaAgents:o,client:"AbtestingV3",version:$}),baseHeaders:{"content-type":"text/plain",...y.headers(),...h.baseHeaders},baseQueryParameters:{...y.queryParameters(),...h.baseQueryParameters}});return {transporter:u,appId:e,apiKey:t,clearCache(){return Promise.all([u.requestsCache.clear(),u.responsesCache.clear()]).then(()=>{})},get _ua(){return u.algoliaAgent.value},addAlgoliaAgent(r,n){u.algoliaAgent.add({segment:r,version:n});},setClientApiKey({apiKey:r}){!s||s==="WithinHeaders"?u.baseHeaders["x-algolia-api-key"]=r:u.baseQueryParameters["x-algolia-api-key"]=r;},addABTests(r,n){p("addABTestsRequest","addABTests",r),p("addABTestsRequest.name","addABTests",r.name),p("addABTestsRequest.variants","addABTests",r.variants),p("addABTestsRequest.metrics","addABTests",r.metrics),p("addABTestsRequest.endAt","addABTests",r.endAt);let i={method:"POST",path:"/3/abtests",queryParameters:{},headers:{},data:r};return u.request(i,n)},addABTestsWithHTTPInfo(r,n){p("addABTestsRequest","addABTestsWithHTTPInfo",r),p("addABTestsRequest.name","addABTestsWithHTTPInfo",r.name),p("addABTestsRequest.variants","addABTestsWithHTTPInfo",r.variants),p("addABTestsRequest.metrics","addABTestsWithHTTPInfo",r.metrics),p("addABTestsRequest.endAt","addABTestsWithHTTPInfo",r.endAt);let i={method:"POST",path:"/3/abtests",queryParameters:{},headers:{},data:r};return u.requestWithHttpInfo(i,n)},customDelete({path:r,parameters:n},a){p("path","customDelete",r);let T={method:"DELETE",path:"/{path}".replace("{path}",r),queryParameters:n||{},headers:{}};return u.request(T,a)},customDeleteWithHTTPInfo({path:r,parameters:n},a){p("path","customDeleteWithHTTPInfo",r);let T={method:"DELETE",path:"/{path}".replace("{path}",r),queryParameters:n||{},headers:{}};return u.requestWithHttpInfo(T,a)},customGet({path:r,parameters:n},a){p("path","customGet",r);let T={method:"GET",path:"/{path}".replace("{path}",r),queryParameters:n||{},headers:{}};return u.request(T,a)},customGetWithHTTPInfo({path:r,parameters:n},a){p("path","customGetWithHTTPInfo",r);let T={method:"GET",path:"/{path}".replace("{path}",r),queryParameters:n||{},headers:{}};return u.requestWithHttpInfo(T,a)},customPost({path:r,parameters:n,body:a},d){p("path","customPost",r);let P={method:"POST",path:"/{path}".replace("{path}",r),queryParameters:n||{},headers:{},data:a||{}};return u.request(P,d)},customPostWithHTTPInfo({path:r,parameters:n,body:a},d){p("path","customPostWithHTTPInfo",r);let P={method:"POST",path:"/{path}".replace("{path}",r),queryParameters:n||{},headers:{},data:a||{}};return u.requestWithHttpInfo(P,d)},customPut({path:r,parameters:n,body:a},d){p("path","customPut",r);let P={method:"PUT",path:"/{path}".replace("{path}",r),queryParameters:n||{},headers:{},data:a||{}};return u.request(P,d)},customPutWithHTTPInfo({path:r,parameters:n,body:a},d){p("path","customPutWithHTTPInfo",r);let P={method:"PUT",path:"/{path}".replace("{path}",r),queryParameters:n||{},headers:{},data:a||{}};return u.requestWithHttpInfo(P,d)},deleteABTest({id:r},n){p("id","deleteABTest",r);let i={method:"DELETE",path:"/3/abtests/{id}".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return u.request(i,n)},deleteABTestWithHTTPInfo({id:r},n){p("id","deleteABTestWithHTTPInfo",r);let i={method:"DELETE",path:"/3/abtests/{id}".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return u.requestWithHttpInfo(i,n)},estimateABTest(r,n){p("estimateABTestRequest","estimateABTest",r),p("estimateABTestRequest.configuration","estimateABTest",r.configuration),p("estimateABTestRequest.variants","estimateABTest",r.variants);let i={method:"POST",path:"/3/abtests/estimate",queryParameters:{},headers:{},data:r};return u.request(i,n)},estimateABTestWithHTTPInfo(r,n){p("estimateABTestRequest","estimateABTestWithHTTPInfo",r),p("estimateABTestRequest.configuration","estimateABTestWithHTTPInfo",r.configuration),p("estimateABTestRequest.variants","estimateABTestWithHTTPInfo",r.variants);let i={method:"POST",path:"/3/abtests/estimate",queryParameters:{},headers:{},data:r};return u.requestWithHttpInfo(i,n)},getABTest({id:r},n){p("id","getABTest",r);let i={method:"GET",path:"/3/abtests/{id}".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return u.request(i,n)},getABTestWithHTTPInfo({id:r},n){p("id","getABTestWithHTTPInfo",r);let i={method:"GET",path:"/3/abtests/{id}".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return u.requestWithHttpInfo(i,n)},getTimeseries({id:r,startDate:n,endDate:a,metric:d},l){p("id","getTimeseries",r);let i="/3/abtests/{id}/timeseries".replace("{id}",encodeURIComponent(r)),T={},P={};n!==void 0&&(P.startDate=n.toString()),a!==void 0&&(P.endDate=a.toString()),d!==void 0&&(P.metric=d.toString());let q={method:"GET",path:i,queryParameters:P,headers:T};return u.request(q,l)},getTimeseriesWithHTTPInfo({id:r,startDate:n,endDate:a,metric:d},l){p("id","getTimeseriesWithHTTPInfo",r);let i="/3/abtests/{id}/timeseries".replace("{id}",encodeURIComponent(r)),T={},P={};n!==void 0&&(P.startDate=n.toString()),a!==void 0&&(P.endDate=a.toString()),d!==void 0&&(P.metric=d.toString());let q={method:"GET",path:i,queryParameters:P,headers:T};return u.requestWithHttpInfo(q,l)},listABTests({offset:r,limit:n,indexPrefix:a,indexSuffix:d,direction:l}={},i=void 0){let T="/3/abtests",P={},q={};r!==void 0&&(q.offset=r.toString()),n!==void 0&&(q.limit=n.toString()),a!==void 0&&(q.indexPrefix=a.toString()),d!==void 0&&(q.indexSuffix=d.toString()),l!==void 0&&(q.direction=l.toString());let B={method:"GET",path:T,queryParameters:q,headers:P};return u.request(B,i)},listABTestsWithHTTPInfo({offset:r,limit:n,indexPrefix:a,indexSuffix:d,direction:l}={},i=void 0){let T="/3/abtests",P={},q={};r!==void 0&&(q.offset=r.toString()),n!==void 0&&(q.limit=n.toString()),a!==void 0&&(q.indexPrefix=a.toString()),d!==void 0&&(q.indexSuffix=d.toString()),l!==void 0&&(q.direction=l.toString());let B={method:"GET",path:T,queryParameters:q,headers:P};return u.requestWithHttpInfo(B,i)},stopABTest({id:r},n){p("id","stopABTest",r);let i={method:"POST",path:"/3/abtests/{id}/stop".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return u.request(i,n)},stopABTestWithHTTPInfo({id:r},n){p("id","stopABTestWithHTTPInfo",r);let i={method:"POST",path:"/3/abtests/{id}/stop".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return u.requestWithHttpInfo(i,n)}}}function Ut(e,t,s,o){if(!e||typeof e!="string")throw new Error("`appId` is missing.");if(!t||typeof t!="string")throw new Error("`apiKey` is missing.");if(s&&(typeof s!="string"||!K.includes(s)))throw new Error(`\`region\` must be one of the following: ${K.join(", ")}`);let{compression:c,...h}=o||{};return ge({appId:e,apiKey:t,region:s,timeouts:{connect:1e3,read:2e3,write:3e4},logger:le(),requester:Te(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:Q(),requestsCache:Q({serializable:false}),hostsCache:C({caches:[ue({key:`${$}-${e}`}),Q()]}),...h})}
|
|
7
|
+
function de(e){let t,s=`algolia-client-js-${e.key}`;function n(){return t===void 0&&(t=e.localStorage||window.localStorage),t}function d(){return JSON.parse(n().getItem(s)||"{}")}function P(r){n().setItem(s,JSON.stringify(r));}function y(){return new Promise(r=>setTimeout(r,0))}function c(){let r=e.timeToLive?e.timeToLive*1e3:null,o=d(),a=new Date().getTime(),u=false;return {namespace:Object.fromEntries(Object.entries(o).filter(([,i])=>!i||i.timestamp===void 0||r&&i.timestamp+r<a?(u=true,false):true)),changed:u}}return {get(r,o,a={miss:()=>Promise.resolve()}){return y().then(()=>{let{namespace:u,changed:l}=c(),i=u[JSON.stringify(r)];return l&&P(u),i?i.value:o().then(p=>a.miss(p).then(()=>p))})},set(r,o){return y().then(()=>{let a=d();return a[JSON.stringify(r)]={timestamp:new Date().getTime(),value:o},n().setItem(s,JSON.stringify(a)),o})},delete(r){return y().then(()=>{let o=d();delete o[JSON.stringify(r)],n().setItem(s,JSON.stringify(o));})},clear(){return Promise.resolve().then(()=>{n().removeItem(s);})}}}function ve(){return {get(e,t,s={miss:()=>Promise.resolve()}){return t().then(d=>Promise.all([d,s.miss(d)])).then(([d])=>d)},set(e,t){return Promise.resolve(t)},delete(e){return Promise.resolve()},clear(){return Promise.resolve()}}}function C(e){let t=[...e.caches],s=t.shift();return s===void 0?ve():{get(n,d,P={miss:()=>Promise.resolve()}){return s.get(n,d,P).catch(()=>C({caches:t}).get(n,d,P))},set(n,d){return s.set(n,d).catch(()=>C({caches:t}).set(n,d))},delete(n){return s.delete(n).catch(()=>C({caches:t}).delete(n))},clear(){return s.clear().catch(()=>C({caches:t}).clear())}}}function V(e={serializable:true}){let t={};return {get(s,n,d={miss:()=>Promise.resolve()}){let P=JSON.stringify(s);if(P in t)return Promise.resolve(e.serializable?JSON.parse(t[P]):t[P]);let y=n();return y.then(c=>d.miss(c)).then(()=>y)},set(s,n){return t[JSON.stringify(s)]=e.serializable?JSON.stringify(n):n,Promise.resolve(n)},delete(s){return delete t[JSON.stringify(s)],Promise.resolve()},clear(){return t={},Promise.resolve()}}}function Se(e){let t={value:`Algolia for JavaScript (${e})`,add(s){let n=`; ${s.segment}${s.version!==void 0?` (${s.version})`:""}`;return t.value.indexOf(n)===-1&&(t.value=`${t.value}${n}`),t}};return t}function le(e,t,s="WithinHeaders"){let n={"x-algolia-api-key":t,"x-algolia-application-id":e};return {headers(){return s==="WithinHeaders"?n:{}},queryParameters(){return s==="WithinQueryParameters"?n:{}}}}function me({algoliaAgents:e,client:t,version:s}){let n=Se(s).add({segment:t,version:s});return e.forEach(d=>n.add(d)),n}function pe(){return {debug(e,t){return Promise.resolve()},info(e,t){return Promise.resolve()},error(e,t){return Promise.resolve()}}}var Ie=10*1024*1024;async function*Ee(e){let t=e.getReader();try{for(;;){let{done:s,value:n}=await t.read();if(s)return;yield n;}}finally{t.releaseLock();}}function He(e){return Symbol.asyncIterator in e?e:Ee(e)}async function*xe(e){let t=new TextDecoder("utf-8"),s=[],n=0,d=false,P=true;for await(let c of He(e)){let r=t.decode(c,{stream:true}),o=0;for(d&&(d=false,r.length>0&&r[0]===`
|
|
8
|
+
`&&(o=1));o<r.length;){let a=r.indexOf("\r",o),u=r.indexOf(`
|
|
9
|
+
`,o);if(a===-1&&u===-1){let R=r.slice(o);if(s.push(R),n+=R.length,n>Ie)throw new Error("SSE line buffer exceeded 10MB");break}let l,i;a!==-1&&(u===-1||a<u)?(l=a,a+1<r.length?i=r[a+1]===`
|
|
10
|
+
`?2:1:(d=true,i=1)):(l=u,i=1);let p=r.slice(o,l);s.push(p);let T=s.length===1?s[0]:s.join("");s.length=0,n=0,P&&(T.startsWith("\uFEFF")&&(T=T.slice(1)),P=false),yield T,o=l+i;}}let y=t.decode();if(y&&s.push(y),s.length>0){let c=s.join("");P&&c.startsWith("\uFEFF")&&(c=c.slice(1)),yield c;}}var be=class{data=[];eventType="";lastEventId=null;retry=null;decode(e){if(e==="")return this.dispatch();if(e[0]===":")return null;let t=e.indexOf(":"),s,n;switch(t===-1?(s=e,n=""):(s=e.slice(0,t),n=e.slice(t+1),n[0]===" "&&(n=n.slice(1))),s){case "data":this.data.push(n);break;case "event":this.eventType=n;break;case "id":n.includes("\0")||(this.lastEventId=n);break;case "retry":/^[0-9]+$/.test(n)&&(this.retry=parseInt(n,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*we(e){let t=new be;for await(let s of xe(e)){let n=t.decode(s);n!==null&&(yield n);}}var Be=750,ee=120*1e3;function te(e,t="up"){let s=Date.now();function n(){return t==="up"||Date.now()-s>ee}function d(){return t==="timed out"&&Date.now()-s<=ee}return {...e,status:t,lastUpdate:s,isUp:n,isTimedOut:d}}var he=class extends Error{name="AlgoliaError";constructor(e,t){super(e),t&&(this.name=t);}};var fe=class extends he{stackTrace;correlationId;constructor(e,t,s,n){super(n?`${e} (Correlation-ID: ${n})`:e,s),this.stackTrace=t,this.correlationId=n;}},re=class extends fe{constructor(e,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",e,"RetryError",t);}},J=class extends fe{status;constructor(e,t,s,n="ApiError",d){super(e,s,n,d),this.status=t;}};var Oe=class extends he{response;correlationId;constructor(e,t,s){super(s?`${e} (Correlation-ID: ${s})`:e,"DeserializationError"),this.response=t,this.correlationId=s;}},Ce=class extends J{error;constructor(e,t,s,n,d){super(e,t,n,"DetailedApiError",d),this.error=s;}};function se(e,t,s){let n=We(s),d=`${e.protocol}://${e.url}${e.port?`:${e.port}`:""}/${t.charAt(0)==="/"?t.substring(1):t}`;return n.length&&(d+=`?${n}`),d}function We(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 ne(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 oe(e,t,s){let n={Accept:"application/json",...e,...t,...s},d={};return Object.keys(n).forEach(P=>{let y=n[P];d[P.toLowerCase()]=y;}),d}function Pe(e){if(!(e.status===204||e.content.length===0))try{return JSON.parse(e.content)}catch(t){throw new Oe(t.message,e,K(e.headers))}}function Le(e){return {status:e.status,headers:e.headers,content:e.content,data:Pe(e)}}function K(e){if(!e)return;if(e["correlation-id"]!==void 0)return e["correlation-id"];let t=Object.keys(e).find(s=>s.toLowerCase()==="correlation-id");return t===void 0?void 0:e[t]}function _e(e){for(let t=e.length-1;t>=0;t--){let s=K(e[t].response.headers);if(s!==void 0)return s}}function De(e,t){let{content:s,status:n}=e,d=K(e.headers);try{let P=JSON.parse(s);return "error"in P?new Ce(P.message,n,P.error,t,d):new J(P.message,n,t,"ApiError",d)}catch{}return new J(s,n,t,"ApiError",d)}var Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",ae=11;function ie(){var e;let t="";if(typeof((e=globalThis.crypto)==null?void 0:e.getRandomValues)=="function"){let s=new Uint8Array(ae);globalThis.crypto.getRandomValues(s);for(let n of s)t+=Q[n%Q.length];return t}for(let s=0;s<ae;s++)t+=Q[Math.floor(Math.random()*Q.length)];return t}var z=1e3;function Ue({isTimedOut:e,status:t}){return !e&&~~t===0}function ke({isTimedOut:e,status:t}){return e||Ue({isTimedOut:e,status:t})||~~(t/100)!==2&&~~(t/100)!==4}function Ne({status:e}){return ~~(e/100)===2}function Te({status:e}){return ~~e===429}var Ge=/^HTTP 429(?:\D|$)/;function Qe(e){return typeof e=="object"&&e!==null&&"status"in e?Te(e):e instanceof Error&&Ge.test(e.message)}function Ve(e){if(typeof e=="object"&&e!==null&&"headers"in e)return e.headers}function ue(e){var t;let s=(t=e?.["retry-after"])==null?void 0:t.trim();if(s===void 0||s.length===0||!/^\d+$/.test(s))return z;let n=Number.parseInt(s,10);return n<=0?z:n*1e3}function ce(e){return e.map(t=>X(t))}function X(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 ge({hosts:e,hostsCache:t,baseHeaders:s,logger:n,baseQueryParameters:d,algoliaAgent:P,timeouts:y,requester:c,requestsCache:r,responsesCache:o,compress:a,compression:u,requestIdChannel:l,maxRateLimitRetries:i=3}){function p(h,f){l===void 0||h["request-id"]!==void 0||Object.keys(f).some(E=>E.toLowerCase()==="x-algolia-request-id")||(l==="headers"?h["request-id"]=ie():f["x-algolia-request-id"]=ie());}let T=h=>new Promise(f=>{setTimeout(f,h);});async function R(h){let f=await Promise.all(h.map(g=>t.get(g,()=>Promise.resolve(te(g))))),E=f.filter(g=>g.isUp()),S=f.filter(g=>g.isTimedOut()),x=[...E,...S];return {hosts:x.length>0?x:h,getTimeout(g,w){return (S.length===0&&g===0?1:S.length+3+g)*w}}}async function q(h,f,E){let S=[],x=ne(h,f),A=oe(s,h.headers,f.headers),g=u==="gzip"&&x!==void 0&&x.length>Be&&(h.method==="POST"||h.method==="PUT");g&&a===void 0&&n.info("Compression is disabled because no compress method is available.");let w=g&&a!==void 0,j=w?await a(x):x;w&&(A["content-encoding"]="gzip");let L=h.method==="GET"?{...h.data,...f.data}:{},b={...d,...h.queryParameters,...L};if(P.value&&(b["x-algolia-agent"]=P.value),f&&f.queryParameters)for(let I of Object.keys(f.queryParameters))!f.queryParameters[I]||Object.prototype.toString.call(f.queryParameters[I])==="[object Object]"?b[I]=f.queryParameters[I]:b[I]=f.queryParameters[I].toString();p(A,b);let _=0,B=i,v=async(I,G)=>{let O=I.pop();if(O===void 0)throw new re(ce(S),_e(S));let M={...y,...f.timeouts},Z={data:j,headers:A,method:h.method,url:se(O,h.path,b),connectTimeout:G(_,M.connect),responseTimeout:G(_,E?M.read:M.write)},F=k=>{let N={request:Z,response:k,host:O,triesLeft:I.length};return S.push(N),N},H=await c.send(Z);if(Te(H)&&B>0){B--,I.push(O);let k=F(H),N=ue(H.headers);return n.info("Retryable failure",{...X(k),wait:N,rateLimitRetriesLeft:B}),await T(N),v(I,G)}if(ke(H)){let k=F(H);return H.isTimedOut&&_++,n.info("Retryable failure",X(k)),await t.set(O,te(O,H.isTimedOut?"timed out":"down")),v(I,G)}if(Ne(H))return H;throw F(H),De(H,ce(S))},D=e.filter(I=>I.accept==="readWrite"||(E?I.accept==="read":I.accept==="write")),U=await R(D);return v([...U.hosts].reverse(),U.getTimeout)}function W(h,f={}){let E=()=>q(h,f,S).then(g=>Pe(g)),S=h.useReadTransporter||h.method==="GET";if((f.cacheable||h.cacheable)!==true)return E();let A={request:h,requestOptions:f,transporter:{queryParameters:d,headers:s}};return o.get(A,()=>r.get(A,()=>r.set(A,E()).then(g=>Promise.all([r.delete(A),g]),g=>Promise.all([r.delete(A),Promise.reject(g)])).then(([g,w])=>w)),{miss:g=>o.set(A,g)})}function Re(h,f={}){let E=h.useReadTransporter||h.method==="GET";return q(h,f,E).then(S=>Le(S))}async function*Ae(h,f={}){if(!c.sendStream)throw new Error("This requester does not support streaming");let E=ne(h,f),S=oe(s,h.headers,f.headers);S.accept="text/event-stream";let x=h.method==="GET"?{...h.data,...f.data}:{},A={...d,...h.queryParameters,...x};if(P.value&&(A["x-algolia-agent"]=P.value),f&&f.queryParameters)for(let v of Object.keys(f.queryParameters))!f.queryParameters[v]||Object.prototype.toString.call(f.queryParameters[v])==="[object Object]"?A[v]=f.queryParameters[v]:A[v]=f.queryParameters[v].toString();p(S,A);let g=h.useReadTransporter||h.method==="GET",w=e.filter(v=>v.accept==="readWrite"||(g?v.accept==="read":v.accept==="write")),L=(await R(w)).hosts[0];if(!L)throw new re([]);let b={...y,...f.timeouts},_={data:E,headers:S,method:h.method,url:se(L,h.path,A),connectTimeout:b.connect,responseTimeout:g?b.read:b.write},B=i;for(;;){let v;try{v=await c.sendStream(_);}catch(D){if(Qe(D)&&B>0){B--;let U=ue(Ve(D));n.info("Retryable failure",{wait:U,rateLimitRetriesLeft:B,host:L}),await T(U);continue}throw D}yield*we(v);return}}return {hostsCache:t,requester:c,timeouts:y,logger:n,algoliaAgent:P,baseHeaders:s,baseQueryParameters:d,requestIdChannel:l,hosts:e,maxRateLimitRetries:i,request:W,requestWithHttpInfo:Re,requestStream:Ae,requestsCache:r,responsesCache:o}}function m(e,t,s){if(s==null||typeof s=="string"&&s.length===0)throw new Error(`Parameter \`${e}\` is required when calling \`${t}\`.`)}function $e(e){let t={};for(let s of e.trim().split(/[\r\n]+/)){let n=s.indexOf(": ");n>0&&(t[s.slice(0,n).toLowerCase()]=s.slice(n+2));}return t}function ye(){function e(t){return new Promise(s=>{let n=new XMLHttpRequest;n.open(t.method,t.url,true),Object.keys(t.headers).forEach(c=>n.setRequestHeader(c,t.headers[c]));let d=(c,r)=>setTimeout(()=>{n.abort(),s({status:0,content:r,isTimedOut:true});},c),P=d(t.connectTimeout,"Connection timeout"),y;n.onreadystatechange=()=>{n.readyState>n.OPENED&&y===void 0&&(clearTimeout(P),y=d(t.responseTimeout,"Socket timeout"));},n.onerror=()=>{n.status===0&&(clearTimeout(P),clearTimeout(y),s({content:n.responseText||"Network request failed",status:n.status,isTimedOut:false}));},n.onload=()=>{clearTimeout(P),clearTimeout(y),s({content:n.responseText,headers:$e(n.getAllResponseHeaders()),status:n.status,isTimedOut:false});},n.send(t.data);})}return {send:e}}var $="1.27.0",Y=["de","us"];function je(e){return [{url:e?"analytics.{region}.algolia.com".replace("{region}",e):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]}function qe({appId:e,apiKey:t,authMode:s,algoliaAgents:n,region:d,...P}){let y=le(e,t,s),c=ge({hosts:je(d),...P,algoliaAgent:me({algoliaAgents:n,client:"AbtestingV3",version:$}),baseHeaders:{"content-type":"text/plain",...y.headers(),...P.baseHeaders},baseQueryParameters:{...y.queryParameters(),...P.baseQueryParameters}});return {transporter:c,appId:e,apiKey:t,clearCache(){return Promise.all([c.requestsCache.clear(),c.responsesCache.clear()]).then(()=>{})},get _ua(){return c.algoliaAgent.value},addAlgoliaAgent(r,o){c.algoliaAgent.add({segment:r,version:o});},setClientApiKey({apiKey:r}){!s||s==="WithinHeaders"?c.baseHeaders["x-algolia-api-key"]=r:c.baseQueryParameters["x-algolia-api-key"]=r;},addABTests(r,o){m("addABTestsRequest","addABTests",r),m("addABTestsRequest.name","addABTests",r.name),m("addABTestsRequest.variants","addABTests",r.variants),m("addABTestsRequest.metrics","addABTests",r.metrics),m("addABTestsRequest.endAt","addABTests",r.endAt);let i={method:"POST",path:"/3/abtests",queryParameters:{},headers:{},data:r};return c.request(i,o)},addABTestsWithHTTPInfo(r,o){m("addABTestsRequest","addABTestsWithHTTPInfo",r),m("addABTestsRequest.name","addABTestsWithHTTPInfo",r.name),m("addABTestsRequest.variants","addABTestsWithHTTPInfo",r.variants),m("addABTestsRequest.metrics","addABTestsWithHTTPInfo",r.metrics),m("addABTestsRequest.endAt","addABTestsWithHTTPInfo",r.endAt);let i={method:"POST",path:"/3/abtests",queryParameters:{},headers:{},data:r};return c.requestWithHttpInfo(i,o)},applyVariantSettings({id:r,variantId:o},a){m("id","applyVariantSettings",r),m("variantId","applyVariantSettings",o);let p={method:"POST",path:"/3/abtests/{id}/settings/{variantId}/apply".replace("{id}",encodeURIComponent(r)).replace("{variantId}",encodeURIComponent(o)),queryParameters:{},headers:{}};return c.request(p,a)},applyVariantSettingsWithHTTPInfo({id:r,variantId:o},a){m("id","applyVariantSettingsWithHTTPInfo",r),m("variantId","applyVariantSettingsWithHTTPInfo",o);let p={method:"POST",path:"/3/abtests/{id}/settings/{variantId}/apply".replace("{id}",encodeURIComponent(r)).replace("{variantId}",encodeURIComponent(o)),queryParameters:{},headers:{}};return c.requestWithHttpInfo(p,a)},customDelete({path:r,parameters:o},a){m("path","customDelete",r);let p={method:"DELETE",path:"/{path}".replace("{path}",r),queryParameters:o||{},headers:{}};return c.request(p,a)},customDeleteWithHTTPInfo({path:r,parameters:o},a){m("path","customDeleteWithHTTPInfo",r);let p={method:"DELETE",path:"/{path}".replace("{path}",r),queryParameters:o||{},headers:{}};return c.requestWithHttpInfo(p,a)},customGet({path:r,parameters:o},a){m("path","customGet",r);let p={method:"GET",path:"/{path}".replace("{path}",r),queryParameters:o||{},headers:{}};return c.request(p,a)},customGetWithHTTPInfo({path:r,parameters:o},a){m("path","customGetWithHTTPInfo",r);let p={method:"GET",path:"/{path}".replace("{path}",r),queryParameters:o||{},headers:{}};return c.requestWithHttpInfo(p,a)},customPost({path:r,parameters:o,body:a},u){m("path","customPost",r);let T={method:"POST",path:"/{path}".replace("{path}",r),queryParameters:o||{},headers:{},data:a||{}};return c.request(T,u)},customPostWithHTTPInfo({path:r,parameters:o,body:a},u){m("path","customPostWithHTTPInfo",r);let T={method:"POST",path:"/{path}".replace("{path}",r),queryParameters:o||{},headers:{},data:a||{}};return c.requestWithHttpInfo(T,u)},customPut({path:r,parameters:o,body:a},u){m("path","customPut",r);let T={method:"PUT",path:"/{path}".replace("{path}",r),queryParameters:o||{},headers:{},data:a||{}};return c.request(T,u)},customPutWithHTTPInfo({path:r,parameters:o,body:a},u){m("path","customPutWithHTTPInfo",r);let T={method:"PUT",path:"/{path}".replace("{path}",r),queryParameters:o||{},headers:{},data:a||{}};return c.requestWithHttpInfo(T,u)},deleteABTest({id:r},o){m("id","deleteABTest",r);let i={method:"DELETE",path:"/3/abtests/{id}".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return c.request(i,o)},deleteABTestWithHTTPInfo({id:r},o){m("id","deleteABTestWithHTTPInfo",r);let i={method:"DELETE",path:"/3/abtests/{id}".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return c.requestWithHttpInfo(i,o)},estimateABTest(r,o){m("estimateABTestRequest","estimateABTest",r),m("estimateABTestRequest.configuration","estimateABTest",r.configuration),m("estimateABTestRequest.variants","estimateABTest",r.variants);let i={method:"POST",path:"/3/abtests/estimate",queryParameters:{},headers:{},data:r};return c.request(i,o)},estimateABTestWithHTTPInfo(r,o){m("estimateABTestRequest","estimateABTestWithHTTPInfo",r),m("estimateABTestRequest.configuration","estimateABTestWithHTTPInfo",r.configuration),m("estimateABTestRequest.variants","estimateABTestWithHTTPInfo",r.variants);let i={method:"POST",path:"/3/abtests/estimate",queryParameters:{},headers:{},data:r};return c.requestWithHttpInfo(i,o)},getABTest({id:r,methods:o},a){m("id","getABTest",r);let u="/3/abtests/{id}".replace("{id}",encodeURIComponent(r)),l={},i={};o!==void 0&&(i.methods=o.toString());let p={method:"GET",path:u,queryParameters:i,headers:l};return c.request(p,a)},getABTestWithHTTPInfo({id:r,methods:o},a){m("id","getABTestWithHTTPInfo",r);let u="/3/abtests/{id}".replace("{id}",encodeURIComponent(r)),l={},i={};o!==void 0&&(i.methods=o.toString());let p={method:"GET",path:u,queryParameters:i,headers:l};return c.requestWithHttpInfo(p,a)},getABTestSettings({id:r},o){m("id","getABTestSettings",r);let i={method:"GET",path:"/3/abtests/{id}/settings".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return c.request(i,o)},getABTestSettingsWithHTTPInfo({id:r},o){m("id","getABTestSettingsWithHTTPInfo",r);let i={method:"GET",path:"/3/abtests/{id}/settings".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return c.requestWithHttpInfo(i,o)},getTimeseries({id:r,startDate:o,endDate:a,metric:u,methods:l},i){m("id","getTimeseries",r);let p="/3/abtests/{id}/timeseries".replace("{id}",encodeURIComponent(r)),T={},R={};o!==void 0&&(R.startDate=o.toString()),a!==void 0&&(R.endDate=a.toString()),u!==void 0&&(R.metric=u.toString()),l!==void 0&&(R.methods=l.toString());let q={method:"GET",path:p,queryParameters:R,headers:T};return c.request(q,i)},getTimeseriesWithHTTPInfo({id:r,startDate:o,endDate:a,metric:u,methods:l},i){m("id","getTimeseriesWithHTTPInfo",r);let p="/3/abtests/{id}/timeseries".replace("{id}",encodeURIComponent(r)),T={},R={};o!==void 0&&(R.startDate=o.toString()),a!==void 0&&(R.endDate=a.toString()),u!==void 0&&(R.metric=u.toString()),l!==void 0&&(R.methods=l.toString());let q={method:"GET",path:p,queryParameters:R,headers:T};return c.requestWithHttpInfo(q,i)},listABTests({offset:r,limit:o,indexPrefix:a,indexSuffix:u,direction:l,methods:i}={},p=void 0){let T="/3/abtests",R={},q={};r!==void 0&&(q.offset=r.toString()),o!==void 0&&(q.limit=o.toString()),a!==void 0&&(q.indexPrefix=a.toString()),u!==void 0&&(q.indexSuffix=u.toString()),l!==void 0&&(q.direction=l.toString()),i!==void 0&&(q.methods=i.toString());let W={method:"GET",path:T,queryParameters:q,headers:R};return c.request(W,p)},listABTestsWithHTTPInfo({offset:r,limit:o,indexPrefix:a,indexSuffix:u,direction:l,methods:i}={},p=void 0){let T="/3/abtests",R={},q={};r!==void 0&&(q.offset=r.toString()),o!==void 0&&(q.limit=o.toString()),a!==void 0&&(q.indexPrefix=a.toString()),u!==void 0&&(q.indexSuffix=u.toString()),l!==void 0&&(q.direction=l.toString()),i!==void 0&&(q.methods=i.toString());let W={method:"GET",path:T,queryParameters:q,headers:R};return c.requestWithHttpInfo(W,p)},saveVariantSettings({id:r,variantId:o,saveSettingsRequest:a},u){m("id","saveVariantSettings",r),m("variantId","saveVariantSettings",o),m("saveSettingsRequest","saveVariantSettings",a);let T={method:"POST",path:"/3/abtests/{id}/settings/{variantId}".replace("{id}",encodeURIComponent(r)).replace("{variantId}",encodeURIComponent(o)),queryParameters:{},headers:{},data:a};return c.request(T,u)},saveVariantSettingsWithHTTPInfo({id:r,variantId:o,saveSettingsRequest:a},u){m("id","saveVariantSettingsWithHTTPInfo",r),m("variantId","saveVariantSettingsWithHTTPInfo",o),m("saveSettingsRequest","saveVariantSettingsWithHTTPInfo",a);let T={method:"POST",path:"/3/abtests/{id}/settings/{variantId}".replace("{id}",encodeURIComponent(r)).replace("{variantId}",encodeURIComponent(o)),queryParameters:{},headers:{},data:a};return c.requestWithHttpInfo(T,u)},stopABTest({id:r},o){m("id","stopABTest",r);let i={method:"POST",path:"/3/abtests/{id}/stop".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return c.request(i,o)},stopABTestWithHTTPInfo({id:r},o){m("id","stopABTestWithHTTPInfo",r);let i={method:"POST",path:"/3/abtests/{id}/stop".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return c.requestWithHttpInfo(i,o)}}}function Xt(e,t,s,n){if(!e||typeof e!="string")throw new Error("`appId` is missing.");if(!t||typeof t!="string")throw new Error("`apiKey` is missing.");if(s&&(typeof s!="string"||!Y.includes(s)))throw new Error(`\`region\` must be one of the following: ${Y.join(", ")}`);let{compression:d,...P}=n||{};return qe({appId:e,apiKey:t,region:s,timeouts:{connect:1e3,read:2e3,write:3e4},logger:pe(),requester:ye(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:V(),requestsCache:V({serializable:false}),hostsCache:C({caches:[de({key:`${$}-${e}`}),V()]}),...P})}
|
|
12
12
|
|
|
13
|
-
exports.abtestingV3Client =
|
|
13
|
+
exports.abtestingV3Client = Xt;
|
|
14
14
|
exports.apiClientVersion = $;
|
|
15
15
|
|
|
16
16
|
}));
|
package/dist/builds/fetch.js
CHANGED
|
@@ -5,7 +5,7 @@ import { createFetchRequester } from "@algolia/requester-fetch";
|
|
|
5
5
|
|
|
6
6
|
// src/abtestingV3Client.ts
|
|
7
7
|
import { createAuth, createTransporter, getAlgoliaAgent, validateRequired } from "@algolia/client-common";
|
|
8
|
-
var apiClientVersion = "1.
|
|
8
|
+
var apiClientVersion = "1.27.0";
|
|
9
9
|
var REGIONS = ["de", "us"];
|
|
10
10
|
function getDefaultHosts(region) {
|
|
11
11
|
const url = !region ? "analytics.algolia.com" : "analytics.{region}.algolia.com".replace("{region}", region);
|
|
@@ -137,6 +137,59 @@ function createAbtestingV3Client({
|
|
|
137
137
|
};
|
|
138
138
|
return transporter.requestWithHttpInfo(request, requestOptions);
|
|
139
139
|
},
|
|
140
|
+
/**
|
|
141
|
+
* Applies the captured settings of the given variant to the control index. The settings must first be captured with the `saveVariantSettings` operation. To revert previously applied settings on the control index, use this operation with the control variant (variant 1). Settings can be applied up to 14 days after the A/B test ends, and reverted up to 15 days after. Later requests return `400`. Each set of captured settings can only be applied once, and settings that were reverted can\'t be applied again. Both cases return `400`. The control index must not be in use by an active A/B test. Otherwise, the request returns `422`.
|
|
142
|
+
*
|
|
143
|
+
* Required API Key ACLs:
|
|
144
|
+
* - analytics
|
|
145
|
+
* - editSettings
|
|
146
|
+
* @param applyVariantSettings - The applyVariantSettings object.
|
|
147
|
+
* @param applyVariantSettings.id - Unique A/B test identifier.
|
|
148
|
+
* @param applyVariantSettings.variantId - One-based index of the A/B test variant. The control is variant 1.
|
|
149
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
150
|
+
*/
|
|
151
|
+
applyVariantSettings({ id, variantId }, requestOptions) {
|
|
152
|
+
validateRequired("id", "applyVariantSettings", id);
|
|
153
|
+
validateRequired("variantId", "applyVariantSettings", variantId);
|
|
154
|
+
const requestPath = "/3/abtests/{id}/settings/{variantId}/apply".replace("{id}", encodeURIComponent(id)).replace("{variantId}", encodeURIComponent(variantId));
|
|
155
|
+
const headers = {};
|
|
156
|
+
const queryParameters = {};
|
|
157
|
+
const request = {
|
|
158
|
+
method: "POST",
|
|
159
|
+
path: requestPath,
|
|
160
|
+
queryParameters,
|
|
161
|
+
headers
|
|
162
|
+
};
|
|
163
|
+
return transporter.request(request, requestOptions);
|
|
164
|
+
},
|
|
165
|
+
/**
|
|
166
|
+
* Applies the captured settings of the given variant to the control index. The settings must first be captured with the `saveVariantSettings` operation. To revert previously applied settings on the control index, use this operation with the control variant (variant 1). Settings can be applied up to 14 days after the A/B test ends, and reverted up to 15 days after. Later requests return `400`. Each set of captured settings can only be applied once, and settings that were reverted can\'t be applied again. Both cases return `400`. The control index must not be in use by an active A/B test. Otherwise, the request returns `422`.
|
|
167
|
+
*
|
|
168
|
+
* 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.
|
|
169
|
+
*
|
|
170
|
+
* Required API Key ACLs:
|
|
171
|
+
* - analytics
|
|
172
|
+
* - editSettings
|
|
173
|
+
* @param applyVariantSettings - The applyVariantSettings object.
|
|
174
|
+
* @param applyVariantSettings.id - Unique A/B test identifier.
|
|
175
|
+
* @param applyVariantSettings.variantId - One-based index of the A/B test variant. The control is variant 1.
|
|
176
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
177
|
+
* @see applyVariantSettings for the plain version.
|
|
178
|
+
*/
|
|
179
|
+
applyVariantSettingsWithHTTPInfo({ id, variantId }, requestOptions) {
|
|
180
|
+
validateRequired("id", "applyVariantSettingsWithHTTPInfo", id);
|
|
181
|
+
validateRequired("variantId", "applyVariantSettingsWithHTTPInfo", variantId);
|
|
182
|
+
const requestPath = "/3/abtests/{id}/settings/{variantId}/apply".replace("{id}", encodeURIComponent(id)).replace("{variantId}", encodeURIComponent(variantId));
|
|
183
|
+
const headers = {};
|
|
184
|
+
const queryParameters = {};
|
|
185
|
+
const request = {
|
|
186
|
+
method: "POST",
|
|
187
|
+
path: requestPath,
|
|
188
|
+
queryParameters,
|
|
189
|
+
headers
|
|
190
|
+
};
|
|
191
|
+
return transporter.requestWithHttpInfo(request, requestOptions);
|
|
192
|
+
},
|
|
140
193
|
/**
|
|
141
194
|
* This method lets you send requests to the Algolia REST API.
|
|
142
195
|
* @param customDelete - The customDelete object.
|
|
@@ -426,13 +479,17 @@ function createAbtestingV3Client({
|
|
|
426
479
|
* - analytics
|
|
427
480
|
* @param getABTest - The getABTest object.
|
|
428
481
|
* @param getABTest.id - Unique A/B test identifier.
|
|
482
|
+
* @param getABTest.methods - Statistical analysis results to include, as a comma-separated list. When omitted, each test uses its configured method, or `frequentist` if no method is configured. Request both methods to include both sets of available results. This doesn\'t change the test configuration or compute missing results. Duplicate values aren\'t allowed.
|
|
429
483
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
430
484
|
*/
|
|
431
|
-
getABTest({ id }, requestOptions) {
|
|
485
|
+
getABTest({ id, methods }, requestOptions) {
|
|
432
486
|
validateRequired("id", "getABTest", id);
|
|
433
487
|
const requestPath = "/3/abtests/{id}".replace("{id}", encodeURIComponent(id));
|
|
434
488
|
const headers = {};
|
|
435
489
|
const queryParameters = {};
|
|
490
|
+
if (methods !== void 0) {
|
|
491
|
+
queryParameters["methods"] = methods.toString();
|
|
492
|
+
}
|
|
436
493
|
const request = {
|
|
437
494
|
method: "GET",
|
|
438
495
|
path: requestPath,
|
|
@@ -450,14 +507,65 @@ function createAbtestingV3Client({
|
|
|
450
507
|
* - analytics
|
|
451
508
|
* @param getABTest - The getABTest object.
|
|
452
509
|
* @param getABTest.id - Unique A/B test identifier.
|
|
510
|
+
* @param getABTest.methods - Statistical analysis results to include, as a comma-separated list. When omitted, each test uses its configured method, or `frequentist` if no method is configured. Request both methods to include both sets of available results. This doesn\'t change the test configuration or compute missing results. Duplicate values aren\'t allowed.
|
|
453
511
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
454
512
|
* @see getABTest for the plain version.
|
|
455
513
|
*/
|
|
456
|
-
getABTestWithHTTPInfo({ id }, requestOptions) {
|
|
514
|
+
getABTestWithHTTPInfo({ id, methods }, requestOptions) {
|
|
457
515
|
validateRequired("id", "getABTestWithHTTPInfo", id);
|
|
458
516
|
const requestPath = "/3/abtests/{id}".replace("{id}", encodeURIComponent(id));
|
|
459
517
|
const headers = {};
|
|
460
518
|
const queryParameters = {};
|
|
519
|
+
if (methods !== void 0) {
|
|
520
|
+
queryParameters["methods"] = methods.toString();
|
|
521
|
+
}
|
|
522
|
+
const request = {
|
|
523
|
+
method: "GET",
|
|
524
|
+
path: requestPath,
|
|
525
|
+
queryParameters,
|
|
526
|
+
headers
|
|
527
|
+
};
|
|
528
|
+
return transporter.requestWithHttpInfo(request, requestOptions);
|
|
529
|
+
},
|
|
530
|
+
/**
|
|
531
|
+
* Retrieves the settings captured for each variant of an A/B test, and whether another active A/B test is using the control index. Settings are captured by the `saveVariantSettings` operation. The response includes an entry for the control (variant 1) alongside the captured variant, so the control\'s original configuration can be restored later. Returns `404` if the A/B test doesn\'t exist or no settings have been captured for it.
|
|
532
|
+
*
|
|
533
|
+
* Required API Key ACLs:
|
|
534
|
+
* - analytics
|
|
535
|
+
* @param getABTestSettings - The getABTestSettings object.
|
|
536
|
+
* @param getABTestSettings.id - Unique A/B test identifier.
|
|
537
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
538
|
+
*/
|
|
539
|
+
getABTestSettings({ id }, requestOptions) {
|
|
540
|
+
validateRequired("id", "getABTestSettings", id);
|
|
541
|
+
const requestPath = "/3/abtests/{id}/settings".replace("{id}", encodeURIComponent(id));
|
|
542
|
+
const headers = {};
|
|
543
|
+
const queryParameters = {};
|
|
544
|
+
const request = {
|
|
545
|
+
method: "GET",
|
|
546
|
+
path: requestPath,
|
|
547
|
+
queryParameters,
|
|
548
|
+
headers
|
|
549
|
+
};
|
|
550
|
+
return transporter.request(request, requestOptions);
|
|
551
|
+
},
|
|
552
|
+
/**
|
|
553
|
+
* Retrieves the settings captured for each variant of an A/B test, and whether another active A/B test is using the control index. Settings are captured by the `saveVariantSettings` operation. The response includes an entry for the control (variant 1) alongside the captured variant, so the control\'s original configuration can be restored later. Returns `404` if the A/B test doesn\'t exist or no settings have been captured for it.
|
|
554
|
+
*
|
|
555
|
+
* 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.
|
|
556
|
+
*
|
|
557
|
+
* Required API Key ACLs:
|
|
558
|
+
* - analytics
|
|
559
|
+
* @param getABTestSettings - The getABTestSettings object.
|
|
560
|
+
* @param getABTestSettings.id - Unique A/B test identifier.
|
|
561
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
562
|
+
* @see getABTestSettings for the plain version.
|
|
563
|
+
*/
|
|
564
|
+
getABTestSettingsWithHTTPInfo({ id }, requestOptions) {
|
|
565
|
+
validateRequired("id", "getABTestSettingsWithHTTPInfo", id);
|
|
566
|
+
const requestPath = "/3/abtests/{id}/settings".replace("{id}", encodeURIComponent(id));
|
|
567
|
+
const headers = {};
|
|
568
|
+
const queryParameters = {};
|
|
461
569
|
const request = {
|
|
462
570
|
method: "GET",
|
|
463
571
|
path: requestPath,
|
|
@@ -475,10 +583,11 @@ function createAbtestingV3Client({
|
|
|
475
583
|
* @param getTimeseries.id - Unique A/B test identifier.
|
|
476
584
|
* @param getTimeseries.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
|
|
477
585
|
* @param getTimeseries.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
|
|
478
|
-
* @param getTimeseries.metric -
|
|
586
|
+
* @param getTimeseries.metric - Metrics to retrieve, as a comma-separated list. If not specified, all metrics are returned.
|
|
587
|
+
* @param getTimeseries.methods - Statistical analysis results to include, as a comma-separated list. When omitted, each test uses its configured method, or `frequentist` if no method is configured. Request both methods to include both sets of available results. This doesn\'t change the test configuration or compute missing results. Duplicate values aren\'t allowed.
|
|
479
588
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
480
589
|
*/
|
|
481
|
-
getTimeseries({ id, startDate, endDate, metric }, requestOptions) {
|
|
590
|
+
getTimeseries({ id, startDate, endDate, metric, methods }, requestOptions) {
|
|
482
591
|
validateRequired("id", "getTimeseries", id);
|
|
483
592
|
const requestPath = "/3/abtests/{id}/timeseries".replace("{id}", encodeURIComponent(id));
|
|
484
593
|
const headers = {};
|
|
@@ -492,6 +601,9 @@ function createAbtestingV3Client({
|
|
|
492
601
|
if (metric !== void 0) {
|
|
493
602
|
queryParameters["metric"] = metric.toString();
|
|
494
603
|
}
|
|
604
|
+
if (methods !== void 0) {
|
|
605
|
+
queryParameters["methods"] = methods.toString();
|
|
606
|
+
}
|
|
495
607
|
const request = {
|
|
496
608
|
method: "GET",
|
|
497
609
|
path: requestPath,
|
|
@@ -511,11 +623,12 @@ function createAbtestingV3Client({
|
|
|
511
623
|
* @param getTimeseries.id - Unique A/B test identifier.
|
|
512
624
|
* @param getTimeseries.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
|
|
513
625
|
* @param getTimeseries.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
|
|
514
|
-
* @param getTimeseries.metric -
|
|
626
|
+
* @param getTimeseries.metric - Metrics to retrieve, as a comma-separated list. If not specified, all metrics are returned.
|
|
627
|
+
* @param getTimeseries.methods - Statistical analysis results to include, as a comma-separated list. When omitted, each test uses its configured method, or `frequentist` if no method is configured. Request both methods to include both sets of available results. This doesn\'t change the test configuration or compute missing results. Duplicate values aren\'t allowed.
|
|
515
628
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
516
629
|
* @see getTimeseries for the plain version.
|
|
517
630
|
*/
|
|
518
|
-
getTimeseriesWithHTTPInfo({ id, startDate, endDate, metric }, requestOptions) {
|
|
631
|
+
getTimeseriesWithHTTPInfo({ id, startDate, endDate, metric, methods }, requestOptions) {
|
|
519
632
|
validateRequired("id", "getTimeseriesWithHTTPInfo", id);
|
|
520
633
|
const requestPath = "/3/abtests/{id}/timeseries".replace("{id}", encodeURIComponent(id));
|
|
521
634
|
const headers = {};
|
|
@@ -529,6 +642,9 @@ function createAbtestingV3Client({
|
|
|
529
642
|
if (metric !== void 0) {
|
|
530
643
|
queryParameters["metric"] = metric.toString();
|
|
531
644
|
}
|
|
645
|
+
if (methods !== void 0) {
|
|
646
|
+
queryParameters["methods"] = methods.toString();
|
|
647
|
+
}
|
|
532
648
|
const request = {
|
|
533
649
|
method: "GET",
|
|
534
650
|
path: requestPath,
|
|
@@ -548,9 +664,10 @@ function createAbtestingV3Client({
|
|
|
548
664
|
* @param listABTests.indexPrefix - Index name prefix. Only A/B tests for indices starting with this string are included in the response.
|
|
549
665
|
* @param listABTests.indexSuffix - Index name suffix. Only A/B tests for indices ending with this string are included in the response.
|
|
550
666
|
* @param listABTests.direction - Sort order for A/B tests by start date. Use \'asc\' for ascending or \'desc\' for descending. Active A/B tests are always listed first.
|
|
667
|
+
* @param listABTests.methods - Statistical analysis results to include, as a comma-separated list. When omitted, each test uses its configured method, or `frequentist` if no method is configured. Request both methods to include both sets of available results. This doesn\'t change the test configuration or compute missing results. Duplicate values aren\'t allowed.
|
|
551
668
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
552
669
|
*/
|
|
553
|
-
listABTests({ offset, limit, indexPrefix, indexSuffix, direction } = {}, requestOptions = void 0) {
|
|
670
|
+
listABTests({ offset, limit, indexPrefix, indexSuffix, direction, methods } = {}, requestOptions = void 0) {
|
|
554
671
|
const requestPath = "/3/abtests";
|
|
555
672
|
const headers = {};
|
|
556
673
|
const queryParameters = {};
|
|
@@ -569,6 +686,9 @@ function createAbtestingV3Client({
|
|
|
569
686
|
if (direction !== void 0) {
|
|
570
687
|
queryParameters["direction"] = direction.toString();
|
|
571
688
|
}
|
|
689
|
+
if (methods !== void 0) {
|
|
690
|
+
queryParameters["methods"] = methods.toString();
|
|
691
|
+
}
|
|
572
692
|
const request = {
|
|
573
693
|
method: "GET",
|
|
574
694
|
path: requestPath,
|
|
@@ -590,10 +710,11 @@ function createAbtestingV3Client({
|
|
|
590
710
|
* @param listABTests.indexPrefix - Index name prefix. Only A/B tests for indices starting with this string are included in the response.
|
|
591
711
|
* @param listABTests.indexSuffix - Index name suffix. Only A/B tests for indices ending with this string are included in the response.
|
|
592
712
|
* @param listABTests.direction - Sort order for A/B tests by start date. Use \'asc\' for ascending or \'desc\' for descending. Active A/B tests are always listed first.
|
|
713
|
+
* @param listABTests.methods - Statistical analysis results to include, as a comma-separated list. When omitted, each test uses its configured method, or `frequentist` if no method is configured. Request both methods to include both sets of available results. This doesn\'t change the test configuration or compute missing results. Duplicate values aren\'t allowed.
|
|
593
714
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
594
715
|
* @see listABTests for the plain version.
|
|
595
716
|
*/
|
|
596
|
-
listABTestsWithHTTPInfo({ offset, limit, indexPrefix, indexSuffix, direction } = {}, requestOptions = void 0) {
|
|
717
|
+
listABTestsWithHTTPInfo({ offset, limit, indexPrefix, indexSuffix, direction, methods } = {}, requestOptions = void 0) {
|
|
597
718
|
const requestPath = "/3/abtests";
|
|
598
719
|
const headers = {};
|
|
599
720
|
const queryParameters = {};
|
|
@@ -612,6 +733,9 @@ function createAbtestingV3Client({
|
|
|
612
733
|
if (direction !== void 0) {
|
|
613
734
|
queryParameters["direction"] = direction.toString();
|
|
614
735
|
}
|
|
736
|
+
if (methods !== void 0) {
|
|
737
|
+
queryParameters["methods"] = methods.toString();
|
|
738
|
+
}
|
|
615
739
|
const request = {
|
|
616
740
|
method: "GET",
|
|
617
741
|
path: requestPath,
|
|
@@ -620,6 +744,65 @@ function createAbtestingV3Client({
|
|
|
620
744
|
};
|
|
621
745
|
return transporter.requestWithHttpInfo(request, requestOptions);
|
|
622
746
|
},
|
|
747
|
+
/**
|
|
748
|
+
* Captures the settings of the given variant and of the control, then stops the A/B test. The captured settings can later be applied to the control index with the `applyVariantSettings` operation, and read back with the `getABTestSettings` operation. The A/B test must have reached 80% of its planned duration. Earlier requests return `400`. Settings can only be captured once per A/B test. A second request returns `409`. `synonyms` and `enableRules` are not captured, so applying the captured settings never changes them on the control index.
|
|
749
|
+
*
|
|
750
|
+
* Required API Key ACLs:
|
|
751
|
+
* - analytics
|
|
752
|
+
* - editSettings
|
|
753
|
+
* @param saveVariantSettings - The saveVariantSettings object.
|
|
754
|
+
* @param saveVariantSettings.id - Unique A/B test identifier.
|
|
755
|
+
* @param saveVariantSettings.variantId - One-based index of the A/B test variant. The control is variant 1.
|
|
756
|
+
* @param saveVariantSettings.saveSettingsRequest - The saveSettingsRequest object.
|
|
757
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
758
|
+
*/
|
|
759
|
+
saveVariantSettings({ id, variantId, saveSettingsRequest }, requestOptions) {
|
|
760
|
+
validateRequired("id", "saveVariantSettings", id);
|
|
761
|
+
validateRequired("variantId", "saveVariantSettings", variantId);
|
|
762
|
+
validateRequired("saveSettingsRequest", "saveVariantSettings", saveSettingsRequest);
|
|
763
|
+
const requestPath = "/3/abtests/{id}/settings/{variantId}".replace("{id}", encodeURIComponent(id)).replace("{variantId}", encodeURIComponent(variantId));
|
|
764
|
+
const headers = {};
|
|
765
|
+
const queryParameters = {};
|
|
766
|
+
const request = {
|
|
767
|
+
method: "POST",
|
|
768
|
+
path: requestPath,
|
|
769
|
+
queryParameters,
|
|
770
|
+
headers,
|
|
771
|
+
data: saveSettingsRequest
|
|
772
|
+
};
|
|
773
|
+
return transporter.request(request, requestOptions);
|
|
774
|
+
},
|
|
775
|
+
/**
|
|
776
|
+
* Captures the settings of the given variant and of the control, then stops the A/B test. The captured settings can later be applied to the control index with the `applyVariantSettings` operation, and read back with the `getABTestSettings` operation. The A/B test must have reached 80% of its planned duration. Earlier requests return `400`. Settings can only be captured once per A/B test. A second request returns `409`. `synonyms` and `enableRules` are not captured, so applying the captured settings never changes them on the control index.
|
|
777
|
+
*
|
|
778
|
+
* 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.
|
|
779
|
+
*
|
|
780
|
+
* Required API Key ACLs:
|
|
781
|
+
* - analytics
|
|
782
|
+
* - editSettings
|
|
783
|
+
* @param saveVariantSettings - The saveVariantSettings object.
|
|
784
|
+
* @param saveVariantSettings.id - Unique A/B test identifier.
|
|
785
|
+
* @param saveVariantSettings.variantId - One-based index of the A/B test variant. The control is variant 1.
|
|
786
|
+
* @param saveVariantSettings.saveSettingsRequest - The saveSettingsRequest object.
|
|
787
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
788
|
+
* @see saveVariantSettings for the plain version.
|
|
789
|
+
*/
|
|
790
|
+
saveVariantSettingsWithHTTPInfo({ id, variantId, saveSettingsRequest }, requestOptions) {
|
|
791
|
+
validateRequired("id", "saveVariantSettingsWithHTTPInfo", id);
|
|
792
|
+
validateRequired("variantId", "saveVariantSettingsWithHTTPInfo", variantId);
|
|
793
|
+
validateRequired("saveSettingsRequest", "saveVariantSettingsWithHTTPInfo", saveSettingsRequest);
|
|
794
|
+
const requestPath = "/3/abtests/{id}/settings/{variantId}".replace("{id}", encodeURIComponent(id)).replace("{variantId}", encodeURIComponent(variantId));
|
|
795
|
+
const headers = {};
|
|
796
|
+
const queryParameters = {};
|
|
797
|
+
const request = {
|
|
798
|
+
method: "POST",
|
|
799
|
+
path: requestPath,
|
|
800
|
+
queryParameters,
|
|
801
|
+
headers,
|
|
802
|
+
data: saveSettingsRequest
|
|
803
|
+
};
|
|
804
|
+
return transporter.requestWithHttpInfo(request, requestOptions);
|
|
805
|
+
},
|
|
623
806
|
/**
|
|
624
807
|
* Stops an A/B test by its ID. You can\'t restart stopped A/B tests.
|
|
625
808
|
*
|