import * as _algolia_client_common from '@algolia/client-common'; import { CreateClientOptions, RequestOptions, AlgoliaHttpResponse, ClientOptions } from '@algolia/client-common'; /** * A/B test statistical analysis method. When omitted, new A/B tests use `bayesian`. They use `frequentist` instead only if no primary metric that supports Bayesian analysis is available. The selected method is saved in the A/B test configuration. Older A/B tests, created before methods were saved, may have no method in their configuration. These tests use `frequentist`. */ type AnalysisMethod = 'bayesian' | 'frequentist'; /** * Multiple-testing correction method applied when evaluating metric significance. */ type ErrorCorrectionType = 'bonferroni' | 'benjamini-hochberg'; /** * Boolean filter applied to the A/B test population. Each filter targets a boolean metric and decides whether to include (true) or exclude (false) matching records. */ type MetricsFilter = { /** * Metric domain (for example `abtesting`, `personalization`). */ domain: string; /** * Public metric name. */ name: string; /** * Whether the experiment should record the effects of this filter. */ trackEffects?: boolean | undefined; /** * If true, keep items that match the filter; if false, exclude them. */ includes?: boolean | undefined; }; /** * Metric for which you want to detect the smallest relative difference. Metrics ending in `UsersRate` are user-level rates: the share of tracked users with at least one search with a click, conversion, add-to-cart, or purchase. For these metrics, sample sizes count users instead of searches. */ type EffectMetric = 'addToCartRate' | 'clickThroughRate' | 'conversionRate' | 'purchaseRate' | 'noResultsRate' | 'addToCartUsersRate' | 'clickedUsersRate' | 'convertedUsersRate' | 'purchaseUsersRate'; /** * Configuration for the smallest difference between test variants you want to detect, used to estimate the required sample size. */ type MinimumDetectableEffect = { /** * Smallest difference in an observable metric between variants. For example, to detect a 10% difference between variants, set this value to 0.1. */ size: number; metric: EffectMetric; }; /** * 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. */ 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'; /** * A/B test configuration. */ type ABTestConfiguration = { minimumDetectableEffect?: MinimumDetectableEffect | undefined; /** * List of metric filters applied to the test population. */ filters?: Array | undefined; errorCorrection?: ErrorCorrectionType | undefined; method?: AnalysisMethod | undefined; primaryMetric?: PrimaryMetric | undefined; }; /** * Outcome of the A/B test once a winner has been declared. Only present when a winning variant has been declared, so its presence indicates the test has been decided. */ type Decision = { /** * Identifier of the declared winning variant. The control variant is 1. */ winnerVariantId: number; /** * Date and time when the winning variant was declared, in RFC 3339 format. */ declaredAt: string; }; /** * A/B test status. - `active`. The A/B test is live and search traffic is split between the two variants. - `stopped`. You stopped the A/B test. The A/B test data is still available for analysis. - `expired`. The A/B test was automatically stopped after reaching its end date. - `failed`. Creating the A/B test failed. */ type Status = 'active' | 'stopped' | 'expired' | 'failed'; /** * Whether this variant metric\'s result is trustworthy yet. This doesn\'t mean the A/B test has ended, and it doesn\'t declare a winning variant. - `enough`. Enough evidence has accumulated to trust this metric\'s result for this variant. - `not_enough`. Evidence was computed but hasn\'t reached the threshold yet. - `collecting`. Evidence is still accumulating, so it\'s too early to report a verdict. - `no_data`. No usable data for this variant metric, and none is expected for it. - `unavailable`. Evidence can\'t be computed for this variant metric\'s comparison. */ type EvidenceStatus = 'enough' | 'not_enough' | 'collecting' | 'no_data' | 'unavailable'; /** * Evidence status for this variant metric\'s comparison with the control. Only present when the API has an evidence status for the comparison. Omitted when evidence isn\'t applicable or no status exists. */ type MetricEvidence = { status: EvidenceStatus; }; /** * Bayesian inference results for this variant metric. Omitted when Bayesian results aren\'t requested or no Bayesian result is available for this metric. Individual inference fields can be omitted when their values aren\'t available. */ type BayesianMetricResult = { /** * Probability that this variant is better than the control. */ probabilityToBeBetter?: number | undefined; /** * Lower bound of the 95% credible interval for the relative effect (variant/control minus 1). */ relativeEffectCILow?: number | undefined; /** * Upper bound of the 95% credible interval for the relative effect (variant/control minus 1). */ relativeEffectCIHigh?: number | undefined; evidence?: MetricEvidence | undefined; }; /** * Metric specific metadata. */ type MetricMetadata = { /** * Only present for `revenue` metrics. It is the amount exceeding the 95th percentile of global revenue transactions involved in the AB Test. This amount is not considered when calculating statistical significance. It is tied to a per revenue-currency pair contrary to other global filter effects (such as outliers and empty search count). */ winsorizedValue?: number | undefined; /** * Mean value for this metric. */ mean?: number | undefined; /** * 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. */ userCount?: number | undefined; }; type MetricResult = { /** * Metric name. Revenue per search results use `revenue_per_search`. */ name: string; /** * Date and time when the metric was last updated, in RFC 3339 format. */ updatedAt: string; /** * Metric value. For `revenue_per_search`, this is the winsorized mean revenue per search in the specified currency. */ value: number; /** * The upper bound of the 95% confidence interval for the metric value. The confidence interval is calculated using either the relative ratio or relative difference between the metric values for the control and the variant. Relative ratio is used for metrics that are ratios (e.g., click-through rate, conversion rate), while relative difference is used for continuous metrics (e.g., revenue). */ valueCIHigh?: number | undefined; /** * The lower bound of the 95% confidence interval for the metric value. The confidence interval is calculated using either the relative ratio or relative difference between the metric values for the control and the variant. Relative ratio is used for metrics that are ratios (e.g., click-through rate, conversion rate), while relative difference is used for continuous metrics (e.g., revenue). */ valueCILow?: number | undefined; /** * P-value for this variant compared to the control. Omitted when no p-value is available for this metric. */ pValue?: number | undefined; /** * Dimension defined during test creation. For revenue metrics, including `revenue_per_search` and `winsorized_revenue_per_user`, this is the currency. */ dimension?: string | undefined; metadata?: MetricMetadata | undefined; /** * The value that was computed during error correction. It is used to determine significance of the metric pValue. The critical value is calculated using Bonferroni or Benjamini-Hochberg corrections, based on the given configuration during the A/B test creation. */ criticalValue?: number | undefined; /** * Whether the pValue is significant or not based on the critical value and the error correction algorithm used. */ significant?: boolean | undefined; bayesian?: BayesianMetricResult | undefined; }; /** * Empty searches removed from the A/B test as a result of configuration settings. */ type EmptySearchFilter = { /** * Number of users removed from the A/B test. */ usersCount?: number | undefined; /** * Number of tracked searches removed from the A/B test. */ trackedSearchesCount?: number | undefined; }; /** * Outliers removed from the A/B test as a result of configuration settings. */ type OutliersFilter = { /** * Number of users removed from the A/B test. */ usersCount?: number | undefined; /** * Number of tracked searches removed from the A/B test. */ trackedSearchesCount?: number | undefined; }; /** * A/B test filter effects resulting from configuration settings. */ type FilterEffects = { outliers?: OutliersFilter | undefined; emptySearch?: EmptySearchFilter | undefined; }; /** * Variant specific metadata. */ type VariantMetadata = { filterEffects?: FilterEffects | undefined; }; type Variant = { /** * Description for this variant. */ description: string; /** * Estimated number of searches, or users for user-level rates (metrics ending in `UsersRate`), required to achieve the desired statistical significance. The A/B test configuration must include a `minimumDetectableEffect` setting for this number to be included in the response. */ estimatedSampleSize?: number | undefined; /** * Index name of the A/B test variant (case-sensitive). */ index: string; /** * Percentage of search requests each variant receives. */ trafficPercentage: number; /** * All ABTest metrics that were defined during test creation. */ metrics: Array; metadata?: VariantMetadata | undefined; /** * Search parameters applied to this variant when the same index is used for multiple variants. Only present if custom search parameters were provided during test creation. */ customSearchParameters?: Record | undefined; }; type ABTest = { /** * Unique A/B test identifier. */ abTestID: number; /** * Date and time when the A/B test was last updated, in RFC 3339 format. */ updatedAt: string; /** * Date and time when the A/B test was created, in RFC 3339 format. */ createdAt: string; /** * End date and time of the A/B test, in RFC 3339 format. */ endAt: string; /** * Date and time when the A/B test was stopped, in RFC 3339 format. */ stoppedAt?: string | null | undefined; /** * A/B test name. */ name: string; /** * Expected outcome of the A/B test. */ hypothesis: string; status: Status; /** * A/B test variants. The first variant is your _control_ index, typically your production index. All of the additional variants are indexes with changed settings that you want to test against the control. */ variants: Array; configuration?: ABTestConfiguration | undefined; decision?: Decision | undefined; }; type ABTestResponse = { /** * Index name of the A/B test variant (case-sensitive). */ index: string; /** * Unique A/B test identifier. */ abTestID: number; /** * Unique identifier of a task. A successful API response means that a task was added to a queue. It might not run immediately. You can check the task\'s progress with the [`task` operation](https://www.algolia.com/doc/rest-api/search/get-task) and this task ID. */ taskID: number; }; /** * Feature-specific settings captured for a variant. */ type FeatureSettings = { /** * Name of the feature the settings belong to. */ name: string; /** * Feature settings payload. The shape depends on the feature. */ settings: any | null; }; /** * Settings captured for one A/B test variant. */ type VariantSettings = { /** * One-based index of the variant within the A/B test. The control is variant 1. */ variantId: number; /** * Whether the variant\'s settings have been applied to the control index. */ applied: boolean; /** * Feature-specific settings captured for the variant. */ featuresSettings?: Array | undefined; /** * Index settings captured for the variant. */ indexSettings?: Record | undefined; /** * Date and time when the variant\'s settings were applied to the control index, in RFC 3339 format. */ applyTimestamp?: string | undefined; /** * Date and time when the applied settings were reverted on the control index, in RFC 3339 format. */ revertTimestamp?: string | undefined; /** * Date and time when the variant\'s settings were captured, in RFC 3339 format. */ declaredTimestamp?: string | undefined; /** * Date and time when the captured settings expired, in RFC 3339 format. */ expiredTimestamp?: string | undefined; }; /** * Captured settings of an A/B test. */ type ABTestSettingsResponse = { /** * Captured settings for each variant of the A/B test. */ abtestSettings: Array; /** * Whether another active A/B test is using the control index. */ controlIndexInUse: boolean; }; type AbTestsVariant = { /** * Index name of the A/B test variant (case-sensitive). */ index: string; /** * Percentage of search requests each variant receives. */ trafficPercentage: number; /** * Description for this variant. */ description?: string | undefined; }; /** * Search parameters to add to the test variant. Only use this parameter if the two variants use the same index. */ type CustomSearchParams = { customSearchParameters: Record; }; type AbTestsVariantSearchParams = AbTestsVariant & CustomSearchParams; type AddABTestsVariant = AbTestsVariant | AbTestsVariantSearchParams; /** * Defines a metric to be retrieved during an A/B test. */ type CreateMetric = { /** * Name of the metric. */ name: string; /** * Dimension of the metric, for example, in case of a revenue metric it could be USD, EUR... */ dimension?: string | undefined; }; type AddABTestsRequest = { /** * A/B test name. */ name: string; /** * Expected outcome of the A/B test. */ hypothesis?: string | undefined; /** * A/B test variants. */ variants: Array; /** * A/B test metrics involved in the test. Only these metrics will be considered when calculating results. */ metrics: Array; configuration?: ABTestConfiguration | undefined; /** * End date and time of the A/B test, in RFC 3339 format. */ endAt: string; }; /** * A/B test configuration for estimating the sample size and duration using minimum detectable effect. */ type EstimateConfiguration = { /** * List of metric filters applied to the test population. */ filters?: Array | undefined; minimumDetectableEffect: MinimumDetectableEffect; }; type EstimateABTestRequest = { configuration: EstimateConfiguration; /** * A/B test variants. */ variants: Array; }; type EstimateABTestResponse = { /** * Estimated number of days needed to reach the sample sizes required for detecting the configured effect. This value is based on historical traffic. */ durationDays?: number | undefined; /** * Sample size estimates for each variant. The first element is the control variant. Each element is the estimated number of searches, or users for user-level rates (metrics ending in `UsersRate`), required to achieve the desired statistical significance. */ sampleSizes?: Array | undefined; }; type ListABTestsResponse = { /** * A/B tests. */ abtests: Array | null; /** * Number of A/B tests. */ count: number; /** * Number of retrievable A/B tests. */ total: number; }; type MetricDate = { /** * Date where the metric was updated, in RFC 3339 format. */ date?: string | undefined; /** * All ABTest metrics that were defined during test creation. */ metrics?: Array | undefined; }; type TimeseriesVariant = { dates?: Array | undefined; }; type Timeseries = { /** * Unique A/B test identifier. */ abTestID: number; /** * A/B test timeseries variants. The first variant is your _control_ index, typically your production index. All of the additional variants are indexes with changed settings that you want to test against the control. */ variants: Array; }; /** * 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. */ type Direction = 'asc' | 'desc'; 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'; /** * Options for capturing a variant\'s settings. */ type SaveSettingsRequest = { /** * Whether to also capture the variant\'s index settings and feature-specific settings. This must be true for A/B tests whose variants use different indices so that the captured variant settings can later be applied. */ saveFeaturesSettings?: boolean | undefined; }; /** * Properties for the `applyVariantSettings` method. */ type ApplyVariantSettingsProps = { /** * Unique A/B test identifier. */ id: number; /** * One-based index of the A/B test variant. The control is variant 1. */ variantId: number; }; /** * Properties for the `customDelete` method. */ type CustomDeleteProps = { /** * Path of the endpoint, for example `1/newFeature`. */ path: string; /** * Query parameters to apply to the current query. */ parameters?: { [key: string]: any; } | undefined; }; /** * Properties for the `customGet` method. */ type CustomGetProps = { /** * Path of the endpoint, for example `1/newFeature`. */ path: string; /** * Query parameters to apply to the current query. */ parameters?: { [key: string]: any; } | undefined; }; /** * Properties for the `customPost` method. */ type CustomPostProps = { /** * Path of the endpoint, for example `1/newFeature`. */ path: string; /** * Query parameters to apply to the current query. */ parameters?: { [key: string]: any; } | undefined; /** * Parameters to send with the custom request. */ body?: Record | undefined; }; /** * Properties for the `customPut` method. */ type CustomPutProps = { /** * Path of the endpoint, for example `1/newFeature`. */ path: string; /** * Query parameters to apply to the current query. */ parameters?: { [key: string]: any; } | undefined; /** * Parameters to send with the custom request. */ body?: Record | undefined; }; /** * Properties for the `deleteABTest` method. */ type DeleteABTestProps = { /** * Unique A/B test identifier. */ id: number; }; /** * Properties for the `getABTest` method. */ type GetABTestProps = { /** * Unique A/B test identifier. */ id: number; /** * 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. */ methods?: Array | undefined; }; /** * Properties for the `getABTestSettings` method. */ type GetABTestSettingsProps = { /** * Unique A/B test identifier. */ id: number; }; /** * Properties for the `getTimeseries` method. */ type GetTimeseriesProps = { /** * Unique A/B test identifier. */ id: number; /** * Start date of the period to analyze, in `YYYY-MM-DD` format. */ startDate?: string | undefined; /** * End date of the period to analyze, in `YYYY-MM-DD` format. */ endDate?: string | undefined; /** * Metrics to retrieve, as a comma-separated list. If not specified, all metrics are returned. */ metric?: Array | undefined; /** * 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. */ methods?: Array | undefined; }; /** * Properties for the `listABTests` method. */ type ListABTestsProps = { /** * Position of the first item to return. */ offset?: number | undefined; /** * Number of items to return. */ limit?: number | undefined; /** * Index name prefix. Only A/B tests for indices starting with this string are included in the response. */ indexPrefix?: string | undefined; /** * Index name suffix. Only A/B tests for indices ending with this string are included in the response. */ indexSuffix?: string | undefined; /** * 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. */ direction?: Direction | undefined; /** * 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. */ methods?: Array | undefined; }; /** * Properties for the `saveVariantSettings` method. */ type SaveVariantSettingsProps = { /** * Unique A/B test identifier. */ id: number; /** * One-based index of the A/B test variant. The control is variant 1. */ variantId: number; saveSettingsRequest: SaveSettingsRequest; }; /** * Properties for the `stopABTest` method. */ type StopABTestProps = { /** * Unique A/B test identifier. */ id: number; }; declare const apiClientVersion = "1.30.0"; declare const REGIONS: readonly ["de", "us"]; type Region = (typeof REGIONS)[number]; type RegionOptions = { region?: Region | undefined; }; declare function createAbtestingV3Client({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }: CreateClientOptions & RegionOptions): { transporter: _algolia_client_common.TransporterWithHttpInfo; /** * The `appId` currently in use. */ appId: string; /** * The `apiKey` currently in use. */ apiKey: string; /** * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties. */ clearCache(): Promise; /** * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system. */ readonly _ua: string; /** * Adds a `segment` to the `x-algolia-agent` sent with every requests. * * @param segment - The algolia agent (user-agent) segment to add. * @param version - The version of the agent. */ addAlgoliaAgent(segment: string, version?: string | undefined): void; /** * Helper method to switch the API key used to authenticate the requests. * * @param params - Method params. * @param params.apiKey - The new API Key to use. */ setClientApiKey({ apiKey }: { apiKey: string; }): void; /** * Creates a new A/B test. * * Required API Key ACLs: * - editSettings * @param addABTestsRequest - The addABTestsRequest object. * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. */ addABTests(addABTestsRequest: AddABTestsRequest, requestOptions?: RequestOptions): Promise; /** * Creates a new A/B test. * * 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. * * Required API Key ACLs: * - editSettings * @param addABTestsRequest - The addABTestsRequest object. * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. * @see addABTests for the plain version. */ addABTestsWithHTTPInfo(addABTestsRequest: AddABTestsRequest, requestOptions?: RequestOptions): Promise>; /** * 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`. * * Required API Key ACLs: * - analytics * - editSettings * @param applyVariantSettings - The applyVariantSettings object. * @param applyVariantSettings.id - Unique A/B test identifier. * @param applyVariantSettings.variantId - One-based index of the A/B test variant. The control is variant 1. * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. */ applyVariantSettings({ id, variantId }: ApplyVariantSettingsProps, requestOptions?: RequestOptions): Promise; /** * 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`. * * 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. * * Required API Key ACLs: * - analytics * - editSettings * @param applyVariantSettings - The applyVariantSettings object. * @param applyVariantSettings.id - Unique A/B test identifier. * @param applyVariantSettings.variantId - One-based index of the A/B test variant. The control is variant 1. * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. * @see applyVariantSettings for the plain version. */ applyVariantSettingsWithHTTPInfo({ id, variantId }: ApplyVariantSettingsProps, requestOptions?: RequestOptions): Promise>; /** * This method lets you send requests to the Algolia REST API. * @param customDelete - The customDelete object. * @param customDelete.path - Path of the endpoint, for example `1/newFeature`. * @param customDelete.parameters - Query parameters to apply to the current query. * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. */ customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise>; /** * This method lets you send requests to the Algolia REST API. * * 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. * @param customDelete - The customDelete object. * @param customDelete.path - Path of the endpoint, for example `1/newFeature`. * @param customDelete.parameters - Query parameters to apply to the current query. * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. * @see customDelete for the plain version. */ customDeleteWithHTTPInfo({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise>>; /** * This method lets you send requests to the Algolia REST API. * @param customGet - The customGet object. * @param customGet.path - Path of the endpoint, for example `1/newFeature`. * @param customGet.parameters - Query parameters to apply to the current query. * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. */ customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise>; /** * This method lets you send requests to the Algolia REST API. * * 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. * @param customGet - The customGet object. * @param customGet.path - Path of the endpoint, for example `1/newFeature`. * @param customGet.parameters - Query parameters to apply to the current query. * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. * @see customGet for the plain version. */ customGetWithHTTPInfo({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise>>; /** * This method lets you send requests to the Algolia REST API. * @param customPost - The customPost object. * @param customPost.path - Path of the endpoint, for example `1/newFeature`. * @param customPost.parameters - Query parameters to apply to the current query. * @param customPost.body - Parameters to send with the custom request. * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. */ customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise>; /** * This method lets you send requests to the Algolia REST API. * * 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. * @param customPost - The customPost object. * @param customPost.path - Path of the endpoint, for example `1/newFeature`. * @param customPost.parameters - Query parameters to apply to the current query. * @param customPost.body - Parameters to send with the custom request. * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. * @see customPost for the plain version. */ customPostWithHTTPInfo({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise>>; /** * This method lets you send requests to the Algolia REST API. * @param customPut - The customPut object. * @param customPut.path - Path of the endpoint, for example `1/newFeature`. * @param customPut.parameters - Query parameters to apply to the current query. * @param customPut.body - Parameters to send with the custom request. * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. */ customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise>; /** * This method lets you send requests to the Algolia REST API. * * 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. * @param customPut - The customPut object. * @param customPut.path - Path of the endpoint, for example `1/newFeature`. * @param customPut.parameters - Query parameters to apply to the current query. * @param customPut.body - Parameters to send with the custom request. * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. * @see customPut for the plain version. */ customPutWithHTTPInfo({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise>>; /** * Deletes an A/B test by its ID. * * Required API Key ACLs: * - editSettings * @param deleteABTest - The deleteABTest object. * @param deleteABTest.id - Unique A/B test identifier. * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. */ deleteABTest({ id }: DeleteABTestProps, requestOptions?: RequestOptions): Promise; /** * Deletes an A/B test by its ID. * * 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. * * Required API Key ACLs: * - editSettings * @param deleteABTest - The deleteABTest object. * @param deleteABTest.id - Unique A/B test identifier. * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. * @see deleteABTest for the plain version. */ deleteABTestWithHTTPInfo({ id }: DeleteABTestProps, requestOptions?: RequestOptions): Promise>; /** * 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. * * Required API Key ACLs: * - analytics * @param estimateABTestRequest - The estimateABTestRequest object. * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. */ estimateABTest(estimateABTestRequest: EstimateABTestRequest, requestOptions?: RequestOptions): Promise; /** * 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. * * 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. * * Required API Key ACLs: * - analytics * @param estimateABTestRequest - The estimateABTestRequest object. * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. * @see estimateABTest for the plain version. */ estimateABTestWithHTTPInfo(estimateABTestRequest: EstimateABTestRequest, requestOptions?: RequestOptions): Promise>; /** * Retrieves the details for an A/B test by its ID. * * Required API Key ACLs: * - analytics * @param getABTest - The getABTest object. * @param getABTest.id - Unique A/B test identifier. * @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. * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. */ getABTest({ id, methods }: GetABTestProps, requestOptions?: RequestOptions): Promise; /** * Retrieves the details for an A/B test by its ID. * * 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. * * Required API Key ACLs: * - analytics * @param getABTest - The getABTest object. * @param getABTest.id - Unique A/B test identifier. * @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. * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. * @see getABTest for the plain version. */ getABTestWithHTTPInfo({ id, methods }: GetABTestProps, requestOptions?: RequestOptions): Promise>; /** * 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. * * Required API Key ACLs: * - analytics * @param getABTestSettings - The getABTestSettings object. * @param getABTestSettings.id - Unique A/B test identifier. * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. */ getABTestSettings({ id }: GetABTestSettingsProps, requestOptions?: RequestOptions): Promise; /** * 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. * * 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. * * Required API Key ACLs: * - analytics * @param getABTestSettings - The getABTestSettings object. * @param getABTestSettings.id - Unique A/B test identifier. * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. * @see getABTestSettings for the plain version. */ getABTestSettingsWithHTTPInfo({ id }: GetABTestSettingsProps, requestOptions?: RequestOptions): Promise>; /** * Retrieves timeseries for an A/B test by its ID. * * Required API Key ACLs: * - analytics * @param getTimeseries - The getTimeseries object. * @param getTimeseries.id - Unique A/B test identifier. * @param getTimeseries.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format. * @param getTimeseries.endDate - End date of the period to analyze, in `YYYY-MM-DD` format. * @param getTimeseries.metric - Metrics to retrieve, as a comma-separated list. If not specified, all metrics are returned. * @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. * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. */ getTimeseries({ id, startDate, endDate, metric, methods }: GetTimeseriesProps, requestOptions?: RequestOptions): Promise; /** * Retrieves timeseries for an A/B test by its ID. * * 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. * * Required API Key ACLs: * - analytics * @param getTimeseries - The getTimeseries object. * @param getTimeseries.id - Unique A/B test identifier. * @param getTimeseries.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format. * @param getTimeseries.endDate - End date of the period to analyze, in `YYYY-MM-DD` format. * @param getTimeseries.metric - Metrics to retrieve, as a comma-separated list. If not specified, all metrics are returned. * @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. * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. * @see getTimeseries for the plain version. */ getTimeseriesWithHTTPInfo({ id, startDate, endDate, metric, methods }: GetTimeseriesProps, requestOptions?: RequestOptions): Promise>; /** * Lists all A/B tests you configured for this application. * * Required API Key ACLs: * - analytics * @param listABTests - The listABTests object. * @param listABTests.offset - Position of the first item to return. * @param listABTests.limit - Number of items to return. * @param listABTests.indexPrefix - Index name prefix. Only A/B tests for indices starting with this string are included in the response. * @param listABTests.indexSuffix - Index name suffix. Only A/B tests for indices ending with this string are included in the response. * @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. * @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. * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. */ listABTests({ offset, limit, indexPrefix, indexSuffix, direction, methods }?: ListABTestsProps, requestOptions?: RequestOptions | undefined): Promise; /** * Lists all A/B tests you configured for this application. * * 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. * * Required API Key ACLs: * - analytics * @param listABTests - The listABTests object. * @param listABTests.offset - Position of the first item to return. * @param listABTests.limit - Number of items to return. * @param listABTests.indexPrefix - Index name prefix. Only A/B tests for indices starting with this string are included in the response. * @param listABTests.indexSuffix - Index name suffix. Only A/B tests for indices ending with this string are included in the response. * @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. * @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. * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. * @see listABTests for the plain version. */ listABTestsWithHTTPInfo({ offset, limit, indexPrefix, indexSuffix, direction, methods }?: ListABTestsProps, requestOptions?: RequestOptions | undefined): Promise>; /** * 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. * * Required API Key ACLs: * - analytics * - editSettings * @param saveVariantSettings - The saveVariantSettings object. * @param saveVariantSettings.id - Unique A/B test identifier. * @param saveVariantSettings.variantId - One-based index of the A/B test variant. The control is variant 1. * @param saveVariantSettings.saveSettingsRequest - The saveSettingsRequest object. * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. */ saveVariantSettings({ id, variantId, saveSettingsRequest }: SaveVariantSettingsProps, requestOptions?: RequestOptions): Promise; /** * 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. * * 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. * * Required API Key ACLs: * - analytics * - editSettings * @param saveVariantSettings - The saveVariantSettings object. * @param saveVariantSettings.id - Unique A/B test identifier. * @param saveVariantSettings.variantId - One-based index of the A/B test variant. The control is variant 1. * @param saveVariantSettings.saveSettingsRequest - The saveSettingsRequest object. * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. * @see saveVariantSettings for the plain version. */ saveVariantSettingsWithHTTPInfo({ id, variantId, saveSettingsRequest }: SaveVariantSettingsProps, requestOptions?: RequestOptions): Promise>; /** * Stops an A/B test by its ID. You can\'t restart stopped A/B tests. * * Required API Key ACLs: * - editSettings * @param stopABTest - The stopABTest object. * @param stopABTest.id - Unique A/B test identifier. * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. */ stopABTest({ id }: StopABTestProps, requestOptions?: RequestOptions): Promise; /** * Stops an A/B test by its ID. You can\'t restart stopped A/B tests. * * 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. * * Required API Key ACLs: * - editSettings * @param stopABTest - The stopABTest object. * @param stopABTest.id - Unique A/B test identifier. * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. * @see stopABTest for the plain version. */ stopABTestWithHTTPInfo({ id }: StopABTestProps, requestOptions?: RequestOptions): Promise>; }; type ConflictResponse = { /** * Status code. */ status: number; /** * Response message. */ message: string; }; /** * Error. */ type ErrorBase = Record & { message?: string | undefined; }; type AbtestingV3Client = ReturnType; declare function abtestingV3Client(appId: string, apiKey: string, region?: Region | undefined, options?: ClientOptions | undefined): AbtestingV3Client; export { type ABTest, type ABTestConfiguration, type ABTestResponse, type ABTestSettingsResponse, type AbTestsVariant, type AbTestsVariantSearchParams, type AbtestingV3Client, type AddABTestsRequest, type AddABTestsVariant, type AnalysisMethod, type ApplyVariantSettingsProps, type BayesianMetricResult, type ConflictResponse, type CreateMetric, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type CustomSearchParams, type Decision, type DeleteABTestProps, type Direction, type EffectMetric, type EmptySearchFilter, type ErrorBase, type ErrorCorrectionType, type EstimateABTestRequest, type EstimateABTestResponse, type EstimateConfiguration, type EvidenceStatus, type FeatureSettings, type FilterEffects, type GetABTestProps, type GetABTestSettingsProps, type GetTimeseriesProps, type ListABTestsProps, type ListABTestsResponse, type MetricDate, type MetricEvidence, type MetricMetadata, type MetricName, type MetricResult, type MetricsFilter, type MinimumDetectableEffect, type OutliersFilter, type PrimaryMetric, type Region, type RegionOptions, type SaveSettingsRequest, type SaveVariantSettingsProps, type Status, type StopABTestProps, type Timeseries, type TimeseriesVariant, type Variant, type VariantMetadata, type VariantSettings, abtestingV3Client, apiClientVersion };