@algolia/client-abtesting 5.0.0-alpha.99 → 5.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/builds/browser.d.ts +22 -3
  2. package/dist/builds/browser.d.ts.map +1 -1
  3. package/dist/builds/node.d.ts +22 -3
  4. package/dist/builds/node.d.ts.map +1 -1
  5. package/dist/client-abtesting.cjs +51 -42
  6. package/dist/client-abtesting.esm.browser.js +38 -34
  7. package/dist/client-abtesting.esm.node.js +51 -42
  8. package/dist/client-abtesting.umd.js +2 -2
  9. package/dist/model/aBTest.d.ts +14 -29
  10. package/dist/model/aBTest.d.ts.map +1 -1
  11. package/dist/model/aBTestConfiguration.d.ts +12 -0
  12. package/dist/model/aBTestConfiguration.d.ts.map +1 -0
  13. package/dist/model/aBTestResponse.d.ts +3 -3
  14. package/dist/model/abTestsVariant.d.ts +3 -3
  15. package/dist/model/addABTestsRequest.d.ts +1 -1
  16. package/dist/model/clientMethodProps.d.ts +7 -7
  17. package/dist/model/{currenciesValue.d.ts → currency.d.ts} +2 -2
  18. package/dist/model/currency.d.ts.map +1 -0
  19. package/dist/model/customSearchParams.d.ts +1 -1
  20. package/dist/model/effect.d.ts +5 -0
  21. package/dist/model/effect.d.ts.map +1 -0
  22. package/dist/model/emptySearch.d.ts +10 -0
  23. package/dist/model/emptySearch.d.ts.map +1 -0
  24. package/dist/model/index.d.ts +7 -1
  25. package/dist/model/index.d.ts.map +1 -1
  26. package/dist/model/listABTestsResponse.d.ts +2 -2
  27. package/dist/model/listABTestsResponse.d.ts.map +1 -1
  28. package/dist/model/minimumDetectableEffect.d.ts +12 -0
  29. package/dist/model/minimumDetectableEffect.d.ts.map +1 -0
  30. package/dist/model/outliers.d.ts +10 -0
  31. package/dist/model/outliers.d.ts.map +1 -0
  32. package/dist/model/status.d.ts +5 -0
  33. package/dist/model/status.d.ts.map +1 -0
  34. package/dist/model/variant.d.ts +29 -25
  35. package/dist/model/variant.d.ts.map +1 -1
  36. package/dist/src/abtestingClient.d.ts +28 -26
  37. package/dist/src/abtestingClient.d.ts.map +1 -1
  38. package/model/aBTest.ts +15 -29
  39. package/model/aBTestConfiguration.ts +16 -0
  40. package/model/aBTestResponse.ts +3 -3
  41. package/model/abTestsVariant.ts +3 -3
  42. package/model/addABTestsRequest.ts +1 -1
  43. package/model/clientMethodProps.ts +7 -7
  44. package/model/{currenciesValue.ts → currency.ts} +1 -1
  45. package/model/customSearchParams.ts +1 -1
  46. package/model/effect.ts +10 -0
  47. package/model/emptySearch.ts +11 -0
  48. package/model/index.ts +7 -1
  49. package/model/listABTestsResponse.ts +2 -2
  50. package/model/minimumDetectableEffect.ts +15 -0
  51. package/model/outliers.ts +11 -0
  52. package/model/status.ts +6 -0
  53. package/model/variant.ts +30 -25
  54. package/package.json +7 -7
  55. package/dist/model/currenciesValue.d.ts.map +0 -1
@@ -2,7 +2,7 @@ import { createAuth, createTransporter, getAlgoliaAgent, DEFAULT_CONNECT_TIMEOUT
2
2
  import { createHttpRequester } from '@algolia/requester-node-http';
3
3
 
4
4
  // 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.
5
- const apiClientVersion = '5.0.0-alpha.99';
5
+ const apiClientVersion = '5.0.0-beta.2';
6
6
  const REGIONS = ['de', 'us'];
7
7
  function getDefaultHosts(region) {
8
8
  const url = !region
@@ -62,9 +62,11 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
62
62
  transporter.algoliaAgent.add({ segment, version });
63
63
  },
64
64
  /**
65
- * Creates an A/B test.
65
+ * Creates a new A/B test.
66
+ *
67
+ * Required API Key ACLs:
68
+ * - editSettings.
66
69
  *
67
- * @summary Create an A/B test.
68
70
  * @param addABTestsRequest - The addABTestsRequest object.
69
71
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
70
72
  */
@@ -96,7 +98,6 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
96
98
  /**
97
99
  * This method allow you to send requests to the Algolia REST API.
98
100
  *
99
- * @summary Send requests to the Algolia REST API.
100
101
  * @param customDelete - The customDelete object.
101
102
  * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
102
103
  * @param customDelete.parameters - Query parameters to apply to the current query.
@@ -106,7 +107,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
106
107
  if (!path) {
107
108
  throw new Error('Parameter `path` is required when calling `customDelete`.');
108
109
  }
109
- const requestPath = '/1{path}'.replace('{path}', path);
110
+ const requestPath = '/{path}'.replace('{path}', path);
110
111
  const headers = {};
111
112
  const queryParameters = parameters ? parameters : {};
112
113
  const request = {
@@ -120,7 +121,6 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
120
121
  /**
121
122
  * This method allow you to send requests to the Algolia REST API.
122
123
  *
123
- * @summary Send requests to the Algolia REST API.
124
124
  * @param customGet - The customGet object.
125
125
  * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
126
126
  * @param customGet.parameters - Query parameters to apply to the current query.
@@ -130,7 +130,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
130
130
  if (!path) {
131
131
  throw new Error('Parameter `path` is required when calling `customGet`.');
132
132
  }
133
- const requestPath = '/1{path}'.replace('{path}', path);
133
+ const requestPath = '/{path}'.replace('{path}', path);
134
134
  const headers = {};
135
135
  const queryParameters = parameters ? parameters : {};
136
136
  const request = {
@@ -144,7 +144,6 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
144
144
  /**
145
145
  * This method allow you to send requests to the Algolia REST API.
146
146
  *
147
- * @summary Send requests to the Algolia REST API.
148
147
  * @param customPost - The customPost object.
149
148
  * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
150
149
  * @param customPost.parameters - Query parameters to apply to the current query.
@@ -155,7 +154,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
155
154
  if (!path) {
156
155
  throw new Error('Parameter `path` is required when calling `customPost`.');
157
156
  }
158
- const requestPath = '/1{path}'.replace('{path}', path);
157
+ const requestPath = '/{path}'.replace('{path}', path);
159
158
  const headers = {};
160
159
  const queryParameters = parameters ? parameters : {};
161
160
  const request = {
@@ -170,7 +169,6 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
170
169
  /**
171
170
  * This method allow you to send requests to the Algolia REST API.
172
171
  *
173
- * @summary Send requests to the Algolia REST API.
174
172
  * @param customPut - The customPut object.
175
173
  * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
176
174
  * @param customPut.parameters - Query parameters to apply to the current query.
@@ -181,7 +179,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
181
179
  if (!path) {
182
180
  throw new Error('Parameter `path` is required when calling `customPut`.');
183
181
  }
184
- const requestPath = '/1{path}'.replace('{path}', path);
182
+ const requestPath = '/{path}'.replace('{path}', path);
185
183
  const headers = {};
186
184
  const queryParameters = parameters ? parameters : {};
187
185
  const request = {
@@ -194,11 +192,13 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
194
192
  return transporter.request(request, requestOptions);
195
193
  },
196
194
  /**
197
- * Delete an A/B test. To determine the `id` for an A/B test, use the [`listABTests` operation](#tag/abtest/operation/listABTests).
195
+ * Deletes an A/B test by its ID.
196
+ *
197
+ * Required API Key ACLs:
198
+ * - editSettings.
198
199
  *
199
- * @summary Delete an A/B test.
200
200
  * @param deleteABTest - The deleteABTest object.
201
- * @param deleteABTest.id - Unique A/B test ID.
201
+ * @param deleteABTest.id - Unique A/B test identifier.
202
202
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
203
203
  */
204
204
  deleteABTest({ id }, requestOptions) {
@@ -217,11 +217,13 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
217
217
  return transporter.request(request, requestOptions);
218
218
  },
219
219
  /**
220
- * 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).
220
+ * Retrieves the details for an A/B test by its ID.
221
+ *
222
+ * Required API Key ACLs:
223
+ * - analytics.
221
224
  *
222
- * @summary Get A/B test details.
223
225
  * @param getABTest - The getABTest object.
224
- * @param getABTest.id - Unique A/B test ID.
226
+ * @param getABTest.id - Unique A/B test identifier.
225
227
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
226
228
  */
227
229
  getABTest({ id }, requestOptions) {
@@ -240,14 +242,16 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
240
242
  return transporter.request(request, requestOptions);
241
243
  },
242
244
  /**
243
- * List all A/B tests.
245
+ * Lists all A/B tests you configured for this application.
246
+ *
247
+ * Required API Key ACLs:
248
+ * - analytics.
244
249
  *
245
- * @summary List all A/B tests.
246
250
  * @param listABTests - The listABTests object.
247
- * @param listABTests.offset - Position of the starting record. Used for paging. 0 is the first record.
248
- * @param listABTests.limit - Number of records to return (page size).
249
- * @param listABTests.indexPrefix - Only return A/B tests for indices starting with this prefix.
250
- * @param listABTests.indexSuffix - Only return A/B tests for indices ending with this suffix.
251
+ * @param listABTests.offset - Position of the first item to return.
252
+ * @param listABTests.limit - Number of items to return.
253
+ * @param listABTests.indexPrefix - Index name prefix. Only A/B tests for indices starting with this string are included in the response.
254
+ * @param listABTests.indexSuffix - Index name suffix. Only A/B tests for indices ending with this string are included in the response.
251
255
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
252
256
  */
253
257
  listABTests({ offset, limit, indexPrefix, indexSuffix } = {}, requestOptions = undefined) {
@@ -275,11 +279,13 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
275
279
  return transporter.request(request, requestOptions);
276
280
  },
277
281
  /**
278
- * 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).
282
+ * Stops an A/B test by its ID. You can\'t restart stopped A/B tests.
283
+ *
284
+ * Required API Key ACLs:
285
+ * - editSettings.
279
286
  *
280
- * @summary Stop an A/B test.
281
287
  * @param stopABTest - The stopABTest object.
282
- * @param stopABTest.id - Unique A/B test ID.
288
+ * @param stopABTest.id - Unique A/B test identifier.
283
289
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
284
290
  */
285
291
  stopABTest({ id }, requestOptions) {
@@ -301,6 +307,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
301
307
  }
302
308
 
303
309
  // 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.
310
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
304
311
  function abtestingClient(appId, apiKey, region, options) {
305
312
  if (!appId || typeof appId !== 'string') {
306
313
  throw new Error('`appId` is missing.');
@@ -311,22 +318,24 @@ function abtestingClient(appId, apiKey, region, options) {
311
318
  if (region && (typeof region !== 'string' || !REGIONS.includes(region))) {
312
319
  throw new Error(`\`region\` must be one of the following: ${REGIONS.join(', ')}`);
313
320
  }
314
- return createAbtestingClient({
315
- appId,
316
- apiKey,
317
- region,
318
- timeouts: {
319
- connect: DEFAULT_CONNECT_TIMEOUT_NODE,
320
- read: DEFAULT_READ_TIMEOUT_NODE,
321
- write: DEFAULT_WRITE_TIMEOUT_NODE,
322
- },
323
- requester: createHttpRequester(),
324
- algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
325
- responsesCache: createNullCache(),
326
- requestsCache: createNullCache(),
327
- hostsCache: createMemoryCache(),
328
- ...options,
329
- });
321
+ return {
322
+ ...createAbtestingClient({
323
+ appId,
324
+ apiKey,
325
+ region,
326
+ timeouts: {
327
+ connect: DEFAULT_CONNECT_TIMEOUT_NODE,
328
+ read: DEFAULT_READ_TIMEOUT_NODE,
329
+ write: DEFAULT_WRITE_TIMEOUT_NODE,
330
+ },
331
+ requester: createHttpRequester(),
332
+ algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
333
+ responsesCache: createNullCache(),
334
+ requestsCache: createNullCache(),
335
+ hostsCache: createMemoryCache(),
336
+ ...options,
337
+ }),
338
+ };
330
339
  }
331
340
 
332
341
  export { abtestingClient, apiClientVersion };
@@ -1,2 +1,2 @@
1
- /*! client-abtesting.umd.js | 5.0.0-alpha.99 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */
2
- !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)||"{}")}function o(e){s().setItem(r,JSON.stringify(e))}return{get:(t,r,s={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>(function(){const t=e.timeToLive?1e3*e.timeToLive:null,r=a(),s=Object.fromEntries(Object.entries(r).filter((([,e])=>void 0!==e.timestamp)));if(o(s),!t)return;o(Object.fromEntries(Object.entries(s).filter((([,e])=>{const r=(new Date).getTime();return!(e.timestamp+t<r)}))))}(),a()[JSON.stringify(t)]))).then((e=>Promise.all([e?e.value:r(),void 0!==e]))).then((([e,t])=>Promise.all([e,t||s.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve().then((()=>{const o=a();return o[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:t},s().setItem(r,JSON.stringify(o)),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,o={miss:()=>Promise.resolve()})=>s.get(e,a,o).catch((()=>r({caches:t}).get(e,a,o))),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 o=JSON.stringify(r);if(o in t)return Promise.resolve(e.serializable?JSON.parse(t[o]):t[o]);const n=s();return n.then((e=>a.miss(e))).then((()=>n))},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 o(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 n(e){var t=function(e,t){if("object"!=typeof e||!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)}function i(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class c extends Error{constructor(e,t){super(e),i(this,"name","AlgoliaError"),t&&(this.name=t)}}class u extends c{constructor(e,t,r){super(e,r),i(this,"stackTrace",void 0),this.stackTrace=t}}class l extends u{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, please create a ticket at https://support.algolia.com/ sharing steps we can use to reproduce the issue.",e,"RetryError")}}class d extends u{constructor(e,t,r,s="ApiError"){super(e,r,s),i(this,"status",void 0),this.status=t}}class m extends c{constructor(e,t){super(e,"DeserializationError"),i(this,"response",void 0),this.response=t}}class h extends d{constructor(e,t,r,s){super(e,t,s,"DetailedApiError"),i(this,"error",void 0),this.error=r}}function p(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 f(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 g({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:s,algoliaAgent:a,timeouts:n,requester:i,requestsCache:c,responsesCache:u}){async function g(c,u,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,u),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,u.headers),v="GET"===c.method?{...c.data,...u.data}:{},T={...s,...c.queryParameters,...v};if(a.value&&(T["x-algolia-agent"]=a.value),u&&u.queryParameters)for(const e of Object.keys(u.queryParameters))u.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(u.queryParameters[e])?T[e]=u.queryParameters[e].toString():T[e]=u.queryParameters[e];let q=0;const b=async(e,r)=>{const s=e.pop();if(void 0===s)throw new l(function(e){return e.map((e=>f(e)))}(y));let a=u.timeout;void 0===a&&(a=g?n.read:n.write);const v={data:P,headers:w,method:c.method,url:p(s,c.path,T),connectTimeout:r(q,n.connect),responseTimeout:r(q,a)},O=t=>{const r={request:v,response:t,host:s,triesLeft:e.length};return y.push(r),r},E=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)}(E)){const a=O(E);return E.isTimedOut&&q++,console.log("Retryable failure",f(a)),await t.set(s,o(s,E.isTimedOut?"timed out":"down")),b(e,r)}if(function({status:e}){return 2==~~(e/100)}(E))return function(e){try{return JSON.parse(e.content)}catch(t){throw new m(t.message,e)}}(E);throw O(E),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 d(s.message,t,r)}catch(e){}return new d(e,t,r)}(E,y)},O=e.filter((e=>"readWrite"===e.accept||(g?"read"===e.accept:"write"===e.accept))),E=await async function(e){const r=await Promise.all(e.map((e=>t.get(e,(()=>Promise.resolve(o(e))))))),s=r.filter((e=>e.isUp())),a=r.filter((e=>e.isTimedOut())),n=[...s,...a];return{hosts:n.length>0?n:e,getTimeout:(e,t)=>(0===a.length&&0===e?1:a.length+3+e)*t}}(O);return b([...E.hosts].reverse(),E.getTimeout)}return{hostsCache:t,requester:i,timeouts:n,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 o=()=>g(e,t);if(!0!==(t.cacheable||e.cacheable))return o();const n={request:e,requestOptions:t,transporter:{queryParameters:s,headers:r}};return u.get(n,(()=>c.get(n,(()=>c.set(n,o()).then((e=>Promise.all([c.delete(n),e])),(e=>Promise.all([c.delete(n),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>u.set(n,e)})},requestsCache:c,responsesCache:u}}function y({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 P="5.0.0-alpha.99",w=["de","us"];e.abtestingClient=function(e,a,o,n){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!a||"string"!=typeof a)throw new Error("`apiKey` is missing.");if(o&&("string"!=typeof o||!w.includes(o)))throw new Error(`\`region\` must be one of the following: ${w.join(", ")}`);return function({appId:e,apiKey:t,authMode:r,algoliaAgents:s,region:a,...o}){const n=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=g({hosts:(c=a,[{url:c?"analytics.{region}.algolia.com".replace("{region}",c):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]),...o,algoliaAgent:y({algoliaAgents:s,client:"Abtesting",version:P}),baseHeaders:{"content-type":"text/plain",...n.headers(),...o.baseHeaders},baseQueryParameters:{...n.queryParameters(),...o.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)},customDelete({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");const s={method:"DELETE",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(s,r)},customGet({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");const s={method:"GET",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(s,r)},customPost({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");const a={method:"POST",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return i.request(a,s)},customPut({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");const a={method:"PUT",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return i.request(a,s)},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)},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 o={};void 0!==e&&(o.offset=e.toString()),void 0!==t&&(o.limit=t.toString()),void 0!==r&&(o.indexPrefix=r.toString()),void 0!==s&&(o.indexSuffix=s.toString());const n={method:"GET",path:"/2/abtests",queryParameters:o,headers:{}};return i.request(n,a)},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:o,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 o;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===o&&(clearTimeout(a),o=s(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(a),clearTimeout(o),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(a),clearTimeout(o),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:`${P}-${e}`}),s()]}),...n})},e.apiClientVersion=P}));
1
+ /*! client-abtesting.umd.js | 5.0.0-beta.2 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */
2
+ !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)||"{}")}function o(e){s().setItem(r,JSON.stringify(e))}return{get:(t,r,s={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>(function(){const t=e.timeToLive?1e3*e.timeToLive:null,r=a(),s=Object.fromEntries(Object.entries(r).filter((([,e])=>void 0!==e.timestamp)));if(o(s),!t)return;o(Object.fromEntries(Object.entries(s).filter((([,e])=>{const r=(new Date).getTime();return!(e.timestamp+t<r)}))))}(),a()[JSON.stringify(t)]))).then((e=>Promise.all([e?e.value:r(),void 0!==e]))).then((([e,t])=>Promise.all([e,t||s.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve().then((()=>{const o=a();return o[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:t},s().setItem(r,JSON.stringify(o)),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,o={miss:()=>Promise.resolve()})=>s.get(e,a,o).catch((()=>r({caches:t}).get(e,a,o))),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 o=JSON.stringify(r);if(o in t)return Promise.resolve(e.serializable?JSON.parse(t[o]):t[o]);const n=s();return n.then((e=>a.miss(e))).then((()=>n))},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 o(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 n(e){var t=function(e,t){if("object"!=typeof e||!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:t+""}function i(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class c extends Error{constructor(e,t){super(e),i(this,"name","AlgoliaError"),t&&(this.name=t)}}class u extends c{constructor(e,t,r){super(e,r),i(this,"stackTrace",void 0),this.stackTrace=t}}class l extends u{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, please create a ticket at https://support.algolia.com/ sharing steps we can use to reproduce the issue.",e,"RetryError")}}class d extends u{constructor(e,t,r,s="ApiError"){super(e,r,s),i(this,"status",void 0),this.status=t}}class m extends c{constructor(e,t){super(e,"DeserializationError"),i(this,"response",void 0),this.response=t}}class h extends d{constructor(e,t,r,s){super(e,t,s,"DetailedApiError"),i(this,"error",void 0),this.error=r}}function p(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]).replaceAll("+","%20")}`)).join("&")}(r);let a=`${e.protocol}://${e.url}${e.port?`:${e.port}`:""}/${"/"===t.charAt(0)?t.substring(1):t}`;return s.length&&(a+=`?${s}`),a}function f(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 g({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:s,algoliaAgent:a,timeouts:n,requester:i,requestsCache:c,responsesCache:u}){async function g(c,u,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,u),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,u.headers),v="GET"===c.method?{...c.data,...u.data}:{},T={...s,...c.queryParameters,...v};if(a.value&&(T["x-algolia-agent"]=a.value),u&&u.queryParameters)for(const e of Object.keys(u.queryParameters))u.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(u.queryParameters[e])?T[e]=u.queryParameters[e].toString():T[e]=u.queryParameters[e];let q=0;const b=async(e,r)=>{const s=e.pop();if(void 0===s)throw new l(function(e){return e.map((e=>f(e)))}(y));let a=g?u.timeouts?.read||n.read:u.timeouts?.write||n.write;const v={data:P,headers:w,method:c.method,url:p(s,c.path,T),connectTimeout:r(q,u.timeouts?.connect||n.connect),responseTimeout:r(q,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&&!~~t}({isTimedOut:e,status:t})||2!=~~(t/100)&&4!=~~(t/100)}(A)){const a=O(A);return A.isTimedOut&&q++,console.log("Retryable failure",f(a)),await t.set(s,o(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 m(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 d(s.message,t,r)}catch(e){}return new d(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(o(e))))))),s=r.filter((e=>e.isUp())),a=r.filter((e=>e.isTimedOut())),n=[...s,...a];return{hosts:n.length>0?n: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:n,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 o=()=>g(e,t);if(!0!==(t.cacheable||e.cacheable))return o();const n={request:e,requestOptions:t,transporter:{queryParameters:s,headers:r}};return u.get(n,(()=>c.get(n,(()=>c.set(n,o()).then((e=>Promise.all([c.delete(n),e])),(e=>Promise.all([c.delete(n),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>u.set(n,e)})},requestsCache:c,responsesCache:u}}function y({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 P="5.0.0-beta.2",w=["de","us"];e.abtestingClient=function(e,a,o,n){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!a||"string"!=typeof a)throw new Error("`apiKey` is missing.");if(o&&("string"!=typeof o||!w.includes(o)))throw new Error(`\`region\` must be one of the following: ${w.join(", ")}`);return function({appId:e,apiKey:t,authMode:r,algoliaAgents:s,region:a,...o}){const n=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=g({hosts:(c=a,[{url:c?"analytics.{region}.algolia.com".replace("{region}",c):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]),...o,algoliaAgent:y({algoliaAgents:s,client:"Abtesting",version:P}),baseHeaders:{"content-type":"text/plain",...n.headers(),...o.baseHeaders},baseQueryParameters:{...n.queryParameters(),...o.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)},customDelete({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");const s={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(s,r)},customGet({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");const s={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(s,r)},customPost({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");const a={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return i.request(a,s)},customPut({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");const a={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return i.request(a,s)},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)},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 o={};void 0!==e&&(o.offset=e.toString()),void 0!==t&&(o.limit=t.toString()),void 0!==r&&(o.indexPrefix=r.toString()),void 0!==s&&(o.indexSuffix=s.toString());const n={method:"GET",path:"/2/abtests",queryParameters:o,headers:{}};return i.request(n,a)},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:o,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 o;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===o&&(clearTimeout(a),o=s(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(a),clearTimeout(o),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(a),clearTimeout(o),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:`${P}-${e}`}),s()]}),...n})},e.apiClientVersion=P}));
@@ -1,52 +1,37 @@
1
+ import type { ABTestConfiguration } from './aBTestConfiguration';
2
+ import type { Status } from './status';
1
3
  import type { Variant } from './variant';
2
4
  export type ABTest = {
3
5
  /**
4
- * Unique A/B test ID.
6
+ * Unique A/B test identifier.
5
7
  */
6
8
  abTestID: number;
9
+ clickSignificance: number | null;
10
+ conversionSignificance: number | null;
11
+ addToCartSignificance: number | null;
12
+ purchaseSignificance: number | null;
13
+ revenueSignificance: Record<string, number> | null;
7
14
  /**
8
- * [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_.
9
- */
10
- clickSignificance: number;
11
- /**
12
- * [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 conversion. A value of 0.95 or over is considered to be _significant_.
13
- */
14
- conversionSignificance: number;
15
- /**
16
- * [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 add-to-cart data. A value of 0.95 or over is considered to be _significant_.
17
- */
18
- addToCartSignificance: number;
19
- /**
20
- * [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 purchase data. A value of 0.95 or over is considered to be _significant_.
21
- */
22
- purchaseSignificance: number;
23
- /**
24
- * [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 revenue data. A value of 0.95 or over is considered to be _significant_.
25
- */
26
- revenueSignificance: Record<string, number>;
27
- /**
28
- * Update date timestamp in [ISO-8601](https://wikipedia.org/wiki/ISO_8601) format.
15
+ * Date and time when the A/B test was last updated, in RFC 3339 format.
29
16
  */
30
17
  updatedAt: string;
31
18
  /**
32
- * Creation date timestamp in [ISO-8601](https://wikipedia.org/wiki/ISO_8601) format.
19
+ * Date and time when the A/B test was created, in RFC 3339 format.
33
20
  */
34
21
  createdAt: string;
35
22
  /**
36
- * End date timestamp in [ISO-8601](https://wikipedia.org/wiki/ISO_8601) format.
23
+ * End date and time of the A/B test, in RFC 3339 format.
37
24
  */
38
25
  endAt: string;
39
26
  /**
40
27
  * A/B test name.
41
28
  */
42
29
  name: string;
30
+ status: Status;
43
31
  /**
44
- * A/B test status.
45
- */
46
- status: string;
47
- /**
48
- * A/B test variants.
32
+ * A/B test variants. The first variant is your _control_ index, typically your production index. The second variant is an index with changed settings that you want to test against the control.
49
33
  */
50
34
  variants: Variant[];
35
+ configuration?: ABTestConfiguration;
51
36
  };
52
37
  //# sourceMappingURL=aBTest.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"aBTest.d.ts","sourceRoot":"","sources":["../../model/aBTest.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,MAAM,MAAM,GAAG;IACnB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,sBAAsB,EAAE,MAAM,CAAC;IAE/B;;OAEG;IACH,qBAAqB,EAAE,MAAM,CAAC;IAE9B;;OAEG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE5C;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB,CAAC"}
1
+ {"version":3,"file":"aBTest.d.ts","sourceRoot":"","sources":["../../model/aBTest.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,MAAM,MAAM,GAAG;IACnB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAEjC,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtC,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IAErC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpC,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IAEnD;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,QAAQ,EAAE,OAAO,EAAE,CAAC;IAEpB,aAAa,CAAC,EAAE,mBAAmB,CAAC;CACrC,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { EmptySearch } from './emptySearch';
2
+ import type { MinimumDetectableEffect } from './minimumDetectableEffect';
3
+ import type { Outliers } from './outliers';
4
+ /**
5
+ * A/B test configuration.
6
+ */
7
+ export type ABTestConfiguration = {
8
+ outliers: Outliers;
9
+ emptySearch?: EmptySearch;
10
+ minimumDetectableEffect?: MinimumDetectableEffect;
11
+ };
12
+ //# sourceMappingURL=aBTestConfiguration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aBTestConfiguration.d.ts","sourceRoot":"","sources":["../../model/aBTestConfiguration.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,QAAQ,CAAC;IAEnB,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;CACnD,CAAC"}
@@ -1,14 +1,14 @@
1
1
  export type ABTestResponse = {
2
2
  /**
3
- * A/B test index.
3
+ * Index name of the A/B test variant (case-sensitive).
4
4
  */
5
5
  index: string;
6
6
  /**
7
- * Unique A/B test ID.
7
+ * Unique A/B test identifier.
8
8
  */
9
9
  abTestID: number;
10
10
  /**
11
- * 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`.
11
+ * 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](#tag/Indices/operation/getTask) and this `taskID`.
12
12
  */
13
13
  taskID: number;
14
14
  };
@@ -1,14 +1,14 @@
1
1
  export type AbTestsVariant = {
2
2
  /**
3
- * A/B test index.
3
+ * Index name of the A/B test variant (case-sensitive).
4
4
  */
5
5
  index: string;
6
6
  /**
7
- * A/B test traffic percentage.
7
+ * Percentage of search requests each variant receives.
8
8
  */
9
9
  trafficPercentage: number;
10
10
  /**
11
- * A/B test description.
11
+ * Description for this variant.
12
12
  */
13
13
  description?: string;
14
14
  };
@@ -9,7 +9,7 @@ export type AddABTestsRequest = {
9
9
  */
10
10
  variants: AddABTestsVariant[];
11
11
  /**
12
- * End date timestamp in [ISO-8601](https://wikipedia.org/wiki/ISO_8601) format.
12
+ * End date and time of the A/B test, in RFC 3339 format.
13
13
  */
14
14
  endAt: string;
15
15
  };
@@ -63,7 +63,7 @@ export type CustomPutProps = {
63
63
  */
64
64
  export type DeleteABTestProps = {
65
65
  /**
66
- * Unique A/B test ID.
66
+ * Unique A/B test identifier.
67
67
  */
68
68
  id: number;
69
69
  };
@@ -72,7 +72,7 @@ export type DeleteABTestProps = {
72
72
  */
73
73
  export type GetABTestProps = {
74
74
  /**
75
- * Unique A/B test ID.
75
+ * Unique A/B test identifier.
76
76
  */
77
77
  id: number;
78
78
  };
@@ -81,19 +81,19 @@ export type GetABTestProps = {
81
81
  */
82
82
  export type ListABTestsProps = {
83
83
  /**
84
- * Position of the starting record. Used for paging. 0 is the first record.
84
+ * Position of the first item to return.
85
85
  */
86
86
  offset?: number;
87
87
  /**
88
- * Number of records to return (page size).
88
+ * Number of items to return.
89
89
  */
90
90
  limit?: number;
91
91
  /**
92
- * Only return A/B tests for indices starting with this prefix.
92
+ * Index name prefix. Only A/B tests for indices starting with this string are included in the response.
93
93
  */
94
94
  indexPrefix?: string;
95
95
  /**
96
- * Only return A/B tests for indices ending with this suffix.
96
+ * Index name suffix. Only A/B tests for indices ending with this string are included in the response.
97
97
  */
98
98
  indexSuffix?: string;
99
99
  };
@@ -102,7 +102,7 @@ export type ListABTestsProps = {
102
102
  */
103
103
  export type StopABTestProps = {
104
104
  /**
105
- * Unique A/B test ID.
105
+ * Unique A/B test identifier.
106
106
  */
107
107
  id: number;
108
108
  };
@@ -1,4 +1,4 @@
1
- export type CurrenciesValue = {
1
+ export type Currency = {
2
2
  /**
3
3
  * Currency code.
4
4
  */
@@ -16,4 +16,4 @@ export type CurrenciesValue = {
16
16
  */
17
17
  standardDeviation?: number;
18
18
  };
19
- //# sourceMappingURL=currenciesValue.d.ts.map
19
+ //# sourceMappingURL=currency.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"currency.d.ts","sourceRoot":"","sources":["../../model/currency.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,QAAQ,GAAG;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 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.
2
+ * Search parameters to add to the test variant. Only use this parameter if the two variants use the same index.
3
3
  */
4
4
  export type CustomSearchParams = {
5
5
  customSearchParameters: Record<string, any>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Metric for which you want to detect the smallest relative difference.
3
+ */
4
+ export type Effect = 'addToCartRate' | 'clickThroughRate' | 'conversionRate' | 'purchaseRate';
5
+ //# sourceMappingURL=effect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"effect.d.ts","sourceRoot":"","sources":["../../model/effect.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,MAAM,GACd,eAAe,GACf,kBAAkB,GAClB,gBAAgB,GAChB,cAAc,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Configuration for handling empty searches.
3
+ */
4
+ export type EmptySearch = {
5
+ /**
6
+ * Whether to exclude empty searches when calculating A/B test results.
7
+ */
8
+ exclude?: boolean;
9
+ };
10
+ //# sourceMappingURL=emptySearch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emptySearch.d.ts","sourceRoot":"","sources":["../../model/emptySearch.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC"}
@@ -1,16 +1,22 @@
1
1
  export * from './aBTest';
2
+ export * from './aBTestConfiguration';
2
3
  export * from './aBTestResponse';
3
4
  export * from './abTestsVariant';
4
5
  export * from './abTestsVariantSearchParams';
5
6
  export * from './addABTestsRequest';
6
7
  export * from './addABTestsVariant';
7
- export * from './currenciesValue';
8
+ export * from './currency';
8
9
  export * from './customSearchParams';
10
+ export * from './effect';
11
+ export * from './emptySearch';
9
12
  export * from './errorBase';
10
13
  export * from './filterEffects';
11
14
  export * from './filterEffectsEmptySearch';
12
15
  export * from './filterEffectsOutliers';
13
16
  export * from './listABTestsResponse';
17
+ export * from './minimumDetectableEffect';
18
+ export * from './outliers';
19
+ export * from './status';
14
20
  export * from './variant';
15
21
  export * from './clientMethodProps';
16
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../model/index.ts"],"names":[],"mappings":"AAEA,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../model/index.ts"],"names":[],"mappings":"AAEA,cAAc,UAAU,CAAC;AACzB,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC"}
@@ -3,9 +3,9 @@ export type ListABTestsResponse = {
3
3
  /**
4
4
  * A/B tests.
5
5
  */
6
- abtests: ABTest[];
6
+ abtests: ABTest[] | null;
7
7
  /**
8
- * Number of A/B tests implemented.
8
+ * Number of A/B tests.
9
9
  */
10
10
  count: number;
11
11
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"listABTestsResponse.d.ts","sourceRoot":"","sources":["../../model/listABTestsResponse.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;IAElB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
1
+ {"version":3,"file":"listABTestsResponse.d.ts","sourceRoot":"","sources":["../../model/listABTestsResponse.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAEzB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { Effect } from './effect';
2
+ /**
3
+ * Configuration for the smallest difference between test variants you want to detect.
4
+ */
5
+ export type MinimumDetectableEffect = {
6
+ /**
7
+ * Smallest difference in an observable metric between variants. For example, to detect a 10% difference between variants, set this value to 0.1.
8
+ */
9
+ size?: number;
10
+ effect?: Effect;
11
+ };
12
+ //# sourceMappingURL=minimumDetectableEffect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"minimumDetectableEffect.d.ts","sourceRoot":"","sources":["../../model/minimumDetectableEffect.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Configuration for handling outliers.
3
+ */
4
+ export type Outliers = {
5
+ /**
6
+ * Whether to exclude outliers when calculating A/B test results.
7
+ */
8
+ exclude?: boolean;
9
+ };
10
+ //# sourceMappingURL=outliers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outliers.d.ts","sourceRoot":"","sources":["../../model/outliers.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * A/B test status. - `active`. The A/B test is live and search traffic is split between the two variants. - `stopped`. You stopped the A/B test. The A/B test data is still available for analysis. - `expired`. The A/B test was automatically stopped after reaching its end date. - `failed`. Creating the A/B test failed.
3
+ */
4
+ export type Status = 'active' | 'expired' | 'failed' | 'stopped';
5
+ //# sourceMappingURL=status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../model/status.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC"}