@algolia/abtesting 1.27.0 → 1.30.0
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 +4 -4
- package/dist/browser.d.ts +9 -5
- package/dist/builds/browser.js +1 -1
- package/dist/builds/browser.js.map +1 -1
- package/dist/builds/browser.min.js +1 -1
- package/dist/builds/browser.min.js.map +1 -1
- package/dist/builds/browser.umd.js +1 -1
- package/dist/builds/fetch.js +1 -1
- package/dist/builds/fetch.js.map +1 -1
- package/dist/builds/node.cjs +1 -1
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +1 -1
- package/dist/builds/node.js.map +1 -1
- package/dist/builds/worker.js +1 -1
- package/dist/builds/worker.js.map +1 -1
- package/dist/fetch.d.ts +9 -5
- package/dist/node.d.cts +9 -5
- package/dist/node.d.ts +9 -5
- package/dist/src/abtestingV3Client.cjs +1 -1
- package/dist/src/abtestingV3Client.cjs.map +1 -1
- package/dist/src/abtestingV3Client.js +1 -1
- package/dist/src/abtestingV3Client.js.map +1 -1
- package/dist/worker.d.ts +9 -5
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -40,11 +40,11 @@ All of our clients comes with type definition, and are available for both browse
|
|
|
40
40
|
### With a package manager
|
|
41
41
|
|
|
42
42
|
```bash
|
|
43
|
-
yarn add @algolia/abtesting@1.
|
|
43
|
+
yarn add @algolia/abtesting@1.30.0
|
|
44
44
|
# or
|
|
45
|
-
npm install @algolia/abtesting@1.
|
|
45
|
+
npm install @algolia/abtesting@1.30.0
|
|
46
46
|
# or
|
|
47
|
-
pnpm add @algolia/abtesting@1.
|
|
47
|
+
pnpm add @algolia/abtesting@1.30.0
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
### Without a package manager
|
|
@@ -52,7 +52,7 @@ pnpm add @algolia/abtesting@1.27.0
|
|
|
52
52
|
Add the following JavaScript snippet to the <head> of your website:
|
|
53
53
|
|
|
54
54
|
```html
|
|
55
|
-
<script src="https://cdn.jsdelivr.net/npm/@algolia/abtesting@1.
|
|
55
|
+
<script src="https://cdn.jsdelivr.net/npm/@algolia/abtesting@1.30.0/dist/builds/browser.umd.js"></script>
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
### Usage
|
package/dist/browser.d.ts
CHANGED
|
@@ -50,9 +50,9 @@ type MinimumDetectableEffect = {
|
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
|
-
* Primary metric for Bayesian analysis. Required when `method` is `bayesian`. When `method` is omitted and the test defaults to `bayesian`, the default primary metric is `conversion_rate`, or the first metric in `metrics` that supports Bayesian analysis if `metrics` doesn\'t include conversion rate. If the request includes a non-empty `metrics` list, this metric must be in that list. User-level rates (`*_users_rate`) are the share of tracked users with at least one such search. Add-to-cart rates, purchase rates, and revenue per search require access to revenue analytics.
|
|
53
|
+
* Primary metric for Bayesian analysis. Required when `method` is `bayesian`. When `method` is omitted and the test defaults to `bayesian`, the default primary metric is `conversion_rate`, or the first metric in `metrics` that supports Bayesian analysis if `metrics` doesn\'t include conversion rate. If the request includes a non-empty `metrics` list, this metric must be in that list. User-level rates (`*_users_rate`) are the share of tracked users with at least one such search. For `users_with_no_results_rate`, this is the share of tracked users with at least one search returning no results. Lower values are better. Add-to-cart rates, purchase rates, and revenue per search require access to revenue analytics.
|
|
54
54
|
*/
|
|
55
|
-
type PrimaryMetric = 'add_to_cart_rate' | 'click_through_rate' | 'conversion_rate' | 'purchase_rate' | 'revenue_per_search' | 'add_to_cart_users_rate' | 'clicked_users_rate' | 'converted_users_rate' | 'purchase_users_rate';
|
|
55
|
+
type PrimaryMetric = 'add_to_cart_rate' | 'click_through_rate' | 'conversion_rate' | 'purchase_rate' | 'revenue_per_search' | 'add_to_cart_users_rate' | 'clicked_users_rate' | 'converted_users_rate' | 'purchase_users_rate' | 'users_with_no_results_rate';
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
58
|
* A/B test configuration.
|
|
@@ -130,6 +130,10 @@ type MetricMetadata = {
|
|
|
130
130
|
* Mean value for this metric.
|
|
131
131
|
*/
|
|
132
132
|
mean?: number | undefined;
|
|
133
|
+
/**
|
|
134
|
+
* Only present for `winsorized_revenue_per_user`. Number of tracked users in this variant with a tracked purchase in the metric\'s currency (`dimension`), plus tracked users with no tracked purchase in any currency. Users who purchased only in other currencies are excluded. It\'s the sample size behind the mean, p-value, and intervals, and differs from the overall `user_count` metric. Omitted when the variant has no record for that currency.
|
|
135
|
+
*/
|
|
136
|
+
userCount?: number | undefined;
|
|
133
137
|
};
|
|
134
138
|
|
|
135
139
|
type MetricResult = {
|
|
@@ -158,7 +162,7 @@ type MetricResult = {
|
|
|
158
162
|
*/
|
|
159
163
|
pValue?: number | undefined;
|
|
160
164
|
/**
|
|
161
|
-
* Dimension defined during test creation. For revenue metrics, including `revenue_per_search`, this is the currency.
|
|
165
|
+
* Dimension defined during test creation. For revenue metrics, including `revenue_per_search` and `winsorized_revenue_per_user`, this is the currency.
|
|
162
166
|
*/
|
|
163
167
|
dimension?: string | undefined;
|
|
164
168
|
metadata?: MetricMetadata | undefined;
|
|
@@ -503,7 +507,7 @@ type Timeseries = {
|
|
|
503
507
|
*/
|
|
504
508
|
type Direction = 'asc' | 'desc';
|
|
505
509
|
|
|
506
|
-
type MetricName = 'search_count' | 'tracked_search_count' | 'user_count' | 'tracked_user_count' | 'no_result_count' | 'tracked_no_result_count' | 'add_to_cart_count' | 'purchase_count' | 'clicked_search_count' | 'converted_search_count' | 'click_through_rate' | 'conversion_rate' | 'add_to_cart_rate' | 'purchase_rate' | 'average_click_position' | 'revenue' | 'revenue_per_search' | 'average_order_value' | 'clicked_users_count' | 'converted_users_count' | 'add_to_cart_users_count' | 'purchase_users_count' | 'users_with_no_results_count' | 'clicked_users_rate' | 'converted_users_rate' | 'add_to_cart_users_rate' | 'purchase_users_rate' | 'avg_click_through_rate_per_user' | 'avg_conversion_rate_per_user' | 'avg_purchase_rate_per_user' | 'avg_add_to_cart_rate_per_user' | 'avg_click_position_per_user' | 'winsorized_revenue_per_user' | 'winsorized_revenue_per_purchaser';
|
|
510
|
+
type MetricName = 'search_count' | 'tracked_search_count' | 'user_count' | 'tracked_user_count' | 'no_result_count' | 'tracked_no_result_count' | 'add_to_cart_count' | 'purchase_count' | 'clicked_search_count' | 'converted_search_count' | 'click_through_rate' | 'conversion_rate' | 'add_to_cart_rate' | 'purchase_rate' | 'average_click_position' | 'revenue' | 'revenue_per_search' | 'average_order_value' | 'clicked_users_count' | 'converted_users_count' | 'add_to_cart_users_count' | 'purchase_users_count' | 'users_with_no_results_count' | 'clicked_users_rate' | 'converted_users_rate' | 'add_to_cart_users_rate' | 'purchase_users_rate' | 'users_with_no_results_rate' | 'avg_click_through_rate_per_user' | 'avg_conversion_rate_per_user' | 'avg_purchase_rate_per_user' | 'avg_add_to_cart_rate_per_user' | 'avg_click_position_per_user' | 'winsorized_revenue_per_user' | 'winsorized_revenue_per_purchaser';
|
|
507
511
|
|
|
508
512
|
/**
|
|
509
513
|
* Options for capturing a variant\'s settings.
|
|
@@ -705,7 +709,7 @@ type StopABTestProps = {
|
|
|
705
709
|
id: number;
|
|
706
710
|
};
|
|
707
711
|
|
|
708
|
-
declare const apiClientVersion = "1.
|
|
712
|
+
declare const apiClientVersion = "1.30.0";
|
|
709
713
|
declare const REGIONS: readonly ["de", "us"];
|
|
710
714
|
type Region = (typeof REGIONS)[number];
|
|
711
715
|
type RegionOptions = {
|
package/dist/builds/browser.js
CHANGED
|
@@ -9,7 +9,7 @@ import { createXhrRequester } from "@algolia/requester-browser-xhr";
|
|
|
9
9
|
|
|
10
10
|
// src/abtestingV3Client.ts
|
|
11
11
|
import { createAuth, createTransporter, getAlgoliaAgent, validateRequired } from "@algolia/client-common";
|
|
12
|
-
var apiClientVersion = "1.
|
|
12
|
+
var apiClientVersion = "1.30.0";
|
|
13
13
|
var REGIONS = ["de", "us"];
|
|
14
14
|
function getDefaultHosts(region) {
|
|
15
15
|
const url = !region ? "analytics.algolia.com" : "analytics.{region}.algolia.com".replace("{region}", region);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../builds/browser.ts","../../src/abtestingV3Client.ts"],"sourcesContent":["// 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.\n\nimport {\n createBrowserLocalStorageCache,\n createFallbackableCache,\n createMemoryCache,\n createNullLogger,\n} from '@algolia/client-common';\nimport { createXhrRequester } from '@algolia/requester-browser-xhr';\n\nimport type { ClientOptions } from '@algolia/client-common';\n\nimport { apiClientVersion, createAbtestingV3Client } from '../src/abtestingV3Client';\n\nimport type { Region } from '../src/abtestingV3Client';\nimport { REGIONS } from '../src/abtestingV3Client';\n\nexport type { Region, RegionOptions } from '../src/abtestingV3Client';\n\nexport { apiClientVersion } from '../src/abtestingV3Client';\n\nexport * from '../model';\n\nexport function abtestingV3Client(\n appId: string,\n apiKey: string,\n region?: Region | undefined,\n options?: ClientOptions | undefined,\n): AbtestingV3Client {\n if (!appId || typeof appId !== 'string') {\n throw new Error('`appId` is missing.');\n }\n\n if (!apiKey || typeof apiKey !== 'string') {\n throw new Error('`apiKey` is missing.');\n }\n\n if (region && (typeof region !== 'string' || !REGIONS.includes(region))) {\n throw new Error(`\\`region\\` must be one of the following: ${REGIONS.join(', ')}`);\n }\n\n const { compression: _compression, ...browserOptions } = options || {};\n\n return createAbtestingV3Client({\n appId,\n apiKey,\n region,\n timeouts: {\n connect: 1000,\n read: 2000,\n write: 30000,\n },\n logger: createNullLogger(),\n requester: createXhrRequester(),\n algoliaAgents: [{ segment: 'Browser' }],\n authMode: 'WithinQueryParameters',\n responsesCache: createMemoryCache(),\n requestsCache: createMemoryCache({ serializable: false }),\n hostsCache: createFallbackableCache({\n caches: [createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }), createMemoryCache()],\n }),\n ...browserOptions,\n });\n}\n\nexport type AbtestingV3Client = ReturnType<typeof createAbtestingV3Client>;\n","// 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.\n\nimport type {\n AlgoliaHttpResponse,\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\nimport { createAuth, createTransporter, getAlgoliaAgent, validateRequired } from '@algolia/client-common';\n\nimport type { ABTest } from '../model/aBTest';\nimport type { ABTestResponse } from '../model/aBTestResponse';\nimport type { ABTestSettingsResponse } from '../model/aBTestSettingsResponse';\nimport type { AddABTestsRequest } from '../model/addABTestsRequest';\nimport type { EstimateABTestRequest } from '../model/estimateABTestRequest';\nimport type { EstimateABTestResponse } from '../model/estimateABTestResponse';\nimport type { ListABTestsResponse } from '../model/listABTestsResponse';\nimport type { Timeseries } from '../model/timeseries';\n\nimport type {\n ApplyVariantSettingsProps,\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteABTestProps,\n GetABTestProps,\n GetABTestSettingsProps,\n GetTimeseriesProps,\n ListABTestsProps,\n SaveVariantSettingsProps,\n StopABTestProps,\n} from '../model/clientMethodProps';\n\nexport const apiClientVersion = '1.27.0';\n\nexport const REGIONS = ['de', 'us'] as const;\nexport type Region = (typeof REGIONS)[number];\nexport type RegionOptions = { region?: Region | undefined };\n\nfunction getDefaultHosts(region?: Region | undefined): Host[] {\n const url = !region ? 'analytics.algolia.com' : 'analytics.{region}.algolia.com'.replace('{region}', region);\n\n return [{ url, accept: 'readWrite', protocol: 'https' }];\n}\n\nexport function createAbtestingV3Client({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n region: regionOption,\n ...options\n}: CreateClientOptions & RegionOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(regionOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'AbtestingV3',\n version: apiClientVersion,\n }),\n baseHeaders: {\n 'content-type': 'text/plain',\n ...auth.headers(),\n ...options.baseHeaders,\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters,\n },\n });\n\n return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * The `apiKey` currently in use.\n */\n apiKey: apiKeyOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string | undefined): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * Helper method to switch the API key used to authenticate the requests.\n *\n * @param params - Method params.\n * @param params.apiKey - The new API Key to use.\n */\n setClientApiKey({ apiKey }: { apiKey: string }): void {\n if (!authMode || authMode === 'WithinHeaders') {\n transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n } else {\n transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;\n }\n },\n\n /**\n * Creates a new A/B test.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param addABTestsRequest - The addABTestsRequest object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n addABTests(addABTestsRequest: AddABTestsRequest, requestOptions?: RequestOptions): Promise<ABTestResponse> {\n validateRequired('addABTestsRequest', 'addABTests', addABTestsRequest);\n\n validateRequired('addABTestsRequest.name', 'addABTests', addABTestsRequest.name);\n validateRequired('addABTestsRequest.variants', 'addABTests', addABTestsRequest.variants);\n validateRequired('addABTestsRequest.metrics', 'addABTests', addABTestsRequest.metrics);\n validateRequired('addABTestsRequest.endAt', 'addABTests', addABTestsRequest.endAt);\n\n const requestPath = '/3/abtests';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: addABTestsRequest,\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * Creates a new A/B test.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param addABTestsRequest - The addABTestsRequest object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see addABTests for the plain version.\n */\n addABTestsWithHTTPInfo(\n addABTestsRequest: AddABTestsRequest,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<ABTestResponse>> {\n validateRequired('addABTestsRequest', 'addABTestsWithHTTPInfo', addABTestsRequest);\n\n validateRequired('addABTestsRequest.name', 'addABTestsWithHTTPInfo', addABTestsRequest.name);\n validateRequired('addABTestsRequest.variants', 'addABTestsWithHTTPInfo', addABTestsRequest.variants);\n validateRequired('addABTestsRequest.metrics', 'addABTestsWithHTTPInfo', addABTestsRequest.metrics);\n validateRequired('addABTestsRequest.endAt', 'addABTestsWithHTTPInfo', addABTestsRequest.endAt);\n\n const requestPath = '/3/abtests';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: addABTestsRequest,\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * Applies the captured settings of the given variant to the control index. The settings must first be captured with the `saveVariantSettings` operation. To revert previously applied settings on the control index, use this operation with the control variant (variant 1). Settings can be applied up to 14 days after the A/B test ends, and reverted up to 15 days after. Later requests return `400`. Each set of captured settings can only be applied once, and settings that were reverted can\\'t be applied again. Both cases return `400`. The control index must not be in use by an active A/B test. Otherwise, the request returns `422`.\n *\n * Required API Key ACLs:\n * - analytics\n * - editSettings\n * @param applyVariantSettings - The applyVariantSettings object.\n * @param applyVariantSettings.id - Unique A/B test identifier.\n * @param applyVariantSettings.variantId - One-based index of the A/B test variant. The control is variant 1.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n applyVariantSettings({ id, variantId }: ApplyVariantSettingsProps, requestOptions?: RequestOptions): Promise<void> {\n validateRequired('id', 'applyVariantSettings', id);\n\n validateRequired('variantId', 'applyVariantSettings', variantId);\n\n const requestPath = '/3/abtests/{id}/settings/{variantId}/apply'\n .replace('{id}', encodeURIComponent(id))\n .replace('{variantId}', encodeURIComponent(variantId));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * Applies the captured settings of the given variant to the control index. The settings must first be captured with the `saveVariantSettings` operation. To revert previously applied settings on the control index, use this operation with the control variant (variant 1). Settings can be applied up to 14 days after the A/B test ends, and reverted up to 15 days after. Later requests return `400`. Each set of captured settings can only be applied once, and settings that were reverted can\\'t be applied again. Both cases return `400`. The control index must not be in use by an active A/B test. Otherwise, the request returns `422`.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n *\n * Required API Key ACLs:\n * - analytics\n * - editSettings\n * @param applyVariantSettings - The applyVariantSettings object.\n * @param applyVariantSettings.id - Unique A/B test identifier.\n * @param applyVariantSettings.variantId - One-based index of the A/B test variant. The control is variant 1.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see applyVariantSettings for the plain version.\n */\n applyVariantSettingsWithHTTPInfo(\n { id, variantId }: ApplyVariantSettingsProps,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<void>> {\n validateRequired('id', 'applyVariantSettingsWithHTTPInfo', id);\n\n validateRequired('variantId', 'applyVariantSettingsWithHTTPInfo', variantId);\n\n const requestPath = '/3/abtests/{id}/settings/{variantId}/apply'\n .replace('{id}', encodeURIComponent(id))\n .replace('{variantId}', encodeURIComponent(variantId));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, for example `1/newFeature`.\n * @param customDelete.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customDelete(\n { path, parameters }: CustomDeleteProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n validateRequired('path', 'customDelete', path);\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * This method lets you send requests to the Algolia REST API.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, for example `1/newFeature`.\n * @param customDelete.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see customDelete for the plain version.\n */\n customDeleteWithHTTPInfo(\n { path, parameters }: CustomDeleteProps,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<Record<string, unknown>>> {\n validateRequired('path', 'customDeleteWithHTTPInfo', path);\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, for example `1/newFeature`.\n * @param customGet.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>> {\n validateRequired('path', 'customGet', path);\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * This method lets you send requests to the Algolia REST API.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, for example `1/newFeature`.\n * @param customGet.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see customGet for the plain version.\n */\n customGetWithHTTPInfo(\n { path, parameters }: CustomGetProps,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<Record<string, unknown>>> {\n validateRequired('path', 'customGetWithHTTPInfo', path);\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, for example `1/newFeature`.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n validateRequired('path', 'customPost', path);\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * This method lets you send requests to the Algolia REST API.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, for example `1/newFeature`.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see customPost for the plain version.\n */\n customPostWithHTTPInfo(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<Record<string, unknown>>> {\n validateRequired('path', 'customPostWithHTTPInfo', path);\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, for example `1/newFeature`.\n * @param customPut.parameters - Query parameters to apply to the current query.\n * @param customPut.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPut(\n { path, parameters, body }: CustomPutProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n validateRequired('path', 'customPut', path);\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * This method lets you send requests to the Algolia REST API.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, for example `1/newFeature`.\n * @param customPut.parameters - Query parameters to apply to the current query.\n * @param customPut.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see customPut for the plain version.\n */\n customPutWithHTTPInfo(\n { path, parameters, body }: CustomPutProps,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<Record<string, unknown>>> {\n validateRequired('path', 'customPutWithHTTPInfo', path);\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * Deletes an A/B test by its ID.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param deleteABTest - The deleteABTest object.\n * @param deleteABTest.id - Unique A/B test identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteABTest({ id }: DeleteABTestProps, requestOptions?: RequestOptions): Promise<ABTestResponse> {\n validateRequired('id', 'deleteABTest', id);\n\n const requestPath = '/3/abtests/{id}'.replace('{id}', encodeURIComponent(id));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * Deletes an A/B test by its ID.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param deleteABTest - The deleteABTest object.\n * @param deleteABTest.id - Unique A/B test identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see deleteABTest for the plain version.\n */\n deleteABTestWithHTTPInfo(\n { id }: DeleteABTestProps,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<ABTestResponse>> {\n validateRequired('id', 'deleteABTestWithHTTPInfo', id);\n\n const requestPath = '/3/abtests/{id}'.replace('{id}', encodeURIComponent(id));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * Given the traffic percentage and the expected effect size, this endpoint estimates the sample size and duration of an A/B test based on historical traffic.\n *\n * Required API Key ACLs:\n * - analytics\n * @param estimateABTestRequest - The estimateABTestRequest object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n estimateABTest(\n estimateABTestRequest: EstimateABTestRequest,\n requestOptions?: RequestOptions,\n ): Promise<EstimateABTestResponse> {\n validateRequired('estimateABTestRequest', 'estimateABTest', estimateABTestRequest);\n\n validateRequired('estimateABTestRequest.configuration', 'estimateABTest', estimateABTestRequest.configuration);\n validateRequired('estimateABTestRequest.variants', 'estimateABTest', estimateABTestRequest.variants);\n\n const requestPath = '/3/abtests/estimate';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: estimateABTestRequest,\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * Given the traffic percentage and the expected effect size, this endpoint estimates the sample size and duration of an A/B test based on historical traffic.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n *\n * Required API Key ACLs:\n * - analytics\n * @param estimateABTestRequest - The estimateABTestRequest object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see estimateABTest for the plain version.\n */\n estimateABTestWithHTTPInfo(\n estimateABTestRequest: EstimateABTestRequest,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<EstimateABTestResponse>> {\n validateRequired('estimateABTestRequest', 'estimateABTestWithHTTPInfo', estimateABTestRequest);\n\n validateRequired(\n 'estimateABTestRequest.configuration',\n 'estimateABTestWithHTTPInfo',\n estimateABTestRequest.configuration,\n );\n validateRequired('estimateABTestRequest.variants', 'estimateABTestWithHTTPInfo', estimateABTestRequest.variants);\n\n const requestPath = '/3/abtests/estimate';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: estimateABTestRequest,\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * Retrieves the details for an A/B test by its ID.\n *\n * Required API Key ACLs:\n * - analytics\n * @param getABTest - The getABTest object.\n * @param getABTest.id - Unique A/B test identifier.\n * @param getABTest.methods - Statistical analysis results to include, as a comma-separated list. When omitted, each test uses its configured method, or `frequentist` if no method is configured. Request both methods to include both sets of available results. This doesn\\'t change the test configuration or compute missing results. Duplicate values aren\\'t allowed.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getABTest({ id, methods }: GetABTestProps, requestOptions?: RequestOptions): Promise<ABTest> {\n validateRequired('id', 'getABTest', id);\n\n const requestPath = '/3/abtests/{id}'.replace('{id}', encodeURIComponent(id));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (methods !== undefined) {\n queryParameters['methods'] = methods.toString();\n }\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves the details for an A/B test by its ID.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n *\n * Required API Key ACLs:\n * - analytics\n * @param getABTest - The getABTest object.\n * @param getABTest.id - Unique A/B test identifier.\n * @param getABTest.methods - Statistical analysis results to include, as a comma-separated list. When omitted, each test uses its configured method, or `frequentist` if no method is configured. Request both methods to include both sets of available results. This doesn\\'t change the test configuration or compute missing results. Duplicate values aren\\'t allowed.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see getABTest for the plain version.\n */\n getABTestWithHTTPInfo(\n { id, methods }: GetABTestProps,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<ABTest>> {\n validateRequired('id', 'getABTestWithHTTPInfo', id);\n\n const requestPath = '/3/abtests/{id}'.replace('{id}', encodeURIComponent(id));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (methods !== undefined) {\n queryParameters['methods'] = methods.toString();\n }\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * Retrieves the settings captured for each variant of an A/B test, and whether another active A/B test is using the control index. Settings are captured by the `saveVariantSettings` operation. The response includes an entry for the control (variant 1) alongside the captured variant, so the control\\'s original configuration can be restored later. Returns `404` if the A/B test doesn\\'t exist or no settings have been captured for it.\n *\n * Required API Key ACLs:\n * - analytics\n * @param getABTestSettings - The getABTestSettings object.\n * @param getABTestSettings.id - Unique A/B test identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getABTestSettings(\n { id }: GetABTestSettingsProps,\n requestOptions?: RequestOptions,\n ): Promise<ABTestSettingsResponse> {\n validateRequired('id', 'getABTestSettings', id);\n\n const requestPath = '/3/abtests/{id}/settings'.replace('{id}', encodeURIComponent(id));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves the settings captured for each variant of an A/B test, and whether another active A/B test is using the control index. Settings are captured by the `saveVariantSettings` operation. The response includes an entry for the control (variant 1) alongside the captured variant, so the control\\'s original configuration can be restored later. Returns `404` if the A/B test doesn\\'t exist or no settings have been captured for it.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n *\n * Required API Key ACLs:\n * - analytics\n * @param getABTestSettings - The getABTestSettings object.\n * @param getABTestSettings.id - Unique A/B test identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see getABTestSettings for the plain version.\n */\n getABTestSettingsWithHTTPInfo(\n { id }: GetABTestSettingsProps,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<ABTestSettingsResponse>> {\n validateRequired('id', 'getABTestSettingsWithHTTPInfo', id);\n\n const requestPath = '/3/abtests/{id}/settings'.replace('{id}', encodeURIComponent(id));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * Retrieves timeseries for an A/B test by its ID.\n *\n * Required API Key ACLs:\n * - analytics\n * @param getTimeseries - The getTimeseries object.\n * @param getTimeseries.id - Unique A/B test identifier.\n * @param getTimeseries.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getTimeseries.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getTimeseries.metric - Metrics to retrieve, as a comma-separated list. If not specified, all metrics are returned.\n * @param getTimeseries.methods - Statistical analysis results to include, as a comma-separated list. When omitted, each test uses its configured method, or `frequentist` if no method is configured. Request both methods to include both sets of available results. This doesn\\'t change the test configuration or compute missing results. Duplicate values aren\\'t allowed.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getTimeseries(\n { id, startDate, endDate, metric, methods }: GetTimeseriesProps,\n requestOptions?: RequestOptions,\n ): Promise<Timeseries> {\n validateRequired('id', 'getTimeseries', id);\n\n const requestPath = '/3/abtests/{id}/timeseries'.replace('{id}', encodeURIComponent(id));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (startDate !== undefined) {\n queryParameters['startDate'] = startDate.toString();\n }\n\n if (endDate !== undefined) {\n queryParameters['endDate'] = endDate.toString();\n }\n\n if (metric !== undefined) {\n queryParameters['metric'] = metric.toString();\n }\n\n if (methods !== undefined) {\n queryParameters['methods'] = methods.toString();\n }\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves timeseries for an A/B test by its ID.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n *\n * Required API Key ACLs:\n * - analytics\n * @param getTimeseries - The getTimeseries object.\n * @param getTimeseries.id - Unique A/B test identifier.\n * @param getTimeseries.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getTimeseries.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getTimeseries.metric - Metrics to retrieve, as a comma-separated list. If not specified, all metrics are returned.\n * @param getTimeseries.methods - Statistical analysis results to include, as a comma-separated list. When omitted, each test uses its configured method, or `frequentist` if no method is configured. Request both methods to include both sets of available results. This doesn\\'t change the test configuration or compute missing results. Duplicate values aren\\'t allowed.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see getTimeseries for the plain version.\n */\n getTimeseriesWithHTTPInfo(\n { id, startDate, endDate, metric, methods }: GetTimeseriesProps,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<Timeseries>> {\n validateRequired('id', 'getTimeseriesWithHTTPInfo', id);\n\n const requestPath = '/3/abtests/{id}/timeseries'.replace('{id}', encodeURIComponent(id));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (startDate !== undefined) {\n queryParameters['startDate'] = startDate.toString();\n }\n\n if (endDate !== undefined) {\n queryParameters['endDate'] = endDate.toString();\n }\n\n if (metric !== undefined) {\n queryParameters['metric'] = metric.toString();\n }\n\n if (methods !== undefined) {\n queryParameters['methods'] = methods.toString();\n }\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * Lists all A/B tests you configured for this application.\n *\n * Required API Key ACLs:\n * - analytics\n * @param listABTests - The listABTests object.\n * @param listABTests.offset - Position of the first item to return.\n * @param listABTests.limit - Number of items to return.\n * @param listABTests.indexPrefix - Index name prefix. Only A/B tests for indices starting with this string are included in the response.\n * @param listABTests.indexSuffix - Index name suffix. Only A/B tests for indices ending with this string are included in the response.\n * @param listABTests.direction - Sort order for A/B tests by start date. Use \\'asc\\' for ascending or \\'desc\\' for descending. Active A/B tests are always listed first.\n * @param listABTests.methods - Statistical analysis results to include, as a comma-separated list. When omitted, each test uses its configured method, or `frequentist` if no method is configured. Request both methods to include both sets of available results. This doesn\\'t change the test configuration or compute missing results. Duplicate values aren\\'t allowed.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n listABTests(\n { offset, limit, indexPrefix, indexSuffix, direction, methods }: ListABTestsProps = {},\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise<ListABTestsResponse> {\n const requestPath = '/3/abtests';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (offset !== undefined) {\n queryParameters['offset'] = offset.toString();\n }\n\n if (limit !== undefined) {\n queryParameters['limit'] = limit.toString();\n }\n\n if (indexPrefix !== undefined) {\n queryParameters['indexPrefix'] = indexPrefix.toString();\n }\n\n if (indexSuffix !== undefined) {\n queryParameters['indexSuffix'] = indexSuffix.toString();\n }\n\n if (direction !== undefined) {\n queryParameters['direction'] = direction.toString();\n }\n\n if (methods !== undefined) {\n queryParameters['methods'] = methods.toString();\n }\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * Lists all A/B tests you configured for this application.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n *\n * Required API Key ACLs:\n * - analytics\n * @param listABTests - The listABTests object.\n * @param listABTests.offset - Position of the first item to return.\n * @param listABTests.limit - Number of items to return.\n * @param listABTests.indexPrefix - Index name prefix. Only A/B tests for indices starting with this string are included in the response.\n * @param listABTests.indexSuffix - Index name suffix. Only A/B tests for indices ending with this string are included in the response.\n * @param listABTests.direction - Sort order for A/B tests by start date. Use \\'asc\\' for ascending or \\'desc\\' for descending. Active A/B tests are always listed first.\n * @param listABTests.methods - Statistical analysis results to include, as a comma-separated list. When omitted, each test uses its configured method, or `frequentist` if no method is configured. Request both methods to include both sets of available results. This doesn\\'t change the test configuration or compute missing results. Duplicate values aren\\'t allowed.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see listABTests for the plain version.\n */\n listABTestsWithHTTPInfo(\n { offset, limit, indexPrefix, indexSuffix, direction, methods }: ListABTestsProps = {},\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise<AlgoliaHttpResponse<ListABTestsResponse>> {\n const requestPath = '/3/abtests';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (offset !== undefined) {\n queryParameters['offset'] = offset.toString();\n }\n\n if (limit !== undefined) {\n queryParameters['limit'] = limit.toString();\n }\n\n if (indexPrefix !== undefined) {\n queryParameters['indexPrefix'] = indexPrefix.toString();\n }\n\n if (indexSuffix !== undefined) {\n queryParameters['indexSuffix'] = indexSuffix.toString();\n }\n\n if (direction !== undefined) {\n queryParameters['direction'] = direction.toString();\n }\n\n if (methods !== undefined) {\n queryParameters['methods'] = methods.toString();\n }\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * Captures the settings of the given variant and of the control, then stops the A/B test. The captured settings can later be applied to the control index with the `applyVariantSettings` operation, and read back with the `getABTestSettings` operation. The A/B test must have reached 80% of its planned duration. Earlier requests return `400`. Settings can only be captured once per A/B test. A second request returns `409`. `synonyms` and `enableRules` are not captured, so applying the captured settings never changes them on the control index.\n *\n * Required API Key ACLs:\n * - analytics\n * - editSettings\n * @param saveVariantSettings - The saveVariantSettings object.\n * @param saveVariantSettings.id - Unique A/B test identifier.\n * @param saveVariantSettings.variantId - One-based index of the A/B test variant. The control is variant 1.\n * @param saveVariantSettings.saveSettingsRequest - The saveSettingsRequest object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n saveVariantSettings(\n { id, variantId, saveSettingsRequest }: SaveVariantSettingsProps,\n requestOptions?: RequestOptions,\n ): Promise<void> {\n validateRequired('id', 'saveVariantSettings', id);\n\n validateRequired('variantId', 'saveVariantSettings', variantId);\n\n validateRequired('saveSettingsRequest', 'saveVariantSettings', saveSettingsRequest);\n\n const requestPath = '/3/abtests/{id}/settings/{variantId}'\n .replace('{id}', encodeURIComponent(id))\n .replace('{variantId}', encodeURIComponent(variantId));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: saveSettingsRequest,\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * Captures the settings of the given variant and of the control, then stops the A/B test. The captured settings can later be applied to the control index with the `applyVariantSettings` operation, and read back with the `getABTestSettings` operation. The A/B test must have reached 80% of its planned duration. Earlier requests return `400`. Settings can only be captured once per A/B test. A second request returns `409`. `synonyms` and `enableRules` are not captured, so applying the captured settings never changes them on the control index.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n *\n * Required API Key ACLs:\n * - analytics\n * - editSettings\n * @param saveVariantSettings - The saveVariantSettings object.\n * @param saveVariantSettings.id - Unique A/B test identifier.\n * @param saveVariantSettings.variantId - One-based index of the A/B test variant. The control is variant 1.\n * @param saveVariantSettings.saveSettingsRequest - The saveSettingsRequest object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see saveVariantSettings for the plain version.\n */\n saveVariantSettingsWithHTTPInfo(\n { id, variantId, saveSettingsRequest }: SaveVariantSettingsProps,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<void>> {\n validateRequired('id', 'saveVariantSettingsWithHTTPInfo', id);\n\n validateRequired('variantId', 'saveVariantSettingsWithHTTPInfo', variantId);\n\n validateRequired('saveSettingsRequest', 'saveVariantSettingsWithHTTPInfo', saveSettingsRequest);\n\n const requestPath = '/3/abtests/{id}/settings/{variantId}'\n .replace('{id}', encodeURIComponent(id))\n .replace('{variantId}', encodeURIComponent(variantId));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: saveSettingsRequest,\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * Stops an A/B test by its ID. You can\\'t restart stopped A/B tests.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param stopABTest - The stopABTest object.\n * @param stopABTest.id - Unique A/B test identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n stopABTest({ id }: StopABTestProps, requestOptions?: RequestOptions): Promise<ABTestResponse> {\n validateRequired('id', 'stopABTest', id);\n\n const requestPath = '/3/abtests/{id}/stop'.replace('{id}', encodeURIComponent(id));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * Stops an A/B test by its ID. You can\\'t restart stopped A/B tests.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param stopABTest - The stopABTest object.\n * @param stopABTest.id - Unique A/B test identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see stopABTest for the plain version.\n */\n stopABTestWithHTTPInfo(\n { id }: StopABTestProps,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<ABTestResponse>> {\n validateRequired('id', 'stopABTestWithHTTPInfo', id);\n\n const requestPath = '/3/abtests/{id}/stop'.replace('{id}', encodeURIComponent(id));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n };\n}\n"],"mappings":";AAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,0BAA0B;;;ACGnC,SAAS,YAAY,mBAAmB,iBAAiB,wBAAwB;AA0B1E,IAAM,mBAAmB;AAEzB,IAAM,UAAU,CAAC,MAAM,IAAI;AAIlC,SAAS,gBAAgB,QAAqC;AAC5D,QAAM,MAAM,CAAC,SAAS,0BAA0B,iCAAiC,QAAQ,YAAY,MAAM;AAE3G,SAAO,CAAC,EAAE,KAAK,QAAQ,aAAa,UAAU,QAAQ,CAAC;AACzD;AAEO,SAAS,wBAAwB;AAAA,EACtC,OAAO;AAAA,EACP,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,GAAG;AACL,GAAwC;AACtC,QAAM,OAAO,WAAW,aAAa,cAAc,QAAQ;AAC3D,QAAM,cAAc,kBAAkB;AAAA,IACpC,OAAO,gBAAgB,YAAY;AAAA,IACnC,GAAG;AAAA,IACH,cAAc,gBAAgB;AAAA,MAC5B;AAAA,MACA,QAAQ;AAAA,MACR,SAAS;AAAA,IACX,CAAC;AAAA,IACD,aAAa;AAAA,MACX,gBAAgB;AAAA,MAChB,GAAG,KAAK,QAAQ;AAAA,MAChB,GAAG,Q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A,QACA,QACA,SACmB;AACnB,MAAI,CAAC,SAAS,OAAO,UAAU,UAAU;AACvC,UAAM,IAAI,MAAM,qBAAqB;AAAA,EACvC;AAEA,MAAI,CAAC,UAAU,OAAO,WAAW,UAAU;AACzC,UAAM,IAAI,MAAM,sBAAsB;AAAA,EACxC;AAEA,MAAI,WAAW,OAAO,WAAW,YAAY,CAAC,QAAQ,SAAS,MAAM,IAAI;AACvE,UAAM,IAAI,MAAM,4CAA4C,QAAQ,KAAK,IAAI,CAAC,EAAE;AAAA,EAClF;AAEA,QAAM,EAAE,aAAa,cAAc,GAAG,eAAe,IAAI,WAAW,CAAC;AAErE,SAAO,wBAAwB;AAAA,IAC7B;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,MACR,SAAS;AAAA,MACT,MAAM;AAAA,MACN,OAAO;AAAA,IACT;AAAA,IACA,QAAQ,iBAAiB;AAAA,IACzB,WAAW,mBAAmB;AAAA,IAC9B,eAAe,CAAC,EAAE,SAAS,UAAU,CAAC;AAAA,IACtC,UAAU;AAAA,IACV,gBAAgB,kBAAkB;AAAA,IAClC,eAAe,kBAAkB,EAAE,cAAc,MAAM,CAAC;AAAA,IACxD,YAAY,wBAAwB;AAAA,MAClC,QAAQ,CAAC,+BAA+B,EAAE,KAAK,GAAG,gBAAgB,IAAI,KAAK,GAAG,CAAC,GAAG,kBAAkB,CAAC;AAAA,IACvG,CAAC;AAAA,IACD,GAAG;AAAA,EACL,CAAC;AACH;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../builds/browser.ts","../../src/abtestingV3Client.ts"],"sourcesContent":["// 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.\n\nimport {\n createBrowserLocalStorageCache,\n createFallbackableCache,\n createMemoryCache,\n createNullLogger,\n} from '@algolia/client-common';\nimport { createXhrRequester } from '@algolia/requester-browser-xhr';\n\nimport type { ClientOptions } from '@algolia/client-common';\n\nimport { apiClientVersion, createAbtestingV3Client } from '../src/abtestingV3Client';\n\nimport type { Region } from '../src/abtestingV3Client';\nimport { REGIONS } from '../src/abtestingV3Client';\n\nexport type { Region, RegionOptions } from '../src/abtestingV3Client';\n\nexport { apiClientVersion } from '../src/abtestingV3Client';\n\nexport * from '../model';\n\nexport function abtestingV3Client(\n appId: string,\n apiKey: string,\n region?: Region | undefined,\n options?: ClientOptions | undefined,\n): AbtestingV3Client {\n if (!appId || typeof appId !== 'string') {\n throw new Error('`appId` is missing.');\n }\n\n if (!apiKey || typeof apiKey !== 'string') {\n throw new Error('`apiKey` is missing.');\n }\n\n if (region && (typeof region !== 'string' || !REGIONS.includes(region))) {\n throw new Error(`\\`region\\` must be one of the following: ${REGIONS.join(', ')}`);\n }\n\n const { compression: _compression, ...browserOptions } = options || {};\n\n return createAbtestingV3Client({\n appId,\n apiKey,\n region,\n timeouts: {\n connect: 1000,\n read: 2000,\n write: 30000,\n },\n logger: createNullLogger(),\n requester: createXhrRequester(),\n algoliaAgents: [{ segment: 'Browser' }],\n authMode: 'WithinQueryParameters',\n responsesCache: createMemoryCache(),\n requestsCache: createMemoryCache({ serializable: false }),\n hostsCache: createFallbackableCache({\n caches: [createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }), createMemoryCache()],\n }),\n ...browserOptions,\n });\n}\n\nexport type AbtestingV3Client = ReturnType<typeof createAbtestingV3Client>;\n","// 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.\n\nimport type {\n AlgoliaHttpResponse,\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\nimport { createAuth, createTransporter, getAlgoliaAgent, validateRequired } from '@algolia/client-common';\n\nimport type { ABTest } from '../model/aBTest';\nimport type { ABTestResponse } from '../model/aBTestResponse';\nimport type { ABTestSettingsResponse } from '../model/aBTestSettingsResponse';\nimport type { AddABTestsRequest } from '../model/addABTestsRequest';\nimport type { EstimateABTestRequest } from '../model/estimateABTestRequest';\nimport type { EstimateABTestResponse } from '../model/estimateABTestResponse';\nimport type { ListABTestsResponse } from '../model/listABTestsResponse';\nimport type { Timeseries } from '../model/timeseries';\n\nimport type {\n ApplyVariantSettingsProps,\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteABTestProps,\n GetABTestProps,\n GetABTestSettingsProps,\n GetTimeseriesProps,\n ListABTestsProps,\n SaveVariantSettingsProps,\n StopABTestProps,\n} from '../model/clientMethodProps';\n\nexport const apiClientVersion = '1.30.0';\n\nexport const REGIONS = ['de', 'us'] as const;\nexport type Region = (typeof REGIONS)[number];\nexport type RegionOptions = { region?: Region | undefined };\n\nfunction getDefaultHosts(region?: Region | undefined): Host[] {\n const url = !region ? 'analytics.algolia.com' : 'analytics.{region}.algolia.com'.replace('{region}', region);\n\n return [{ url, accept: 'readWrite', protocol: 'https' }];\n}\n\nexport function createAbtestingV3Client({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n region: regionOption,\n ...options\n}: CreateClientOptions & RegionOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(regionOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'AbtestingV3',\n version: apiClientVersion,\n }),\n baseHeaders: {\n 'content-type': 'text/plain',\n ...auth.headers(),\n ...options.baseHeaders,\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters,\n },\n });\n\n return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * The `apiKey` currently in use.\n */\n apiKey: apiKeyOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string | undefined): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * Helper method to switch the API key used to authenticate the requests.\n *\n * @param params - Method params.\n * @param params.apiKey - The new API Key to use.\n */\n setClientApiKey({ apiKey }: { apiKey: string }): void {\n if (!authMode || authMode === 'WithinHeaders') {\n transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n } else {\n transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;\n }\n },\n\n /**\n * Creates a new A/B test.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param addABTestsRequest - The addABTestsRequest object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n addABTests(addABTestsRequest: AddABTestsRequest, requestOptions?: RequestOptions): Promise<ABTestResponse> {\n validateRequired('addABTestsRequest', 'addABTests', addABTestsRequest);\n\n validateRequired('addABTestsRequest.name', 'addABTests', addABTestsRequest.name);\n validateRequired('addABTestsRequest.variants', 'addABTests', addABTestsRequest.variants);\n validateRequired('addABTestsRequest.metrics', 'addABTests', addABTestsRequest.metrics);\n validateRequired('addABTestsRequest.endAt', 'addABTests', addABTestsRequest.endAt);\n\n const requestPath = '/3/abtests';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: addABTestsRequest,\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * Creates a new A/B test.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param addABTestsRequest - The addABTestsRequest object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see addABTests for the plain version.\n */\n addABTestsWithHTTPInfo(\n addABTestsRequest: AddABTestsRequest,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<ABTestResponse>> {\n validateRequired('addABTestsRequest', 'addABTestsWithHTTPInfo', addABTestsRequest);\n\n validateRequired('addABTestsRequest.name', 'addABTestsWithHTTPInfo', addABTestsRequest.name);\n validateRequired('addABTestsRequest.variants', 'addABTestsWithHTTPInfo', addABTestsRequest.variants);\n validateRequired('addABTestsRequest.metrics', 'addABTestsWithHTTPInfo', addABTestsRequest.metrics);\n validateRequired('addABTestsRequest.endAt', 'addABTestsWithHTTPInfo', addABTestsRequest.endAt);\n\n const requestPath = '/3/abtests';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: addABTestsRequest,\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * Applies the captured settings of the given variant to the control index. The settings must first be captured with the `saveVariantSettings` operation. To revert previously applied settings on the control index, use this operation with the control variant (variant 1). Settings can be applied up to 14 days after the A/B test ends, and reverted up to 15 days after. Later requests return `400`. Each set of captured settings can only be applied once, and settings that were reverted can\\'t be applied again. Both cases return `400`. The control index must not be in use by an active A/B test. Otherwise, the request returns `422`.\n *\n * Required API Key ACLs:\n * - analytics\n * - editSettings\n * @param applyVariantSettings - The applyVariantSettings object.\n * @param applyVariantSettings.id - Unique A/B test identifier.\n * @param applyVariantSettings.variantId - One-based index of the A/B test variant. The control is variant 1.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n applyVariantSettings({ id, variantId }: ApplyVariantSettingsProps, requestOptions?: RequestOptions): Promise<void> {\n validateRequired('id', 'applyVariantSettings', id);\n\n validateRequired('variantId', 'applyVariantSettings', variantId);\n\n const requestPath = '/3/abtests/{id}/settings/{variantId}/apply'\n .replace('{id}', encodeURIComponent(id))\n .replace('{variantId}', encodeURIComponent(variantId));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * Applies the captured settings of the given variant to the control index. The settings must first be captured with the `saveVariantSettings` operation. To revert previously applied settings on the control index, use this operation with the control variant (variant 1). Settings can be applied up to 14 days after the A/B test ends, and reverted up to 15 days after. Later requests return `400`. Each set of captured settings can only be applied once, and settings that were reverted can\\'t be applied again. Both cases return `400`. The control index must not be in use by an active A/B test. Otherwise, the request returns `422`.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n *\n * Required API Key ACLs:\n * - analytics\n * - editSettings\n * @param applyVariantSettings - The applyVariantSettings object.\n * @param applyVariantSettings.id - Unique A/B test identifier.\n * @param applyVariantSettings.variantId - One-based index of the A/B test variant. The control is variant 1.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see applyVariantSettings for the plain version.\n */\n applyVariantSettingsWithHTTPInfo(\n { id, variantId }: ApplyVariantSettingsProps,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<void>> {\n validateRequired('id', 'applyVariantSettingsWithHTTPInfo', id);\n\n validateRequired('variantId', 'applyVariantSettingsWithHTTPInfo', variantId);\n\n const requestPath = '/3/abtests/{id}/settings/{variantId}/apply'\n .replace('{id}', encodeURIComponent(id))\n .replace('{variantId}', encodeURIComponent(variantId));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, for example `1/newFeature`.\n * @param customDelete.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customDelete(\n { path, parameters }: CustomDeleteProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n validateRequired('path', 'customDelete', path);\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * This method lets you send requests to the Algolia REST API.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, for example `1/newFeature`.\n * @param customDelete.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see customDelete for the plain version.\n */\n customDeleteWithHTTPInfo(\n { path, parameters }: CustomDeleteProps,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<Record<string, unknown>>> {\n validateRequired('path', 'customDeleteWithHTTPInfo', path);\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, for example `1/newFeature`.\n * @param customGet.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>> {\n validateRequired('path', 'customGet', path);\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * This method lets you send requests to the Algolia REST API.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, for example `1/newFeature`.\n * @param customGet.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see customGet for the plain version.\n */\n customGetWithHTTPInfo(\n { path, parameters }: CustomGetProps,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<Record<string, unknown>>> {\n validateRequired('path', 'customGetWithHTTPInfo', path);\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, for example `1/newFeature`.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n validateRequired('path', 'customPost', path);\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * This method lets you send requests to the Algolia REST API.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, for example `1/newFeature`.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see customPost for the plain version.\n */\n customPostWithHTTPInfo(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<Record<string, unknown>>> {\n validateRequired('path', 'customPostWithHTTPInfo', path);\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, for example `1/newFeature`.\n * @param customPut.parameters - Query parameters to apply to the current query.\n * @param customPut.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPut(\n { path, parameters, body }: CustomPutProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n validateRequired('path', 'customPut', path);\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * This method lets you send requests to the Algolia REST API.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, for example `1/newFeature`.\n * @param customPut.parameters - Query parameters to apply to the current query.\n * @param customPut.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see customPut for the plain version.\n */\n customPutWithHTTPInfo(\n { path, parameters, body }: CustomPutProps,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<Record<string, unknown>>> {\n validateRequired('path', 'customPutWithHTTPInfo', path);\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * Deletes an A/B test by its ID.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param deleteABTest - The deleteABTest object.\n * @param deleteABTest.id - Unique A/B test identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteABTest({ id }: DeleteABTestProps, requestOptions?: RequestOptions): Promise<ABTestResponse> {\n validateRequired('id', 'deleteABTest', id);\n\n const requestPath = '/3/abtests/{id}'.replace('{id}', encodeURIComponent(id));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * Deletes an A/B test by its ID.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param deleteABTest - The deleteABTest object.\n * @param deleteABTest.id - Unique A/B test identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see deleteABTest for the plain version.\n */\n deleteABTestWithHTTPInfo(\n { id }: DeleteABTestProps,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<ABTestResponse>> {\n validateRequired('id', 'deleteABTestWithHTTPInfo', id);\n\n const requestPath = '/3/abtests/{id}'.replace('{id}', encodeURIComponent(id));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * Given the traffic percentage and the expected effect size, this endpoint estimates the sample size and duration of an A/B test based on historical traffic.\n *\n * Required API Key ACLs:\n * - analytics\n * @param estimateABTestRequest - The estimateABTestRequest object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n estimateABTest(\n estimateABTestRequest: EstimateABTestRequest,\n requestOptions?: RequestOptions,\n ): Promise<EstimateABTestResponse> {\n validateRequired('estimateABTestRequest', 'estimateABTest', estimateABTestRequest);\n\n validateRequired('estimateABTestRequest.configuration', 'estimateABTest', estimateABTestRequest.configuration);\n validateRequired('estimateABTestRequest.variants', 'estimateABTest', estimateABTestRequest.variants);\n\n const requestPath = '/3/abtests/estimate';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: estimateABTestRequest,\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * Given the traffic percentage and the expected effect size, this endpoint estimates the sample size and duration of an A/B test based on historical traffic.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n *\n * Required API Key ACLs:\n * - analytics\n * @param estimateABTestRequest - The estimateABTestRequest object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see estimateABTest for the plain version.\n */\n estimateABTestWithHTTPInfo(\n estimateABTestRequest: EstimateABTestRequest,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<EstimateABTestResponse>> {\n validateRequired('estimateABTestRequest', 'estimateABTestWithHTTPInfo', estimateABTestRequest);\n\n validateRequired(\n 'estimateABTestRequest.configuration',\n 'estimateABTestWithHTTPInfo',\n estimateABTestRequest.configuration,\n );\n validateRequired('estimateABTestRequest.variants', 'estimateABTestWithHTTPInfo', estimateABTestRequest.variants);\n\n const requestPath = '/3/abtests/estimate';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: estimateABTestRequest,\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * Retrieves the details for an A/B test by its ID.\n *\n * Required API Key ACLs:\n * - analytics\n * @param getABTest - The getABTest object.\n * @param getABTest.id - Unique A/B test identifier.\n * @param getABTest.methods - Statistical analysis results to include, as a comma-separated list. When omitted, each test uses its configured method, or `frequentist` if no method is configured. Request both methods to include both sets of available results. This doesn\\'t change the test configuration or compute missing results. Duplicate values aren\\'t allowed.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getABTest({ id, methods }: GetABTestProps, requestOptions?: RequestOptions): Promise<ABTest> {\n validateRequired('id', 'getABTest', id);\n\n const requestPath = '/3/abtests/{id}'.replace('{id}', encodeURIComponent(id));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (methods !== undefined) {\n queryParameters['methods'] = methods.toString();\n }\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves the details for an A/B test by its ID.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n *\n * Required API Key ACLs:\n * - analytics\n * @param getABTest - The getABTest object.\n * @param getABTest.id - Unique A/B test identifier.\n * @param getABTest.methods - Statistical analysis results to include, as a comma-separated list. When omitted, each test uses its configured method, or `frequentist` if no method is configured. Request both methods to include both sets of available results. This doesn\\'t change the test configuration or compute missing results. Duplicate values aren\\'t allowed.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see getABTest for the plain version.\n */\n getABTestWithHTTPInfo(\n { id, methods }: GetABTestProps,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<ABTest>> {\n validateRequired('id', 'getABTestWithHTTPInfo', id);\n\n const requestPath = '/3/abtests/{id}'.replace('{id}', encodeURIComponent(id));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (methods !== undefined) {\n queryParameters['methods'] = methods.toString();\n }\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * Retrieves the settings captured for each variant of an A/B test, and whether another active A/B test is using the control index. Settings are captured by the `saveVariantSettings` operation. The response includes an entry for the control (variant 1) alongside the captured variant, so the control\\'s original configuration can be restored later. Returns `404` if the A/B test doesn\\'t exist or no settings have been captured for it.\n *\n * Required API Key ACLs:\n * - analytics\n * @param getABTestSettings - The getABTestSettings object.\n * @param getABTestSettings.id - Unique A/B test identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getABTestSettings(\n { id }: GetABTestSettingsProps,\n requestOptions?: RequestOptions,\n ): Promise<ABTestSettingsResponse> {\n validateRequired('id', 'getABTestSettings', id);\n\n const requestPath = '/3/abtests/{id}/settings'.replace('{id}', encodeURIComponent(id));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves the settings captured for each variant of an A/B test, and whether another active A/B test is using the control index. Settings are captured by the `saveVariantSettings` operation. The response includes an entry for the control (variant 1) alongside the captured variant, so the control\\'s original configuration can be restored later. Returns `404` if the A/B test doesn\\'t exist or no settings have been captured for it.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n *\n * Required API Key ACLs:\n * - analytics\n * @param getABTestSettings - The getABTestSettings object.\n * @param getABTestSettings.id - Unique A/B test identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see getABTestSettings for the plain version.\n */\n getABTestSettingsWithHTTPInfo(\n { id }: GetABTestSettingsProps,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<ABTestSettingsResponse>> {\n validateRequired('id', 'getABTestSettingsWithHTTPInfo', id);\n\n const requestPath = '/3/abtests/{id}/settings'.replace('{id}', encodeURIComponent(id));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * Retrieves timeseries for an A/B test by its ID.\n *\n * Required API Key ACLs:\n * - analytics\n * @param getTimeseries - The getTimeseries object.\n * @param getTimeseries.id - Unique A/B test identifier.\n * @param getTimeseries.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getTimeseries.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getTimeseries.metric - Metrics to retrieve, as a comma-separated list. If not specified, all metrics are returned.\n * @param getTimeseries.methods - Statistical analysis results to include, as a comma-separated list. When omitted, each test uses its configured method, or `frequentist` if no method is configured. Request both methods to include both sets of available results. This doesn\\'t change the test configuration or compute missing results. Duplicate values aren\\'t allowed.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getTimeseries(\n { id, startDate, endDate, metric, methods }: GetTimeseriesProps,\n requestOptions?: RequestOptions,\n ): Promise<Timeseries> {\n validateRequired('id', 'getTimeseries', id);\n\n const requestPath = '/3/abtests/{id}/timeseries'.replace('{id}', encodeURIComponent(id));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (startDate !== undefined) {\n queryParameters['startDate'] = startDate.toString();\n }\n\n if (endDate !== undefined) {\n queryParameters['endDate'] = endDate.toString();\n }\n\n if (metric !== undefined) {\n queryParameters['metric'] = metric.toString();\n }\n\n if (methods !== undefined) {\n queryParameters['methods'] = methods.toString();\n }\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves timeseries for an A/B test by its ID.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n *\n * Required API Key ACLs:\n * - analytics\n * @param getTimeseries - The getTimeseries object.\n * @param getTimeseries.id - Unique A/B test identifier.\n * @param getTimeseries.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getTimeseries.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getTimeseries.metric - Metrics to retrieve, as a comma-separated list. If not specified, all metrics are returned.\n * @param getTimeseries.methods - Statistical analysis results to include, as a comma-separated list. When omitted, each test uses its configured method, or `frequentist` if no method is configured. Request both methods to include both sets of available results. This doesn\\'t change the test configuration or compute missing results. Duplicate values aren\\'t allowed.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see getTimeseries for the plain version.\n */\n getTimeseriesWithHTTPInfo(\n { id, startDate, endDate, metric, methods }: GetTimeseriesProps,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<Timeseries>> {\n validateRequired('id', 'getTimeseriesWithHTTPInfo', id);\n\n const requestPath = '/3/abtests/{id}/timeseries'.replace('{id}', encodeURIComponent(id));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (startDate !== undefined) {\n queryParameters['startDate'] = startDate.toString();\n }\n\n if (endDate !== undefined) {\n queryParameters['endDate'] = endDate.toString();\n }\n\n if (metric !== undefined) {\n queryParameters['metric'] = metric.toString();\n }\n\n if (methods !== undefined) {\n queryParameters['methods'] = methods.toString();\n }\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * Lists all A/B tests you configured for this application.\n *\n * Required API Key ACLs:\n * - analytics\n * @param listABTests - The listABTests object.\n * @param listABTests.offset - Position of the first item to return.\n * @param listABTests.limit - Number of items to return.\n * @param listABTests.indexPrefix - Index name prefix. Only A/B tests for indices starting with this string are included in the response.\n * @param listABTests.indexSuffix - Index name suffix. Only A/B tests for indices ending with this string are included in the response.\n * @param listABTests.direction - Sort order for A/B tests by start date. Use \\'asc\\' for ascending or \\'desc\\' for descending. Active A/B tests are always listed first.\n * @param listABTests.methods - Statistical analysis results to include, as a comma-separated list. When omitted, each test uses its configured method, or `frequentist` if no method is configured. Request both methods to include both sets of available results. This doesn\\'t change the test configuration or compute missing results. Duplicate values aren\\'t allowed.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n listABTests(\n { offset, limit, indexPrefix, indexSuffix, direction, methods }: ListABTestsProps = {},\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise<ListABTestsResponse> {\n const requestPath = '/3/abtests';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (offset !== undefined) {\n queryParameters['offset'] = offset.toString();\n }\n\n if (limit !== undefined) {\n queryParameters['limit'] = limit.toString();\n }\n\n if (indexPrefix !== undefined) {\n queryParameters['indexPrefix'] = indexPrefix.toString();\n }\n\n if (indexSuffix !== undefined) {\n queryParameters['indexSuffix'] = indexSuffix.toString();\n }\n\n if (direction !== undefined) {\n queryParameters['direction'] = direction.toString();\n }\n\n if (methods !== undefined) {\n queryParameters['methods'] = methods.toString();\n }\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * Lists all A/B tests you configured for this application.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n *\n * Required API Key ACLs:\n * - analytics\n * @param listABTests - The listABTests object.\n * @param listABTests.offset - Position of the first item to return.\n * @param listABTests.limit - Number of items to return.\n * @param listABTests.indexPrefix - Index name prefix. Only A/B tests for indices starting with this string are included in the response.\n * @param listABTests.indexSuffix - Index name suffix. Only A/B tests for indices ending with this string are included in the response.\n * @param listABTests.direction - Sort order for A/B tests by start date. Use \\'asc\\' for ascending or \\'desc\\' for descending. Active A/B tests are always listed first.\n * @param listABTests.methods - Statistical analysis results to include, as a comma-separated list. When omitted, each test uses its configured method, or `frequentist` if no method is configured. Request both methods to include both sets of available results. This doesn\\'t change the test configuration or compute missing results. Duplicate values aren\\'t allowed.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see listABTests for the plain version.\n */\n listABTestsWithHTTPInfo(\n { offset, limit, indexPrefix, indexSuffix, direction, methods }: ListABTestsProps = {},\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise<AlgoliaHttpResponse<ListABTestsResponse>> {\n const requestPath = '/3/abtests';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (offset !== undefined) {\n queryParameters['offset'] = offset.toString();\n }\n\n if (limit !== undefined) {\n queryParameters['limit'] = limit.toString();\n }\n\n if (indexPrefix !== undefined) {\n queryParameters['indexPrefix'] = indexPrefix.toString();\n }\n\n if (indexSuffix !== undefined) {\n queryParameters['indexSuffix'] = indexSuffix.toString();\n }\n\n if (direction !== undefined) {\n queryParameters['direction'] = direction.toString();\n }\n\n if (methods !== undefined) {\n queryParameters['methods'] = methods.toString();\n }\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * Captures the settings of the given variant and of the control, then stops the A/B test. The captured settings can later be applied to the control index with the `applyVariantSettings` operation, and read back with the `getABTestSettings` operation. The A/B test must have reached 80% of its planned duration. Earlier requests return `400`. Settings can only be captured once per A/B test. A second request returns `409`. `synonyms` and `enableRules` are not captured, so applying the captured settings never changes them on the control index.\n *\n * Required API Key ACLs:\n * - analytics\n * - editSettings\n * @param saveVariantSettings - The saveVariantSettings object.\n * @param saveVariantSettings.id - Unique A/B test identifier.\n * @param saveVariantSettings.variantId - One-based index of the A/B test variant. The control is variant 1.\n * @param saveVariantSettings.saveSettingsRequest - The saveSettingsRequest object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n saveVariantSettings(\n { id, variantId, saveSettingsRequest }: SaveVariantSettingsProps,\n requestOptions?: RequestOptions,\n ): Promise<void> {\n validateRequired('id', 'saveVariantSettings', id);\n\n validateRequired('variantId', 'saveVariantSettings', variantId);\n\n validateRequired('saveSettingsRequest', 'saveVariantSettings', saveSettingsRequest);\n\n const requestPath = '/3/abtests/{id}/settings/{variantId}'\n .replace('{id}', encodeURIComponent(id))\n .replace('{variantId}', encodeURIComponent(variantId));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: saveSettingsRequest,\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * Captures the settings of the given variant and of the control, then stops the A/B test. The captured settings can later be applied to the control index with the `applyVariantSettings` operation, and read back with the `getABTestSettings` operation. The A/B test must have reached 80% of its planned duration. Earlier requests return `400`. Settings can only be captured once per A/B test. A second request returns `409`. `synonyms` and `enableRules` are not captured, so applying the captured settings never changes them on the control index.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n *\n * Required API Key ACLs:\n * - analytics\n * - editSettings\n * @param saveVariantSettings - The saveVariantSettings object.\n * @param saveVariantSettings.id - Unique A/B test identifier.\n * @param saveVariantSettings.variantId - One-based index of the A/B test variant. The control is variant 1.\n * @param saveVariantSettings.saveSettingsRequest - The saveSettingsRequest object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see saveVariantSettings for the plain version.\n */\n saveVariantSettingsWithHTTPInfo(\n { id, variantId, saveSettingsRequest }: SaveVariantSettingsProps,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<void>> {\n validateRequired('id', 'saveVariantSettingsWithHTTPInfo', id);\n\n validateRequired('variantId', 'saveVariantSettingsWithHTTPInfo', variantId);\n\n validateRequired('saveSettingsRequest', 'saveVariantSettingsWithHTTPInfo', saveSettingsRequest);\n\n const requestPath = '/3/abtests/{id}/settings/{variantId}'\n .replace('{id}', encodeURIComponent(id))\n .replace('{variantId}', encodeURIComponent(variantId));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: saveSettingsRequest,\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n\n /**\n * Stops an A/B test by its ID. You can\\'t restart stopped A/B tests.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param stopABTest - The stopABTest object.\n * @param stopABTest.id - Unique A/B test identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n stopABTest({ id }: StopABTestProps, requestOptions?: RequestOptions): Promise<ABTestResponse> {\n validateRequired('id', 'stopABTest', id);\n\n const requestPath = '/3/abtests/{id}/stop'.replace('{id}', encodeURIComponent(id));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n /**\n * Stops an A/B test by its ID. You can\\'t restart stopped A/B tests.\n *\n * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param stopABTest - The stopABTest object.\n * @param stopABTest.id - Unique A/B test identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n * @see stopABTest for the plain version.\n */\n stopABTestWithHTTPInfo(\n { id }: StopABTestProps,\n requestOptions?: RequestOptions,\n ): Promise<AlgoliaHttpResponse<ABTestResponse>> {\n validateRequired('id', 'stopABTestWithHTTPInfo', id);\n\n const requestPath = '/3/abtests/{id}/stop'.replace('{id}', encodeURIComponent(id));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.requestWithHttpInfo(request, requestOptions);\n },\n };\n}\n"],"mappings":";AAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,0BAA0B;;;ACGnC,SAAS,YAAY,mBAAmB,iBAAiB,wBAAwB;AA0B1E,IAAM,mBAAmB;AAEzB,IAAM,UAAU,CAAC,MAAM,IAAI;AAIlC,SAAS,gBAAgB,QAAqC;AAC5D,QAAM,MAAM,CAAC,SAAS,0BAA0B,iCAAiC,QAAQ,YAAY,MAAM;AAE3G,SAAO,CAAC,EAAE,KAAK,QAAQ,aAAa,UAAU,QAAQ,CAAC;AACzD;AAEO,SAAS,wBAAwB;AAAA,EACtC,OAAO;AAAA,EACP,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,GAAG;AACL,GAAwC;AACtC,QAAM,OAAO,WAAW,aAAa,cAAc,QAAQ;AAC3D,QAAM,cAAc,kBAAkB;AAAA,IACpC,OAAO,gBAAgB,YAAY;AAAA,IACnC,GAAG;AAAA,IACH,cAAc,gBAAgB;AAAA,MAC5B;AAAA,MACA,QAAQ;AAAA,MACR,SAAS;AAAA,IACX,CAAC;AAAA,IACD,aAAa;AAAA,MACX,gBAAgB;AAAA,MAChB,GAAG,KAAK,QAAQ;AAAA,MAChB,GAAG,QAAQ;AAAA,IACb;AAAA,IACA,qBAAqB;AAAA,MACnB,GAAG,KAAK,gBAAgB;AAAA,MACxB,GAAG,QAAQ;AAAA,IACb;AAAA,EACF,CAAC;AAED,SAAO;AAAA,IACL;AAAA;AAAA;AAAA;AAAA,IAKA,OAAO;AAAA;AAAA;AAAA;AAAA,IAKP,QAAQ;AAAA;AAAA;AAAA;AAAA,IAKR,aAA4B;AAC1B,aAAO,QAAQ,IAAI,CAAC,YAAY,cAAc,MAAM,GAAG,YAAY,eAAe,MAAM,CAAC,CAAC,EAAE,KAAK,MA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Aa,cAAc,GAAG,eAAe,IAAI,WAAW,CAAC;AAErE,SAAO,wBAAwB;AAAA,IAC7B;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,MACR,SAAS;AAAA,MACT,MAAM;AAAA,MACN,OAAO;AAAA,IACT;AAAA,IACA,QAAQ,iBAAiB;AAAA,IACzB,WAAW,mBAAmB;AAAA,IAC9B,eAAe,CAAC,EAAE,SAAS,UAAU,CAAC;AAAA,IACtC,UAAU;AAAA,IACV,gBAAgB,kBAAkB;AAAA,IAClC,eAAe,kBAAkB,EAAE,cAAc,MAAM,CAAC;AAAA,IACxD,YAAY,wBAAwB;AAAA,MAClC,QAAQ,CAAC,+BAA+B,EAAE,KAAK,GAAG,gBAAgB,IAAI,KAAK,GAAG,CAAC,GAAG,kBAAkB,CAAC;AAAA,IACvG,CAAC;AAAA,IACD,GAAG;AAAA,EACL,CAAC;AACH;","names":[]}
|
|
@@ -2,5 +2,5 @@ function de(e){let t,s=`algolia-client-js-${e.key}`;function n(){return t===void
|
|
|
2
2
|
`&&(o=1));o<r.length;){let a=r.indexOf("\r",o),u=r.indexOf(`
|
|
3
3
|
`,o);if(a===-1&&u===-1){let R=r.slice(o);if(s.push(R),n+=R.length,n>Ie)throw new Error("SSE line buffer exceeded 10MB");break}let l,i;a!==-1&&(u===-1||a<u)?(l=a,a+1<r.length?i=r[a+1]===`
|
|
4
4
|
`?2:1:(d=!0,i=1)):(l=u,i=1);let p=r.slice(o,l);s.push(p);let T=s.length===1?s[0]:s.join("");s.length=0,n=0,P&&(T.startsWith("\uFEFF")&&(T=T.slice(1)),P=!1),yield T,o=l+i}}let y=t.decode();if(y&&s.push(y),s.length>0){let c=s.join("");P&&c.startsWith("\uFEFF")&&(c=c.slice(1)),yield c}}var be=class{data=[];eventType="";lastEventId=null;retry=null;decode(e){if(e==="")return this.dispatch();if(e[0]===":")return null;let t=e.indexOf(":"),s,n;switch(t===-1?(s=e,n=""):(s=e.slice(0,t),n=e.slice(t+1),n[0]===" "&&(n=n.slice(1))),s){case"data":this.data.push(n);break;case"event":this.eventType=n;break;case"id":n.includes("\0")||(this.lastEventId=n);break;case"retry":/^[0-9]+$/.test(n)&&(this.retry=parseInt(n,10));break}return null}dispatch(){let e=this.eventType;if(this.eventType="",this.data.length===0)return null;let t={data:this.data.join(`
|
|
5
|
-
`),event:e,id:this.lastEventId,retry:this.retry};return this.data=[],t}};async function*we(e){let t=new be;for await(let s of xe(e)){let n=t.decode(s);n!==null&&(yield n)}}var Be=750,ee=120*1e3;function te(e,t="up"){let s=Date.now();function n(){return t==="up"||Date.now()-s>ee}function d(){return t==="timed out"&&Date.now()-s<=ee}return{...e,status:t,lastUpdate:s,isUp:n,isTimedOut:d}}var he=class extends Error{name="AlgoliaError";constructor(e,t){super(e),t&&(this.name=t)}};var fe=class extends he{stackTrace;correlationId;constructor(e,t,s,n){super(n?`${e} (Correlation-ID: ${n})`:e,s),this.stackTrace=t,this.correlationId=n}},re=class extends fe{constructor(e,t){super("Unreachable hosts - your application id may be incorrect. If the error persists, please visit our help center https://alg.li/support-unreachable-hosts or reach out to the Algolia Support team: https://alg.li/support",e,"RetryError",t)}},J=class extends fe{status;constructor(e,t,s,n="ApiError",d){super(e,s,n,d),this.status=t}};var Oe=class extends he{response;correlationId;constructor(e,t,s){super(s?`${e} (Correlation-ID: ${s})`:e,"DeserializationError"),this.response=t,this.correlationId=s}},Ce=class extends J{error;constructor(e,t,s,n,d){super(e,t,n,"DetailedApiError",d),this.error=s}};function se(e,t,s){let n=We(s),d=`${e.protocol}://${e.url}${e.port?`:${e.port}`:""}/${t.charAt(0)==="/"?t.substring(1):t}`;return n.length&&(d+=`?${n}`),d}function We(e){return Object.keys(e).filter(t=>e[t]!==void 0).sort().map(t=>`${t}=${encodeURIComponent(Object.prototype.toString.call(e[t])==="[object Array]"?e[t].join(","):e[t]).replace(/\+/g,"%20")}`).join("&")}function ne(e,t){if(e.method==="GET"||e.data===void 0&&t.data===void 0)return;let s=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(s)}function oe(e,t,s){let n={Accept:"application/json",...e,...t,...s},d={};return Object.keys(n).forEach(P=>{let y=n[P];d[P.toLowerCase()]=y}),d}function Pe(e){if(!(e.status===204||e.content.length===0))try{return JSON.parse(e.content)}catch(t){throw new Oe(t.message,e,K(e.headers))}}function Le(e){return{status:e.status,headers:e.headers,content:e.content,data:Pe(e)}}function K(e){if(!e)return;if(e["correlation-id"]!==void 0)return e["correlation-id"];let t=Object.keys(e).find(s=>s.toLowerCase()==="correlation-id");return t===void 0?void 0:e[t]}function _e(e){for(let t=e.length-1;t>=0;t--){let s=K(e[t].response.headers);if(s!==void 0)return s}}function De(e,t){let{content:s,status:n}=e,d=K(e.headers);try{let P=JSON.parse(s);return"error"in P?new Ce(P.message,n,P.error,t,d):new J(P.message,n,t,"ApiError",d)}catch{}return new J(s,n,t,"ApiError",d)}var Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",ae=11;function ie(){var e;let t="";if(typeof((e=globalThis.crypto)==null?void 0:e.getRandomValues)=="function"){let s=new Uint8Array(ae);globalThis.crypto.getRandomValues(s);for(let n of s)t+=Q[n%Q.length];return t}for(let s=0;s<ae;s++)t+=Q[Math.floor(Math.random()*Q.length)];return t}var z=1e3;function Ue({isTimedOut:e,status:t}){return!e&&~~t===0}function ke({isTimedOut:e,status:t}){return e||Ue({isTimedOut:e,status:t})||~~(t/100)!==2&&~~(t/100)!==4}function Ne({status:e}){return~~(e/100)===2}function Te({status:e}){return~~e===429}var Ge=/^HTTP 429(?:\D|$)/;function Qe(e){return typeof e=="object"&&e!==null&&"status"in e?Te(e):e instanceof Error&&Ge.test(e.message)}function Ve(e){if(typeof e=="object"&&e!==null&&"headers"in e)return e.headers}function ue(e){var t;let s=(t=e?.["retry-after"])==null?void 0:t.trim();if(s===void 0||s.length===0||!/^\d+$/.test(s))return z;let n=Number.parseInt(s,10);return n<=0?z:n*1e3}function ce(e){return e.map(t=>X(t))}function X(e){let t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function ge({hosts:e,hostsCache:t,baseHeaders:s,logger:n,baseQueryParameters:d,algoliaAgent:P,timeouts:y,requester:c,requestsCache:r,responsesCache:o,compress:a,compression:u,requestIdChannel:l,maxRateLimitRetries:i=3}){function p(h,f){l===void 0||h["request-id"]!==void 0||Object.keys(f).some(E=>E.toLowerCase()==="x-algolia-request-id")||(l==="headers"?h["request-id"]=ie():f["x-algolia-request-id"]=ie())}let T=h=>new Promise(f=>{setTimeout(f,h)});async function R(h){let f=await Promise.all(h.map(g=>t.get(g,()=>Promise.resolve(te(g))))),E=f.filter(g=>g.isUp()),S=f.filter(g=>g.isTimedOut()),x=[...E,...S];return{hosts:x.length>0?x:h,getTimeout(g,w){return(S.length===0&&g===0?1:S.length+3+g)*w}}}async function q(h,f,E){let S=[],x=ne(h,f),A=oe(s,h.headers,f.headers),g=u==="gzip"&&x!==void 0&&x.length>Be&&(h.method==="POST"||h.method==="PUT");g&&a===void 0&&n.info("Compression is disabled because no compress method is available.");let w=g&&a!==void 0,j=w?await a(x):x;w&&(A["content-encoding"]="gzip");let L=h.method==="GET"?{...h.data,...f.data}:{},b={...d,...h.queryParameters,...L};if(P.value&&(b["x-algolia-agent"]=P.value),f&&f.queryParameters)for(let I of Object.keys(f.queryParameters))!f.queryParameters[I]||Object.prototype.toString.call(f.queryParameters[I])==="[object Object]"?b[I]=f.queryParameters[I]:b[I]=f.queryParameters[I].toString();p(A,b);let _=0,B=i,v=async(I,G)=>{let O=I.pop();if(O===void 0)throw new re(ce(S),_e(S));let M={...y,...f.timeouts},Z={data:j,headers:A,method:h.method,url:se(O,h.path,b),connectTimeout:G(_,M.connect),responseTimeout:G(_,E?M.read:M.write)},F=k=>{let N={request:Z,response:k,host:O,triesLeft:I.length};return S.push(N),N},H=await c.send(Z);if(Te(H)&&B>0){B--,I.push(O);let k=F(H),N=ue(H.headers);return n.info("Retryable failure",{...X(k),wait:N,rateLimitRetriesLeft:B}),await T(N),v(I,G)}if(ke(H)){let k=F(H);return H.isTimedOut&&_++,n.info("Retryable failure",X(k)),await t.set(O,te(O,H.isTimedOut?"timed out":"down")),v(I,G)}if(Ne(H))return H;throw F(H),De(H,ce(S))},D=e.filter(I=>I.accept==="readWrite"||(E?I.accept==="read":I.accept==="write")),U=await R(D);return v([...U.hosts].reverse(),U.getTimeout)}function W(h,f={}){let E=()=>q(h,f,S).then(g=>Pe(g)),S=h.useReadTransporter||h.method==="GET";if((f.cacheable||h.cacheable)!==!0)return E();let A={request:h,requestOptions:f,transporter:{queryParameters:d,headers:s}};return o.get(A,()=>r.get(A,()=>r.set(A,E()).then(g=>Promise.all([r.delete(A),g]),g=>Promise.all([r.delete(A),Promise.reject(g)])).then(([g,w])=>w)),{miss:g=>o.set(A,g)})}function Re(h,f={}){let E=h.useReadTransporter||h.method==="GET";return q(h,f,E).then(S=>Le(S))}async function*Ae(h,f={}){if(!c.sendStream)throw new Error("This requester does not support streaming");let E=ne(h,f),S=oe(s,h.headers,f.headers);S.accept="text/event-stream";let x=h.method==="GET"?{...h.data,...f.data}:{},A={...d,...h.queryParameters,...x};if(P.value&&(A["x-algolia-agent"]=P.value),f&&f.queryParameters)for(let v of Object.keys(f.queryParameters))!f.queryParameters[v]||Object.prototype.toString.call(f.queryParameters[v])==="[object Object]"?A[v]=f.queryParameters[v]:A[v]=f.queryParameters[v].toString();p(S,A);let g=h.useReadTransporter||h.method==="GET",w=e.filter(v=>v.accept==="readWrite"||(g?v.accept==="read":v.accept==="write")),L=(await R(w)).hosts[0];if(!L)throw new re([]);let b={...y,...f.timeouts},_={data:E,headers:S,method:h.method,url:se(L,h.path,A),connectTimeout:b.connect,responseTimeout:g?b.read:b.write},B=i;for(;;){let v;try{v=await c.sendStream(_)}catch(D){if(Qe(D)&&B>0){B--;let U=ue(Ve(D));n.info("Retryable failure",{wait:U,rateLimitRetriesLeft:B,host:L}),await T(U);continue}throw D}yield*we(v);return}}return{hostsCache:t,requester:c,timeouts:y,logger:n,algoliaAgent:P,baseHeaders:s,baseQueryParameters:d,requestIdChannel:l,hosts:e,maxRateLimitRetries:i,request:W,requestWithHttpInfo:Re,requestStream:Ae,requestsCache:r,responsesCache:o}}function m(e,t,s){if(s==null||typeof s=="string"&&s.length===0)throw new Error(`Parameter \`${e}\` is required when calling \`${t}\`.`)}function $e(e){let t={};for(let s of e.trim().split(/[\r\n]+/)){let n=s.indexOf(": ");n>0&&(t[s.slice(0,n).toLowerCase()]=s.slice(n+2))}return t}function ye(){function e(t){return new Promise(s=>{let n=new XMLHttpRequest;n.open(t.method,t.url,!0),Object.keys(t.headers).forEach(c=>n.setRequestHeader(c,t.headers[c]));let d=(c,r)=>setTimeout(()=>{n.abort(),s({status:0,content:r,isTimedOut:!0})},c),P=d(t.connectTimeout,"Connection timeout"),y;n.onreadystatechange=()=>{n.readyState>n.OPENED&&y===void 0&&(clearTimeout(P),y=d(t.responseTimeout,"Socket timeout"))},n.onerror=()=>{n.status===0&&(clearTimeout(P),clearTimeout(y),s({content:n.responseText||"Network request failed",status:n.status,isTimedOut:!1}))},n.onload=()=>{clearTimeout(P),clearTimeout(y),s({content:n.responseText,headers:$e(n.getAllResponseHeaders()),status:n.status,isTimedOut:!1})},n.send(t.data)})}return{send:e}}var $="1.27.0",Y=["de","us"];function je(e){return[{url:e?"analytics.{region}.algolia.com".replace("{region}",e):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]}function qe({appId:e,apiKey:t,authMode:s,algoliaAgents:n,region:d,...P}){let y=le(e,t,s),c=ge({hosts:je(d),...P,algoliaAgent:me({algoliaAgents:n,client:"AbtestingV3",version:$}),baseHeaders:{"content-type":"text/plain",...y.headers(),...P.baseHeaders},baseQueryParameters:{...y.queryParameters(),...P.baseQueryParameters}});return{transporter:c,appId:e,apiKey:t,clearCache(){return Promise.all([c.requestsCache.clear(),c.responsesCache.clear()]).then(()=>{})},get _ua(){return c.algoliaAgent.value},addAlgoliaAgent(r,o){c.algoliaAgent.add({segment:r,version:o})},setClientApiKey({apiKey:r}){!s||s==="WithinHeaders"?c.baseHeaders["x-algolia-api-key"]=r:c.baseQueryParameters["x-algolia-api-key"]=r},addABTests(r,o){m("addABTestsRequest","addABTests",r),m("addABTestsRequest.name","addABTests",r.name),m("addABTestsRequest.variants","addABTests",r.variants),m("addABTestsRequest.metrics","addABTests",r.metrics),m("addABTestsRequest.endAt","addABTests",r.endAt);let i={method:"POST",path:"/3/abtests",queryParameters:{},headers:{},data:r};return c.request(i,o)},addABTestsWithHTTPInfo(r,o){m("addABTestsRequest","addABTestsWithHTTPInfo",r),m("addABTestsRequest.name","addABTestsWithHTTPInfo",r.name),m("addABTestsRequest.variants","addABTestsWithHTTPInfo",r.variants),m("addABTestsRequest.metrics","addABTestsWithHTTPInfo",r.metrics),m("addABTestsRequest.endAt","addABTestsWithHTTPInfo",r.endAt);let i={method:"POST",path:"/3/abtests",queryParameters:{},headers:{},data:r};return c.requestWithHttpInfo(i,o)},applyVariantSettings({id:r,variantId:o},a){m("id","applyVariantSettings",r),m("variantId","applyVariantSettings",o);let p={method:"POST",path:"/3/abtests/{id}/settings/{variantId}/apply".replace("{id}",encodeURIComponent(r)).replace("{variantId}",encodeURIComponent(o)),queryParameters:{},headers:{}};return c.request(p,a)},applyVariantSettingsWithHTTPInfo({id:r,variantId:o},a){m("id","applyVariantSettingsWithHTTPInfo",r),m("variantId","applyVariantSettingsWithHTTPInfo",o);let p={method:"POST",path:"/3/abtests/{id}/settings/{variantId}/apply".replace("{id}",encodeURIComponent(r)).replace("{variantId}",encodeURIComponent(o)),queryParameters:{},headers:{}};return c.requestWithHttpInfo(p,a)},customDelete({path:r,parameters:o},a){m("path","customDelete",r);let p={method:"DELETE",path:"/{path}".replace("{path}",r),queryParameters:o||{},headers:{}};return c.request(p,a)},customDeleteWithHTTPInfo({path:r,parameters:o},a){m("path","customDeleteWithHTTPInfo",r);let p={method:"DELETE",path:"/{path}".replace("{path}",r),queryParameters:o||{},headers:{}};return c.requestWithHttpInfo(p,a)},customGet({path:r,parameters:o},a){m("path","customGet",r);let p={method:"GET",path:"/{path}".replace("{path}",r),queryParameters:o||{},headers:{}};return c.request(p,a)},customGetWithHTTPInfo({path:r,parameters:o},a){m("path","customGetWithHTTPInfo",r);let p={method:"GET",path:"/{path}".replace("{path}",r),queryParameters:o||{},headers:{}};return c.requestWithHttpInfo(p,a)},customPost({path:r,parameters:o,body:a},u){m("path","customPost",r);let T={method:"POST",path:"/{path}".replace("{path}",r),queryParameters:o||{},headers:{},data:a||{}};return c.request(T,u)},customPostWithHTTPInfo({path:r,parameters:o,body:a},u){m("path","customPostWithHTTPInfo",r);let T={method:"POST",path:"/{path}".replace("{path}",r),queryParameters:o||{},headers:{},data:a||{}};return c.requestWithHttpInfo(T,u)},customPut({path:r,parameters:o,body:a},u){m("path","customPut",r);let T={method:"PUT",path:"/{path}".replace("{path}",r),queryParameters:o||{},headers:{},data:a||{}};return c.request(T,u)},customPutWithHTTPInfo({path:r,parameters:o,body:a},u){m("path","customPutWithHTTPInfo",r);let T={method:"PUT",path:"/{path}".replace("{path}",r),queryParameters:o||{},headers:{},data:a||{}};return c.requestWithHttpInfo(T,u)},deleteABTest({id:r},o){m("id","deleteABTest",r);let i={method:"DELETE",path:"/3/abtests/{id}".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return c.request(i,o)},deleteABTestWithHTTPInfo({id:r},o){m("id","deleteABTestWithHTTPInfo",r);let i={method:"DELETE",path:"/3/abtests/{id}".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return c.requestWithHttpInfo(i,o)},estimateABTest(r,o){m("estimateABTestRequest","estimateABTest",r),m("estimateABTestRequest.configuration","estimateABTest",r.configuration),m("estimateABTestRequest.variants","estimateABTest",r.variants);let i={method:"POST",path:"/3/abtests/estimate",queryParameters:{},headers:{},data:r};return c.request(i,o)},estimateABTestWithHTTPInfo(r,o){m("estimateABTestRequest","estimateABTestWithHTTPInfo",r),m("estimateABTestRequest.configuration","estimateABTestWithHTTPInfo",r.configuration),m("estimateABTestRequest.variants","estimateABTestWithHTTPInfo",r.variants);let i={method:"POST",path:"/3/abtests/estimate",queryParameters:{},headers:{},data:r};return c.requestWithHttpInfo(i,o)},getABTest({id:r,methods:o},a){m("id","getABTest",r);let u="/3/abtests/{id}".replace("{id}",encodeURIComponent(r)),l={},i={};o!==void 0&&(i.methods=o.toString());let p={method:"GET",path:u,queryParameters:i,headers:l};return c.request(p,a)},getABTestWithHTTPInfo({id:r,methods:o},a){m("id","getABTestWithHTTPInfo",r);let u="/3/abtests/{id}".replace("{id}",encodeURIComponent(r)),l={},i={};o!==void 0&&(i.methods=o.toString());let p={method:"GET",path:u,queryParameters:i,headers:l};return c.requestWithHttpInfo(p,a)},getABTestSettings({id:r},o){m("id","getABTestSettings",r);let i={method:"GET",path:"/3/abtests/{id}/settings".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return c.request(i,o)},getABTestSettingsWithHTTPInfo({id:r},o){m("id","getABTestSettingsWithHTTPInfo",r);let i={method:"GET",path:"/3/abtests/{id}/settings".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return c.requestWithHttpInfo(i,o)},getTimeseries({id:r,startDate:o,endDate:a,metric:u,methods:l},i){m("id","getTimeseries",r);let p="/3/abtests/{id}/timeseries".replace("{id}",encodeURIComponent(r)),T={},R={};o!==void 0&&(R.startDate=o.toString()),a!==void 0&&(R.endDate=a.toString()),u!==void 0&&(R.metric=u.toString()),l!==void 0&&(R.methods=l.toString());let q={method:"GET",path:p,queryParameters:R,headers:T};return c.request(q,i)},getTimeseriesWithHTTPInfo({id:r,startDate:o,endDate:a,metric:u,methods:l},i){m("id","getTimeseriesWithHTTPInfo",r);let p="/3/abtests/{id}/timeseries".replace("{id}",encodeURIComponent(r)),T={},R={};o!==void 0&&(R.startDate=o.toString()),a!==void 0&&(R.endDate=a.toString()),u!==void 0&&(R.metric=u.toString()),l!==void 0&&(R.methods=l.toString());let q={method:"GET",path:p,queryParameters:R,headers:T};return c.requestWithHttpInfo(q,i)},listABTests({offset:r,limit:o,indexPrefix:a,indexSuffix:u,direction:l,methods:i}={},p=void 0){let T="/3/abtests",R={},q={};r!==void 0&&(q.offset=r.toString()),o!==void 0&&(q.limit=o.toString()),a!==void 0&&(q.indexPrefix=a.toString()),u!==void 0&&(q.indexSuffix=u.toString()),l!==void 0&&(q.direction=l.toString()),i!==void 0&&(q.methods=i.toString());let W={method:"GET",path:T,queryParameters:q,headers:R};return c.request(W,p)},listABTestsWithHTTPInfo({offset:r,limit:o,indexPrefix:a,indexSuffix:u,direction:l,methods:i}={},p=void 0){let T="/3/abtests",R={},q={};r!==void 0&&(q.offset=r.toString()),o!==void 0&&(q.limit=o.toString()),a!==void 0&&(q.indexPrefix=a.toString()),u!==void 0&&(q.indexSuffix=u.toString()),l!==void 0&&(q.direction=l.toString()),i!==void 0&&(q.methods=i.toString());let W={method:"GET",path:T,queryParameters:q,headers:R};return c.requestWithHttpInfo(W,p)},saveVariantSettings({id:r,variantId:o,saveSettingsRequest:a},u){m("id","saveVariantSettings",r),m("variantId","saveVariantSettings",o),m("saveSettingsRequest","saveVariantSettings",a);let T={method:"POST",path:"/3/abtests/{id}/settings/{variantId}".replace("{id}",encodeURIComponent(r)).replace("{variantId}",encodeURIComponent(o)),queryParameters:{},headers:{},data:a};return c.request(T,u)},saveVariantSettingsWithHTTPInfo({id:r,variantId:o,saveSettingsRequest:a},u){m("id","saveVariantSettingsWithHTTPInfo",r),m("variantId","saveVariantSettingsWithHTTPInfo",o),m("saveSettingsRequest","saveVariantSettingsWithHTTPInfo",a);let T={method:"POST",path:"/3/abtests/{id}/settings/{variantId}".replace("{id}",encodeURIComponent(r)).replace("{variantId}",encodeURIComponent(o)),queryParameters:{},headers:{},data:a};return c.requestWithHttpInfo(T,u)},stopABTest({id:r},o){m("id","stopABTest",r);let i={method:"POST",path:"/3/abtests/{id}/stop".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return c.request(i,o)},stopABTestWithHTTPInfo({id:r},o){m("id","stopABTestWithHTTPInfo",r);let i={method:"POST",path:"/3/abtests/{id}/stop".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return c.requestWithHttpInfo(i,o)}}}function Xt(e,t,s,n){if(!e||typeof e!="string")throw new Error("`appId` is missing.");if(!t||typeof t!="string")throw new Error("`apiKey` is missing.");if(s&&(typeof s!="string"||!Y.includes(s)))throw new Error(`\`region\` must be one of the following: ${Y.join(", ")}`);let{compression:d,...P}=n||{};return qe({appId:e,apiKey:t,region:s,timeouts:{connect:1e3,read:2e3,write:3e4},logger:pe(),requester:ye(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:V(),requestsCache:V({serializable:!1}),hostsCache:C({caches:[de({key:`${$}-${e}`}),V()]}),...P})}export{Xt as abtestingV3Client,$ as apiClientVersion};
|
|
5
|
+
`),event:e,id:this.lastEventId,retry:this.retry};return this.data=[],t}};async function*we(e){let t=new be;for await(let s of xe(e)){let n=t.decode(s);n!==null&&(yield n)}}var Be=750,ee=120*1e3;function te(e,t="up"){let s=Date.now();function n(){return t==="up"||Date.now()-s>ee}function d(){return t==="timed out"&&Date.now()-s<=ee}return{...e,status:t,lastUpdate:s,isUp:n,isTimedOut:d}}var he=class extends Error{name="AlgoliaError";constructor(e,t){super(e),t&&(this.name=t)}};var fe=class extends he{stackTrace;correlationId;constructor(e,t,s,n){super(n?`${e} (Correlation-ID: ${n})`:e,s),this.stackTrace=t,this.correlationId=n}},re=class extends fe{constructor(e,t){super("Unreachable hosts - your application id may be incorrect. If the error persists, please visit our help center https://alg.li/support-unreachable-hosts or reach out to the Algolia Support team: https://alg.li/support",e,"RetryError",t)}},J=class extends fe{status;constructor(e,t,s,n="ApiError",d){super(e,s,n,d),this.status=t}};var Oe=class extends he{response;correlationId;constructor(e,t,s){super(s?`${e} (Correlation-ID: ${s})`:e,"DeserializationError"),this.response=t,this.correlationId=s}},Ce=class extends J{error;constructor(e,t,s,n,d){super(e,t,n,"DetailedApiError",d),this.error=s}};function se(e,t,s){let n=We(s),d=`${e.protocol}://${e.url}${e.port?`:${e.port}`:""}/${t.charAt(0)==="/"?t.substring(1):t}`;return n.length&&(d+=`?${n}`),d}function We(e){return Object.keys(e).filter(t=>e[t]!==void 0).sort().map(t=>`${t}=${encodeURIComponent(Object.prototype.toString.call(e[t])==="[object Array]"?e[t].join(","):e[t]).replace(/\+/g,"%20")}`).join("&")}function ne(e,t){if(e.method==="GET"||e.data===void 0&&t.data===void 0)return;let s=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(s)}function oe(e,t,s){let n={Accept:"application/json",...e,...t,...s},d={};return Object.keys(n).forEach(P=>{let y=n[P];d[P.toLowerCase()]=y}),d}function Pe(e){if(!(e.status===204||e.content.length===0))try{return JSON.parse(e.content)}catch(t){throw new Oe(t.message,e,K(e.headers))}}function Le(e){return{status:e.status,headers:e.headers,content:e.content,data:Pe(e)}}function K(e){if(!e)return;if(e["correlation-id"]!==void 0)return e["correlation-id"];let t=Object.keys(e).find(s=>s.toLowerCase()==="correlation-id");return t===void 0?void 0:e[t]}function _e(e){for(let t=e.length-1;t>=0;t--){let s=K(e[t].response.headers);if(s!==void 0)return s}}function De(e,t){let{content:s,status:n}=e,d=K(e.headers);try{let P=JSON.parse(s);return"error"in P?new Ce(P.message,n,P.error,t,d):new J(P.message,n,t,"ApiError",d)}catch{}return new J(s,n,t,"ApiError",d)}var Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",ae=11;function ie(){var e;let t="";if(typeof((e=globalThis.crypto)==null?void 0:e.getRandomValues)=="function"){let s=new Uint8Array(ae);globalThis.crypto.getRandomValues(s);for(let n of s)t+=Q[n%Q.length];return t}for(let s=0;s<ae;s++)t+=Q[Math.floor(Math.random()*Q.length)];return t}var z=1e3;function Ue({isTimedOut:e,status:t}){return!e&&~~t===0}function ke({isTimedOut:e,status:t}){return e||Ue({isTimedOut:e,status:t})||~~(t/100)!==2&&~~(t/100)!==4}function Ne({status:e}){return~~(e/100)===2}function Te({status:e}){return~~e===429}var Ge=/^HTTP 429(?:\D|$)/;function Qe(e){return typeof e=="object"&&e!==null&&"status"in e?Te(e):e instanceof Error&&Ge.test(e.message)}function Ve(e){if(typeof e=="object"&&e!==null&&"headers"in e)return e.headers}function ue(e){var t;let s=(t=e?.["retry-after"])==null?void 0:t.trim();if(s===void 0||s.length===0||!/^\d+$/.test(s))return z;let n=Number.parseInt(s,10);return n<=0?z:n*1e3}function ce(e){return e.map(t=>X(t))}function X(e){let t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function ge({hosts:e,hostsCache:t,baseHeaders:s,logger:n,baseQueryParameters:d,algoliaAgent:P,timeouts:y,requester:c,requestsCache:r,responsesCache:o,compress:a,compression:u,requestIdChannel:l,maxRateLimitRetries:i=3}){function p(h,f){l===void 0||h["request-id"]!==void 0||Object.keys(f).some(E=>E.toLowerCase()==="x-algolia-request-id")||(l==="headers"?h["request-id"]=ie():f["x-algolia-request-id"]=ie())}let T=h=>new Promise(f=>{setTimeout(f,h)});async function R(h){let f=await Promise.all(h.map(g=>t.get(g,()=>Promise.resolve(te(g))))),E=f.filter(g=>g.isUp()),S=f.filter(g=>g.isTimedOut()),x=[...E,...S];return{hosts:x.length>0?x:h,getTimeout(g,w){return(S.length===0&&g===0?1:S.length+3+g)*w}}}async function q(h,f,E){let S=[],x=ne(h,f),A=oe(s,h.headers,f.headers),g=u==="gzip"&&x!==void 0&&x.length>Be&&(h.method==="POST"||h.method==="PUT");g&&a===void 0&&n.info("Compression is disabled because no compress method is available.");let w=g&&a!==void 0,j=w?await a(x):x;w&&(A["content-encoding"]="gzip");let L=h.method==="GET"?{...h.data,...f.data}:{},b={...d,...h.queryParameters,...L};if(P.value&&(b["x-algolia-agent"]=P.value),f&&f.queryParameters)for(let I of Object.keys(f.queryParameters))!f.queryParameters[I]||Object.prototype.toString.call(f.queryParameters[I])==="[object Object]"?b[I]=f.queryParameters[I]:b[I]=f.queryParameters[I].toString();p(A,b);let _=0,B=i,v=async(I,G)=>{let O=I.pop();if(O===void 0)throw new re(ce(S),_e(S));let M={...y,...f.timeouts},Z={data:j,headers:A,method:h.method,url:se(O,h.path,b),connectTimeout:G(_,M.connect),responseTimeout:G(_,E?M.read:M.write)},F=k=>{let N={request:Z,response:k,host:O,triesLeft:I.length};return S.push(N),N},H=await c.send(Z);if(Te(H)&&B>0){B--,I.push(O);let k=F(H),N=ue(H.headers);return n.info("Retryable failure",{...X(k),wait:N,rateLimitRetriesLeft:B}),await T(N),v(I,G)}if(ke(H)){let k=F(H);return H.isTimedOut&&_++,n.info("Retryable failure",X(k)),await t.set(O,te(O,H.isTimedOut?"timed out":"down")),v(I,G)}if(Ne(H))return H;throw F(H),De(H,ce(S))},D=e.filter(I=>I.accept==="readWrite"||(E?I.accept==="read":I.accept==="write")),U=await R(D);return v([...U.hosts].reverse(),U.getTimeout)}function W(h,f={}){let E=()=>q(h,f,S).then(g=>Pe(g)),S=h.useReadTransporter||h.method==="GET";if((f.cacheable||h.cacheable)!==!0)return E();let A={request:h,requestOptions:f,transporter:{queryParameters:d,headers:s}};return o.get(A,()=>r.get(A,()=>r.set(A,E()).then(g=>Promise.all([r.delete(A),g]),g=>Promise.all([r.delete(A),Promise.reject(g)])).then(([g,w])=>w)),{miss:g=>o.set(A,g)})}function Re(h,f={}){let E=h.useReadTransporter||h.method==="GET";return q(h,f,E).then(S=>Le(S))}async function*Ae(h,f={}){if(!c.sendStream)throw new Error("This requester does not support streaming");let E=ne(h,f),S=oe(s,h.headers,f.headers);S.accept="text/event-stream";let x=h.method==="GET"?{...h.data,...f.data}:{},A={...d,...h.queryParameters,...x};if(P.value&&(A["x-algolia-agent"]=P.value),f&&f.queryParameters)for(let v of Object.keys(f.queryParameters))!f.queryParameters[v]||Object.prototype.toString.call(f.queryParameters[v])==="[object Object]"?A[v]=f.queryParameters[v]:A[v]=f.queryParameters[v].toString();p(S,A);let g=h.useReadTransporter||h.method==="GET",w=e.filter(v=>v.accept==="readWrite"||(g?v.accept==="read":v.accept==="write")),L=(await R(w)).hosts[0];if(!L)throw new re([]);let b={...y,...f.timeouts},_={data:E,headers:S,method:h.method,url:se(L,h.path,A),connectTimeout:b.connect,responseTimeout:g?b.read:b.write},B=i;for(;;){let v;try{v=await c.sendStream(_)}catch(D){if(Qe(D)&&B>0){B--;let U=ue(Ve(D));n.info("Retryable failure",{wait:U,rateLimitRetriesLeft:B,host:L}),await T(U);continue}throw D}yield*we(v);return}}return{hostsCache:t,requester:c,timeouts:y,logger:n,algoliaAgent:P,baseHeaders:s,baseQueryParameters:d,requestIdChannel:l,hosts:e,maxRateLimitRetries:i,request:W,requestWithHttpInfo:Re,requestStream:Ae,requestsCache:r,responsesCache:o}}function m(e,t,s){if(s==null||typeof s=="string"&&s.length===0)throw new Error(`Parameter \`${e}\` is required when calling \`${t}\`.`)}function $e(e){let t={};for(let s of e.trim().split(/[\r\n]+/)){let n=s.indexOf(": ");n>0&&(t[s.slice(0,n).toLowerCase()]=s.slice(n+2))}return t}function ye(){function e(t){return new Promise(s=>{let n=new XMLHttpRequest;n.open(t.method,t.url,!0),Object.keys(t.headers).forEach(c=>n.setRequestHeader(c,t.headers[c]));let d=(c,r)=>setTimeout(()=>{n.abort(),s({status:0,content:r,isTimedOut:!0})},c),P=d(t.connectTimeout,"Connection timeout"),y;n.onreadystatechange=()=>{n.readyState>n.OPENED&&y===void 0&&(clearTimeout(P),y=d(t.responseTimeout,"Socket timeout"))},n.onerror=()=>{n.status===0&&(clearTimeout(P),clearTimeout(y),s({content:n.responseText||"Network request failed",status:n.status,isTimedOut:!1}))},n.onload=()=>{clearTimeout(P),clearTimeout(y),s({content:n.responseText,headers:$e(n.getAllResponseHeaders()),status:n.status,isTimedOut:!1})},n.send(t.data)})}return{send:e}}var $="1.30.0",Y=["de","us"];function je(e){return[{url:e?"analytics.{region}.algolia.com".replace("{region}",e):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]}function qe({appId:e,apiKey:t,authMode:s,algoliaAgents:n,region:d,...P}){let y=le(e,t,s),c=ge({hosts:je(d),...P,algoliaAgent:me({algoliaAgents:n,client:"AbtestingV3",version:$}),baseHeaders:{"content-type":"text/plain",...y.headers(),...P.baseHeaders},baseQueryParameters:{...y.queryParameters(),...P.baseQueryParameters}});return{transporter:c,appId:e,apiKey:t,clearCache(){return Promise.all([c.requestsCache.clear(),c.responsesCache.clear()]).then(()=>{})},get _ua(){return c.algoliaAgent.value},addAlgoliaAgent(r,o){c.algoliaAgent.add({segment:r,version:o})},setClientApiKey({apiKey:r}){!s||s==="WithinHeaders"?c.baseHeaders["x-algolia-api-key"]=r:c.baseQueryParameters["x-algolia-api-key"]=r},addABTests(r,o){m("addABTestsRequest","addABTests",r),m("addABTestsRequest.name","addABTests",r.name),m("addABTestsRequest.variants","addABTests",r.variants),m("addABTestsRequest.metrics","addABTests",r.metrics),m("addABTestsRequest.endAt","addABTests",r.endAt);let i={method:"POST",path:"/3/abtests",queryParameters:{},headers:{},data:r};return c.request(i,o)},addABTestsWithHTTPInfo(r,o){m("addABTestsRequest","addABTestsWithHTTPInfo",r),m("addABTestsRequest.name","addABTestsWithHTTPInfo",r.name),m("addABTestsRequest.variants","addABTestsWithHTTPInfo",r.variants),m("addABTestsRequest.metrics","addABTestsWithHTTPInfo",r.metrics),m("addABTestsRequest.endAt","addABTestsWithHTTPInfo",r.endAt);let i={method:"POST",path:"/3/abtests",queryParameters:{},headers:{},data:r};return c.requestWithHttpInfo(i,o)},applyVariantSettings({id:r,variantId:o},a){m("id","applyVariantSettings",r),m("variantId","applyVariantSettings",o);let p={method:"POST",path:"/3/abtests/{id}/settings/{variantId}/apply".replace("{id}",encodeURIComponent(r)).replace("{variantId}",encodeURIComponent(o)),queryParameters:{},headers:{}};return c.request(p,a)},applyVariantSettingsWithHTTPInfo({id:r,variantId:o},a){m("id","applyVariantSettingsWithHTTPInfo",r),m("variantId","applyVariantSettingsWithHTTPInfo",o);let p={method:"POST",path:"/3/abtests/{id}/settings/{variantId}/apply".replace("{id}",encodeURIComponent(r)).replace("{variantId}",encodeURIComponent(o)),queryParameters:{},headers:{}};return c.requestWithHttpInfo(p,a)},customDelete({path:r,parameters:o},a){m("path","customDelete",r);let p={method:"DELETE",path:"/{path}".replace("{path}",r),queryParameters:o||{},headers:{}};return c.request(p,a)},customDeleteWithHTTPInfo({path:r,parameters:o},a){m("path","customDeleteWithHTTPInfo",r);let p={method:"DELETE",path:"/{path}".replace("{path}",r),queryParameters:o||{},headers:{}};return c.requestWithHttpInfo(p,a)},customGet({path:r,parameters:o},a){m("path","customGet",r);let p={method:"GET",path:"/{path}".replace("{path}",r),queryParameters:o||{},headers:{}};return c.request(p,a)},customGetWithHTTPInfo({path:r,parameters:o},a){m("path","customGetWithHTTPInfo",r);let p={method:"GET",path:"/{path}".replace("{path}",r),queryParameters:o||{},headers:{}};return c.requestWithHttpInfo(p,a)},customPost({path:r,parameters:o,body:a},u){m("path","customPost",r);let T={method:"POST",path:"/{path}".replace("{path}",r),queryParameters:o||{},headers:{},data:a||{}};return c.request(T,u)},customPostWithHTTPInfo({path:r,parameters:o,body:a},u){m("path","customPostWithHTTPInfo",r);let T={method:"POST",path:"/{path}".replace("{path}",r),queryParameters:o||{},headers:{},data:a||{}};return c.requestWithHttpInfo(T,u)},customPut({path:r,parameters:o,body:a},u){m("path","customPut",r);let T={method:"PUT",path:"/{path}".replace("{path}",r),queryParameters:o||{},headers:{},data:a||{}};return c.request(T,u)},customPutWithHTTPInfo({path:r,parameters:o,body:a},u){m("path","customPutWithHTTPInfo",r);let T={method:"PUT",path:"/{path}".replace("{path}",r),queryParameters:o||{},headers:{},data:a||{}};return c.requestWithHttpInfo(T,u)},deleteABTest({id:r},o){m("id","deleteABTest",r);let i={method:"DELETE",path:"/3/abtests/{id}".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return c.request(i,o)},deleteABTestWithHTTPInfo({id:r},o){m("id","deleteABTestWithHTTPInfo",r);let i={method:"DELETE",path:"/3/abtests/{id}".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return c.requestWithHttpInfo(i,o)},estimateABTest(r,o){m("estimateABTestRequest","estimateABTest",r),m("estimateABTestRequest.configuration","estimateABTest",r.configuration),m("estimateABTestRequest.variants","estimateABTest",r.variants);let i={method:"POST",path:"/3/abtests/estimate",queryParameters:{},headers:{},data:r};return c.request(i,o)},estimateABTestWithHTTPInfo(r,o){m("estimateABTestRequest","estimateABTestWithHTTPInfo",r),m("estimateABTestRequest.configuration","estimateABTestWithHTTPInfo",r.configuration),m("estimateABTestRequest.variants","estimateABTestWithHTTPInfo",r.variants);let i={method:"POST",path:"/3/abtests/estimate",queryParameters:{},headers:{},data:r};return c.requestWithHttpInfo(i,o)},getABTest({id:r,methods:o},a){m("id","getABTest",r);let u="/3/abtests/{id}".replace("{id}",encodeURIComponent(r)),l={},i={};o!==void 0&&(i.methods=o.toString());let p={method:"GET",path:u,queryParameters:i,headers:l};return c.request(p,a)},getABTestWithHTTPInfo({id:r,methods:o},a){m("id","getABTestWithHTTPInfo",r);let u="/3/abtests/{id}".replace("{id}",encodeURIComponent(r)),l={},i={};o!==void 0&&(i.methods=o.toString());let p={method:"GET",path:u,queryParameters:i,headers:l};return c.requestWithHttpInfo(p,a)},getABTestSettings({id:r},o){m("id","getABTestSettings",r);let i={method:"GET",path:"/3/abtests/{id}/settings".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return c.request(i,o)},getABTestSettingsWithHTTPInfo({id:r},o){m("id","getABTestSettingsWithHTTPInfo",r);let i={method:"GET",path:"/3/abtests/{id}/settings".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return c.requestWithHttpInfo(i,o)},getTimeseries({id:r,startDate:o,endDate:a,metric:u,methods:l},i){m("id","getTimeseries",r);let p="/3/abtests/{id}/timeseries".replace("{id}",encodeURIComponent(r)),T={},R={};o!==void 0&&(R.startDate=o.toString()),a!==void 0&&(R.endDate=a.toString()),u!==void 0&&(R.metric=u.toString()),l!==void 0&&(R.methods=l.toString());let q={method:"GET",path:p,queryParameters:R,headers:T};return c.request(q,i)},getTimeseriesWithHTTPInfo({id:r,startDate:o,endDate:a,metric:u,methods:l},i){m("id","getTimeseriesWithHTTPInfo",r);let p="/3/abtests/{id}/timeseries".replace("{id}",encodeURIComponent(r)),T={},R={};o!==void 0&&(R.startDate=o.toString()),a!==void 0&&(R.endDate=a.toString()),u!==void 0&&(R.metric=u.toString()),l!==void 0&&(R.methods=l.toString());let q={method:"GET",path:p,queryParameters:R,headers:T};return c.requestWithHttpInfo(q,i)},listABTests({offset:r,limit:o,indexPrefix:a,indexSuffix:u,direction:l,methods:i}={},p=void 0){let T="/3/abtests",R={},q={};r!==void 0&&(q.offset=r.toString()),o!==void 0&&(q.limit=o.toString()),a!==void 0&&(q.indexPrefix=a.toString()),u!==void 0&&(q.indexSuffix=u.toString()),l!==void 0&&(q.direction=l.toString()),i!==void 0&&(q.methods=i.toString());let W={method:"GET",path:T,queryParameters:q,headers:R};return c.request(W,p)},listABTestsWithHTTPInfo({offset:r,limit:o,indexPrefix:a,indexSuffix:u,direction:l,methods:i}={},p=void 0){let T="/3/abtests",R={},q={};r!==void 0&&(q.offset=r.toString()),o!==void 0&&(q.limit=o.toString()),a!==void 0&&(q.indexPrefix=a.toString()),u!==void 0&&(q.indexSuffix=u.toString()),l!==void 0&&(q.direction=l.toString()),i!==void 0&&(q.methods=i.toString());let W={method:"GET",path:T,queryParameters:q,headers:R};return c.requestWithHttpInfo(W,p)},saveVariantSettings({id:r,variantId:o,saveSettingsRequest:a},u){m("id","saveVariantSettings",r),m("variantId","saveVariantSettings",o),m("saveSettingsRequest","saveVariantSettings",a);let T={method:"POST",path:"/3/abtests/{id}/settings/{variantId}".replace("{id}",encodeURIComponent(r)).replace("{variantId}",encodeURIComponent(o)),queryParameters:{},headers:{},data:a};return c.request(T,u)},saveVariantSettingsWithHTTPInfo({id:r,variantId:o,saveSettingsRequest:a},u){m("id","saveVariantSettingsWithHTTPInfo",r),m("variantId","saveVariantSettingsWithHTTPInfo",o),m("saveSettingsRequest","saveVariantSettingsWithHTTPInfo",a);let T={method:"POST",path:"/3/abtests/{id}/settings/{variantId}".replace("{id}",encodeURIComponent(r)).replace("{variantId}",encodeURIComponent(o)),queryParameters:{},headers:{},data:a};return c.requestWithHttpInfo(T,u)},stopABTest({id:r},o){m("id","stopABTest",r);let i={method:"POST",path:"/3/abtests/{id}/stop".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return c.request(i,o)},stopABTestWithHTTPInfo({id:r},o){m("id","stopABTestWithHTTPInfo",r);let i={method:"POST",path:"/3/abtests/{id}/stop".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return c.requestWithHttpInfo(i,o)}}}function Xt(e,t,s,n){if(!e||typeof e!="string")throw new Error("`appId` is missing.");if(!t||typeof t!="string")throw new Error("`apiKey` is missing.");if(s&&(typeof s!="string"||!Y.includes(s)))throw new Error(`\`region\` must be one of the following: ${Y.join(", ")}`);let{compression:d,...P}=n||{};return qe({appId:e,apiKey:t,region:s,timeouts:{connect:1e3,read:2e3,write:3e4},logger:pe(),requester:ye(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:V(),requestsCache:V({serializable:!1}),hostsCache:C({caches:[de({key:`${$}-${e}`}),V()]}),...P})}export{Xt as abtestingV3Client,$ as apiClientVersion};
|
|
6
6
|
//# sourceMappingURL=browser.min.js.map
|