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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/builds/browser.d.ts +22 -3
  2. package/dist/builds/browser.d.ts.map +1 -1
  3. package/dist/builds/node.d.ts +22 -3
  4. package/dist/builds/node.d.ts.map +1 -1
  5. package/dist/client-abtesting.cjs +51 -42
  6. package/dist/client-abtesting.esm.browser.js +38 -34
  7. package/dist/client-abtesting.esm.node.js +51 -42
  8. package/dist/client-abtesting.umd.js +2 -2
  9. package/dist/model/aBTest.d.ts +14 -29
  10. package/dist/model/aBTest.d.ts.map +1 -1
  11. package/dist/model/aBTestConfiguration.d.ts +12 -0
  12. package/dist/model/aBTestConfiguration.d.ts.map +1 -0
  13. package/dist/model/aBTestResponse.d.ts +3 -3
  14. package/dist/model/abTestsVariant.d.ts +3 -3
  15. package/dist/model/addABTestsRequest.d.ts +1 -1
  16. package/dist/model/clientMethodProps.d.ts +7 -7
  17. package/dist/model/{currenciesValue.d.ts → currency.d.ts} +2 -2
  18. package/dist/model/currency.d.ts.map +1 -0
  19. package/dist/model/customSearchParams.d.ts +1 -1
  20. package/dist/model/effect.d.ts +5 -0
  21. package/dist/model/effect.d.ts.map +1 -0
  22. package/dist/model/emptySearch.d.ts +10 -0
  23. package/dist/model/emptySearch.d.ts.map +1 -0
  24. package/dist/model/index.d.ts +7 -1
  25. package/dist/model/index.d.ts.map +1 -1
  26. package/dist/model/listABTestsResponse.d.ts +2 -2
  27. package/dist/model/listABTestsResponse.d.ts.map +1 -1
  28. package/dist/model/minimumDetectableEffect.d.ts +12 -0
  29. package/dist/model/minimumDetectableEffect.d.ts.map +1 -0
  30. package/dist/model/outliers.d.ts +10 -0
  31. package/dist/model/outliers.d.ts.map +1 -0
  32. package/dist/model/status.d.ts +5 -0
  33. package/dist/model/status.d.ts.map +1 -0
  34. package/dist/model/variant.d.ts +29 -25
  35. package/dist/model/variant.d.ts.map +1 -1
  36. package/dist/src/abtestingClient.d.ts +28 -26
  37. package/dist/src/abtestingClient.d.ts.map +1 -1
  38. package/model/aBTest.ts +15 -29
  39. package/model/aBTestConfiguration.ts +16 -0
  40. package/model/aBTestResponse.ts +3 -3
  41. package/model/abTestsVariant.ts +3 -3
  42. package/model/addABTestsRequest.ts +1 -1
  43. package/model/clientMethodProps.ts +7 -7
  44. package/model/{currenciesValue.ts → currency.ts} +1 -1
  45. package/model/customSearchParams.ts +1 -1
  46. package/model/effect.ts +10 -0
  47. package/model/emptySearch.ts +11 -0
  48. package/model/index.ts +7 -1
  49. package/model/listABTestsResponse.ts +2 -2
  50. package/model/minimumDetectableEffect.ts +15 -0
  51. package/model/outliers.ts +11 -0
  52. package/model/status.ts +6 -0
  53. package/model/variant.ts +30 -25
  54. package/package.json +7 -7
  55. package/dist/model/currenciesValue.d.ts.map +0 -1
@@ -1,6 +1,25 @@
1
1
  import type { ClientOptions } from '@algolia/client-common';
2
- import type { AbtestingClient, Region } from '../src/abtestingClient';
3
- export { apiClientVersion, AbtestingClient, Region, } from '../src/abtestingClient';
2
+ import type { Region } from '../src/abtestingClient';
3
+ export { apiClientVersion, Region } from '../src/abtestingClient';
4
4
  export * from '../model';
5
- export declare function abtestingClient(appId: string, apiKey: string, region?: Region, options?: ClientOptions): AbtestingClient;
5
+ /**
6
+ * The client type.
7
+ */
8
+ export type AbtestingClient = ReturnType<typeof abtestingClient>;
9
+ export declare function abtestingClient(appId: string, apiKey: string, region?: Region, options?: ClientOptions): {
10
+ transporter: import("@algolia/client-common").Transporter;
11
+ appId: string;
12
+ clearCache(): Promise<void>;
13
+ readonly _ua: string;
14
+ addAlgoliaAgent(segment: string, version?: string | undefined): void;
15
+ addABTests(addABTestsRequest: import("../model").AddABTestsRequest, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("../model").ABTestResponse>;
16
+ customDelete({ path, parameters }: import("../model").CustomDeleteProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<Record<string, any>>;
17
+ customGet({ path, parameters }: import("../model").CustomGetProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<Record<string, any>>;
18
+ customPost({ path, parameters, body }: import("../model").CustomPostProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<Record<string, any>>;
19
+ customPut({ path, parameters, body }: import("../model").CustomPutProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<Record<string, any>>;
20
+ deleteABTest({ id }: import("../model").DeleteABTestProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("../model").ABTestResponse>;
21
+ getABTest({ id }: import("../model").GetABTestProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("../model").ABTest>;
22
+ listABTests({ offset, limit, indexPrefix, indexSuffix }?: import("../model").ListABTestsProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("../model").ListABTestsResponse>;
23
+ stopABTest({ id }: import("../model").StopABTestProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("../model").ABTestResponse>;
24
+ };
6
25
  //# sourceMappingURL=browser.d.ts.map
@@ -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,eAAe,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAOtE,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,MAAM,GACP,MAAM,wBAAwB,CAAC;AAChC,cAAc,UAAU,CAAC;AAEzB,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,aAAa,GACtB,eAAe,CAqCjB"}
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,6 +1,25 @@
1
1
  import type { ClientOptions } from '@algolia/client-common';
2
- import type { AbtestingClient, Region } from '../src/abtestingClient';
3
- export { apiClientVersion, AbtestingClient, Region, } from '../src/abtestingClient';
2
+ import type { Region } from '../src/abtestingClient';
3
+ export { apiClientVersion, Region } from '../src/abtestingClient';
4
4
  export * from '../model';
5
- export declare function abtestingClient(appId: string, apiKey: string, region?: Region, options?: ClientOptions): AbtestingClient;
5
+ /**
6
+ * The client type.
7
+ */
8
+ export type AbtestingClient = ReturnType<typeof abtestingClient>;
9
+ export declare function abtestingClient(appId: string, apiKey: string, region?: Region, options?: ClientOptions): {
10
+ transporter: import("@algolia/client-common").Transporter;
11
+ appId: string;
12
+ clearCache(): Promise<void>;
13
+ _ua: string;
14
+ addAlgoliaAgent(segment: string, version?: string | undefined): void;
15
+ addABTests(addABTestsRequest: import("../model").AddABTestsRequest, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("../model").ABTestResponse>;
16
+ customDelete({ path, parameters }: import("../model").CustomDeleteProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<Record<string, any>>;
17
+ customGet({ path, parameters }: import("../model").CustomGetProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<Record<string, any>>;
18
+ customPost({ path, parameters, body }: import("../model").CustomPostProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<Record<string, any>>;
19
+ customPut({ path, parameters, body }: import("../model").CustomPutProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<Record<string, any>>;
20
+ deleteABTest({ id }: import("../model").DeleteABTestProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("../model").ABTestResponse>;
21
+ getABTest({ id }: import("../model").GetABTestProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("../model").ABTest>;
22
+ listABTests({ offset, limit, indexPrefix, indexSuffix }?: import("../model").ListABTestsProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("../model").ListABTestsResponse>;
23
+ stopABTest({ id }: import("../model").StopABTestProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("../model").ABTestResponse>;
24
+ };
6
25
  //# sourceMappingURL=node.d.ts.map
@@ -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,eAAe,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGtE,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,MAAM,GACP,MAAM,wBAAwB,CAAC;AAChC,cAAc,UAAU,CAAC;AAEzB,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,aAAa,GACtB,eAAe,CA+BjB"}
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"}
@@ -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.99';
7
+ const apiClientVersion = '5.0.0-beta.1';
8
8
  const REGIONS = ['de', 'us'];
9
9
  function getDefaultHosts(region) {
10
10
  const url = !region
@@ -64,9 +64,11 @@ 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
+ *
69
+ * Required API Key ACLs:
70
+ * - editSettings.
68
71
  *
69
- * @summary Create an A/B test.
70
72
  * @param addABTestsRequest - The addABTestsRequest object.
71
73
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
72
74
  */
@@ -98,7 +100,6 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
98
100
  /**
99
101
  * This method allow you to send requests to the Algolia REST API.
100
102
  *
101
- * @summary Send requests to the Algolia REST API.
102
103
  * @param customDelete - The customDelete object.
103
104
  * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
104
105
  * @param customDelete.parameters - Query parameters to apply to the current query.
@@ -108,7 +109,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
108
109
  if (!path) {
109
110
  throw new Error('Parameter `path` is required when calling `customDelete`.');
110
111
  }
111
- const requestPath = '/1{path}'.replace('{path}', path);
112
+ const requestPath = '/{path}'.replace('{path}', path);
112
113
  const headers = {};
113
114
  const queryParameters = parameters ? parameters : {};
114
115
  const request = {
@@ -122,7 +123,6 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
122
123
  /**
123
124
  * This method allow you to send requests to the Algolia REST API.
124
125
  *
125
- * @summary Send requests to the Algolia REST API.
126
126
  * @param customGet - The customGet object.
127
127
  * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
128
128
  * @param customGet.parameters - Query parameters to apply to the current query.
@@ -132,7 +132,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
132
132
  if (!path) {
133
133
  throw new Error('Parameter `path` is required when calling `customGet`.');
134
134
  }
135
- const requestPath = '/1{path}'.replace('{path}', path);
135
+ const requestPath = '/{path}'.replace('{path}', path);
136
136
  const headers = {};
137
137
  const queryParameters = parameters ? parameters : {};
138
138
  const request = {
@@ -146,7 +146,6 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
146
146
  /**
147
147
  * This method allow you to send requests to the Algolia REST API.
148
148
  *
149
- * @summary Send requests to the Algolia REST API.
150
149
  * @param customPost - The customPost object.
151
150
  * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
152
151
  * @param customPost.parameters - Query parameters to apply to the current query.
@@ -157,7 +156,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
157
156
  if (!path) {
158
157
  throw new Error('Parameter `path` is required when calling `customPost`.');
159
158
  }
160
- const requestPath = '/1{path}'.replace('{path}', path);
159
+ const requestPath = '/{path}'.replace('{path}', path);
161
160
  const headers = {};
162
161
  const queryParameters = parameters ? parameters : {};
163
162
  const request = {
@@ -172,7 +171,6 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
172
171
  /**
173
172
  * This method allow you to send requests to the Algolia REST API.
174
173
  *
175
- * @summary Send requests to the Algolia REST API.
176
174
  * @param customPut - The customPut object.
177
175
  * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
178
176
  * @param customPut.parameters - Query parameters to apply to the current query.
@@ -183,7 +181,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
183
181
  if (!path) {
184
182
  throw new Error('Parameter `path` is required when calling `customPut`.');
185
183
  }
186
- const requestPath = '/1{path}'.replace('{path}', path);
184
+ const requestPath = '/{path}'.replace('{path}', path);
187
185
  const headers = {};
188
186
  const queryParameters = parameters ? parameters : {};
189
187
  const request = {
@@ -196,11 +194,13 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
196
194
  return transporter.request(request, requestOptions);
197
195
  },
198
196
  /**
199
- * 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
+ *
199
+ * Required API Key ACLs:
200
+ * - editSettings.
200
201
  *
201
- * @summary Delete an A/B test.
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,11 +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
+ *
224
+ * Required API Key ACLs:
225
+ * - analytics.
223
226
  *
224
- * @summary Get A/B test details.
225
227
  * @param getABTest - The getABTest object.
226
- * @param getABTest.id - Unique A/B test ID.
228
+ * @param getABTest.id - Unique A/B test identifier.
227
229
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
228
230
  */
229
231
  getABTest({ id }, requestOptions) {
@@ -242,14 +244,16 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
242
244
  return transporter.request(request, requestOptions);
243
245
  },
244
246
  /**
245
- * List all A/B tests.
247
+ * Lists all A/B tests you configured for this application.
248
+ *
249
+ * Required API Key ACLs:
250
+ * - analytics.
246
251
  *
247
- * @summary List all A/B tests.
248
252
  * @param listABTests - The listABTests object.
249
- * @param listABTests.offset - Position of the starting record. Used for paging. 0 is the first record.
250
- * @param listABTests.limit - Number of records to return (page size).
251
- * @param listABTests.indexPrefix - Only return A/B tests for indices starting with this prefix.
252
- * @param listABTests.indexSuffix - Only return A/B tests for indices ending with this suffix.
253
+ * @param listABTests.offset - Position of the first item to return.
254
+ * @param listABTests.limit - Number of items to return.
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.
253
257
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
254
258
  */
255
259
  listABTests({ offset, limit, indexPrefix, indexSuffix } = {}, requestOptions = undefined) {
@@ -277,11 +281,13 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
277
281
  return transporter.request(request, requestOptions);
278
282
  },
279
283
  /**
280
- * 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
+ *
286
+ * Required API Key ACLs:
287
+ * - editSettings.
281
288
  *
282
- * @summary Stop an A/B test.
283
289
  * @param stopABTest - The stopABTest object.
284
- * @param stopABTest.id - Unique A/B test ID.
290
+ * @param stopABTest.id - Unique A/B test identifier.
285
291
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
286
292
  */
287
293
  stopABTest({ id }, requestOptions) {
@@ -303,6 +309,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
303
309
  }
304
310
 
305
311
  // 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.
312
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
306
313
  function abtestingClient(appId, apiKey, region, options) {
307
314
  if (!appId || typeof appId !== 'string') {
308
315
  throw new Error('`appId` is missing.');
@@ -313,22 +320,24 @@ function abtestingClient(appId, apiKey, region, options) {
313
320
  if (region && (typeof region !== 'string' || !REGIONS.includes(region))) {
314
321
  throw new Error(`\`region\` must be one of the following: ${REGIONS.join(', ')}`);
315
322
  }
316
- return createAbtestingClient({
317
- appId,
318
- apiKey,
319
- region,
320
- timeouts: {
321
- connect: clientCommon.DEFAULT_CONNECT_TIMEOUT_NODE,
322
- read: clientCommon.DEFAULT_READ_TIMEOUT_NODE,
323
- write: clientCommon.DEFAULT_WRITE_TIMEOUT_NODE,
324
- },
325
- requester: requesterNodeHttp.createHttpRequester(),
326
- algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
327
- responsesCache: clientCommon.createNullCache(),
328
- requestsCache: clientCommon.createNullCache(),
329
- hostsCache: clientCommon.createMemoryCache(),
330
- ...options,
331
- });
323
+ return {
324
+ ...createAbtestingClient({
325
+ appId,
326
+ apiKey,
327
+ region,
328
+ timeouts: {
329
+ connect: clientCommon.DEFAULT_CONNECT_TIMEOUT_NODE,
330
+ read: clientCommon.DEFAULT_READ_TIMEOUT_NODE,
331
+ write: clientCommon.DEFAULT_WRITE_TIMEOUT_NODE,
332
+ },
333
+ requester: requesterNodeHttp.createHttpRequester(),
334
+ algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
335
+ responsesCache: clientCommon.createNullCache(),
336
+ requestsCache: clientCommon.createNullCache(),
337
+ hostsCache: clientCommon.createMemoryCache(),
338
+ ...options,
339
+ }),
340
+ };
332
341
  }
333
342
 
334
343
  exports.abtestingClient = abtestingClient;
@@ -207,7 +207,7 @@ function _toPrimitive(t, r) {
207
207
  }
208
208
  function _toPropertyKey(t) {
209
209
  var i = _toPrimitive(t, "string");
210
- return "symbol" == typeof i ? i : String(i);
210
+ return "symbol" == typeof i ? i : i + "";
211
211
  }
212
212
  function _defineProperty(obj, key, value) {
213
213
  key = _toPropertyKey(key);
@@ -270,7 +270,7 @@ class DetailedApiError extends ApiError {
270
270
  }
271
271
  function serializeUrl(host, path, queryParameters) {
272
272
  const queryParametersAsString = serializeQueryParameters(queryParameters);
273
- let url = `${host.protocol}://${host.url}/${path.charAt(0) === '/' ? path.substr(1) : path}`;
273
+ let url = `${host.protocol}://${host.url}${host.port ? `:${host.port}` : ''}/${path.charAt(0) === '/' ? path.substring(1) : path}`;
274
274
  if (queryParametersAsString.length) {
275
275
  url += `?${queryParametersAsString}`;
276
276
  }
@@ -278,7 +278,7 @@ function serializeUrl(host, path, queryParameters) {
278
278
  }
279
279
  function serializeQueryParameters(parameters) {
280
280
  const isObjectOrArray = value => Object.prototype.toString.call(value) === '[object Object]' || Object.prototype.toString.call(value) === '[object Array]';
281
- return Object.keys(parameters).map(key => `${key}=${encodeURIComponent(isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key])}`).join('&');
281
+ return Object.keys(parameters).map(key => `${key}=${encodeURIComponent(isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key]).replaceAll('+', '%20')}`).join('&');
282
282
  }
283
283
  function serializeData(request, requestOptions) {
284
284
  if (request.method === 'GET' || request.data === undefined && requestOptions.data === undefined) {
@@ -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.99';
686
+ const apiClientVersion = '5.0.0-beta.1';
690
687
  const REGIONS = ['de', 'us'];
691
688
  function getDefaultHosts(region) {
692
689
  const url = !region
@@ -746,9 +743,11 @@ 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.
747
+ *
748
+ * Required API Key ACLs:
749
+ * - editSettings.
750
750
  *
751
- * @summary Create an A/B test.
752
751
  * @param addABTestsRequest - The addABTestsRequest object.
753
752
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
754
753
  */
@@ -780,7 +779,6 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
780
779
  /**
781
780
  * This method allow you to send requests to the Algolia REST API.
782
781
  *
783
- * @summary Send requests to the Algolia REST API.
784
782
  * @param customDelete - The customDelete object.
785
783
  * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
786
784
  * @param customDelete.parameters - Query parameters to apply to the current query.
@@ -790,7 +788,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
790
788
  if (!path) {
791
789
  throw new Error('Parameter `path` is required when calling `customDelete`.');
792
790
  }
793
- const requestPath = '/1{path}'.replace('{path}', path);
791
+ const requestPath = '/{path}'.replace('{path}', path);
794
792
  const headers = {};
795
793
  const queryParameters = parameters ? parameters : {};
796
794
  const request = {
@@ -804,7 +802,6 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
804
802
  /**
805
803
  * This method allow you to send requests to the Algolia REST API.
806
804
  *
807
- * @summary Send requests to the Algolia REST API.
808
805
  * @param customGet - The customGet object.
809
806
  * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
810
807
  * @param customGet.parameters - Query parameters to apply to the current query.
@@ -814,7 +811,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
814
811
  if (!path) {
815
812
  throw new Error('Parameter `path` is required when calling `customGet`.');
816
813
  }
817
- const requestPath = '/1{path}'.replace('{path}', path);
814
+ const requestPath = '/{path}'.replace('{path}', path);
818
815
  const headers = {};
819
816
  const queryParameters = parameters ? parameters : {};
820
817
  const request = {
@@ -828,7 +825,6 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
828
825
  /**
829
826
  * This method allow you to send requests to the Algolia REST API.
830
827
  *
831
- * @summary Send requests to the Algolia REST API.
832
828
  * @param customPost - The customPost object.
833
829
  * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
834
830
  * @param customPost.parameters - Query parameters to apply to the current query.
@@ -839,7 +835,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
839
835
  if (!path) {
840
836
  throw new Error('Parameter `path` is required when calling `customPost`.');
841
837
  }
842
- const requestPath = '/1{path}'.replace('{path}', path);
838
+ const requestPath = '/{path}'.replace('{path}', path);
843
839
  const headers = {};
844
840
  const queryParameters = parameters ? parameters : {};
845
841
  const request = {
@@ -854,7 +850,6 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
854
850
  /**
855
851
  * This method allow you to send requests to the Algolia REST API.
856
852
  *
857
- * @summary Send requests to the Algolia REST API.
858
853
  * @param customPut - The customPut object.
859
854
  * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
860
855
  * @param customPut.parameters - Query parameters to apply to the current query.
@@ -865,7 +860,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
865
860
  if (!path) {
866
861
  throw new Error('Parameter `path` is required when calling `customPut`.');
867
862
  }
868
- const requestPath = '/1{path}'.replace('{path}', path);
863
+ const requestPath = '/{path}'.replace('{path}', path);
869
864
  const headers = {};
870
865
  const queryParameters = parameters ? parameters : {};
871
866
  const request = {
@@ -878,11 +873,13 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
878
873
  return transporter.request(request, requestOptions);
879
874
  },
880
875
  /**
881
- * 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.
877
+ *
878
+ * Required API Key ACLs:
879
+ * - editSettings.
882
880
  *
883
- * @summary Delete an A/B test.
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,11 +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.
902
+ *
903
+ * Required API Key ACLs:
904
+ * - analytics.
905
905
  *
906
- * @summary Get A/B test details.
907
906
  * @param getABTest - The getABTest object.
908
- * @param getABTest.id - Unique A/B test ID.
907
+ * @param getABTest.id - Unique A/B test identifier.
909
908
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
910
909
  */
911
910
  getABTest({ id }, requestOptions) {
@@ -924,14 +923,16 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
924
923
  return transporter.request(request, requestOptions);
925
924
  },
926
925
  /**
927
- * List all A/B tests.
926
+ * Lists all A/B tests you configured for this application.
927
+ *
928
+ * Required API Key ACLs:
929
+ * - analytics.
928
930
  *
929
- * @summary List all A/B tests.
930
931
  * @param listABTests - The listABTests object.
931
- * @param listABTests.offset - Position of the starting record. Used for paging. 0 is the first record.
932
- * @param listABTests.limit - Number of records to return (page size).
933
- * @param listABTests.indexPrefix - Only return A/B tests for indices starting with this prefix.
934
- * @param listABTests.indexSuffix - Only return A/B tests for indices ending with this suffix.
932
+ * @param listABTests.offset - Position of the first item to return.
933
+ * @param listABTests.limit - Number of items to return.
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.
935
936
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
936
937
  */
937
938
  listABTests({ offset, limit, indexPrefix, indexSuffix } = {}, requestOptions = undefined) {
@@ -959,11 +960,13 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
959
960
  return transporter.request(request, requestOptions);
960
961
  },
961
962
  /**
962
- * 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.
964
+ *
965
+ * Required API Key ACLs:
966
+ * - editSettings.
963
967
  *
964
- * @summary Stop an A/B test.
965
968
  * @param stopABTest - The stopABTest object.
966
- * @param stopABTest.id - Unique A/B test ID.
969
+ * @param stopABTest.id - Unique A/B test identifier.
967
970
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
968
971
  */
969
972
  stopABTest({ id }, requestOptions) {
@@ -985,6 +988,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
985
988
  }
986
989
 
987
990
  // 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.
991
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
988
992
  function abtestingClient(appId, apiKey, region, options) {
989
993
  if (!appId || typeof appId !== 'string') {
990
994
  throw new Error('`appId` is missing.');