@algolia/abtesting 1.21.2 → 1.22.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 +145 -3
- package/dist/builds/browser.js +312 -1
- package/dist/builds/browser.js.map +1 -1
- package/dist/builds/browser.min.js +5 -5
- package/dist/builds/browser.min.js.map +1 -1
- package/dist/builds/browser.umd.js +7 -7
- package/dist/builds/fetch.js +312 -1
- package/dist/builds/fetch.js.map +1 -1
- package/dist/builds/node.cjs +312 -1
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +312 -1
- package/dist/builds/node.js.map +1 -1
- package/dist/builds/worker.js +312 -1
- package/dist/builds/worker.js.map +1 -1
- package/dist/fetch.d.ts +145 -3
- package/dist/node.d.cts +145 -3
- package/dist/node.d.ts +145 -3
- package/dist/src/abtestingV3Client.cjs +312 -1
- package/dist/src/abtestingV3Client.cjs.map +1 -1
- package/dist/src/abtestingV3Client.js +312 -1
- package/dist/src/abtestingV3Client.js.map +1 -1
- package/dist/worker.d.ts +145 -3
- package/package.json +8 -8
|
@@ -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 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 { 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 CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteABTestProps,\n GetABTestProps,\n GetTimeseriesProps,\n ListABTestsProps,\n StopABTestProps,\n} from '../model/clientMethodProps';\n\nexport const apiClientVersion = '1.21.2';\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 /**\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 /**\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 /**\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 /**\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 /**\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 /**\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 /**\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 requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getABTest({ id }: 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 const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(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 - List of metrics to retrieve. If not specified, all metrics are returned.\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 }: 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 const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(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 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 }: 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 const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(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}\n"],"mappings":";AAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,0BAA0B;;;ACEnC,SAAS,YAAY,mBAAmB,iBAAiB,wBAAwB;AAsB1E,IAAM,mBAAmB;AAEzB,IAAM,UAAU,CAAC,MAAM,IAAI;AAIlC,SAAS,gBAAgB,QAAqC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,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 { 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 CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteABTestProps,\n GetABTestProps,\n GetTimeseriesProps,\n ListABTestsProps,\n StopABTestProps,\n} from '../model/clientMethodProps';\n\nexport const apiClientVersion = '1.22.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 * 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 requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getABTest({ id }: 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 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 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 }: 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 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 - List of metrics to retrieve. If not specified, all metrics are returned.\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 }: 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 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 - List of metrics to retrieve. If not specified, all metrics are returned.\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 }: 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 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 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 }: 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 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 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 }: 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 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 * 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;AAsB1E,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,KAA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 +1,6 @@
|
|
|
1
|
-
function
|
|
2
|
-
`&&(n=1));n<
|
|
3
|
-
`,n);if(
|
|
4
|
-
`?2:1:(
|
|
5
|
-
`),event:t,id:this.lastEventId,retry:this.retry};return this.data=[],e}};async function*he(t){let e=new fe;for await(let s of pe(t)){let r=e.decode(s);r!==null&&(yield r)}}var ge=750,J=120*1e3;function M(t,e="up"){let s=Date.now();function r(){return e==="up"||Date.now()-s>J}function a(){return e==="timed out"&&Date.now()-s<=J}return{...t,status:e,lastUpdate:s,isUp:r,isTimedOut:a}}var re=class extends Error{name="AlgoliaError";constructor(t,e){super(t),e&&(this.name=e)}};var se=class extends re{stackTrace;constructor(t,e,s){super(t,s),this.stackTrace=e}},Q=class extends se{constructor(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",t,"RetryError")}},$=class extends se{status;constructor(t,e,s,r="ApiError"){super(t,s,r),this.status=e}},ye=class extends re{response;constructor(t,e){super(t,"DeserializationError"),this.response=e}},Pe=class extends ${error;constructor(t,e,s,r){super(t,e,r,"DetailedApiError"),this.error=s}};function V(t,e,s){let r=Te(s),a=`${t.protocol}://${t.url}${t.port?`:${t.port}`:""}/${e.charAt(0)==="/"?e.substring(1):e}`;return r.length&&(a+=`?${r}`),a}function Te(t){return Object.keys(t).filter(e=>t[e]!==void 0).sort().map(e=>`${e}=${encodeURIComponent(Object.prototype.toString.call(t[e])==="[object Array]"?t[e].join(","):t[e]).replace(/\+/g,"%20")}`).join("&")}function X(t,e){if(t.method==="GET"||t.data===void 0&&e.data===void 0)return;let s=Array.isArray(t.data)?t.data:{...t.data,...e.data};return JSON.stringify(s)}function K(t,e,s){let r={Accept:"application/json",...t,...e,...s},a={};return Object.keys(r).forEach(d=>{let h=r[d];a[d.toLowerCase()]=h}),a}function Ae(t){if(!(t.status===204||t.content.length===0))try{return JSON.parse(t.content)}catch(e){throw new ye(e.message,t)}}function Ee({content:t,status:e},s){try{let r=JSON.parse(t);return"error"in r?new Pe(r.message,e,r.error,s):new $(r.message,e,s)}catch{}return new $(t,e,s)}function Re({isTimedOut:t,status:e}){return!t&&~~e===0}function ve({isTimedOut:t,status:e}){return t||Re({isTimedOut:t,status:e})||~~(e/100)!==2&&~~(e/100)!==4}function xe({status:t}){return~~(t/100)===2}function qe(t){return t.map(e=>oe(e))}function oe(t){let e=t.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...t,request:{...t.request,headers:{...t.request.headers,...e}}}}function ne({hosts:t,hostsCache:e,baseHeaders:s,logger:r,baseQueryParameters:a,algoliaAgent:d,timeouts:h,requester:c,requestsCache:o,responsesCache:n,compress:u,compression:p}){async function f(i){let l=await Promise.all(i.map(g=>e.get(g,()=>Promise.resolve(M(g))))),q=l.filter(g=>g.isUp()),R=l.filter(g=>g.isTimedOut()),x=[...q,...R];return{hosts:x.length>0?x:i,getTimeout(g,S){return(R.length===0&&g===0?1:R.length+3+g)*S}}}async function m(i,l,q){let R=[],x=X(i,l),A=K(s,i.headers,l.headers),g=p==="gzip"&&x!==void 0&&x.length>ge&&(i.method==="POST"||i.method==="PUT");g&&u===void 0&&r.info("Compression is disabled because no compress method is available.");let S=g&&u!==void 0,L=S?await u(x):x;S&&(A["content-encoding"]="gzip");let I=i.method==="GET"?{...i.data,...l.data}:{},b={...a,...i.queryParameters,...I};if(d.value&&(b["x-algolia-agent"]=d.value),l&&l.queryParameters)for(let E of Object.keys(l.queryParameters))!l.queryParameters[E]||Object.prototype.toString.call(l.queryParameters[E])==="[object Object]"?b[E]=l.queryParameters[E]:b[E]=l.queryParameters[E].toString();let B=0,_=async(E,k)=>{let C=E.pop();if(C===void 0)throw new Q(qe(R));let U={...h,...l.timeouts},G={data:L,headers:A,method:i.method,url:V(C,i.path,b),connectTimeout:k(B,U.connect),responseTimeout:k(B,q?U.read:U.write)},W=H=>{let z={request:G,response:H,host:C,triesLeft:E.length};return R.push(z),z},w=await c.send(G);if(ve(w)){let H=W(w);return w.isTimedOut&&B++,r.info("Retryable failure",oe(H)),await e.set(C,M(C,w.isTimedOut?"timed out":"down")),_(E,k)}if(xe(w))return Ae(w);throw W(w),Ee(w,R)},v=t.filter(E=>E.accept==="readWrite"||(q?E.accept==="read":E.accept==="write")),F=await f(v);return _([...F.hosts].reverse(),F.getTimeout)}function T(i,l={}){let q=()=>m(i,l,R),R=i.useReadTransporter||i.method==="GET";if((l.cacheable||i.cacheable)!==!0)return q();let A={request:i,requestOptions:l,transporter:{queryParameters:a,headers:s}};return n.get(A,()=>o.get(A,()=>o.set(A,q()).then(g=>Promise.all([o.delete(A),g]),g=>Promise.all([o.delete(A),Promise.reject(g)])).then(([g,S])=>S)),{miss:g=>n.set(A,g)})}async function*y(i,l={}){if(!c.sendStream)throw new Error("This requester does not support streaming");let q=X(i,l),R=K(s,i.headers,l.headers);R.accept="text/event-stream";let x=i.method==="GET"?{...i.data,...l.data}:{},A={...a,...i.queryParameters,...x};if(d.value&&(A["x-algolia-agent"]=d.value),l&&l.queryParameters)for(let v of Object.keys(l.queryParameters))!l.queryParameters[v]||Object.prototype.toString.call(l.queryParameters[v])==="[object Object]"?A[v]=l.queryParameters[v]:A[v]=l.queryParameters[v].toString();let g=i.useReadTransporter||i.method==="GET",S=t.filter(v=>v.accept==="readWrite"||(g?v.accept==="read":v.accept==="write")),I=(await f(S)).hosts[0];if(!I)throw new Q([]);let b={...h,...l.timeouts},B={data:q,headers:R,method:i.method,url:V(I,i.path,A),connectTimeout:b.connect,responseTimeout:g?b.read:b.write},_=await c.sendStream(B);yield*he(_)}return{hostsCache:e,requester:c,timeouts:h,logger:r,algoliaAgent:d,baseHeaders:s,baseQueryParameters:a,hosts:t,request:T,requestStream:y,requestsCache:o,responsesCache:n}}function P(t,e,s){if(s==null||typeof s=="string"&&s.length===0)throw new Error(`Parameter \`${t}\` is required when calling \`${e}\`.`)}function ae(){function t(e){return new Promise(s=>{let r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach(c=>r.setRequestHeader(c,e.headers[c]));let a=(c,o)=>setTimeout(()=>{r.abort(),s({status:0,content:o,isTimedOut:!0})},c),d=a(e.connectTimeout,"Connection timeout"),h;r.onreadystatechange=()=>{r.readyState>r.OPENED&&h===void 0&&(clearTimeout(d),h=a(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{r.status===0&&(clearTimeout(d),clearTimeout(h),s({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(d),clearTimeout(h),s({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)})}return{send:t}}var D="1.21.2",j=["de","us"];function Se(t){return[{url:t?"analytics.{region}.algolia.com".replace("{region}",t):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]}function ie({appId:t,apiKey:e,authMode:s,algoliaAgents:r,region:a,...d}){let h=Z(t,e,s),c=ne({hosts:Se(a),...d,algoliaAgent:ee({algoliaAgents:r,client:"AbtestingV3",version:D}),baseHeaders:{"content-type":"text/plain",...h.headers(),...d.baseHeaders},baseQueryParameters:{...h.queryParameters(),...d.baseQueryParameters}});return{transporter:c,appId:t,apiKey:e,clearCache(){return Promise.all([c.requestsCache.clear(),c.responsesCache.clear()]).then(()=>{})},get _ua(){return c.algoliaAgent.value},addAlgoliaAgent(o,n){c.algoliaAgent.add({segment:o,version:n})},setClientApiKey({apiKey:o}){!s||s==="WithinHeaders"?c.baseHeaders["x-algolia-api-key"]=o:c.baseQueryParameters["x-algolia-api-key"]=o},addABTests(o,n){P("addABTestsRequest","addABTests",o),P("addABTestsRequest.name","addABTests",o.name),P("addABTestsRequest.variants","addABTests",o.variants),P("addABTestsRequest.metrics","addABTests",o.metrics),P("addABTestsRequest.endAt","addABTests",o.endAt);let m={method:"POST",path:"/3/abtests",queryParameters:{},headers:{},data:o};return c.request(m,n)},customDelete({path:o,parameters:n},u){P("path","customDelete",o);let T={method:"DELETE",path:"/{path}".replace("{path}",o),queryParameters:n||{},headers:{}};return c.request(T,u)},customGet({path:o,parameters:n},u){P("path","customGet",o);let T={method:"GET",path:"/{path}".replace("{path}",o),queryParameters:n||{},headers:{}};return c.request(T,u)},customPost({path:o,parameters:n,body:u},p){P("path","customPost",o);let y={method:"POST",path:"/{path}".replace("{path}",o),queryParameters:n||{},headers:{},data:u||{}};return c.request(y,p)},customPut({path:o,parameters:n,body:u},p){P("path","customPut",o);let y={method:"PUT",path:"/{path}".replace("{path}",o),queryParameters:n||{},headers:{},data:u||{}};return c.request(y,p)},deleteABTest({id:o},n){P("id","deleteABTest",o);let m={method:"DELETE",path:"/3/abtests/{id}".replace("{id}",encodeURIComponent(o)),queryParameters:{},headers:{}};return c.request(m,n)},estimateABTest(o,n){P("estimateABTestRequest","estimateABTest",o),P("estimateABTestRequest.configuration","estimateABTest",o.configuration),P("estimateABTestRequest.variants","estimateABTest",o.variants);let m={method:"POST",path:"/3/abtests/estimate",queryParameters:{},headers:{},data:o};return c.request(m,n)},getABTest({id:o},n){P("id","getABTest",o);let m={method:"GET",path:"/3/abtests/{id}".replace("{id}",encodeURIComponent(o)),queryParameters:{},headers:{}};return c.request(m,n)},getTimeseries({id:o,startDate:n,endDate:u,metric:p},f){P("id","getTimeseries",o);let m="/3/abtests/{id}/timeseries".replace("{id}",encodeURIComponent(o)),T={},y={};n!==void 0&&(y.startDate=n.toString()),u!==void 0&&(y.endDate=u.toString()),p!==void 0&&(y.metric=p.toString());let i={method:"GET",path:m,queryParameters:y,headers:T};return c.request(i,f)},listABTests({offset:o,limit:n,indexPrefix:u,indexSuffix:p,direction:f}={},m=void 0){let T="/3/abtests",y={},i={};o!==void 0&&(i.offset=o.toString()),n!==void 0&&(i.limit=n.toString()),u!==void 0&&(i.indexPrefix=u.toString()),p!==void 0&&(i.indexSuffix=p.toString()),f!==void 0&&(i.direction=f.toString());let l={method:"GET",path:T,queryParameters:i,headers:y};return c.request(l,m)},stopABTest({id:o},n){P("id","stopABTest",o);let m={method:"POST",path:"/3/abtests/{id}/stop".replace("{id}",encodeURIComponent(o)),queryParameters:{},headers:{}};return c.request(m,n)}}}function At(t,e,s,r){if(!t||typeof t!="string")throw new Error("`appId` is missing.");if(!e||typeof e!="string")throw new Error("`apiKey` is missing.");if(s&&(typeof s!="string"||!j.includes(s)))throw new Error(`\`region\` must be one of the following: ${j.join(", ")}`);let{compression:a,...d}=r||{};return ie({appId:t,apiKey:e,region:s,timeouts:{connect:1e3,read:2e3,write:3e4},logger:te(),requester:ae(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:N(),requestsCache:N({serializable:!1}),hostsCache:O({caches:[Y({key:`${D}-${t}`}),N()]}),...d})}export{At as abtestingV3Client,D as apiClientVersion};
|
|
1
|
+
function Z(e){let t,o=`algolia-client-js-${e.key}`;function s(){return t===void 0&&(t=e.localStorage||window.localStorage),t}function d(){return JSON.parse(s().getItem(o)||"{}")}function f(r){s().setItem(o,JSON.stringify(r))}function y(){return new Promise(r=>setTimeout(r,0))}function i(){let r=e.timeToLive?e.timeToLive*1e3:null,n=d(),a=new Date().getTime(),c=!1;return{namespace:Object.fromEntries(Object.entries(n).filter(([,u])=>!u||u.timestamp===void 0||r&&u.timestamp+r<a?(c=!0,!1):!0)),changed:c}}return{get(r,n,a={miss:()=>Promise.resolve()}){return y().then(()=>{let{namespace:c,changed:l}=i(),u=c[JSON.stringify(r)];return l&&f(c),u?u.value:n().then(T=>a.miss(T).then(()=>T))})},set(r,n){return y().then(()=>{let a=d();return a[JSON.stringify(r)]={timestamp:new Date().getTime(),value:n},s().setItem(o,JSON.stringify(a)),n})},delete(r){return y().then(()=>{let n=d();delete n[JSON.stringify(r)],s().setItem(o,JSON.stringify(n))})},clear(){return Promise.resolve().then(()=>{s().removeItem(o)})}}}function de(){return{get(e,t,o={miss:()=>Promise.resolve()}){return t().then(d=>Promise.all([d,o.miss(d)])).then(([d])=>d)},set(e,t){return Promise.resolve(t)},delete(e){return Promise.resolve()},clear(){return Promise.resolve()}}}function b(e){let t=[...e.caches],o=t.shift();return o===void 0?de():{get(s,d,f={miss:()=>Promise.resolve()}){return o.get(s,d,f).catch(()=>b({caches:t}).get(s,d,f))},set(s,d){return o.set(s,d).catch(()=>b({caches:t}).set(s,d))},delete(s){return o.delete(s).catch(()=>b({caches:t}).delete(s))},clear(){return o.clear().catch(()=>b({caches:t}).clear())}}}function D(e={serializable:!0}){let t={};return{get(o,s,d={miss:()=>Promise.resolve()}){let f=JSON.stringify(o);if(f in t)return Promise.resolve(e.serializable?JSON.parse(t[f]):t[f]);let y=s();return y.then(i=>d.miss(i)).then(()=>y)},set(o,s){return t[JSON.stringify(o)]=e.serializable?JSON.stringify(s):s,Promise.resolve(s)},delete(o){return delete t[JSON.stringify(o)],Promise.resolve()},clear(){return t={},Promise.resolve()}}}function le(e){let t={value:`Algolia for JavaScript (${e})`,add(o){let s=`; ${o.segment}${o.version!==void 0?` (${o.version})`:""}`;return t.value.indexOf(s)===-1&&(t.value=`${t.value}${s}`),t}};return t}function ee(e,t,o="WithinHeaders"){let s={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers(){return o==="WithinHeaders"?s:{}},queryParameters(){return o==="WithinQueryParameters"?s:{}}}}function te({algoliaAgents:e,client:t,version:o}){let s=le(o).add({segment:t,version:o});return e.forEach(d=>s.add(d)),s}function re(){return{debug(e,t){return Promise.resolve()},info(e,t){return Promise.resolve()},error(e,t){return Promise.resolve()}}}var me=10*1024*1024;async function*pe(e){let t=e.getReader();try{for(;;){let{done:o,value:s}=await t.read();if(o)return;yield s}}finally{t.releaseLock()}}function he(e){return Symbol.asyncIterator in e?e:pe(e)}async function*fe(e){let t=new TextDecoder("utf-8"),o=[],s=0,d=!1,f=!0;for await(let i of he(e)){let r=t.decode(i,{stream:!0}),n=0;for(d&&(d=!1,r.length>0&&r[0]===`
|
|
2
|
+
`&&(n=1));n<r.length;){let a=r.indexOf("\r",n),c=r.indexOf(`
|
|
3
|
+
`,n);if(a===-1&&c===-1){let q=r.slice(n);if(o.push(q),s+=q.length,s>me)throw new Error("SSE line buffer exceeded 10MB");break}let l,u;a!==-1&&(c===-1||a<c)?(l=a,a+1<r.length?u=r[a+1]===`
|
|
4
|
+
`?2:1:(d=!0,u=1)):(l=c,u=1);let T=r.slice(n,l);o.push(T);let P=o.length===1?o[0]:o.join("");o.length=0,s=0,f&&(P.startsWith("\uFEFF")&&(P=P.slice(1)),f=!1),yield P,n=l+u}}let y=t.decode();if(y&&o.push(y),o.length>0){let i=o.join("");f&&i.startsWith("\uFEFF")&&(i=i.slice(1)),yield i}}var Pe=class{data=[];eventType="";lastEventId=null;retry=null;decode(e){if(e==="")return this.dispatch();if(e[0]===":")return null;let t=e.indexOf(":"),o,s;switch(t===-1?(o=e,s=""):(o=e.slice(0,t),s=e.slice(t+1),s[0]===" "&&(s=s.slice(1))),o){case"data":this.data.push(s);break;case"event":this.eventType=s;break;case"id":s.includes("\0")||(this.lastEventId=s);break;case"retry":/^[0-9]+$/.test(s)&&(this.retry=parseInt(s,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*Te(e){let t=new Pe;for await(let o of fe(e)){let s=t.decode(o);s!==null&&(yield s)}}var ge=750,J=120*1e3;function M(e,t="up"){let o=Date.now();function s(){return t==="up"||Date.now()-o>J}function d(){return t==="timed out"&&Date.now()-o<=J}return{...e,status:t,lastUpdate:o,isUp:s,isTimedOut:d}}var se=class extends Error{name="AlgoliaError";constructor(e,t){super(e),t&&(this.name=t)}};var oe=class extends se{stackTrace;constructor(e,t,o){super(e,o),this.stackTrace=t}},V=class extends oe{constructor(e){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")}},G=class extends oe{status;constructor(e,t,o,s="ApiError"){super(e,o,s),this.status=t}},ye=class extends se{response;constructor(e,t){super(e,"DeserializationError"),this.response=t}},qe=class extends G{error;constructor(e,t,o,s){super(e,t,s,"DetailedApiError"),this.error=o}};function X(e,t,o){let s=Ae(o),d=`${e.protocol}://${e.url}${e.port?`:${e.port}`:""}/${t.charAt(0)==="/"?t.substring(1):t}`;return s.length&&(d+=`?${s}`),d}function Ae(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 K(e,t){if(e.method==="GET"||e.data===void 0&&t.data===void 0)return;let o=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(o)}function Y(e,t,o){let s={Accept:"application/json",...e,...t,...o},d={};return Object.keys(s).forEach(f=>{let y=s[f];d[f.toLowerCase()]=y}),d}function ne(e){if(!(e.status===204||e.content.length===0))try{return JSON.parse(e.content)}catch(t){throw new ye(t.message,e)}}function Re(e){return{status:e.status,headers:e.headers,content:e.content,data:ne(e)}}function Ee({content:e,status:t},o){try{let s=JSON.parse(e);return"error"in s?new qe(s.message,t,s.error,o):new G(s.message,t,o)}catch{}return new G(e,t,o)}function ve({isTimedOut:e,status:t}){return!e&&~~t===0}function Ie({isTimedOut:e,status:t}){return e||ve({isTimedOut:e,status:t})||~~(t/100)!==2&&~~(t/100)!==4}function He({status:e}){return~~(e/100)===2}function Se(e){return e.map(t=>ae(t))}function ae(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 ie({hosts:e,hostsCache:t,baseHeaders:o,logger:s,baseQueryParameters:d,algoliaAgent:f,timeouts:y,requester:i,requestsCache:r,responsesCache:n,compress:a,compression:c}){async function l(m){let h=await Promise.all(m.map(g=>t.get(g,()=>Promise.resolve(M(g))))),I=h.filter(g=>g.isUp()),R=h.filter(g=>g.isTimedOut()),H=[...I,...R];return{hosts:H.length>0?H:m,getTimeout(g,S){return(R.length===0&&g===0?1:R.length+3+g)*S}}}async function u(m,h,I){let R=[],H=K(m,h),A=Y(o,m.headers,h.headers),g=c==="gzip"&&H!==void 0&&H.length>ge&&(m.method==="POST"||m.method==="PUT");g&&a===void 0&&s.info("Compression is disabled because no compress method is available.");let S=g&&a!==void 0,_=S?await a(H):H;S&&(A["content-encoding"]="gzip");let C=m.method==="GET"?{...m.data,...h.data}:{},x={...d,...m.queryParameters,...C};if(f.value&&(x["x-algolia-agent"]=f.value),h&&h.queryParameters)for(let E of Object.keys(h.queryParameters))!h.queryParameters[E]||Object.prototype.toString.call(h.queryParameters[E])==="[object Object]"?x[E]=h.queryParameters[E]:x[E]=h.queryParameters[E].toString();let w=0,W=async(E,N)=>{let O=E.pop();if(O===void 0)throw new V(Se(R));let k={...y,...h.timeouts},j={data:_,headers:A,method:m.method,url:X(O,m.path,x),connectTimeout:N(w,k.connect),responseTimeout:N(w,I?k.read:k.write)},F=U=>{let z={request:j,response:U,host:O,triesLeft:E.length};return R.push(z),z},B=await i.send(j);if(Ie(B)){let U=F(B);return B.isTimedOut&&w++,s.info("Retryable failure",ae(U)),await t.set(O,M(O,B.isTimedOut?"timed out":"down")),W(E,N)}if(He(B))return B;throw F(B),Ee(B,R)},v=e.filter(E=>E.accept==="readWrite"||(I?E.accept==="read":E.accept==="write")),$=await l(v);return W([...$.hosts].reverse(),$.getTimeout)}function T(m,h={}){let I=()=>u(m,h,R).then(g=>ne(g)),R=m.useReadTransporter||m.method==="GET";if((h.cacheable||m.cacheable)!==!0)return I();let A={request:m,requestOptions:h,transporter:{queryParameters:d,headers:o}};return n.get(A,()=>r.get(A,()=>r.set(A,I()).then(g=>Promise.all([r.delete(A),g]),g=>Promise.all([r.delete(A),Promise.reject(g)])).then(([g,S])=>S)),{miss:g=>n.set(A,g)})}function P(m,h={}){let I=m.useReadTransporter||m.method==="GET";return u(m,h,I).then(R=>Re(R))}async function*q(m,h={}){if(!i.sendStream)throw new Error("This requester does not support streaming");let I=K(m,h),R=Y(o,m.headers,h.headers);R.accept="text/event-stream";let H=m.method==="GET"?{...m.data,...h.data}:{},A={...d,...m.queryParameters,...H};if(f.value&&(A["x-algolia-agent"]=f.value),h&&h.queryParameters)for(let v of Object.keys(h.queryParameters))!h.queryParameters[v]||Object.prototype.toString.call(h.queryParameters[v])==="[object Object]"?A[v]=h.queryParameters[v]:A[v]=h.queryParameters[v].toString();let g=m.useReadTransporter||m.method==="GET",S=e.filter(v=>v.accept==="readWrite"||(g?v.accept==="read":v.accept==="write")),C=(await l(S)).hosts[0];if(!C)throw new V([]);let x={...y,...h.timeouts},w={data:I,headers:R,method:m.method,url:X(C,m.path,A),connectTimeout:x.connect,responseTimeout:g?x.read:x.write},W=await i.sendStream(w);yield*Te(W)}return{hostsCache:t,requester:i,timeouts:y,logger:s,algoliaAgent:f,baseHeaders:o,baseQueryParameters:d,hosts:e,request:T,requestWithHttpInfo:P,requestStream:q,requestsCache:r,responsesCache:n}}function p(e,t,o){if(o==null||typeof o=="string"&&o.length===0)throw new Error(`Parameter \`${e}\` is required when calling \`${t}\`.`)}function xe(e){let t={};for(let o of e.trim().split(/[\r\n]+/)){let s=o.indexOf(": ");s>0&&(t[o.slice(0,s).toLowerCase()]=o.slice(s+2))}return t}function ue(){function e(t){return new Promise(o=>{let s=new XMLHttpRequest;s.open(t.method,t.url,!0),Object.keys(t.headers).forEach(i=>s.setRequestHeader(i,t.headers[i]));let d=(i,r)=>setTimeout(()=>{s.abort(),o({status:0,content:r,isTimedOut:!0})},i),f=d(t.connectTimeout,"Connection timeout"),y;s.onreadystatechange=()=>{s.readyState>s.OPENED&&y===void 0&&(clearTimeout(f),y=d(t.responseTimeout,"Socket timeout"))},s.onerror=()=>{s.status===0&&(clearTimeout(f),clearTimeout(y),o({content:s.responseText||"Network request failed",status:s.status,isTimedOut:!1}))},s.onload=()=>{clearTimeout(f),clearTimeout(y),o({content:s.responseText,headers:xe(s.getAllResponseHeaders()),status:s.status,isTimedOut:!1})},s.send(t.data)})}return{send:e}}var L="1.22.0",Q=["de","us"];function Be(e){return[{url:e?"analytics.{region}.algolia.com".replace("{region}",e):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]}function ce({appId:e,apiKey:t,authMode:o,algoliaAgents:s,region:d,...f}){let y=ee(e,t,o),i=ie({hosts:Be(d),...f,algoliaAgent:te({algoliaAgents:s,client:"AbtestingV3",version:L}),baseHeaders:{"content-type":"text/plain",...y.headers(),...f.baseHeaders},baseQueryParameters:{...y.queryParameters(),...f.baseQueryParameters}});return{transporter:i,appId:e,apiKey:t,clearCache(){return Promise.all([i.requestsCache.clear(),i.responsesCache.clear()]).then(()=>{})},get _ua(){return i.algoliaAgent.value},addAlgoliaAgent(r,n){i.algoliaAgent.add({segment:r,version:n})},setClientApiKey({apiKey:r}){!o||o==="WithinHeaders"?i.baseHeaders["x-algolia-api-key"]=r:i.baseQueryParameters["x-algolia-api-key"]=r},addABTests(r,n){p("addABTestsRequest","addABTests",r),p("addABTestsRequest.name","addABTests",r.name),p("addABTestsRequest.variants","addABTests",r.variants),p("addABTestsRequest.metrics","addABTests",r.metrics),p("addABTestsRequest.endAt","addABTests",r.endAt);let u={method:"POST",path:"/3/abtests",queryParameters:{},headers:{},data:r};return i.request(u,n)},addABTestsWithHTTPInfo(r,n){p("addABTestsRequest","addABTestsWithHTTPInfo",r),p("addABTestsRequest.name","addABTestsWithHTTPInfo",r.name),p("addABTestsRequest.variants","addABTestsWithHTTPInfo",r.variants),p("addABTestsRequest.metrics","addABTestsWithHTTPInfo",r.metrics),p("addABTestsRequest.endAt","addABTestsWithHTTPInfo",r.endAt);let u={method:"POST",path:"/3/abtests",queryParameters:{},headers:{},data:r};return i.requestWithHttpInfo(u,n)},customDelete({path:r,parameters:n},a){p("path","customDelete",r);let T={method:"DELETE",path:"/{path}".replace("{path}",r),queryParameters:n||{},headers:{}};return i.request(T,a)},customDeleteWithHTTPInfo({path:r,parameters:n},a){p("path","customDeleteWithHTTPInfo",r);let T={method:"DELETE",path:"/{path}".replace("{path}",r),queryParameters:n||{},headers:{}};return i.requestWithHttpInfo(T,a)},customGet({path:r,parameters:n},a){p("path","customGet",r);let T={method:"GET",path:"/{path}".replace("{path}",r),queryParameters:n||{},headers:{}};return i.request(T,a)},customGetWithHTTPInfo({path:r,parameters:n},a){p("path","customGetWithHTTPInfo",r);let T={method:"GET",path:"/{path}".replace("{path}",r),queryParameters:n||{},headers:{}};return i.requestWithHttpInfo(T,a)},customPost({path:r,parameters:n,body:a},c){p("path","customPost",r);let P={method:"POST",path:"/{path}".replace("{path}",r),queryParameters:n||{},headers:{},data:a||{}};return i.request(P,c)},customPostWithHTTPInfo({path:r,parameters:n,body:a},c){p("path","customPostWithHTTPInfo",r);let P={method:"POST",path:"/{path}".replace("{path}",r),queryParameters:n||{},headers:{},data:a||{}};return i.requestWithHttpInfo(P,c)},customPut({path:r,parameters:n,body:a},c){p("path","customPut",r);let P={method:"PUT",path:"/{path}".replace("{path}",r),queryParameters:n||{},headers:{},data:a||{}};return i.request(P,c)},customPutWithHTTPInfo({path:r,parameters:n,body:a},c){p("path","customPutWithHTTPInfo",r);let P={method:"PUT",path:"/{path}".replace("{path}",r),queryParameters:n||{},headers:{},data:a||{}};return i.requestWithHttpInfo(P,c)},deleteABTest({id:r},n){p("id","deleteABTest",r);let u={method:"DELETE",path:"/3/abtests/{id}".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return i.request(u,n)},deleteABTestWithHTTPInfo({id:r},n){p("id","deleteABTestWithHTTPInfo",r);let u={method:"DELETE",path:"/3/abtests/{id}".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(u,n)},estimateABTest(r,n){p("estimateABTestRequest","estimateABTest",r),p("estimateABTestRequest.configuration","estimateABTest",r.configuration),p("estimateABTestRequest.variants","estimateABTest",r.variants);let u={method:"POST",path:"/3/abtests/estimate",queryParameters:{},headers:{},data:r};return i.request(u,n)},estimateABTestWithHTTPInfo(r,n){p("estimateABTestRequest","estimateABTestWithHTTPInfo",r),p("estimateABTestRequest.configuration","estimateABTestWithHTTPInfo",r.configuration),p("estimateABTestRequest.variants","estimateABTestWithHTTPInfo",r.variants);let u={method:"POST",path:"/3/abtests/estimate",queryParameters:{},headers:{},data:r};return i.requestWithHttpInfo(u,n)},getABTest({id:r},n){p("id","getABTest",r);let u={method:"GET",path:"/3/abtests/{id}".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return i.request(u,n)},getABTestWithHTTPInfo({id:r},n){p("id","getABTestWithHTTPInfo",r);let u={method:"GET",path:"/3/abtests/{id}".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(u,n)},getTimeseries({id:r,startDate:n,endDate:a,metric:c},l){p("id","getTimeseries",r);let u="/3/abtests/{id}/timeseries".replace("{id}",encodeURIComponent(r)),T={},P={};n!==void 0&&(P.startDate=n.toString()),a!==void 0&&(P.endDate=a.toString()),c!==void 0&&(P.metric=c.toString());let q={method:"GET",path:u,queryParameters:P,headers:T};return i.request(q,l)},getTimeseriesWithHTTPInfo({id:r,startDate:n,endDate:a,metric:c},l){p("id","getTimeseriesWithHTTPInfo",r);let u="/3/abtests/{id}/timeseries".replace("{id}",encodeURIComponent(r)),T={},P={};n!==void 0&&(P.startDate=n.toString()),a!==void 0&&(P.endDate=a.toString()),c!==void 0&&(P.metric=c.toString());let q={method:"GET",path:u,queryParameters:P,headers:T};return i.requestWithHttpInfo(q,l)},listABTests({offset:r,limit:n,indexPrefix:a,indexSuffix:c,direction:l}={},u=void 0){let T="/3/abtests",P={},q={};r!==void 0&&(q.offset=r.toString()),n!==void 0&&(q.limit=n.toString()),a!==void 0&&(q.indexPrefix=a.toString()),c!==void 0&&(q.indexSuffix=c.toString()),l!==void 0&&(q.direction=l.toString());let m={method:"GET",path:T,queryParameters:q,headers:P};return i.request(m,u)},listABTestsWithHTTPInfo({offset:r,limit:n,indexPrefix:a,indexSuffix:c,direction:l}={},u=void 0){let T="/3/abtests",P={},q={};r!==void 0&&(q.offset=r.toString()),n!==void 0&&(q.limit=n.toString()),a!==void 0&&(q.indexPrefix=a.toString()),c!==void 0&&(q.indexSuffix=c.toString()),l!==void 0&&(q.direction=l.toString());let m={method:"GET",path:T,queryParameters:q,headers:P};return i.requestWithHttpInfo(m,u)},stopABTest({id:r},n){p("id","stopABTest",r);let u={method:"POST",path:"/3/abtests/{id}/stop".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return i.request(u,n)},stopABTestWithHTTPInfo({id:r},n){p("id","stopABTestWithHTTPInfo",r);let u={method:"POST",path:"/3/abtests/{id}/stop".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(u,n)}}}function Et(e,t,o,s){if(!e||typeof e!="string")throw new Error("`appId` is missing.");if(!t||typeof t!="string")throw new Error("`apiKey` is missing.");if(o&&(typeof o!="string"||!Q.includes(o)))throw new Error(`\`region\` must be one of the following: ${Q.join(", ")}`);let{compression:d,...f}=s||{};return ce({appId:e,apiKey:t,region:o,timeouts:{connect:1e3,read:2e3,write:3e4},logger:re(),requester:ue(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:D(),requestsCache:D({serializable:!1}),hostsCache:b({caches:[Z({key:`${L}-${e}`}),D()]}),...f})}export{Et as abtestingV3Client,L as apiClientVersion};
|
|
6
6
|
//# sourceMappingURL=browser.min.js.map
|