Socket
Socket
Sign inDemoInstall

@algolia/client-abtesting

Package Overview
Dependencies
Maintainers
85
Versions
153
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@algolia/client-abtesting - npm Package Compare versions

Comparing version 5.7.0 to 5.8.0

139

dist/browser.d.ts

@@ -52,3 +52,3 @@ import * as _algolia_client_common from '@algolia/client-common';

*/
type Status = 'active' | 'expired' | 'failed' | 'stopped';
type Status = 'active' | 'stopped' | 'expired' | 'failed';

@@ -142,3 +142,5 @@ type Currency = {

*/
currencies?: Record<string, Currency>;
currencies?: {
[key: string]: Currency;
};
/**

@@ -200,3 +202,5 @@ * Description for this variant.

purchaseSignificance?: number | null;
revenueSignificance?: Record<string, number> | null;
revenueSignificance?: {
[key: string]: number;
} | null;
/**

@@ -222,3 +226,3 @@ * Date and time when the A/B test was last updated, in RFC 3339 format.

*/
variants: Variant[];
variants: Array<Variant>;
configuration?: ABTestConfiguration;

@@ -276,3 +280,3 @@ };

*/
variants: AddABTestsVariant[];
variants: Array<AddABTestsVariant>;
/**

@@ -284,2 +288,43 @@ * End date and time of the A/B test, in RFC 3339 format.

type ListABTestsResponse = {
/**
* A/B tests.
*/
abtests: Array<ABTest> | null;
/**
* Number of A/B tests.
*/
count: number;
/**
* Number of retrievable A/B tests.
*/
total: number;
};
type ScheduleABTestResponse = {
/**
* Unique scheduled A/B test identifier.
*/
abTestScheduleID: number;
};
type ScheduleABTestsRequest = {
/**
* A/B test name.
*/
name: string;
/**
* A/B test variants.
*/
variants: Array<AddABTestsVariant>;
/**
* Date and time when the A/B test is scheduled to start, in RFC 3339 format.
*/
scheduledAt: string;
/**
* End date and time of the A/B test, in RFC 3339 format.
*/
endAt: string;
};
/**

@@ -296,3 +341,5 @@ * Properties for the `customDelete` method.

*/
parameters?: Record<string, any>;
parameters?: {
[key: string]: any;
};
};

@@ -310,3 +357,5 @@ /**

*/
parameters?: Record<string, any>;
parameters?: {
[key: string]: any;
};
};

@@ -324,3 +373,5 @@ /**

*/
parameters?: Record<string, any>;
parameters?: {
[key: string]: any;
};
/**

@@ -342,3 +393,5 @@ * Parameters to send with the custom request.

*/
parameters?: Record<string, any>;
parameters?: {
[key: string]: any;
};
/**

@@ -398,44 +451,3 @@ * Parameters to send with the custom request.

type ListABTestsResponse = {
/**
* A/B tests.
*/
abtests: ABTest[] | null;
/**
* Number of A/B tests.
*/
count: number;
/**
* Number of retrievable A/B tests.
*/
total: number;
};
type ScheduleABTestResponse = {
/**
* Unique scheduled A/B test identifier.
*/
abTestScheduleID: number;
};
type ScheduleABTestsRequest = {
/**
* A/B test name.
*/
name: string;
/**
* A/B test variants.
*/
variants: AddABTestsVariant[];
/**
* Date and time when the A/B test is scheduled to start, in RFC 3339 format.
*/
scheduledAt: string;
/**
* End date and time of the A/B test, in RFC 3339 format.
*/
endAt: string;
};
declare const apiClientVersion = "5.7.0";
declare const apiClientVersion = "5.8.0";
declare const REGIONS: readonly ["de", "us"];

@@ -479,4 +491,3 @@ type Region = (typeof REGIONS)[number];

* Required API Key ACLs:
* - editSettings.
*
* - editSettings
* @param addABTestsRequest - The addABTestsRequest object.

@@ -488,3 +499,2 @@ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.

* This method allow you to send requests to the Algolia REST API.
*
* @param customDelete - The customDelete object.

@@ -498,3 +508,2 @@ * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.

* This method allow you to send requests to the Algolia REST API.
*
* @param customGet - The customGet object.

@@ -508,3 +517,2 @@ * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.

* This method allow you to send requests to the Algolia REST API.
*
* @param customPost - The customPost object.

@@ -519,3 +527,2 @@ * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.

* This method allow you to send requests to the Algolia REST API.
*
* @param customPut - The customPut object.

@@ -532,4 +539,3 @@ * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.

* Required API Key ACLs:
* - editSettings.
*
* - editSettings
* @param deleteABTest - The deleteABTest object.

@@ -544,4 +550,3 @@ * @param deleteABTest.id - Unique A/B test identifier.

* Required API Key ACLs:
* - analytics.
*
* - analytics
* @param getABTest - The getABTest object.

@@ -556,4 +561,3 @@ * @param getABTest.id - Unique A/B test identifier.

* Required API Key ACLs:
* - analytics.
*
* - analytics
* @param listABTests - The listABTests object.

@@ -571,4 +575,3 @@ * @param listABTests.offset - Position of the first item to return.

* Required API Key ACLs:
* - editSettings.
*
* - editSettings
* @param scheduleABTestsRequest - The scheduleABTestsRequest object.

@@ -582,4 +585,3 @@ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.

* Required API Key ACLs:
* - editSettings.
*
* - editSettings
* @param stopABTest - The stopABTest object.

@@ -599,6 +601,5 @@ * @param stopABTest.id - Unique A/B test identifier.

declare function abtestingClient(appId: string, apiKey: string, region?: Region, options?: ClientOptions): AbtestingClient;
type AbtestingClient = ReturnType<typeof createAbtestingClient>;
declare function abtestingClient(appId: string, apiKey: string, region?: Region, options?: ClientOptions): AbtestingClient;
export { type ABTest, type ABTestConfiguration, type ABTestResponse, type AbTestsVariant, type AbTestsVariantSearchParams, type AbtestingClient, type AddABTestsRequest, type AddABTestsVariant, type Currency, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type CustomSearchParams, type DeleteABTestProps, type Effect, type EmptySearch, type EmptySearchFilter, type ErrorBase, type FilterEffects, type GetABTestProps, type ListABTestsProps, type ListABTestsResponse, type MinimumDetectableEffect, type Outliers, type OutliersFilter, type Region, type ScheduleABTestResponse, type ScheduleABTestsRequest, type Status, type StopABTestProps, type Variant, abtestingClient, apiClientVersion };
// builds/browser.ts
import { createXhrRequester } from "@algolia/requester-browser-xhr";
import {
createBrowserLocalStorageCache,
createFallbackableCache,
createMemoryCache,
createNullLogger,
createMemoryCache,
createFallbackableCache,
createBrowserLocalStorageCache,
DEFAULT_CONNECT_TIMEOUT_BROWSER,

@@ -11,7 +12,6 @@ DEFAULT_READ_TIMEOUT_BROWSER,

} from "@algolia/client-common";
import { createXhrRequester } from "@algolia/requester-browser-xhr";
// src/abtestingClient.ts
import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common";
var apiClientVersion = "5.7.0";
var apiClientVersion = "5.8.0";
var REGIONS = ["de", "us"];

@@ -93,4 +93,3 @@ function getDefaultHosts(region) {

* Required API Key ACLs:
* - editSettings.
*
* - editSettings
* @param addABTestsRequest - The addABTestsRequest object.

@@ -126,3 +125,2 @@ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.

* This method allow you to send requests to the Algolia REST API.
*
* @param customDelete - The customDelete object.

@@ -150,3 +148,2 @@ * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.

* This method allow you to send requests to the Algolia REST API.
*
* @param customGet - The customGet object.

@@ -174,3 +171,2 @@ * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.

* This method allow you to send requests to the Algolia REST API.
*
* @param customPost - The customPost object.

@@ -200,3 +196,2 @@ * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.

* This method allow you to send requests to the Algolia REST API.
*
* @param customPut - The customPut object.

@@ -228,4 +223,3 @@ * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.

* Required API Key ACLs:
* - editSettings.
*
* - editSettings
* @param deleteABTest - The deleteABTest object.

@@ -254,4 +248,3 @@ * @param deleteABTest.id - Unique A/B test identifier.

* Required API Key ACLs:
* - analytics.
*
* - analytics
* @param getABTest - The getABTest object.

@@ -280,4 +273,3 @@ * @param getABTest.id - Unique A/B test identifier.

* Required API Key ACLs:
* - analytics.
*
* - analytics
* @param listABTests - The listABTests object.

@@ -295,12 +287,12 @@ * @param listABTests.offset - Position of the first item to return.

if (offset !== void 0) {
queryParameters.offset = offset.toString();
queryParameters["offset"] = offset.toString();
}
if (limit !== void 0) {
queryParameters.limit = limit.toString();
queryParameters["limit"] = limit.toString();
}
if (indexPrefix !== void 0) {
queryParameters.indexPrefix = indexPrefix.toString();
queryParameters["indexPrefix"] = indexPrefix.toString();
}
if (indexSuffix !== void 0) {
queryParameters.indexSuffix = indexSuffix.toString();
queryParameters["indexSuffix"] = indexSuffix.toString();
}

@@ -319,4 +311,3 @@ const request = {

* Required API Key ACLs:
* - editSettings.
*
* - editSettings
* @param scheduleABTestsRequest - The scheduleABTestsRequest object.

@@ -357,4 +348,3 @@ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.

* Required API Key ACLs:
* - editSettings.
*
* - editSettings
* @param stopABTest - The stopABTest object.

@@ -361,0 +351,0 @@ * @param stopABTest.id - Unique A/B test identifier.

@@ -1,2 +0,2 @@

function W(t){let e,s=`algolia-client-js-${t.key}`;function r(){return e===void 0&&(e=t.localStorage||window.localStorage),e}function i(){return JSON.parse(r().getItem(s)||"{}")}function m(a){r().setItem(s,JSON.stringify(a))}function p(){let a=t.timeToLive?t.timeToLive*1e3:null,o=i(),n=Object.fromEntries(Object.entries(o).filter(([,d])=>d.timestamp!==void 0));if(m(n),!a)return;let u=Object.fromEntries(Object.entries(n).filter(([,d])=>{let P=new Date().getTime();return!(d.timestamp+a<P)}));m(u)}return{get(a,o,n={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(p(),i()[JSON.stringify(a)])).then(u=>Promise.all([u?u.value:o(),u!==void 0])).then(([u,d])=>Promise.all([u,d||n.miss(u)])).then(([u])=>u)},set(a,o){return Promise.resolve().then(()=>{let n=i();return n[JSON.stringify(a)]={timestamp:new Date().getTime(),value:o},r().setItem(s,JSON.stringify(n)),o})},delete(a){return Promise.resolve().then(()=>{let o=i();delete o[JSON.stringify(a)],r().setItem(s,JSON.stringify(o))})},clear(){return Promise.resolve().then(()=>{r().removeItem(s)})}}}function ee(){return{get(t,e,s={miss:()=>Promise.resolve()}){return e().then(i=>Promise.all([i,s.miss(i)])).then(([i])=>i)},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?ee():{get(r,i,m={miss:()=>Promise.resolve()}){return s.get(r,i,m).catch(()=>q({caches:e}).get(r,i,m))},set(r,i){return s.set(r,i).catch(()=>q({caches:e}).set(r,i))},delete(r){return s.delete(r).catch(()=>q({caches:e}).delete(r))},clear(){return s.clear().catch(()=>q({caches:e}).clear())}}}function O(t={serializable:!0}){let e={};return{get(s,r,i={miss:()=>Promise.resolve()}){let m=JSON.stringify(s);if(m in e)return Promise.resolve(t.serializable?JSON.parse(e[m]):e[m]);let p=r();return p.then(a=>i.miss(a)).then(()=>p)},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()}}}var $=1e3,j=2e3,J=3e4;function te(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 Q(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 G({algoliaAgents:t,client:e,version:s}){let r=te(s).add({segment:e,version:s});return t.forEach(i=>r.add(i)),r}function M(){return{debug(t,e){return Promise.resolve()},info(t,e){return Promise.resolve()},error(t,e){return Promise.resolve()}}}var k=2*60*1e3;function H(t,e="up"){let s=Date.now();function r(){return e==="up"||Date.now()-s>k}function i(){return e==="timed out"&&Date.now()-s<=k}return{...t,status:e,lastUpdate:s,isUp:r,isTimedOut:i}}var z=class extends Error{name="AlgoliaError";constructor(t,e){super(t),e&&(this.name=e)}},F=class extends z{stackTrace;constructor(t,e,s){super(t,s),this.stackTrace=e}},re=class extends F{constructor(t){super("Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.",t,"RetryError")}},C=class extends F{status;constructor(t,e,s,r="ApiError"){super(t,s,r),this.status=e}},se=class extends z{response;constructor(t,e){super(t,"DeserializationError"),this.response=e}},oe=class extends C{error;constructor(t,e,s,r){super(t,e,r,"DetailedApiError"),this.error=s}};function ae(t,e,s){let r=ne(s),i=`${t.protocol}://${t.url}${t.port?`:${t.port}`:""}/${e.charAt(0)==="/"?e.substring(1):e}`;return r.length&&(i+=`?${r}`),i}function ne(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]).replaceAll("+","%20")}`).join("&")}function ie(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 ce(t,e,s){let r={Accept:"application/json",...t,...e,...s},i={};return Object.keys(r).forEach(m=>{let p=r[m];i[m.toLowerCase()]=p}),i}function ue(t){try{return JSON.parse(t.content)}catch(e){throw new se(e.message,t)}}function le({content:t,status:e},s){try{let r=JSON.parse(t);return"error"in r?new oe(r.message,e,r.error,s):new C(r.message,e,s)}catch{}return new C(t,e,s)}function me({isTimedOut:t,status:e}){return!t&&~~e===0}function de({isTimedOut:t,status:e}){return t||me({isTimedOut:t,status:e})||~~(e/100)!==2&&~~(e/100)!==4}function he({status:t}){return~~(t/100)===2}function pe(t){return t.map(e=>X(e))}function X(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 K({hosts:t,hostsCache:e,baseHeaders:s,logger:r,baseQueryParameters:i,algoliaAgent:m,timeouts:p,requester:a,requestsCache:o,responsesCache:n}){async function u(c){let l=await Promise.all(c.map(h=>e.get(h,()=>Promise.resolve(H(h))))),f=l.filter(h=>h.isUp()),T=l.filter(h=>h.isTimedOut()),w=[...f,...T];return{hosts:w.length>0?w:c,getTimeout(h,A){return(T.length===0&&h===0?1:T.length+3+h)*A}}}async function d(c,l,f=!0){let T=[],w=ie(c,l),y=ce(s,c.headers,l.headers),h=c.method==="GET"?{...c.data,...l.data}:{},A={...i,...c.queryParameters,...h};if(m.value&&(A["x-algolia-agent"]=m.value),l&&l.queryParameters)for(let g of Object.keys(l.queryParameters))!l.queryParameters[g]||Object.prototype.toString.call(l.queryParameters[g])==="[object Object]"?A[g]=l.queryParameters[g]:A[g]=l.queryParameters[g].toString();let v=0,N=async(g,b)=>{let R=g.pop();if(R===void 0)throw new re(pe(T));let B={...p,...l.timeouts},I={data:w,headers:y,method:c.method,url:ae(R,c.path,A),connectTimeout:b(v,B.connect),responseTimeout:b(v,f?B.read:B.write)},U=x=>{let L={request:I,response:x,host:R,triesLeft:g.length};return T.push(L),L},E=await a.send(I);if(de(E)){let x=U(E);return E.isTimedOut&&v++,r.info("Retryable failure",X(x)),await e.set(R,H(R,E.isTimedOut?"timed out":"down")),N(g,b)}if(he(E))return ue(E);throw U(E),le(E,T)},Z=t.filter(g=>g.accept==="readWrite"||(f?g.accept==="read":g.accept==="write")),D=await u(Z);return N([...D.hosts].reverse(),D.getTimeout)}function P(c,l={}){let f=c.useReadTransporter||c.method==="GET";if(!f)return d(c,l,f);let T=()=>d(c,l);if((l.cacheable||c.cacheable)!==!0)return T();let y={request:c,requestOptions:l,transporter:{queryParameters:i,headers:s}};return n.get(y,()=>o.get(y,()=>o.set(y,T()).then(h=>Promise.all([o.delete(y),h]),h=>Promise.all([o.delete(y),Promise.reject(h)])).then(([h,A])=>A)),{miss:h=>n.set(y,h)})}return{hostsCache:e,requester:a,timeouts:p,logger:r,algoliaAgent:m,baseHeaders:s,baseQueryParameters:i,hosts:t,request:P,requestsCache:o,responsesCache:n}}function V(){function t(e){return new Promise(s=>{let r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach(a=>r.setRequestHeader(a,e.headers[a]));let i=(a,o)=>setTimeout(()=>{r.abort(),s({status:0,content:o,isTimedOut:!0})},a),m=i(e.connectTimeout,"Connection timeout"),p;r.onreadystatechange=()=>{r.readyState>r.OPENED&&p===void 0&&(clearTimeout(m),p=i(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{r.status===0&&(clearTimeout(m),clearTimeout(p),s({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(m),clearTimeout(p),s({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)})}return{send:t}}var S="5.7.0",_=["de","us"];function fe(t){return[{url:t?"analytics.{region}.algolia.com".replace("{region}",t):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]}function Y({appId:t,apiKey:e,authMode:s,algoliaAgents:r,region:i,...m}){let p=Q(t,e,s),a=K({hosts:fe(i),...m,algoliaAgent:G({algoliaAgents:r,client:"Abtesting",version:S}),baseHeaders:{"content-type":"text/plain",...p.headers(),...m.baseHeaders},baseQueryParameters:{...p.queryParameters(),...m.baseQueryParameters}});return{transporter:a,appId:t,clearCache(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then(()=>{})},get _ua(){return a.algoliaAgent.value},addAlgoliaAgent(o,n){a.algoliaAgent.add({segment:o,version:n})},setClientApiKey({apiKey:o}){!s||s==="WithinHeaders"?a.baseHeaders["x-algolia-api-key"]=o:a.baseQueryParameters["x-algolia-api-key"]=o},addABTests(o,n){if(!o)throw new Error("Parameter `addABTestsRequest` is required when calling `addABTests`.");if(!o.name)throw new Error("Parameter `addABTestsRequest.name` is required when calling `addABTests`.");if(!o.variants)throw new Error("Parameter `addABTestsRequest.variants` is required when calling `addABTests`.");if(!o.endAt)throw new Error("Parameter `addABTestsRequest.endAt` is required when calling `addABTests`.");let c={method:"POST",path:"/2/abtests",queryParameters:{},headers:{},data:o};return a.request(c,n)},customDelete({path:o,parameters:n},u){if(!o)throw new Error("Parameter `path` is required when calling `customDelete`.");let l={method:"DELETE",path:"/{path}".replace("{path}",o),queryParameters:n||{},headers:{}};return a.request(l,u)},customGet({path:o,parameters:n},u){if(!o)throw new Error("Parameter `path` is required when calling `customGet`.");let l={method:"GET",path:"/{path}".replace("{path}",o),queryParameters:n||{},headers:{}};return a.request(l,u)},customPost({path:o,parameters:n,body:u},d){if(!o)throw new Error("Parameter `path` is required when calling `customPost`.");let f={method:"POST",path:"/{path}".replace("{path}",o),queryParameters:n||{},headers:{},data:u||{}};return a.request(f,d)},customPut({path:o,parameters:n,body:u},d){if(!o)throw new Error("Parameter `path` is required when calling `customPut`.");let f={method:"PUT",path:"/{path}".replace("{path}",o),queryParameters:n||{},headers:{},data:u||{}};return a.request(f,d)},deleteABTest({id:o},n){if(!o)throw new Error("Parameter `id` is required when calling `deleteABTest`.");let c={method:"DELETE",path:"/2/abtests/{id}".replace("{id}",encodeURIComponent(o)),queryParameters:{},headers:{}};return a.request(c,n)},getABTest({id:o},n){if(!o)throw new Error("Parameter `id` is required when calling `getABTest`.");let c={method:"GET",path:"/2/abtests/{id}".replace("{id}",encodeURIComponent(o)),queryParameters:{},headers:{}};return a.request(c,n)},listABTests({offset:o,limit:n,indexPrefix:u,indexSuffix:d}={},P=void 0){let c="/2/abtests",l={},f={};o!==void 0&&(f.offset=o.toString()),n!==void 0&&(f.limit=n.toString()),u!==void 0&&(f.indexPrefix=u.toString()),d!==void 0&&(f.indexSuffix=d.toString());let T={method:"GET",path:c,queryParameters:f,headers:l};return a.request(T,P)},scheduleABTest(o,n){if(!o)throw new Error("Parameter `scheduleABTestsRequest` is required when calling `scheduleABTest`.");if(!o.name)throw new Error("Parameter `scheduleABTestsRequest.name` is required when calling `scheduleABTest`.");if(!o.variants)throw new Error("Parameter `scheduleABTestsRequest.variants` is required when calling `scheduleABTest`.");if(!o.scheduledAt)throw new Error("Parameter `scheduleABTestsRequest.scheduledAt` is required when calling `scheduleABTest`.");if(!o.endAt)throw new Error("Parameter `scheduleABTestsRequest.endAt` is required when calling `scheduleABTest`.");let c={method:"POST",path:"/2/abtests/schedule",queryParameters:{},headers:{},data:o};return a.request(c,n)},stopABTest({id:o},n){if(!o)throw new Error("Parameter `id` is required when calling `stopABTest`.");let c={method:"POST",path:"/2/abtests/{id}/stop".replace("{id}",encodeURIComponent(o)),queryParameters:{},headers:{}};return a.request(c,n)}}}function Ye(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&&(typeof s!="string"||!_.includes(s)))throw new Error(`\`region\` must be one of the following: ${_.join(", ")}`);return Y({appId:t,apiKey:e,region:s,timeouts:{connect:$,read:j,write:J},logger:M(),requester:V(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:O(),requestsCache:O({serializable:!1}),hostsCache:q({caches:[W({key:`${S}-${t}`}),O()]}),...r})}export{Ye as abtestingClient,S as apiClientVersion};
function k(){function t(e){return new Promise(s=>{let r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach(a=>r.setRequestHeader(a,e.headers[a]));let i=(a,o)=>setTimeout(()=>{r.abort(),s({status:0,content:o,isTimedOut:!0})},a),m=i(e.connectTimeout,"Connection timeout"),p;r.onreadystatechange=()=>{r.readyState>r.OPENED&&p===void 0&&(clearTimeout(m),p=i(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{r.status===0&&(clearTimeout(m),clearTimeout(p),s({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(m),clearTimeout(p),s({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)})}return{send:t}}function $(t){let e,s=`algolia-client-js-${t.key}`;function r(){return e===void 0&&(e=t.localStorage||window.localStorage),e}function i(){return JSON.parse(r().getItem(s)||"{}")}function m(a){r().setItem(s,JSON.stringify(a))}function p(){let a=t.timeToLive?t.timeToLive*1e3:null,o=i(),n=Object.fromEntries(Object.entries(o).filter(([,d])=>d.timestamp!==void 0));if(m(n),!a)return;let u=Object.fromEntries(Object.entries(n).filter(([,d])=>{let P=new Date().getTime();return!(d.timestamp+a<P)}));m(u)}return{get(a,o,n={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(p(),i()[JSON.stringify(a)])).then(u=>Promise.all([u?u.value:o(),u!==void 0])).then(([u,d])=>Promise.all([u,d||n.miss(u)])).then(([u])=>u)},set(a,o){return Promise.resolve().then(()=>{let n=i();return n[JSON.stringify(a)]={timestamp:new Date().getTime(),value:o},r().setItem(s,JSON.stringify(n)),o})},delete(a){return Promise.resolve().then(()=>{let o=i();delete o[JSON.stringify(a)],r().setItem(s,JSON.stringify(o))})},clear(){return Promise.resolve().then(()=>{r().removeItem(s)})}}}function ee(){return{get(t,e,s={miss:()=>Promise.resolve()}){return e().then(i=>Promise.all([i,s.miss(i)])).then(([i])=>i)},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?ee():{get(r,i,m={miss:()=>Promise.resolve()}){return s.get(r,i,m).catch(()=>q({caches:e}).get(r,i,m))},set(r,i){return s.set(r,i).catch(()=>q({caches:e}).set(r,i))},delete(r){return s.delete(r).catch(()=>q({caches:e}).delete(r))},clear(){return s.clear().catch(()=>q({caches:e}).clear())}}}function O(t={serializable:!0}){let e={};return{get(s,r,i={miss:()=>Promise.resolve()}){let m=JSON.stringify(s);if(m in e)return Promise.resolve(t.serializable?JSON.parse(e[m]):e[m]);let p=r();return p.then(a=>i.miss(a)).then(()=>p)},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()}}}var j=1e3,J=2e3,Q=3e4;function te(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 G(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 M({algoliaAgents:t,client:e,version:s}){let r=te(s).add({segment:e,version:s});return t.forEach(i=>r.add(i)),r}function z(){return{debug(t,e){return Promise.resolve()},info(t,e){return Promise.resolve()},error(t,e){return Promise.resolve()}}}var H=2*60*1e3;function W(t,e="up"){let s=Date.now();function r(){return e==="up"||Date.now()-s>H}function i(){return e==="timed out"&&Date.now()-s<=H}return{...t,status:e,lastUpdate:s,isUp:r,isTimedOut:i}}var F=class extends Error{name="AlgoliaError";constructor(t,e){super(t),e&&(this.name=e)}},X=class extends F{stackTrace;constructor(t,e,s){super(t,s),this.stackTrace=e}},re=class extends X{constructor(t){super("Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.",t,"RetryError")}},C=class extends X{status;constructor(t,e,s,r="ApiError"){super(t,s,r),this.status=e}},se=class extends F{response;constructor(t,e){super(t,"DeserializationError"),this.response=e}},oe=class extends C{error;constructor(t,e,s,r){super(t,e,r,"DetailedApiError"),this.error=s}};function ae(t,e,s){let r=ne(s),i=`${t.protocol}://${t.url}${t.port?`:${t.port}`:""}/${e.charAt(0)==="/"?e.substring(1):e}`;return r.length&&(i+=`?${r}`),i}function ne(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 ie(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 ce(t,e,s){let r={Accept:"application/json",...t,...e,...s},i={};return Object.keys(r).forEach(m=>{let p=r[m];i[m.toLowerCase()]=p}),i}function ue(t){try{return JSON.parse(t.content)}catch(e){throw new se(e.message,t)}}function le({content:t,status:e},s){try{let r=JSON.parse(t);return"error"in r?new oe(r.message,e,r.error,s):new C(r.message,e,s)}catch{}return new C(t,e,s)}function me({isTimedOut:t,status:e}){return!t&&~~e===0}function de({isTimedOut:t,status:e}){return t||me({isTimedOut:t,status:e})||~~(e/100)!==2&&~~(e/100)!==4}function he({status:t}){return~~(t/100)===2}function pe(t){return t.map(e=>K(e))}function K(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 V({hosts:t,hostsCache:e,baseHeaders:s,logger:r,baseQueryParameters:i,algoliaAgent:m,timeouts:p,requester:a,requestsCache:o,responsesCache:n}){async function u(c){let l=await Promise.all(c.map(h=>e.get(h,()=>Promise.resolve(W(h))))),f=l.filter(h=>h.isUp()),T=l.filter(h=>h.isTimedOut()),w=[...f,...T];return{hosts:w.length>0?w:c,getTimeout(h,A){return(T.length===0&&h===0?1:T.length+3+h)*A}}}async function d(c,l,f=!0){let T=[],w=ie(c,l),y=ce(s,c.headers,l.headers),h=c.method==="GET"?{...c.data,...l.data}:{},A={...i,...c.queryParameters,...h};if(m.value&&(A["x-algolia-agent"]=m.value),l&&l.queryParameters)for(let g of Object.keys(l.queryParameters))!l.queryParameters[g]||Object.prototype.toString.call(l.queryParameters[g])==="[object Object]"?A[g]=l.queryParameters[g]:A[g]=l.queryParameters[g].toString();let v=0,N=async(g,b)=>{let R=g.pop();if(R===void 0)throw new re(pe(T));let B={...p,...l.timeouts},I={data:w,headers:y,method:c.method,url:ae(R,c.path,A),connectTimeout:b(v,B.connect),responseTimeout:b(v,f?B.read:B.write)},U=x=>{let L={request:I,response:x,host:R,triesLeft:g.length};return T.push(L),L},E=await a.send(I);if(de(E)){let x=U(E);return E.isTimedOut&&v++,r.info("Retryable failure",K(x)),await e.set(R,W(R,E.isTimedOut?"timed out":"down")),N(g,b)}if(he(E))return ue(E);throw U(E),le(E,T)},Z=t.filter(g=>g.accept==="readWrite"||(f?g.accept==="read":g.accept==="write")),D=await u(Z);return N([...D.hosts].reverse(),D.getTimeout)}function P(c,l={}){let f=c.useReadTransporter||c.method==="GET";if(!f)return d(c,l,f);let T=()=>d(c,l);if((l.cacheable||c.cacheable)!==!0)return T();let y={request:c,requestOptions:l,transporter:{queryParameters:i,headers:s}};return n.get(y,()=>o.get(y,()=>o.set(y,T()).then(h=>Promise.all([o.delete(y),h]),h=>Promise.all([o.delete(y),Promise.reject(h)])).then(([h,A])=>A)),{miss:h=>n.set(y,h)})}return{hostsCache:e,requester:a,timeouts:p,logger:r,algoliaAgent:m,baseHeaders:s,baseQueryParameters:i,hosts:t,request:P,requestsCache:o,responsesCache:n}}var S="5.8.0",_=["de","us"];function fe(t){return[{url:t?"analytics.{region}.algolia.com".replace("{region}",t):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]}function Y({appId:t,apiKey:e,authMode:s,algoliaAgents:r,region:i,...m}){let p=G(t,e,s),a=V({hosts:fe(i),...m,algoliaAgent:M({algoliaAgents:r,client:"Abtesting",version:S}),baseHeaders:{"content-type":"text/plain",...p.headers(),...m.baseHeaders},baseQueryParameters:{...p.queryParameters(),...m.baseQueryParameters}});return{transporter:a,appId:t,clearCache(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then(()=>{})},get _ua(){return a.algoliaAgent.value},addAlgoliaAgent(o,n){a.algoliaAgent.add({segment:o,version:n})},setClientApiKey({apiKey:o}){!s||s==="WithinHeaders"?a.baseHeaders["x-algolia-api-key"]=o:a.baseQueryParameters["x-algolia-api-key"]=o},addABTests(o,n){if(!o)throw new Error("Parameter `addABTestsRequest` is required when calling `addABTests`.");if(!o.name)throw new Error("Parameter `addABTestsRequest.name` is required when calling `addABTests`.");if(!o.variants)throw new Error("Parameter `addABTestsRequest.variants` is required when calling `addABTests`.");if(!o.endAt)throw new Error("Parameter `addABTestsRequest.endAt` is required when calling `addABTests`.");let c={method:"POST",path:"/2/abtests",queryParameters:{},headers:{},data:o};return a.request(c,n)},customDelete({path:o,parameters:n},u){if(!o)throw new Error("Parameter `path` is required when calling `customDelete`.");let l={method:"DELETE",path:"/{path}".replace("{path}",o),queryParameters:n||{},headers:{}};return a.request(l,u)},customGet({path:o,parameters:n},u){if(!o)throw new Error("Parameter `path` is required when calling `customGet`.");let l={method:"GET",path:"/{path}".replace("{path}",o),queryParameters:n||{},headers:{}};return a.request(l,u)},customPost({path:o,parameters:n,body:u},d){if(!o)throw new Error("Parameter `path` is required when calling `customPost`.");let f={method:"POST",path:"/{path}".replace("{path}",o),queryParameters:n||{},headers:{},data:u||{}};return a.request(f,d)},customPut({path:o,parameters:n,body:u},d){if(!o)throw new Error("Parameter `path` is required when calling `customPut`.");let f={method:"PUT",path:"/{path}".replace("{path}",o),queryParameters:n||{},headers:{},data:u||{}};return a.request(f,d)},deleteABTest({id:o},n){if(!o)throw new Error("Parameter `id` is required when calling `deleteABTest`.");let c={method:"DELETE",path:"/2/abtests/{id}".replace("{id}",encodeURIComponent(o)),queryParameters:{},headers:{}};return a.request(c,n)},getABTest({id:o},n){if(!o)throw new Error("Parameter `id` is required when calling `getABTest`.");let c={method:"GET",path:"/2/abtests/{id}".replace("{id}",encodeURIComponent(o)),queryParameters:{},headers:{}};return a.request(c,n)},listABTests({offset:o,limit:n,indexPrefix:u,indexSuffix:d}={},P=void 0){let c="/2/abtests",l={},f={};o!==void 0&&(f.offset=o.toString()),n!==void 0&&(f.limit=n.toString()),u!==void 0&&(f.indexPrefix=u.toString()),d!==void 0&&(f.indexSuffix=d.toString());let T={method:"GET",path:c,queryParameters:f,headers:l};return a.request(T,P)},scheduleABTest(o,n){if(!o)throw new Error("Parameter `scheduleABTestsRequest` is required when calling `scheduleABTest`.");if(!o.name)throw new Error("Parameter `scheduleABTestsRequest.name` is required when calling `scheduleABTest`.");if(!o.variants)throw new Error("Parameter `scheduleABTestsRequest.variants` is required when calling `scheduleABTest`.");if(!o.scheduledAt)throw new Error("Parameter `scheduleABTestsRequest.scheduledAt` is required when calling `scheduleABTest`.");if(!o.endAt)throw new Error("Parameter `scheduleABTestsRequest.endAt` is required when calling `scheduleABTest`.");let c={method:"POST",path:"/2/abtests/schedule",queryParameters:{},headers:{},data:o};return a.request(c,n)},stopABTest({id:o},n){if(!o)throw new Error("Parameter `id` is required when calling `stopABTest`.");let c={method:"POST",path:"/2/abtests/{id}/stop".replace("{id}",encodeURIComponent(o)),queryParameters:{},headers:{}};return a.request(c,n)}}}function tt(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&&(typeof s!="string"||!_.includes(s)))throw new Error(`\`region\` must be one of the following: ${_.join(", ")}`);return Y({appId:t,apiKey:e,region:s,timeouts:{connect:j,read:J,write:Q},logger:z(),requester:k(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:O(),requestsCache:O({serializable:!1}),hostsCache:q({caches:[$({key:`${S}-${t}`}),O()]}),...r})}export{tt as abtestingClient,S as apiClientVersion};
//# sourceMappingURL=browser.min.js.map

@@ -7,7 +7,7 @@ (function (global, factory) {

function W(t){let e,s=`algolia-client-js-${t.key}`;function r(){return e===void 0&&(e=t.localStorage||window.localStorage),e}function i(){return JSON.parse(r().getItem(s)||"{}")}function m(a){r().setItem(s,JSON.stringify(a));}function p(){let a=t.timeToLive?t.timeToLive*1e3:null,o=i(),n=Object.fromEntries(Object.entries(o).filter(([,d])=>d.timestamp!==void 0));if(m(n),!a)return;let u=Object.fromEntries(Object.entries(n).filter(([,d])=>{let P=new Date().getTime();return !(d.timestamp+a<P)}));m(u);}return {get(a,o,n={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(p(),i()[JSON.stringify(a)])).then(u=>Promise.all([u?u.value:o(),u!==void 0])).then(([u,d])=>Promise.all([u,d||n.miss(u)])).then(([u])=>u)},set(a,o){return Promise.resolve().then(()=>{let n=i();return n[JSON.stringify(a)]={timestamp:new Date().getTime(),value:o},r().setItem(s,JSON.stringify(n)),o})},delete(a){return Promise.resolve().then(()=>{let o=i();delete o[JSON.stringify(a)],r().setItem(s,JSON.stringify(o));})},clear(){return Promise.resolve().then(()=>{r().removeItem(s);})}}}function ee(){return {get(t,e,s={miss:()=>Promise.resolve()}){return e().then(i=>Promise.all([i,s.miss(i)])).then(([i])=>i)},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?ee():{get(r,i,m={miss:()=>Promise.resolve()}){return s.get(r,i,m).catch(()=>q({caches:e}).get(r,i,m))},set(r,i){return s.set(r,i).catch(()=>q({caches:e}).set(r,i))},delete(r){return s.delete(r).catch(()=>q({caches:e}).delete(r))},clear(){return s.clear().catch(()=>q({caches:e}).clear())}}}function O(t={serializable:!0}){let e={};return {get(s,r,i={miss:()=>Promise.resolve()}){let m=JSON.stringify(s);if(m in e)return Promise.resolve(t.serializable?JSON.parse(e[m]):e[m]);let p=r();return p.then(a=>i.miss(a)).then(()=>p)},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()}}}var $=1e3,j=2e3,J=3e4;function te(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 Q(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 G({algoliaAgents:t,client:e,version:s}){let r=te(s).add({segment:e,version:s});return t.forEach(i=>r.add(i)),r}function M(){return {debug(t,e){return Promise.resolve()},info(t,e){return Promise.resolve()},error(t,e){return Promise.resolve()}}}var k=2*60*1e3;function H(t,e="up"){let s=Date.now();function r(){return e==="up"||Date.now()-s>k}function i(){return e==="timed out"&&Date.now()-s<=k}return {...t,status:e,lastUpdate:s,isUp:r,isTimedOut:i}}var z=class extends Error{name="AlgoliaError";constructor(t,e){super(t),e&&(this.name=e);}},F=class extends z{stackTrace;constructor(t,e,s){super(t,s),this.stackTrace=e;}},re=class extends F{constructor(t){super("Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.",t,"RetryError");}},C=class extends F{status;constructor(t,e,s,r="ApiError"){super(t,s,r),this.status=e;}},se=class extends z{response;constructor(t,e){super(t,"DeserializationError"),this.response=e;}},oe=class extends C{error;constructor(t,e,s,r){super(t,e,r,"DetailedApiError"),this.error=s;}};function ae(t,e,s){let r=ne(s),i=`${t.protocol}://${t.url}${t.port?`:${t.port}`:""}/${e.charAt(0)==="/"?e.substring(1):e}`;return r.length&&(i+=`?${r}`),i}function ne(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]).replaceAll("+","%20")}`).join("&")}function ie(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 ce(t,e,s){let r={Accept:"application/json",...t,...e,...s},i={};return Object.keys(r).forEach(m=>{let p=r[m];i[m.toLowerCase()]=p;}),i}function ue(t){try{return JSON.parse(t.content)}catch(e){throw new se(e.message,t)}}function le({content:t,status:e},s){try{let r=JSON.parse(t);return "error"in r?new oe(r.message,e,r.error,s):new C(r.message,e,s)}catch{}return new C(t,e,s)}function me({isTimedOut:t,status:e}){return !t&&~~e===0}function de({isTimedOut:t,status:e}){return t||me({isTimedOut:t,status:e})||~~(e/100)!==2&&~~(e/100)!==4}function he({status:t}){return ~~(t/100)===2}function pe(t){return t.map(e=>X(e))}function X(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 K({hosts:t,hostsCache:e,baseHeaders:s,logger:r,baseQueryParameters:i,algoliaAgent:m,timeouts:p,requester:a,requestsCache:o,responsesCache:n}){async function u(c){let l=await Promise.all(c.map(h=>e.get(h,()=>Promise.resolve(H(h))))),f=l.filter(h=>h.isUp()),T=l.filter(h=>h.isTimedOut()),w=[...f,...T];return {hosts:w.length>0?w:c,getTimeout(h,A){return (T.length===0&&h===0?1:T.length+3+h)*A}}}async function d(c,l,f=!0){let T=[],w=ie(c,l),y=ce(s,c.headers,l.headers),h=c.method==="GET"?{...c.data,...l.data}:{},A={...i,...c.queryParameters,...h};if(m.value&&(A["x-algolia-agent"]=m.value),l&&l.queryParameters)for(let g of Object.keys(l.queryParameters))!l.queryParameters[g]||Object.prototype.toString.call(l.queryParameters[g])==="[object Object]"?A[g]=l.queryParameters[g]:A[g]=l.queryParameters[g].toString();let v=0,N=async(g,b)=>{let R=g.pop();if(R===void 0)throw new re(pe(T));let B={...p,...l.timeouts},I={data:w,headers:y,method:c.method,url:ae(R,c.path,A),connectTimeout:b(v,B.connect),responseTimeout:b(v,f?B.read:B.write)},U=x=>{let L={request:I,response:x,host:R,triesLeft:g.length};return T.push(L),L},E=await a.send(I);if(de(E)){let x=U(E);return E.isTimedOut&&v++,r.info("Retryable failure",X(x)),await e.set(R,H(R,E.isTimedOut?"timed out":"down")),N(g,b)}if(he(E))return ue(E);throw U(E),le(E,T)},Z=t.filter(g=>g.accept==="readWrite"||(f?g.accept==="read":g.accept==="write")),D=await u(Z);return N([...D.hosts].reverse(),D.getTimeout)}function P(c,l={}){let f=c.useReadTransporter||c.method==="GET";if(!f)return d(c,l,f);let T=()=>d(c,l);if((l.cacheable||c.cacheable)!==!0)return T();let y={request:c,requestOptions:l,transporter:{queryParameters:i,headers:s}};return n.get(y,()=>o.get(y,()=>o.set(y,T()).then(h=>Promise.all([o.delete(y),h]),h=>Promise.all([o.delete(y),Promise.reject(h)])).then(([h,A])=>A)),{miss:h=>n.set(y,h)})}return {hostsCache:e,requester:a,timeouts:p,logger:r,algoliaAgent:m,baseHeaders:s,baseQueryParameters:i,hosts:t,request:P,requestsCache:o,responsesCache:n}}function V(){function t(e){return new Promise(s=>{let r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach(a=>r.setRequestHeader(a,e.headers[a]));let i=(a,o)=>setTimeout(()=>{r.abort(),s({status:0,content:o,isTimedOut:!0});},a),m=i(e.connectTimeout,"Connection timeout"),p;r.onreadystatechange=()=>{r.readyState>r.OPENED&&p===void 0&&(clearTimeout(m),p=i(e.responseTimeout,"Socket timeout"));},r.onerror=()=>{r.status===0&&(clearTimeout(m),clearTimeout(p),s({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}));},r.onload=()=>{clearTimeout(m),clearTimeout(p),s({content:r.responseText,status:r.status,isTimedOut:!1});},r.send(e.data);})}return {send:t}}var S="5.7.0",_=["de","us"];function fe(t){return [{url:t?"analytics.{region}.algolia.com".replace("{region}",t):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]}function Y({appId:t,apiKey:e,authMode:s,algoliaAgents:r,region:i,...m}){let p=Q(t,e,s),a=K({hosts:fe(i),...m,algoliaAgent:G({algoliaAgents:r,client:"Abtesting",version:S}),baseHeaders:{"content-type":"text/plain",...p.headers(),...m.baseHeaders},baseQueryParameters:{...p.queryParameters(),...m.baseQueryParameters}});return {transporter:a,appId:t,clearCache(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then(()=>{})},get _ua(){return a.algoliaAgent.value},addAlgoliaAgent(o,n){a.algoliaAgent.add({segment:o,version:n});},setClientApiKey({apiKey:o}){!s||s==="WithinHeaders"?a.baseHeaders["x-algolia-api-key"]=o:a.baseQueryParameters["x-algolia-api-key"]=o;},addABTests(o,n){if(!o)throw new Error("Parameter `addABTestsRequest` is required when calling `addABTests`.");if(!o.name)throw new Error("Parameter `addABTestsRequest.name` is required when calling `addABTests`.");if(!o.variants)throw new Error("Parameter `addABTestsRequest.variants` is required when calling `addABTests`.");if(!o.endAt)throw new Error("Parameter `addABTestsRequest.endAt` is required when calling `addABTests`.");let c={method:"POST",path:"/2/abtests",queryParameters:{},headers:{},data:o};return a.request(c,n)},customDelete({path:o,parameters:n},u){if(!o)throw new Error("Parameter `path` is required when calling `customDelete`.");let l={method:"DELETE",path:"/{path}".replace("{path}",o),queryParameters:n||{},headers:{}};return a.request(l,u)},customGet({path:o,parameters:n},u){if(!o)throw new Error("Parameter `path` is required when calling `customGet`.");let l={method:"GET",path:"/{path}".replace("{path}",o),queryParameters:n||{},headers:{}};return a.request(l,u)},customPost({path:o,parameters:n,body:u},d){if(!o)throw new Error("Parameter `path` is required when calling `customPost`.");let f={method:"POST",path:"/{path}".replace("{path}",o),queryParameters:n||{},headers:{},data:u||{}};return a.request(f,d)},customPut({path:o,parameters:n,body:u},d){if(!o)throw new Error("Parameter `path` is required when calling `customPut`.");let f={method:"PUT",path:"/{path}".replace("{path}",o),queryParameters:n||{},headers:{},data:u||{}};return a.request(f,d)},deleteABTest({id:o},n){if(!o)throw new Error("Parameter `id` is required when calling `deleteABTest`.");let c={method:"DELETE",path:"/2/abtests/{id}".replace("{id}",encodeURIComponent(o)),queryParameters:{},headers:{}};return a.request(c,n)},getABTest({id:o},n){if(!o)throw new Error("Parameter `id` is required when calling `getABTest`.");let c={method:"GET",path:"/2/abtests/{id}".replace("{id}",encodeURIComponent(o)),queryParameters:{},headers:{}};return a.request(c,n)},listABTests({offset:o,limit:n,indexPrefix:u,indexSuffix:d}={},P=void 0){let c="/2/abtests",l={},f={};o!==void 0&&(f.offset=o.toString()),n!==void 0&&(f.limit=n.toString()),u!==void 0&&(f.indexPrefix=u.toString()),d!==void 0&&(f.indexSuffix=d.toString());let T={method:"GET",path:c,queryParameters:f,headers:l};return a.request(T,P)},scheduleABTest(o,n){if(!o)throw new Error("Parameter `scheduleABTestsRequest` is required when calling `scheduleABTest`.");if(!o.name)throw new Error("Parameter `scheduleABTestsRequest.name` is required when calling `scheduleABTest`.");if(!o.variants)throw new Error("Parameter `scheduleABTestsRequest.variants` is required when calling `scheduleABTest`.");if(!o.scheduledAt)throw new Error("Parameter `scheduleABTestsRequest.scheduledAt` is required when calling `scheduleABTest`.");if(!o.endAt)throw new Error("Parameter `scheduleABTestsRequest.endAt` is required when calling `scheduleABTest`.");let c={method:"POST",path:"/2/abtests/schedule",queryParameters:{},headers:{},data:o};return a.request(c,n)},stopABTest({id:o},n){if(!o)throw new Error("Parameter `id` is required when calling `stopABTest`.");let c={method:"POST",path:"/2/abtests/{id}/stop".replace("{id}",encodeURIComponent(o)),queryParameters:{},headers:{}};return a.request(c,n)}}}function Ye(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&&(typeof s!="string"||!_.includes(s)))throw new Error(`\`region\` must be one of the following: ${_.join(", ")}`);return Y({appId:t,apiKey:e,region:s,timeouts:{connect:$,read:j,write:J},logger:M(),requester:V(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:O(),requestsCache:O({serializable:!1}),hostsCache:q({caches:[W({key:`${S}-${t}`}),O()]}),...r})}
function k(){function t(e){return new Promise(s=>{let r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach(a=>r.setRequestHeader(a,e.headers[a]));let i=(a,o)=>setTimeout(()=>{r.abort(),s({status:0,content:o,isTimedOut:!0});},a),m=i(e.connectTimeout,"Connection timeout"),p;r.onreadystatechange=()=>{r.readyState>r.OPENED&&p===void 0&&(clearTimeout(m),p=i(e.responseTimeout,"Socket timeout"));},r.onerror=()=>{r.status===0&&(clearTimeout(m),clearTimeout(p),s({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}));},r.onload=()=>{clearTimeout(m),clearTimeout(p),s({content:r.responseText,status:r.status,isTimedOut:!1});},r.send(e.data);})}return {send:t}}function $(t){let e,s=`algolia-client-js-${t.key}`;function r(){return e===void 0&&(e=t.localStorage||window.localStorage),e}function i(){return JSON.parse(r().getItem(s)||"{}")}function m(a){r().setItem(s,JSON.stringify(a));}function p(){let a=t.timeToLive?t.timeToLive*1e3:null,o=i(),n=Object.fromEntries(Object.entries(o).filter(([,d])=>d.timestamp!==void 0));if(m(n),!a)return;let u=Object.fromEntries(Object.entries(n).filter(([,d])=>{let P=new Date().getTime();return !(d.timestamp+a<P)}));m(u);}return {get(a,o,n={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(p(),i()[JSON.stringify(a)])).then(u=>Promise.all([u?u.value:o(),u!==void 0])).then(([u,d])=>Promise.all([u,d||n.miss(u)])).then(([u])=>u)},set(a,o){return Promise.resolve().then(()=>{let n=i();return n[JSON.stringify(a)]={timestamp:new Date().getTime(),value:o},r().setItem(s,JSON.stringify(n)),o})},delete(a){return Promise.resolve().then(()=>{let o=i();delete o[JSON.stringify(a)],r().setItem(s,JSON.stringify(o));})},clear(){return Promise.resolve().then(()=>{r().removeItem(s);})}}}function ee(){return {get(t,e,s={miss:()=>Promise.resolve()}){return e().then(i=>Promise.all([i,s.miss(i)])).then(([i])=>i)},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?ee():{get(r,i,m={miss:()=>Promise.resolve()}){return s.get(r,i,m).catch(()=>q({caches:e}).get(r,i,m))},set(r,i){return s.set(r,i).catch(()=>q({caches:e}).set(r,i))},delete(r){return s.delete(r).catch(()=>q({caches:e}).delete(r))},clear(){return s.clear().catch(()=>q({caches:e}).clear())}}}function O(t={serializable:!0}){let e={};return {get(s,r,i={miss:()=>Promise.resolve()}){let m=JSON.stringify(s);if(m in e)return Promise.resolve(t.serializable?JSON.parse(e[m]):e[m]);let p=r();return p.then(a=>i.miss(a)).then(()=>p)},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()}}}var j=1e3,J=2e3,Q=3e4;function te(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 G(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 M({algoliaAgents:t,client:e,version:s}){let r=te(s).add({segment:e,version:s});return t.forEach(i=>r.add(i)),r}function z(){return {debug(t,e){return Promise.resolve()},info(t,e){return Promise.resolve()},error(t,e){return Promise.resolve()}}}var H=2*60*1e3;function W(t,e="up"){let s=Date.now();function r(){return e==="up"||Date.now()-s>H}function i(){return e==="timed out"&&Date.now()-s<=H}return {...t,status:e,lastUpdate:s,isUp:r,isTimedOut:i}}var F=class extends Error{name="AlgoliaError";constructor(t,e){super(t),e&&(this.name=e);}},X=class extends F{stackTrace;constructor(t,e,s){super(t,s),this.stackTrace=e;}},re=class extends X{constructor(t){super("Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.",t,"RetryError");}},C=class extends X{status;constructor(t,e,s,r="ApiError"){super(t,s,r),this.status=e;}},se=class extends F{response;constructor(t,e){super(t,"DeserializationError"),this.response=e;}},oe=class extends C{error;constructor(t,e,s,r){super(t,e,r,"DetailedApiError"),this.error=s;}};function ae(t,e,s){let r=ne(s),i=`${t.protocol}://${t.url}${t.port?`:${t.port}`:""}/${e.charAt(0)==="/"?e.substring(1):e}`;return r.length&&(i+=`?${r}`),i}function ne(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 ie(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 ce(t,e,s){let r={Accept:"application/json",...t,...e,...s},i={};return Object.keys(r).forEach(m=>{let p=r[m];i[m.toLowerCase()]=p;}),i}function ue(t){try{return JSON.parse(t.content)}catch(e){throw new se(e.message,t)}}function le({content:t,status:e},s){try{let r=JSON.parse(t);return "error"in r?new oe(r.message,e,r.error,s):new C(r.message,e,s)}catch{}return new C(t,e,s)}function me({isTimedOut:t,status:e}){return !t&&~~e===0}function de({isTimedOut:t,status:e}){return t||me({isTimedOut:t,status:e})||~~(e/100)!==2&&~~(e/100)!==4}function he({status:t}){return ~~(t/100)===2}function pe(t){return t.map(e=>K(e))}function K(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 V({hosts:t,hostsCache:e,baseHeaders:s,logger:r,baseQueryParameters:i,algoliaAgent:m,timeouts:p,requester:a,requestsCache:o,responsesCache:n}){async function u(c){let l=await Promise.all(c.map(h=>e.get(h,()=>Promise.resolve(W(h))))),f=l.filter(h=>h.isUp()),T=l.filter(h=>h.isTimedOut()),w=[...f,...T];return {hosts:w.length>0?w:c,getTimeout(h,A){return (T.length===0&&h===0?1:T.length+3+h)*A}}}async function d(c,l,f=!0){let T=[],w=ie(c,l),y=ce(s,c.headers,l.headers),h=c.method==="GET"?{...c.data,...l.data}:{},A={...i,...c.queryParameters,...h};if(m.value&&(A["x-algolia-agent"]=m.value),l&&l.queryParameters)for(let g of Object.keys(l.queryParameters))!l.queryParameters[g]||Object.prototype.toString.call(l.queryParameters[g])==="[object Object]"?A[g]=l.queryParameters[g]:A[g]=l.queryParameters[g].toString();let v=0,N=async(g,b)=>{let R=g.pop();if(R===void 0)throw new re(pe(T));let B={...p,...l.timeouts},I={data:w,headers:y,method:c.method,url:ae(R,c.path,A),connectTimeout:b(v,B.connect),responseTimeout:b(v,f?B.read:B.write)},U=x=>{let L={request:I,response:x,host:R,triesLeft:g.length};return T.push(L),L},E=await a.send(I);if(de(E)){let x=U(E);return E.isTimedOut&&v++,r.info("Retryable failure",K(x)),await e.set(R,W(R,E.isTimedOut?"timed out":"down")),N(g,b)}if(he(E))return ue(E);throw U(E),le(E,T)},Z=t.filter(g=>g.accept==="readWrite"||(f?g.accept==="read":g.accept==="write")),D=await u(Z);return N([...D.hosts].reverse(),D.getTimeout)}function P(c,l={}){let f=c.useReadTransporter||c.method==="GET";if(!f)return d(c,l,f);let T=()=>d(c,l);if((l.cacheable||c.cacheable)!==!0)return T();let y={request:c,requestOptions:l,transporter:{queryParameters:i,headers:s}};return n.get(y,()=>o.get(y,()=>o.set(y,T()).then(h=>Promise.all([o.delete(y),h]),h=>Promise.all([o.delete(y),Promise.reject(h)])).then(([h,A])=>A)),{miss:h=>n.set(y,h)})}return {hostsCache:e,requester:a,timeouts:p,logger:r,algoliaAgent:m,baseHeaders:s,baseQueryParameters:i,hosts:t,request:P,requestsCache:o,responsesCache:n}}var S="5.8.0",_=["de","us"];function fe(t){return [{url:t?"analytics.{region}.algolia.com".replace("{region}",t):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]}function Y({appId:t,apiKey:e,authMode:s,algoliaAgents:r,region:i,...m}){let p=G(t,e,s),a=V({hosts:fe(i),...m,algoliaAgent:M({algoliaAgents:r,client:"Abtesting",version:S}),baseHeaders:{"content-type":"text/plain",...p.headers(),...m.baseHeaders},baseQueryParameters:{...p.queryParameters(),...m.baseQueryParameters}});return {transporter:a,appId:t,clearCache(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then(()=>{})},get _ua(){return a.algoliaAgent.value},addAlgoliaAgent(o,n){a.algoliaAgent.add({segment:o,version:n});},setClientApiKey({apiKey:o}){!s||s==="WithinHeaders"?a.baseHeaders["x-algolia-api-key"]=o:a.baseQueryParameters["x-algolia-api-key"]=o;},addABTests(o,n){if(!o)throw new Error("Parameter `addABTestsRequest` is required when calling `addABTests`.");if(!o.name)throw new Error("Parameter `addABTestsRequest.name` is required when calling `addABTests`.");if(!o.variants)throw new Error("Parameter `addABTestsRequest.variants` is required when calling `addABTests`.");if(!o.endAt)throw new Error("Parameter `addABTestsRequest.endAt` is required when calling `addABTests`.");let c={method:"POST",path:"/2/abtests",queryParameters:{},headers:{},data:o};return a.request(c,n)},customDelete({path:o,parameters:n},u){if(!o)throw new Error("Parameter `path` is required when calling `customDelete`.");let l={method:"DELETE",path:"/{path}".replace("{path}",o),queryParameters:n||{},headers:{}};return a.request(l,u)},customGet({path:o,parameters:n},u){if(!o)throw new Error("Parameter `path` is required when calling `customGet`.");let l={method:"GET",path:"/{path}".replace("{path}",o),queryParameters:n||{},headers:{}};return a.request(l,u)},customPost({path:o,parameters:n,body:u},d){if(!o)throw new Error("Parameter `path` is required when calling `customPost`.");let f={method:"POST",path:"/{path}".replace("{path}",o),queryParameters:n||{},headers:{},data:u||{}};return a.request(f,d)},customPut({path:o,parameters:n,body:u},d){if(!o)throw new Error("Parameter `path` is required when calling `customPut`.");let f={method:"PUT",path:"/{path}".replace("{path}",o),queryParameters:n||{},headers:{},data:u||{}};return a.request(f,d)},deleteABTest({id:o},n){if(!o)throw new Error("Parameter `id` is required when calling `deleteABTest`.");let c={method:"DELETE",path:"/2/abtests/{id}".replace("{id}",encodeURIComponent(o)),queryParameters:{},headers:{}};return a.request(c,n)},getABTest({id:o},n){if(!o)throw new Error("Parameter `id` is required when calling `getABTest`.");let c={method:"GET",path:"/2/abtests/{id}".replace("{id}",encodeURIComponent(o)),queryParameters:{},headers:{}};return a.request(c,n)},listABTests({offset:o,limit:n,indexPrefix:u,indexSuffix:d}={},P=void 0){let c="/2/abtests",l={},f={};o!==void 0&&(f.offset=o.toString()),n!==void 0&&(f.limit=n.toString()),u!==void 0&&(f.indexPrefix=u.toString()),d!==void 0&&(f.indexSuffix=d.toString());let T={method:"GET",path:c,queryParameters:f,headers:l};return a.request(T,P)},scheduleABTest(o,n){if(!o)throw new Error("Parameter `scheduleABTestsRequest` is required when calling `scheduleABTest`.");if(!o.name)throw new Error("Parameter `scheduleABTestsRequest.name` is required when calling `scheduleABTest`.");if(!o.variants)throw new Error("Parameter `scheduleABTestsRequest.variants` is required when calling `scheduleABTest`.");if(!o.scheduledAt)throw new Error("Parameter `scheduleABTestsRequest.scheduledAt` is required when calling `scheduleABTest`.");if(!o.endAt)throw new Error("Parameter `scheduleABTestsRequest.endAt` is required when calling `scheduleABTest`.");let c={method:"POST",path:"/2/abtests/schedule",queryParameters:{},headers:{},data:o};return a.request(c,n)},stopABTest({id:o},n){if(!o)throw new Error("Parameter `id` is required when calling `stopABTest`.");let c={method:"POST",path:"/2/abtests/{id}/stop".replace("{id}",encodeURIComponent(o)),queryParameters:{},headers:{}};return a.request(c,n)}}}function tt(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&&(typeof s!="string"||!_.includes(s)))throw new Error(`\`region\` must be one of the following: ${_.join(", ")}`);return Y({appId:t,apiKey:e,region:s,timeouts:{connect:j,read:J,write:Q},logger:z(),requester:k(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:O(),requestsCache:O({serializable:!1}),hostsCache:q({caches:[$({key:`${S}-${t}`}),O()]}),...r})}
exports.abtestingClient = Ye;
exports.abtestingClient = tt;
exports.apiClientVersion = S;
}));
// builds/fetch.ts
import {
createNullLogger,
createMemoryCache,
createNullCache,
createNullLogger,
DEFAULT_CONNECT_TIMEOUT_NODE,

@@ -14,3 +14,3 @@ DEFAULT_READ_TIMEOUT_NODE,

import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common";
var apiClientVersion = "5.7.0";
var apiClientVersion = "5.8.0";
var REGIONS = ["de", "us"];

@@ -92,4 +92,3 @@ function getDefaultHosts(region) {

* Required API Key ACLs:
* - editSettings.
*
* - editSettings
* @param addABTestsRequest - The addABTestsRequest object.

@@ -125,3 +124,2 @@ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.

* This method allow you to send requests to the Algolia REST API.
*
* @param customDelete - The customDelete object.

@@ -149,3 +147,2 @@ * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.

* This method allow you to send requests to the Algolia REST API.
*
* @param customGet - The customGet object.

@@ -173,3 +170,2 @@ * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.

* This method allow you to send requests to the Algolia REST API.
*
* @param customPost - The customPost object.

@@ -199,3 +195,2 @@ * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.

* This method allow you to send requests to the Algolia REST API.
*
* @param customPut - The customPut object.

@@ -227,4 +222,3 @@ * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.

* Required API Key ACLs:
* - editSettings.
*
* - editSettings
* @param deleteABTest - The deleteABTest object.

@@ -253,4 +247,3 @@ * @param deleteABTest.id - Unique A/B test identifier.

* Required API Key ACLs:
* - analytics.
*
* - analytics
* @param getABTest - The getABTest object.

@@ -279,4 +272,3 @@ * @param getABTest.id - Unique A/B test identifier.

* Required API Key ACLs:
* - analytics.
*
* - analytics
* @param listABTests - The listABTests object.

@@ -294,12 +286,12 @@ * @param listABTests.offset - Position of the first item to return.

if (offset !== void 0) {
queryParameters.offset = offset.toString();
queryParameters["offset"] = offset.toString();
}
if (limit !== void 0) {
queryParameters.limit = limit.toString();
queryParameters["limit"] = limit.toString();
}
if (indexPrefix !== void 0) {
queryParameters.indexPrefix = indexPrefix.toString();
queryParameters["indexPrefix"] = indexPrefix.toString();
}
if (indexSuffix !== void 0) {
queryParameters.indexSuffix = indexSuffix.toString();
queryParameters["indexSuffix"] = indexSuffix.toString();
}

@@ -318,4 +310,3 @@ const request = {

* Required API Key ACLs:
* - editSettings.
*
* - editSettings
* @param scheduleABTestsRequest - The scheduleABTestsRequest object.

@@ -356,4 +347,3 @@ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.

* Required API Key ACLs:
* - editSettings.
*
* - editSettings
* @param stopABTest - The stopABTest object.

@@ -360,0 +350,0 @@ * @param stopABTest.id - Unique A/B test identifier.

// builds/node.ts
import { createHttpRequester } from "@algolia/requester-node-http";
import {
createNullLogger,
createMemoryCache,
createNullCache,
createNullLogger,
DEFAULT_CONNECT_TIMEOUT_NODE,

@@ -10,7 +11,6 @@ DEFAULT_READ_TIMEOUT_NODE,

} from "@algolia/client-common";
import { createHttpRequester } from "@algolia/requester-node-http";
// src/abtestingClient.ts
import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common";
var apiClientVersion = "5.7.0";
var apiClientVersion = "5.8.0";
var REGIONS = ["de", "us"];

@@ -92,4 +92,3 @@ function getDefaultHosts(region) {

* Required API Key ACLs:
* - editSettings.
*
* - editSettings
* @param addABTestsRequest - The addABTestsRequest object.

@@ -125,3 +124,2 @@ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.

* This method allow you to send requests to the Algolia REST API.
*
* @param customDelete - The customDelete object.

@@ -149,3 +147,2 @@ * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.

* This method allow you to send requests to the Algolia REST API.
*
* @param customGet - The customGet object.

@@ -173,3 +170,2 @@ * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.

* This method allow you to send requests to the Algolia REST API.
*
* @param customPost - The customPost object.

@@ -199,3 +195,2 @@ * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.

* This method allow you to send requests to the Algolia REST API.
*
* @param customPut - The customPut object.

@@ -227,4 +222,3 @@ * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.

* Required API Key ACLs:
* - editSettings.
*
* - editSettings
* @param deleteABTest - The deleteABTest object.

@@ -253,4 +247,3 @@ * @param deleteABTest.id - Unique A/B test identifier.

* Required API Key ACLs:
* - analytics.
*
* - analytics
* @param getABTest - The getABTest object.

@@ -279,4 +272,3 @@ * @param getABTest.id - Unique A/B test identifier.

* Required API Key ACLs:
* - analytics.
*
* - analytics
* @param listABTests - The listABTests object.

@@ -294,12 +286,12 @@ * @param listABTests.offset - Position of the first item to return.

if (offset !== void 0) {
queryParameters.offset = offset.toString();
queryParameters["offset"] = offset.toString();
}
if (limit !== void 0) {
queryParameters.limit = limit.toString();
queryParameters["limit"] = limit.toString();
}
if (indexPrefix !== void 0) {
queryParameters.indexPrefix = indexPrefix.toString();
queryParameters["indexPrefix"] = indexPrefix.toString();
}
if (indexSuffix !== void 0) {
queryParameters.indexSuffix = indexSuffix.toString();
queryParameters["indexSuffix"] = indexSuffix.toString();
}

@@ -318,4 +310,3 @@ const request = {

* Required API Key ACLs:
* - editSettings.
*
* - editSettings
* @param scheduleABTestsRequest - The scheduleABTestsRequest object.

@@ -356,4 +347,3 @@ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.

* Required API Key ACLs:
* - editSettings.
*
* - editSettings
* @param stopABTest - The stopABTest object.

@@ -360,0 +350,0 @@ * @param stopABTest.id - Unique A/B test identifier.

@@ -52,3 +52,3 @@ import * as _algolia_client_common from '@algolia/client-common';

*/
type Status = 'active' | 'expired' | 'failed' | 'stopped';
type Status = 'active' | 'stopped' | 'expired' | 'failed';

@@ -142,3 +142,5 @@ type Currency = {

*/
currencies?: Record<string, Currency>;
currencies?: {
[key: string]: Currency;
};
/**

@@ -200,3 +202,5 @@ * Description for this variant.

purchaseSignificance?: number | null;
revenueSignificance?: Record<string, number> | null;
revenueSignificance?: {
[key: string]: number;
} | null;
/**

@@ -222,3 +226,3 @@ * Date and time when the A/B test was last updated, in RFC 3339 format.

*/
variants: Variant[];
variants: Array<Variant>;
configuration?: ABTestConfiguration;

@@ -276,3 +280,3 @@ };

*/
variants: AddABTestsVariant[];
variants: Array<AddABTestsVariant>;
/**

@@ -284,2 +288,43 @@ * End date and time of the A/B test, in RFC 3339 format.

type ListABTestsResponse = {
/**
* A/B tests.
*/
abtests: Array<ABTest> | null;
/**
* Number of A/B tests.
*/
count: number;
/**
* Number of retrievable A/B tests.
*/
total: number;
};
type ScheduleABTestResponse = {
/**
* Unique scheduled A/B test identifier.
*/
abTestScheduleID: number;
};
type ScheduleABTestsRequest = {
/**
* A/B test name.
*/
name: string;
/**
* A/B test variants.
*/
variants: Array<AddABTestsVariant>;
/**
* Date and time when the A/B test is scheduled to start, in RFC 3339 format.
*/
scheduledAt: string;
/**
* End date and time of the A/B test, in RFC 3339 format.
*/
endAt: string;
};
/**

@@ -296,3 +341,5 @@ * Properties for the `customDelete` method.

*/
parameters?: Record<string, any>;
parameters?: {
[key: string]: any;
};
};

@@ -310,3 +357,5 @@ /**

*/
parameters?: Record<string, any>;
parameters?: {
[key: string]: any;
};
};

@@ -324,3 +373,5 @@ /**

*/
parameters?: Record<string, any>;
parameters?: {
[key: string]: any;
};
/**

@@ -342,3 +393,5 @@ * Parameters to send with the custom request.

*/
parameters?: Record<string, any>;
parameters?: {
[key: string]: any;
};
/**

@@ -398,44 +451,3 @@ * Parameters to send with the custom request.

type ListABTestsResponse = {
/**
* A/B tests.
*/
abtests: ABTest[] | null;
/**
* Number of A/B tests.
*/
count: number;
/**
* Number of retrievable A/B tests.
*/
total: number;
};
type ScheduleABTestResponse = {
/**
* Unique scheduled A/B test identifier.
*/
abTestScheduleID: number;
};
type ScheduleABTestsRequest = {
/**
* A/B test name.
*/
name: string;
/**
* A/B test variants.
*/
variants: AddABTestsVariant[];
/**
* Date and time when the A/B test is scheduled to start, in RFC 3339 format.
*/
scheduledAt: string;
/**
* End date and time of the A/B test, in RFC 3339 format.
*/
endAt: string;
};
declare const apiClientVersion = "5.7.0";
declare const apiClientVersion = "5.8.0";
declare const REGIONS: readonly ["de", "us"];

@@ -479,4 +491,3 @@ type Region = (typeof REGIONS)[number];

* Required API Key ACLs:
* - editSettings.
*
* - editSettings
* @param addABTestsRequest - The addABTestsRequest object.

@@ -488,3 +499,2 @@ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.

* This method allow you to send requests to the Algolia REST API.
*
* @param customDelete - The customDelete object.

@@ -498,3 +508,2 @@ * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.

* This method allow you to send requests to the Algolia REST API.
*
* @param customGet - The customGet object.

@@ -508,3 +517,2 @@ * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.

* This method allow you to send requests to the Algolia REST API.
*
* @param customPost - The customPost object.

@@ -519,3 +527,2 @@ * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.

* This method allow you to send requests to the Algolia REST API.
*
* @param customPut - The customPut object.

@@ -532,4 +539,3 @@ * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.

* Required API Key ACLs:
* - editSettings.
*
* - editSettings
* @param deleteABTest - The deleteABTest object.

@@ -544,4 +550,3 @@ * @param deleteABTest.id - Unique A/B test identifier.

* Required API Key ACLs:
* - analytics.
*
* - analytics
* @param getABTest - The getABTest object.

@@ -556,4 +561,3 @@ * @param getABTest.id - Unique A/B test identifier.

* Required API Key ACLs:
* - analytics.
*
* - analytics
* @param listABTests - The listABTests object.

@@ -571,4 +575,3 @@ * @param listABTests.offset - Position of the first item to return.

* Required API Key ACLs:
* - editSettings.
*
* - editSettings
* @param scheduleABTestsRequest - The scheduleABTestsRequest object.

@@ -582,4 +585,3 @@ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.

* Required API Key ACLs:
* - editSettings.
*
* - editSettings
* @param stopABTest - The stopABTest object.

@@ -586,0 +588,0 @@ * @param stopABTest.id - Unique A/B test identifier.

@@ -52,3 +52,3 @@ import * as _algolia_client_common from '@algolia/client-common';

*/
type Status = 'active' | 'expired' | 'failed' | 'stopped';
type Status = 'active' | 'stopped' | 'expired' | 'failed';

@@ -142,3 +142,5 @@ type Currency = {

*/
currencies?: Record<string, Currency>;
currencies?: {
[key: string]: Currency;
};
/**

@@ -200,3 +202,5 @@ * Description for this variant.

purchaseSignificance?: number | null;
revenueSignificance?: Record<string, number> | null;
revenueSignificance?: {
[key: string]: number;
} | null;
/**

@@ -222,3 +226,3 @@ * Date and time when the A/B test was last updated, in RFC 3339 format.

*/
variants: Variant[];
variants: Array<Variant>;
configuration?: ABTestConfiguration;

@@ -276,3 +280,3 @@ };

*/
variants: AddABTestsVariant[];
variants: Array<AddABTestsVariant>;
/**

@@ -284,2 +288,43 @@ * End date and time of the A/B test, in RFC 3339 format.

type ListABTestsResponse = {
/**
* A/B tests.
*/
abtests: Array<ABTest> | null;
/**
* Number of A/B tests.
*/
count: number;
/**
* Number of retrievable A/B tests.
*/
total: number;
};
type ScheduleABTestResponse = {
/**
* Unique scheduled A/B test identifier.
*/
abTestScheduleID: number;
};
type ScheduleABTestsRequest = {
/**
* A/B test name.
*/
name: string;
/**
* A/B test variants.
*/
variants: Array<AddABTestsVariant>;
/**
* Date and time when the A/B test is scheduled to start, in RFC 3339 format.
*/
scheduledAt: string;
/**
* End date and time of the A/B test, in RFC 3339 format.
*/
endAt: string;
};
/**

@@ -296,3 +341,5 @@ * Properties for the `customDelete` method.

*/
parameters?: Record<string, any>;
parameters?: {
[key: string]: any;
};
};

@@ -310,3 +357,5 @@ /**

*/
parameters?: Record<string, any>;
parameters?: {
[key: string]: any;
};
};

@@ -324,3 +373,5 @@ /**

*/
parameters?: Record<string, any>;
parameters?: {
[key: string]: any;
};
/**

@@ -342,3 +393,5 @@ * Parameters to send with the custom request.

*/
parameters?: Record<string, any>;
parameters?: {
[key: string]: any;
};
/**

@@ -398,44 +451,3 @@ * Parameters to send with the custom request.

type ListABTestsResponse = {
/**
* A/B tests.
*/
abtests: ABTest[] | null;
/**
* Number of A/B tests.
*/
count: number;
/**
* Number of retrievable A/B tests.
*/
total: number;
};
type ScheduleABTestResponse = {
/**
* Unique scheduled A/B test identifier.
*/
abTestScheduleID: number;
};
type ScheduleABTestsRequest = {
/**
* A/B test name.
*/
name: string;
/**
* A/B test variants.
*/
variants: AddABTestsVariant[];
/**
* Date and time when the A/B test is scheduled to start, in RFC 3339 format.
*/
scheduledAt: string;
/**
* End date and time of the A/B test, in RFC 3339 format.
*/
endAt: string;
};
declare const apiClientVersion = "5.7.0";
declare const apiClientVersion = "5.8.0";
declare const REGIONS: readonly ["de", "us"];

@@ -479,4 +491,3 @@ type Region = (typeof REGIONS)[number];

* Required API Key ACLs:
* - editSettings.
*
* - editSettings
* @param addABTestsRequest - The addABTestsRequest object.

@@ -488,3 +499,2 @@ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.

* This method allow you to send requests to the Algolia REST API.
*
* @param customDelete - The customDelete object.

@@ -498,3 +508,2 @@ * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.

* This method allow you to send requests to the Algolia REST API.
*
* @param customGet - The customGet object.

@@ -508,3 +517,2 @@ * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.

* This method allow you to send requests to the Algolia REST API.
*
* @param customPost - The customPost object.

@@ -519,3 +527,2 @@ * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.

* This method allow you to send requests to the Algolia REST API.
*
* @param customPut - The customPut object.

@@ -532,4 +539,3 @@ * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.

* Required API Key ACLs:
* - editSettings.
*
* - editSettings
* @param deleteABTest - The deleteABTest object.

@@ -544,4 +550,3 @@ * @param deleteABTest.id - Unique A/B test identifier.

* Required API Key ACLs:
* - analytics.
*
* - analytics
* @param getABTest - The getABTest object.

@@ -556,4 +561,3 @@ * @param getABTest.id - Unique A/B test identifier.

* Required API Key ACLs:
* - analytics.
*
* - analytics
* @param listABTests - The listABTests object.

@@ -571,4 +575,3 @@ * @param listABTests.offset - Position of the first item to return.

* Required API Key ACLs:
* - editSettings.
*
* - editSettings
* @param scheduleABTestsRequest - The scheduleABTestsRequest object.

@@ -582,4 +585,3 @@ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.

* Required API Key ACLs:
* - editSettings.
*
* - editSettings
* @param stopABTest - The stopABTest object.

@@ -586,0 +588,0 @@ * @param stopABTest.id - Unique A/B test identifier.

// src/abtestingClient.ts
import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common";
var apiClientVersion = "5.7.0";
var apiClientVersion = "5.8.0";
var REGIONS = ["de", "us"];

@@ -80,4 +80,3 @@ function getDefaultHosts(region) {

* Required API Key ACLs:
* - editSettings.
*
* - editSettings
* @param addABTestsRequest - The addABTestsRequest object.

@@ -113,3 +112,2 @@ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.

* This method allow you to send requests to the Algolia REST API.
*
* @param customDelete - The customDelete object.

@@ -137,3 +135,2 @@ * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.

* This method allow you to send requests to the Algolia REST API.
*
* @param customGet - The customGet object.

@@ -161,3 +158,2 @@ * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.

* This method allow you to send requests to the Algolia REST API.
*
* @param customPost - The customPost object.

@@ -187,3 +183,2 @@ * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.

* This method allow you to send requests to the Algolia REST API.
*
* @param customPut - The customPut object.

@@ -215,4 +210,3 @@ * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.

* Required API Key ACLs:
* - editSettings.
*
* - editSettings
* @param deleteABTest - The deleteABTest object.

@@ -241,4 +235,3 @@ * @param deleteABTest.id - Unique A/B test identifier.

* Required API Key ACLs:
* - analytics.
*
* - analytics
* @param getABTest - The getABTest object.

@@ -267,4 +260,3 @@ * @param getABTest.id - Unique A/B test identifier.

* Required API Key ACLs:
* - analytics.
*
* - analytics
* @param listABTests - The listABTests object.

@@ -282,12 +274,12 @@ * @param listABTests.offset - Position of the first item to return.

if (offset !== void 0) {
queryParameters.offset = offset.toString();
queryParameters["offset"] = offset.toString();
}
if (limit !== void 0) {
queryParameters.limit = limit.toString();
queryParameters["limit"] = limit.toString();
}
if (indexPrefix !== void 0) {
queryParameters.indexPrefix = indexPrefix.toString();
queryParameters["indexPrefix"] = indexPrefix.toString();
}
if (indexSuffix !== void 0) {
queryParameters.indexSuffix = indexSuffix.toString();
queryParameters["indexSuffix"] = indexSuffix.toString();
}

@@ -306,4 +298,3 @@ const request = {

* Required API Key ACLs:
* - editSettings.
*
* - editSettings
* @param scheduleABTestsRequest - The scheduleABTestsRequest object.

@@ -344,4 +335,3 @@ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.

* Required API Key ACLs:
* - editSettings.
*
* - editSettings
* @param stopABTest - The stopABTest object.

@@ -348,0 +338,0 @@ * @param stopABTest.id - Unique A/B test identifier.

// eslint-disable-next-line import/no-commonjs,import/extensions
module.exports = require('./dist/builds/node.cjs');
module.exports = require('./dist/builds/node.cjs');

@@ -21,3 +21,3 @@ // 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.

revenueSignificance?: Record<string, number> | null;
revenueSignificance?: { [key: string]: number } | null;

@@ -49,5 +49,5 @@ /**

*/
variants: Variant[];
variants: Array<Variant>;
configuration?: ABTestConfiguration;
};

@@ -14,3 +14,3 @@ // 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.

*/
variants: AddABTestsVariant[];
variants: Array<AddABTestsVariant>;

@@ -17,0 +17,0 @@ /**

@@ -14,3 +14,3 @@ // 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.

*/
parameters?: Record<string, any>;
parameters?: { [key: string]: any };
};

@@ -29,3 +29,3 @@

*/
parameters?: Record<string, any>;
parameters?: { [key: string]: any };
};

@@ -44,3 +44,3 @@

*/
parameters?: Record<string, any>;
parameters?: { [key: string]: any };
/**

@@ -63,3 +63,3 @@ * Parameters to send with the custom request.

*/
parameters?: Record<string, any>;
parameters?: { [key: string]: any };
/**

@@ -66,0 +66,0 @@ * Parameters to send with the custom request.

@@ -10,2 +10,3 @@ // 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.

export * from './addABTestsVariant';
export * from './clientMethodProps';
export * from './currency';

@@ -26,2 +27,1 @@ export * from './customSearchParams';

export * from './variant';
export * from './clientMethodProps';

@@ -9,3 +9,3 @@ // 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.

*/
abtests: ABTest[] | null;
abtests: Array<ABTest> | null;

@@ -12,0 +12,0 @@ /**

@@ -14,3 +14,3 @@ // 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.

*/
variants: AddABTestsVariant[];
variants: Array<AddABTestsVariant>;

@@ -17,0 +17,0 @@ /**

@@ -6,2 +6,2 @@ // 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.

*/
export type Status = 'active' | 'expired' | 'failed' | 'stopped';
export type Status = 'active' | 'stopped' | 'expired' | 'failed';

@@ -45,3 +45,3 @@ // 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.

*/
currencies?: Record<string, Currency>;
currencies?: { [key: string]: Currency };

@@ -48,0 +48,0 @@ /**

{
"version": "5.7.0",
"version": "5.8.0",
"repository": {

@@ -52,6 +52,6 @@ "type": "git",

"dependencies": {
"@algolia/client-common": "5.7.0",
"@algolia/requester-browser-xhr": "5.7.0",
"@algolia/requester-fetch": "5.7.0",
"@algolia/requester-node-http": "5.7.0"
"@algolia/client-common": "5.8.0",
"@algolia/requester-browser-xhr": "5.8.0",
"@algolia/requester-fetch": "5.8.0",
"@algolia/requester-node-http": "5.8.0"
},

@@ -62,3 +62,3 @@ "devDependencies": {

"publint": "0.2.11",
"rollup": "4.22.5",
"rollup": "4.24.0",
"tsup": "8.3.0",

@@ -65,0 +65,0 @@ "typescript": "5.6.2"

@@ -43,9 +43,8 @@ <p align="center">

```bash
yarn add @algolia/client-abtesting@5.7.0
yarn add @algolia/client-abtesting@5.8.0
# or
npm install @algolia/client-abtesting@5.7.0
npm install @algolia/client-abtesting@5.8.0
# or
pnpm add @algolia/client-abtesting@5.7.0
pnpm add @algolia/client-abtesting@5.8.0
```

@@ -58,3 +57,3 @@

```html
<script src="https://cdn.jsdelivr.net/npm/@algolia/client-abtesting@5.7.0/dist/builds/browser.umd.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@algolia/client-abtesting@5.8.0/dist/builds/browser.umd.js"></script>
```

@@ -80,2 +79,2 @@

The Algolia JavaScript API Client is an open-sourced software licensed under the [MIT license](LICENSE).
The Algolia JavaScript API Client is an open-sourced software licensed under the [MIT license](LICENSE).

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc