@algolia/client-abtesting 5.1.1 → 5.2.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.
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  <a href="https://npmjs.org/package/@algolia/client-abtesting"><img src="https://img.shields.io/npm/v/@algolia/client-abtesting.svg?style=flat-square" alt="NPM version"></img></a>
10
10
  <a href="http://npm-stat.com/charts.html?package=@algolia/client-abtesting"><img src="https://img.shields.io/npm/dm/@algolia/client-abtesting.svg?style=flat-square" alt="NPM downloads"></a>
11
11
  <a href="https://www.jsdelivr.com/package/npm/@algolia/client-abtesting"><img src="https://data.jsdelivr.com/v1/package/npm/@algolia/client-abtesting/badge" alt="jsDelivr Downloads"></img></a>
12
- <a href="LICENSE.md"><img src="https://img.shields.io/badge/license-MIT-green.svg?style=flat-square" alt="License"></a>
12
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg?style=flat-square" alt="License"></a>
13
13
  </p>
14
14
  </p>
15
15
 
@@ -13,10 +13,10 @@ export declare function abtestingClient(appId: string, apiKey: string, region?:
13
13
  readonly _ua: string;
14
14
  addAlgoliaAgent(segment: string, version?: string): void;
15
15
  addABTests(addABTestsRequest: import("../model").AddABTestsRequest, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").ABTestResponse>;
16
- customDelete({ path, parameters }: import("../model").CustomDeleteProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
17
- customGet({ path, parameters }: import("../model").CustomGetProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
18
- customPost({ path, parameters, body }: import("../model").CustomPostProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
19
- customPut({ path, parameters, body }: import("../model").CustomPutProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
16
+ customDelete({ path, parameters }: import("../model").CustomDeleteProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, unknown>>;
17
+ customGet({ path, parameters }: import("../model").CustomGetProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, unknown>>;
18
+ customPost({ path, parameters, body }: import("../model").CustomPostProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, unknown>>;
19
+ customPut({ path, parameters, body }: import("../model").CustomPutProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, unknown>>;
20
20
  deleteABTest({ id }: import("../model").DeleteABTestProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").ABTestResponse>;
21
21
  getABTest({ id }: import("../model").GetABTestProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").ABTest>;
22
22
  listABTests({ offset, limit, indexPrefix, indexSuffix }?: import("../model").ListABTestsProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("../model").ListABTestsResponse>;
@@ -1 +1 @@
1
- {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../builds/browser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAW5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAOrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAClE,cAAc,UAAU,CAAC;AAEzB;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAGjE,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,aAAa;;;;;;;;;;;;;;;;EAsCxB"}
1
+ {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../builds/browser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAW5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAClE,cAAc,UAAU,CAAC;AAEzB;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAGjE,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa;;;;;;;;;;;;;;;;EAgCtG"}
@@ -13,10 +13,10 @@ export declare function abtestingClient(appId: string, apiKey: string, region?:
13
13
  _ua: string;
14
14
  addAlgoliaAgent(segment: string, version?: string): void;
15
15
  addABTests(addABTestsRequest: import("../model").AddABTestsRequest, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").ABTestResponse>;
16
- customDelete({ path, parameters }: import("../model").CustomDeleteProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
17
- customGet({ path, parameters }: import("../model").CustomGetProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
18
- customPost({ path, parameters, body }: import("../model").CustomPostProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
19
- customPut({ path, parameters, body }: import("../model").CustomPutProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
16
+ customDelete({ path, parameters }: import("../model").CustomDeleteProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, unknown>>;
17
+ customGet({ path, parameters }: import("../model").CustomGetProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, unknown>>;
18
+ customPost({ path, parameters, body }: import("../model").CustomPostProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, unknown>>;
19
+ customPut({ path, parameters, body }: import("../model").CustomPutProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, unknown>>;
20
20
  deleteABTest({ id }: import("../model").DeleteABTestProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").ABTestResponse>;
21
21
  getABTest({ id }: import("../model").GetABTestProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").ABTest>;
22
22
  listABTests({ offset, limit, indexPrefix, indexSuffix }?: import("../model").ListABTestsProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("../model").ListABTestsResponse>;
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../builds/node.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAU5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAClE,cAAc,UAAU,CAAC;AAEzB;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAGjE,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,aAAa;;;;;;;;;;;;;;;;EAkCxB"}
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../builds/node.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAU5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAClE,cAAc,UAAU,CAAC;AAEzB;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAGjE,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa;;;;;;;;;;;;;;;;EA+BtG"}
@@ -4,12 +4,10 @@ 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.1.1';
7
+ const apiClientVersion = '5.2.2';
8
8
  const REGIONS = ['de', 'us'];
9
9
  function getDefaultHosts(region) {
10
- const url = !region
11
- ? 'analytics.algolia.com'
12
- : 'analytics.{region}.algolia.com'.replace('{region}', region);
10
+ const url = !region ? 'analytics.algolia.com' : 'analytics.{region}.algolia.com'.replace('{region}', region);
13
11
  return [{ url, accept: 'readWrite', protocol: 'https' }];
14
12
  }
15
13
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
@@ -43,10 +41,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
43
41
  * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
44
42
  */
45
43
  clearCache() {
46
- return Promise.all([
47
- transporter.requestsCache.clear(),
48
- transporter.responsesCache.clear(),
49
- ]).then(() => undefined);
44
+ return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);
50
45
  },
51
46
  /**
52
47
  * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
@@ -314,7 +314,7 @@ function deserializeFailure({
314
314
  return new DetailedApiError(parsed.message, status, parsed.error, stackFrame);
315
315
  }
316
316
  return new ApiError(parsed.message, status, stackFrame);
317
- } catch (e) {
317
+ } catch {
318
318
  // ..
319
319
  }
320
320
  return new ApiError(content, status, stackFrame);
@@ -442,14 +442,17 @@ function createTransporter({
442
442
  if (host === undefined) {
443
443
  throw new RetryError(stackTraceWithoutCredentials(stackTrace));
444
444
  }
445
- let responseTimeout = isRead ? requestOptions.timeouts?.read || timeouts.read : requestOptions.timeouts?.write || timeouts.write;
445
+ const timeout = {
446
+ ...timeouts,
447
+ ...requestOptions.timeouts
448
+ };
446
449
  const payload = {
447
450
  data,
448
451
  headers,
449
452
  method: request.method,
450
453
  url: serializeUrl(host, request.path, queryParameters),
451
- connectTimeout: getTimeout(timeoutsCount, requestOptions.timeouts?.connect || timeouts.connect),
452
- responseTimeout: getTimeout(timeoutsCount, responseTimeout)
454
+ connectTimeout: getTimeout(timeoutsCount, timeout.connect),
455
+ responseTimeout: getTimeout(timeoutsCount, isRead ? timeout.read : timeout.write)
453
456
  };
454
457
  /**
455
458
  * The stackFrame is pushed to the stackTrace so we
@@ -642,8 +645,7 @@ function createXhrRequester() {
642
645
  const connectTimeout = createTimeout(request.connectTimeout, 'Connection timeout');
643
646
  let responseTimeout;
644
647
  baseRequester.onreadystatechange = () => {
645
- if (baseRequester.readyState > baseRequester.OPENED &&
646
- responseTimeout === undefined) {
648
+ if (baseRequester.readyState > baseRequester.OPENED && responseTimeout === undefined) {
647
649
  clearTimeout(connectTimeout);
648
650
  responseTimeout = createTimeout(request.responseTimeout, 'Socket timeout');
649
651
  }
@@ -676,12 +678,10 @@ function createXhrRequester() {
676
678
  }
677
679
 
678
680
  // 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.
679
- const apiClientVersion = '5.1.1';
681
+ const apiClientVersion = '5.2.2';
680
682
  const REGIONS = ['de', 'us'];
681
683
  function getDefaultHosts(region) {
682
- const url = !region
683
- ? 'analytics.algolia.com'
684
- : 'analytics.{region}.algolia.com'.replace('{region}', region);
684
+ const url = !region ? 'analytics.algolia.com' : 'analytics.{region}.algolia.com'.replace('{region}', region);
685
685
  return [{ url, accept: 'readWrite', protocol: 'https' }];
686
686
  }
687
687
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
@@ -715,10 +715,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
715
715
  * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
716
716
  */
717
717
  clearCache() {
718
- return Promise.all([
719
- transporter.requestsCache.clear(),
720
- transporter.responsesCache.clear(),
721
- ]).then(() => undefined);
718
+ return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);
722
719
  },
723
720
  /**
724
721
  * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
@@ -1044,10 +1041,7 @@ function abtestingClient(appId, apiKey, region, options) {
1044
1041
  responsesCache: createMemoryCache(),
1045
1042
  requestsCache: createMemoryCache({ serializable: false }),
1046
1043
  hostsCache: createFallbackableCache({
1047
- caches: [
1048
- createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }),
1049
- createMemoryCache(),
1050
- ],
1044
+ caches: [createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }), createMemoryCache()],
1051
1045
  }),
1052
1046
  ...options,
1053
1047
  });
@@ -2,12 +2,10 @@ 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.1.1';
5
+ const apiClientVersion = '5.2.2';
6
6
  const REGIONS = ['de', 'us'];
7
7
  function getDefaultHosts(region) {
8
- const url = !region
9
- ? 'analytics.algolia.com'
10
- : 'analytics.{region}.algolia.com'.replace('{region}', region);
8
+ const url = !region ? 'analytics.algolia.com' : 'analytics.{region}.algolia.com'.replace('{region}', region);
11
9
  return [{ url, accept: 'readWrite', protocol: 'https' }];
12
10
  }
13
11
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
@@ -41,10 +39,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
41
39
  * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
42
40
  */
43
41
  clearCache() {
44
- return Promise.all([
45
- transporter.requestsCache.clear(),
46
- transporter.responsesCache.clear(),
47
- ]).then(() => undefined);
42
+ return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);
48
43
  },
49
44
  /**
50
45
  * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
@@ -1,2 +1,2 @@
1
- /*! client-abtesting.umd.js | 5.1.1 | © 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 n(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(n(s),!t)return;n(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 n=a();return n[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:t},s().setItem(r,JSON.stringify(n)),t})),delete:e=>Promise.resolve().then((()=>{const t=a();delete t[JSON.stringify(e)],s().setItem(r,JSON.stringify(t))})),clear:()=>Promise.resolve().then((()=>{s().removeItem(r)}))}}function r(e){const t=[...e.caches],s=t.shift();return void 0===s?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then((e=>Promise.all([e,r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,a,n={miss:()=>Promise.resolve()})=>s.get(e,a,n).catch((()=>r({caches:t}).get(e,a,n))),set:(e,a)=>s.set(e,a).catch((()=>r({caches:t}).set(e,a))),delete:e=>s.delete(e).catch((()=>r({caches:t}).delete(e))),clear:()=>s.clear().catch((()=>r({caches:t}).clear()))}}function s(e={serializable:!0}){let t={};return{get(r,s,a={miss:()=>Promise.resolve()}){const n=JSON.stringify(r);if(n in t)return Promise.resolve(e.serializable?JSON.parse(t[n]):t[n]);const o=s();return o.then((e=>a.miss(e))).then((()=>o))},set:(r,s)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(s):s,Promise.resolve(s)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}const a=12e4;function n(e,t="up"){const r=Date.now();return{...e,status:t,lastUpdate:r,isUp:function(){return"up"===t||Date.now()-r>a},isTimedOut:function(){return"timed out"===t&&Date.now()-r<=a}}}function o(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!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+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class i extends Error{constructor(e,t){super(e),o(this,"name","AlgoliaError"),t&&(this.name=t)}}class u extends i{constructor(e,t,r){super(e,r),o(this,"stackTrace",void 0),this.stackTrace=t}}class c extends u{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.",e,"RetryError")}}class l extends u{constructor(e,t,r,s="ApiError"){super(e,r,s),o(this,"status",void 0),this.status=t}}class d extends i{constructor(e,t){super(e,"DeserializationError"),o(this,"response",void 0),this.response=t}}class h extends l{constructor(e,t,r,s){super(e,t,s,"DetailedApiError"),o(this,"error",void 0),this.error=r}}function m(e,t,r){const s=(a=r,Object.keys(a).filter((e=>void 0!==a[e])).sort().map((e=>`${e}=${encodeURIComponent("[object Array]"===Object.prototype.toString.call(a[e])?a[e].join(","):a[e]).replaceAll("+","%20")}`)).join("&"));var a;let n=`${e.protocol}://${e.url}${e.port?`:${e.port}`:""}/${"/"===t.charAt(0)?t.substring(1):t}`;return s.length&&(n+=`?${s}`),n}function p(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function f({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:s,algoliaAgent:a,timeouts:o,requester:i,requestsCache:u,responsesCache:f}){async function g(u,f,g=!0){const w=[],y=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)}(u,f),P=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,u.headers,f.headers),T="GET"===u.method?{...u.data,...f.data}:{},q={...s,...u.queryParameters,...T};if(a.value&&(q["x-algolia-agent"]=a.value),f&&f.queryParameters)for(const e of Object.keys(f.queryParameters))f.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(f.queryParameters[e])?q[e]=f.queryParameters[e].toString():q[e]=f.queryParameters[e];let v=0;const b=async(e,r)=>{const s=e.pop();if(void 0===s)throw new c(function(e){return e.map((e=>p(e)))}(w));let a=g?f.timeouts?.read||o.read:f.timeouts?.write||o.write;const T={data:y,headers:P,method:u.method,url:m(s,u.path,q),connectTimeout:r(v,f.timeouts?.connect||o.connect),responseTimeout:r(v,a)},A=t=>{const r={request:T,response:t,host:s,triesLeft:e.length};return w.push(r),r},E=await i.send(T);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)}(E)){const a=A(E);return E.isTimedOut&&v++,console.log("Retryable failure",p(a)),await t.set(s,n(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 d(t.message,e)}}(E);throw A(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 l(s.message,t,r)}catch(e){}return new l(e,t,r)}(E,w)},A=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(n(e))))))),s=r.filter((e=>e.isUp())),a=r.filter((e=>e.isTimedOut())),o=[...s,...a];return{hosts:o.length>0?o:e,getTimeout:(e,t)=>(0===a.length&&0===e?1:a.length+3+e)*t}}(A);return b([...E.hosts].reverse(),E.getTimeout)}return{hostsCache:t,requester:i,timeouts:o,algoliaAgent:a,baseHeaders:r,baseQueryParameters:s,hosts:e,request:function(e,t={}){const a=e.useReadTransporter||"GET"===e.method;if(!a)return g(e,t,a);const n=()=>g(e,t);if(!0!==(t.cacheable||e.cacheable))return n();const o={request:e,requestOptions:t,transporter:{queryParameters:s,headers:r}};return f.get(o,(()=>u.get(o,(()=>u.set(o,n()).then((e=>Promise.all([u.delete(o),e])),(e=>Promise.all([u.delete(o),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>f.set(o,e)})},requestsCache:u,responsesCache:f}}function g({algoliaAgents:e,client:t,version:r}){const s=function(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}(r).add({segment:t,version:r});return e.forEach((e=>s.add(e))),s}const w="5.1.1",y=["de","us"];e.abtestingClient=function(e,a,n,o){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!a||"string"!=typeof a)throw new Error("`apiKey` is missing.");if(n&&("string"!=typeof n||!y.includes(n)))throw new Error(`\`region\` must be one of the following: ${y.join(", ")}`);return function({appId:e,apiKey:t,authMode:r,algoliaAgents:s,region:a,...n}){const o=function(e,t,r="WithinHeaders"){const s={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===r?s:{},queryParameters:()=>"WithinQueryParameters"===r?s:{}}}(e,t,r),i=f({hosts:(u=a,[{url:u?"analytics.{region}.algolia.com".replace("{region}",u):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]),...n,algoliaAgent:g({algoliaAgents:s,client:"Abtesting",version:w}),baseHeaders:{"content-type":"text/plain",...o.headers(),...n.baseHeaders},baseQueryParameters:{...o.queryParameters(),...n.baseQueryParameters}});var u;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 n={};void 0!==e&&(n.offset=e.toString()),void 0!==t&&(n.limit=t.toString()),void 0!==r&&(n.indexPrefix=r.toString()),void 0!==s&&(n.indexSuffix=s.toString());const o={method:"GET",path:"/2/abtests",queryParameters:n,headers:{}};return i.request(o,a)},scheduleABTest(e,t){if(!e)throw new Error("Parameter `scheduleABTestsRequest` is required when calling `scheduleABTest`.");if(!e.name)throw new Error("Parameter `scheduleABTestsRequest.name` is required when calling `scheduleABTest`.");if(!e.variants)throw new Error("Parameter `scheduleABTestsRequest.variants` is required when calling `scheduleABTest`.");if(!e.scheduledAt)throw new Error("Parameter `scheduleABTestsRequest.scheduledAt` is required when calling `scheduleABTest`.");if(!e.endAt)throw new Error("Parameter `scheduleABTestsRequest.endAt` is required when calling `scheduleABTest`.");const r={method:"POST",path:"/2/abtests/schedule",queryParameters:{},headers:{},data:e};return i.request(r,t)},stopABTest({id:e},t){if(!e)throw new Error("Parameter `id` is required when calling `stopABTest`.");const r={method:"POST",path:"/2/abtests/{id}/stop".replace("{id}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)}}}({appId:e,apiKey:a,region:n,timeouts:{connect:1e3,read:2e3,write:3e4},requester:{send:function(e){return new Promise((t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((t=>r.setRequestHeader(t,e.headers[t])));const s=(e,s)=>setTimeout((()=>{r.abort(),t({status:0,content:s,isTimedOut:!0})}),e),a=s(e.connectTimeout,"Connection timeout");let n;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===n&&(clearTimeout(a),n=s(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(a),clearTimeout(n),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(a),clearTimeout(n),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:s(),requestsCache:s({serializable:!1}),hostsCache:r({caches:[t({key:`${w}-${e}`}),s()]}),...o})},e.apiClientVersion=w}));
1
+ /*! client-abtesting.umd.js | 5.2.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 n(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(n(s),!t)return;n(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 n=a();return n[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:t},s().setItem(r,JSON.stringify(n)),t})),delete:e=>Promise.resolve().then((()=>{const t=a();delete t[JSON.stringify(e)],s().setItem(r,JSON.stringify(t))})),clear:()=>Promise.resolve().then((()=>{s().removeItem(r)}))}}function r(e){const t=[...e.caches],s=t.shift();return void 0===s?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then((e=>Promise.all([e,r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,a,n={miss:()=>Promise.resolve()})=>s.get(e,a,n).catch((()=>r({caches:t}).get(e,a,n))),set:(e,a)=>s.set(e,a).catch((()=>r({caches:t}).set(e,a))),delete:e=>s.delete(e).catch((()=>r({caches:t}).delete(e))),clear:()=>s.clear().catch((()=>r({caches:t}).clear()))}}function s(e={serializable:!0}){let t={};return{get(r,s,a={miss:()=>Promise.resolve()}){const n=JSON.stringify(r);if(n in t)return Promise.resolve(e.serializable?JSON.parse(t[n]):t[n]);const o=s();return o.then((e=>a.miss(e))).then((()=>o))},set:(r,s)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(s):s,Promise.resolve(s)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}const a=12e4;function n(e,t="up"){const r=Date.now();return{...e,status:t,lastUpdate:r,isUp:function(){return"up"===t||Date.now()-r>a},isTimedOut:function(){return"timed out"===t&&Date.now()-r<=a}}}function o(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!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+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class i extends Error{constructor(e,t){super(e),o(this,"name","AlgoliaError"),t&&(this.name=t)}}class u extends i{constructor(e,t,r){super(e,r),o(this,"stackTrace",void 0),this.stackTrace=t}}class c extends u{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.",e,"RetryError")}}class l extends u{constructor(e,t,r,s="ApiError"){super(e,r,s),o(this,"status",void 0),this.status=t}}class d extends i{constructor(e,t){super(e,"DeserializationError"),o(this,"response",void 0),this.response=t}}class h extends l{constructor(e,t,r,s){super(e,t,s,"DetailedApiError"),o(this,"error",void 0),this.error=r}}function m(e,t,r){const s=(a=r,Object.keys(a).filter((e=>void 0!==a[e])).sort().map((e=>`${e}=${encodeURIComponent("[object Array]"===Object.prototype.toString.call(a[e])?a[e].join(","):a[e]).replaceAll("+","%20")}`)).join("&"));var a;let n=`${e.protocol}://${e.url}${e.port?`:${e.port}`:""}/${"/"===t.charAt(0)?t.substring(1):t}`;return s.length&&(n+=`?${s}`),n}function p(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function f({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:s,algoliaAgent:a,timeouts:o,requester:i,requestsCache:u,responsesCache:f}){async function g(u,f,g=!0){const w=[],y=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)}(u,f),P=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,u.headers,f.headers),T="GET"===u.method?{...u.data,...f.data}:{},q={...s,...u.queryParameters,...T};if(a.value&&(q["x-algolia-agent"]=a.value),f&&f.queryParameters)for(const e of Object.keys(f.queryParameters))f.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(f.queryParameters[e])?q[e]=f.queryParameters[e].toString():q[e]=f.queryParameters[e];let v=0;const b=async(e,r)=>{const s=e.pop();if(void 0===s)throw new c(function(e){return e.map((e=>p(e)))}(w));const a={...o,...f.timeouts},T={data:y,headers:P,method:u.method,url:m(s,u.path,q),connectTimeout:r(v,a.connect),responseTimeout:r(v,g?a.read:a.write)},A=t=>{const r={request:T,response:t,host:s,triesLeft:e.length};return w.push(r),r},E=await i.send(T);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)}(E)){const a=A(E);return E.isTimedOut&&v++,console.log("Retryable failure",p(a)),await t.set(s,n(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 d(t.message,e)}}(E);throw A(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 l(s.message,t,r)}catch{}return new l(e,t,r)}(E,w)},A=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(n(e))))))),s=r.filter((e=>e.isUp())),a=r.filter((e=>e.isTimedOut())),o=[...s,...a];return{hosts:o.length>0?o:e,getTimeout:(e,t)=>(0===a.length&&0===e?1:a.length+3+e)*t}}(A);return b([...E.hosts].reverse(),E.getTimeout)}return{hostsCache:t,requester:i,timeouts:o,algoliaAgent:a,baseHeaders:r,baseQueryParameters:s,hosts:e,request:function(e,t={}){const a=e.useReadTransporter||"GET"===e.method;if(!a)return g(e,t,a);const n=()=>g(e,t);if(!0!==(t.cacheable||e.cacheable))return n();const o={request:e,requestOptions:t,transporter:{queryParameters:s,headers:r}};return f.get(o,(()=>u.get(o,(()=>u.set(o,n()).then((e=>Promise.all([u.delete(o),e])),(e=>Promise.all([u.delete(o),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>f.set(o,e)})},requestsCache:u,responsesCache:f}}function g({algoliaAgents:e,client:t,version:r}){const s=function(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}(r).add({segment:t,version:r});return e.forEach((e=>s.add(e))),s}const w="5.2.2",y=["de","us"];e.abtestingClient=function(e,a,n,o){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!a||"string"!=typeof a)throw new Error("`apiKey` is missing.");if(n&&("string"!=typeof n||!y.includes(n)))throw new Error(`\`region\` must be one of the following: ${y.join(", ")}`);return function({appId:e,apiKey:t,authMode:r,algoliaAgents:s,region:a,...n}){const o=function(e,t,r="WithinHeaders"){const s={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===r?s:{},queryParameters:()=>"WithinQueryParameters"===r?s:{}}}(e,t,r),i=f({hosts:(u=a,[{url:u?"analytics.{region}.algolia.com".replace("{region}",u):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]),...n,algoliaAgent:g({algoliaAgents:s,client:"Abtesting",version:w}),baseHeaders:{"content-type":"text/plain",...o.headers(),...n.baseHeaders},baseQueryParameters:{...o.queryParameters(),...n.baseQueryParameters}});var u;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 n={};void 0!==e&&(n.offset=e.toString()),void 0!==t&&(n.limit=t.toString()),void 0!==r&&(n.indexPrefix=r.toString()),void 0!==s&&(n.indexSuffix=s.toString());const o={method:"GET",path:"/2/abtests",queryParameters:n,headers:{}};return i.request(o,a)},scheduleABTest(e,t){if(!e)throw new Error("Parameter `scheduleABTestsRequest` is required when calling `scheduleABTest`.");if(!e.name)throw new Error("Parameter `scheduleABTestsRequest.name` is required when calling `scheduleABTest`.");if(!e.variants)throw new Error("Parameter `scheduleABTestsRequest.variants` is required when calling `scheduleABTest`.");if(!e.scheduledAt)throw new Error("Parameter `scheduleABTestsRequest.scheduledAt` is required when calling `scheduleABTest`.");if(!e.endAt)throw new Error("Parameter `scheduleABTestsRequest.endAt` is required when calling `scheduleABTest`.");const r={method:"POST",path:"/2/abtests/schedule",queryParameters:{},headers:{},data:e};return i.request(r,t)},stopABTest({id:e},t){if(!e)throw new Error("Parameter `id` is required when calling `stopABTest`.");const r={method:"POST",path:"/2/abtests/{id}/stop".replace("{id}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)}}}({appId:e,apiKey:a,region:n,timeouts:{connect:1e3,read:2e3,write:3e4},requester:{send:function(e){return new Promise((t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((t=>r.setRequestHeader(t,e.headers[t])));const s=(e,s)=>setTimeout((()=>{r.abort(),t({status:0,content:s,isTimedOut:!0})}),e),a=s(e.connectTimeout,"Connection timeout");let n;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===n&&(clearTimeout(a),n=s(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(a),clearTimeout(n),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(a),clearTimeout(n),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:s(),requestsCache:s({serializable:!1}),hostsCache:r({caches:[t({key:`${w}-${e}`}),s()]}),...o})},e.apiClientVersion=w}));
@@ -39,7 +39,7 @@ export type CustomPostProps = {
39
39
  /**
40
40
  * Parameters to send with the custom request.
41
41
  */
42
- body?: Record<string, any>;
42
+ body?: Record<string, unknown>;
43
43
  };
44
44
  /**
45
45
  * Properties for the `customPut` method.
@@ -56,7 +56,7 @@ export type CustomPutProps = {
56
56
  /**
57
57
  * Parameters to send with the custom request.
58
58
  */
59
- body?: Record<string, any>;
59
+ body?: Record<string, unknown>;
60
60
  };
61
61
  /**
62
62
  * Properties for the `deleteABTest` method.
@@ -1 +1 @@
1
- {"version":3,"file":"clientMethod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EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC"}
@@ -2,6 +2,6 @@
2
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
- customSearchParameters: Record<string, any>;
5
+ customSearchParameters: Record<string, unknown>;
6
6
  };
7
7
  //# sourceMappingURL=customSearchParams.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"customSearchParams.d.ts","sourceRoot":"","sources":["../../model/customSearchParams.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC7C,CAAC"}
1
+ {"version":3,"file":"customSearchParams.d.ts","sourceRoot":"","sources":["../../model/customSearchParams.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjD,CAAC"}
@@ -1 +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"}
1
+ {"version":3,"file":"effect.d.ts","sourceRoot":"","sources":["../../model/effect.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,eAAe,GAAG,kBAAkB,GAAG,gBAAgB,GAAG,cAAc,CAAC"}
@@ -6,7 +6,7 @@ import type { CustomDeleteProps, CustomGetProps, CustomPostProps, CustomPutProps
6
6
  import type { ListABTestsResponse } from '../model/listABTestsResponse';
7
7
  import type { ScheduleABTestResponse } from '../model/scheduleABTestResponse';
8
8
  import type { ScheduleABTestsRequest } from '../model/scheduleABTestsRequest';
9
- export declare const apiClientVersion = "5.1.1";
9
+ export declare const apiClientVersion = "5.2.2";
10
10
  export declare const REGIONS: readonly ["de", "us"];
11
11
  export type Region = (typeof REGIONS)[number];
12
12
  export declare function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }: CreateClientOptions & {
@@ -50,7 +50,7 @@ export declare function createAbtestingClient({ appId: appIdOption, apiKey: apiK
50
50
  * @param customDelete.parameters - Query parameters to apply to the current query.
51
51
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
52
52
  */
53
- customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
53
+ customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
54
54
  /**
55
55
  * This method allow you to send requests to the Algolia REST API.
56
56
  *
@@ -59,7 +59,7 @@ export declare function createAbtestingClient({ appId: appIdOption, apiKey: apiK
59
59
  * @param customGet.parameters - Query parameters to apply to the current query.
60
60
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
61
61
  */
62
- customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
62
+ customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
63
63
  /**
64
64
  * This method allow you to send requests to the Algolia REST API.
65
65
  *
@@ -69,7 +69,7 @@ export declare function createAbtestingClient({ appId: appIdOption, apiKey: apiK
69
69
  * @param customPost.body - Parameters to send with the custom request.
70
70
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
71
71
  */
72
- customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
72
+ customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
73
73
  /**
74
74
  * This method allow you to send requests to the Algolia REST API.
75
75
  *
@@ -79,7 +79,7 @@ export declare function createAbtestingClient({ appId: appIdOption, apiKey: apiK
79
79
  * @param customPut.body - Parameters to send with the custom request.
80
80
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
81
81
  */
82
- customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
82
+ customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
83
83
  /**
84
84
  * Deletes an A/B test by its ID.
85
85
  *
@@ -1 +1 @@
1
- {"version":3,"file":"abtestingClient.d.ts","sourceRoot":"","sources":["../../src/abtestingClient.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,mBAAmB,EAKnB,cAAc,EACf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,eAAe,EAChB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,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AAc,CAAC;EAmBhG"}
@@ -43,7 +43,7 @@ export type CustomPostProps = {
43
43
  /**
44
44
  * Parameters to send with the custom request.
45
45
  */
46
- body?: Record<string, any>;
46
+ body?: Record<string, unknown>;
47
47
  };
48
48
 
49
49
  /**
@@ -61,7 +61,7 @@ export type CustomPutProps = {
61
61
  /**
62
62
  * Parameters to send with the custom request.
63
63
  */
64
- body?: Record<string, any>;
64
+ body?: Record<string, unknown>;
65
65
  };
66
66
 
67
67
  /**
@@ -4,5 +4,5 @@
4
4
  * Search parameters to add to the test variant. Only use this parameter if the two variants use the same index.
5
5
  */
6
6
  export type CustomSearchParams = {
7
- customSearchParameters: Record<string, any>;
7
+ customSearchParameters: Record<string, unknown>;
8
8
  };
package/model/effect.ts CHANGED
@@ -3,8 +3,4 @@
3
3
  /**
4
4
  * Metric for which you want to detect the smallest relative difference.
5
5
  */
6
- export type Effect =
7
- | 'addToCartRate'
8
- | 'clickThroughRate'
9
- | 'conversionRate'
10
- | 'purchaseRate';
6
+ export type Effect = 'addToCartRate' | 'clickThroughRate' | 'conversionRate' | 'purchaseRate';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@algolia/client-abtesting",
3
- "version": "5.1.1",
3
+ "version": "5.2.2",
4
4
  "description": "JavaScript client for client-abtesting",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,7 +18,7 @@
18
18
  "default": "./dist/client-abtesting.cjs",
19
19
  "types": "./dist/builds/node.d.ts"
20
20
  },
21
- "default": {
21
+ "browser": {
22
22
  "umd": "./dist/client-abtesting.umd.js",
23
23
  "module": "./dist/client-abtesting.esm.browser.js",
24
24
  "import": "./dist/client-abtesting.esm.browser.js",
@@ -44,13 +44,13 @@
44
44
  "clean": "rm -rf ./dist || true"
45
45
  },
46
46
  "dependencies": {
47
- "@algolia/client-common": "5.1.1",
48
- "@algolia/requester-browser-xhr": "5.1.1",
49
- "@algolia/requester-node-http": "5.1.1"
47
+ "@algolia/client-common": "5.2.2",
48
+ "@algolia/requester-browser-xhr": "5.2.2",
49
+ "@algolia/requester-node-http": "5.2.2"
50
50
  },
51
51
  "devDependencies": {
52
- "@types/node": "22.2.0",
53
- "rollup": "4.20.0",
52
+ "@types/node": "22.5.0",
53
+ "rollup": "4.21.0",
54
54
  "typescript": "5.5.4"
55
55
  },
56
56
  "engines": {