Socket
Socket
Sign inDemoInstall

@algolia/client-abtesting

Package Overview
Dependencies
Maintainers
84
Versions
154
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.0.0-alpha.73 to 5.0.0-alpha.75

60

dist/client-abtesting.cjs.js
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var clientCommon = require('@algolia/client-common');

@@ -9,3 +7,3 @@ var requesterNodeHttp = require('@algolia/requester-node-http');

// 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.
const apiClientVersion = '5.0.0-alpha.73';
const apiClientVersion = '5.0.0-alpha.75';
const REGIONS = ['de', 'us'];

@@ -70,5 +68,5 @@ function getDefaultHosts(region) {

/**
* Creates a new A/B test with provided configuration. You can set an A/B test on two different indices with different settings, or on the same index with different search parameters by providing a customSearchParameters setting on one of the variants.
* Creates an A/B test.
*
* @summary Create a test.
* @summary Create an A/B test.
* @param addABTestsRequest - The addABTestsRequest object.

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

}
if (!addABTestsRequest.variant) {
throw new Error('Parameter `addABTestsRequest.variant` is required when calling `addABTests`.');
if (!addABTestsRequest.variants) {
throw new Error('Parameter `addABTestsRequest.variants` is required when calling `addABTests`.');
}

@@ -108,4 +106,4 @@ if (!addABTestsRequest.endAt) {

* @param del - The del object.
* @param del.path - The path of the API endpoint to target, anything after the /1 needs to be specified.
* @param del.parameters - Query parameters to be applied to the current query.
* @param del.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param del.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.

@@ -129,7 +127,7 @@ */

/**
* Delete a test.
* Delete an A/B test. To determine the `id` for an A/B test, use the [`listABTests` operation](#tag/abtest/operation/listABTests).
*
* @summary Delete a test.
* @summary Delete an A/B test.
* @param deleteABTest - The deleteABTest object.
* @param deleteABTest.id - The A/B test ID.
* @param deleteABTest.id - Unique A/B test ID.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.

@@ -157,4 +155,4 @@ */

* @param get - The get object.
* @param get.path - The path of the API endpoint to target, anything after the /1 needs to be specified.
* @param get.parameters - Query parameters to be applied to the current query.
* @param get.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param get.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.

@@ -178,7 +176,7 @@ */

/**
* Returns metadata and metrics for an A/B test.
* Get specific details for an A/B test. To determine the `id` for an A/B test, use the [`listABTests` operation](#tag/abtest/operation/listABTests).
*
* @summary Get a test.
* @summary Get A/B test details.
* @param getABTest - The getABTest object.
* @param getABTest.id - The A/B test ID.
* @param getABTest.id - Unique A/B test ID.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.

@@ -202,10 +200,10 @@ */

/**
* Fetch all existing A/B tests for App that are available for the current API Key. When no data has been processed, the metrics will be returned as null.
* List all A/B tests.
*
* @summary List all tests.
* @summary List all A/B tests.
* @param listABTests - The listABTests object.
* @param listABTests.offset - Position of the starting record. Used for paging. 0 is the first record.
* @param listABTests.limit - Number of records to return. Limit is the size of the page.
* @param listABTests.indexPrefix - Filters the returned ab tests by any indices starting with the provided prefix that are assigned to either variant of an ab test.
* @param listABTests.indexSuffix - Filters the returned ab tests by any indices ending with the provided suffix that are assigned to either variant of an ab test.
* @param listABTests.limit - Number of records to return (page size).
* @param listABTests.indexPrefix - Only return A/B tests for indices starting with this prefix.
* @param listABTests.indexSuffix - Only return A/B tests for indices ending with this suffix.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.

@@ -242,5 +240,5 @@ */

* @param post - The post object.
* @param post.path - The path of the API endpoint to target, anything after the /1 needs to be specified.
* @param post.parameters - Query parameters to be applied to the current query.
* @param post.body - The parameters to send with the custom request.
* @param post.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param post.parameters - Query parameters to apply to the current query.
* @param post.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.

@@ -269,5 +267,5 @@ */

* @param put - The put object.
* @param put.path - The path of the API endpoint to target, anything after the /1 needs to be specified.
* @param put.parameters - Query parameters to be applied to the current query.
* @param put.body - The parameters to send with the custom request.
* @param put.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param put.parameters - Query parameters to apply to the current query.
* @param put.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.

@@ -292,7 +290,7 @@ */

/**
* Marks the A/B test as stopped. At this point, the test is over and cannot be restarted. As a result, your application is back to normal: index A will perform as usual, receiving 100% of all search requests. Associated metadata and metrics are still stored.
* If stopped, the test is over and can\'t be restarted. There is now only one index, receiving 100% of all search requests. The data gathered for stopped A/B tests is retained. To determine the `id` for an A/B test, use the [`listABTests` operation](#tag/abtest/operation/listABTests).
*
* @summary Stop a test.
* @summary Stop an A/B test.
* @param stopABTest - The stopABTest object.
* @param stopABTest.id - The A/B test ID.
* @param stopABTest.id - Unique A/B test ID.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.

@@ -299,0 +297,0 @@ */

@@ -665,3 +665,3 @@ function createAuth(appId, apiKey, authMode = 'WithinHeaders') {

// 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.
const apiClientVersion = '5.0.0-alpha.73';
const apiClientVersion = '5.0.0-alpha.75';
const REGIONS = ['de', 'us'];

@@ -726,5 +726,5 @@ function getDefaultHosts(region) {

/**
* Creates a new A/B test with provided configuration. You can set an A/B test on two different indices with different settings, or on the same index with different search parameters by providing a customSearchParameters setting on one of the variants.
* Creates an A/B test.
*
* @summary Create a test.
* @summary Create an A/B test.
* @param addABTestsRequest - The addABTestsRequest object.

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

}
if (!addABTestsRequest.variant) {
throw new Error('Parameter `addABTestsRequest.variant` is required when calling `addABTests`.');
if (!addABTestsRequest.variants) {
throw new Error('Parameter `addABTestsRequest.variants` is required when calling `addABTests`.');
}

@@ -764,4 +764,4 @@ if (!addABTestsRequest.endAt) {

* @param del - The del object.
* @param del.path - The path of the API endpoint to target, anything after the /1 needs to be specified.
* @param del.parameters - Query parameters to be applied to the current query.
* @param del.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param del.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.

@@ -785,7 +785,7 @@ */

/**
* Delete a test.
* Delete an A/B test. To determine the `id` for an A/B test, use the [`listABTests` operation](#tag/abtest/operation/listABTests).
*
* @summary Delete a test.
* @summary Delete an A/B test.
* @param deleteABTest - The deleteABTest object.
* @param deleteABTest.id - The A/B test ID.
* @param deleteABTest.id - Unique A/B test ID.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.

@@ -813,4 +813,4 @@ */

* @param get - The get object.
* @param get.path - The path of the API endpoint to target, anything after the /1 needs to be specified.
* @param get.parameters - Query parameters to be applied to the current query.
* @param get.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param get.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.

@@ -834,7 +834,7 @@ */

/**
* Returns metadata and metrics for an A/B test.
* Get specific details for an A/B test. To determine the `id` for an A/B test, use the [`listABTests` operation](#tag/abtest/operation/listABTests).
*
* @summary Get a test.
* @summary Get A/B test details.
* @param getABTest - The getABTest object.
* @param getABTest.id - The A/B test ID.
* @param getABTest.id - Unique A/B test ID.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.

@@ -858,10 +858,10 @@ */

/**
* Fetch all existing A/B tests for App that are available for the current API Key. When no data has been processed, the metrics will be returned as null.
* List all A/B tests.
*
* @summary List all tests.
* @summary List all A/B tests.
* @param listABTests - The listABTests object.
* @param listABTests.offset - Position of the starting record. Used for paging. 0 is the first record.
* @param listABTests.limit - Number of records to return. Limit is the size of the page.
* @param listABTests.indexPrefix - Filters the returned ab tests by any indices starting with the provided prefix that are assigned to either variant of an ab test.
* @param listABTests.indexSuffix - Filters the returned ab tests by any indices ending with the provided suffix that are assigned to either variant of an ab test.
* @param listABTests.limit - Number of records to return (page size).
* @param listABTests.indexPrefix - Only return A/B tests for indices starting with this prefix.
* @param listABTests.indexSuffix - Only return A/B tests for indices ending with this suffix.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.

@@ -898,5 +898,5 @@ */

* @param post - The post object.
* @param post.path - The path of the API endpoint to target, anything after the /1 needs to be specified.
* @param post.parameters - Query parameters to be applied to the current query.
* @param post.body - The parameters to send with the custom request.
* @param post.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param post.parameters - Query parameters to apply to the current query.
* @param post.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.

@@ -925,5 +925,5 @@ */

* @param put - The put object.
* @param put.path - The path of the API endpoint to target, anything after the /1 needs to be specified.
* @param put.parameters - Query parameters to be applied to the current query.
* @param put.body - The parameters to send with the custom request.
* @param put.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param put.parameters - Query parameters to apply to the current query.
* @param put.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.

@@ -948,7 +948,7 @@ */

/**
* Marks the A/B test as stopped. At this point, the test is over and cannot be restarted. As a result, your application is back to normal: index A will perform as usual, receiving 100% of all search requests. Associated metadata and metrics are still stored.
* If stopped, the test is over and can\'t be restarted. There is now only one index, receiving 100% of all search requests. The data gathered for stopped A/B tests is retained. To determine the `id` for an A/B test, use the [`listABTests` operation](#tag/abtest/operation/listABTests).
*
* @summary Stop a test.
* @summary Stop an A/B test.
* @param stopABTest - The stopABTest object.
* @param stopABTest.id - The A/B test ID.
* @param stopABTest.id - Unique A/B test ID.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.

@@ -955,0 +955,0 @@ */

@@ -5,3 +5,3 @@ import { createAuth, createTransporter, getAlgoliaAgent, DEFAULT_CONNECT_TIMEOUT_NODE, DEFAULT_READ_TIMEOUT_NODE, DEFAULT_WRITE_TIMEOUT_NODE, createNullCache, createMemoryCache } from '@algolia/client-common';

// 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.
const apiClientVersion = '5.0.0-alpha.73';
const apiClientVersion = '5.0.0-alpha.75';
const REGIONS = ['de', 'us'];

@@ -66,5 +66,5 @@ function getDefaultHosts(region) {

/**
* Creates a new A/B test with provided configuration. You can set an A/B test on two different indices with different settings, or on the same index with different search parameters by providing a customSearchParameters setting on one of the variants.
* Creates an A/B test.
*
* @summary Create a test.
* @summary Create an A/B test.
* @param addABTestsRequest - The addABTestsRequest object.

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

}
if (!addABTestsRequest.variant) {
throw new Error('Parameter `addABTestsRequest.variant` is required when calling `addABTests`.');
if (!addABTestsRequest.variants) {
throw new Error('Parameter `addABTestsRequest.variants` is required when calling `addABTests`.');
}

@@ -104,4 +104,4 @@ if (!addABTestsRequest.endAt) {

* @param del - The del object.
* @param del.path - The path of the API endpoint to target, anything after the /1 needs to be specified.
* @param del.parameters - Query parameters to be applied to the current query.
* @param del.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param del.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.

@@ -125,7 +125,7 @@ */

/**
* Delete a test.
* Delete an A/B test. To determine the `id` for an A/B test, use the [`listABTests` operation](#tag/abtest/operation/listABTests).
*
* @summary Delete a test.
* @summary Delete an A/B test.
* @param deleteABTest - The deleteABTest object.
* @param deleteABTest.id - The A/B test ID.
* @param deleteABTest.id - Unique A/B test ID.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.

@@ -153,4 +153,4 @@ */

* @param get - The get object.
* @param get.path - The path of the API endpoint to target, anything after the /1 needs to be specified.
* @param get.parameters - Query parameters to be applied to the current query.
* @param get.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param get.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.

@@ -174,7 +174,7 @@ */

/**
* Returns metadata and metrics for an A/B test.
* Get specific details for an A/B test. To determine the `id` for an A/B test, use the [`listABTests` operation](#tag/abtest/operation/listABTests).
*
* @summary Get a test.
* @summary Get A/B test details.
* @param getABTest - The getABTest object.
* @param getABTest.id - The A/B test ID.
* @param getABTest.id - Unique A/B test ID.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.

@@ -198,10 +198,10 @@ */

/**
* Fetch all existing A/B tests for App that are available for the current API Key. When no data has been processed, the metrics will be returned as null.
* List all A/B tests.
*
* @summary List all tests.
* @summary List all A/B tests.
* @param listABTests - The listABTests object.
* @param listABTests.offset - Position of the starting record. Used for paging. 0 is the first record.
* @param listABTests.limit - Number of records to return. Limit is the size of the page.
* @param listABTests.indexPrefix - Filters the returned ab tests by any indices starting with the provided prefix that are assigned to either variant of an ab test.
* @param listABTests.indexSuffix - Filters the returned ab tests by any indices ending with the provided suffix that are assigned to either variant of an ab test.
* @param listABTests.limit - Number of records to return (page size).
* @param listABTests.indexPrefix - Only return A/B tests for indices starting with this prefix.
* @param listABTests.indexSuffix - Only return A/B tests for indices ending with this suffix.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.

@@ -238,5 +238,5 @@ */

* @param post - The post object.
* @param post.path - The path of the API endpoint to target, anything after the /1 needs to be specified.
* @param post.parameters - Query parameters to be applied to the current query.
* @param post.body - The parameters to send with the custom request.
* @param post.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param post.parameters - Query parameters to apply to the current query.
* @param post.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.

@@ -265,5 +265,5 @@ */

* @param put - The put object.
* @param put.path - The path of the API endpoint to target, anything after the /1 needs to be specified.
* @param put.parameters - Query parameters to be applied to the current query.
* @param put.body - The parameters to send with the custom request.
* @param put.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param put.parameters - Query parameters to apply to the current query.
* @param put.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.

@@ -288,7 +288,7 @@ */

/**
* Marks the A/B test as stopped. At this point, the test is over and cannot be restarted. As a result, your application is back to normal: index A will perform as usual, receiving 100% of all search requests. Associated metadata and metrics are still stored.
* If stopped, the test is over and can\'t be restarted. There is now only one index, receiving 100% of all search requests. The data gathered for stopped A/B tests is retained. To determine the `id` for an A/B test, use the [`listABTests` operation](#tag/abtest/operation/listABTests).
*
* @summary Stop a test.
* @summary Stop an A/B test.
* @param stopABTest - The stopABTest object.
* @param stopABTest.id - The A/B test ID.
* @param stopABTest.id - Unique A/B test ID.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.

@@ -295,0 +295,0 @@ */

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

/*! client-abtesting.umd.js | 5.0.0-alpha.73 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/client-abtesting"]={})}(this,(function(e){"use strict";function t(e){let t;const r=`algolia-client-js-${e.key}`;function s(){return void 0===t&&(t=e.localStorage||window.localStorage),t}function a(){return JSON.parse(s().getItem(r)||"{}")}return{get:(e,t,r={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>{const r=JSON.stringify(e),s=a()[r];return Promise.all([s||t(),void 0!==s])})).then((([e,t])=>Promise.all([e,t||r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve().then((()=>{const n=a();return n[JSON.stringify(e)]=t,s().setItem(r,JSON.stringify(n)),t})),delete:e=>Promise.resolve().then((()=>{const t=a();delete t[JSON.stringify(e)],s().setItem(r,JSON.stringify(t))})),clear:()=>Promise.resolve().then((()=>{s().removeItem(r)}))}}function r(e){const t=[...e.caches],s=t.shift();return void 0===s?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then((e=>Promise.all([e,r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,a,n={miss:()=>Promise.resolve()})=>s.get(e,a,n).catch((()=>r({caches:t}).get(e,a,n))),set:(e,a)=>s.set(e,a).catch((()=>r({caches:t}).set(e,a))),delete:e=>s.delete(e).catch((()=>r({caches:t}).delete(e))),clear:()=>s.clear().catch((()=>r({caches:t}).clear()))}}function s(e={serializable:!0}){let t={};return{get(r,s,a={miss:()=>Promise.resolve()}){const n=JSON.stringify(r);if(n in t)return Promise.resolve(e.serializable?JSON.parse(t[n]):t[n]);const o=s();return o.then((e=>a.miss(e))).then((()=>o))},set:(r,s)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(s):s,Promise.resolve(s)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}const a=12e4;function n(e,t="up"){const r=Date.now();return{...e,status:t,lastUpdate:r,isUp:function(){return"up"===t||Date.now()-r>a},isTimedOut:function(){return"timed out"===t&&Date.now()-r<=a}}}function o(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var s=r.call(e,t||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class i extends Error{constructor(e,t){super(e),o(this,"name","AlgoliaError"),t&&(this.name=t)}}class c extends i{constructor(e,t,r){super(e,r),o(this,"stackTrace",void 0),this.stackTrace=t}}class u extends c{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",e,"RetryError")}}class l extends c{constructor(e,t,r,s="ApiError"){super(e,r,s),o(this,"status",void 0),this.status=t}}class d extends i{constructor(e,t){super(e,"DeserializationError"),o(this,"response",void 0),this.response=t}}class h extends l{constructor(e,t,r,s){super(e,t,s,"DetailedApiError"),o(this,"error",void 0),this.error=r}}function m(e,t,r){const s=function(e){const t=e=>"[object Object]"===Object.prototype.toString.call(e)||"[object Array]"===Object.prototype.toString.call(e);return Object.keys(e).map((r=>`${r}=${encodeURIComponent(t(e[r])?JSON.stringify(e[r]):e[r])}`)).join("&")}(r);let a=`${e.protocol}://${e.url}/${"/"===t.charAt(0)?t.substr(1):t}`;return s.length&&(a+=`?${s}`),a}function p(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function f({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:s,algoliaAgent:a,timeouts:o,requester:i,requestsCache:c,responsesCache:f}){async function g(c,f,g=!0){const y=[],P=function(e,t){if("GET"===e.method||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(c,f),w=function(e,t,r){const s={Accept:"application/json",...e,...t,...r},a={};return Object.keys(s).forEach((e=>{const t=s[e];a[e.toLowerCase()]=t})),a}(r,c.headers,f.headers),q="GET"===c.method?{...c.data,...f.data}:{},v={...s,...c.queryParameters,...q};if(a.value&&(v["x-algolia-agent"]=a.value),f&&f.queryParameters)for(const e of Object.keys(f.queryParameters))f.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(f.queryParameters[e])?v[e]=f.queryParameters[e].toString():v[e]=f.queryParameters[e];let T=0;const b=async(e,r)=>{const s=e.pop();if(void 0===s)throw new u(function(e){return e.map((e=>p(e)))}(y));let a=f.timeout;void 0===a&&(a=g?o.read:o.write);const q={data:P,headers:w,method:c.method,url:m(s,c.path,v),connectTimeout:r(T,o.connect),responseTimeout:r(T,a)},O=t=>{const r={request:q,response:t,host:s,triesLeft:e.length};return y.push(r),r},A=await i.send(q);if(function({isTimedOut:e,status:t}){return e||function({isTimedOut:e,status:t}){return!e&&0==~~t}({isTimedOut:e,status:t})||2!=~~(t/100)&&4!=~~(t/100)}(A)){const a=O(A);return A.isTimedOut&&T++,console.log("Retryable failure",p(a)),await t.set(s,n(s,A.isTimedOut?"timed out":"down")),b(e,r)}if(function({status:e}){return 2==~~(e/100)}(A))return function(e){try{return JSON.parse(e.content)}catch(t){throw new d(t.message,e)}}(A);throw O(A),function({content:e,status:t},r){try{const s=JSON.parse(e);return"error"in s?new h(s.message,t,s.error,r):new l(s.message,t,r)}catch(e){}return new l(e,t,r)}(A,y)},O=e.filter((e=>"readWrite"===e.accept||(g?"read"===e.accept:"write"===e.accept))),A=await async function(e){const r=await Promise.all(e.map((e=>t.get(e,(()=>Promise.resolve(n(e))))))),s=r.filter((e=>e.isUp())),a=r.filter((e=>e.isTimedOut())),o=[...s,...a];return{hosts:o.length>0?o:e,getTimeout:(e,t)=>(0===a.length&&0===e?1:a.length+3+e)*t}}(O);return b([...A.hosts].reverse(),A.getTimeout)}return{hostsCache:t,requester:i,timeouts:o,algoliaAgent:a,baseHeaders:r,baseQueryParameters:s,hosts:e,request:function(e,t={}){const a=e.useReadTransporter||"GET"===e.method;if(!a)return g(e,t,a);const n=()=>g(e,t);if(!0!==(t.cacheable||e.cacheable))return n();const o={request:e,requestOptions:t,transporter:{queryParameters:s,headers:r}};return f.get(o,(()=>c.get(o,(()=>c.set(o,n()).then((e=>Promise.all([c.delete(o),e])),(e=>Promise.all([c.delete(o),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>f.set(o,e)})},requestsCache:c,responsesCache:f}}function g({algoliaAgents:e,client:t,version:r}){const s=function(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}(r).add({segment:t,version:r});return e.forEach((e=>s.add(e))),s}const y="5.0.0-alpha.73",P=["de","us"];e.abtestingClient=function(e,a,n,o){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!a||"string"!=typeof a)throw new Error("`apiKey` is missing.");if(n&&("string"!=typeof n||!P.includes(n)))throw new Error(`\`region\` must be one of the following: ${P.join(", ")}`);return function({appId:e,apiKey:t,authMode:r,algoliaAgents:s,region:a,...n}){const o=function(e,t,r="WithinHeaders"){const s={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===r?s:{},queryParameters:()=>"WithinQueryParameters"===r?s:{}}}(e,t,r),i=f({hosts:(c=a,[{url:c?"analytics.{region}.algolia.com".replace("{region}",c):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]),...n,algoliaAgent:g({algoliaAgents:s,client:"Abtesting",version:y}),baseHeaders:{"content-type":"text/plain",...o.headers(),...n.baseHeaders},baseQueryParameters:{...o.queryParameters(),...n.baseQueryParameters}});var c;return{transporter:i,appId:e,clearCache:()=>Promise.all([i.requestsCache.clear(),i.responsesCache.clear()]).then((()=>{})),get _ua(){return i.algoliaAgent.value},addAlgoliaAgent(e,t){i.algoliaAgent.add({segment:e,version:t})},addABTests(e,t){if(!e)throw new Error("Parameter `addABTestsRequest` is required when calling `addABTests`.");if(!e.name)throw new Error("Parameter `addABTestsRequest.name` is required when calling `addABTests`.");if(!e.variant)throw new Error("Parameter `addABTestsRequest.variant` is required when calling `addABTests`.");if(!e.endAt)throw new Error("Parameter `addABTestsRequest.endAt` is required when calling `addABTests`.");const r={method:"POST",path:"/2/abtests",queryParameters:{},headers:{},data:e};return i.request(r,t)},del({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `del`.");const s={method:"DELETE",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(s,r)},deleteABTest({id:e},t){if(!e)throw new Error("Parameter `id` is required when calling `deleteABTest`.");const r={method:"DELETE",path:"/2/abtests/{id}".replace("{id}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},get({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `get`.");const s={method:"GET",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(s,r)},getABTest({id:e},t){if(!e)throw new Error("Parameter `id` is required when calling `getABTest`.");const r={method:"GET",path:"/2/abtests/{id}".replace("{id}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},listABTests({offset:e,limit:t,indexPrefix:r,indexSuffix:s}={},a=undefined){const n={};void 0!==e&&(n.offset=e.toString()),void 0!==t&&(n.limit=t.toString()),void 0!==r&&(n.indexPrefix=r.toString()),void 0!==s&&(n.indexSuffix=s.toString());const o={method:"GET",path:"/2/abtests",queryParameters:n,headers:{}};return i.request(o,a)},post({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `post`.");const a={method:"POST",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return i.request(a,s)},put({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `put`.");const a={method:"PUT",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return i.request(a,s)},stopABTest({id:e},t){if(!e)throw new Error("Parameter `id` is required when calling `stopABTest`.");const r={method:"POST",path:"/2/abtests/{id}/stop".replace("{id}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)}}}({appId:e,apiKey:a,region:n,timeouts:{connect:1e3,read:2e3,write:3e4},requester:{send:function(e){return new Promise((t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((t=>r.setRequestHeader(t,e.headers[t])));const s=(e,s)=>setTimeout((()=>{r.abort(),t({status:0,content:s,isTimedOut:!0})}),e),a=s(e.connectTimeout,"Connection timeout");let n;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===n&&(clearTimeout(a),n=s(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(a),clearTimeout(n),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(a),clearTimeout(n),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:s(),requestsCache:s({serializable:!1}),hostsCache:r({caches:[t({key:`${y}-${e}`}),s()]}),...o})},e.apiClientVersion=y}));
/*! client-abtesting.umd.js | 5.0.0-alpha.75 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/client-abtesting"]={})}(this,(function(e){"use strict";function t(e){let t;const r=`algolia-client-js-${e.key}`;function s(){return void 0===t&&(t=e.localStorage||window.localStorage),t}function a(){return JSON.parse(s().getItem(r)||"{}")}return{get:(e,t,r={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>{const r=JSON.stringify(e),s=a()[r];return Promise.all([s||t(),void 0!==s])})).then((([e,t])=>Promise.all([e,t||r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve().then((()=>{const n=a();return n[JSON.stringify(e)]=t,s().setItem(r,JSON.stringify(n)),t})),delete:e=>Promise.resolve().then((()=>{const t=a();delete t[JSON.stringify(e)],s().setItem(r,JSON.stringify(t))})),clear:()=>Promise.resolve().then((()=>{s().removeItem(r)}))}}function r(e){const t=[...e.caches],s=t.shift();return void 0===s?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then((e=>Promise.all([e,r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,a,n={miss:()=>Promise.resolve()})=>s.get(e,a,n).catch((()=>r({caches:t}).get(e,a,n))),set:(e,a)=>s.set(e,a).catch((()=>r({caches:t}).set(e,a))),delete:e=>s.delete(e).catch((()=>r({caches:t}).delete(e))),clear:()=>s.clear().catch((()=>r({caches:t}).clear()))}}function s(e={serializable:!0}){let t={};return{get(r,s,a={miss:()=>Promise.resolve()}){const n=JSON.stringify(r);if(n in t)return Promise.resolve(e.serializable?JSON.parse(t[n]):t[n]);const o=s();return o.then((e=>a.miss(e))).then((()=>o))},set:(r,s)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(s):s,Promise.resolve(s)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}const a=12e4;function n(e,t="up"){const r=Date.now();return{...e,status:t,lastUpdate:r,isUp:function(){return"up"===t||Date.now()-r>a},isTimedOut:function(){return"timed out"===t&&Date.now()-r<=a}}}function o(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var s=r.call(e,t||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class i extends Error{constructor(e,t){super(e),o(this,"name","AlgoliaError"),t&&(this.name=t)}}class c extends i{constructor(e,t,r){super(e,r),o(this,"stackTrace",void 0),this.stackTrace=t}}class u extends c{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",e,"RetryError")}}class l extends c{constructor(e,t,r,s="ApiError"){super(e,r,s),o(this,"status",void 0),this.status=t}}class d extends i{constructor(e,t){super(e,"DeserializationError"),o(this,"response",void 0),this.response=t}}class h extends l{constructor(e,t,r,s){super(e,t,s,"DetailedApiError"),o(this,"error",void 0),this.error=r}}function m(e,t,r){const s=function(e){const t=e=>"[object Object]"===Object.prototype.toString.call(e)||"[object Array]"===Object.prototype.toString.call(e);return Object.keys(e).map((r=>`${r}=${encodeURIComponent(t(e[r])?JSON.stringify(e[r]):e[r])}`)).join("&")}(r);let a=`${e.protocol}://${e.url}/${"/"===t.charAt(0)?t.substr(1):t}`;return s.length&&(a+=`?${s}`),a}function p(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function f({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:s,algoliaAgent:a,timeouts:o,requester:i,requestsCache:c,responsesCache:f}){async function g(c,f,g=!0){const y=[],P=function(e,t){if("GET"===e.method||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(c,f),w=function(e,t,r){const s={Accept:"application/json",...e,...t,...r},a={};return Object.keys(s).forEach((e=>{const t=s[e];a[e.toLowerCase()]=t})),a}(r,c.headers,f.headers),v="GET"===c.method?{...c.data,...f.data}:{},q={...s,...c.queryParameters,...v};if(a.value&&(q["x-algolia-agent"]=a.value),f&&f.queryParameters)for(const e of Object.keys(f.queryParameters))f.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(f.queryParameters[e])?q[e]=f.queryParameters[e].toString():q[e]=f.queryParameters[e];let T=0;const b=async(e,r)=>{const s=e.pop();if(void 0===s)throw new u(function(e){return e.map((e=>p(e)))}(y));let a=f.timeout;void 0===a&&(a=g?o.read:o.write);const v={data:P,headers:w,method:c.method,url:m(s,c.path,q),connectTimeout:r(T,o.connect),responseTimeout:r(T,a)},O=t=>{const r={request:v,response:t,host:s,triesLeft:e.length};return y.push(r),r},A=await i.send(v);if(function({isTimedOut:e,status:t}){return e||function({isTimedOut:e,status:t}){return!e&&0==~~t}({isTimedOut:e,status:t})||2!=~~(t/100)&&4!=~~(t/100)}(A)){const a=O(A);return A.isTimedOut&&T++,console.log("Retryable failure",p(a)),await t.set(s,n(s,A.isTimedOut?"timed out":"down")),b(e,r)}if(function({status:e}){return 2==~~(e/100)}(A))return function(e){try{return JSON.parse(e.content)}catch(t){throw new d(t.message,e)}}(A);throw O(A),function({content:e,status:t},r){try{const s=JSON.parse(e);return"error"in s?new h(s.message,t,s.error,r):new l(s.message,t,r)}catch(e){}return new l(e,t,r)}(A,y)},O=e.filter((e=>"readWrite"===e.accept||(g?"read"===e.accept:"write"===e.accept))),A=await async function(e){const r=await Promise.all(e.map((e=>t.get(e,(()=>Promise.resolve(n(e))))))),s=r.filter((e=>e.isUp())),a=r.filter((e=>e.isTimedOut())),o=[...s,...a];return{hosts:o.length>0?o:e,getTimeout:(e,t)=>(0===a.length&&0===e?1:a.length+3+e)*t}}(O);return b([...A.hosts].reverse(),A.getTimeout)}return{hostsCache:t,requester:i,timeouts:o,algoliaAgent:a,baseHeaders:r,baseQueryParameters:s,hosts:e,request:function(e,t={}){const a=e.useReadTransporter||"GET"===e.method;if(!a)return g(e,t,a);const n=()=>g(e,t);if(!0!==(t.cacheable||e.cacheable))return n();const o={request:e,requestOptions:t,transporter:{queryParameters:s,headers:r}};return f.get(o,(()=>c.get(o,(()=>c.set(o,n()).then((e=>Promise.all([c.delete(o),e])),(e=>Promise.all([c.delete(o),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>f.set(o,e)})},requestsCache:c,responsesCache:f}}function g({algoliaAgents:e,client:t,version:r}){const s=function(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}(r).add({segment:t,version:r});return e.forEach((e=>s.add(e))),s}const y="5.0.0-alpha.75",P=["de","us"];e.abtestingClient=function(e,a,n,o){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!a||"string"!=typeof a)throw new Error("`apiKey` is missing.");if(n&&("string"!=typeof n||!P.includes(n)))throw new Error(`\`region\` must be one of the following: ${P.join(", ")}`);return function({appId:e,apiKey:t,authMode:r,algoliaAgents:s,region:a,...n}){const o=function(e,t,r="WithinHeaders"){const s={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===r?s:{},queryParameters:()=>"WithinQueryParameters"===r?s:{}}}(e,t,r),i=f({hosts:(c=a,[{url:c?"analytics.{region}.algolia.com".replace("{region}",c):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]),...n,algoliaAgent:g({algoliaAgents:s,client:"Abtesting",version:y}),baseHeaders:{"content-type":"text/plain",...o.headers(),...n.baseHeaders},baseQueryParameters:{...o.queryParameters(),...n.baseQueryParameters}});var c;return{transporter:i,appId:e,clearCache:()=>Promise.all([i.requestsCache.clear(),i.responsesCache.clear()]).then((()=>{})),get _ua(){return i.algoliaAgent.value},addAlgoliaAgent(e,t){i.algoliaAgent.add({segment:e,version:t})},addABTests(e,t){if(!e)throw new Error("Parameter `addABTestsRequest` is required when calling `addABTests`.");if(!e.name)throw new Error("Parameter `addABTestsRequest.name` is required when calling `addABTests`.");if(!e.variants)throw new Error("Parameter `addABTestsRequest.variants` is required when calling `addABTests`.");if(!e.endAt)throw new Error("Parameter `addABTestsRequest.endAt` is required when calling `addABTests`.");const r={method:"POST",path:"/2/abtests",queryParameters:{},headers:{},data:e};return i.request(r,t)},del({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `del`.");const s={method:"DELETE",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(s,r)},deleteABTest({id:e},t){if(!e)throw new Error("Parameter `id` is required when calling `deleteABTest`.");const r={method:"DELETE",path:"/2/abtests/{id}".replace("{id}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},get({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `get`.");const s={method:"GET",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(s,r)},getABTest({id:e},t){if(!e)throw new Error("Parameter `id` is required when calling `getABTest`.");const r={method:"GET",path:"/2/abtests/{id}".replace("{id}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},listABTests({offset:e,limit:t,indexPrefix:r,indexSuffix:s}={},a=void 0){const n={};void 0!==e&&(n.offset=e.toString()),void 0!==t&&(n.limit=t.toString()),void 0!==r&&(n.indexPrefix=r.toString()),void 0!==s&&(n.indexSuffix=s.toString());const o={method:"GET",path:"/2/abtests",queryParameters:n,headers:{}};return i.request(o,a)},post({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `post`.");const a={method:"POST",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return i.request(a,s)},put({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `put`.");const a={method:"PUT",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return i.request(a,s)},stopABTest({id:e},t){if(!e)throw new Error("Parameter `id` is required when calling `stopABTest`.");const r={method:"POST",path:"/2/abtests/{id}/stop".replace("{id}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)}}}({appId:e,apiKey:a,region:n,timeouts:{connect:1e3,read:2e3,write:3e4},requester:{send:function(e){return new Promise((t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((t=>r.setRequestHeader(t,e.headers[t])));const s=(e,s)=>setTimeout((()=>{r.abort(),t({status:0,content:s,isTimedOut:!0})}),e),a=s(e.connectTimeout,"Connection timeout");let n;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===n&&(clearTimeout(a),n=s(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(a),clearTimeout(n),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(a),clearTimeout(n),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:s(),requestsCache:s({serializable:!1}),hostsCache:r({caches:[t({key:`${y}-${e}`}),s()]}),...o})},e.apiClientVersion=y}));
import type { Variant } from './variant';
export type ABTest = {
/**
* The A/B test ID.
* Unique A/B test ID.
*/
abTestID: number;
/**
* A/B test significance based on click data. Should be > 0.95 to be considered significant (no matter which variant is winning).
* [A/B test significance](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing/in-depth/how-ab-test-scores-are-calculated/#statistical-significance-or-chance) based on click data. A value of 0.95 or over is considered to be _significant_.
*/
clickSignificance: number;
/**
* A/B test significance based on conversion data. Should be > 0.95 to be considered significant (no matter which variant is winning).
* End date timestamp in [ISO-8601](https://wikipedia.org/wiki/ISO_8601) format.
*/
conversionSignificance: number;
conversionSignificance: string;
/**
* End date for the A/B test expressed as YYYY-MM-DDThh:mm:ssZ.
* Update date timestamp in [ISO-8601](https://wikipedia.org/wiki/ISO_8601) format.
*/
endAt: string;
/**
* Update date for the A/B test expressed as YYYY-MM-DDThh:mm:ssZ.
*/
updatedAt: string;
/**
* Creation date for the A/B test expressed as YYYY-MM-DDThh:mm:ssZ.
* Creation date timestamp in [ISO-8601](https://wikipedia.org/wiki/ISO_8601) format.
*/

@@ -32,7 +28,7 @@ createdAt: string;

/**
* Status of the A/B test.
* A/B test status.
*/
status: string;
/**
* List of A/B test variant.
* A/B test variants.
*/

@@ -39,0 +35,0 @@ variants: Variant[];

export type ABTestResponse = {
/**
* The index performing the A/B test.
* A/B test index.
*/
index: string;
/**
* The A/B test ID.
* Unique A/B test ID.
*/
abTestID: number;
/**
* TaskID of the task to wait for.
* Unique identifier of a task. A successful API response means that a task was added to a queue. It might not run immediately. You can check the task\'s progress with the `task` operation and this `taskID`.
*/

@@ -13,0 +13,0 @@ taskID: number;

export type AbTestsVariant = {
/**
* The index performing the A/B test.
* A/B test index.
*/
index: string;
/**
* The traffic percentage for the A/B test.
* A/B test traffic percentage.
*/
trafficPercentage: number;
/**
* The A/B test description.
* A/B test description.
*/

@@ -13,0 +13,0 @@ description?: string;

@@ -8,7 +8,7 @@ import type { AddABTestsVariant } from './addABTestsVariant';

/**
* List of 2 variants for the A/B test.
* A/B test variants.
*/
variant: AddABTestsVariant[];
variants: AddABTestsVariant[];
/**
* End date for the A/B test expressed as YYYY-MM-DDThh:mm:ssZ.
* End date timestamp in [ISO-8601](https://wikipedia.org/wiki/ISO_8601) format.
*/

@@ -15,0 +15,0 @@ endAt: string;

@@ -6,7 +6,7 @@ /**

/**
* The path of the API endpoint to target, anything after the /1 needs to be specified.
* Path of the endpoint, anything after \"/1\" must be specified.
*/
path: string;
/**
* Query parameters to be applied to the current query.
* Query parameters to apply to the current query.
*/

@@ -20,3 +20,3 @@ parameters?: Record<string, any>;

/**
* The A/B test ID.
* Unique A/B test ID.
*/

@@ -30,7 +30,7 @@ id: number;

/**
* The path of the API endpoint to target, anything after the /1 needs to be specified.
* Path of the endpoint, anything after \"/1\" must be specified.
*/
path: string;
/**
* Query parameters to be applied to the current query.
* Query parameters to apply to the current query.
*/

@@ -44,3 +44,3 @@ parameters?: Record<string, any>;

/**
* The A/B test ID.
* Unique A/B test ID.
*/

@@ -58,11 +58,11 @@ id: number;

/**
* Number of records to return. Limit is the size of the page.
* Number of records to return (page size).
*/
limit?: number;
/**
* Filters the returned ab tests by any indices starting with the provided prefix that are assigned to either variant of an ab test.
* Only return A/B tests for indices starting with this prefix.
*/
indexPrefix?: string;
/**
* Filters the returned ab tests by any indices ending with the provided suffix that are assigned to either variant of an ab test.
* Only return A/B tests for indices ending with this suffix.
*/

@@ -76,11 +76,11 @@ indexSuffix?: string;

/**
* The path of the API endpoint to target, anything after the /1 needs to be specified.
* Path of the endpoint, anything after \"/1\" must be specified.
*/
path: string;
/**
* Query parameters to be applied to the current query.
* Query parameters to apply to the current query.
*/
parameters?: Record<string, any>;
/**
* The parameters to send with the custom request.
* Parameters to send with the custom request.
*/

@@ -94,11 +94,11 @@ body?: Record<string, any>;

/**
* The path of the API endpoint to target, anything after the /1 needs to be specified.
* Path of the endpoint, anything after \"/1\" must be specified.
*/
path: string;
/**
* Query parameters to be applied to the current query.
* Query parameters to apply to the current query.
*/
parameters?: Record<string, any>;
/**
* The parameters to send with the custom request.
* Parameters to send with the custom request.
*/

@@ -112,3 +112,3 @@ body?: Record<string, any>;

/**
* The A/B test ID.
* Unique A/B test ID.
*/

@@ -115,0 +115,0 @@ id: number;

@@ -0,1 +1,4 @@

/**
* Applies search parameters from [a restricted set of options](https://www.algolia.com/doc/api-reference/api-methods/add-ab-test/#method-param-customsearchparameters). Only use this parameter if the two variants use the same index.
*/
export type CustomSearchParams = {

@@ -2,0 +5,0 @@ customSearchParameters: Record<string, any>;

import type { ABTest } from './aBTest';
export type ListABTestsResponse = {
/**
* List of A/B tests.
* A/B tests.
*/
abtests: ABTest[];
/**
* Number of A/B tests found for the app.
* Number of A/B tests implemented.
*/
count: number;
/**
* Number of A/B tests retrievable.
* Number of retrievable A/B tests.
*/

@@ -14,0 +14,0 @@ total: number;

export type Variant = {
/**
* Average click position for the variant.
* Variant\'s [average click position](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#click-position).
*/
averageClickPosition: number;
/**
* Distinct click count for the variant.
* Number of click events for this variant.
*/
clickCount: number;
/**
* Click through rate for the variant.
* Variant\'s [click-through rate](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#click-through-rate).
*/
clickThroughRate: number;
/**
* Distinct conversion count for the variant.
* Number of click events for this variant.
*/
conversionCount: number;
/**
* Conversion rate for the variant.
* Variant\'s [conversion rate](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#conversion-rate).
*/
conversionRate: number;
/**
* The A/B test description.
* A/B test description.
*/
description: string;
/**
* The index performing the A/B test.
* A/B test index.
*/
index: string;
/**
* The number of occurrences.
* Number of [searches without results](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#searches-without-results) for that variant.
*/
noResultCount: number;
/**
* Count of the tracked searches attributed to outlier traffic that were removed from the A/B test.
* Number of tracked searches attributed to [outlier traffic](https://www.algolia.com/doc/guides/ab-testing/how-to-read-your-a-b-test-results/#is-the-split-off) that were removed from the A/B test. A _tracked_ search is a search request where the `clickAnalytics` parameter is `true`.
*/
outlierTrackedSearchesCount: number;
/**
* Count of users attributed to outlier traffic that were removed from the A/B test.
* Number of users attributed to [outlier traffic](https://www.algolia.com/doc/guides/ab-testing/how-to-read-your-a-b-test-results/#is-the-split-off) that were removed from the A/B test.
*/
outlierUsersCount: number;
/**
* The number of search during the A/B test.
* Number of searches carried out during the A/B test.
*/
searchCount: number;
/**
* The number of tracked search click.
* Number of tracked searches. This is the number of search requests where the `clickAnalytics` parameter is `true`.
*/
trackedSearchCount: number;
/**
* The traffic percentage for the A/B test.
* A/B test traffic percentage.
*/
trafficPercentage: number;
/**
* The number of user during the A/B test.
* Number of users during the A/B test.
*/

@@ -57,0 +57,0 @@ userCount: number;

@@ -7,3 +7,3 @@ import type { CreateClientOptions, RequestOptions } from '@algolia/client-common';

import type { ListABTestsResponse } from '../model/listABTestsResponse';
export declare const apiClientVersion = "5.0.0-alpha.73";
export declare const apiClientVersion = "5.0.0-alpha.75";
export declare const REGIONS: readonly ["de", "us"];

@@ -35,5 +35,5 @@ export type Region = (typeof REGIONS)[number];

/**
* Creates a new A/B test with provided configuration. You can set an A/B test on two different indices with different settings, or on the same index with different search parameters by providing a customSearchParameters setting on one of the variants.
* Creates an A/B test.
*
* @summary Create a test.
* @summary Create an A/B test.
* @param addABTestsRequest - The addABTestsRequest object.

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

* @param del - The del object.
* @param del.path - The path of the API endpoint to target, anything after the /1 needs to be specified.
* @param del.parameters - Query parameters to be applied to the current query.
* @param del.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param del.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.

@@ -55,7 +55,7 @@ */

/**
* Delete a test.
* Delete an A/B test. To determine the `id` for an A/B test, use the [`listABTests` operation](#tag/abtest/operation/listABTests).
*
* @summary Delete a test.
* @summary Delete an A/B test.
* @param deleteABTest - The deleteABTest object.
* @param deleteABTest.id - The A/B test ID.
* @param deleteABTest.id - Unique A/B test ID.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.

@@ -69,4 +69,4 @@ */

* @param get - The get object.
* @param get.path - The path of the API endpoint to target, anything after the /1 needs to be specified.
* @param get.parameters - Query parameters to be applied to the current query.
* @param get.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param get.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.

@@ -76,7 +76,7 @@ */

/**
* Returns metadata and metrics for an A/B test.
* Get specific details for an A/B test. To determine the `id` for an A/B test, use the [`listABTests` operation](#tag/abtest/operation/listABTests).
*
* @summary Get a test.
* @summary Get A/B test details.
* @param getABTest - The getABTest object.
* @param getABTest.id - The A/B test ID.
* @param getABTest.id - Unique A/B test ID.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.

@@ -86,10 +86,10 @@ */

/**
* Fetch all existing A/B tests for App that are available for the current API Key. When no data has been processed, the metrics will be returned as null.
* List all A/B tests.
*
* @summary List all tests.
* @summary List all A/B tests.
* @param listABTests - The listABTests object.
* @param listABTests.offset - Position of the starting record. Used for paging. 0 is the first record.
* @param listABTests.limit - Number of records to return. Limit is the size of the page.
* @param listABTests.indexPrefix - Filters the returned ab tests by any indices starting with the provided prefix that are assigned to either variant of an ab test.
* @param listABTests.indexSuffix - Filters the returned ab tests by any indices ending with the provided suffix that are assigned to either variant of an ab test.
* @param listABTests.limit - Number of records to return (page size).
* @param listABTests.indexPrefix - Only return A/B tests for indices starting with this prefix.
* @param listABTests.indexSuffix - Only return A/B tests for indices ending with this suffix.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.

@@ -103,5 +103,5 @@ */

* @param post - The post object.
* @param post.path - The path of the API endpoint to target, anything after the /1 needs to be specified.
* @param post.parameters - Query parameters to be applied to the current query.
* @param post.body - The parameters to send with the custom request.
* @param post.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param post.parameters - Query parameters to apply to the current query.
* @param post.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.

@@ -115,5 +115,5 @@ */

* @param put - The put object.
* @param put.path - The path of the API endpoint to target, anything after the /1 needs to be specified.
* @param put.parameters - Query parameters to be applied to the current query.
* @param put.body - The parameters to send with the custom request.
* @param put.path - Path of the endpoint, anything after \"/1\" must be specified.
* @param put.parameters - Query parameters to apply to the current query.
* @param put.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.

@@ -123,7 +123,7 @@ */

/**
* Marks the A/B test as stopped. At this point, the test is over and cannot be restarted. As a result, your application is back to normal: index A will perform as usual, receiving 100% of all search requests. Associated metadata and metrics are still stored.
* If stopped, the test is over and can\'t be restarted. There is now only one index, receiving 100% of all search requests. The data gathered for stopped A/B tests is retained. To determine the `id` for an A/B test, use the [`listABTests` operation](#tag/abtest/operation/listABTests).
*
* @summary Stop a test.
* @summary Stop an A/B test.
* @param stopABTest - The stopABTest object.
* @param stopABTest.id - The A/B test ID.
* @param stopABTest.id - Unique A/B test ID.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.

@@ -130,0 +130,0 @@ */

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

/**
* The A/B test ID.
* Unique A/B test ID.
*/

@@ -13,3 +13,3 @@ abTestID: number;

/**
* A/B test significance based on click data. Should be > 0.95 to be considered significant (no matter which variant is winning).
* [A/B test significance](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing/in-depth/how-ab-test-scores-are-calculated/#statistical-significance-or-chance) based on click data. A value of 0.95 or over is considered to be _significant_.
*/

@@ -19,18 +19,13 @@ clickSignificance: number;

/**
* A/B test significance based on conversion data. Should be > 0.95 to be considered significant (no matter which variant is winning).
* End date timestamp in [ISO-8601](https://wikipedia.org/wiki/ISO_8601) format.
*/
conversionSignificance: number;
conversionSignificance: string;
/**
* End date for the A/B test expressed as YYYY-MM-DDThh:mm:ssZ.
* Update date timestamp in [ISO-8601](https://wikipedia.org/wiki/ISO_8601) format.
*/
endAt: string;
/**
* Update date for the A/B test expressed as YYYY-MM-DDThh:mm:ssZ.
*/
updatedAt: string;
/**
* Creation date for the A/B test expressed as YYYY-MM-DDThh:mm:ssZ.
* Creation date timestamp in [ISO-8601](https://wikipedia.org/wiki/ISO_8601) format.
*/

@@ -45,3 +40,3 @@ createdAt: string;

/**
* Status of the A/B test.
* A/B test status.
*/

@@ -51,5 +46,5 @@ status: string;

/**
* List of A/B test variant.
* A/B test variants.
*/
variants: Variant[];
};

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

/**
* The index performing the A/B test.
* A/B test index.
*/

@@ -11,3 +11,3 @@ index: string;

/**
* The A/B test ID.
* Unique A/B test ID.
*/

@@ -17,5 +17,5 @@ abTestID: number;

/**
* TaskID of the task to wait for.
* Unique identifier of a task. A successful API response means that a task was added to a queue. It might not run immediately. You can check the task\'s progress with the `task` operation and this `taskID`.
*/
taskID: number;
};

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

/**
* The index performing the A/B test.
* A/B test index.
*/

@@ -11,3 +11,3 @@ index: string;

/**
* The traffic percentage for the A/B test.
* A/B test traffic percentage.
*/

@@ -17,5 +17,5 @@ trafficPercentage: number;

/**
* The A/B test description.
* A/B test description.
*/
description?: string;
};

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

/**
* List of 2 variants for the A/B test.
* A/B test variants.
*/
variant: AddABTestsVariant[];
variants: AddABTestsVariant[];
/**
* End date for the A/B test expressed as YYYY-MM-DDThh:mm:ssZ.
* End date timestamp in [ISO-8601](https://wikipedia.org/wiki/ISO_8601) format.
*/
endAt: string;
};

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

/**
* The path of the API endpoint to target, anything after the /1 needs to be specified.
* Path of the endpoint, anything after \"/1\" must be specified.
*/
path: string;
/**
* Query parameters to be applied to the current query.
* Query parameters to apply to the current query.
*/

@@ -23,3 +23,3 @@ parameters?: Record<string, any>;

/**
* The A/B test ID.
* Unique A/B test ID.
*/

@@ -34,7 +34,7 @@ id: number;

/**
* The path of the API endpoint to target, anything after the /1 needs to be specified.
* Path of the endpoint, anything after \"/1\" must be specified.
*/
path: string;
/**
* Query parameters to be applied to the current query.
* Query parameters to apply to the current query.
*/

@@ -49,3 +49,3 @@ parameters?: Record<string, any>;

/**
* The A/B test ID.
* Unique A/B test ID.
*/

@@ -64,11 +64,11 @@ id: number;

/**
* Number of records to return. Limit is the size of the page.
* Number of records to return (page size).
*/
limit?: number;
/**
* Filters the returned ab tests by any indices starting with the provided prefix that are assigned to either variant of an ab test.
* Only return A/B tests for indices starting with this prefix.
*/
indexPrefix?: string;
/**
* Filters the returned ab tests by any indices ending with the provided suffix that are assigned to either variant of an ab test.
* Only return A/B tests for indices ending with this suffix.
*/

@@ -83,11 +83,11 @@ indexSuffix?: string;

/**
* The path of the API endpoint to target, anything after the /1 needs to be specified.
* Path of the endpoint, anything after \"/1\" must be specified.
*/
path: string;
/**
* Query parameters to be applied to the current query.
* Query parameters to apply to the current query.
*/
parameters?: Record<string, any>;
/**
* The parameters to send with the custom request.
* Parameters to send with the custom request.
*/

@@ -102,11 +102,11 @@ body?: Record<string, any>;

/**
* The path of the API endpoint to target, anything after the /1 needs to be specified.
* Path of the endpoint, anything after \"/1\" must be specified.
*/
path: string;
/**
* Query parameters to be applied to the current query.
* Query parameters to apply to the current query.
*/
parameters?: Record<string, any>;
/**
* The parameters to send with the custom request.
* Parameters to send with the custom request.
*/

@@ -121,5 +121,5 @@ body?: Record<string, any>;

/**
* The A/B test ID.
* Unique A/B test ID.
*/
id: number;
};
// 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.
/**
* Applies search parameters from [a restricted set of options](https://www.algolia.com/doc/api-reference/api-methods/add-ab-test/#method-param-customsearchparameters). Only use this parameter if the two variants use the same index.
*/
export type CustomSearchParams = {
customSearchParameters: Record<string, any>;
};

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

/**
* List of A/B tests.
* A/B tests.
*/

@@ -13,3 +13,3 @@ abtests: ABTest[];

/**
* Number of A/B tests found for the app.
* Number of A/B tests implemented.
*/

@@ -19,5 +19,5 @@ count: number;

/**
* Number of A/B tests retrievable.
* Number of retrievable A/B tests.
*/
total: number;
};

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

/**
* Average click position for the variant.
* Variant\'s [average click position](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#click-position).
*/

@@ -11,3 +11,3 @@ averageClickPosition: number;

/**
* Distinct click count for the variant.
* Number of click events for this variant.
*/

@@ -17,3 +17,3 @@ clickCount: number;

/**
* Click through rate for the variant.
* Variant\'s [click-through rate](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#click-through-rate).
*/

@@ -23,3 +23,3 @@ clickThroughRate: number;

/**
* Distinct conversion count for the variant.
* Number of click events for this variant.
*/

@@ -29,3 +29,3 @@ conversionCount: number;

/**
* Conversion rate for the variant.
* Variant\'s [conversion rate](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#conversion-rate).
*/

@@ -35,3 +35,3 @@ conversionRate: number;

/**
* The A/B test description.
* A/B test description.
*/

@@ -41,3 +41,3 @@ description: string;

/**
* The index performing the A/B test.
* A/B test index.
*/

@@ -47,3 +47,3 @@ index: string;

/**
* The number of occurrences.
* Number of [searches without results](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#searches-without-results) for that variant.
*/

@@ -53,3 +53,3 @@ noResultCount: number;

/**
* Count of the tracked searches attributed to outlier traffic that were removed from the A/B test.
* Number of tracked searches attributed to [outlier traffic](https://www.algolia.com/doc/guides/ab-testing/how-to-read-your-a-b-test-results/#is-the-split-off) that were removed from the A/B test. A _tracked_ search is a search request where the `clickAnalytics` parameter is `true`.
*/

@@ -59,3 +59,3 @@ outlierTrackedSearchesCount: number;

/**
* Count of users attributed to outlier traffic that were removed from the A/B test.
* Number of users attributed to [outlier traffic](https://www.algolia.com/doc/guides/ab-testing/how-to-read-your-a-b-test-results/#is-the-split-off) that were removed from the A/B test.
*/

@@ -65,3 +65,3 @@ outlierUsersCount: number;

/**
* The number of search during the A/B test.
* Number of searches carried out during the A/B test.
*/

@@ -71,3 +71,3 @@ searchCount: number;

/**
* The number of tracked search click.
* Number of tracked searches. This is the number of search requests where the `clickAnalytics` parameter is `true`.
*/

@@ -77,3 +77,3 @@ trackedSearchCount: number;

/**
* The traffic percentage for the A/B test.
* A/B test traffic percentage.
*/

@@ -83,5 +83,5 @@ trafficPercentage: number;

/**
* The number of user during the A/B test.
* Number of users during the A/B test.
*/
userCount: number;
};
{
"name": "@algolia/client-abtesting",
"version": "5.0.0-alpha.73",
"version": "5.0.0-alpha.75",
"description": "JavaScript client for client-abtesting",

@@ -8,2 +8,3 @@ "repository": "algolia/algoliasearch-client-javascript",

"author": "Algolia",
"type": "module",
"exports": {

@@ -42,10 +43,10 @@ ".": {

"dependencies": {
"@algolia/client-common": "5.0.0-alpha.73",
"@algolia/requester-browser-xhr": "5.0.0-alpha.73",
"@algolia/requester-node-http": "5.0.0-alpha.73"
"@algolia/client-common": "5.0.0-alpha.75",
"@algolia/requester-browser-xhr": "5.0.0-alpha.75",
"@algolia/requester-node-http": "5.0.0-alpha.75"
},
"devDependencies": {
"@types/node": "18.16.18",
"rollup": "2.79.1",
"typescript": "5.0.4"
"@types/node": "18.17.0",
"rollup": "3.26.3",
"typescript": "5.1.6"
},

@@ -52,0 +53,0 @@ "engines": {

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