@algolia/client-abtesting
Advanced tools
Comparing version 5.2.5 to 5.3.0
import * as _algolia_client_common from '@algolia/client-common'; | ||
import { ClientOptions } from '@algolia/client-common'; | ||
import { CreateClientOptions, RequestOptions, ClientOptions } from '@algolia/client-common'; | ||
@@ -280,50 +280,2 @@ /** | ||
/** | ||
* Error. | ||
*/ | ||
type ErrorBase = Record<string, any> & { | ||
message?: string; | ||
}; | ||
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; | ||
}; | ||
/** | ||
* Properties for the `customDelete` method. | ||
@@ -437,28 +389,196 @@ */ | ||
declare const apiClientVersion = "5.2.5"; | ||
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.3.0"; | ||
declare const REGIONS: readonly ["de", "us"]; | ||
type Region = (typeof REGIONS)[number]; | ||
/** | ||
* The client type. | ||
*/ | ||
type AbtestingClient = ReturnType<typeof abtestingClient>; | ||
declare function abtestingClient(appId: string, apiKey: string, region?: Region, options?: ClientOptions): { | ||
declare function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }: CreateClientOptions & { | ||
region?: Region; | ||
}): { | ||
transporter: _algolia_client_common.Transporter; | ||
/** | ||
* The `appId` currently in use. | ||
*/ | ||
appId: string; | ||
/** | ||
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties. | ||
*/ | ||
clearCache(): Promise<void>; | ||
/** | ||
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system. | ||
*/ | ||
readonly _ua: string; | ||
/** | ||
* Adds a `segment` to the `x-algolia-agent` sent with every requests. | ||
* | ||
* @param segment - The algolia agent (user-agent) segment to add. | ||
* @param version - The version of the agent. | ||
*/ | ||
addAlgoliaAgent(segment: string, version?: string): void; | ||
addABTests(addABTestsRequest: AddABTestsRequest, requestOptions?: _algolia_client_common.RequestOptions): Promise<ABTestResponse>; | ||
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<Record<string, unknown>>; | ||
customGet({ path, parameters }: CustomGetProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<Record<string, unknown>>; | ||
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<Record<string, unknown>>; | ||
customPut({ path, parameters, body }: CustomPutProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<Record<string, unknown>>; | ||
deleteABTest({ id }: DeleteABTestProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<ABTestResponse>; | ||
getABTest({ id }: GetABTestProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<ABTest>; | ||
listABTests({ offset, limit, indexPrefix, indexSuffix }?: ListABTestsProps, requestOptions?: _algolia_client_common.RequestOptions | undefined): Promise<ListABTestsResponse>; | ||
scheduleABTest(scheduleABTestsRequest: ScheduleABTestsRequest, requestOptions?: _algolia_client_common.RequestOptions): Promise<ScheduleABTestResponse>; | ||
stopABTest({ id }: StopABTestProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<ABTestResponse>; | ||
/** | ||
* Helper method to switch the API key used to authenticate the requests. | ||
* | ||
* @param params - Method params. | ||
* @param params.apiKey - The new API Key to use. | ||
*/ | ||
setClientApiKey({ apiKey }: { | ||
apiKey: string; | ||
}): void; | ||
/** | ||
* Creates a new A/B test. | ||
* | ||
* Required API Key ACLs: | ||
* - editSettings. | ||
* | ||
* @param addABTestsRequest - The addABTestsRequest object. | ||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. | ||
*/ | ||
addABTests(addABTestsRequest: AddABTestsRequest, requestOptions?: RequestOptions): Promise<ABTestResponse>; | ||
/** | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customDelete - The customDelete object. | ||
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* @param customDelete.parameters - Query parameters to apply to the current query. | ||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. | ||
*/ | ||
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>; | ||
/** | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customGet - The customGet object. | ||
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* @param customGet.parameters - Query parameters to apply to the current query. | ||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. | ||
*/ | ||
customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>; | ||
/** | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customPost - The customPost object. | ||
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* @param customPost.parameters - Query parameters to apply to the current query. | ||
* @param customPost.body - Parameters to send with the custom request. | ||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. | ||
*/ | ||
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>; | ||
/** | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customPut - The customPut object. | ||
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* @param customPut.parameters - Query parameters to apply to the current query. | ||
* @param customPut.body - Parameters to send with the custom request. | ||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. | ||
*/ | ||
customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>; | ||
/** | ||
* Deletes an A/B test by its ID. | ||
* | ||
* Required API Key ACLs: | ||
* - editSettings. | ||
* | ||
* @param deleteABTest - The deleteABTest object. | ||
* @param deleteABTest.id - Unique A/B test identifier. | ||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. | ||
*/ | ||
deleteABTest({ id }: DeleteABTestProps, requestOptions?: RequestOptions): Promise<ABTestResponse>; | ||
/** | ||
* Retrieves the details for an A/B test by its ID. | ||
* | ||
* Required API Key ACLs: | ||
* - analytics. | ||
* | ||
* @param getABTest - The getABTest object. | ||
* @param getABTest.id - Unique A/B test identifier. | ||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. | ||
*/ | ||
getABTest({ id }: GetABTestProps, requestOptions?: RequestOptions): Promise<ABTest>; | ||
/** | ||
* Lists all A/B tests you configured for this application. | ||
* | ||
* Required API Key ACLs: | ||
* - analytics. | ||
* | ||
* @param listABTests - The listABTests object. | ||
* @param listABTests.offset - Position of the first item to return. | ||
* @param listABTests.limit - Number of items to return. | ||
* @param listABTests.indexPrefix - Index name prefix. Only A/B tests for indices starting with this string are included in the response. | ||
* @param listABTests.indexSuffix - Index name suffix. Only A/B tests for indices ending with this string are included in the response. | ||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. | ||
*/ | ||
listABTests({ offset, limit, indexPrefix, indexSuffix }?: ListABTestsProps, requestOptions?: RequestOptions | undefined): Promise<ListABTestsResponse>; | ||
/** | ||
* Schedule an A/B test to be started at a later time. | ||
* | ||
* Required API Key ACLs: | ||
* - editSettings. | ||
* | ||
* @param scheduleABTestsRequest - The scheduleABTestsRequest object. | ||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. | ||
*/ | ||
scheduleABTest(scheduleABTestsRequest: ScheduleABTestsRequest, requestOptions?: RequestOptions): Promise<ScheduleABTestResponse>; | ||
/** | ||
* Stops an A/B test by its ID. You can\'t restart stopped A/B tests. | ||
* | ||
* Required API Key ACLs: | ||
* - editSettings. | ||
* | ||
* @param stopABTest - The stopABTest object. | ||
* @param stopABTest.id - Unique A/B test identifier. | ||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. | ||
*/ | ||
stopABTest({ id }: StopABTestProps, requestOptions?: RequestOptions): Promise<ABTestResponse>; | ||
}; | ||
/** | ||
* Error. | ||
*/ | ||
type ErrorBase = Record<string, any> & { | ||
message?: string; | ||
}; | ||
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 }; |
@@ -14,3 +14,3 @@ // builds/browser.ts | ||
import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common"; | ||
var apiClientVersion = "5.2.5"; | ||
var apiClientVersion = "5.3.0"; | ||
var REGIONS = ["de", "us"]; | ||
@@ -30,22 +30,21 @@ function getDefaultHosts(region) { | ||
const auth = createAuth(appIdOption, apiKeyOption, authMode); | ||
const transporter = createTransporter({ | ||
hosts: getDefaultHosts(regionOption), | ||
...options, | ||
algoliaAgent: getAlgoliaAgent({ | ||
algoliaAgents, | ||
client: "Abtesting", | ||
version: apiClientVersion | ||
return { | ||
transporter: createTransporter({ | ||
hosts: getDefaultHosts(regionOption), | ||
...options, | ||
algoliaAgent: getAlgoliaAgent({ | ||
algoliaAgents, | ||
client: "Abtesting", | ||
version: apiClientVersion | ||
}), | ||
baseHeaders: { | ||
"content-type": "text/plain", | ||
...auth.headers(), | ||
...options.baseHeaders | ||
}, | ||
baseQueryParameters: { | ||
...auth.queryParameters(), | ||
...options.baseQueryParameters | ||
} | ||
}), | ||
baseHeaders: { | ||
"content-type": "text/plain", | ||
...auth.headers(), | ||
...options.baseHeaders | ||
}, | ||
baseQueryParameters: { | ||
...auth.queryParameters(), | ||
...options.baseQueryParameters | ||
} | ||
}); | ||
return { | ||
transporter, | ||
/** | ||
@@ -59,3 +58,5 @@ * The `appId` currently in use. | ||
clearCache() { | ||
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0); | ||
return Promise.all([this.transporter.requestsCache.clear(), this.transporter.responsesCache.clear()]).then( | ||
() => void 0 | ||
); | ||
}, | ||
@@ -66,3 +67,3 @@ /** | ||
get _ua() { | ||
return transporter.algoliaAgent.value; | ||
return this.transporter.algoliaAgent.value; | ||
}, | ||
@@ -76,5 +77,14 @@ /** | ||
addAlgoliaAgent(segment, version) { | ||
transporter.algoliaAgent.add({ segment, version }); | ||
this.transporter.algoliaAgent.add({ segment, version }); | ||
}, | ||
/** | ||
* Helper method to switch the API key used to authenticate the requests. | ||
* | ||
* @param params - Method params. | ||
* @param params.apiKey - The new API Key to use. | ||
*/ | ||
setClientApiKey({ apiKey }) { | ||
this.transporter.baseHeaders["x-algolia-api-key"] = apiKey; | ||
}, | ||
/** | ||
* Creates a new A/B test. | ||
@@ -111,3 +121,3 @@ * | ||
}; | ||
return transporter.request(request, requestOptions); | ||
return this.transporter.request(request, requestOptions); | ||
}, | ||
@@ -135,3 +145,3 @@ /** | ||
}; | ||
return transporter.request(request, requestOptions); | ||
return this.transporter.request(request, requestOptions); | ||
}, | ||
@@ -159,3 +169,3 @@ /** | ||
}; | ||
return transporter.request(request, requestOptions); | ||
return this.transporter.request(request, requestOptions); | ||
}, | ||
@@ -185,3 +195,3 @@ /** | ||
}; | ||
return transporter.request(request, requestOptions); | ||
return this.transporter.request(request, requestOptions); | ||
}, | ||
@@ -211,3 +221,3 @@ /** | ||
}; | ||
return transporter.request(request, requestOptions); | ||
return this.transporter.request(request, requestOptions); | ||
}, | ||
@@ -237,3 +247,3 @@ /** | ||
}; | ||
return transporter.request(request, requestOptions); | ||
return this.transporter.request(request, requestOptions); | ||
}, | ||
@@ -263,3 +273,3 @@ /** | ||
}; | ||
return transporter.request(request, requestOptions); | ||
return this.transporter.request(request, requestOptions); | ||
}, | ||
@@ -301,3 +311,3 @@ /** | ||
}; | ||
return transporter.request(request, requestOptions); | ||
return this.transporter.request(request, requestOptions); | ||
}, | ||
@@ -339,3 +349,3 @@ /** | ||
}; | ||
return transporter.request(request, requestOptions); | ||
return this.transporter.request(request, requestOptions); | ||
}, | ||
@@ -365,3 +375,3 @@ /** | ||
}; | ||
return transporter.request(request, requestOptions); | ||
return this.transporter.request(request, requestOptions); | ||
} | ||
@@ -368,0 +378,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
function H(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 W(t){let e,s=`algolia-client-js-${t.key}`;function r(){return e===void 0&&(e=t.localStorage||window.localStorage),e}function n(){return JSON.parse(r().getItem(s)||"{}")}function m(a){r().setItem(s,JSON.stringify(a))}function f(){let a=t.timeToLive?t.timeToLive*1e3:null,o=n(),i=Object.fromEntries(Object.entries(o).filter(([,d])=>d.timestamp!==void 0));if(m(i),!a)return;let u=Object.fromEntries(Object.entries(i).filter(([,d])=>{let l=new Date().getTime();return!(d.timestamp+a<l)}));m(u)}return{get(a,o,i={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(f(),n()[JSON.stringify(a)])).then(u=>Promise.all([u?u.value:o(),u!==void 0])).then(([u,d])=>Promise.all([u,d||i.miss(u)])).then(([u])=>u)},set(a,o){return Promise.resolve().then(()=>{let i=n();return i[JSON.stringify(a)]={timestamp:new Date().getTime(),value:o},r().setItem(s,JSON.stringify(i)),o})},delete(a){return Promise.resolve().then(()=>{let o=n();delete o[JSON.stringify(a)],r().setItem(s,JSON.stringify(o))})},clear(){return Promise.resolve().then(()=>{r().removeItem(s)})}}}function Y(){return{get(t,e,s={miss:()=>Promise.resolve()}){return e().then(n=>Promise.all([n,s.miss(n)])).then(([n])=>n)},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?Y():{get(r,n,m={miss:()=>Promise.resolve()}){return s.get(r,n,m).catch(()=>q({caches:e}).get(r,n,m))},set(r,n){return s.set(r,n).catch(()=>q({caches:e}).set(r,n))},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,n={miss:()=>Promise.resolve()}){let m=JSON.stringify(s);if(m in e)return Promise.resolve(t.serializable?JSON.parse(e[m]):e[m]);let f=r();return f.then(a=>n.miss(a)).then(()=>f)},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 L=2*60*1e3;function k(t,e="up"){let s=Date.now();function r(){return e==="up"||Date.now()-s>L}function n(){return e==="timed out"&&Date.now()-s<=L}return{...t,status:e,lastUpdate:s,isUp:r,isTimedOut:n}}var j=class extends Error{name="AlgoliaError";constructor(t,e){super(t),e&&(this.name=e)}},J=class extends j{stackTrace;constructor(t,e,s){super(t,s),this.stackTrace=e}},Z=class extends J{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")}},x=class extends J{status;constructor(t,e,s,r="ApiError"){super(t,s,r),this.status=e}},ee=class extends j{response;constructor(t,e){super(t,"DeserializationError"),this.response=e}},te=class extends x{error;constructor(t,e,s,r){super(t,e,r,"DetailedApiError"),this.error=s}};function re(t,e,s){let r=se(s),n=`${t.protocol}://${t.url}${t.port?`:${t.port}`:""}/${e.charAt(0)==="/"?e.substring(1):e}`;return r.length&&(n+=`?${r}`),n}function se(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 oe(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 ae(t,e,s){let r={Accept:"application/json",...t,...e,...s},n={};return Object.keys(r).forEach(m=>{let f=r[m];n[m.toLowerCase()]=f}),n}function ne(t){try{return JSON.parse(t.content)}catch(e){throw new ee(e.message,t)}}function ie({content:t,status:e},s){try{let r=JSON.parse(t);return"error"in r?new te(r.message,e,r.error,s):new x(r.message,e,s)}catch{}return new x(t,e,s)}function ce({isTimedOut:t,status:e}){return!t&&~~e===0}function ue({isTimedOut:t,status:e}){return t||ce({isTimedOut:t,status:e})||~~(e/100)!==2&&~~(e/100)!==4}function le({status:t}){return~~(t/100)===2}function me(t){return t.map(e=>$(e))}function $(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 M({hosts:t,hostsCache:e,baseHeaders:s,baseQueryParameters:r,algoliaAgent:n,timeouts:m,requester:f,requestsCache:a,responsesCache:o}){async function i(l){let c=await Promise.all(l.map(p=>e.get(p,()=>Promise.resolve(k(p))))),P=c.filter(p=>p.isUp()),h=c.filter(p=>p.isTimedOut()),E=[...P,...h];return{hosts:E.length>0?E:l,getTimeout(p,y){return(h.length===0&&p===0?1:h.length+3+p)*y}}}async function u(l,c,P=!0){let h=[],E=oe(l,c),T=ae(s,l.headers,c.headers),p=l.method==="GET"?{...l.data,...c.data}:{},y={...r,...l.queryParameters,...p};if(n.value&&(y["x-algolia-agent"]=n.value),c&&c.queryParameters)for(let g of Object.keys(c.queryParameters))!c.queryParameters[g]||Object.prototype.toString.call(c.queryParameters[g])==="[object Object]"?y[g]=c.queryParameters[g]:y[g]=c.queryParameters[g].toString();let w=0,N=async(g,S)=>{let R=g.pop();if(R===void 0)throw new Z(me(h));let B={...m,...c.timeouts},_={data:E,headers:T,method:l.method,url:re(R,l.path,y),connectTimeout:S(w,B.connect),responseTimeout:S(w,P?B.read:B.write)},U=b=>{let I={request:_,response:b,host:R,triesLeft:g.length};return h.push(I),I},A=await f.send(_);if(ue(A)){let b=U(A);return A.isTimedOut&&w++,console.log("Retryable failure",$(b)),await e.set(R,k(R,A.isTimedOut?"timed out":"down")),N(g,S)}if(le(A))return ne(A);throw U(A),ie(A,h)},K=t.filter(g=>g.accept==="readWrite"||(P?g.accept==="read":g.accept==="write")),D=await i(K);return N([...D.hosts].reverse(),D.getTimeout)}function d(l,c={}){let P=l.useReadTransporter||l.method==="GET";if(!P)return u(l,c,P);let h=()=>u(l,c);if((c.cacheable||l.cacheable)!==!0)return h();let T={request:l,requestOptions:c,transporter:{queryParameters:r,headers:s}};return o.get(T,()=>a.get(T,()=>a.set(T,h()).then(p=>Promise.all([a.delete(T),p]),p=>Promise.all([a.delete(T),Promise.reject(p)])).then(([p,y])=>y)),{miss:p=>o.set(T,p)})}return{hostsCache:e,requester:f,timeouts:m,algoliaAgent:n,baseHeaders:s,baseQueryParameters:r,hosts:t,request:d,requestsCache:a,responsesCache:o}}function de(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({algoliaAgents:t,client:e,version:s}){let r=de(s).add({segment:e,version:s});return t.forEach(n=>r.add(n)),r}var Q=1e3,z=2e3,F=3e4;function X(){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 n=(a,o)=>setTimeout(()=>{r.abort(),s({status:0,content:o,isTimedOut:!0})},a),m=n(e.connectTimeout,"Connection timeout"),f;r.onreadystatechange=()=>{r.readyState>r.OPENED&&f===void 0&&(clearTimeout(m),f=n(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{r.status===0&&(clearTimeout(m),clearTimeout(f),s({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(m),clearTimeout(f),s({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)})}return{send:t}}var v="5.2.5",C=["de","us"];function he(t){return[{url:t?"analytics.{region}.algolia.com".replace("{region}",t):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]}function V({appId:t,apiKey:e,authMode:s,algoliaAgents:r,region:n,...m}){let f=H(t,e,s),a=M({hosts:he(n),...m,algoliaAgent:G({algoliaAgents:r,client:"Abtesting",version:v}),baseHeaders:{"content-type":"text/plain",...f.headers(),...m.baseHeaders},baseQueryParameters:{...f.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,i){a.algoliaAgent.add({segment:o,version:i})},addABTests(o,i){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,i)},customDelete({path:o,parameters:i},u){if(!o)throw new Error("Parameter `path` is required when calling `customDelete`.");let P={method:"DELETE",path:"/{path}".replace("{path}",o),queryParameters:i||{},headers:{}};return a.request(P,u)},customGet({path:o,parameters:i},u){if(!o)throw new Error("Parameter `path` is required when calling `customGet`.");let P={method:"GET",path:"/{path}".replace("{path}",o),queryParameters:i||{},headers:{}};return a.request(P,u)},customPost({path:o,parameters:i,body:u},d){if(!o)throw new Error("Parameter `path` is required when calling `customPost`.");let h={method:"POST",path:"/{path}".replace("{path}",o),queryParameters:i||{},headers:{},data:u||{}};return a.request(h,d)},customPut({path:o,parameters:i,body:u},d){if(!o)throw new Error("Parameter `path` is required when calling `customPut`.");let h={method:"PUT",path:"/{path}".replace("{path}",o),queryParameters:i||{},headers:{},data:u||{}};return a.request(h,d)},deleteABTest({id:o},i){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,i)},getABTest({id:o},i){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,i)},listABTests({offset:o,limit:i,indexPrefix:u,indexSuffix:d}={},l=void 0){let c="/2/abtests",P={},h={};o!==void 0&&(h.offset=o.toString()),i!==void 0&&(h.limit=i.toString()),u!==void 0&&(h.indexPrefix=u.toString()),d!==void 0&&(h.indexSuffix=d.toString());let E={method:"GET",path:c,queryParameters:h,headers:P};return a.request(E,l)},scheduleABTest(o,i){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,i)},stopABTest({id:o},i){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,i)}}}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"||!C.includes(s)))throw new Error(`\`region\` must be one of the following: ${C.join(", ")}`);return V({appId:t,apiKey:e,region:s,timeouts:{connect:Q,read:z,write:F},requester:X(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:O(),requestsCache:O({serializable:!1}),hostsCache:q({caches:[W({key:`${v}-${t}`}),O()]}),...r})}export{Ye as abtestingClient,v as apiClientVersion}; | ||
function H(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 W(t){let e,s=`algolia-client-js-${t.key}`;function r(){return e===void 0&&(e=t.localStorage||window.localStorage),e}function n(){return JSON.parse(r().getItem(s)||"{}")}function m(o){r().setItem(s,JSON.stringify(o))}function p(){let o=t.timeToLive?t.timeToLive*1e3:null,a=n(),u=Object.fromEntries(Object.entries(a).filter(([,d])=>d.timestamp!==void 0));if(m(u),!o)return;let l=Object.fromEntries(Object.entries(u).filter(([,d])=>{let i=new Date().getTime();return!(d.timestamp+o<i)}));m(l)}return{get(o,a,u={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(p(),n()[JSON.stringify(o)])).then(l=>Promise.all([l?l.value:a(),l!==void 0])).then(([l,d])=>Promise.all([l,d||u.miss(l)])).then(([l])=>l)},set(o,a){return Promise.resolve().then(()=>{let u=n();return u[JSON.stringify(o)]={timestamp:new Date().getTime(),value:a},r().setItem(s,JSON.stringify(u)),a})},delete(o){return Promise.resolve().then(()=>{let a=n();delete a[JSON.stringify(o)],r().setItem(s,JSON.stringify(a))})},clear(){return Promise.resolve().then(()=>{r().removeItem(s)})}}}function Y(){return{get(t,e,s={miss:()=>Promise.resolve()}){return e().then(n=>Promise.all([n,s.miss(n)])).then(([n])=>n)},set(t,e){return Promise.resolve(e)},delete(t){return Promise.resolve()},clear(){return Promise.resolve()}}}function E(t){let e=[...t.caches],s=e.shift();return s===void 0?Y():{get(r,n,m={miss:()=>Promise.resolve()}){return s.get(r,n,m).catch(()=>E({caches:e}).get(r,n,m))},set(r,n){return s.set(r,n).catch(()=>E({caches:e}).set(r,n))},delete(r){return s.delete(r).catch(()=>E({caches:e}).delete(r))},clear(){return s.clear().catch(()=>E({caches:e}).clear())}}}function O(t={serializable:!0}){let e={};return{get(s,r,n={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(o=>n.miss(o)).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 L=2*60*1e3;function k(t,e="up"){let s=Date.now();function r(){return e==="up"||Date.now()-s>L}function n(){return e==="timed out"&&Date.now()-s<=L}return{...t,status:e,lastUpdate:s,isUp:r,isTimedOut:n}}var j=class extends Error{name="AlgoliaError";constructor(t,e){super(t),e&&(this.name=e)}},J=class extends j{stackTrace;constructor(t,e,s){super(t,s),this.stackTrace=e}},Z=class extends J{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")}},x=class extends J{status;constructor(t,e,s,r="ApiError"){super(t,s,r),this.status=e}},ee=class extends j{response;constructor(t,e){super(t,"DeserializationError"),this.response=e}},te=class extends x{error;constructor(t,e,s,r){super(t,e,r,"DetailedApiError"),this.error=s}};function re(t,e,s){let r=se(s),n=`${t.protocol}://${t.url}${t.port?`:${t.port}`:""}/${e.charAt(0)==="/"?e.substring(1):e}`;return r.length&&(n+=`?${r}`),n}function se(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 oe(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 ae(t,e,s){let r={Accept:"application/json",...t,...e,...s},n={};return Object.keys(r).forEach(m=>{let p=r[m];n[m.toLowerCase()]=p}),n}function ne(t){try{return JSON.parse(t.content)}catch(e){throw new ee(e.message,t)}}function ie({content:t,status:e},s){try{let r=JSON.parse(t);return"error"in r?new te(r.message,e,r.error,s):new x(r.message,e,s)}catch{}return new x(t,e,s)}function ce({isTimedOut:t,status:e}){return!t&&~~e===0}function ue({isTimedOut:t,status:e}){return t||ce({isTimedOut:t,status:e})||~~(e/100)!==2&&~~(e/100)!==4}function le({status:t}){return~~(t/100)===2}function me(t){return t.map(e=>$(e))}function $(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 M({hosts:t,hostsCache:e,baseHeaders:s,baseQueryParameters:r,algoliaAgent:n,timeouts:m,requester:p,requestsCache:o,responsesCache:a}){async function u(i){let c=await Promise.all(i.map(h=>e.get(h,()=>Promise.resolve(k(h))))),f=c.filter(h=>h.isUp()),g=c.filter(h=>h.isTimedOut()),q=[...f,...g];return{hosts:q.length>0?q:i,getTimeout(h,y){return(g.length===0&&h===0?1:g.length+3+h)*y}}}async function l(i,c,f=!0){let g=[],q=oe(i,c),T=ae(s,i.headers,c.headers),h=i.method==="GET"?{...i.data,...c.data}:{},y={...r,...i.queryParameters,...h};if(n.value&&(y["x-algolia-agent"]=n.value),c&&c.queryParameters)for(let P of Object.keys(c.queryParameters))!c.queryParameters[P]||Object.prototype.toString.call(c.queryParameters[P])==="[object Object]"?y[P]=c.queryParameters[P]:y[P]=c.queryParameters[P].toString();let w=0,N=async(P,S)=>{let R=P.pop();if(R===void 0)throw new Z(me(g));let B={...m,...c.timeouts},_={data:q,headers:T,method:i.method,url:re(R,i.path,y),connectTimeout:S(w,B.connect),responseTimeout:S(w,f?B.read:B.write)},U=b=>{let I={request:_,response:b,host:R,triesLeft:P.length};return g.push(I),I},A=await p.send(_);if(ue(A)){let b=U(A);return A.isTimedOut&&w++,console.log("Retryable failure",$(b)),await e.set(R,k(R,A.isTimedOut?"timed out":"down")),N(P,S)}if(le(A))return ne(A);throw U(A),ie(A,g)},V=t.filter(P=>P.accept==="readWrite"||(f?P.accept==="read":P.accept==="write")),D=await u(V);return N([...D.hosts].reverse(),D.getTimeout)}function d(i,c={}){let f=i.useReadTransporter||i.method==="GET";if(!f)return l(i,c,f);let g=()=>l(i,c);if((c.cacheable||i.cacheable)!==!0)return g();let T={request:i,requestOptions:c,transporter:{queryParameters:r,headers:s}};return a.get(T,()=>o.get(T,()=>o.set(T,g()).then(h=>Promise.all([o.delete(T),h]),h=>Promise.all([o.delete(T),Promise.reject(h)])).then(([h,y])=>y)),{miss:h=>a.set(T,h)})}return{hostsCache:e,requester:p,timeouts:m,algoliaAgent:n,baseHeaders:s,baseQueryParameters:r,hosts:t,request:d,requestsCache:o,responsesCache:a}}function de(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({algoliaAgents:t,client:e,version:s}){let r=de(s).add({segment:e,version:s});return t.forEach(n=>r.add(n)),r}var Q=1e3,z=2e3,F=3e4;function X(){function t(e){return new Promise(s=>{let r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach(o=>r.setRequestHeader(o,e.headers[o]));let n=(o,a)=>setTimeout(()=>{r.abort(),s({status:0,content:a,isTimedOut:!0})},o),m=n(e.connectTimeout,"Connection timeout"),p;r.onreadystatechange=()=>{r.readyState>r.OPENED&&p===void 0&&(clearTimeout(m),p=n(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 v="5.3.0",C=["de","us"];function he(t){return[{url:t?"analytics.{region}.algolia.com".replace("{region}",t):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]}function K({appId:t,apiKey:e,authMode:s,algoliaAgents:r,region:n,...m}){let p=H(t,e,s);return{transporter:M({hosts:he(n),...m,algoliaAgent:G({algoliaAgents:r,client:"Abtesting",version:v}),baseHeaders:{"content-type":"text/plain",...p.headers(),...m.baseHeaders},baseQueryParameters:{...p.queryParameters(),...m.baseQueryParameters}}),appId:t,clearCache(){return Promise.all([this.transporter.requestsCache.clear(),this.transporter.responsesCache.clear()]).then(()=>{})},get _ua(){return this.transporter.algoliaAgent.value},addAlgoliaAgent(o,a){this.transporter.algoliaAgent.add({segment:o,version:a})},setClientApiKey({apiKey:o}){this.transporter.baseHeaders["x-algolia-api-key"]=o},addABTests(o,a){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 i={method:"POST",path:"/2/abtests",queryParameters:{},headers:{},data:o};return this.transporter.request(i,a)},customDelete({path:o,parameters:a},u){if(!o)throw new Error("Parameter `path` is required when calling `customDelete`.");let c={method:"DELETE",path:"/{path}".replace("{path}",o),queryParameters:a||{},headers:{}};return this.transporter.request(c,u)},customGet({path:o,parameters:a},u){if(!o)throw new Error("Parameter `path` is required when calling `customGet`.");let c={method:"GET",path:"/{path}".replace("{path}",o),queryParameters:a||{},headers:{}};return this.transporter.request(c,u)},customPost({path:o,parameters:a,body:u},l){if(!o)throw new Error("Parameter `path` is required when calling `customPost`.");let f={method:"POST",path:"/{path}".replace("{path}",o),queryParameters:a||{},headers:{},data:u||{}};return this.transporter.request(f,l)},customPut({path:o,parameters:a,body:u},l){if(!o)throw new Error("Parameter `path` is required when calling `customPut`.");let f={method:"PUT",path:"/{path}".replace("{path}",o),queryParameters:a||{},headers:{},data:u||{}};return this.transporter.request(f,l)},deleteABTest({id:o},a){if(!o)throw new Error("Parameter `id` is required when calling `deleteABTest`.");let i={method:"DELETE",path:"/2/abtests/{id}".replace("{id}",encodeURIComponent(o)),queryParameters:{},headers:{}};return this.transporter.request(i,a)},getABTest({id:o},a){if(!o)throw new Error("Parameter `id` is required when calling `getABTest`.");let i={method:"GET",path:"/2/abtests/{id}".replace("{id}",encodeURIComponent(o)),queryParameters:{},headers:{}};return this.transporter.request(i,a)},listABTests({offset:o,limit:a,indexPrefix:u,indexSuffix:l}={},d=void 0){let i="/2/abtests",c={},f={};o!==void 0&&(f.offset=o.toString()),a!==void 0&&(f.limit=a.toString()),u!==void 0&&(f.indexPrefix=u.toString()),l!==void 0&&(f.indexSuffix=l.toString());let g={method:"GET",path:i,queryParameters:f,headers:c};return this.transporter.request(g,d)},scheduleABTest(o,a){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 i={method:"POST",path:"/2/abtests/schedule",queryParameters:{},headers:{},data:o};return this.transporter.request(i,a)},stopABTest({id:o},a){if(!o)throw new Error("Parameter `id` is required when calling `stopABTest`.");let i={method:"POST",path:"/2/abtests/{id}/stop".replace("{id}",encodeURIComponent(o)),queryParameters:{},headers:{}};return this.transporter.request(i,a)}}}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"||!C.includes(s)))throw new Error(`\`region\` must be one of the following: ${C.join(", ")}`);return K({appId:t,apiKey:e,region:s,timeouts:{connect:Q,read:z,write:F},requester:X(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:O(),requestsCache:O({serializable:!1}),hostsCache:E({caches:[W({key:`${v}-${t}`}),O()]}),...r})}export{Ye as abtestingClient,v as apiClientVersion}; | ||
//# sourceMappingURL=browser.min.js.map |
@@ -7,3 +7,3 @@ (function (global, factory) { | ||
function H(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 W(t){let e,s=`algolia-client-js-${t.key}`;function r(){return e===void 0&&(e=t.localStorage||window.localStorage),e}function n(){return JSON.parse(r().getItem(s)||"{}")}function m(a){r().setItem(s,JSON.stringify(a));}function f(){let a=t.timeToLive?t.timeToLive*1e3:null,o=n(),i=Object.fromEntries(Object.entries(o).filter(([,d])=>d.timestamp!==void 0));if(m(i),!a)return;let u=Object.fromEntries(Object.entries(i).filter(([,d])=>{let l=new Date().getTime();return !(d.timestamp+a<l)}));m(u);}return {get(a,o,i={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(f(),n()[JSON.stringify(a)])).then(u=>Promise.all([u?u.value:o(),u!==void 0])).then(([u,d])=>Promise.all([u,d||i.miss(u)])).then(([u])=>u)},set(a,o){return Promise.resolve().then(()=>{let i=n();return i[JSON.stringify(a)]={timestamp:new Date().getTime(),value:o},r().setItem(s,JSON.stringify(i)),o})},delete(a){return Promise.resolve().then(()=>{let o=n();delete o[JSON.stringify(a)],r().setItem(s,JSON.stringify(o));})},clear(){return Promise.resolve().then(()=>{r().removeItem(s);})}}}function Y(){return {get(t,e,s={miss:()=>Promise.resolve()}){return e().then(n=>Promise.all([n,s.miss(n)])).then(([n])=>n)},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?Y():{get(r,n,m={miss:()=>Promise.resolve()}){return s.get(r,n,m).catch(()=>q({caches:e}).get(r,n,m))},set(r,n){return s.set(r,n).catch(()=>q({caches:e}).set(r,n))},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,n={miss:()=>Promise.resolve()}){let m=JSON.stringify(s);if(m in e)return Promise.resolve(t.serializable?JSON.parse(e[m]):e[m]);let f=r();return f.then(a=>n.miss(a)).then(()=>f)},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 L=2*60*1e3;function k(t,e="up"){let s=Date.now();function r(){return e==="up"||Date.now()-s>L}function n(){return e==="timed out"&&Date.now()-s<=L}return {...t,status:e,lastUpdate:s,isUp:r,isTimedOut:n}}var j=class extends Error{name="AlgoliaError";constructor(t,e){super(t),e&&(this.name=e);}},J=class extends j{stackTrace;constructor(t,e,s){super(t,s),this.stackTrace=e;}},Z=class extends J{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");}},x=class extends J{status;constructor(t,e,s,r="ApiError"){super(t,s,r),this.status=e;}},ee=class extends j{response;constructor(t,e){super(t,"DeserializationError"),this.response=e;}},te=class extends x{error;constructor(t,e,s,r){super(t,e,r,"DetailedApiError"),this.error=s;}};function re(t,e,s){let r=se(s),n=`${t.protocol}://${t.url}${t.port?`:${t.port}`:""}/${e.charAt(0)==="/"?e.substring(1):e}`;return r.length&&(n+=`?${r}`),n}function se(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 oe(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 ae(t,e,s){let r={Accept:"application/json",...t,...e,...s},n={};return Object.keys(r).forEach(m=>{let f=r[m];n[m.toLowerCase()]=f;}),n}function ne(t){try{return JSON.parse(t.content)}catch(e){throw new ee(e.message,t)}}function ie({content:t,status:e},s){try{let r=JSON.parse(t);return "error"in r?new te(r.message,e,r.error,s):new x(r.message,e,s)}catch{}return new x(t,e,s)}function ce({isTimedOut:t,status:e}){return !t&&~~e===0}function ue({isTimedOut:t,status:e}){return t||ce({isTimedOut:t,status:e})||~~(e/100)!==2&&~~(e/100)!==4}function le({status:t}){return ~~(t/100)===2}function me(t){return t.map(e=>$(e))}function $(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 M({hosts:t,hostsCache:e,baseHeaders:s,baseQueryParameters:r,algoliaAgent:n,timeouts:m,requester:f,requestsCache:a,responsesCache:o}){async function i(l){let c=await Promise.all(l.map(p=>e.get(p,()=>Promise.resolve(k(p))))),P=c.filter(p=>p.isUp()),h=c.filter(p=>p.isTimedOut()),E=[...P,...h];return {hosts:E.length>0?E:l,getTimeout(p,y){return (h.length===0&&p===0?1:h.length+3+p)*y}}}async function u(l,c,P=!0){let h=[],E=oe(l,c),T=ae(s,l.headers,c.headers),p=l.method==="GET"?{...l.data,...c.data}:{},y={...r,...l.queryParameters,...p};if(n.value&&(y["x-algolia-agent"]=n.value),c&&c.queryParameters)for(let g of Object.keys(c.queryParameters))!c.queryParameters[g]||Object.prototype.toString.call(c.queryParameters[g])==="[object Object]"?y[g]=c.queryParameters[g]:y[g]=c.queryParameters[g].toString();let w=0,N=async(g,S)=>{let R=g.pop();if(R===void 0)throw new Z(me(h));let B={...m,...c.timeouts},_={data:E,headers:T,method:l.method,url:re(R,l.path,y),connectTimeout:S(w,B.connect),responseTimeout:S(w,P?B.read:B.write)},U=b=>{let I={request:_,response:b,host:R,triesLeft:g.length};return h.push(I),I},A=await f.send(_);if(ue(A)){let b=U(A);return A.isTimedOut&&w++,console.log("Retryable failure",$(b)),await e.set(R,k(R,A.isTimedOut?"timed out":"down")),N(g,S)}if(le(A))return ne(A);throw U(A),ie(A,h)},K=t.filter(g=>g.accept==="readWrite"||(P?g.accept==="read":g.accept==="write")),D=await i(K);return N([...D.hosts].reverse(),D.getTimeout)}function d(l,c={}){let P=l.useReadTransporter||l.method==="GET";if(!P)return u(l,c,P);let h=()=>u(l,c);if((c.cacheable||l.cacheable)!==!0)return h();let T={request:l,requestOptions:c,transporter:{queryParameters:r,headers:s}};return o.get(T,()=>a.get(T,()=>a.set(T,h()).then(p=>Promise.all([a.delete(T),p]),p=>Promise.all([a.delete(T),Promise.reject(p)])).then(([p,y])=>y)),{miss:p=>o.set(T,p)})}return {hostsCache:e,requester:f,timeouts:m,algoliaAgent:n,baseHeaders:s,baseQueryParameters:r,hosts:t,request:d,requestsCache:a,responsesCache:o}}function de(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({algoliaAgents:t,client:e,version:s}){let r=de(s).add({segment:e,version:s});return t.forEach(n=>r.add(n)),r}var Q=1e3,z=2e3,F=3e4;function X(){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 n=(a,o)=>setTimeout(()=>{r.abort(),s({status:0,content:o,isTimedOut:!0});},a),m=n(e.connectTimeout,"Connection timeout"),f;r.onreadystatechange=()=>{r.readyState>r.OPENED&&f===void 0&&(clearTimeout(m),f=n(e.responseTimeout,"Socket timeout"));},r.onerror=()=>{r.status===0&&(clearTimeout(m),clearTimeout(f),s({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}));},r.onload=()=>{clearTimeout(m),clearTimeout(f),s({content:r.responseText,status:r.status,isTimedOut:!1});},r.send(e.data);})}return {send:t}}var v="5.2.5",C=["de","us"];function he(t){return [{url:t?"analytics.{region}.algolia.com".replace("{region}",t):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]}function V({appId:t,apiKey:e,authMode:s,algoliaAgents:r,region:n,...m}){let f=H(t,e,s),a=M({hosts:he(n),...m,algoliaAgent:G({algoliaAgents:r,client:"Abtesting",version:v}),baseHeaders:{"content-type":"text/plain",...f.headers(),...m.baseHeaders},baseQueryParameters:{...f.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,i){a.algoliaAgent.add({segment:o,version:i});},addABTests(o,i){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,i)},customDelete({path:o,parameters:i},u){if(!o)throw new Error("Parameter `path` is required when calling `customDelete`.");let P={method:"DELETE",path:"/{path}".replace("{path}",o),queryParameters:i||{},headers:{}};return a.request(P,u)},customGet({path:o,parameters:i},u){if(!o)throw new Error("Parameter `path` is required when calling `customGet`.");let P={method:"GET",path:"/{path}".replace("{path}",o),queryParameters:i||{},headers:{}};return a.request(P,u)},customPost({path:o,parameters:i,body:u},d){if(!o)throw new Error("Parameter `path` is required when calling `customPost`.");let h={method:"POST",path:"/{path}".replace("{path}",o),queryParameters:i||{},headers:{},data:u||{}};return a.request(h,d)},customPut({path:o,parameters:i,body:u},d){if(!o)throw new Error("Parameter `path` is required when calling `customPut`.");let h={method:"PUT",path:"/{path}".replace("{path}",o),queryParameters:i||{},headers:{},data:u||{}};return a.request(h,d)},deleteABTest({id:o},i){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,i)},getABTest({id:o},i){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,i)},listABTests({offset:o,limit:i,indexPrefix:u,indexSuffix:d}={},l=void 0){let c="/2/abtests",P={},h={};o!==void 0&&(h.offset=o.toString()),i!==void 0&&(h.limit=i.toString()),u!==void 0&&(h.indexPrefix=u.toString()),d!==void 0&&(h.indexSuffix=d.toString());let E={method:"GET",path:c,queryParameters:h,headers:P};return a.request(E,l)},scheduleABTest(o,i){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,i)},stopABTest({id:o},i){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,i)}}}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"||!C.includes(s)))throw new Error(`\`region\` must be one of the following: ${C.join(", ")}`);return V({appId:t,apiKey:e,region:s,timeouts:{connect:Q,read:z,write:F},requester:X(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:O(),requestsCache:O({serializable:!1}),hostsCache:q({caches:[W({key:`${v}-${t}`}),O()]}),...r})} | ||
function H(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 W(t){let e,s=`algolia-client-js-${t.key}`;function r(){return e===void 0&&(e=t.localStorage||window.localStorage),e}function n(){return JSON.parse(r().getItem(s)||"{}")}function m(o){r().setItem(s,JSON.stringify(o));}function p(){let o=t.timeToLive?t.timeToLive*1e3:null,a=n(),u=Object.fromEntries(Object.entries(a).filter(([,d])=>d.timestamp!==void 0));if(m(u),!o)return;let l=Object.fromEntries(Object.entries(u).filter(([,d])=>{let i=new Date().getTime();return !(d.timestamp+o<i)}));m(l);}return {get(o,a,u={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(p(),n()[JSON.stringify(o)])).then(l=>Promise.all([l?l.value:a(),l!==void 0])).then(([l,d])=>Promise.all([l,d||u.miss(l)])).then(([l])=>l)},set(o,a){return Promise.resolve().then(()=>{let u=n();return u[JSON.stringify(o)]={timestamp:new Date().getTime(),value:a},r().setItem(s,JSON.stringify(u)),a})},delete(o){return Promise.resolve().then(()=>{let a=n();delete a[JSON.stringify(o)],r().setItem(s,JSON.stringify(a));})},clear(){return Promise.resolve().then(()=>{r().removeItem(s);})}}}function Y(){return {get(t,e,s={miss:()=>Promise.resolve()}){return e().then(n=>Promise.all([n,s.miss(n)])).then(([n])=>n)},set(t,e){return Promise.resolve(e)},delete(t){return Promise.resolve()},clear(){return Promise.resolve()}}}function E(t){let e=[...t.caches],s=e.shift();return s===void 0?Y():{get(r,n,m={miss:()=>Promise.resolve()}){return s.get(r,n,m).catch(()=>E({caches:e}).get(r,n,m))},set(r,n){return s.set(r,n).catch(()=>E({caches:e}).set(r,n))},delete(r){return s.delete(r).catch(()=>E({caches:e}).delete(r))},clear(){return s.clear().catch(()=>E({caches:e}).clear())}}}function O(t={serializable:!0}){let e={};return {get(s,r,n={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(o=>n.miss(o)).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 L=2*60*1e3;function k(t,e="up"){let s=Date.now();function r(){return e==="up"||Date.now()-s>L}function n(){return e==="timed out"&&Date.now()-s<=L}return {...t,status:e,lastUpdate:s,isUp:r,isTimedOut:n}}var j=class extends Error{name="AlgoliaError";constructor(t,e){super(t),e&&(this.name=e);}},J=class extends j{stackTrace;constructor(t,e,s){super(t,s),this.stackTrace=e;}},Z=class extends J{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");}},x=class extends J{status;constructor(t,e,s,r="ApiError"){super(t,s,r),this.status=e;}},ee=class extends j{response;constructor(t,e){super(t,"DeserializationError"),this.response=e;}},te=class extends x{error;constructor(t,e,s,r){super(t,e,r,"DetailedApiError"),this.error=s;}};function re(t,e,s){let r=se(s),n=`${t.protocol}://${t.url}${t.port?`:${t.port}`:""}/${e.charAt(0)==="/"?e.substring(1):e}`;return r.length&&(n+=`?${r}`),n}function se(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 oe(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 ae(t,e,s){let r={Accept:"application/json",...t,...e,...s},n={};return Object.keys(r).forEach(m=>{let p=r[m];n[m.toLowerCase()]=p;}),n}function ne(t){try{return JSON.parse(t.content)}catch(e){throw new ee(e.message,t)}}function ie({content:t,status:e},s){try{let r=JSON.parse(t);return "error"in r?new te(r.message,e,r.error,s):new x(r.message,e,s)}catch{}return new x(t,e,s)}function ce({isTimedOut:t,status:e}){return !t&&~~e===0}function ue({isTimedOut:t,status:e}){return t||ce({isTimedOut:t,status:e})||~~(e/100)!==2&&~~(e/100)!==4}function le({status:t}){return ~~(t/100)===2}function me(t){return t.map(e=>$(e))}function $(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 M({hosts:t,hostsCache:e,baseHeaders:s,baseQueryParameters:r,algoliaAgent:n,timeouts:m,requester:p,requestsCache:o,responsesCache:a}){async function u(i){let c=await Promise.all(i.map(h=>e.get(h,()=>Promise.resolve(k(h))))),f=c.filter(h=>h.isUp()),g=c.filter(h=>h.isTimedOut()),q=[...f,...g];return {hosts:q.length>0?q:i,getTimeout(h,y){return (g.length===0&&h===0?1:g.length+3+h)*y}}}async function l(i,c,f=!0){let g=[],q=oe(i,c),T=ae(s,i.headers,c.headers),h=i.method==="GET"?{...i.data,...c.data}:{},y={...r,...i.queryParameters,...h};if(n.value&&(y["x-algolia-agent"]=n.value),c&&c.queryParameters)for(let P of Object.keys(c.queryParameters))!c.queryParameters[P]||Object.prototype.toString.call(c.queryParameters[P])==="[object Object]"?y[P]=c.queryParameters[P]:y[P]=c.queryParameters[P].toString();let w=0,N=async(P,S)=>{let R=P.pop();if(R===void 0)throw new Z(me(g));let B={...m,...c.timeouts},_={data:q,headers:T,method:i.method,url:re(R,i.path,y),connectTimeout:S(w,B.connect),responseTimeout:S(w,f?B.read:B.write)},U=b=>{let I={request:_,response:b,host:R,triesLeft:P.length};return g.push(I),I},A=await p.send(_);if(ue(A)){let b=U(A);return A.isTimedOut&&w++,console.log("Retryable failure",$(b)),await e.set(R,k(R,A.isTimedOut?"timed out":"down")),N(P,S)}if(le(A))return ne(A);throw U(A),ie(A,g)},V=t.filter(P=>P.accept==="readWrite"||(f?P.accept==="read":P.accept==="write")),D=await u(V);return N([...D.hosts].reverse(),D.getTimeout)}function d(i,c={}){let f=i.useReadTransporter||i.method==="GET";if(!f)return l(i,c,f);let g=()=>l(i,c);if((c.cacheable||i.cacheable)!==!0)return g();let T={request:i,requestOptions:c,transporter:{queryParameters:r,headers:s}};return a.get(T,()=>o.get(T,()=>o.set(T,g()).then(h=>Promise.all([o.delete(T),h]),h=>Promise.all([o.delete(T),Promise.reject(h)])).then(([h,y])=>y)),{miss:h=>a.set(T,h)})}return {hostsCache:e,requester:p,timeouts:m,algoliaAgent:n,baseHeaders:s,baseQueryParameters:r,hosts:t,request:d,requestsCache:o,responsesCache:a}}function de(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({algoliaAgents:t,client:e,version:s}){let r=de(s).add({segment:e,version:s});return t.forEach(n=>r.add(n)),r}var Q=1e3,z=2e3,F=3e4;function X(){function t(e){return new Promise(s=>{let r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach(o=>r.setRequestHeader(o,e.headers[o]));let n=(o,a)=>setTimeout(()=>{r.abort(),s({status:0,content:a,isTimedOut:!0});},o),m=n(e.connectTimeout,"Connection timeout"),p;r.onreadystatechange=()=>{r.readyState>r.OPENED&&p===void 0&&(clearTimeout(m),p=n(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 v="5.3.0",C=["de","us"];function he(t){return [{url:t?"analytics.{region}.algolia.com".replace("{region}",t):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]}function K({appId:t,apiKey:e,authMode:s,algoliaAgents:r,region:n,...m}){let p=H(t,e,s);return {transporter:M({hosts:he(n),...m,algoliaAgent:G({algoliaAgents:r,client:"Abtesting",version:v}),baseHeaders:{"content-type":"text/plain",...p.headers(),...m.baseHeaders},baseQueryParameters:{...p.queryParameters(),...m.baseQueryParameters}}),appId:t,clearCache(){return Promise.all([this.transporter.requestsCache.clear(),this.transporter.responsesCache.clear()]).then(()=>{})},get _ua(){return this.transporter.algoliaAgent.value},addAlgoliaAgent(o,a){this.transporter.algoliaAgent.add({segment:o,version:a});},setClientApiKey({apiKey:o}){this.transporter.baseHeaders["x-algolia-api-key"]=o;},addABTests(o,a){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 i={method:"POST",path:"/2/abtests",queryParameters:{},headers:{},data:o};return this.transporter.request(i,a)},customDelete({path:o,parameters:a},u){if(!o)throw new Error("Parameter `path` is required when calling `customDelete`.");let c={method:"DELETE",path:"/{path}".replace("{path}",o),queryParameters:a||{},headers:{}};return this.transporter.request(c,u)},customGet({path:o,parameters:a},u){if(!o)throw new Error("Parameter `path` is required when calling `customGet`.");let c={method:"GET",path:"/{path}".replace("{path}",o),queryParameters:a||{},headers:{}};return this.transporter.request(c,u)},customPost({path:o,parameters:a,body:u},l){if(!o)throw new Error("Parameter `path` is required when calling `customPost`.");let f={method:"POST",path:"/{path}".replace("{path}",o),queryParameters:a||{},headers:{},data:u||{}};return this.transporter.request(f,l)},customPut({path:o,parameters:a,body:u},l){if(!o)throw new Error("Parameter `path` is required when calling `customPut`.");let f={method:"PUT",path:"/{path}".replace("{path}",o),queryParameters:a||{},headers:{},data:u||{}};return this.transporter.request(f,l)},deleteABTest({id:o},a){if(!o)throw new Error("Parameter `id` is required when calling `deleteABTest`.");let i={method:"DELETE",path:"/2/abtests/{id}".replace("{id}",encodeURIComponent(o)),queryParameters:{},headers:{}};return this.transporter.request(i,a)},getABTest({id:o},a){if(!o)throw new Error("Parameter `id` is required when calling `getABTest`.");let i={method:"GET",path:"/2/abtests/{id}".replace("{id}",encodeURIComponent(o)),queryParameters:{},headers:{}};return this.transporter.request(i,a)},listABTests({offset:o,limit:a,indexPrefix:u,indexSuffix:l}={},d=void 0){let i="/2/abtests",c={},f={};o!==void 0&&(f.offset=o.toString()),a!==void 0&&(f.limit=a.toString()),u!==void 0&&(f.indexPrefix=u.toString()),l!==void 0&&(f.indexSuffix=l.toString());let g={method:"GET",path:i,queryParameters:f,headers:c};return this.transporter.request(g,d)},scheduleABTest(o,a){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 i={method:"POST",path:"/2/abtests/schedule",queryParameters:{},headers:{},data:o};return this.transporter.request(i,a)},stopABTest({id:o},a){if(!o)throw new Error("Parameter `id` is required when calling `stopABTest`.");let i={method:"POST",path:"/2/abtests/{id}/stop".replace("{id}",encodeURIComponent(o)),queryParameters:{},headers:{}};return this.transporter.request(i,a)}}}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"||!C.includes(s)))throw new Error(`\`region\` must be one of the following: ${C.join(", ")}`);return K({appId:t,apiKey:e,region:s,timeouts:{connect:Q,read:z,write:F},requester:X(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:O(),requestsCache:O({serializable:!1}),hostsCache:E({caches:[W({key:`${v}-${t}`}),O()]}),...r})} | ||
@@ -10,0 +10,0 @@ exports.abtestingClient = Ye; |
@@ -13,3 +13,3 @@ // builds/node.ts | ||
import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common"; | ||
var apiClientVersion = "5.2.5"; | ||
var apiClientVersion = "5.3.0"; | ||
var REGIONS = ["de", "us"]; | ||
@@ -29,22 +29,21 @@ function getDefaultHosts(region) { | ||
const auth = createAuth(appIdOption, apiKeyOption, authMode); | ||
const transporter = createTransporter({ | ||
hosts: getDefaultHosts(regionOption), | ||
...options, | ||
algoliaAgent: getAlgoliaAgent({ | ||
algoliaAgents, | ||
client: "Abtesting", | ||
version: apiClientVersion | ||
return { | ||
transporter: createTransporter({ | ||
hosts: getDefaultHosts(regionOption), | ||
...options, | ||
algoliaAgent: getAlgoliaAgent({ | ||
algoliaAgents, | ||
client: "Abtesting", | ||
version: apiClientVersion | ||
}), | ||
baseHeaders: { | ||
"content-type": "text/plain", | ||
...auth.headers(), | ||
...options.baseHeaders | ||
}, | ||
baseQueryParameters: { | ||
...auth.queryParameters(), | ||
...options.baseQueryParameters | ||
} | ||
}), | ||
baseHeaders: { | ||
"content-type": "text/plain", | ||
...auth.headers(), | ||
...options.baseHeaders | ||
}, | ||
baseQueryParameters: { | ||
...auth.queryParameters(), | ||
...options.baseQueryParameters | ||
} | ||
}); | ||
return { | ||
transporter, | ||
/** | ||
@@ -58,3 +57,5 @@ * The `appId` currently in use. | ||
clearCache() { | ||
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0); | ||
return Promise.all([this.transporter.requestsCache.clear(), this.transporter.responsesCache.clear()]).then( | ||
() => void 0 | ||
); | ||
}, | ||
@@ -65,3 +66,3 @@ /** | ||
get _ua() { | ||
return transporter.algoliaAgent.value; | ||
return this.transporter.algoliaAgent.value; | ||
}, | ||
@@ -75,5 +76,14 @@ /** | ||
addAlgoliaAgent(segment, version) { | ||
transporter.algoliaAgent.add({ segment, version }); | ||
this.transporter.algoliaAgent.add({ segment, version }); | ||
}, | ||
/** | ||
* Helper method to switch the API key used to authenticate the requests. | ||
* | ||
* @param params - Method params. | ||
* @param params.apiKey - The new API Key to use. | ||
*/ | ||
setClientApiKey({ apiKey }) { | ||
this.transporter.baseHeaders["x-algolia-api-key"] = apiKey; | ||
}, | ||
/** | ||
* Creates a new A/B test. | ||
@@ -110,3 +120,3 @@ * | ||
}; | ||
return transporter.request(request, requestOptions); | ||
return this.transporter.request(request, requestOptions); | ||
}, | ||
@@ -134,3 +144,3 @@ /** | ||
}; | ||
return transporter.request(request, requestOptions); | ||
return this.transporter.request(request, requestOptions); | ||
}, | ||
@@ -158,3 +168,3 @@ /** | ||
}; | ||
return transporter.request(request, requestOptions); | ||
return this.transporter.request(request, requestOptions); | ||
}, | ||
@@ -184,3 +194,3 @@ /** | ||
}; | ||
return transporter.request(request, requestOptions); | ||
return this.transporter.request(request, requestOptions); | ||
}, | ||
@@ -210,3 +220,3 @@ /** | ||
}; | ||
return transporter.request(request, requestOptions); | ||
return this.transporter.request(request, requestOptions); | ||
}, | ||
@@ -236,3 +246,3 @@ /** | ||
}; | ||
return transporter.request(request, requestOptions); | ||
return this.transporter.request(request, requestOptions); | ||
}, | ||
@@ -262,3 +272,3 @@ /** | ||
}; | ||
return transporter.request(request, requestOptions); | ||
return this.transporter.request(request, requestOptions); | ||
}, | ||
@@ -300,3 +310,3 @@ /** | ||
}; | ||
return transporter.request(request, requestOptions); | ||
return this.transporter.request(request, requestOptions); | ||
}, | ||
@@ -338,3 +348,3 @@ /** | ||
}; | ||
return transporter.request(request, requestOptions); | ||
return this.transporter.request(request, requestOptions); | ||
}, | ||
@@ -364,3 +374,3 @@ /** | ||
}; | ||
return transporter.request(request, requestOptions); | ||
return this.transporter.request(request, requestOptions); | ||
} | ||
@@ -367,0 +377,0 @@ }; |
import * as _algolia_client_common from '@algolia/client-common'; | ||
import { ClientOptions } from '@algolia/client-common'; | ||
import { CreateClientOptions, RequestOptions, ClientOptions } from '@algolia/client-common'; | ||
@@ -280,50 +280,2 @@ /** | ||
/** | ||
* Error. | ||
*/ | ||
type ErrorBase = Record<string, any> & { | ||
message?: string; | ||
}; | ||
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; | ||
}; | ||
/** | ||
* Properties for the `customDelete` method. | ||
@@ -437,28 +389,196 @@ */ | ||
declare const apiClientVersion = "5.2.5"; | ||
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.3.0"; | ||
declare const REGIONS: readonly ["de", "us"]; | ||
type Region = (typeof REGIONS)[number]; | ||
/** | ||
* The client type. | ||
*/ | ||
type AbtestingClient = ReturnType<typeof abtestingClient>; | ||
declare function abtestingClient(appId: string, apiKey: string, region?: Region, options?: ClientOptions): { | ||
declare function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }: CreateClientOptions & { | ||
region?: Region; | ||
}): { | ||
transporter: _algolia_client_common.Transporter; | ||
/** | ||
* The `appId` currently in use. | ||
*/ | ||
appId: string; | ||
/** | ||
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties. | ||
*/ | ||
clearCache(): Promise<void>; | ||
_ua: string; | ||
/** | ||
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system. | ||
*/ | ||
readonly _ua: string; | ||
/** | ||
* Adds a `segment` to the `x-algolia-agent` sent with every requests. | ||
* | ||
* @param segment - The algolia agent (user-agent) segment to add. | ||
* @param version - The version of the agent. | ||
*/ | ||
addAlgoliaAgent(segment: string, version?: string): void; | ||
addABTests(addABTestsRequest: AddABTestsRequest, requestOptions?: _algolia_client_common.RequestOptions): Promise<ABTestResponse>; | ||
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<Record<string, unknown>>; | ||
customGet({ path, parameters }: CustomGetProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<Record<string, unknown>>; | ||
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<Record<string, unknown>>; | ||
customPut({ path, parameters, body }: CustomPutProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<Record<string, unknown>>; | ||
deleteABTest({ id }: DeleteABTestProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<ABTestResponse>; | ||
getABTest({ id }: GetABTestProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<ABTest>; | ||
listABTests({ offset, limit, indexPrefix, indexSuffix }?: ListABTestsProps, requestOptions?: _algolia_client_common.RequestOptions | undefined): Promise<ListABTestsResponse>; | ||
scheduleABTest(scheduleABTestsRequest: ScheduleABTestsRequest, requestOptions?: _algolia_client_common.RequestOptions): Promise<ScheduleABTestResponse>; | ||
stopABTest({ id }: StopABTestProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<ABTestResponse>; | ||
/** | ||
* Helper method to switch the API key used to authenticate the requests. | ||
* | ||
* @param params - Method params. | ||
* @param params.apiKey - The new API Key to use. | ||
*/ | ||
setClientApiKey({ apiKey }: { | ||
apiKey: string; | ||
}): void; | ||
/** | ||
* Creates a new A/B test. | ||
* | ||
* Required API Key ACLs: | ||
* - editSettings. | ||
* | ||
* @param addABTestsRequest - The addABTestsRequest object. | ||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. | ||
*/ | ||
addABTests(addABTestsRequest: AddABTestsRequest, requestOptions?: RequestOptions): Promise<ABTestResponse>; | ||
/** | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customDelete - The customDelete object. | ||
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* @param customDelete.parameters - Query parameters to apply to the current query. | ||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. | ||
*/ | ||
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>; | ||
/** | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customGet - The customGet object. | ||
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* @param customGet.parameters - Query parameters to apply to the current query. | ||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. | ||
*/ | ||
customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>; | ||
/** | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customPost - The customPost object. | ||
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* @param customPost.parameters - Query parameters to apply to the current query. | ||
* @param customPost.body - Parameters to send with the custom request. | ||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. | ||
*/ | ||
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>; | ||
/** | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customPut - The customPut object. | ||
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* @param customPut.parameters - Query parameters to apply to the current query. | ||
* @param customPut.body - Parameters to send with the custom request. | ||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. | ||
*/ | ||
customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>; | ||
/** | ||
* Deletes an A/B test by its ID. | ||
* | ||
* Required API Key ACLs: | ||
* - editSettings. | ||
* | ||
* @param deleteABTest - The deleteABTest object. | ||
* @param deleteABTest.id - Unique A/B test identifier. | ||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. | ||
*/ | ||
deleteABTest({ id }: DeleteABTestProps, requestOptions?: RequestOptions): Promise<ABTestResponse>; | ||
/** | ||
* Retrieves the details for an A/B test by its ID. | ||
* | ||
* Required API Key ACLs: | ||
* - analytics. | ||
* | ||
* @param getABTest - The getABTest object. | ||
* @param getABTest.id - Unique A/B test identifier. | ||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. | ||
*/ | ||
getABTest({ id }: GetABTestProps, requestOptions?: RequestOptions): Promise<ABTest>; | ||
/** | ||
* Lists all A/B tests you configured for this application. | ||
* | ||
* Required API Key ACLs: | ||
* - analytics. | ||
* | ||
* @param listABTests - The listABTests object. | ||
* @param listABTests.offset - Position of the first item to return. | ||
* @param listABTests.limit - Number of items to return. | ||
* @param listABTests.indexPrefix - Index name prefix. Only A/B tests for indices starting with this string are included in the response. | ||
* @param listABTests.indexSuffix - Index name suffix. Only A/B tests for indices ending with this string are included in the response. | ||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. | ||
*/ | ||
listABTests({ offset, limit, indexPrefix, indexSuffix }?: ListABTestsProps, requestOptions?: RequestOptions | undefined): Promise<ListABTestsResponse>; | ||
/** | ||
* Schedule an A/B test to be started at a later time. | ||
* | ||
* Required API Key ACLs: | ||
* - editSettings. | ||
* | ||
* @param scheduleABTestsRequest - The scheduleABTestsRequest object. | ||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. | ||
*/ | ||
scheduleABTest(scheduleABTestsRequest: ScheduleABTestsRequest, requestOptions?: RequestOptions): Promise<ScheduleABTestResponse>; | ||
/** | ||
* Stops an A/B test by its ID. You can\'t restart stopped A/B tests. | ||
* | ||
* Required API Key ACLs: | ||
* - editSettings. | ||
* | ||
* @param stopABTest - The stopABTest object. | ||
* @param stopABTest.id - Unique A/B test identifier. | ||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. | ||
*/ | ||
stopABTest({ id }: StopABTestProps, requestOptions?: RequestOptions): Promise<ABTestResponse>; | ||
}; | ||
/** | ||
* Error. | ||
*/ | ||
type ErrorBase = Record<string, any> & { | ||
message?: string; | ||
}; | ||
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 }; |
// src/abtestingClient.ts | ||
import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common"; | ||
var apiClientVersion = "5.2.5"; | ||
var apiClientVersion = "5.3.0"; | ||
var REGIONS = ["de", "us"]; | ||
@@ -18,22 +18,21 @@ function getDefaultHosts(region) { | ||
const auth = createAuth(appIdOption, apiKeyOption, authMode); | ||
const transporter = createTransporter({ | ||
hosts: getDefaultHosts(regionOption), | ||
...options, | ||
algoliaAgent: getAlgoliaAgent({ | ||
algoliaAgents, | ||
client: "Abtesting", | ||
version: apiClientVersion | ||
return { | ||
transporter: createTransporter({ | ||
hosts: getDefaultHosts(regionOption), | ||
...options, | ||
algoliaAgent: getAlgoliaAgent({ | ||
algoliaAgents, | ||
client: "Abtesting", | ||
version: apiClientVersion | ||
}), | ||
baseHeaders: { | ||
"content-type": "text/plain", | ||
...auth.headers(), | ||
...options.baseHeaders | ||
}, | ||
baseQueryParameters: { | ||
...auth.queryParameters(), | ||
...options.baseQueryParameters | ||
} | ||
}), | ||
baseHeaders: { | ||
"content-type": "text/plain", | ||
...auth.headers(), | ||
...options.baseHeaders | ||
}, | ||
baseQueryParameters: { | ||
...auth.queryParameters(), | ||
...options.baseQueryParameters | ||
} | ||
}); | ||
return { | ||
transporter, | ||
/** | ||
@@ -47,3 +46,5 @@ * The `appId` currently in use. | ||
clearCache() { | ||
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0); | ||
return Promise.all([this.transporter.requestsCache.clear(), this.transporter.responsesCache.clear()]).then( | ||
() => void 0 | ||
); | ||
}, | ||
@@ -54,3 +55,3 @@ /** | ||
get _ua() { | ||
return transporter.algoliaAgent.value; | ||
return this.transporter.algoliaAgent.value; | ||
}, | ||
@@ -64,5 +65,14 @@ /** | ||
addAlgoliaAgent(segment, version) { | ||
transporter.algoliaAgent.add({ segment, version }); | ||
this.transporter.algoliaAgent.add({ segment, version }); | ||
}, | ||
/** | ||
* Helper method to switch the API key used to authenticate the requests. | ||
* | ||
* @param params - Method params. | ||
* @param params.apiKey - The new API Key to use. | ||
*/ | ||
setClientApiKey({ apiKey }) { | ||
this.transporter.baseHeaders["x-algolia-api-key"] = apiKey; | ||
}, | ||
/** | ||
* Creates a new A/B test. | ||
@@ -99,3 +109,3 @@ * | ||
}; | ||
return transporter.request(request, requestOptions); | ||
return this.transporter.request(request, requestOptions); | ||
}, | ||
@@ -123,3 +133,3 @@ /** | ||
}; | ||
return transporter.request(request, requestOptions); | ||
return this.transporter.request(request, requestOptions); | ||
}, | ||
@@ -147,3 +157,3 @@ /** | ||
}; | ||
return transporter.request(request, requestOptions); | ||
return this.transporter.request(request, requestOptions); | ||
}, | ||
@@ -173,3 +183,3 @@ /** | ||
}; | ||
return transporter.request(request, requestOptions); | ||
return this.transporter.request(request, requestOptions); | ||
}, | ||
@@ -199,3 +209,3 @@ /** | ||
}; | ||
return transporter.request(request, requestOptions); | ||
return this.transporter.request(request, requestOptions); | ||
}, | ||
@@ -225,3 +235,3 @@ /** | ||
}; | ||
return transporter.request(request, requestOptions); | ||
return this.transporter.request(request, requestOptions); | ||
}, | ||
@@ -251,3 +261,3 @@ /** | ||
}; | ||
return transporter.request(request, requestOptions); | ||
return this.transporter.request(request, requestOptions); | ||
}, | ||
@@ -289,3 +299,3 @@ /** | ||
}; | ||
return transporter.request(request, requestOptions); | ||
return this.transporter.request(request, requestOptions); | ||
}, | ||
@@ -327,3 +337,3 @@ /** | ||
}; | ||
return transporter.request(request, requestOptions); | ||
return this.transporter.request(request, requestOptions); | ||
}, | ||
@@ -353,3 +363,3 @@ /** | ||
}; | ||
return transporter.request(request, requestOptions); | ||
return this.transporter.request(request, requestOptions); | ||
} | ||
@@ -356,0 +366,0 @@ }; |
{ | ||
"version": "5.2.5", | ||
"version": "5.3.0", | ||
"repository": { | ||
@@ -47,5 +47,5 @@ "type": "git", | ||
"dependencies": { | ||
"@algolia/client-common": "5.2.5", | ||
"@algolia/requester-browser-xhr": "5.2.5", | ||
"@algolia/requester-node-http": "5.2.5" | ||
"@algolia/client-common": "5.3.0", | ||
"@algolia/requester-browser-xhr": "5.3.0", | ||
"@algolia/requester-node-http": "5.3.0" | ||
}, | ||
@@ -52,0 +52,0 @@ "devDependencies": { |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
366197
3647
0
+ Added@algolia/client-common@5.3.0(transitive)
+ Added@algolia/requester-browser-xhr@5.3.0(transitive)
+ Added@algolia/requester-node-http@5.3.0(transitive)
- Removed@algolia/client-common@5.2.5(transitive)
- Removed@algolia/requester-browser-xhr@5.2.5(transitive)
- Removed@algolia/requester-node-http@5.2.5(transitive)
Updated@algolia/client-common@5.3.0