@algolia/client-abtesting 5.0.0-alpha.110 → 5.0.0-alpha.112

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 (44) hide show
  1. package/dist/client-abtesting.cjs +11 -11
  2. package/dist/client-abtesting.esm.browser.js +13 -16
  3. package/dist/client-abtesting.esm.node.js +11 -11
  4. package/dist/client-abtesting.umd.js +2 -2
  5. package/dist/model/aBTest.d.ts +9 -24
  6. package/dist/model/aBTest.d.ts.map +1 -1
  7. package/dist/model/aBTestConfiguration.d.ts +12 -0
  8. package/dist/model/aBTestConfiguration.d.ts.map +1 -0
  9. package/dist/model/aBTestResponse.d.ts +2 -2
  10. package/dist/model/abTestsVariant.d.ts +3 -3
  11. package/dist/model/addABTestsRequest.d.ts +1 -1
  12. package/dist/model/clientMethodProps.d.ts +5 -5
  13. package/dist/model/customSearchParams.d.ts +1 -1
  14. package/dist/model/effect.d.ts +5 -0
  15. package/dist/model/effect.d.ts.map +1 -0
  16. package/dist/model/emptySearch.d.ts +10 -0
  17. package/dist/model/emptySearch.d.ts.map +1 -0
  18. package/dist/model/index.d.ts +6 -0
  19. package/dist/model/index.d.ts.map +1 -1
  20. package/dist/model/listABTestsResponse.d.ts +1 -1
  21. package/dist/model/minimumDetectableEffect.d.ts +12 -0
  22. package/dist/model/minimumDetectableEffect.d.ts.map +1 -0
  23. package/dist/model/outliers.d.ts +10 -0
  24. package/dist/model/outliers.d.ts.map +1 -0
  25. package/dist/model/status.d.ts +5 -0
  26. package/dist/model/status.d.ts.map +1 -0
  27. package/dist/model/variant.d.ts +13 -13
  28. package/dist/src/abtestingClient.d.ts +11 -11
  29. package/model/aBTest.ts +10 -24
  30. package/model/aBTestConfiguration.ts +16 -0
  31. package/model/aBTestResponse.ts +2 -2
  32. package/model/abTestsVariant.ts +3 -3
  33. package/model/addABTestsRequest.ts +1 -1
  34. package/model/clientMethodProps.ts +5 -5
  35. package/model/customSearchParams.ts +1 -1
  36. package/model/effect.ts +10 -0
  37. package/model/emptySearch.ts +11 -0
  38. package/model/index.ts +6 -0
  39. package/model/listABTestsResponse.ts +1 -1
  40. package/model/minimumDetectableEffect.ts +15 -0
  41. package/model/outliers.ts +11 -0
  42. package/model/status.ts +6 -0
  43. package/model/variant.ts +13 -13
  44. package/package.json +7 -7
@@ -4,7 +4,7 @@ var clientCommon = require('@algolia/client-common');
4
4
  var requesterNodeHttp = require('@algolia/requester-node-http');
5
5
 
6
6
  // 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.
7
- const apiClientVersion = '5.0.0-alpha.110';
7
+ const apiClientVersion = '5.0.0-alpha.112';
8
8
  const REGIONS = ['de', 'us'];
9
9
  function getDefaultHosts(region) {
10
10
  const url = !region
@@ -64,7 +64,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
64
64
  transporter.algoliaAgent.add({ segment, version });
65
65
  },
66
66
  /**
67
- * Creates an A/B test.
67
+ * Creates a new A/B test.
68
68
  *
69
69
  * Required API Key ACLs:
70
70
  * - editSettings.
@@ -194,13 +194,13 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
194
194
  return transporter.request(request, requestOptions);
195
195
  },
196
196
  /**
197
- * Delete an A/B test. To determine the `id` for an A/B test, use the [`listABTests` operation](#tag/abtest/operation/listABTests).
197
+ * Deletes an A/B test by its ID.
198
198
  *
199
199
  * Required API Key ACLs:
200
200
  * - editSettings.
201
201
  *
202
202
  * @param deleteABTest - The deleteABTest object.
203
- * @param deleteABTest.id - Unique A/B test ID.
203
+ * @param deleteABTest.id - Unique A/B test identifier.
204
204
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
205
205
  */
206
206
  deleteABTest({ id }, requestOptions) {
@@ -219,13 +219,13 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
219
219
  return transporter.request(request, requestOptions);
220
220
  },
221
221
  /**
222
- * 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).
222
+ * Retrieves the details for an A/B test by its ID.
223
223
  *
224
224
  * Required API Key ACLs:
225
225
  * - analytics.
226
226
  *
227
227
  * @param getABTest - The getABTest object.
228
- * @param getABTest.id - Unique A/B test ID.
228
+ * @param getABTest.id - Unique A/B test identifier.
229
229
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
230
230
  */
231
231
  getABTest({ id }, requestOptions) {
@@ -244,7 +244,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
244
244
  return transporter.request(request, requestOptions);
245
245
  },
246
246
  /**
247
- * List all A/B tests.
247
+ * Lists all A/B tests you configured for this application.
248
248
  *
249
249
  * Required API Key ACLs:
250
250
  * - analytics.
@@ -252,8 +252,8 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
252
252
  * @param listABTests - The listABTests object.
253
253
  * @param listABTests.offset - Position of the first item to return.
254
254
  * @param listABTests.limit - Number of items to return.
255
- * @param listABTests.indexPrefix - Only return A/B tests for indices starting with this prefix.
256
- * @param listABTests.indexSuffix - Only return A/B tests for indices ending with this suffix.
255
+ * @param listABTests.indexPrefix - Index name prefix. Only A/B tests for indices starting with this string are included in the response.
256
+ * @param listABTests.indexSuffix - Index name suffix. Only A/B tests for indices ending with this string are included in the response.
257
257
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
258
258
  */
259
259
  listABTests({ offset, limit, indexPrefix, indexSuffix } = {}, requestOptions = undefined) {
@@ -281,13 +281,13 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
281
281
  return transporter.request(request, requestOptions);
282
282
  },
283
283
  /**
284
- * 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).
284
+ * Stops an A/B test by its ID. You can\'t restart stopped A/B tests.
285
285
  *
286
286
  * Required API Key ACLs:
287
287
  * - editSettings.
288
288
  *
289
289
  * @param stopABTest - The stopABTest object.
290
- * @param stopABTest.id - Unique A/B test ID.
290
+ * @param stopABTest.id - Unique A/B test identifier.
291
291
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
292
292
  */
293
293
  stopABTest({ id }, requestOptions) {
@@ -449,16 +449,13 @@ function createTransporter({
449
449
  if (host === undefined) {
450
450
  throw new RetryError(stackTraceWithoutCredentials(stackTrace));
451
451
  }
452
- let responseTimeout = requestOptions.timeout;
453
- if (responseTimeout === undefined) {
454
- responseTimeout = isRead ? timeouts.read : timeouts.write;
455
- }
452
+ let responseTimeout = isRead ? requestOptions.timeouts?.read || timeouts.read : requestOptions.timeouts?.write || timeouts.write;
456
453
  const payload = {
457
454
  data,
458
455
  headers,
459
456
  method: request.method,
460
457
  url: serializeUrl(host, request.path, queryParameters),
461
- connectTimeout: getTimeout(timeoutsCount, timeouts.connect),
458
+ connectTimeout: getTimeout(timeoutsCount, requestOptions.timeouts?.connect || timeouts.connect),
462
459
  responseTimeout: getTimeout(timeoutsCount, responseTimeout)
463
460
  };
464
461
  /**
@@ -686,7 +683,7 @@ function createXhrRequester() {
686
683
  }
687
684
 
688
685
  // 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.
689
- const apiClientVersion = '5.0.0-alpha.110';
686
+ const apiClientVersion = '5.0.0-alpha.112';
690
687
  const REGIONS = ['de', 'us'];
691
688
  function getDefaultHosts(region) {
692
689
  const url = !region
@@ -746,7 +743,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
746
743
  transporter.algoliaAgent.add({ segment, version });
747
744
  },
748
745
  /**
749
- * Creates an A/B test.
746
+ * Creates a new A/B test.
750
747
  *
751
748
  * Required API Key ACLs:
752
749
  * - editSettings.
@@ -876,13 +873,13 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
876
873
  return transporter.request(request, requestOptions);
877
874
  },
878
875
  /**
879
- * Delete an A/B test. To determine the `id` for an A/B test, use the [`listABTests` operation](#tag/abtest/operation/listABTests).
876
+ * Deletes an A/B test by its ID.
880
877
  *
881
878
  * Required API Key ACLs:
882
879
  * - editSettings.
883
880
  *
884
881
  * @param deleteABTest - The deleteABTest object.
885
- * @param deleteABTest.id - Unique A/B test ID.
882
+ * @param deleteABTest.id - Unique A/B test identifier.
886
883
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
887
884
  */
888
885
  deleteABTest({ id }, requestOptions) {
@@ -901,13 +898,13 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
901
898
  return transporter.request(request, requestOptions);
902
899
  },
903
900
  /**
904
- * 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).
901
+ * Retrieves the details for an A/B test by its ID.
905
902
  *
906
903
  * Required API Key ACLs:
907
904
  * - analytics.
908
905
  *
909
906
  * @param getABTest - The getABTest object.
910
- * @param getABTest.id - Unique A/B test ID.
907
+ * @param getABTest.id - Unique A/B test identifier.
911
908
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
912
909
  */
913
910
  getABTest({ id }, requestOptions) {
@@ -926,7 +923,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
926
923
  return transporter.request(request, requestOptions);
927
924
  },
928
925
  /**
929
- * List all A/B tests.
926
+ * Lists all A/B tests you configured for this application.
930
927
  *
931
928
  * Required API Key ACLs:
932
929
  * - analytics.
@@ -934,8 +931,8 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
934
931
  * @param listABTests - The listABTests object.
935
932
  * @param listABTests.offset - Position of the first item to return.
936
933
  * @param listABTests.limit - Number of items to return.
937
- * @param listABTests.indexPrefix - Only return A/B tests for indices starting with this prefix.
938
- * @param listABTests.indexSuffix - Only return A/B tests for indices ending with this suffix.
934
+ * @param listABTests.indexPrefix - Index name prefix. Only A/B tests for indices starting with this string are included in the response.
935
+ * @param listABTests.indexSuffix - Index name suffix. Only A/B tests for indices ending with this string are included in the response.
939
936
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
940
937
  */
941
938
  listABTests({ offset, limit, indexPrefix, indexSuffix } = {}, requestOptions = undefined) {
@@ -963,13 +960,13 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
963
960
  return transporter.request(request, requestOptions);
964
961
  },
965
962
  /**
966
- * 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).
963
+ * Stops an A/B test by its ID. You can\'t restart stopped A/B tests.
967
964
  *
968
965
  * Required API Key ACLs:
969
966
  * - editSettings.
970
967
  *
971
968
  * @param stopABTest - The stopABTest object.
972
- * @param stopABTest.id - Unique A/B test ID.
969
+ * @param stopABTest.id - Unique A/B test identifier.
973
970
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
974
971
  */
975
972
  stopABTest({ id }, requestOptions) {
@@ -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.110';
5
+ const apiClientVersion = '5.0.0-alpha.112';
6
6
  const REGIONS = ['de', 'us'];
7
7
  function getDefaultHosts(region) {
8
8
  const url = !region
@@ -62,7 +62,7 @@ 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
66
  *
67
67
  * Required API Key ACLs:
68
68
  * - editSettings.
@@ -192,13 +192,13 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
192
192
  return transporter.request(request, requestOptions);
193
193
  },
194
194
  /**
195
- * 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
196
  *
197
197
  * Required API Key ACLs:
198
198
  * - editSettings.
199
199
  *
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,13 +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
221
  *
222
222
  * Required API Key ACLs:
223
223
  * - analytics.
224
224
  *
225
225
  * @param getABTest - The getABTest object.
226
- * @param getABTest.id - Unique A/B test ID.
226
+ * @param getABTest.id - Unique A/B test identifier.
227
227
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
228
228
  */
229
229
  getABTest({ id }, requestOptions) {
@@ -242,7 +242,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
242
242
  return transporter.request(request, requestOptions);
243
243
  },
244
244
  /**
245
- * List all A/B tests.
245
+ * Lists all A/B tests you configured for this application.
246
246
  *
247
247
  * Required API Key ACLs:
248
248
  * - analytics.
@@ -250,8 +250,8 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
250
250
  * @param listABTests - The listABTests object.
251
251
  * @param listABTests.offset - Position of the first item to return.
252
252
  * @param listABTests.limit - Number of items to return.
253
- * @param listABTests.indexPrefix - Only return A/B tests for indices starting with this prefix.
254
- * @param listABTests.indexSuffix - Only return A/B tests for indices ending with this suffix.
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.
255
255
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
256
256
  */
257
257
  listABTests({ offset, limit, indexPrefix, indexSuffix } = {}, requestOptions = undefined) {
@@ -279,13 +279,13 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
279
279
  return transporter.request(request, requestOptions);
280
280
  },
281
281
  /**
282
- * 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
283
  *
284
284
  * Required API Key ACLs:
285
285
  * - editSettings.
286
286
  *
287
287
  * @param stopABTest - The stopABTest object.
288
- * @param stopABTest.id - Unique A/B test ID.
288
+ * @param stopABTest.id - Unique A/B test identifier.
289
289
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
290
290
  */
291
291
  stopABTest({ id }, requestOptions) {
@@ -1,2 +1,2 @@
1
- /*! client-abtesting.umd.js | 5.0.0-alpha.110 | © 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=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},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-alpha.110",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
+ /*! client-abtesting.umd.js | 5.0.0-alpha.112 | © 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-alpha.112",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;
7
- /**
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
9
  clickSignificance: number | null;
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
10
  conversionSignificance: number | null;
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
11
  addToCartSignificance: number | null;
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
12
  purchaseSignificance: number | null;
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
13
  revenueSignificance: Record<string, number> | null;
27
14
  /**
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,GAAG,IAAI,CAAC;IAEjC;;OAEG;IACH,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtC;;OAEG;IACH,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IAErC;;OAEG;IACH,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpC;;OAEG;IACH,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;;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,10 +1,10 @@
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
  /**
@@ -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
  };
@@ -89,11 +89,11 @@ export type ListABTestsProps = {
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,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,4 +1,5 @@
1
1
  export * from './aBTest';
2
+ export * from './aBTestConfiguration';
2
3
  export * from './aBTestResponse';
3
4
  export * from './abTestsVariant';
4
5
  export * from './abTestsVariantSearchParams';
@@ -6,11 +7,16 @@ export * from './addABTestsRequest';
6
7
  export * from './addABTestsVariant';
7
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,YAAY,CAAC;AAC3B,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"}
@@ -5,7 +5,7 @@ export type ListABTestsResponse = {
5
5
  */
6
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
  /**
@@ -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