algoliasearch 5.2.4-beta.6 → 5.2.5
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/dist/algoliasearch.umd.js +8 -8
- package/dist/browser.d.ts +1 -2
- package/dist/browser.min.js +1 -1
- package/dist/browser.min.js.map +1 -1
- package/dist/lite/browser.d.ts +1 -1
- package/dist/lite/builds/browser.js +1 -1
- package/dist/lite/builds/browser.js.map +1 -1
- package/dist/lite/builds/browser.min.js +1 -1
- package/dist/lite/builds/browser.min.js.map +1 -1
- package/dist/lite/builds/browser.umd.js +3 -3
- package/dist/lite/builds/node.cjs +1 -1
- package/dist/lite/builds/node.cjs.map +1 -1
- package/dist/lite/builds/node.js +1 -1
- package/dist/lite/builds/node.js.map +1 -1
- package/dist/lite/node.d.cts +1 -1
- package/dist/lite/node.d.ts +1 -1
- package/dist/lite/src/liteClient.cjs +1 -1
- package/dist/lite/src/liteClient.cjs.map +1 -1
- package/dist/lite/src/liteClient.js +1 -1
- package/dist/lite/src/liteClient.js.map +1 -1
- package/dist/node.d.cts +1 -2
- package/dist/node.d.ts +1 -2
- package/index.d.ts +1 -0
- package/lite/src/liteClient.ts +1 -1
- package/package.json +9 -9
package/dist/browser.min.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../node_modules/.pnpm/@algolia+client-abtesting@5.2.4/node_modules/@algolia/client-abtesting/dist/client-abtesting.esm.browser.js","../node_modules/.pnpm/@algolia+client-analytics@5.2.4/node_modules/@algolia/client-analytics/dist/client-analytics.esm.browser.js","../node_modules/.pnpm/@algolia+client-common@5.2.4/node_modules/@algolia/client-common/dist/client-common.esm.node.js","../node_modules/.pnpm/@algolia+client-personalization@5.2.4/node_modules/@algolia/client-personalization/dist/client-personalization.esm.browser.js","../node_modules/.pnpm/@algolia+client-search@5.2.4/node_modules/@algolia/client-search/dist/client-search.esm.browser.js","../node_modules/.pnpm/@algolia+recommend@5.2.4/node_modules/@algolia/recommend/dist/recommend.esm.browser.js","../node_modules/.pnpm/@algolia+requester-browser-xhr@5.2.4/node_modules/@algolia/requester-browser-xhr/dist/requester-browser-xhr.esm.node.js","../builds/browser.ts"],"sourcesContent":["function createAuth(appId, apiKey, authMode = 'WithinHeaders') {\n const credentials = {\n 'x-algolia-api-key': apiKey,\n 'x-algolia-application-id': appId\n };\n return {\n headers() {\n return authMode === 'WithinHeaders' ? credentials : {};\n },\n queryParameters() {\n return authMode === 'WithinQueryParameters' ? credentials : {};\n }\n };\n}\n\nfunction createBrowserLocalStorageCache(options) {\n let storage;\n // We've changed the namespace to avoid conflicts with v4, as this version is a huge breaking change\n const namespaceKey = `algolia-client-js-${options.key}`;\n function getStorage() {\n if (storage === undefined) {\n storage = options.localStorage || window.localStorage;\n }\n return storage;\n }\n function getNamespace() {\n return JSON.parse(getStorage().getItem(namespaceKey) || '{}');\n }\n function setNamespace(namespace) {\n getStorage().setItem(namespaceKey, JSON.stringify(namespace));\n }\n function removeOutdatedCacheItems() {\n const timeToLive = options.timeToLive ? options.timeToLive * 1000 : null;\n const namespace = getNamespace();\n const filteredNamespaceWithoutOldFormattedCacheItems = Object.fromEntries(Object.entries(namespace).filter(([, cacheItem]) => {\n return cacheItem.timestamp !== undefined;\n }));\n setNamespace(filteredNamespaceWithoutOldFormattedCacheItems);\n if (!timeToLive) {\n return;\n }\n const filteredNamespaceWithoutExpiredItems = Object.fromEntries(Object.entries(filteredNamespaceWithoutOldFormattedCacheItems).filter(([, cacheItem]) => {\n const currentTimestamp = new Date().getTime();\n const isExpired = cacheItem.timestamp + timeToLive < currentTimestamp;\n return !isExpired;\n }));\n setNamespace(filteredNamespaceWithoutExpiredItems);\n }\n return {\n get(key, defaultValue, events = {\n miss: () => Promise.resolve()\n }) {\n return Promise.resolve().then(() => {\n removeOutdatedCacheItems();\n return getNamespace()[JSON.stringify(key)];\n }).then(value => {\n return Promise.all([value ? value.value : defaultValue(), value !== undefined]);\n }).then(([value, exists]) => {\n return Promise.all([value, exists || events.miss(value)]);\n }).then(([value]) => value);\n },\n set(key, value) {\n return Promise.resolve().then(() => {\n const namespace = getNamespace();\n namespace[JSON.stringify(key)] = {\n timestamp: new Date().getTime(),\n value\n };\n getStorage().setItem(namespaceKey, JSON.stringify(namespace));\n return value;\n });\n },\n delete(key) {\n return Promise.resolve().then(() => {\n const namespace = getNamespace();\n delete namespace[JSON.stringify(key)];\n getStorage().setItem(namespaceKey, JSON.stringify(namespace));\n });\n },\n clear() {\n return Promise.resolve().then(() => {\n getStorage().removeItem(namespaceKey);\n });\n }\n };\n}\n\nfunction createNullCache() {\n return {\n get(_key, defaultValue, events = {\n miss: () => Promise.resolve()\n }) {\n const value = defaultValue();\n return value.then(result => Promise.all([result, events.miss(result)])).then(([result]) => result);\n },\n set(_key, value) {\n return Promise.resolve(value);\n },\n delete(_key) {\n return Promise.resolve();\n },\n clear() {\n return Promise.resolve();\n }\n };\n}\n\nfunction createFallbackableCache(options) {\n const caches = [...options.caches];\n const current = caches.shift();\n if (current === undefined) {\n return createNullCache();\n }\n return {\n get(key, defaultValue, events = {\n miss: () => Promise.resolve()\n }) {\n return current.get(key, defaultValue, events).catch(() => {\n return createFallbackableCache({\n caches\n }).get(key, defaultValue, events);\n });\n },\n set(key, value) {\n return current.set(key, value).catch(() => {\n return createFallbackableCache({\n caches\n }).set(key, value);\n });\n },\n delete(key) {\n return current.delete(key).catch(() => {\n return createFallbackableCache({\n caches\n }).delete(key);\n });\n },\n clear() {\n return current.clear().catch(() => {\n return createFallbackableCache({\n caches\n }).clear();\n });\n }\n };\n}\n\nfunction createMemoryCache(options = {\n serializable: true\n}) {\n let cache = {};\n return {\n get(key, defaultValue, events = {\n miss: () => Promise.resolve()\n }) {\n const keyAsString = JSON.stringify(key);\n if (keyAsString in cache) {\n return Promise.resolve(options.serializable ? JSON.parse(cache[keyAsString]) : cache[keyAsString]);\n }\n const promise = defaultValue();\n return promise.then(value => events.miss(value)).then(() => promise);\n },\n set(key, value) {\n cache[JSON.stringify(key)] = options.serializable ? JSON.stringify(value) : value;\n return Promise.resolve(value);\n },\n delete(key) {\n delete cache[JSON.stringify(key)];\n return Promise.resolve();\n },\n clear() {\n cache = {};\n return Promise.resolve();\n }\n };\n}\n\n// By default, API Clients at Algolia have expiration delay of 5 mins.\n// In the JavaScript client, we have 2 mins.\nconst EXPIRATION_DELAY = 2 * 60 * 1000;\nfunction createStatefulHost(host, status = 'up') {\n const lastUpdate = Date.now();\n function isUp() {\n return status === 'up' || Date.now() - lastUpdate > EXPIRATION_DELAY;\n }\n function isTimedOut() {\n return status === 'timed out' && Date.now() - lastUpdate <= EXPIRATION_DELAY;\n }\n return {\n ...host,\n status,\n lastUpdate,\n isUp,\n isTimedOut\n };\n}\n\nfunction _defineProperty(e, r, t) {\n return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nfunction _toPrimitive(t, r) {\n if (\"object\" != typeof t || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != typeof i) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nfunction _toPropertyKey(t) {\n var i = _toPrimitive(t, \"string\");\n return \"symbol\" == typeof i ? i : i + \"\";\n}\n\nclass AlgoliaError extends Error {\n constructor(message, name) {\n super(message);\n _defineProperty(this, \"name\", 'AlgoliaError');\n if (name) {\n this.name = name;\n }\n }\n}\nclass ErrorWithStackTrace extends AlgoliaError {\n constructor(message, stackTrace, name) {\n super(message, name);\n // the array and object should be frozen to reflect the stackTrace at the time of the error\n _defineProperty(this, \"stackTrace\", void 0);\n this.stackTrace = stackTrace;\n }\n}\nclass RetryError extends ErrorWithStackTrace {\n constructor(stackTrace) {\n super('Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.', stackTrace, 'RetryError');\n }\n}\nclass ApiError extends ErrorWithStackTrace {\n constructor(message, status, stackTrace, name = 'ApiError') {\n super(message, stackTrace, name);\n _defineProperty(this, \"status\", void 0);\n this.status = status;\n }\n}\nclass DeserializationError extends AlgoliaError {\n constructor(message, response) {\n super(message, 'DeserializationError');\n _defineProperty(this, \"response\", void 0);\n this.response = response;\n }\n}\n// DetailedApiError is only used by the ingestion client to return more informative error, other clients will use ApiClient.\nclass DetailedApiError extends ApiError {\n constructor(message, status, error, stackTrace) {\n super(message, status, stackTrace, 'DetailedApiError');\n _defineProperty(this, \"error\", void 0);\n this.error = error;\n }\n}\nfunction serializeUrl(host, path, queryParameters) {\n const queryParametersAsString = serializeQueryParameters(queryParameters);\n let url = `${host.protocol}://${host.url}${host.port ? `:${host.port}` : ''}/${path.charAt(0) === '/' ? path.substring(1) : path}`;\n if (queryParametersAsString.length) {\n url += `?${queryParametersAsString}`;\n }\n return url;\n}\nfunction serializeQueryParameters(parameters) {\n return Object.keys(parameters).filter(key => parameters[key] !== undefined).sort().map(key => `${key}=${encodeURIComponent(Object.prototype.toString.call(parameters[key]) === '[object Array]' ? parameters[key].join(',') : parameters[key]).replaceAll('+', '%20')}`).join('&');\n}\nfunction serializeData(request, requestOptions) {\n if (request.method === 'GET' || request.data === undefined && requestOptions.data === undefined) {\n return undefined;\n }\n const data = Array.isArray(request.data) ? request.data : {\n ...request.data,\n ...requestOptions.data\n };\n return JSON.stringify(data);\n}\nfunction serializeHeaders(baseHeaders, requestHeaders, requestOptionsHeaders) {\n const headers = {\n Accept: 'application/json',\n ...baseHeaders,\n ...requestHeaders,\n ...requestOptionsHeaders\n };\n const serializedHeaders = {};\n Object.keys(headers).forEach(header => {\n const value = headers[header];\n serializedHeaders[header.toLowerCase()] = value;\n });\n return serializedHeaders;\n}\nfunction deserializeSuccess(response) {\n try {\n return JSON.parse(response.content);\n } catch (e) {\n throw new DeserializationError(e.message, response);\n }\n}\nfunction deserializeFailure({\n content,\n status\n}, stackFrame) {\n try {\n const parsed = JSON.parse(content);\n if ('error' in parsed) {\n return new DetailedApiError(parsed.message, status, parsed.error, stackFrame);\n }\n return new ApiError(parsed.message, status, stackFrame);\n } catch {\n // ..\n }\n return new ApiError(content, status, stackFrame);\n}\n\nfunction isNetworkError({\n isTimedOut,\n status\n}) {\n return !isTimedOut && ~~status === 0;\n}\nfunction isRetryable({\n isTimedOut,\n status\n}) {\n return isTimedOut || isNetworkError({\n isTimedOut,\n status\n }) || ~~(status / 100) !== 2 && ~~(status / 100) !== 4;\n}\nfunction isSuccess({\n status\n}) {\n return ~~(status / 100) === 2;\n}\n\nfunction stackTraceWithoutCredentials(stackTrace) {\n return stackTrace.map(stackFrame => stackFrameWithoutCredentials(stackFrame));\n}\nfunction stackFrameWithoutCredentials(stackFrame) {\n const modifiedHeaders = stackFrame.request.headers['x-algolia-api-key'] ? {\n 'x-algolia-api-key': '*****'\n } : {};\n return {\n ...stackFrame,\n request: {\n ...stackFrame.request,\n headers: {\n ...stackFrame.request.headers,\n ...modifiedHeaders\n }\n }\n };\n}\n\nfunction createTransporter({\n hosts,\n hostsCache,\n baseHeaders,\n baseQueryParameters,\n algoliaAgent,\n timeouts,\n requester,\n requestsCache,\n responsesCache\n}) {\n async function createRetryableOptions(compatibleHosts) {\n const statefulHosts = await Promise.all(compatibleHosts.map(compatibleHost => {\n return hostsCache.get(compatibleHost, () => {\n return Promise.resolve(createStatefulHost(compatibleHost));\n });\n }));\n const hostsUp = statefulHosts.filter(host => host.isUp());\n const hostsTimedOut = statefulHosts.filter(host => host.isTimedOut());\n // Note, we put the hosts that previously timed out on the end of the list.\n const hostsAvailable = [...hostsUp, ...hostsTimedOut];\n const compatibleHostsAvailable = hostsAvailable.length > 0 ? hostsAvailable : compatibleHosts;\n return {\n hosts: compatibleHostsAvailable,\n getTimeout(timeoutsCount, baseTimeout) {\n /**\n * Imagine that you have 4 hosts, if timeouts will increase\n * on the following way: 1 (timed out) > 4 (timed out) > 5 (200).\n *\n * Note that, the very next request, we start from the previous timeout.\n *\n * 5 (timed out) > 6 (timed out) > 7 ...\n *\n * This strategy may need to be reviewed, but is the strategy on the our\n * current v3 version.\n */\n const timeoutMultiplier = hostsTimedOut.length === 0 && timeoutsCount === 0 ? 1 : hostsTimedOut.length + 3 + timeoutsCount;\n return timeoutMultiplier * baseTimeout;\n }\n };\n }\n async function retryableRequest(request, requestOptions, isRead = true) {\n const stackTrace = [];\n /**\n * First we prepare the payload that do not depend from hosts.\n */\n const data = serializeData(request, requestOptions);\n const headers = serializeHeaders(baseHeaders, request.headers, requestOptions.headers);\n // On `GET`, the data is proxied to query parameters.\n const dataQueryParameters = request.method === 'GET' ? {\n ...request.data,\n ...requestOptions.data\n } : {};\n const queryParameters = {\n ...baseQueryParameters,\n ...request.queryParameters,\n ...dataQueryParameters\n };\n if (algoliaAgent.value) {\n queryParameters['x-algolia-agent'] = algoliaAgent.value;\n }\n if (requestOptions && requestOptions.queryParameters) {\n for (const key of Object.keys(requestOptions.queryParameters)) {\n // We want to keep `undefined` and `null` values,\n // but also avoid stringifying `object`s, as they are\n // handled in the `serializeUrl` step right after.\n if (!requestOptions.queryParameters[key] || Object.prototype.toString.call(requestOptions.queryParameters[key]) === '[object Object]') {\n queryParameters[key] = requestOptions.queryParameters[key];\n } else {\n queryParameters[key] = requestOptions.queryParameters[key].toString();\n }\n }\n }\n let timeoutsCount = 0;\n const retry = async (retryableHosts, getTimeout) => {\n /**\n * We iterate on each host, until there is no host left.\n */\n const host = retryableHosts.pop();\n if (host === undefined) {\n throw new RetryError(stackTraceWithoutCredentials(stackTrace));\n }\n const timeout = {\n ...timeouts,\n ...requestOptions.timeouts\n };\n const payload = {\n data,\n headers,\n method: request.method,\n url: serializeUrl(host, request.path, queryParameters),\n connectTimeout: getTimeout(timeoutsCount, timeout.connect),\n responseTimeout: getTimeout(timeoutsCount, isRead ? timeout.read : timeout.write)\n };\n /**\n * The stackFrame is pushed to the stackTrace so we\n * can have information about onRetry and onFailure\n * decisions.\n */\n const pushToStackTrace = response => {\n const stackFrame = {\n request: payload,\n response,\n host,\n triesLeft: retryableHosts.length\n };\n stackTrace.push(stackFrame);\n return stackFrame;\n };\n const response = await requester.send(payload);\n if (isRetryable(response)) {\n const stackFrame = pushToStackTrace(response);\n // If response is a timeout, we increase the number of timeouts so we can increase the timeout later.\n if (response.isTimedOut) {\n timeoutsCount++;\n }\n /**\n * Failures are individually sent to the logger, allowing\n * the end user to debug / store stack frames even\n * when a retry error does not happen.\n */\n // eslint-disable-next-line no-console -- this will be fixed by exposing a `logger` to the transporter\n console.log('Retryable failure', stackFrameWithoutCredentials(stackFrame));\n /**\n * We also store the state of the host in failure cases. If the host, is\n * down it will remain down for the next 2 minutes. In a timeout situation,\n * this host will be added end of the list of hosts on the next request.\n */\n await hostsCache.set(host, createStatefulHost(host, response.isTimedOut ? 'timed out' : 'down'));\n return retry(retryableHosts, getTimeout);\n }\n if (isSuccess(response)) {\n return deserializeSuccess(response);\n }\n pushToStackTrace(response);\n throw deserializeFailure(response, stackTrace);\n };\n /**\n * Finally, for each retryable host perform request until we got a non\n * retryable response. Some notes here:\n *\n * 1. The reverse here is applied so we can apply a `pop` later on => more performant.\n * 2. We also get from the retryable options a timeout multiplier that is tailored\n * for the current context.\n */\n const compatibleHosts = hosts.filter(host => host.accept === 'readWrite' || (isRead ? host.accept === 'read' : host.accept === 'write'));\n const options = await createRetryableOptions(compatibleHosts);\n return retry([...options.hosts].reverse(), options.getTimeout);\n }\n function createRequest(request, requestOptions = {}) {\n /**\n * A read request is either a `GET` request, or a request that we make\n * via the `read` transporter (e.g. `search`).\n */\n const isRead = request.useReadTransporter || request.method === 'GET';\n if (!isRead) {\n /**\n * On write requests, no cache mechanisms are applied, and we\n * proxy the request immediately to the requester.\n */\n return retryableRequest(request, requestOptions, isRead);\n }\n const createRetryableRequest = () => {\n /**\n * Then, we prepare a function factory that contains the construction of\n * the retryable request. At this point, we may *not* perform the actual\n * request. But we want to have the function factory ready.\n */\n return retryableRequest(request, requestOptions);\n };\n /**\n * Once we have the function factory ready, we need to determine of the\n * request is \"cacheable\" - should be cached. Note that, once again,\n * the user can force this option.\n */\n const cacheable = requestOptions.cacheable || request.cacheable;\n /**\n * If is not \"cacheable\", we immediately trigger the retryable request, no\n * need to check cache implementations.\n */\n if (cacheable !== true) {\n return createRetryableRequest();\n }\n /**\n * If the request is \"cacheable\", we need to first compute the key to ask\n * the cache implementations if this request is on progress or if the\n * response already exists on the cache.\n */\n const key = {\n request,\n requestOptions,\n transporter: {\n queryParameters: baseQueryParameters,\n headers: baseHeaders\n }\n };\n /**\n * With the computed key, we first ask the responses cache\n * implementation if this request was been resolved before.\n */\n return responsesCache.get(key, () => {\n /**\n * If the request has never resolved before, we actually ask if there\n * is a current request with the same key on progress.\n */\n return requestsCache.get(key, () =>\n /**\n * Finally, if there is no request in progress with the same key,\n * this `createRetryableRequest()` will actually trigger the\n * retryable request.\n */\n requestsCache.set(key, createRetryableRequest()).then(response => Promise.all([requestsCache.delete(key), response]), err => Promise.all([requestsCache.delete(key), Promise.reject(err)])).then(([_, response]) => response));\n }, {\n /**\n * Of course, once we get this response back from the server, we\n * tell response cache to actually store the received response\n * to be used later.\n */\n miss: response => responsesCache.set(key, response)\n });\n }\n return {\n hostsCache,\n requester,\n timeouts,\n algoliaAgent,\n baseHeaders,\n baseQueryParameters,\n hosts,\n request: createRequest,\n requestsCache,\n responsesCache\n };\n}\n\nfunction createAlgoliaAgent(version) {\n const algoliaAgent = {\n value: `Algolia for JavaScript (${version})`,\n add(options) {\n const addedAlgoliaAgent = `; ${options.segment}${options.version !== undefined ? ` (${options.version})` : ''}`;\n if (algoliaAgent.value.indexOf(addedAlgoliaAgent) === -1) {\n algoliaAgent.value = `${algoliaAgent.value}${addedAlgoliaAgent}`;\n }\n return algoliaAgent;\n }\n };\n return algoliaAgent;\n}\n\nfunction getAlgoliaAgent({\n algoliaAgents,\n client,\n version\n}) {\n const defaultAlgoliaAgent = createAlgoliaAgent(version).add({\n segment: client,\n version\n });\n algoliaAgents.forEach(algoliaAgent => defaultAlgoliaAgent.add(algoliaAgent));\n return defaultAlgoliaAgent;\n}\n\nconst DEFAULT_CONNECT_TIMEOUT_BROWSER = 1000;\nconst DEFAULT_READ_TIMEOUT_BROWSER = 2000;\nconst DEFAULT_WRITE_TIMEOUT_BROWSER = 30000;\n\nfunction createXhrRequester() {\n function send(request) {\n return new Promise((resolve) => {\n const baseRequester = new XMLHttpRequest();\n baseRequester.open(request.method, request.url, true);\n Object.keys(request.headers).forEach((key) => baseRequester.setRequestHeader(key, request.headers[key]));\n const createTimeout = (timeout, content) => {\n return setTimeout(() => {\n baseRequester.abort();\n resolve({\n status: 0,\n content,\n isTimedOut: true,\n });\n }, timeout);\n };\n const connectTimeout = createTimeout(request.connectTimeout, 'Connection timeout');\n let responseTimeout;\n baseRequester.onreadystatechange = () => {\n if (baseRequester.readyState > baseRequester.OPENED && responseTimeout === undefined) {\n clearTimeout(connectTimeout);\n responseTimeout = createTimeout(request.responseTimeout, 'Socket timeout');\n }\n };\n baseRequester.onerror = () => {\n // istanbul ignore next\n if (baseRequester.status === 0) {\n clearTimeout(connectTimeout);\n clearTimeout(responseTimeout);\n resolve({\n content: baseRequester.responseText || 'Network request failed',\n status: baseRequester.status,\n isTimedOut: false,\n });\n }\n };\n baseRequester.onload = () => {\n clearTimeout(connectTimeout);\n clearTimeout(responseTimeout);\n resolve({\n content: baseRequester.responseText,\n status: baseRequester.status,\n isTimedOut: false,\n });\n };\n baseRequester.send(request.data);\n });\n }\n return { send };\n}\n\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.\nconst apiClientVersion = '5.2.4';\nconst REGIONS = ['de', 'us'];\nfunction getDefaultHosts(region) {\n const url = !region ? 'analytics.algolia.com' : 'analytics.{region}.algolia.com'.replace('{region}', region);\n return [{ url, accept: 'readWrite', protocol: 'https' }];\n}\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nfunction createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(regionOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Abtesting',\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 return {\n transporter,\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache() {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua() {\n return transporter.algoliaAgent.value;\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, version) {\n transporter.algoliaAgent.add({ segment, version });\n },\n /**\n * Creates a new A/B test.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\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, requestOptions) {\n if (!addABTestsRequest) {\n throw new Error('Parameter `addABTestsRequest` is required when calling `addABTests`.');\n }\n if (!addABTestsRequest.name) {\n throw new Error('Parameter `addABTestsRequest.name` is required when calling `addABTests`.');\n }\n if (!addABTestsRequest.variants) {\n throw new Error('Parameter `addABTestsRequest.variants` is required when calling `addABTests`.');\n }\n if (!addABTestsRequest.endAt) {\n throw new Error('Parameter `addABTestsRequest.endAt` is required when calling `addABTests`.');\n }\n const requestPath = '/2/abtests';\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: addABTestsRequest,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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({ path, parameters }, requestOptions) {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customDelete`.');\n }\n const requestPath = '/{path}'.replace('{path}', path);\n const headers = {};\n const queryParameters = parameters ? parameters : {};\n const request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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 }, requestOptions) {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customGet`.');\n }\n const requestPath = '/{path}'.replace('{path}', path);\n const headers = {};\n const queryParameters = parameters ? parameters : {};\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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({ path, parameters, body }, requestOptions) {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\n const requestPath = '/{path}'.replace('{path}', path);\n const headers = {};\n const queryParameters = parameters ? parameters : {};\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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({ path, parameters, body }, requestOptions) {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPut`.');\n }\n const requestPath = '/{path}'.replace('{path}', path);\n const headers = {};\n const queryParameters = parameters ? parameters : {};\n const request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Deletes an A/B test by its ID.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\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 }, requestOptions) {\n if (!id) {\n throw new Error('Parameter `id` is required when calling `deleteABTest`.');\n }\n const requestPath = '/2/abtests/{id}'.replace('{id}', encodeURIComponent(id));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves the details for an A/B test by its ID.\n *\n * Required API Key ACLs:\n * - analytics.\n *\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 }, requestOptions) {\n if (!id) {\n throw new Error('Parameter `id` is required when calling `getABTest`.');\n }\n const requestPath = '/2/abtests/{id}'.replace('{id}', encodeURIComponent(id));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Lists all A/B tests you configured for this application.\n *\n * Required API Key ACLs:\n * - analytics.\n *\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 requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n listABTests({ offset, limit, indexPrefix, indexSuffix } = {}, requestOptions = undefined) {\n const requestPath = '/2/abtests';\n const headers = {};\n const queryParameters = {};\n if (offset !== undefined) {\n queryParameters.offset = offset.toString();\n }\n if (limit !== undefined) {\n queryParameters.limit = limit.toString();\n }\n if (indexPrefix !== undefined) {\n queryParameters.indexPrefix = indexPrefix.toString();\n }\n if (indexSuffix !== undefined) {\n queryParameters.indexSuffix = indexSuffix.toString();\n }\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Schedule an A/B test to be started at a later time.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param scheduleABTestsRequest - The scheduleABTestsRequest object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n scheduleABTest(scheduleABTestsRequest, requestOptions) {\n if (!scheduleABTestsRequest) {\n throw new Error('Parameter `scheduleABTestsRequest` is required when calling `scheduleABTest`.');\n }\n if (!scheduleABTestsRequest.name) {\n throw new Error('Parameter `scheduleABTestsRequest.name` is required when calling `scheduleABTest`.');\n }\n if (!scheduleABTestsRequest.variants) {\n throw new Error('Parameter `scheduleABTestsRequest.variants` is required when calling `scheduleABTest`.');\n }\n if (!scheduleABTestsRequest.scheduledAt) {\n throw new Error('Parameter `scheduleABTestsRequest.scheduledAt` is required when calling `scheduleABTest`.');\n }\n if (!scheduleABTestsRequest.endAt) {\n throw new Error('Parameter `scheduleABTestsRequest.endAt` is required when calling `scheduleABTest`.');\n }\n const requestPath = '/2/abtests/schedule';\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: scheduleABTestsRequest,\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 * Required API Key ACLs:\n * - editSettings.\n *\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 }, requestOptions) {\n if (!id) {\n throw new Error('Parameter `id` is required when calling `stopABTest`.');\n }\n const requestPath = '/2/abtests/{id}/stop'.replace('{id}', encodeURIComponent(id));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n };\n}\n\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// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nfunction abtestingClient(appId, apiKey, region, options) {\n if (!appId || typeof appId !== 'string') {\n throw new Error('`appId` is missing.');\n }\n if (!apiKey || typeof apiKey !== 'string') {\n throw new Error('`apiKey` is missing.');\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 return createAbtestingClient({\n appId,\n apiKey,\n region,\n timeouts: {\n connect: DEFAULT_CONNECT_TIMEOUT_BROWSER,\n read: DEFAULT_READ_TIMEOUT_BROWSER,\n write: DEFAULT_WRITE_TIMEOUT_BROWSER,\n },\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 ...options,\n });\n}\n\nexport { abtestingClient, apiClientVersion };\n","function createAuth(appId, apiKey, authMode = 'WithinHeaders') {\n const credentials = {\n 'x-algolia-api-key': apiKey,\n 'x-algolia-application-id': appId\n };\n return {\n headers() {\n return authMode === 'WithinHeaders' ? credentials : {};\n },\n queryParameters() {\n return authMode === 'WithinQueryParameters' ? credentials : {};\n }\n };\n}\n\nfunction createBrowserLocalStorageCache(options) {\n let storage;\n // We've changed the namespace to avoid conflicts with v4, as this version is a huge breaking change\n const namespaceKey = `algolia-client-js-${options.key}`;\n function getStorage() {\n if (storage === undefined) {\n storage = options.localStorage || window.localStorage;\n }\n return storage;\n }\n function getNamespace() {\n return JSON.parse(getStorage().getItem(namespaceKey) || '{}');\n }\n function setNamespace(namespace) {\n getStorage().setItem(namespaceKey, JSON.stringify(namespace));\n }\n function removeOutdatedCacheItems() {\n const timeToLive = options.timeToLive ? options.timeToLive * 1000 : null;\n const namespace = getNamespace();\n const filteredNamespaceWithoutOldFormattedCacheItems = Object.fromEntries(Object.entries(namespace).filter(([, cacheItem]) => {\n return cacheItem.timestamp !== undefined;\n }));\n setNamespace(filteredNamespaceWithoutOldFormattedCacheItems);\n if (!timeToLive) {\n return;\n }\n const filteredNamespaceWithoutExpiredItems = Object.fromEntries(Object.entries(filteredNamespaceWithoutOldFormattedCacheItems).filter(([, cacheItem]) => {\n const currentTimestamp = new Date().getTime();\n const isExpired = cacheItem.timestamp + timeToLive < currentTimestamp;\n return !isExpired;\n }));\n setNamespace(filteredNamespaceWithoutExpiredItems);\n }\n return {\n get(key, defaultValue, events = {\n miss: () => Promise.resolve()\n }) {\n return Promise.resolve().then(() => {\n removeOutdatedCacheItems();\n return getNamespace()[JSON.stringify(key)];\n }).then(value => {\n return Promise.all([value ? value.value : defaultValue(), value !== undefined]);\n }).then(([value, exists]) => {\n return Promise.all([value, exists || events.miss(value)]);\n }).then(([value]) => value);\n },\n set(key, value) {\n return Promise.resolve().then(() => {\n const namespace = getNamespace();\n namespace[JSON.stringify(key)] = {\n timestamp: new Date().getTime(),\n value\n };\n getStorage().setItem(namespaceKey, JSON.stringify(namespace));\n return value;\n });\n },\n delete(key) {\n return Promise.resolve().then(() => {\n const namespace = getNamespace();\n delete namespace[JSON.stringify(key)];\n getStorage().setItem(namespaceKey, JSON.stringify(namespace));\n });\n },\n clear() {\n return Promise.resolve().then(() => {\n getStorage().removeItem(namespaceKey);\n });\n }\n };\n}\n\nfunction createNullCache() {\n return {\n get(_key, defaultValue, events = {\n miss: () => Promise.resolve()\n }) {\n const value = defaultValue();\n return value.then(result => Promise.all([result, events.miss(result)])).then(([result]) => result);\n },\n set(_key, value) {\n return Promise.resolve(value);\n },\n delete(_key) {\n return Promise.resolve();\n },\n clear() {\n return Promise.resolve();\n }\n };\n}\n\nfunction createFallbackableCache(options) {\n const caches = [...options.caches];\n const current = caches.shift();\n if (current === undefined) {\n return createNullCache();\n }\n return {\n get(key, defaultValue, events = {\n miss: () => Promise.resolve()\n }) {\n return current.get(key, defaultValue, events).catch(() => {\n return createFallbackableCache({\n caches\n }).get(key, defaultValue, events);\n });\n },\n set(key, value) {\n return current.set(key, value).catch(() => {\n return createFallbackableCache({\n caches\n }).set(key, value);\n });\n },\n delete(key) {\n return current.delete(key).catch(() => {\n return createFallbackableCache({\n caches\n }).delete(key);\n });\n },\n clear() {\n return current.clear().catch(() => {\n return createFallbackableCache({\n caches\n }).clear();\n });\n }\n };\n}\n\nfunction createMemoryCache(options = {\n serializable: true\n}) {\n let cache = {};\n return {\n get(key, defaultValue, events = {\n miss: () => Promise.resolve()\n }) {\n const keyAsString = JSON.stringify(key);\n if (keyAsString in cache) {\n return Promise.resolve(options.serializable ? JSON.parse(cache[keyAsString]) : cache[keyAsString]);\n }\n const promise = defaultValue();\n return promise.then(value => events.miss(value)).then(() => promise);\n },\n set(key, value) {\n cache[JSON.stringify(key)] = options.serializable ? JSON.stringify(value) : value;\n return Promise.resolve(value);\n },\n delete(key) {\n delete cache[JSON.stringify(key)];\n return Promise.resolve();\n },\n clear() {\n cache = {};\n return Promise.resolve();\n }\n };\n}\n\n// By default, API Clients at Algolia have expiration delay of 5 mins.\n// In the JavaScript client, we have 2 mins.\nconst EXPIRATION_DELAY = 2 * 60 * 1000;\nfunction createStatefulHost(host, status = 'up') {\n const lastUpdate = Date.now();\n function isUp() {\n return status === 'up' || Date.now() - lastUpdate > EXPIRATION_DELAY;\n }\n function isTimedOut() {\n return status === 'timed out' && Date.now() - lastUpdate <= EXPIRATION_DELAY;\n }\n return {\n ...host,\n status,\n lastUpdate,\n isUp,\n isTimedOut\n };\n}\n\nfunction _defineProperty(e, r, t) {\n return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nfunction _toPrimitive(t, r) {\n if (\"object\" != typeof t || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != typeof i) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nfunction _toPropertyKey(t) {\n var i = _toPrimitive(t, \"string\");\n return \"symbol\" == typeof i ? i : i + \"\";\n}\n\nclass AlgoliaError extends Error {\n constructor(message, name) {\n super(message);\n _defineProperty(this, \"name\", 'AlgoliaError');\n if (name) {\n this.name = name;\n }\n }\n}\nclass ErrorWithStackTrace extends AlgoliaError {\n constructor(message, stackTrace, name) {\n super(message, name);\n // the array and object should be frozen to reflect the stackTrace at the time of the error\n _defineProperty(this, \"stackTrace\", void 0);\n this.stackTrace = stackTrace;\n }\n}\nclass RetryError extends ErrorWithStackTrace {\n constructor(stackTrace) {\n super('Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.', stackTrace, 'RetryError');\n }\n}\nclass ApiError extends ErrorWithStackTrace {\n constructor(message, status, stackTrace, name = 'ApiError') {\n super(message, stackTrace, name);\n _defineProperty(this, \"status\", void 0);\n this.status = status;\n }\n}\nclass DeserializationError extends AlgoliaError {\n constructor(message, response) {\n super(message, 'DeserializationError');\n _defineProperty(this, \"response\", void 0);\n this.response = response;\n }\n}\n// DetailedApiError is only used by the ingestion client to return more informative error, other clients will use ApiClient.\nclass DetailedApiError extends ApiError {\n constructor(message, status, error, stackTrace) {\n super(message, status, stackTrace, 'DetailedApiError');\n _defineProperty(this, \"error\", void 0);\n this.error = error;\n }\n}\nfunction serializeUrl(host, path, queryParameters) {\n const queryParametersAsString = serializeQueryParameters(queryParameters);\n let url = `${host.protocol}://${host.url}${host.port ? `:${host.port}` : ''}/${path.charAt(0) === '/' ? path.substring(1) : path}`;\n if (queryParametersAsString.length) {\n url += `?${queryParametersAsString}`;\n }\n return url;\n}\nfunction serializeQueryParameters(parameters) {\n return Object.keys(parameters).filter(key => parameters[key] !== undefined).sort().map(key => `${key}=${encodeURIComponent(Object.prototype.toString.call(parameters[key]) === '[object Array]' ? parameters[key].join(',') : parameters[key]).replaceAll('+', '%20')}`).join('&');\n}\nfunction serializeData(request, requestOptions) {\n if (request.method === 'GET' || request.data === undefined && requestOptions.data === undefined) {\n return undefined;\n }\n const data = Array.isArray(request.data) ? request.data : {\n ...request.data,\n ...requestOptions.data\n };\n return JSON.stringify(data);\n}\nfunction serializeHeaders(baseHeaders, requestHeaders, requestOptionsHeaders) {\n const headers = {\n Accept: 'application/json',\n ...baseHeaders,\n ...requestHeaders,\n ...requestOptionsHeaders\n };\n const serializedHeaders = {};\n Object.keys(headers).forEach(header => {\n const value = headers[header];\n serializedHeaders[header.toLowerCase()] = value;\n });\n return serializedHeaders;\n}\nfunction deserializeSuccess(response) {\n try {\n return JSON.parse(response.content);\n } catch (e) {\n throw new DeserializationError(e.message, response);\n }\n}\nfunction deserializeFailure({\n content,\n status\n}, stackFrame) {\n try {\n const parsed = JSON.parse(content);\n if ('error' in parsed) {\n return new DetailedApiError(parsed.message, status, parsed.error, stackFrame);\n }\n return new ApiError(parsed.message, status, stackFrame);\n } catch {\n // ..\n }\n return new ApiError(content, status, stackFrame);\n}\n\nfunction isNetworkError({\n isTimedOut,\n status\n}) {\n return !isTimedOut && ~~status === 0;\n}\nfunction isRetryable({\n isTimedOut,\n status\n}) {\n return isTimedOut || isNetworkError({\n isTimedOut,\n status\n }) || ~~(status / 100) !== 2 && ~~(status / 100) !== 4;\n}\nfunction isSuccess({\n status\n}) {\n return ~~(status / 100) === 2;\n}\n\nfunction stackTraceWithoutCredentials(stackTrace) {\n return stackTrace.map(stackFrame => stackFrameWithoutCredentials(stackFrame));\n}\nfunction stackFrameWithoutCredentials(stackFrame) {\n const modifiedHeaders = stackFrame.request.headers['x-algolia-api-key'] ? {\n 'x-algolia-api-key': '*****'\n } : {};\n return {\n ...stackFrame,\n request: {\n ...stackFrame.request,\n headers: {\n ...stackFrame.request.headers,\n ...modifiedHeaders\n }\n }\n };\n}\n\nfunction createTransporter({\n hosts,\n hostsCache,\n baseHeaders,\n baseQueryParameters,\n algoliaAgent,\n timeouts,\n requester,\n requestsCache,\n responsesCache\n}) {\n async function createRetryableOptions(compatibleHosts) {\n const statefulHosts = await Promise.all(compatibleHosts.map(compatibleHost => {\n return hostsCache.get(compatibleHost, () => {\n return Promise.resolve(createStatefulHost(compatibleHost));\n });\n }));\n const hostsUp = statefulHosts.filter(host => host.isUp());\n const hostsTimedOut = statefulHosts.filter(host => host.isTimedOut());\n // Note, we put the hosts that previously timed out on the end of the list.\n const hostsAvailable = [...hostsUp, ...hostsTimedOut];\n const compatibleHostsAvailable = hostsAvailable.length > 0 ? hostsAvailable : compatibleHosts;\n return {\n hosts: compatibleHostsAvailable,\n getTimeout(timeoutsCount, baseTimeout) {\n /**\n * Imagine that you have 4 hosts, if timeouts will increase\n * on the following way: 1 (timed out) > 4 (timed out) > 5 (200).\n *\n * Note that, the very next request, we start from the previous timeout.\n *\n * 5 (timed out) > 6 (timed out) > 7 ...\n *\n * This strategy may need to be reviewed, but is the strategy on the our\n * current v3 version.\n */\n const timeoutMultiplier = hostsTimedOut.length === 0 && timeoutsCount === 0 ? 1 : hostsTimedOut.length + 3 + timeoutsCount;\n return timeoutMultiplier * baseTimeout;\n }\n };\n }\n async function retryableRequest(request, requestOptions, isRead = true) {\n const stackTrace = [];\n /**\n * First we prepare the payload that do not depend from hosts.\n */\n const data = serializeData(request, requestOptions);\n const headers = serializeHeaders(baseHeaders, request.headers, requestOptions.headers);\n // On `GET`, the data is proxied to query parameters.\n const dataQueryParameters = request.method === 'GET' ? {\n ...request.data,\n ...requestOptions.data\n } : {};\n const queryParameters = {\n ...baseQueryParameters,\n ...request.queryParameters,\n ...dataQueryParameters\n };\n if (algoliaAgent.value) {\n queryParameters['x-algolia-agent'] = algoliaAgent.value;\n }\n if (requestOptions && requestOptions.queryParameters) {\n for (const key of Object.keys(requestOptions.queryParameters)) {\n // We want to keep `undefined` and `null` values,\n // but also avoid stringifying `object`s, as they are\n // handled in the `serializeUrl` step right after.\n if (!requestOptions.queryParameters[key] || Object.prototype.toString.call(requestOptions.queryParameters[key]) === '[object Object]') {\n queryParameters[key] = requestOptions.queryParameters[key];\n } else {\n queryParameters[key] = requestOptions.queryParameters[key].toString();\n }\n }\n }\n let timeoutsCount = 0;\n const retry = async (retryableHosts, getTimeout) => {\n /**\n * We iterate on each host, until there is no host left.\n */\n const host = retryableHosts.pop();\n if (host === undefined) {\n throw new RetryError(stackTraceWithoutCredentials(stackTrace));\n }\n const timeout = {\n ...timeouts,\n ...requestOptions.timeouts\n };\n const payload = {\n data,\n headers,\n method: request.method,\n url: serializeUrl(host, request.path, queryParameters),\n connectTimeout: getTimeout(timeoutsCount, timeout.connect),\n responseTimeout: getTimeout(timeoutsCount, isRead ? timeout.read : timeout.write)\n };\n /**\n * The stackFrame is pushed to the stackTrace so we\n * can have information about onRetry and onFailure\n * decisions.\n */\n const pushToStackTrace = response => {\n const stackFrame = {\n request: payload,\n response,\n host,\n triesLeft: retryableHosts.length\n };\n stackTrace.push(stackFrame);\n return stackFrame;\n };\n const response = await requester.send(payload);\n if (isRetryable(response)) {\n const stackFrame = pushToStackTrace(response);\n // If response is a timeout, we increase the number of timeouts so we can increase the timeout later.\n if (response.isTimedOut) {\n timeoutsCount++;\n }\n /**\n * Failures are individually sent to the logger, allowing\n * the end user to debug / store stack frames even\n * when a retry error does not happen.\n */\n // eslint-disable-next-line no-console -- this will be fixed by exposing a `logger` to the transporter\n console.log('Retryable failure', stackFrameWithoutCredentials(stackFrame));\n /**\n * We also store the state of the host in failure cases. If the host, is\n * down it will remain down for the next 2 minutes. In a timeout situation,\n * this host will be added end of the list of hosts on the next request.\n */\n await hostsCache.set(host, createStatefulHost(host, response.isTimedOut ? 'timed out' : 'down'));\n return retry(retryableHosts, getTimeout);\n }\n if (isSuccess(response)) {\n return deserializeSuccess(response);\n }\n pushToStackTrace(response);\n throw deserializeFailure(response, stackTrace);\n };\n /**\n * Finally, for each retryable host perform request until we got a non\n * retryable response. Some notes here:\n *\n * 1. The reverse here is applied so we can apply a `pop` later on => more performant.\n * 2. We also get from the retryable options a timeout multiplier that is tailored\n * for the current context.\n */\n const compatibleHosts = hosts.filter(host => host.accept === 'readWrite' || (isRead ? host.accept === 'read' : host.accept === 'write'));\n const options = await createRetryableOptions(compatibleHosts);\n return retry([...options.hosts].reverse(), options.getTimeout);\n }\n function createRequest(request, requestOptions = {}) {\n /**\n * A read request is either a `GET` request, or a request that we make\n * via the `read` transporter (e.g. `search`).\n */\n const isRead = request.useReadTransporter || request.method === 'GET';\n if (!isRead) {\n /**\n * On write requests, no cache mechanisms are applied, and we\n * proxy the request immediately to the requester.\n */\n return retryableRequest(request, requestOptions, isRead);\n }\n const createRetryableRequest = () => {\n /**\n * Then, we prepare a function factory that contains the construction of\n * the retryable request. At this point, we may *not* perform the actual\n * request. But we want to have the function factory ready.\n */\n return retryableRequest(request, requestOptions);\n };\n /**\n * Once we have the function factory ready, we need to determine of the\n * request is \"cacheable\" - should be cached. Note that, once again,\n * the user can force this option.\n */\n const cacheable = requestOptions.cacheable || request.cacheable;\n /**\n * If is not \"cacheable\", we immediately trigger the retryable request, no\n * need to check cache implementations.\n */\n if (cacheable !== true) {\n return createRetryableRequest();\n }\n /**\n * If the request is \"cacheable\", we need to first compute the key to ask\n * the cache implementations if this request is on progress or if the\n * response already exists on the cache.\n */\n const key = {\n request,\n requestOptions,\n transporter: {\n queryParameters: baseQueryParameters,\n headers: baseHeaders\n }\n };\n /**\n * With the computed key, we first ask the responses cache\n * implementation if this request was been resolved before.\n */\n return responsesCache.get(key, () => {\n /**\n * If the request has never resolved before, we actually ask if there\n * is a current request with the same key on progress.\n */\n return requestsCache.get(key, () =>\n /**\n * Finally, if there is no request in progress with the same key,\n * this `createRetryableRequest()` will actually trigger the\n * retryable request.\n */\n requestsCache.set(key, createRetryableRequest()).then(response => Promise.all([requestsCache.delete(key), response]), err => Promise.all([requestsCache.delete(key), Promise.reject(err)])).then(([_, response]) => response));\n }, {\n /**\n * Of course, once we get this response back from the server, we\n * tell response cache to actually store the received response\n * to be used later.\n */\n miss: response => responsesCache.set(key, response)\n });\n }\n return {\n hostsCache,\n requester,\n timeouts,\n algoliaAgent,\n baseHeaders,\n baseQueryParameters,\n hosts,\n request: createRequest,\n requestsCache,\n responsesCache\n };\n}\n\nfunction createAlgoliaAgent(version) {\n const algoliaAgent = {\n value: `Algolia for JavaScript (${version})`,\n add(options) {\n const addedAlgoliaAgent = `; ${options.segment}${options.version !== undefined ? ` (${options.version})` : ''}`;\n if (algoliaAgent.value.indexOf(addedAlgoliaAgent) === -1) {\n algoliaAgent.value = `${algoliaAgent.value}${addedAlgoliaAgent}`;\n }\n return algoliaAgent;\n }\n };\n return algoliaAgent;\n}\n\nfunction getAlgoliaAgent({\n algoliaAgents,\n client,\n version\n}) {\n const defaultAlgoliaAgent = createAlgoliaAgent(version).add({\n segment: client,\n version\n });\n algoliaAgents.forEach(algoliaAgent => defaultAlgoliaAgent.add(algoliaAgent));\n return defaultAlgoliaAgent;\n}\n\nconst DEFAULT_CONNECT_TIMEOUT_BROWSER = 1000;\nconst DEFAULT_READ_TIMEOUT_BROWSER = 2000;\nconst DEFAULT_WRITE_TIMEOUT_BROWSER = 30000;\n\nfunction createXhrRequester() {\n function send(request) {\n return new Promise((resolve) => {\n const baseRequester = new XMLHttpRequest();\n baseRequester.open(request.method, request.url, true);\n Object.keys(request.headers).forEach((key) => baseRequester.setRequestHeader(key, request.headers[key]));\n const createTimeout = (timeout, content) => {\n return setTimeout(() => {\n baseRequester.abort();\n resolve({\n status: 0,\n content,\n isTimedOut: true,\n });\n }, timeout);\n };\n const connectTimeout = createTimeout(request.connectTimeout, 'Connection timeout');\n let responseTimeout;\n baseRequester.onreadystatechange = () => {\n if (baseRequester.readyState > baseRequester.OPENED && responseTimeout === undefined) {\n clearTimeout(connectTimeout);\n responseTimeout = createTimeout(request.responseTimeout, 'Socket timeout');\n }\n };\n baseRequester.onerror = () => {\n // istanbul ignore next\n if (baseRequester.status === 0) {\n clearTimeout(connectTimeout);\n clearTimeout(responseTimeout);\n resolve({\n content: baseRequester.responseText || 'Network request failed',\n status: baseRequester.status,\n isTimedOut: false,\n });\n }\n };\n baseRequester.onload = () => {\n clearTimeout(connectTimeout);\n clearTimeout(responseTimeout);\n resolve({\n content: baseRequester.responseText,\n status: baseRequester.status,\n isTimedOut: false,\n });\n };\n baseRequester.send(request.data);\n });\n }\n return { send };\n}\n\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.\nconst apiClientVersion = '5.2.4';\nconst REGIONS = ['de', 'us'];\nfunction getDefaultHosts(region) {\n const url = !region ? 'analytics.algolia.com' : 'analytics.{region}.algolia.com'.replace('{region}', region);\n return [{ url, accept: 'readWrite', protocol: 'https' }];\n}\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nfunction createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(regionOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Analytics',\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 return {\n transporter,\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache() {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua() {\n return transporter.algoliaAgent.value;\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, version) {\n transporter.algoliaAgent.add({ segment, version });\n },\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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({ path, parameters }, requestOptions) {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customDelete`.');\n }\n const requestPath = '/{path}'.replace('{path}', path);\n const headers = {};\n const queryParameters = parameters ? parameters : {};\n const request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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 }, requestOptions) {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customGet`.');\n }\n const requestPath = '/{path}'.replace('{path}', path);\n const headers = {};\n const queryParameters = parameters ? parameters : {};\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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({ path, parameters, body }, requestOptions) {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\n const requestPath = '/{path}'.replace('{path}', path);\n const headers = {};\n const queryParameters = parameters ? parameters : {};\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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({ path, parameters, body }, requestOptions) {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPut`.');\n }\n const requestPath = '/{path}'.replace('{path}', path);\n const headers = {};\n const queryParameters = parameters ? parameters : {};\n const request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves the add-to-cart rate for all of your searches with at least one add-to-cart event, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getAddToCartRate - The getAddToCartRate object.\n * @param getAddToCartRate.index - Index name.\n * @param getAddToCartRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getAddToCartRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getAddToCartRate.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getAddToCartRate({ index, startDate, endDate, tags }, requestOptions) {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getAddToCartRate`.');\n }\n const requestPath = '/2/conversions/addToCartRate';\n const headers = {};\n const queryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.toString();\n }\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves the average click position of your search results, including a daily breakdown. The average click position is the average of all clicked search results\\' positions. For example, if users only ever click on the first result for any search, the average click position is 1. By default, the analyzed period includes the last eight days including the current day.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getAverageClickPosition - The getAverageClickPosition object.\n * @param getAverageClickPosition.index - Index name.\n * @param getAverageClickPosition.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getAverageClickPosition.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getAverageClickPosition.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getAverageClickPosition({ index, startDate, endDate, tags }, requestOptions) {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getAverageClickPosition`.');\n }\n const requestPath = '/2/clicks/averageClickPosition';\n const headers = {};\n const queryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.toString();\n }\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves the positions in the search results and their associated number of clicks. This lets you check how many clicks the first, second, or tenth search results receive.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getClickPositions - The getClickPositions object.\n * @param getClickPositions.index - Index name.\n * @param getClickPositions.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getClickPositions.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getClickPositions.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getClickPositions({ index, startDate, endDate, tags }, requestOptions) {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getClickPositions`.');\n }\n const requestPath = '/2/clicks/positions';\n const headers = {};\n const queryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.toString();\n }\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves the click-through rate for all of your searches with at least one click event, including a daily breakdown By default, the analyzed period includes the last eight days including the current day.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getClickThroughRate - The getClickThroughRate object.\n * @param getClickThroughRate.index - Index name.\n * @param getClickThroughRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getClickThroughRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getClickThroughRate.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getClickThroughRate({ index, startDate, endDate, tags }, requestOptions) {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getClickThroughRate`.');\n }\n const requestPath = '/2/clicks/clickThroughRate';\n const headers = {};\n const queryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.toString();\n }\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves the conversion rate for all of your searches with at least one conversion event, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getConversionRate - The getConversionRate object.\n * @param getConversionRate.index - Index name.\n * @param getConversionRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getConversionRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getConversionRate.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getConversionRate({ index, startDate, endDate, tags }, requestOptions) {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getConversionRate`.');\n }\n const requestPath = '/2/conversions/conversionRate';\n const headers = {};\n const queryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.toString();\n }\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves the fraction of searches that didn\\'t lead to any click within a time range, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getNoClickRate - The getNoClickRate object.\n * @param getNoClickRate.index - Index name.\n * @param getNoClickRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getNoClickRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getNoClickRate.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getNoClickRate({ index, startDate, endDate, tags }, requestOptions) {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getNoClickRate`.');\n }\n const requestPath = '/2/searches/noClickRate';\n const headers = {};\n const queryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.toString();\n }\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves the fraction of searches that didn\\'t return any results within a time range, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getNoResultsRate - The getNoResultsRate object.\n * @param getNoResultsRate.index - Index name.\n * @param getNoResultsRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getNoResultsRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getNoResultsRate.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getNoResultsRate({ index, startDate, endDate, tags }, requestOptions) {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getNoResultsRate`.');\n }\n const requestPath = '/2/searches/noResultRate';\n const headers = {};\n const queryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.toString();\n }\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves the purchase rate for all of your searches with at least one purchase event, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getPurchaseRate - The getPurchaseRate object.\n * @param getPurchaseRate.index - Index name.\n * @param getPurchaseRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getPurchaseRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getPurchaseRate.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getPurchaseRate({ index, startDate, endDate, tags }, requestOptions) {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getPurchaseRate`.');\n }\n const requestPath = '/2/conversions/purchaseRate';\n const headers = {};\n const queryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.toString();\n }\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves revenue-related metrics, such as the total revenue or the average order value. To retrieve revenue-related metrics, sent purchase events. By default, the analyzed period includes the last eight days including the current day.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getRevenue - The getRevenue object.\n * @param getRevenue.index - Index name.\n * @param getRevenue.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getRevenue.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getRevenue.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRevenue({ index, startDate, endDate, tags }, requestOptions) {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getRevenue`.');\n }\n const requestPath = '/2/conversions/revenue';\n const headers = {};\n const queryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.toString();\n }\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves the number of searches within a time range, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getSearchesCount - The getSearchesCount object.\n * @param getSearchesCount.index - Index name.\n * @param getSearchesCount.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getSearchesCount.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getSearchesCount.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getSearchesCount({ index, startDate, endDate, tags }, requestOptions) {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getSearchesCount`.');\n }\n const requestPath = '/2/searches/count';\n const headers = {};\n const queryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.toString();\n }\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves the most popular searches that didn\\'t lead to any clicks, from the 1,000 most frequent searches.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getSearchesNoClicks - The getSearchesNoClicks object.\n * @param getSearchesNoClicks.index - Index name.\n * @param getSearchesNoClicks.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getSearchesNoClicks.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getSearchesNoClicks.limit - Number of items to return.\n * @param getSearchesNoClicks.offset - Position of the first item to return.\n * @param getSearchesNoClicks.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getSearchesNoClicks({ index, startDate, endDate, limit, offset, tags }, requestOptions) {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getSearchesNoClicks`.');\n }\n const requestPath = '/2/searches/noClicks';\n const headers = {};\n const queryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (limit !== undefined) {\n queryParameters.limit = limit.toString();\n }\n if (offset !== undefined) {\n queryParameters.offset = offset.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.toString();\n }\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves the most popular searches that didn\\'t return any results.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getSearchesNoResults - The getSearchesNoResults object.\n * @param getSearchesNoResults.index - Index name.\n * @param getSearchesNoResults.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getSearchesNoResults.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getSearchesNoResults.limit - Number of items to return.\n * @param getSearchesNoResults.offset - Position of the first item to return.\n * @param getSearchesNoResults.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getSearchesNoResults({ index, startDate, endDate, limit, offset, tags }, requestOptions) {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getSearchesNoResults`.');\n }\n const requestPath = '/2/searches/noResults';\n const headers = {};\n const queryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (limit !== undefined) {\n queryParameters.limit = limit.toString();\n }\n if (offset !== undefined) {\n queryParameters.offset = offset.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.toString();\n }\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves the time when the Analytics data for the specified index was last updated. The Analytics data is updated every 5 minutes.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getStatus - The getStatus object.\n * @param getStatus.index - Index name.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getStatus({ index }, requestOptions) {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getStatus`.');\n }\n const requestPath = '/2/status';\n const headers = {};\n const queryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves the countries with the most searches to your index.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getTopCountries - The getTopCountries object.\n * @param getTopCountries.index - Index name.\n * @param getTopCountries.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getTopCountries.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getTopCountries.limit - Number of items to return.\n * @param getTopCountries.offset - Position of the first item to return.\n * @param getTopCountries.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getTopCountries({ index, startDate, endDate, limit, offset, tags }, requestOptions) {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getTopCountries`.');\n }\n const requestPath = '/2/countries';\n const headers = {};\n const queryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (limit !== undefined) {\n queryParameters.limit = limit.toString();\n }\n if (offset !== undefined) {\n queryParameters.offset = offset.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.toString();\n }\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves the most frequently used filter attributes. These are attributes of your records that you included in the `attributesForFaceting` setting.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getTopFilterAttributes - The getTopFilterAttributes object.\n * @param getTopFilterAttributes.index - Index name.\n * @param getTopFilterAttributes.search - Search query.\n * @param getTopFilterAttributes.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getTopFilterAttributes.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getTopFilterAttributes.limit - Number of items to return.\n * @param getTopFilterAttributes.offset - Position of the first item to return.\n * @param getTopFilterAttributes.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getTopFilterAttributes({ index, search, startDate, endDate, limit, offset, tags }, requestOptions) {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getTopFilterAttributes`.');\n }\n const requestPath = '/2/filters';\n const headers = {};\n const queryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n if (search !== undefined) {\n queryParameters.search = search.toString();\n }\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (limit !== undefined) {\n queryParameters.limit = limit.toString();\n }\n if (offset !== undefined) {\n queryParameters.offset = offset.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.toString();\n }\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves the most frequent filter (facet) values for a filter attribute. These are attributes of your records that you included in the `attributesForFaceting` setting.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getTopFilterForAttribute - The getTopFilterForAttribute object.\n * @param getTopFilterForAttribute.attribute - Attribute name.\n * @param getTopFilterForAttribute.index - Index name.\n * @param getTopFilterForAttribute.search - Search query.\n * @param getTopFilterForAttribute.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getTopFilterForAttribute.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getTopFilterForAttribute.limit - Number of items to return.\n * @param getTopFilterForAttribute.offset - Position of the first item to return.\n * @param getTopFilterForAttribute.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getTopFilterForAttribute({ attribute, index, search, startDate, endDate, limit, offset, tags }, requestOptions) {\n if (!attribute) {\n throw new Error('Parameter `attribute` is required when calling `getTopFilterForAttribute`.');\n }\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getTopFilterForAttribute`.');\n }\n const requestPath = '/2/filters/{attribute}'.replace('{attribute}', encodeURIComponent(attribute));\n const headers = {};\n const queryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n if (search !== undefined) {\n queryParameters.search = search.toString();\n }\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (limit !== undefined) {\n queryParameters.limit = limit.toString();\n }\n if (offset !== undefined) {\n queryParameters.offset = offset.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.toString();\n }\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves the most frequently used filters for a search that didn\\'t return any results. To get the most frequent searches without results, use the [Retrieve searches without results](#tag/search/operation/getSearchesNoResults) operation.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getTopFiltersNoResults - The getTopFiltersNoResults object.\n * @param getTopFiltersNoResults.index - Index name.\n * @param getTopFiltersNoResults.search - Search query.\n * @param getTopFiltersNoResults.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getTopFiltersNoResults.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getTopFiltersNoResults.limit - Number of items to return.\n * @param getTopFiltersNoResults.offset - Position of the first item to return.\n * @param getTopFiltersNoResults.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getTopFiltersNoResults({ index, search, startDate, endDate, limit, offset, tags }, requestOptions) {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getTopFiltersNoResults`.');\n }\n const requestPath = '/2/filters/noResults';\n const headers = {};\n const queryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n if (search !== undefined) {\n queryParameters.search = search.toString();\n }\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (limit !== undefined) {\n queryParameters.limit = limit.toString();\n }\n if (offset !== undefined) {\n queryParameters.offset = offset.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.toString();\n }\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves the object IDs of the most frequent search results.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getTopHits - The getTopHits object.\n * @param getTopHits.index - Index name.\n * @param getTopHits.search - Search query.\n * @param getTopHits.clickAnalytics - Whether to include metrics related to click and conversion events in the response.\n * @param getTopHits.revenueAnalytics - Whether to include revenue-related metrics in the response. If true, metrics related to click and conversion events are also included in the response.\n * @param getTopHits.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getTopHits.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getTopHits.limit - Number of items to return.\n * @param getTopHits.offset - Position of the first item to return.\n * @param getTopHits.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getTopHits({ index, search, clickAnalytics, revenueAnalytics, startDate, endDate, limit, offset, tags }, requestOptions) {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getTopHits`.');\n }\n const requestPath = '/2/hits';\n const headers = {};\n const queryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n if (search !== undefined) {\n queryParameters.search = search.toString();\n }\n if (clickAnalytics !== undefined) {\n queryParameters.clickAnalytics = clickAnalytics.toString();\n }\n if (revenueAnalytics !== undefined) {\n queryParameters.revenueAnalytics = revenueAnalytics.toString();\n }\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (limit !== undefined) {\n queryParameters.limit = limit.toString();\n }\n if (offset !== undefined) {\n queryParameters.offset = offset.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.toString();\n }\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Returns the most popular search terms.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getTopSearches - The getTopSearches object.\n * @param getTopSearches.index - Index name.\n * @param getTopSearches.clickAnalytics - Whether to include metrics related to click and conversion events in the response.\n * @param getTopSearches.revenueAnalytics - Whether to include revenue-related metrics in the response. If true, metrics related to click and conversion events are also included in the response.\n * @param getTopSearches.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getTopSearches.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getTopSearches.orderBy - Attribute by which to order the response items. If the `clickAnalytics` parameter is false, only `searchCount` is available.\n * @param getTopSearches.direction - Sorting direction of the results: ascending or descending.\n * @param getTopSearches.limit - Number of items to return.\n * @param getTopSearches.offset - Position of the first item to return.\n * @param getTopSearches.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getTopSearches({ index, clickAnalytics, revenueAnalytics, startDate, endDate, orderBy, direction, limit, offset, tags, }, requestOptions) {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getTopSearches`.');\n }\n const requestPath = '/2/searches';\n const headers = {};\n const queryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n if (clickAnalytics !== undefined) {\n queryParameters.clickAnalytics = clickAnalytics.toString();\n }\n if (revenueAnalytics !== undefined) {\n queryParameters.revenueAnalytics = revenueAnalytics.toString();\n }\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (orderBy !== undefined) {\n queryParameters.orderBy = orderBy.toString();\n }\n if (direction !== undefined) {\n queryParameters.direction = direction.toString();\n }\n if (limit !== undefined) {\n queryParameters.limit = limit.toString();\n }\n if (offset !== undefined) {\n queryParameters.offset = offset.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.toString();\n }\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves the number of unique users within a time range, including a daily breakdown. Since this endpoint returns the number of unique users, the sum of the daily values might be different from the total number. By default, Algolia distinguishes search users by their IP address, _unless_ you include a pseudonymous user identifier in your search requests with the `userToken` API parameter or `x-algolia-usertoken` request header. By default, the analyzed period includes the last eight days including the current day.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getUsersCount - The getUsersCount object.\n * @param getUsersCount.index - Index name.\n * @param getUsersCount.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getUsersCount.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getUsersCount.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getUsersCount({ index, startDate, endDate, tags }, requestOptions) {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getUsersCount`.');\n }\n const requestPath = '/2/users/count';\n const headers = {};\n const queryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.toString();\n }\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n };\n}\n\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// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nfunction analyticsClient(appId, apiKey, region, options) {\n if (!appId || typeof appId !== 'string') {\n throw new Error('`appId` is missing.');\n }\n if (!apiKey || typeof apiKey !== 'string') {\n throw new Error('`apiKey` is missing.');\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 return createAnalyticsClient({\n appId,\n apiKey,\n region,\n timeouts: {\n connect: DEFAULT_CONNECT_TIMEOUT_BROWSER,\n read: DEFAULT_READ_TIMEOUT_BROWSER,\n write: DEFAULT_WRITE_TIMEOUT_BROWSER,\n },\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 ...options,\n });\n}\n\nexport { analyticsClient, apiClientVersion };\n","function createAuth(appId, apiKey, authMode = 'WithinHeaders') {\n const credentials = {\n 'x-algolia-api-key': apiKey,\n 'x-algolia-application-id': appId\n };\n return {\n headers() {\n return authMode === 'WithinHeaders' ? credentials : {};\n },\n queryParameters() {\n return authMode === 'WithinQueryParameters' ? credentials : {};\n }\n };\n}\n\nfunction getUrlParams({\n host,\n search,\n pathname\n}) {\n const urlSearchParams = search.split('?');\n if (urlSearchParams.length === 1) {\n return {\n host,\n algoliaAgent: '',\n searchParams: undefined,\n path: pathname\n };\n }\n const splitSearchParams = urlSearchParams[1].split('&');\n let algoliaAgent = '';\n const searchParams = {};\n if (splitSearchParams.length > 0) {\n splitSearchParams.forEach(param => {\n const [key, value] = param.split('=');\n if (key === 'x-algolia-agent') {\n algoliaAgent = value;\n return;\n }\n searchParams[key] = value;\n });\n }\n return {\n host,\n algoliaAgent,\n searchParams: Object.keys(searchParams).length === 0 ? undefined : searchParams,\n path: pathname\n };\n}\nfunction createEchoRequester({\n getURL,\n status = 200\n}) {\n function send(request) {\n const {\n host,\n searchParams,\n algoliaAgent,\n path\n } = getUrlParams(getURL(request.url));\n const content = {\n ...request,\n data: request.data ? JSON.parse(request.data) : undefined,\n path,\n host,\n algoliaAgent,\n searchParams\n };\n return Promise.resolve({\n content: JSON.stringify(content),\n isTimedOut: false,\n status\n });\n }\n return {\n send\n };\n}\n\n/**\n * Helper: Returns the promise of a given `func` to iterate on, based on a given `validate` condition.\n *\n * @param createIterator - The createIterator options.\n * @param createIterator.func - The function to run, which returns a promise.\n * @param createIterator.validate - The validator function. It receives the resolved return of `func`.\n * @param createIterator.aggregator - The function that runs right after the `func` method has been executed, allows you to do anything with the response before `validate`.\n * @param createIterator.error - The `validate` condition to throw an error, and its message.\n * @param createIterator.timeout - The function to decide how long to wait between iterations.\n */\nfunction createIterablePromise({\n func,\n validate,\n aggregator,\n error,\n timeout = () => 0\n}) {\n const retry = previousResponse => {\n return new Promise((resolve, reject) => {\n func(previousResponse).then(response => {\n if (aggregator) {\n aggregator(response);\n }\n if (validate(response)) {\n return resolve(response);\n }\n if (error && error.validate(response)) {\n return reject(new Error(error.message(response)));\n }\n return setTimeout(() => {\n retry(response).then(resolve).catch(reject);\n }, timeout());\n }).catch(err => {\n reject(err);\n });\n });\n };\n return retry();\n}\n\nfunction createBrowserLocalStorageCache(options) {\n let storage;\n // We've changed the namespace to avoid conflicts with v4, as this version is a huge breaking change\n const namespaceKey = `algolia-client-js-${options.key}`;\n function getStorage() {\n if (storage === undefined) {\n storage = options.localStorage || window.localStorage;\n }\n return storage;\n }\n function getNamespace() {\n return JSON.parse(getStorage().getItem(namespaceKey) || '{}');\n }\n function setNamespace(namespace) {\n getStorage().setItem(namespaceKey, JSON.stringify(namespace));\n }\n function removeOutdatedCacheItems() {\n const timeToLive = options.timeToLive ? options.timeToLive * 1000 : null;\n const namespace = getNamespace();\n const filteredNamespaceWithoutOldFormattedCacheItems = Object.fromEntries(Object.entries(namespace).filter(([, cacheItem]) => {\n return cacheItem.timestamp !== undefined;\n }));\n setNamespace(filteredNamespaceWithoutOldFormattedCacheItems);\n if (!timeToLive) {\n return;\n }\n const filteredNamespaceWithoutExpiredItems = Object.fromEntries(Object.entries(filteredNamespaceWithoutOldFormattedCacheItems).filter(([, cacheItem]) => {\n const currentTimestamp = new Date().getTime();\n const isExpired = cacheItem.timestamp + timeToLive < currentTimestamp;\n return !isExpired;\n }));\n setNamespace(filteredNamespaceWithoutExpiredItems);\n }\n return {\n get(key, defaultValue, events = {\n miss: () => Promise.resolve()\n }) {\n return Promise.resolve().then(() => {\n removeOutdatedCacheItems();\n return getNamespace()[JSON.stringify(key)];\n }).then(value => {\n return Promise.all([value ? value.value : defaultValue(), value !== undefined]);\n }).then(([value, exists]) => {\n return Promise.all([value, exists || events.miss(value)]);\n }).then(([value]) => value);\n },\n set(key, value) {\n return Promise.resolve().then(() => {\n const namespace = getNamespace();\n namespace[JSON.stringify(key)] = {\n timestamp: new Date().getTime(),\n value\n };\n getStorage().setItem(namespaceKey, JSON.stringify(namespace));\n return value;\n });\n },\n delete(key) {\n return Promise.resolve().then(() => {\n const namespace = getNamespace();\n delete namespace[JSON.stringify(key)];\n getStorage().setItem(namespaceKey, JSON.stringify(namespace));\n });\n },\n clear() {\n return Promise.resolve().then(() => {\n getStorage().removeItem(namespaceKey);\n });\n }\n };\n}\n\nfunction createNullCache() {\n return {\n get(_key, defaultValue, events = {\n miss: () => Promise.resolve()\n }) {\n const value = defaultValue();\n return value.then(result => Promise.all([result, events.miss(result)])).then(([result]) => result);\n },\n set(_key, value) {\n return Promise.resolve(value);\n },\n delete(_key) {\n return Promise.resolve();\n },\n clear() {\n return Promise.resolve();\n }\n };\n}\n\nfunction createFallbackableCache(options) {\n const caches = [...options.caches];\n const current = caches.shift();\n if (current === undefined) {\n return createNullCache();\n }\n return {\n get(key, defaultValue, events = {\n miss: () => Promise.resolve()\n }) {\n return current.get(key, defaultValue, events).catch(() => {\n return createFallbackableCache({\n caches\n }).get(key, defaultValue, events);\n });\n },\n set(key, value) {\n return current.set(key, value).catch(() => {\n return createFallbackableCache({\n caches\n }).set(key, value);\n });\n },\n delete(key) {\n return current.delete(key).catch(() => {\n return createFallbackableCache({\n caches\n }).delete(key);\n });\n },\n clear() {\n return current.clear().catch(() => {\n return createFallbackableCache({\n caches\n }).clear();\n });\n }\n };\n}\n\nfunction createMemoryCache(options = {\n serializable: true\n}) {\n let cache = {};\n return {\n get(key, defaultValue, events = {\n miss: () => Promise.resolve()\n }) {\n const keyAsString = JSON.stringify(key);\n if (keyAsString in cache) {\n return Promise.resolve(options.serializable ? JSON.parse(cache[keyAsString]) : cache[keyAsString]);\n }\n const promise = defaultValue();\n return promise.then(value => events.miss(value)).then(() => promise);\n },\n set(key, value) {\n cache[JSON.stringify(key)] = options.serializable ? JSON.stringify(value) : value;\n return Promise.resolve(value);\n },\n delete(key) {\n delete cache[JSON.stringify(key)];\n return Promise.resolve();\n },\n clear() {\n cache = {};\n return Promise.resolve();\n }\n };\n}\n\n// By default, API Clients at Algolia have expiration delay of 5 mins.\n// In the JavaScript client, we have 2 mins.\nconst EXPIRATION_DELAY = 2 * 60 * 1000;\nfunction createStatefulHost(host, status = 'up') {\n const lastUpdate = Date.now();\n function isUp() {\n return status === 'up' || Date.now() - lastUpdate > EXPIRATION_DELAY;\n }\n function isTimedOut() {\n return status === 'timed out' && Date.now() - lastUpdate <= EXPIRATION_DELAY;\n }\n return {\n ...host,\n status,\n lastUpdate,\n isUp,\n isTimedOut\n };\n}\n\nfunction _defineProperty(e, r, t) {\n return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nfunction _toPrimitive(t, r) {\n if (\"object\" != typeof t || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != typeof i) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nfunction _toPropertyKey(t) {\n var i = _toPrimitive(t, \"string\");\n return \"symbol\" == typeof i ? i : i + \"\";\n}\n\nclass AlgoliaError extends Error {\n constructor(message, name) {\n super(message);\n _defineProperty(this, \"name\", 'AlgoliaError');\n if (name) {\n this.name = name;\n }\n }\n}\nclass ErrorWithStackTrace extends AlgoliaError {\n constructor(message, stackTrace, name) {\n super(message, name);\n // the array and object should be frozen to reflect the stackTrace at the time of the error\n _defineProperty(this, \"stackTrace\", void 0);\n this.stackTrace = stackTrace;\n }\n}\nclass RetryError extends ErrorWithStackTrace {\n constructor(stackTrace) {\n super('Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.', stackTrace, 'RetryError');\n }\n}\nclass ApiError extends ErrorWithStackTrace {\n constructor(message, status, stackTrace, name = 'ApiError') {\n super(message, stackTrace, name);\n _defineProperty(this, \"status\", void 0);\n this.status = status;\n }\n}\nclass DeserializationError extends AlgoliaError {\n constructor(message, response) {\n super(message, 'DeserializationError');\n _defineProperty(this, \"response\", void 0);\n this.response = response;\n }\n}\n// DetailedApiError is only used by the ingestion client to return more informative error, other clients will use ApiClient.\nclass DetailedApiError extends ApiError {\n constructor(message, status, error, stackTrace) {\n super(message, status, stackTrace, 'DetailedApiError');\n _defineProperty(this, \"error\", void 0);\n this.error = error;\n }\n}\n\nfunction shuffle(array) {\n const shuffledArray = array;\n for (let c = array.length - 1; c > 0; c--) {\n const b = Math.floor(Math.random() * (c + 1));\n const a = array[c];\n shuffledArray[c] = array[b];\n shuffledArray[b] = a;\n }\n return shuffledArray;\n}\nfunction serializeUrl(host, path, queryParameters) {\n const queryParametersAsString = serializeQueryParameters(queryParameters);\n let url = `${host.protocol}://${host.url}${host.port ? `:${host.port}` : ''}/${path.charAt(0) === '/' ? path.substring(1) : path}`;\n if (queryParametersAsString.length) {\n url += `?${queryParametersAsString}`;\n }\n return url;\n}\nfunction serializeQueryParameters(parameters) {\n return Object.keys(parameters).filter(key => parameters[key] !== undefined).sort().map(key => `${key}=${encodeURIComponent(Object.prototype.toString.call(parameters[key]) === '[object Array]' ? parameters[key].join(',') : parameters[key]).replaceAll('+', '%20')}`).join('&');\n}\nfunction serializeData(request, requestOptions) {\n if (request.method === 'GET' || request.data === undefined && requestOptions.data === undefined) {\n return undefined;\n }\n const data = Array.isArray(request.data) ? request.data : {\n ...request.data,\n ...requestOptions.data\n };\n return JSON.stringify(data);\n}\nfunction serializeHeaders(baseHeaders, requestHeaders, requestOptionsHeaders) {\n const headers = {\n Accept: 'application/json',\n ...baseHeaders,\n ...requestHeaders,\n ...requestOptionsHeaders\n };\n const serializedHeaders = {};\n Object.keys(headers).forEach(header => {\n const value = headers[header];\n serializedHeaders[header.toLowerCase()] = value;\n });\n return serializedHeaders;\n}\nfunction deserializeSuccess(response) {\n try {\n return JSON.parse(response.content);\n } catch (e) {\n throw new DeserializationError(e.message, response);\n }\n}\nfunction deserializeFailure({\n content,\n status\n}, stackFrame) {\n try {\n const parsed = JSON.parse(content);\n if ('error' in parsed) {\n return new DetailedApiError(parsed.message, status, parsed.error, stackFrame);\n }\n return new ApiError(parsed.message, status, stackFrame);\n } catch {\n // ..\n }\n return new ApiError(content, status, stackFrame);\n}\n\nfunction isNetworkError({\n isTimedOut,\n status\n}) {\n return !isTimedOut && ~~status === 0;\n}\nfunction isRetryable({\n isTimedOut,\n status\n}) {\n return isTimedOut || isNetworkError({\n isTimedOut,\n status\n }) || ~~(status / 100) !== 2 && ~~(status / 100) !== 4;\n}\nfunction isSuccess({\n status\n}) {\n return ~~(status / 100) === 2;\n}\n\nfunction stackTraceWithoutCredentials(stackTrace) {\n return stackTrace.map(stackFrame => stackFrameWithoutCredentials(stackFrame));\n}\nfunction stackFrameWithoutCredentials(stackFrame) {\n const modifiedHeaders = stackFrame.request.headers['x-algolia-api-key'] ? {\n 'x-algolia-api-key': '*****'\n } : {};\n return {\n ...stackFrame,\n request: {\n ...stackFrame.request,\n headers: {\n ...stackFrame.request.headers,\n ...modifiedHeaders\n }\n }\n };\n}\n\nfunction createTransporter({\n hosts,\n hostsCache,\n baseHeaders,\n baseQueryParameters,\n algoliaAgent,\n timeouts,\n requester,\n requestsCache,\n responsesCache\n}) {\n async function createRetryableOptions(compatibleHosts) {\n const statefulHosts = await Promise.all(compatibleHosts.map(compatibleHost => {\n return hostsCache.get(compatibleHost, () => {\n return Promise.resolve(createStatefulHost(compatibleHost));\n });\n }));\n const hostsUp = statefulHosts.filter(host => host.isUp());\n const hostsTimedOut = statefulHosts.filter(host => host.isTimedOut());\n // Note, we put the hosts that previously timed out on the end of the list.\n const hostsAvailable = [...hostsUp, ...hostsTimedOut];\n const compatibleHostsAvailable = hostsAvailable.length > 0 ? hostsAvailable : compatibleHosts;\n return {\n hosts: compatibleHostsAvailable,\n getTimeout(timeoutsCount, baseTimeout) {\n /**\n * Imagine that you have 4 hosts, if timeouts will increase\n * on the following way: 1 (timed out) > 4 (timed out) > 5 (200).\n *\n * Note that, the very next request, we start from the previous timeout.\n *\n * 5 (timed out) > 6 (timed out) > 7 ...\n *\n * This strategy may need to be reviewed, but is the strategy on the our\n * current v3 version.\n */\n const timeoutMultiplier = hostsTimedOut.length === 0 && timeoutsCount === 0 ? 1 : hostsTimedOut.length + 3 + timeoutsCount;\n return timeoutMultiplier * baseTimeout;\n }\n };\n }\n async function retryableRequest(request, requestOptions, isRead = true) {\n const stackTrace = [];\n /**\n * First we prepare the payload that do not depend from hosts.\n */\n const data = serializeData(request, requestOptions);\n const headers = serializeHeaders(baseHeaders, request.headers, requestOptions.headers);\n // On `GET`, the data is proxied to query parameters.\n const dataQueryParameters = request.method === 'GET' ? {\n ...request.data,\n ...requestOptions.data\n } : {};\n const queryParameters = {\n ...baseQueryParameters,\n ...request.queryParameters,\n ...dataQueryParameters\n };\n if (algoliaAgent.value) {\n queryParameters['x-algolia-agent'] = algoliaAgent.value;\n }\n if (requestOptions && requestOptions.queryParameters) {\n for (const key of Object.keys(requestOptions.queryParameters)) {\n // We want to keep `undefined` and `null` values,\n // but also avoid stringifying `object`s, as they are\n // handled in the `serializeUrl` step right after.\n if (!requestOptions.queryParameters[key] || Object.prototype.toString.call(requestOptions.queryParameters[key]) === '[object Object]') {\n queryParameters[key] = requestOptions.queryParameters[key];\n } else {\n queryParameters[key] = requestOptions.queryParameters[key].toString();\n }\n }\n }\n let timeoutsCount = 0;\n const retry = async (retryableHosts, getTimeout) => {\n /**\n * We iterate on each host, until there is no host left.\n */\n const host = retryableHosts.pop();\n if (host === undefined) {\n throw new RetryError(stackTraceWithoutCredentials(stackTrace));\n }\n const timeout = {\n ...timeouts,\n ...requestOptions.timeouts\n };\n const payload = {\n data,\n headers,\n method: request.method,\n url: serializeUrl(host, request.path, queryParameters),\n connectTimeout: getTimeout(timeoutsCount, timeout.connect),\n responseTimeout: getTimeout(timeoutsCount, isRead ? timeout.read : timeout.write)\n };\n /**\n * The stackFrame is pushed to the stackTrace so we\n * can have information about onRetry and onFailure\n * decisions.\n */\n const pushToStackTrace = response => {\n const stackFrame = {\n request: payload,\n response,\n host,\n triesLeft: retryableHosts.length\n };\n stackTrace.push(stackFrame);\n return stackFrame;\n };\n const response = await requester.send(payload);\n if (isRetryable(response)) {\n const stackFrame = pushToStackTrace(response);\n // If response is a timeout, we increase the number of timeouts so we can increase the timeout later.\n if (response.isTimedOut) {\n timeoutsCount++;\n }\n /**\n * Failures are individually sent to the logger, allowing\n * the end user to debug / store stack frames even\n * when a retry error does not happen.\n */\n // eslint-disable-next-line no-console -- this will be fixed by exposing a `logger` to the transporter\n console.log('Retryable failure', stackFrameWithoutCredentials(stackFrame));\n /**\n * We also store the state of the host in failure cases. If the host, is\n * down it will remain down for the next 2 minutes. In a timeout situation,\n * this host will be added end of the list of hosts on the next request.\n */\n await hostsCache.set(host, createStatefulHost(host, response.isTimedOut ? 'timed out' : 'down'));\n return retry(retryableHosts, getTimeout);\n }\n if (isSuccess(response)) {\n return deserializeSuccess(response);\n }\n pushToStackTrace(response);\n throw deserializeFailure(response, stackTrace);\n };\n /**\n * Finally, for each retryable host perform request until we got a non\n * retryable response. Some notes here:\n *\n * 1. The reverse here is applied so we can apply a `pop` later on => more performant.\n * 2. We also get from the retryable options a timeout multiplier that is tailored\n * for the current context.\n */\n const compatibleHosts = hosts.filter(host => host.accept === 'readWrite' || (isRead ? host.accept === 'read' : host.accept === 'write'));\n const options = await createRetryableOptions(compatibleHosts);\n return retry([...options.hosts].reverse(), options.getTimeout);\n }\n function createRequest(request, requestOptions = {}) {\n /**\n * A read request is either a `GET` request, or a request that we make\n * via the `read` transporter (e.g. `search`).\n */\n const isRead = request.useReadTransporter || request.method === 'GET';\n if (!isRead) {\n /**\n * On write requests, no cache mechanisms are applied, and we\n * proxy the request immediately to the requester.\n */\n return retryableRequest(request, requestOptions, isRead);\n }\n const createRetryableRequest = () => {\n /**\n * Then, we prepare a function factory that contains the construction of\n * the retryable request. At this point, we may *not* perform the actual\n * request. But we want to have the function factory ready.\n */\n return retryableRequest(request, requestOptions);\n };\n /**\n * Once we have the function factory ready, we need to determine of the\n * request is \"cacheable\" - should be cached. Note that, once again,\n * the user can force this option.\n */\n const cacheable = requestOptions.cacheable || request.cacheable;\n /**\n * If is not \"cacheable\", we immediately trigger the retryable request, no\n * need to check cache implementations.\n */\n if (cacheable !== true) {\n return createRetryableRequest();\n }\n /**\n * If the request is \"cacheable\", we need to first compute the key to ask\n * the cache implementations if this request is on progress or if the\n * response already exists on the cache.\n */\n const key = {\n request,\n requestOptions,\n transporter: {\n queryParameters: baseQueryParameters,\n headers: baseHeaders\n }\n };\n /**\n * With the computed key, we first ask the responses cache\n * implementation if this request was been resolved before.\n */\n return responsesCache.get(key, () => {\n /**\n * If the request has never resolved before, we actually ask if there\n * is a current request with the same key on progress.\n */\n return requestsCache.get(key, () =>\n /**\n * Finally, if there is no request in progress with the same key,\n * this `createRetryableRequest()` will actually trigger the\n * retryable request.\n */\n requestsCache.set(key, createRetryableRequest()).then(response => Promise.all([requestsCache.delete(key), response]), err => Promise.all([requestsCache.delete(key), Promise.reject(err)])).then(([_, response]) => response));\n }, {\n /**\n * Of course, once we get this response back from the server, we\n * tell response cache to actually store the received response\n * to be used later.\n */\n miss: response => responsesCache.set(key, response)\n });\n }\n return {\n hostsCache,\n requester,\n timeouts,\n algoliaAgent,\n baseHeaders,\n baseQueryParameters,\n hosts,\n request: createRequest,\n requestsCache,\n responsesCache\n };\n}\n\nfunction createAlgoliaAgent(version) {\n const algoliaAgent = {\n value: `Algolia for JavaScript (${version})`,\n add(options) {\n const addedAlgoliaAgent = `; ${options.segment}${options.version !== undefined ? ` (${options.version})` : ''}`;\n if (algoliaAgent.value.indexOf(addedAlgoliaAgent) === -1) {\n algoliaAgent.value = `${algoliaAgent.value}${addedAlgoliaAgent}`;\n }\n return algoliaAgent;\n }\n };\n return algoliaAgent;\n}\n\nfunction getAlgoliaAgent({\n algoliaAgents,\n client,\n version\n}) {\n const defaultAlgoliaAgent = createAlgoliaAgent(version).add({\n segment: client,\n version\n });\n algoliaAgents.forEach(algoliaAgent => defaultAlgoliaAgent.add(algoliaAgent));\n return defaultAlgoliaAgent;\n}\n\nconst DEFAULT_CONNECT_TIMEOUT_BROWSER = 1000;\nconst DEFAULT_READ_TIMEOUT_BROWSER = 2000;\nconst DEFAULT_WRITE_TIMEOUT_BROWSER = 30000;\nconst DEFAULT_CONNECT_TIMEOUT_NODE = 2000;\nconst DEFAULT_READ_TIMEOUT_NODE = 5000;\nconst DEFAULT_WRITE_TIMEOUT_NODE = 30000;\n\nexport { AlgoliaError, ApiError, DEFAULT_CONNECT_TIMEOUT_BROWSER, DEFAULT_CONNECT_TIMEOUT_NODE, DEFAULT_READ_TIMEOUT_BROWSER, DEFAULT_READ_TIMEOUT_NODE, DEFAULT_WRITE_TIMEOUT_BROWSER, DEFAULT_WRITE_TIMEOUT_NODE, DeserializationError, DetailedApiError, ErrorWithStackTrace, RetryError, createAlgoliaAgent, createAuth, createBrowserLocalStorageCache, createEchoRequester, createFallbackableCache, createIterablePromise, createMemoryCache, createNullCache, createStatefulHost, createTransporter, deserializeFailure, deserializeSuccess, getAlgoliaAgent, isNetworkError, isRetryable, isSuccess, serializeData, serializeHeaders, serializeQueryParameters, serializeUrl, shuffle, stackFrameWithoutCredentials, stackTraceWithoutCredentials };\n","function createAuth(appId, apiKey, authMode = 'WithinHeaders') {\n const credentials = {\n 'x-algolia-api-key': apiKey,\n 'x-algolia-application-id': appId\n };\n return {\n headers() {\n return authMode === 'WithinHeaders' ? credentials : {};\n },\n queryParameters() {\n return authMode === 'WithinQueryParameters' ? credentials : {};\n }\n };\n}\n\nfunction createBrowserLocalStorageCache(options) {\n let storage;\n // We've changed the namespace to avoid conflicts with v4, as this version is a huge breaking change\n const namespaceKey = `algolia-client-js-${options.key}`;\n function getStorage() {\n if (storage === undefined) {\n storage = options.localStorage || window.localStorage;\n }\n return storage;\n }\n function getNamespace() {\n return JSON.parse(getStorage().getItem(namespaceKey) || '{}');\n }\n function setNamespace(namespace) {\n getStorage().setItem(namespaceKey, JSON.stringify(namespace));\n }\n function removeOutdatedCacheItems() {\n const timeToLive = options.timeToLive ? options.timeToLive * 1000 : null;\n const namespace = getNamespace();\n const filteredNamespaceWithoutOldFormattedCacheItems = Object.fromEntries(Object.entries(namespace).filter(([, cacheItem]) => {\n return cacheItem.timestamp !== undefined;\n }));\n setNamespace(filteredNamespaceWithoutOldFormattedCacheItems);\n if (!timeToLive) {\n return;\n }\n const filteredNamespaceWithoutExpiredItems = Object.fromEntries(Object.entries(filteredNamespaceWithoutOldFormattedCacheItems).filter(([, cacheItem]) => {\n const currentTimestamp = new Date().getTime();\n const isExpired = cacheItem.timestamp + timeToLive < currentTimestamp;\n return !isExpired;\n }));\n setNamespace(filteredNamespaceWithoutExpiredItems);\n }\n return {\n get(key, defaultValue, events = {\n miss: () => Promise.resolve()\n }) {\n return Promise.resolve().then(() => {\n removeOutdatedCacheItems();\n return getNamespace()[JSON.stringify(key)];\n }).then(value => {\n return Promise.all([value ? value.value : defaultValue(), value !== undefined]);\n }).then(([value, exists]) => {\n return Promise.all([value, exists || events.miss(value)]);\n }).then(([value]) => value);\n },\n set(key, value) {\n return Promise.resolve().then(() => {\n const namespace = getNamespace();\n namespace[JSON.stringify(key)] = {\n timestamp: new Date().getTime(),\n value\n };\n getStorage().setItem(namespaceKey, JSON.stringify(namespace));\n return value;\n });\n },\n delete(key) {\n return Promise.resolve().then(() => {\n const namespace = getNamespace();\n delete namespace[JSON.stringify(key)];\n getStorage().setItem(namespaceKey, JSON.stringify(namespace));\n });\n },\n clear() {\n return Promise.resolve().then(() => {\n getStorage().removeItem(namespaceKey);\n });\n }\n };\n}\n\nfunction createNullCache() {\n return {\n get(_key, defaultValue, events = {\n miss: () => Promise.resolve()\n }) {\n const value = defaultValue();\n return value.then(result => Promise.all([result, events.miss(result)])).then(([result]) => result);\n },\n set(_key, value) {\n return Promise.resolve(value);\n },\n delete(_key) {\n return Promise.resolve();\n },\n clear() {\n return Promise.resolve();\n }\n };\n}\n\nfunction createFallbackableCache(options) {\n const caches = [...options.caches];\n const current = caches.shift();\n if (current === undefined) {\n return createNullCache();\n }\n return {\n get(key, defaultValue, events = {\n miss: () => Promise.resolve()\n }) {\n return current.get(key, defaultValue, events).catch(() => {\n return createFallbackableCache({\n caches\n }).get(key, defaultValue, events);\n });\n },\n set(key, value) {\n return current.set(key, value).catch(() => {\n return createFallbackableCache({\n caches\n }).set(key, value);\n });\n },\n delete(key) {\n return current.delete(key).catch(() => {\n return createFallbackableCache({\n caches\n }).delete(key);\n });\n },\n clear() {\n return current.clear().catch(() => {\n return createFallbackableCache({\n caches\n }).clear();\n });\n }\n };\n}\n\nfunction createMemoryCache(options = {\n serializable: true\n}) {\n let cache = {};\n return {\n get(key, defaultValue, events = {\n miss: () => Promise.resolve()\n }) {\n const keyAsString = JSON.stringify(key);\n if (keyAsString in cache) {\n return Promise.resolve(options.serializable ? JSON.parse(cache[keyAsString]) : cache[keyAsString]);\n }\n const promise = defaultValue();\n return promise.then(value => events.miss(value)).then(() => promise);\n },\n set(key, value) {\n cache[JSON.stringify(key)] = options.serializable ? JSON.stringify(value) : value;\n return Promise.resolve(value);\n },\n delete(key) {\n delete cache[JSON.stringify(key)];\n return Promise.resolve();\n },\n clear() {\n cache = {};\n return Promise.resolve();\n }\n };\n}\n\n// By default, API Clients at Algolia have expiration delay of 5 mins.\n// In the JavaScript client, we have 2 mins.\nconst EXPIRATION_DELAY = 2 * 60 * 1000;\nfunction createStatefulHost(host, status = 'up') {\n const lastUpdate = Date.now();\n function isUp() {\n return status === 'up' || Date.now() - lastUpdate > EXPIRATION_DELAY;\n }\n function isTimedOut() {\n return status === 'timed out' && Date.now() - lastUpdate <= EXPIRATION_DELAY;\n }\n return {\n ...host,\n status,\n lastUpdate,\n isUp,\n isTimedOut\n };\n}\n\nfunction _defineProperty(e, r, t) {\n return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nfunction _toPrimitive(t, r) {\n if (\"object\" != typeof t || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != typeof i) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nfunction _toPropertyKey(t) {\n var i = _toPrimitive(t, \"string\");\n return \"symbol\" == typeof i ? i : i + \"\";\n}\n\nclass AlgoliaError extends Error {\n constructor(message, name) {\n super(message);\n _defineProperty(this, \"name\", 'AlgoliaError');\n if (name) {\n this.name = name;\n }\n }\n}\nclass ErrorWithStackTrace extends AlgoliaError {\n constructor(message, stackTrace, name) {\n super(message, name);\n // the array and object should be frozen to reflect the stackTrace at the time of the error\n _defineProperty(this, \"stackTrace\", void 0);\n this.stackTrace = stackTrace;\n }\n}\nclass RetryError extends ErrorWithStackTrace {\n constructor(stackTrace) {\n super('Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.', stackTrace, 'RetryError');\n }\n}\nclass ApiError extends ErrorWithStackTrace {\n constructor(message, status, stackTrace, name = 'ApiError') {\n super(message, stackTrace, name);\n _defineProperty(this, \"status\", void 0);\n this.status = status;\n }\n}\nclass DeserializationError extends AlgoliaError {\n constructor(message, response) {\n super(message, 'DeserializationError');\n _defineProperty(this, \"response\", void 0);\n this.response = response;\n }\n}\n// DetailedApiError is only used by the ingestion client to return more informative error, other clients will use ApiClient.\nclass DetailedApiError extends ApiError {\n constructor(message, status, error, stackTrace) {\n super(message, status, stackTrace, 'DetailedApiError');\n _defineProperty(this, \"error\", void 0);\n this.error = error;\n }\n}\nfunction serializeUrl(host, path, queryParameters) {\n const queryParametersAsString = serializeQueryParameters(queryParameters);\n let url = `${host.protocol}://${host.url}${host.port ? `:${host.port}` : ''}/${path.charAt(0) === '/' ? path.substring(1) : path}`;\n if (queryParametersAsString.length) {\n url += `?${queryParametersAsString}`;\n }\n return url;\n}\nfunction serializeQueryParameters(parameters) {\n return Object.keys(parameters).filter(key => parameters[key] !== undefined).sort().map(key => `${key}=${encodeURIComponent(Object.prototype.toString.call(parameters[key]) === '[object Array]' ? parameters[key].join(',') : parameters[key]).replaceAll('+', '%20')}`).join('&');\n}\nfunction serializeData(request, requestOptions) {\n if (request.method === 'GET' || request.data === undefined && requestOptions.data === undefined) {\n return undefined;\n }\n const data = Array.isArray(request.data) ? request.data : {\n ...request.data,\n ...requestOptions.data\n };\n return JSON.stringify(data);\n}\nfunction serializeHeaders(baseHeaders, requestHeaders, requestOptionsHeaders) {\n const headers = {\n Accept: 'application/json',\n ...baseHeaders,\n ...requestHeaders,\n ...requestOptionsHeaders\n };\n const serializedHeaders = {};\n Object.keys(headers).forEach(header => {\n const value = headers[header];\n serializedHeaders[header.toLowerCase()] = value;\n });\n return serializedHeaders;\n}\nfunction deserializeSuccess(response) {\n try {\n return JSON.parse(response.content);\n } catch (e) {\n throw new DeserializationError(e.message, response);\n }\n}\nfunction deserializeFailure({\n content,\n status\n}, stackFrame) {\n try {\n const parsed = JSON.parse(content);\n if ('error' in parsed) {\n return new DetailedApiError(parsed.message, status, parsed.error, stackFrame);\n }\n return new ApiError(parsed.message, status, stackFrame);\n } catch {\n // ..\n }\n return new ApiError(content, status, stackFrame);\n}\n\nfunction isNetworkError({\n isTimedOut,\n status\n}) {\n return !isTimedOut && ~~status === 0;\n}\nfunction isRetryable({\n isTimedOut,\n status\n}) {\n return isTimedOut || isNetworkError({\n isTimedOut,\n status\n }) || ~~(status / 100) !== 2 && ~~(status / 100) !== 4;\n}\nfunction isSuccess({\n status\n}) {\n return ~~(status / 100) === 2;\n}\n\nfunction stackTraceWithoutCredentials(stackTrace) {\n return stackTrace.map(stackFrame => stackFrameWithoutCredentials(stackFrame));\n}\nfunction stackFrameWithoutCredentials(stackFrame) {\n const modifiedHeaders = stackFrame.request.headers['x-algolia-api-key'] ? {\n 'x-algolia-api-key': '*****'\n } : {};\n return {\n ...stackFrame,\n request: {\n ...stackFrame.request,\n headers: {\n ...stackFrame.request.headers,\n ...modifiedHeaders\n }\n }\n };\n}\n\nfunction createTransporter({\n hosts,\n hostsCache,\n baseHeaders,\n baseQueryParameters,\n algoliaAgent,\n timeouts,\n requester,\n requestsCache,\n responsesCache\n}) {\n async function createRetryableOptions(compatibleHosts) {\n const statefulHosts = await Promise.all(compatibleHosts.map(compatibleHost => {\n return hostsCache.get(compatibleHost, () => {\n return Promise.resolve(createStatefulHost(compatibleHost));\n });\n }));\n const hostsUp = statefulHosts.filter(host => host.isUp());\n const hostsTimedOut = statefulHosts.filter(host => host.isTimedOut());\n // Note, we put the hosts that previously timed out on the end of the list.\n const hostsAvailable = [...hostsUp, ...hostsTimedOut];\n const compatibleHostsAvailable = hostsAvailable.length > 0 ? hostsAvailable : compatibleHosts;\n return {\n hosts: compatibleHostsAvailable,\n getTimeout(timeoutsCount, baseTimeout) {\n /**\n * Imagine that you have 4 hosts, if timeouts will increase\n * on the following way: 1 (timed out) > 4 (timed out) > 5 (200).\n *\n * Note that, the very next request, we start from the previous timeout.\n *\n * 5 (timed out) > 6 (timed out) > 7 ...\n *\n * This strategy may need to be reviewed, but is the strategy on the our\n * current v3 version.\n */\n const timeoutMultiplier = hostsTimedOut.length === 0 && timeoutsCount === 0 ? 1 : hostsTimedOut.length + 3 + timeoutsCount;\n return timeoutMultiplier * baseTimeout;\n }\n };\n }\n async function retryableRequest(request, requestOptions, isRead = true) {\n const stackTrace = [];\n /**\n * First we prepare the payload that do not depend from hosts.\n */\n const data = serializeData(request, requestOptions);\n const headers = serializeHeaders(baseHeaders, request.headers, requestOptions.headers);\n // On `GET`, the data is proxied to query parameters.\n const dataQueryParameters = request.method === 'GET' ? {\n ...request.data,\n ...requestOptions.data\n } : {};\n const queryParameters = {\n ...baseQueryParameters,\n ...request.queryParameters,\n ...dataQueryParameters\n };\n if (algoliaAgent.value) {\n queryParameters['x-algolia-agent'] = algoliaAgent.value;\n }\n if (requestOptions && requestOptions.queryParameters) {\n for (const key of Object.keys(requestOptions.queryParameters)) {\n // We want to keep `undefined` and `null` values,\n // but also avoid stringifying `object`s, as they are\n // handled in the `serializeUrl` step right after.\n if (!requestOptions.queryParameters[key] || Object.prototype.toString.call(requestOptions.queryParameters[key]) === '[object Object]') {\n queryParameters[key] = requestOptions.queryParameters[key];\n } else {\n queryParameters[key] = requestOptions.queryParameters[key].toString();\n }\n }\n }\n let timeoutsCount = 0;\n const retry = async (retryableHosts, getTimeout) => {\n /**\n * We iterate on each host, until there is no host left.\n */\n const host = retryableHosts.pop();\n if (host === undefined) {\n throw new RetryError(stackTraceWithoutCredentials(stackTrace));\n }\n const timeout = {\n ...timeouts,\n ...requestOptions.timeouts\n };\n const payload = {\n data,\n headers,\n method: request.method,\n url: serializeUrl(host, request.path, queryParameters),\n connectTimeout: getTimeout(timeoutsCount, timeout.connect),\n responseTimeout: getTimeout(timeoutsCount, isRead ? timeout.read : timeout.write)\n };\n /**\n * The stackFrame is pushed to the stackTrace so we\n * can have information about onRetry and onFailure\n * decisions.\n */\n const pushToStackTrace = response => {\n const stackFrame = {\n request: payload,\n response,\n host,\n triesLeft: retryableHosts.length\n };\n stackTrace.push(stackFrame);\n return stackFrame;\n };\n const response = await requester.send(payload);\n if (isRetryable(response)) {\n const stackFrame = pushToStackTrace(response);\n // If response is a timeout, we increase the number of timeouts so we can increase the timeout later.\n if (response.isTimedOut) {\n timeoutsCount++;\n }\n /**\n * Failures are individually sent to the logger, allowing\n * the end user to debug / store stack frames even\n * when a retry error does not happen.\n */\n // eslint-disable-next-line no-console -- this will be fixed by exposing a `logger` to the transporter\n console.log('Retryable failure', stackFrameWithoutCredentials(stackFrame));\n /**\n * We also store the state of the host in failure cases. If the host, is\n * down it will remain down for the next 2 minutes. In a timeout situation,\n * this host will be added end of the list of hosts on the next request.\n */\n await hostsCache.set(host, createStatefulHost(host, response.isTimedOut ? 'timed out' : 'down'));\n return retry(retryableHosts, getTimeout);\n }\n if (isSuccess(response)) {\n return deserializeSuccess(response);\n }\n pushToStackTrace(response);\n throw deserializeFailure(response, stackTrace);\n };\n /**\n * Finally, for each retryable host perform request until we got a non\n * retryable response. Some notes here:\n *\n * 1. The reverse here is applied so we can apply a `pop` later on => more performant.\n * 2. We also get from the retryable options a timeout multiplier that is tailored\n * for the current context.\n */\n const compatibleHosts = hosts.filter(host => host.accept === 'readWrite' || (isRead ? host.accept === 'read' : host.accept === 'write'));\n const options = await createRetryableOptions(compatibleHosts);\n return retry([...options.hosts].reverse(), options.getTimeout);\n }\n function createRequest(request, requestOptions = {}) {\n /**\n * A read request is either a `GET` request, or a request that we make\n * via the `read` transporter (e.g. `search`).\n */\n const isRead = request.useReadTransporter || request.method === 'GET';\n if (!isRead) {\n /**\n * On write requests, no cache mechanisms are applied, and we\n * proxy the request immediately to the requester.\n */\n return retryableRequest(request, requestOptions, isRead);\n }\n const createRetryableRequest = () => {\n /**\n * Then, we prepare a function factory that contains the construction of\n * the retryable request. At this point, we may *not* perform the actual\n * request. But we want to have the function factory ready.\n */\n return retryableRequest(request, requestOptions);\n };\n /**\n * Once we have the function factory ready, we need to determine of the\n * request is \"cacheable\" - should be cached. Note that, once again,\n * the user can force this option.\n */\n const cacheable = requestOptions.cacheable || request.cacheable;\n /**\n * If is not \"cacheable\", we immediately trigger the retryable request, no\n * need to check cache implementations.\n */\n if (cacheable !== true) {\n return createRetryableRequest();\n }\n /**\n * If the request is \"cacheable\", we need to first compute the key to ask\n * the cache implementations if this request is on progress or if the\n * response already exists on the cache.\n */\n const key = {\n request,\n requestOptions,\n transporter: {\n queryParameters: baseQueryParameters,\n headers: baseHeaders\n }\n };\n /**\n * With the computed key, we first ask the responses cache\n * implementation if this request was been resolved before.\n */\n return responsesCache.get(key, () => {\n /**\n * If the request has never resolved before, we actually ask if there\n * is a current request with the same key on progress.\n */\n return requestsCache.get(key, () =>\n /**\n * Finally, if there is no request in progress with the same key,\n * this `createRetryableRequest()` will actually trigger the\n * retryable request.\n */\n requestsCache.set(key, createRetryableRequest()).then(response => Promise.all([requestsCache.delete(key), response]), err => Promise.all([requestsCache.delete(key), Promise.reject(err)])).then(([_, response]) => response));\n }, {\n /**\n * Of course, once we get this response back from the server, we\n * tell response cache to actually store the received response\n * to be used later.\n */\n miss: response => responsesCache.set(key, response)\n });\n }\n return {\n hostsCache,\n requester,\n timeouts,\n algoliaAgent,\n baseHeaders,\n baseQueryParameters,\n hosts,\n request: createRequest,\n requestsCache,\n responsesCache\n };\n}\n\nfunction createAlgoliaAgent(version) {\n const algoliaAgent = {\n value: `Algolia for JavaScript (${version})`,\n add(options) {\n const addedAlgoliaAgent = `; ${options.segment}${options.version !== undefined ? ` (${options.version})` : ''}`;\n if (algoliaAgent.value.indexOf(addedAlgoliaAgent) === -1) {\n algoliaAgent.value = `${algoliaAgent.value}${addedAlgoliaAgent}`;\n }\n return algoliaAgent;\n }\n };\n return algoliaAgent;\n}\n\nfunction getAlgoliaAgent({\n algoliaAgents,\n client,\n version\n}) {\n const defaultAlgoliaAgent = createAlgoliaAgent(version).add({\n segment: client,\n version\n });\n algoliaAgents.forEach(algoliaAgent => defaultAlgoliaAgent.add(algoliaAgent));\n return defaultAlgoliaAgent;\n}\n\nconst DEFAULT_CONNECT_TIMEOUT_BROWSER = 1000;\nconst DEFAULT_READ_TIMEOUT_BROWSER = 2000;\nconst DEFAULT_WRITE_TIMEOUT_BROWSER = 30000;\n\nfunction createXhrRequester() {\n function send(request) {\n return new Promise((resolve) => {\n const baseRequester = new XMLHttpRequest();\n baseRequester.open(request.method, request.url, true);\n Object.keys(request.headers).forEach((key) => baseRequester.setRequestHeader(key, request.headers[key]));\n const createTimeout = (timeout, content) => {\n return setTimeout(() => {\n baseRequester.abort();\n resolve({\n status: 0,\n content,\n isTimedOut: true,\n });\n }, timeout);\n };\n const connectTimeout = createTimeout(request.connectTimeout, 'Connection timeout');\n let responseTimeout;\n baseRequester.onreadystatechange = () => {\n if (baseRequester.readyState > baseRequester.OPENED && responseTimeout === undefined) {\n clearTimeout(connectTimeout);\n responseTimeout = createTimeout(request.responseTimeout, 'Socket timeout');\n }\n };\n baseRequester.onerror = () => {\n // istanbul ignore next\n if (baseRequester.status === 0) {\n clearTimeout(connectTimeout);\n clearTimeout(responseTimeout);\n resolve({\n content: baseRequester.responseText || 'Network request failed',\n status: baseRequester.status,\n isTimedOut: false,\n });\n }\n };\n baseRequester.onload = () => {\n clearTimeout(connectTimeout);\n clearTimeout(responseTimeout);\n resolve({\n content: baseRequester.responseText,\n status: baseRequester.status,\n isTimedOut: false,\n });\n };\n baseRequester.send(request.data);\n });\n }\n return { send };\n}\n\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.\nconst apiClientVersion = '5.2.4';\nconst REGIONS = ['eu', 'us'];\nfunction getDefaultHosts(region) {\n const url = 'personalization.{region}.algolia.com'.replace('{region}', region);\n return [{ url, accept: 'readWrite', protocol: 'https' }];\n}\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nfunction createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(regionOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Personalization',\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 return {\n transporter,\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache() {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua() {\n return transporter.algoliaAgent.value;\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, version) {\n transporter.algoliaAgent.add({ segment, version });\n },\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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({ path, parameters }, requestOptions) {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customDelete`.');\n }\n const requestPath = '/{path}'.replace('{path}', path);\n const headers = {};\n const queryParameters = parameters ? parameters : {};\n const request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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 }, requestOptions) {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customGet`.');\n }\n const requestPath = '/{path}'.replace('{path}', path);\n const headers = {};\n const queryParameters = parameters ? parameters : {};\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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({ path, parameters, body }, requestOptions) {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\n const requestPath = '/{path}'.replace('{path}', path);\n const headers = {};\n const queryParameters = parameters ? parameters : {};\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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({ path, parameters, body }, requestOptions) {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPut`.');\n }\n const requestPath = '/{path}'.replace('{path}', path);\n const headers = {};\n const queryParameters = parameters ? parameters : {};\n const request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Deletes a user profile. The response includes a date and time when the user profile can safely be considered deleted.\n *\n * Required API Key ACLs:\n * - recommendation.\n *\n * @param deleteUserProfile - The deleteUserProfile object.\n * @param deleteUserProfile.userToken - Unique identifier representing a user for which to fetch the personalization profile.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteUserProfile({ userToken }, requestOptions) {\n if (!userToken) {\n throw new Error('Parameter `userToken` is required when calling `deleteUserProfile`.');\n }\n const requestPath = '/1/profiles/{userToken}'.replace('{userToken}', encodeURIComponent(userToken));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves the current personalization strategy.\n *\n * Required API Key ACLs:\n * - recommendation.\n *\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getPersonalizationStrategy(requestOptions) {\n const requestPath = '/1/strategies/personalization';\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves a user profile and their affinities for different facets.\n *\n * Required API Key ACLs:\n * - recommendation.\n *\n * @param getUserTokenProfile - The getUserTokenProfile object.\n * @param getUserTokenProfile.userToken - Unique identifier representing a user for which to fetch the personalization profile.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getUserTokenProfile({ userToken }, requestOptions) {\n if (!userToken) {\n throw new Error('Parameter `userToken` is required when calling `getUserTokenProfile`.');\n }\n const requestPath = '/1/profiles/personalization/{userToken}'.replace('{userToken}', encodeURIComponent(userToken));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Creates a new personalization strategy.\n *\n * Required API Key ACLs:\n * - recommendation.\n *\n * @param personalizationStrategyParams - The personalizationStrategyParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n setPersonalizationStrategy(personalizationStrategyParams, requestOptions) {\n if (!personalizationStrategyParams) {\n throw new Error('Parameter `personalizationStrategyParams` is required when calling `setPersonalizationStrategy`.');\n }\n if (!personalizationStrategyParams.eventScoring) {\n throw new Error('Parameter `personalizationStrategyParams.eventScoring` is required when calling `setPersonalizationStrategy`.');\n }\n if (!personalizationStrategyParams.facetScoring) {\n throw new Error('Parameter `personalizationStrategyParams.facetScoring` is required when calling `setPersonalizationStrategy`.');\n }\n if (!personalizationStrategyParams.personalizationImpact) {\n throw new Error('Parameter `personalizationStrategyParams.personalizationImpact` is required when calling `setPersonalizationStrategy`.');\n }\n const requestPath = '/1/strategies/personalization';\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: personalizationStrategyParams,\n };\n return transporter.request(request, requestOptions);\n },\n };\n}\n\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// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nfunction personalizationClient(appId, apiKey, region, options) {\n if (!appId || typeof appId !== 'string') {\n throw new Error('`appId` is missing.');\n }\n if (!apiKey || typeof apiKey !== 'string') {\n throw new Error('`apiKey` is missing.');\n }\n if (!region || (region && (typeof region !== 'string' || !REGIONS.includes(region)))) {\n throw new Error(`\\`region\\` is required and must be one of the following: ${REGIONS.join(', ')}`);\n }\n return createPersonalizationClient({\n appId,\n apiKey,\n region,\n timeouts: {\n connect: DEFAULT_CONNECT_TIMEOUT_BROWSER,\n read: DEFAULT_READ_TIMEOUT_BROWSER,\n write: DEFAULT_WRITE_TIMEOUT_BROWSER,\n },\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 ...options,\n });\n}\n\nexport { apiClientVersion, personalizationClient };\n","function createAuth(appId, apiKey, authMode = 'WithinHeaders') {\n const credentials = {\n 'x-algolia-api-key': apiKey,\n 'x-algolia-application-id': appId\n };\n return {\n headers() {\n return authMode === 'WithinHeaders' ? credentials : {};\n },\n queryParameters() {\n return authMode === 'WithinQueryParameters' ? credentials : {};\n }\n };\n}\n\n/**\n * Helper: Returns the promise of a given `func` to iterate on, based on a given `validate` condition.\n *\n * @param createIterator - The createIterator options.\n * @param createIterator.func - The function to run, which returns a promise.\n * @param createIterator.validate - The validator function. It receives the resolved return of `func`.\n * @param createIterator.aggregator - The function that runs right after the `func` method has been executed, allows you to do anything with the response before `validate`.\n * @param createIterator.error - The `validate` condition to throw an error, and its message.\n * @param createIterator.timeout - The function to decide how long to wait between iterations.\n */\nfunction createIterablePromise({\n func,\n validate,\n aggregator,\n error,\n timeout = () => 0\n}) {\n const retry = previousResponse => {\n return new Promise((resolve, reject) => {\n func(previousResponse).then(response => {\n if (aggregator) {\n aggregator(response);\n }\n if (validate(response)) {\n return resolve(response);\n }\n if (error && error.validate(response)) {\n return reject(new Error(error.message(response)));\n }\n return setTimeout(() => {\n retry(response).then(resolve).catch(reject);\n }, timeout());\n }).catch(err => {\n reject(err);\n });\n });\n };\n return retry();\n}\n\nfunction createBrowserLocalStorageCache(options) {\n let storage;\n // We've changed the namespace to avoid conflicts with v4, as this version is a huge breaking change\n const namespaceKey = `algolia-client-js-${options.key}`;\n function getStorage() {\n if (storage === undefined) {\n storage = options.localStorage || window.localStorage;\n }\n return storage;\n }\n function getNamespace() {\n return JSON.parse(getStorage().getItem(namespaceKey) || '{}');\n }\n function setNamespace(namespace) {\n getStorage().setItem(namespaceKey, JSON.stringify(namespace));\n }\n function removeOutdatedCacheItems() {\n const timeToLive = options.timeToLive ? options.timeToLive * 1000 : null;\n const namespace = getNamespace();\n const filteredNamespaceWithoutOldFormattedCacheItems = Object.fromEntries(Object.entries(namespace).filter(([, cacheItem]) => {\n return cacheItem.timestamp !== undefined;\n }));\n setNamespace(filteredNamespaceWithoutOldFormattedCacheItems);\n if (!timeToLive) {\n return;\n }\n const filteredNamespaceWithoutExpiredItems = Object.fromEntries(Object.entries(filteredNamespaceWithoutOldFormattedCacheItems).filter(([, cacheItem]) => {\n const currentTimestamp = new Date().getTime();\n const isExpired = cacheItem.timestamp + timeToLive < currentTimestamp;\n return !isExpired;\n }));\n setNamespace(filteredNamespaceWithoutExpiredItems);\n }\n return {\n get(key, defaultValue, events = {\n miss: () => Promise.resolve()\n }) {\n return Promise.resolve().then(() => {\n removeOutdatedCacheItems();\n return getNamespace()[JSON.stringify(key)];\n }).then(value => {\n return Promise.all([value ? value.value : defaultValue(), value !== undefined]);\n }).then(([value, exists]) => {\n return Promise.all([value, exists || events.miss(value)]);\n }).then(([value]) => value);\n },\n set(key, value) {\n return Promise.resolve().then(() => {\n const namespace = getNamespace();\n namespace[JSON.stringify(key)] = {\n timestamp: new Date().getTime(),\n value\n };\n getStorage().setItem(namespaceKey, JSON.stringify(namespace));\n return value;\n });\n },\n delete(key) {\n return Promise.resolve().then(() => {\n const namespace = getNamespace();\n delete namespace[JSON.stringify(key)];\n getStorage().setItem(namespaceKey, JSON.stringify(namespace));\n });\n },\n clear() {\n return Promise.resolve().then(() => {\n getStorage().removeItem(namespaceKey);\n });\n }\n };\n}\n\nfunction createNullCache() {\n return {\n get(_key, defaultValue, events = {\n miss: () => Promise.resolve()\n }) {\n const value = defaultValue();\n return value.then(result => Promise.all([result, events.miss(result)])).then(([result]) => result);\n },\n set(_key, value) {\n return Promise.resolve(value);\n },\n delete(_key) {\n return Promise.resolve();\n },\n clear() {\n return Promise.resolve();\n }\n };\n}\n\nfunction createFallbackableCache(options) {\n const caches = [...options.caches];\n const current = caches.shift();\n if (current === undefined) {\n return createNullCache();\n }\n return {\n get(key, defaultValue, events = {\n miss: () => Promise.resolve()\n }) {\n return current.get(key, defaultValue, events).catch(() => {\n return createFallbackableCache({\n caches\n }).get(key, defaultValue, events);\n });\n },\n set(key, value) {\n return current.set(key, value).catch(() => {\n return createFallbackableCache({\n caches\n }).set(key, value);\n });\n },\n delete(key) {\n return current.delete(key).catch(() => {\n return createFallbackableCache({\n caches\n }).delete(key);\n });\n },\n clear() {\n return current.clear().catch(() => {\n return createFallbackableCache({\n caches\n }).clear();\n });\n }\n };\n}\n\nfunction createMemoryCache(options = {\n serializable: true\n}) {\n let cache = {};\n return {\n get(key, defaultValue, events = {\n miss: () => Promise.resolve()\n }) {\n const keyAsString = JSON.stringify(key);\n if (keyAsString in cache) {\n return Promise.resolve(options.serializable ? JSON.parse(cache[keyAsString]) : cache[keyAsString]);\n }\n const promise = defaultValue();\n return promise.then(value => events.miss(value)).then(() => promise);\n },\n set(key, value) {\n cache[JSON.stringify(key)] = options.serializable ? JSON.stringify(value) : value;\n return Promise.resolve(value);\n },\n delete(key) {\n delete cache[JSON.stringify(key)];\n return Promise.resolve();\n },\n clear() {\n cache = {};\n return Promise.resolve();\n }\n };\n}\n\n// By default, API Clients at Algolia have expiration delay of 5 mins.\n// In the JavaScript client, we have 2 mins.\nconst EXPIRATION_DELAY = 2 * 60 * 1000;\nfunction createStatefulHost(host, status = 'up') {\n const lastUpdate = Date.now();\n function isUp() {\n return status === 'up' || Date.now() - lastUpdate > EXPIRATION_DELAY;\n }\n function isTimedOut() {\n return status === 'timed out' && Date.now() - lastUpdate <= EXPIRATION_DELAY;\n }\n return {\n ...host,\n status,\n lastUpdate,\n isUp,\n isTimedOut\n };\n}\n\nfunction _defineProperty(e, r, t) {\n return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nfunction _toPrimitive(t, r) {\n if (\"object\" != typeof t || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != typeof i) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nfunction _toPropertyKey(t) {\n var i = _toPrimitive(t, \"string\");\n return \"symbol\" == typeof i ? i : i + \"\";\n}\n\nclass AlgoliaError extends Error {\n constructor(message, name) {\n super(message);\n _defineProperty(this, \"name\", 'AlgoliaError');\n if (name) {\n this.name = name;\n }\n }\n}\nclass ErrorWithStackTrace extends AlgoliaError {\n constructor(message, stackTrace, name) {\n super(message, name);\n // the array and object should be frozen to reflect the stackTrace at the time of the error\n _defineProperty(this, \"stackTrace\", void 0);\n this.stackTrace = stackTrace;\n }\n}\nclass RetryError extends ErrorWithStackTrace {\n constructor(stackTrace) {\n super('Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.', stackTrace, 'RetryError');\n }\n}\nclass ApiError extends ErrorWithStackTrace {\n constructor(message, status, stackTrace, name = 'ApiError') {\n super(message, stackTrace, name);\n _defineProperty(this, \"status\", void 0);\n this.status = status;\n }\n}\nclass DeserializationError extends AlgoliaError {\n constructor(message, response) {\n super(message, 'DeserializationError');\n _defineProperty(this, \"response\", void 0);\n this.response = response;\n }\n}\n// DetailedApiError is only used by the ingestion client to return more informative error, other clients will use ApiClient.\nclass DetailedApiError extends ApiError {\n constructor(message, status, error, stackTrace) {\n super(message, status, stackTrace, 'DetailedApiError');\n _defineProperty(this, \"error\", void 0);\n this.error = error;\n }\n}\n\nfunction shuffle(array) {\n const shuffledArray = array;\n for (let c = array.length - 1; c > 0; c--) {\n const b = Math.floor(Math.random() * (c + 1));\n const a = array[c];\n shuffledArray[c] = array[b];\n shuffledArray[b] = a;\n }\n return shuffledArray;\n}\nfunction serializeUrl(host, path, queryParameters) {\n const queryParametersAsString = serializeQueryParameters(queryParameters);\n let url = `${host.protocol}://${host.url}${host.port ? `:${host.port}` : ''}/${path.charAt(0) === '/' ? path.substring(1) : path}`;\n if (queryParametersAsString.length) {\n url += `?${queryParametersAsString}`;\n }\n return url;\n}\nfunction serializeQueryParameters(parameters) {\n return Object.keys(parameters).filter(key => parameters[key] !== undefined).sort().map(key => `${key}=${encodeURIComponent(Object.prototype.toString.call(parameters[key]) === '[object Array]' ? parameters[key].join(',') : parameters[key]).replaceAll('+', '%20')}`).join('&');\n}\nfunction serializeData(request, requestOptions) {\n if (request.method === 'GET' || request.data === undefined && requestOptions.data === undefined) {\n return undefined;\n }\n const data = Array.isArray(request.data) ? request.data : {\n ...request.data,\n ...requestOptions.data\n };\n return JSON.stringify(data);\n}\nfunction serializeHeaders(baseHeaders, requestHeaders, requestOptionsHeaders) {\n const headers = {\n Accept: 'application/json',\n ...baseHeaders,\n ...requestHeaders,\n ...requestOptionsHeaders\n };\n const serializedHeaders = {};\n Object.keys(headers).forEach(header => {\n const value = headers[header];\n serializedHeaders[header.toLowerCase()] = value;\n });\n return serializedHeaders;\n}\nfunction deserializeSuccess(response) {\n try {\n return JSON.parse(response.content);\n } catch (e) {\n throw new DeserializationError(e.message, response);\n }\n}\nfunction deserializeFailure({\n content,\n status\n}, stackFrame) {\n try {\n const parsed = JSON.parse(content);\n if ('error' in parsed) {\n return new DetailedApiError(parsed.message, status, parsed.error, stackFrame);\n }\n return new ApiError(parsed.message, status, stackFrame);\n } catch {\n // ..\n }\n return new ApiError(content, status, stackFrame);\n}\n\nfunction isNetworkError({\n isTimedOut,\n status\n}) {\n return !isTimedOut && ~~status === 0;\n}\nfunction isRetryable({\n isTimedOut,\n status\n}) {\n return isTimedOut || isNetworkError({\n isTimedOut,\n status\n }) || ~~(status / 100) !== 2 && ~~(status / 100) !== 4;\n}\nfunction isSuccess({\n status\n}) {\n return ~~(status / 100) === 2;\n}\n\nfunction stackTraceWithoutCredentials(stackTrace) {\n return stackTrace.map(stackFrame => stackFrameWithoutCredentials(stackFrame));\n}\nfunction stackFrameWithoutCredentials(stackFrame) {\n const modifiedHeaders = stackFrame.request.headers['x-algolia-api-key'] ? {\n 'x-algolia-api-key': '*****'\n } : {};\n return {\n ...stackFrame,\n request: {\n ...stackFrame.request,\n headers: {\n ...stackFrame.request.headers,\n ...modifiedHeaders\n }\n }\n };\n}\n\nfunction createTransporter({\n hosts,\n hostsCache,\n baseHeaders,\n baseQueryParameters,\n algoliaAgent,\n timeouts,\n requester,\n requestsCache,\n responsesCache\n}) {\n async function createRetryableOptions(compatibleHosts) {\n const statefulHosts = await Promise.all(compatibleHosts.map(compatibleHost => {\n return hostsCache.get(compatibleHost, () => {\n return Promise.resolve(createStatefulHost(compatibleHost));\n });\n }));\n const hostsUp = statefulHosts.filter(host => host.isUp());\n const hostsTimedOut = statefulHosts.filter(host => host.isTimedOut());\n // Note, we put the hosts that previously timed out on the end of the list.\n const hostsAvailable = [...hostsUp, ...hostsTimedOut];\n const compatibleHostsAvailable = hostsAvailable.length > 0 ? hostsAvailable : compatibleHosts;\n return {\n hosts: compatibleHostsAvailable,\n getTimeout(timeoutsCount, baseTimeout) {\n /**\n * Imagine that you have 4 hosts, if timeouts will increase\n * on the following way: 1 (timed out) > 4 (timed out) > 5 (200).\n *\n * Note that, the very next request, we start from the previous timeout.\n *\n * 5 (timed out) > 6 (timed out) > 7 ...\n *\n * This strategy may need to be reviewed, but is the strategy on the our\n * current v3 version.\n */\n const timeoutMultiplier = hostsTimedOut.length === 0 && timeoutsCount === 0 ? 1 : hostsTimedOut.length + 3 + timeoutsCount;\n return timeoutMultiplier * baseTimeout;\n }\n };\n }\n async function retryableRequest(request, requestOptions, isRead = true) {\n const stackTrace = [];\n /**\n * First we prepare the payload that do not depend from hosts.\n */\n const data = serializeData(request, requestOptions);\n const headers = serializeHeaders(baseHeaders, request.headers, requestOptions.headers);\n // On `GET`, the data is proxied to query parameters.\n const dataQueryParameters = request.method === 'GET' ? {\n ...request.data,\n ...requestOptions.data\n } : {};\n const queryParameters = {\n ...baseQueryParameters,\n ...request.queryParameters,\n ...dataQueryParameters\n };\n if (algoliaAgent.value) {\n queryParameters['x-algolia-agent'] = algoliaAgent.value;\n }\n if (requestOptions && requestOptions.queryParameters) {\n for (const key of Object.keys(requestOptions.queryParameters)) {\n // We want to keep `undefined` and `null` values,\n // but also avoid stringifying `object`s, as they are\n // handled in the `serializeUrl` step right after.\n if (!requestOptions.queryParameters[key] || Object.prototype.toString.call(requestOptions.queryParameters[key]) === '[object Object]') {\n queryParameters[key] = requestOptions.queryParameters[key];\n } else {\n queryParameters[key] = requestOptions.queryParameters[key].toString();\n }\n }\n }\n let timeoutsCount = 0;\n const retry = async (retryableHosts, getTimeout) => {\n /**\n * We iterate on each host, until there is no host left.\n */\n const host = retryableHosts.pop();\n if (host === undefined) {\n throw new RetryError(stackTraceWithoutCredentials(stackTrace));\n }\n const timeout = {\n ...timeouts,\n ...requestOptions.timeouts\n };\n const payload = {\n data,\n headers,\n method: request.method,\n url: serializeUrl(host, request.path, queryParameters),\n connectTimeout: getTimeout(timeoutsCount, timeout.connect),\n responseTimeout: getTimeout(timeoutsCount, isRead ? timeout.read : timeout.write)\n };\n /**\n * The stackFrame is pushed to the stackTrace so we\n * can have information about onRetry and onFailure\n * decisions.\n */\n const pushToStackTrace = response => {\n const stackFrame = {\n request: payload,\n response,\n host,\n triesLeft: retryableHosts.length\n };\n stackTrace.push(stackFrame);\n return stackFrame;\n };\n const response = await requester.send(payload);\n if (isRetryable(response)) {\n const stackFrame = pushToStackTrace(response);\n // If response is a timeout, we increase the number of timeouts so we can increase the timeout later.\n if (response.isTimedOut) {\n timeoutsCount++;\n }\n /**\n * Failures are individually sent to the logger, allowing\n * the end user to debug / store stack frames even\n * when a retry error does not happen.\n */\n // eslint-disable-next-line no-console -- this will be fixed by exposing a `logger` to the transporter\n console.log('Retryable failure', stackFrameWithoutCredentials(stackFrame));\n /**\n * We also store the state of the host in failure cases. If the host, is\n * down it will remain down for the next 2 minutes. In a timeout situation,\n * this host will be added end of the list of hosts on the next request.\n */\n await hostsCache.set(host, createStatefulHost(host, response.isTimedOut ? 'timed out' : 'down'));\n return retry(retryableHosts, getTimeout);\n }\n if (isSuccess(response)) {\n return deserializeSuccess(response);\n }\n pushToStackTrace(response);\n throw deserializeFailure(response, stackTrace);\n };\n /**\n * Finally, for each retryable host perform request until we got a non\n * retryable response. Some notes here:\n *\n * 1. The reverse here is applied so we can apply a `pop` later on => more performant.\n * 2. We also get from the retryable options a timeout multiplier that is tailored\n * for the current context.\n */\n const compatibleHosts = hosts.filter(host => host.accept === 'readWrite' || (isRead ? host.accept === 'read' : host.accept === 'write'));\n const options = await createRetryableOptions(compatibleHosts);\n return retry([...options.hosts].reverse(), options.getTimeout);\n }\n function createRequest(request, requestOptions = {}) {\n /**\n * A read request is either a `GET` request, or a request that we make\n * via the `read` transporter (e.g. `search`).\n */\n const isRead = request.useReadTransporter || request.method === 'GET';\n if (!isRead) {\n /**\n * On write requests, no cache mechanisms are applied, and we\n * proxy the request immediately to the requester.\n */\n return retryableRequest(request, requestOptions, isRead);\n }\n const createRetryableRequest = () => {\n /**\n * Then, we prepare a function factory that contains the construction of\n * the retryable request. At this point, we may *not* perform the actual\n * request. But we want to have the function factory ready.\n */\n return retryableRequest(request, requestOptions);\n };\n /**\n * Once we have the function factory ready, we need to determine of the\n * request is \"cacheable\" - should be cached. Note that, once again,\n * the user can force this option.\n */\n const cacheable = requestOptions.cacheable || request.cacheable;\n /**\n * If is not \"cacheable\", we immediately trigger the retryable request, no\n * need to check cache implementations.\n */\n if (cacheable !== true) {\n return createRetryableRequest();\n }\n /**\n * If the request is \"cacheable\", we need to first compute the key to ask\n * the cache implementations if this request is on progress or if the\n * response already exists on the cache.\n */\n const key = {\n request,\n requestOptions,\n transporter: {\n queryParameters: baseQueryParameters,\n headers: baseHeaders\n }\n };\n /**\n * With the computed key, we first ask the responses cache\n * implementation if this request was been resolved before.\n */\n return responsesCache.get(key, () => {\n /**\n * If the request has never resolved before, we actually ask if there\n * is a current request with the same key on progress.\n */\n return requestsCache.get(key, () =>\n /**\n * Finally, if there is no request in progress with the same key,\n * this `createRetryableRequest()` will actually trigger the\n * retryable request.\n */\n requestsCache.set(key, createRetryableRequest()).then(response => Promise.all([requestsCache.delete(key), response]), err => Promise.all([requestsCache.delete(key), Promise.reject(err)])).then(([_, response]) => response));\n }, {\n /**\n * Of course, once we get this response back from the server, we\n * tell response cache to actually store the received response\n * to be used later.\n */\n miss: response => responsesCache.set(key, response)\n });\n }\n return {\n hostsCache,\n requester,\n timeouts,\n algoliaAgent,\n baseHeaders,\n baseQueryParameters,\n hosts,\n request: createRequest,\n requestsCache,\n responsesCache\n };\n}\n\nfunction createAlgoliaAgent(version) {\n const algoliaAgent = {\n value: `Algolia for JavaScript (${version})`,\n add(options) {\n const addedAlgoliaAgent = `; ${options.segment}${options.version !== undefined ? ` (${options.version})` : ''}`;\n if (algoliaAgent.value.indexOf(addedAlgoliaAgent) === -1) {\n algoliaAgent.value = `${algoliaAgent.value}${addedAlgoliaAgent}`;\n }\n return algoliaAgent;\n }\n };\n return algoliaAgent;\n}\n\nfunction getAlgoliaAgent({\n algoliaAgents,\n client,\n version\n}) {\n const defaultAlgoliaAgent = createAlgoliaAgent(version).add({\n segment: client,\n version\n });\n algoliaAgents.forEach(algoliaAgent => defaultAlgoliaAgent.add(algoliaAgent));\n return defaultAlgoliaAgent;\n}\n\nconst DEFAULT_CONNECT_TIMEOUT_BROWSER = 1000;\nconst DEFAULT_READ_TIMEOUT_BROWSER = 2000;\nconst DEFAULT_WRITE_TIMEOUT_BROWSER = 30000;\n\nfunction createXhrRequester() {\n function send(request) {\n return new Promise((resolve) => {\n const baseRequester = new XMLHttpRequest();\n baseRequester.open(request.method, request.url, true);\n Object.keys(request.headers).forEach((key) => baseRequester.setRequestHeader(key, request.headers[key]));\n const createTimeout = (timeout, content) => {\n return setTimeout(() => {\n baseRequester.abort();\n resolve({\n status: 0,\n content,\n isTimedOut: true,\n });\n }, timeout);\n };\n const connectTimeout = createTimeout(request.connectTimeout, 'Connection timeout');\n let responseTimeout;\n baseRequester.onreadystatechange = () => {\n if (baseRequester.readyState > baseRequester.OPENED && responseTimeout === undefined) {\n clearTimeout(connectTimeout);\n responseTimeout = createTimeout(request.responseTimeout, 'Socket timeout');\n }\n };\n baseRequester.onerror = () => {\n // istanbul ignore next\n if (baseRequester.status === 0) {\n clearTimeout(connectTimeout);\n clearTimeout(responseTimeout);\n resolve({\n content: baseRequester.responseText || 'Network request failed',\n status: baseRequester.status,\n isTimedOut: false,\n });\n }\n };\n baseRequester.onload = () => {\n clearTimeout(connectTimeout);\n clearTimeout(responseTimeout);\n resolve({\n content: baseRequester.responseText,\n status: baseRequester.status,\n isTimedOut: false,\n });\n };\n baseRequester.send(request.data);\n });\n }\n return { send };\n}\n\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.\nconst apiClientVersion = '5.2.4';\nfunction getDefaultHosts(appId) {\n return [\n {\n url: `${appId}-dsn.algolia.net`,\n accept: 'read',\n protocol: 'https',\n },\n {\n url: `${appId}.algolia.net`,\n accept: 'write',\n protocol: 'https',\n },\n ].concat(shuffle([\n {\n url: `${appId}-1.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-2.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-3.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n ]));\n}\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nfunction createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(appIdOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Search',\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 return {\n transporter,\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache() {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua() {\n return transporter.algoliaAgent.value;\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, version) {\n transporter.algoliaAgent.add({ segment, version });\n },\n /**\n * Helper: Wait for a task to be published (completed) for a given `indexName` and `taskID`.\n *\n * @summary Helper method that waits for a task to be published (completed).\n * @param waitForTaskOptions - The `waitForTaskOptions` object.\n * @param waitForTaskOptions.indexName - The `indexName` where the operation was performed.\n * @param waitForTaskOptions.taskID - The `taskID` returned in the method response.\n * @param waitForTaskOptions.maxRetries - The maximum number of retries. 50 by default.\n * @param waitForTaskOptions.timeout - The function to decide how long to wait between retries.\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.\n */\n waitForTask({ indexName, taskID, maxRetries = 50, timeout = (retryCount) => Math.min(retryCount * 200, 5000), }, requestOptions) {\n let retryCount = 0;\n return createIterablePromise({\n func: () => this.getTask({ indexName, taskID }, requestOptions),\n validate: (response) => response.status === 'published',\n aggregator: () => (retryCount += 1),\n error: {\n validate: () => retryCount >= maxRetries,\n message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`,\n },\n timeout: () => timeout(retryCount),\n });\n },\n /**\n * Helper: Wait for an application-level task to complete for a given `taskID`.\n *\n * @summary Helper method that waits for a task to be published (completed).\n * @param waitForAppTaskOptions - The `waitForTaskOptions` object.\n * @param waitForAppTaskOptions.taskID - The `taskID` returned in the method response.\n * @param waitForAppTaskOptions.maxRetries - The maximum number of retries. 50 by default.\n * @param waitForAppTaskOptions.timeout - The function to decide how long to wait between retries.\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.\n */\n waitForAppTask({ taskID, maxRetries = 50, timeout = (retryCount) => Math.min(retryCount * 200, 5000), }, requestOptions) {\n let retryCount = 0;\n return createIterablePromise({\n func: () => this.getAppTask({ taskID }, requestOptions),\n validate: (response) => response.status === 'published',\n aggregator: () => (retryCount += 1),\n error: {\n validate: () => retryCount >= maxRetries,\n message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`,\n },\n timeout: () => timeout(retryCount),\n });\n },\n /**\n * Helper: Wait for an API key to be added, updated or deleted based on a given `operation`.\n *\n * @summary Helper method that waits for an API key task to be processed.\n * @param waitForApiKeyOptions - The `waitForApiKeyOptions` object.\n * @param waitForApiKeyOptions.operation - The `operation` that was done on a `key`.\n * @param waitForApiKeyOptions.key - The `key` that has been added, deleted or updated.\n * @param waitForApiKeyOptions.apiKey - Necessary to know if an `update` operation has been processed, compare fields of the response with it.\n * @param waitForApiKeyOptions.maxRetries - The maximum number of retries. 50 by default.\n * @param waitForApiKeyOptions.timeout - The function to decide how long to wait between retries.\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getApikey` method and merged with the transporter requestOptions.\n */\n waitForApiKey({ operation, key, apiKey, maxRetries = 50, timeout = (retryCount) => Math.min(retryCount * 200, 5000), }, requestOptions) {\n let retryCount = 0;\n const baseIteratorOptions = {\n aggregator: () => (retryCount += 1),\n error: {\n validate: () => retryCount >= maxRetries,\n message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`,\n },\n timeout: () => timeout(retryCount),\n };\n if (operation === 'update') {\n if (!apiKey) {\n throw new Error('`apiKey` is required when waiting for an `update` operation.');\n }\n return createIterablePromise({\n ...baseIteratorOptions,\n func: () => this.getApiKey({ key }, requestOptions),\n validate: (response) => {\n for (const field of Object.keys(apiKey)) {\n const value = apiKey[field];\n const resValue = response[field];\n if (Array.isArray(value) && Array.isArray(resValue)) {\n if (value.length !== resValue.length || value.some((v, index) => v !== resValue[index])) {\n return false;\n }\n }\n else if (value !== resValue) {\n return false;\n }\n }\n return true;\n },\n });\n }\n return createIterablePromise({\n ...baseIteratorOptions,\n func: () => this.getApiKey({ key }, requestOptions).catch((error) => {\n if (error.status === 404) {\n return undefined;\n }\n throw error;\n }),\n validate: (response) => (operation === 'add' ? response !== undefined : response === undefined),\n });\n },\n /**\n * Helper: Iterate on the `browse` method of the client to allow aggregating objects of an index.\n *\n * @summary Helper method that iterates on the `browse` method.\n * @param browseObjects - The `browseObjects` object.\n * @param browseObjects.indexName - The index in which to perform the request.\n * @param browseObjects.browseParams - The `browse` parameters.\n * @param browseObjects.validate - The validator function. It receive the resolved return of the API call. By default, stops when there is no `cursor` in the response.\n * @param browseObjects.aggregator - The function that runs right after the API call has been resolved, allows you to do anything with the response before `validate`.\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `browse` method and merged with the transporter requestOptions.\n */\n browseObjects({ indexName, browseParams, ...browseObjectsOptions }, requestOptions) {\n return createIterablePromise({\n func: (previousResponse) => {\n return this.browse({\n indexName,\n browseParams: {\n cursor: previousResponse ? previousResponse.cursor : undefined,\n ...browseParams,\n },\n }, requestOptions);\n },\n validate: (response) => response.cursor === undefined,\n ...browseObjectsOptions,\n });\n },\n /**\n * Helper: Iterate on the `searchRules` method of the client to allow aggregating rules of an index.\n *\n * @summary Helper method that iterates on the `searchRules` method.\n * @param browseRules - The `browseRules` object.\n * @param browseRules.indexName - The index in which to perform the request.\n * @param browseRules.searchRulesParams - The `searchRules` method parameters.\n * @param browseRules.validate - The validator function. It receive the resolved return of the API call. By default, stops when there is less hits returned than the number of maximum hits (1000).\n * @param browseRules.aggregator - The function that runs right after the API call has been resolved, allows you to do anything with the response before `validate`.\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `searchRules` method and merged with the transporter requestOptions.\n */\n browseRules({ indexName, searchRulesParams, ...browseRulesOptions }, requestOptions) {\n const params = {\n hitsPerPage: 1000,\n ...searchRulesParams,\n };\n return createIterablePromise({\n func: (previousResponse) => {\n return this.searchRules({\n indexName,\n searchRulesParams: {\n ...params,\n page: previousResponse ? previousResponse.page + 1 : params.page || 0,\n },\n }, requestOptions);\n },\n validate: (response) => response.nbHits < params.hitsPerPage,\n ...browseRulesOptions,\n });\n },\n /**\n * Helper: Iterate on the `searchSynonyms` method of the client to allow aggregating rules of an index.\n *\n * @summary Helper method that iterates on the `searchSynonyms` method.\n * @param browseSynonyms - The `browseSynonyms` object.\n * @param browseSynonyms.indexName - The index in which to perform the request.\n * @param browseSynonyms.validate - The validator function. It receive the resolved return of the API call. By default, stops when there is less hits returned than the number of maximum hits (1000).\n * @param browseSynonyms.aggregator - The function that runs right after the API call has been resolved, allows you to do anything with the response before `validate`.\n * @param browseSynonyms.searchSynonymsParams - The `searchSynonyms` method parameters.\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `searchSynonyms` method and merged with the transporter requestOptions.\n */\n browseSynonyms({ indexName, searchSynonymsParams, ...browseSynonymsOptions }, requestOptions) {\n const params = {\n page: 0,\n ...searchSynonymsParams,\n hitsPerPage: 1000,\n };\n return createIterablePromise({\n func: (_) => {\n const resp = this.searchSynonyms({\n indexName,\n searchSynonymsParams: {\n ...params,\n page: params.page,\n },\n }, requestOptions);\n params.page += 1;\n return resp;\n },\n validate: (response) => response.nbHits < params.hitsPerPage,\n ...browseSynonymsOptions,\n });\n },\n /**\n * Helper: Chunks the given `objects` list in subset of 1000 elements max in order to make it fit in `batch` requests.\n *\n * @summary Helper: Chunks the given `objects` list in subset of 1000 elements max in order to make it fit in `batch` requests.\n * @param chunkedBatch - The `chunkedBatch` object.\n * @param chunkedBatch.indexName - The `indexName` to replace `objects` in.\n * @param chunkedBatch.objects - The array of `objects` to store in the given Algolia `indexName`.\n * @param chunkedBatch.action - The `batch` `action` to perform on the given array of `objects`, defaults to `addObject`.\n * @param chunkedBatch.waitForTasks - Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable.\n * @param chunkedBatch.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.\n */\n async chunkedBatch({ indexName, objects, action = 'addObject', waitForTasks, batchSize = 1000 }, requestOptions) {\n let requests = [];\n const responses = [];\n const objectEntries = objects.entries();\n for (const [i, obj] of objectEntries) {\n requests.push({ action, body: obj });\n if (requests.length === batchSize || i === objects.length - 1) {\n responses.push(await this.batch({ indexName, batchWriteParams: { requests } }, requestOptions));\n requests = [];\n }\n }\n if (waitForTasks) {\n for (const resp of responses) {\n await this.waitForTask({ indexName, taskID: resp.taskID });\n }\n }\n return responses;\n },\n /**\n * Helper: Saves the given array of objects in the given index. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objects in it.\n *\n * @summary Helper: Saves the given array of objects in the given index. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objects in it.\n * @param saveObjects - The `saveObjects` object.\n * @param saveObjects.indexName - The `indexName` to save `objects` in.\n * @param saveObjects.objects - The array of `objects` to store in the given Algolia `indexName`.\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `batch` method and merged with the transporter requestOptions.\n */\n async saveObjects({ indexName, objects }, requestOptions) {\n return await this.chunkedBatch({ indexName, objects, action: 'addObject' }, requestOptions);\n },\n /**\n * Helper: Deletes every records for the given objectIDs. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objectIDs in it.\n *\n * @summary Helper: Deletes every records for the given objectIDs. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objectIDs in it.\n * @param deleteObjects - The `deleteObjects` object.\n * @param deleteObjects.indexName - The `indexName` to delete `objectIDs` from.\n * @param deleteObjects.objectIDs - The objectIDs to delete.\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `batch` method and merged with the transporter requestOptions.\n */\n async deleteObjects({ indexName, objectIDs }, requestOptions) {\n return await this.chunkedBatch({\n indexName,\n objects: objectIDs.map((objectID) => ({ objectID })),\n action: 'deleteObject',\n }, requestOptions);\n },\n /**\n * Helper: Replaces object content of all the given objects according to their respective `objectID` field. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objects in it.\n *\n * @summary Helper: Replaces object content of all the given objects according to their respective `objectID` field. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objects in it.\n * @param partialUpdateObjects - The `partialUpdateObjects` object.\n * @param partialUpdateObjects.indexName - The `indexName` to update `objects` in.\n * @param partialUpdateObjects.objects - The array of `objects` to update in the given Algolia `indexName`.\n * @param partialUpdateObjects.createIfNotExists - To be provided if non-existing objects are passed, otherwise, the call will fail..\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.\n */\n async partialUpdateObjects({ indexName, objects, createIfNotExists }, requestOptions) {\n return await this.chunkedBatch({\n indexName,\n objects,\n action: createIfNotExists ? 'partialUpdateObject' : 'partialUpdateObjectNoCreate',\n }, requestOptions);\n },\n /**\n * Helper: Replaces all objects (records) in the given `index_name` with the given `objects`. A temporary index is created during this process in order to backup your data.\n * See https://api-clients-automation.netlify.app/docs/add-new-api-client#5-helpers for implementation details.\n *\n * @summary Helper: Replaces all objects (records) in the given `index_name` with the given `objects`. A temporary index is created during this process in order to backup your data.\n * @param replaceAllObjects - The `replaceAllObjects` object.\n * @param replaceAllObjects.indexName - The `indexName` to replace `objects` in.\n * @param replaceAllObjects.objects - The array of `objects` to store in the given Algolia `indexName`.\n * @param replaceAllObjects.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `objects.length / batchSize`. Defaults to 1000.\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `batch`, `operationIndex` and `getTask` method and merged with the transporter requestOptions.\n */\n async replaceAllObjects({ indexName, objects, batchSize }, requestOptions) {\n const randomSuffix = Math.floor(Math.random() * 1000000) + 100000;\n const tmpIndexName = `${indexName}_tmp_${randomSuffix}`;\n let copyOperationResponse = await this.operationIndex({\n indexName,\n operationIndexParams: {\n operation: 'copy',\n destination: tmpIndexName,\n scope: ['settings', 'rules', 'synonyms'],\n },\n }, requestOptions);\n const batchResponses = await this.chunkedBatch({ indexName: tmpIndexName, objects, waitForTasks: true, batchSize }, requestOptions);\n await this.waitForTask({\n indexName: tmpIndexName,\n taskID: copyOperationResponse.taskID,\n });\n copyOperationResponse = await this.operationIndex({\n indexName,\n operationIndexParams: {\n operation: 'copy',\n destination: tmpIndexName,\n scope: ['settings', 'rules', 'synonyms'],\n },\n }, requestOptions);\n await this.waitForTask({\n indexName: tmpIndexName,\n taskID: copyOperationResponse.taskID,\n });\n const moveOperationResponse = await this.operationIndex({\n indexName: tmpIndexName,\n operationIndexParams: { operation: 'move', destination: indexName },\n }, requestOptions);\n await this.waitForTask({\n indexName: tmpIndexName,\n taskID: moveOperationResponse.taskID,\n });\n return { copyOperationResponse, batchResponses, moveOperationResponse };\n },\n /**\n * Helper: calls the `search` method but with certainty that we will only request Algolia records (hits) and not facets.\n * Disclaimer: We don't assert that the parameters you pass to this method only contains `hits` requests to prevent impacting search performances, this helper is purely for typing purposes.\n *\n * @summary Search multiple indices for `hits`.\n * @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForHits(searchMethodParams, requestOptions) {\n return this.search(searchMethodParams, requestOptions);\n },\n /**\n * Helper: calls the `search` method but with certainty that we will only request Algolia facets and not records (hits).\n * Disclaimer: We don't assert that the parameters you pass to this method only contains `facets` requests to prevent impacting search performances, this helper is purely for typing purposes.\n *\n * @summary Search multiple indices for `facets`.\n * @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForFacets(searchMethodParams, requestOptions) {\n return this.search(searchMethodParams, requestOptions);\n },\n /**\n * Creates a new API key with specific permissions and restrictions.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param apiKey - The apiKey object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n addApiKey(apiKey, requestOptions) {\n if (!apiKey) {\n throw new Error('Parameter `apiKey` is required when calling `addApiKey`.');\n }\n if (!apiKey.acl) {\n throw new Error('Parameter `apiKey.acl` is required when calling `addApiKey`.');\n }\n const requestPath = '/1/keys';\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: apiKey,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * If a record with the specified object ID exists, the existing record is replaced. Otherwise, a new record is added to the index. To update _some_ attributes of an existing record, use the [`partial` operation](#tag/Records/operation/partialUpdateObject) instead. To add, update, or replace multiple records, use the [`batch` operation](#tag/Records/operation/batch).\n *\n * Required API Key ACLs:\n * - addObject.\n *\n * @param addOrUpdateObject - The addOrUpdateObject object.\n * @param addOrUpdateObject.indexName - Name of the index on which to perform the operation.\n * @param addOrUpdateObject.objectID - Unique record identifier.\n * @param addOrUpdateObject.body - The record, a schemaless object with attributes that are useful in the context of search and discovery.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n addOrUpdateObject({ indexName, objectID, body }, requestOptions) {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `addOrUpdateObject`.');\n }\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `addOrUpdateObject`.');\n }\n if (!body) {\n throw new Error('Parameter `body` is required when calling `addOrUpdateObject`.');\n }\n const requestPath = '/1/indexes/{indexName}/{objectID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Adds a source to the list of allowed sources.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param source - Source to add.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n appendSource(source, requestOptions) {\n if (!source) {\n throw new Error('Parameter `source` is required when calling `appendSource`.');\n }\n if (!source.source) {\n throw new Error('Parameter `source.source` is required when calling `appendSource`.');\n }\n const requestPath = '/1/security/sources/append';\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: source,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Assigns or moves a user ID to a cluster. The time it takes to move a user is proportional to the amount of data linked to the user ID.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param assignUserId - The assignUserId object.\n * @param assignUserId.xAlgoliaUserID - Unique identifier of the user who makes the search request.\n * @param assignUserId.assignUserIdParams - The assignUserIdParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n assignUserId({ xAlgoliaUserID, assignUserIdParams }, requestOptions) {\n if (!xAlgoliaUserID) {\n throw new Error('Parameter `xAlgoliaUserID` is required when calling `assignUserId`.');\n }\n if (!assignUserIdParams) {\n throw new Error('Parameter `assignUserIdParams` is required when calling `assignUserId`.');\n }\n if (!assignUserIdParams.cluster) {\n throw new Error('Parameter `assignUserIdParams.cluster` is required when calling `assignUserId`.');\n }\n const requestPath = '/1/clusters/mapping';\n const headers = {};\n const queryParameters = {};\n if (xAlgoliaUserID !== undefined) {\n headers['X-Algolia-User-ID'] = xAlgoliaUserID.toString();\n }\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: assignUserIdParams,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Adds, updates, or deletes records in one index with a single API request. Batching index updates reduces latency and increases data integrity. - Actions are applied in the order they\\'re specified. - Actions are equivalent to the individual API requests of the same name.\n *\n * @param batch - The batch object.\n * @param batch.indexName - Name of the index on which to perform the operation.\n * @param batch.batchWriteParams - The batchWriteParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n batch({ indexName, batchWriteParams }, requestOptions) {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `batch`.');\n }\n if (!batchWriteParams) {\n throw new Error('Parameter `batchWriteParams` is required when calling `batch`.');\n }\n if (!batchWriteParams.requests) {\n throw new Error('Parameter `batchWriteParams.requests` is required when calling `batch`.');\n }\n const requestPath = '/1/indexes/{indexName}/batch'.replace('{indexName}', encodeURIComponent(indexName));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: batchWriteParams,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Assigns multiple user IDs to a cluster. **You can\\'t move users with this operation**.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param batchAssignUserIds - The batchAssignUserIds object.\n * @param batchAssignUserIds.xAlgoliaUserID - Unique identifier of the user who makes the search request.\n * @param batchAssignUserIds.batchAssignUserIdsParams - The batchAssignUserIdsParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n batchAssignUserIds({ xAlgoliaUserID, batchAssignUserIdsParams }, requestOptions) {\n if (!xAlgoliaUserID) {\n throw new Error('Parameter `xAlgoliaUserID` is required when calling `batchAssignUserIds`.');\n }\n if (!batchAssignUserIdsParams) {\n throw new Error('Parameter `batchAssignUserIdsParams` is required when calling `batchAssignUserIds`.');\n }\n if (!batchAssignUserIdsParams.cluster) {\n throw new Error('Parameter `batchAssignUserIdsParams.cluster` is required when calling `batchAssignUserIds`.');\n }\n if (!batchAssignUserIdsParams.users) {\n throw new Error('Parameter `batchAssignUserIdsParams.users` is required when calling `batchAssignUserIds`.');\n }\n const requestPath = '/1/clusters/mapping/batch';\n const headers = {};\n const queryParameters = {};\n if (xAlgoliaUserID !== undefined) {\n headers['X-Algolia-User-ID'] = xAlgoliaUserID.toString();\n }\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: batchAssignUserIdsParams,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Adds or deletes multiple entries from your plurals, segmentation, or stop word dictionaries.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param batchDictionaryEntries - The batchDictionaryEntries object.\n * @param batchDictionaryEntries.dictionaryName - Dictionary type in which to search.\n * @param batchDictionaryEntries.batchDictionaryEntriesParams - The batchDictionaryEntriesParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n batchDictionaryEntries({ dictionaryName, batchDictionaryEntriesParams }, requestOptions) {\n if (!dictionaryName) {\n throw new Error('Parameter `dictionaryName` is required when calling `batchDictionaryEntries`.');\n }\n if (!batchDictionaryEntriesParams) {\n throw new Error('Parameter `batchDictionaryEntriesParams` is required when calling `batchDictionaryEntries`.');\n }\n if (!batchDictionaryEntriesParams.requests) {\n throw new Error('Parameter `batchDictionaryEntriesParams.requests` is required when calling `batchDictionaryEntries`.');\n }\n const requestPath = '/1/dictionaries/{dictionaryName}/batch'.replace('{dictionaryName}', encodeURIComponent(dictionaryName));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: batchDictionaryEntriesParams,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves records from an index, up to 1,000 per request. While searching retrieves _hits_ (records augmented with attributes for highlighting and ranking details), browsing _just_ returns matching records. This can be useful if you want to export your indices. - The Analytics API doesn\\'t collect data when using `browse`. - Records are ranked by attributes and custom ranking. - There\\'s no ranking for: typo-tolerance, number of matched words, proximity, geo distance. Browse requests automatically apply these settings: - `advancedSyntax`: `false` - `attributesToHighlight`: `[]` - `attributesToSnippet`: `[]` - `distinct`: `false` - `enablePersonalization`: `false` - `enableRules`: `false` - `facets`: `[]` - `getRankingInfo`: `false` - `ignorePlurals`: `false` - `optionalFilters`: `[]` - `typoTolerance`: `true` or `false` (`min` and `strict` is evaluated to `true`) If you send these parameters with your browse requests, they\\'ll be ignored.\n *\n * Required API Key ACLs:\n * - browse.\n *\n * @param browse - The browse object.\n * @param browse.indexName - Name of the index on which to perform the operation.\n * @param browse.browseParams - The browseParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n browse({ indexName, browseParams }, requestOptions) {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `browse`.');\n }\n const requestPath = '/1/indexes/{indexName}/browse'.replace('{indexName}', encodeURIComponent(indexName));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: browseParams ? browseParams : {},\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Deletes only the records from an index while keeping settings, synonyms, and rules.\n *\n * Required API Key ACLs:\n * - deleteIndex.\n *\n * @param clearObjects - The clearObjects object.\n * @param clearObjects.indexName - Name of the index on which to perform the operation.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n clearObjects({ indexName }, requestOptions) {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `clearObjects`.');\n }\n const requestPath = '/1/indexes/{indexName}/clear'.replace('{indexName}', encodeURIComponent(indexName));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Deletes all rules from the index.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param clearRules - The clearRules object.\n * @param clearRules.indexName - Name of the index on which to perform the operation.\n * @param clearRules.forwardToReplicas - Whether changes are applied to replica indices.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n clearRules({ indexName, forwardToReplicas }, requestOptions) {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `clearRules`.');\n }\n const requestPath = '/1/indexes/{indexName}/rules/clear'.replace('{indexName}', encodeURIComponent(indexName));\n const headers = {};\n const queryParameters = {};\n if (forwardToReplicas !== undefined) {\n queryParameters.forwardToReplicas = forwardToReplicas.toString();\n }\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Deletes all synonyms from the index.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param clearSynonyms - The clearSynonyms object.\n * @param clearSynonyms.indexName - Name of the index on which to perform the operation.\n * @param clearSynonyms.forwardToReplicas - Whether changes are applied to replica indices.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n clearSynonyms({ indexName, forwardToReplicas }, requestOptions) {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `clearSynonyms`.');\n }\n const requestPath = '/1/indexes/{indexName}/synonyms/clear'.replace('{indexName}', encodeURIComponent(indexName));\n const headers = {};\n const queryParameters = {};\n if (forwardToReplicas !== undefined) {\n queryParameters.forwardToReplicas = forwardToReplicas.toString();\n }\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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({ path, parameters }, requestOptions) {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customDelete`.');\n }\n const requestPath = '/{path}'.replace('{path}', path);\n const headers = {};\n const queryParameters = parameters ? parameters : {};\n const request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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 }, requestOptions) {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customGet`.');\n }\n const requestPath = '/{path}'.replace('{path}', path);\n const headers = {};\n const queryParameters = parameters ? parameters : {};\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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({ path, parameters, body }, requestOptions) {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\n const requestPath = '/{path}'.replace('{path}', path);\n const headers = {};\n const queryParameters = parameters ? parameters : {};\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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({ path, parameters, body }, requestOptions) {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPut`.');\n }\n const requestPath = '/{path}'.replace('{path}', path);\n const headers = {};\n const queryParameters = parameters ? parameters : {};\n const request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Deletes the API key.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param deleteApiKey - The deleteApiKey object.\n * @param deleteApiKey.key - API key.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteApiKey({ key }, requestOptions) {\n if (!key) {\n throw new Error('Parameter `key` is required when calling `deleteApiKey`.');\n }\n const requestPath = '/1/keys/{key}'.replace('{key}', encodeURIComponent(key));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * This operation doesn\\'t accept empty queries or filters. It\\'s more efficient to get a list of object IDs with the [`browse` operation](#tag/Search/operation/browse), and then delete the records using the [`batch` operation](#tag/Records/operation/batch).\n *\n * Required API Key ACLs:\n * - deleteIndex.\n *\n * @param deleteBy - The deleteBy object.\n * @param deleteBy.indexName - Name of the index on which to perform the operation.\n * @param deleteBy.deleteByParams - The deleteByParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteBy({ indexName, deleteByParams }, requestOptions) {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `deleteBy`.');\n }\n if (!deleteByParams) {\n throw new Error('Parameter `deleteByParams` is required when calling `deleteBy`.');\n }\n const requestPath = '/1/indexes/{indexName}/deleteByQuery'.replace('{indexName}', encodeURIComponent(indexName));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: deleteByParams,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Deletes an index and all its settings. - Deleting an index doesn\\'t delete its analytics data. - If you try to delete a non-existing index, the operation is ignored without warning. - If the index you want to delete has replica indices, the replicas become independent indices. - If the index you want to delete is a replica index, you must first unlink it from its primary index before you can delete it. For more information, see [Delete replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/how-to/deleting-replicas/).\n *\n * Required API Key ACLs:\n * - deleteIndex.\n *\n * @param deleteIndex - The deleteIndex object.\n * @param deleteIndex.indexName - Name of the index on which to perform the operation.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteIndex({ indexName }, requestOptions) {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `deleteIndex`.');\n }\n const requestPath = '/1/indexes/{indexName}'.replace('{indexName}', encodeURIComponent(indexName));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Deletes a record by its object ID. To delete more than one record, use the [`batch` operation](#tag/Records/operation/batch). To delete records matching a query, use the [`deleteByQuery` operation](#tag/Records/operation/deleteBy).\n *\n * Required API Key ACLs:\n * - deleteObject.\n *\n * @param deleteObject - The deleteObject object.\n * @param deleteObject.indexName - Name of the index on which to perform the operation.\n * @param deleteObject.objectID - Unique record identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteObject({ indexName, objectID }, requestOptions) {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `deleteObject`.');\n }\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `deleteObject`.');\n }\n const requestPath = '/1/indexes/{indexName}/{objectID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Deletes a rule by its ID. To find the object ID for rules, use the [`search` operation](#tag/Rules/operation/searchRules).\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param deleteRule - The deleteRule object.\n * @param deleteRule.indexName - Name of the index on which to perform the operation.\n * @param deleteRule.objectID - Unique identifier of a rule object.\n * @param deleteRule.forwardToReplicas - Whether changes are applied to replica indices.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteRule({ indexName, objectID, forwardToReplicas }, requestOptions) {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `deleteRule`.');\n }\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `deleteRule`.');\n }\n const requestPath = '/1/indexes/{indexName}/rules/{objectID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers = {};\n const queryParameters = {};\n if (forwardToReplicas !== undefined) {\n queryParameters.forwardToReplicas = forwardToReplicas.toString();\n }\n const request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Deletes a source from the list of allowed sources.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param deleteSource - The deleteSource object.\n * @param deleteSource.source - IP address range of the source.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteSource({ source }, requestOptions) {\n if (!source) {\n throw new Error('Parameter `source` is required when calling `deleteSource`.');\n }\n const requestPath = '/1/security/sources/{source}'.replace('{source}', encodeURIComponent(source));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Deletes a synonym by its ID. To find the object IDs of your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param deleteSynonym - The deleteSynonym object.\n * @param deleteSynonym.indexName - Name of the index on which to perform the operation.\n * @param deleteSynonym.objectID - Unique identifier of a synonym object.\n * @param deleteSynonym.forwardToReplicas - Whether changes are applied to replica indices.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteSynonym({ indexName, objectID, forwardToReplicas }, requestOptions) {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `deleteSynonym`.');\n }\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `deleteSynonym`.');\n }\n const requestPath = '/1/indexes/{indexName}/synonyms/{objectID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers = {};\n const queryParameters = {};\n if (forwardToReplicas !== undefined) {\n queryParameters.forwardToReplicas = forwardToReplicas.toString();\n }\n const request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Gets the permissions and restrictions of an API key. When authenticating with the admin API key, you can request information for any of your application\\'s keys. When authenticating with other API keys, you can only retrieve information for that key.\n *\n * @param getApiKey - The getApiKey object.\n * @param getApiKey.key - API key.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getApiKey({ key }, requestOptions) {\n if (!key) {\n throw new Error('Parameter `key` is required when calling `getApiKey`.');\n }\n const requestPath = '/1/keys/{key}'.replace('{key}', encodeURIComponent(key));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Checks the status of a given application task.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param getAppTask - The getAppTask object.\n * @param getAppTask.taskID - Unique task identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getAppTask({ taskID }, requestOptions) {\n if (!taskID) {\n throw new Error('Parameter `taskID` is required when calling `getAppTask`.');\n }\n const requestPath = '/1/task/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Lists supported languages with their supported dictionary types and number of custom entries.\n *\n * Required API Key ACLs:\n * - settings.\n *\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getDictionaryLanguages(requestOptions) {\n const requestPath = '/1/dictionaries/*/languages';\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves the languages for which standard dictionary entries are turned off.\n *\n * Required API Key ACLs:\n * - settings.\n *\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getDictionarySettings(requestOptions) {\n const requestPath = '/1/dictionaries/*/settings';\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * The request must be authenticated by an API key with the [`logs` ACL](https://www.algolia.com/doc/guides/security/api-keys/#access-control-list-acl). - Logs are held for the last seven days. - Up to 1,000 API requests per server are logged. - This request counts towards your [operations quota](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-) but doesn\\'t appear in the logs itself.\n *\n * Required API Key ACLs:\n * - logs.\n *\n * @param getLogs - The getLogs object.\n * @param getLogs.offset - First log entry to retrieve. The most recent entries are listed first.\n * @param getLogs.length - Maximum number of entries to retrieve.\n * @param getLogs.indexName - Index for which to retrieve log entries. By default, log entries are retrieved for all indices.\n * @param getLogs.type - Type of log entries to retrieve. By default, all log entries are retrieved.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getLogs({ offset, length, indexName, type } = {}, requestOptions = undefined) {\n const requestPath = '/1/logs';\n const headers = {};\n const queryParameters = {};\n if (offset !== undefined) {\n queryParameters.offset = offset.toString();\n }\n if (length !== undefined) {\n queryParameters.length = length.toString();\n }\n if (indexName !== undefined) {\n queryParameters.indexName = indexName.toString();\n }\n if (type !== undefined) {\n queryParameters.type = type.toString();\n }\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves one record by its object ID. To retrieve more than one record, use the [`objects` operation](#tag/Records/operation/getObjects).\n *\n * Required API Key ACLs:\n * - search.\n *\n * @param getObject - The getObject object.\n * @param getObject.indexName - Name of the index on which to perform the operation.\n * @param getObject.objectID - Unique record identifier.\n * @param getObject.attributesToRetrieve - Attributes to include with the records in the response. This is useful to reduce the size of the API response. By default, all retrievable attributes are returned. `objectID` is always retrieved. Attributes included in `unretrievableAttributes` won\\'t be retrieved unless the request is authenticated with the admin API key.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getObject({ indexName, objectID, attributesToRetrieve }, requestOptions) {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `getObject`.');\n }\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `getObject`.');\n }\n const requestPath = '/1/indexes/{indexName}/{objectID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers = {};\n const queryParameters = {};\n if (attributesToRetrieve !== undefined) {\n queryParameters.attributesToRetrieve = attributesToRetrieve.toString();\n }\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves one or more records, potentially from different indices. Records are returned in the same order as the requests.\n *\n * Required API Key ACLs:\n * - search.\n *\n * @param getObjectsParams - Request object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getObjects(getObjectsParams, requestOptions) {\n if (!getObjectsParams) {\n throw new Error('Parameter `getObjectsParams` is required when calling `getObjects`.');\n }\n if (!getObjectsParams.requests) {\n throw new Error('Parameter `getObjectsParams.requests` is required when calling `getObjects`.');\n }\n const requestPath = '/1/indexes/*/objects';\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: getObjectsParams,\n useReadTransporter: true,\n cacheable: true,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves a rule by its ID. To find the object ID of rules, use the [`search` operation](#tag/Rules/operation/searchRules).\n *\n * Required API Key ACLs:\n * - settings.\n *\n * @param getRule - The getRule object.\n * @param getRule.indexName - Name of the index on which to perform the operation.\n * @param getRule.objectID - Unique identifier of a rule object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRule({ indexName, objectID }, requestOptions) {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `getRule`.');\n }\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `getRule`.');\n }\n const requestPath = '/1/indexes/{indexName}/rules/{objectID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves an object with non-null index settings.\n *\n * Required API Key ACLs:\n * - search.\n *\n * @param getSettings - The getSettings object.\n * @param getSettings.indexName - Name of the index on which to perform the operation.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getSettings({ indexName }, requestOptions) {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `getSettings`.');\n }\n const requestPath = '/1/indexes/{indexName}/settings'.replace('{indexName}', encodeURIComponent(indexName));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves all allowed IP addresses with access to your application.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getSources(requestOptions) {\n const requestPath = '/1/security/sources';\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves a syonym by its ID. To find the object IDs for your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).\n *\n * Required API Key ACLs:\n * - settings.\n *\n * @param getSynonym - The getSynonym object.\n * @param getSynonym.indexName - Name of the index on which to perform the operation.\n * @param getSynonym.objectID - Unique identifier of a synonym object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getSynonym({ indexName, objectID }, requestOptions) {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `getSynonym`.');\n }\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `getSynonym`.');\n }\n const requestPath = '/1/indexes/{indexName}/synonyms/{objectID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Checks the status of a given task. Indexing tasks are asynchronous. When you add, update, or delete records or indices, a task is created on a queue and completed depending on the load on the server. The indexing tasks\\' responses include a task ID that you can use to check the status.\n *\n * Required API Key ACLs:\n * - addObject.\n *\n * @param getTask - The getTask object.\n * @param getTask.indexName - Name of the index on which to perform the operation.\n * @param getTask.taskID - Unique task identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getTask({ indexName, taskID }, requestOptions) {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `getTask`.');\n }\n if (!taskID) {\n throw new Error('Parameter `taskID` is required when calling `getTask`.');\n }\n const requestPath = '/1/indexes/{indexName}/task/{taskID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{taskID}', encodeURIComponent(taskID));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Get the IDs of the 10 users with the highest number of records per cluster. Since it can take a few seconds to get the data from the different clusters, the response isn\\'t real-time.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getTopUserIds(requestOptions) {\n const requestPath = '/1/clusters/mapping/top';\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Returns the user ID data stored in the mapping. Since it can take a few seconds to get the data from the different clusters, the response isn\\'t real-time.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param getUserId - The getUserId object.\n * @param getUserId.userID - Unique identifier of the user who makes the search request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getUserId({ userID }, requestOptions) {\n if (!userID) {\n throw new Error('Parameter `userID` is required when calling `getUserId`.');\n }\n const requestPath = '/1/clusters/mapping/{userID}'.replace('{userID}', encodeURIComponent(userID));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * To determine when the time-consuming process of creating a large batch of users or migrating users from one cluster to another is complete, this operation retrieves the status of the process.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param hasPendingMappings - The hasPendingMappings object.\n * @param hasPendingMappings.getClusters - Whether to include the cluster\\'s pending mapping state in the response.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n hasPendingMappings({ getClusters } = {}, requestOptions = undefined) {\n const requestPath = '/1/clusters/mapping/pending';\n const headers = {};\n const queryParameters = {};\n if (getClusters !== undefined) {\n queryParameters.getClusters = getClusters.toString();\n }\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Lists all API keys associated with your Algolia application, including their permissions and restrictions.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n listApiKeys(requestOptions) {\n const requestPath = '/1/keys';\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Lists the available clusters in a multi-cluster setup.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n listClusters(requestOptions) {\n const requestPath = '/1/clusters';\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Lists all indices in the current Algolia application. The request follows any index restrictions of the API key you use to make the request.\n *\n * Required API Key ACLs:\n * - listIndexes.\n *\n * @param listIndices - The listIndices object.\n * @param listIndices.page - Requested page of the API response. If `null`, the API response is not paginated.\n * @param listIndices.hitsPerPage - Number of hits per page.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n listIndices({ page, hitsPerPage } = {}, requestOptions = undefined) {\n const requestPath = '/1/indexes';\n const headers = {};\n const queryParameters = {};\n if (page !== undefined) {\n queryParameters.page = page.toString();\n }\n if (hitsPerPage !== undefined) {\n queryParameters.hitsPerPage = hitsPerPage.toString();\n }\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Lists the userIDs assigned to a multi-cluster application. Since it can take a few seconds to get the data from the different clusters, the response isn\\'t real-time.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param listUserIds - The listUserIds object.\n * @param listUserIds.page - Requested page of the API response. If `null`, the API response is not paginated.\n * @param listUserIds.hitsPerPage - Number of hits per page.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n listUserIds({ page, hitsPerPage } = {}, requestOptions = undefined) {\n const requestPath = '/1/clusters/mapping';\n const headers = {};\n const queryParameters = {};\n if (page !== undefined) {\n queryParameters.page = page.toString();\n }\n if (hitsPerPage !== undefined) {\n queryParameters.hitsPerPage = hitsPerPage.toString();\n }\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Adds, updates, or deletes records in multiple indices with a single API request. - Actions are applied in the order they are specified. - Actions are equivalent to the individual API requests of the same name.\n *\n * @param batchParams - The batchParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n multipleBatch(batchParams, requestOptions) {\n if (!batchParams) {\n throw new Error('Parameter `batchParams` is required when calling `multipleBatch`.');\n }\n if (!batchParams.requests) {\n throw new Error('Parameter `batchParams.requests` is required when calling `multipleBatch`.');\n }\n const requestPath = '/1/indexes/*/batch';\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: batchParams,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Copies or moves (renames) an index within the same Algolia application. - Existing destination indices are overwritten, except for their analytics data. - If the destination index doesn\\'t exist yet, it\\'ll be created. **Copy** - Copying a source index that doesn\\'t exist creates a new index with 0 records and default settings. - The API keys of the source index are merged with the existing keys in the destination index. - You can\\'t copy the `enableReRanking`, `mode`, and `replicas` settings. - You can\\'t copy to a destination index that already has replicas. - Be aware of the [size limits](https://www.algolia.com/doc/guides/scaling/algolia-service-limits/#application-record-and-index-limits). - Related guide: [Copy indices](https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/how-to/copy-indices/) **Move** - Moving a source index that doesn\\'t exist is ignored without returning an error. - When moving an index, the analytics data keep their original name and a new set of analytics data is started for the new name. To access the original analytics in the dashboard, create an index with the original name. - If the destination index has replicas, moving will overwrite the existing index and copy the data to the replica indices. - Related guide: [Move indices](https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/how-to/move-indices/).\n *\n * Required API Key ACLs:\n * - addObject.\n *\n * @param operationIndex - The operationIndex object.\n * @param operationIndex.indexName - Name of the index on which to perform the operation.\n * @param operationIndex.operationIndexParams - The operationIndexParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n operationIndex({ indexName, operationIndexParams }, requestOptions) {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `operationIndex`.');\n }\n if (!operationIndexParams) {\n throw new Error('Parameter `operationIndexParams` is required when calling `operationIndex`.');\n }\n if (!operationIndexParams.operation) {\n throw new Error('Parameter `operationIndexParams.operation` is required when calling `operationIndex`.');\n }\n if (!operationIndexParams.destination) {\n throw new Error('Parameter `operationIndexParams.destination` is required when calling `operationIndex`.');\n }\n const requestPath = '/1/indexes/{indexName}/operation'.replace('{indexName}', encodeURIComponent(indexName));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: operationIndexParams,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Adds new attributes to a record, or update existing ones. - If a record with the specified object ID doesn\\'t exist, a new record is added to the index **if** `createIfNotExists` is true. - If the index doesn\\'t exist yet, this method creates a new index. - You can use any first-level attribute but not nested attributes. If you specify a nested attribute, the engine treats it as a replacement for its first-level ancestor. To update an attribute without pushing the entire record, you can use these built-in operations. These operations can be helpful if you don\\'t have access to your initial data. - Increment: increment a numeric attribute - Decrement: decrement a numeric attribute - Add: append a number or string element to an array attribute - Remove: remove all matching number or string elements from an array attribute made of numbers or strings - AddUnique: add a number or string element to an array attribute made of numbers or strings only if it\\'s not already present - IncrementFrom: increment a numeric integer attribute only if the provided value matches the current value, and otherwise ignore the whole object update. For example, if you pass an IncrementFrom value of 2 for the version attribute, but the current value of the attribute is 1, the engine ignores the update. If the object doesn\\'t exist, the engine only creates it if you pass an IncrementFrom value of 0. - IncrementSet: increment a numeric integer attribute only if the provided value is greater than the current value, and otherwise ignore the whole object update. For example, if you pass an IncrementSet value of 2 for the version attribute, and the current value of the attribute is 1, the engine updates the object. If the object doesn\\'t exist yet, the engine only creates it if you pass an IncrementSet value that\\'s greater than 0. You can specify an operation by providing an object with the attribute to update as the key and its value being an object with the following properties: - _operation: the operation to apply on the attribute - value: the right-hand side argument to the operation, for example, increment or decrement step, value to add or remove.\n *\n * Required API Key ACLs:\n * - addObject.\n *\n * @param partialUpdateObject - The partialUpdateObject object.\n * @param partialUpdateObject.indexName - Name of the index on which to perform the operation.\n * @param partialUpdateObject.objectID - Unique record identifier.\n * @param partialUpdateObject.attributesToUpdate - Attributes with their values.\n * @param partialUpdateObject.createIfNotExists - Whether to create a new record if it doesn\\'t exist.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n partialUpdateObject({ indexName, objectID, attributesToUpdate, createIfNotExists }, requestOptions) {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `partialUpdateObject`.');\n }\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `partialUpdateObject`.');\n }\n if (!attributesToUpdate) {\n throw new Error('Parameter `attributesToUpdate` is required when calling `partialUpdateObject`.');\n }\n const requestPath = '/1/indexes/{indexName}/{objectID}/partial'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers = {};\n const queryParameters = {};\n if (createIfNotExists !== undefined) {\n queryParameters.createIfNotExists = createIfNotExists.toString();\n }\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: attributesToUpdate,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Deletes a user ID and its associated data from the clusters.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param removeUserId - The removeUserId object.\n * @param removeUserId.userID - Unique identifier of the user who makes the search request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n removeUserId({ userID }, requestOptions) {\n if (!userID) {\n throw new Error('Parameter `userID` is required when calling `removeUserId`.');\n }\n const requestPath = '/1/clusters/mapping/{userID}'.replace('{userID}', encodeURIComponent(userID));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Replaces the list of allowed sources.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param replaceSources - The replaceSources object.\n * @param replaceSources.source - Allowed sources.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n replaceSources({ source }, requestOptions) {\n if (!source) {\n throw new Error('Parameter `source` is required when calling `replaceSources`.');\n }\n const requestPath = '/1/security/sources';\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: source,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Restores a deleted API key. Restoring resets the `validity` attribute to `0`. Algolia stores up to 1,000 API keys per application. If you create more, the oldest API keys are deleted and can\\'t be restored.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param restoreApiKey - The restoreApiKey object.\n * @param restoreApiKey.key - API key.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n restoreApiKey({ key }, requestOptions) {\n if (!key) {\n throw new Error('Parameter `key` is required when calling `restoreApiKey`.');\n }\n const requestPath = '/1/keys/{key}/restore'.replace('{key}', encodeURIComponent(key));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Adds a record to an index or replace it. - If the record doesn\\'t have an object ID, a new record with an auto-generated object ID is added to your index. - If a record with the specified object ID exists, the existing record is replaced. - If a record with the specified object ID doesn\\'t exist, a new record is added to your index. - If you add a record to an index that doesn\\'t exist yet, a new index is created. To update _some_ attributes of a record, use the [`partial` operation](#tag/Records/operation/partialUpdateObject). To add, update, or replace multiple records, use the [`batch` operation](#tag/Records/operation/batch).\n *\n * Required API Key ACLs:\n * - addObject.\n *\n * @param saveObject - The saveObject object.\n * @param saveObject.indexName - Name of the index on which to perform the operation.\n * @param saveObject.body - The record, a schemaless object with attributes that are useful in the context of search and discovery.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n saveObject({ indexName, body }, requestOptions) {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `saveObject`.');\n }\n if (!body) {\n throw new Error('Parameter `body` is required when calling `saveObject`.');\n }\n const requestPath = '/1/indexes/{indexName}'.replace('{indexName}', encodeURIComponent(indexName));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * If a rule with the specified object ID doesn\\'t exist, it\\'s created. Otherwise, the existing rule is replaced. To create or update more than one rule, use the [`batch` operation](#tag/Rules/operation/saveRules).\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param saveRule - The saveRule object.\n * @param saveRule.indexName - Name of the index on which to perform the operation.\n * @param saveRule.objectID - Unique identifier of a rule object.\n * @param saveRule.rule - The rule object.\n * @param saveRule.forwardToReplicas - Whether changes are applied to replica indices.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n saveRule({ indexName, objectID, rule, forwardToReplicas }, requestOptions) {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `saveRule`.');\n }\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `saveRule`.');\n }\n if (!rule) {\n throw new Error('Parameter `rule` is required when calling `saveRule`.');\n }\n if (!rule.objectID) {\n throw new Error('Parameter `rule.objectID` is required when calling `saveRule`.');\n }\n const requestPath = '/1/indexes/{indexName}/rules/{objectID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers = {};\n const queryParameters = {};\n if (forwardToReplicas !== undefined) {\n queryParameters.forwardToReplicas = forwardToReplicas.toString();\n }\n const request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: rule,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Create or update multiple rules. If a rule with the specified object ID doesn\\'t exist, Algolia creates a new one. Otherwise, existing rules are replaced.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param saveRules - The saveRules object.\n * @param saveRules.indexName - Name of the index on which to perform the operation.\n * @param saveRules.rules - The rules object.\n * @param saveRules.forwardToReplicas - Whether changes are applied to replica indices.\n * @param saveRules.clearExistingRules - Whether existing rules should be deleted before adding this batch.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n saveRules({ indexName, rules, forwardToReplicas, clearExistingRules }, requestOptions) {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `saveRules`.');\n }\n if (!rules) {\n throw new Error('Parameter `rules` is required when calling `saveRules`.');\n }\n const requestPath = '/1/indexes/{indexName}/rules/batch'.replace('{indexName}', encodeURIComponent(indexName));\n const headers = {};\n const queryParameters = {};\n if (forwardToReplicas !== undefined) {\n queryParameters.forwardToReplicas = forwardToReplicas.toString();\n }\n if (clearExistingRules !== undefined) {\n queryParameters.clearExistingRules = clearExistingRules.toString();\n }\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: rules,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * If a synonym with the specified object ID doesn\\'t exist, Algolia adds a new one. Otherwise, the existing synonym is replaced. To add multiple synonyms in a single API request, use the [`batch` operation](#tag/Synonyms/operation/saveSynonyms).\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param saveSynonym - The saveSynonym object.\n * @param saveSynonym.indexName - Name of the index on which to perform the operation.\n * @param saveSynonym.objectID - Unique identifier of a synonym object.\n * @param saveSynonym.synonymHit - The synonymHit object.\n * @param saveSynonym.forwardToReplicas - Whether changes are applied to replica indices.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n saveSynonym({ indexName, objectID, synonymHit, forwardToReplicas }, requestOptions) {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `saveSynonym`.');\n }\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `saveSynonym`.');\n }\n if (!synonymHit) {\n throw new Error('Parameter `synonymHit` is required when calling `saveSynonym`.');\n }\n if (!synonymHit.objectID) {\n throw new Error('Parameter `synonymHit.objectID` is required when calling `saveSynonym`.');\n }\n if (!synonymHit.type) {\n throw new Error('Parameter `synonymHit.type` is required when calling `saveSynonym`.');\n }\n const requestPath = '/1/indexes/{indexName}/synonyms/{objectID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers = {};\n const queryParameters = {};\n if (forwardToReplicas !== undefined) {\n queryParameters.forwardToReplicas = forwardToReplicas.toString();\n }\n const request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: synonymHit,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * If a synonym with the `objectID` doesn\\'t exist, Algolia adds a new one. Otherwise, existing synonyms are replaced.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param saveSynonyms - The saveSynonyms object.\n * @param saveSynonyms.indexName - Name of the index on which to perform the operation.\n * @param saveSynonyms.synonymHit - The synonymHit object.\n * @param saveSynonyms.forwardToReplicas - Whether changes are applied to replica indices.\n * @param saveSynonyms.replaceExistingSynonyms - Whether to replace all synonyms in the index with the ones sent with this request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n saveSynonyms({ indexName, synonymHit, forwardToReplicas, replaceExistingSynonyms }, requestOptions) {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `saveSynonyms`.');\n }\n if (!synonymHit) {\n throw new Error('Parameter `synonymHit` is required when calling `saveSynonyms`.');\n }\n const requestPath = '/1/indexes/{indexName}/synonyms/batch'.replace('{indexName}', encodeURIComponent(indexName));\n const headers = {};\n const queryParameters = {};\n if (forwardToReplicas !== undefined) {\n queryParameters.forwardToReplicas = forwardToReplicas.toString();\n }\n if (replaceExistingSynonyms !== undefined) {\n queryParameters.replaceExistingSynonyms = replaceExistingSynonyms.toString();\n }\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: synonymHit,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Sends multiple search request to one or more indices. This can be useful in these cases: - Different indices for different purposes, such as, one index for products, another one for marketing content. - Multiple searches to the same index—for example, with different filters.\n *\n * Required API Key ACLs:\n * - search.\n *\n * @param searchMethodParams - Muli-search request body. Results are returned in the same order as the requests.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n search(searchMethodParams, requestOptions) {\n if (searchMethodParams && Array.isArray(searchMethodParams)) {\n const newSignatureRequest = {\n requests: searchMethodParams.map(({ params, ...legacyRequest }) => {\n if (legacyRequest.type === 'facet') {\n return {\n ...legacyRequest,\n ...params,\n type: 'facet',\n };\n }\n return {\n ...legacyRequest,\n ...params,\n facet: undefined,\n maxFacetHits: undefined,\n facetQuery: undefined,\n };\n }),\n };\n // eslint-disable-next-line no-param-reassign\n searchMethodParams = newSignatureRequest;\n }\n if (!searchMethodParams) {\n throw new Error('Parameter `searchMethodParams` is required when calling `search`.');\n }\n if (!searchMethodParams.requests) {\n throw new Error('Parameter `searchMethodParams.requests` is required when calling `search`.');\n }\n const requestPath = '/1/indexes/*/queries';\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchMethodParams,\n useReadTransporter: true,\n cacheable: true,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Searches for standard and custom dictionary entries.\n *\n * Required API Key ACLs:\n * - settings.\n *\n * @param searchDictionaryEntries - The searchDictionaryEntries object.\n * @param searchDictionaryEntries.dictionaryName - Dictionary type in which to search.\n * @param searchDictionaryEntries.searchDictionaryEntriesParams - The searchDictionaryEntriesParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchDictionaryEntries({ dictionaryName, searchDictionaryEntriesParams }, requestOptions) {\n if (!dictionaryName) {\n throw new Error('Parameter `dictionaryName` is required when calling `searchDictionaryEntries`.');\n }\n if (!searchDictionaryEntriesParams) {\n throw new Error('Parameter `searchDictionaryEntriesParams` is required when calling `searchDictionaryEntries`.');\n }\n if (!searchDictionaryEntriesParams.query) {\n throw new Error('Parameter `searchDictionaryEntriesParams.query` is required when calling `searchDictionaryEntries`.');\n }\n const requestPath = '/1/dictionaries/{dictionaryName}/search'.replace('{dictionaryName}', encodeURIComponent(dictionaryName));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchDictionaryEntriesParams,\n useReadTransporter: true,\n cacheable: true,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Searches for values of a specified facet attribute. - By default, facet values are sorted by decreasing count. You can adjust this with the `sortFacetValueBy` parameter. - Searching for facet values doesn\\'t work if you have **more than 65 searchable facets and searchable attributes combined**.\n *\n * Required API Key ACLs:\n * - search.\n *\n * @param searchForFacetValues - The searchForFacetValues object.\n * @param searchForFacetValues.indexName - Name of the index on which to perform the operation.\n * @param searchForFacetValues.facetName - Facet attribute in which to search for values. This attribute must be included in the `attributesForFaceting` index setting with the `searchable()` modifier.\n * @param searchForFacetValues.searchForFacetValuesRequest - The searchForFacetValuesRequest object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForFacetValues({ indexName, facetName, searchForFacetValuesRequest }, requestOptions) {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `searchForFacetValues`.');\n }\n if (!facetName) {\n throw new Error('Parameter `facetName` is required when calling `searchForFacetValues`.');\n }\n const requestPath = '/1/indexes/{indexName}/facets/{facetName}/query'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{facetName}', encodeURIComponent(facetName));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchForFacetValuesRequest ? searchForFacetValuesRequest : {},\n useReadTransporter: true,\n cacheable: true,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Searches for rules in your index.\n *\n * Required API Key ACLs:\n * - settings.\n *\n * @param searchRules - The searchRules object.\n * @param searchRules.indexName - Name of the index on which to perform the operation.\n * @param searchRules.searchRulesParams - The searchRulesParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchRules({ indexName, searchRulesParams }, requestOptions) {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `searchRules`.');\n }\n const requestPath = '/1/indexes/{indexName}/rules/search'.replace('{indexName}', encodeURIComponent(indexName));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchRulesParams ? searchRulesParams : {},\n useReadTransporter: true,\n cacheable: true,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Searches a single index and return matching search results (_hits_). This method lets you retrieve up to 1,000 hits. If you need more, use the [`browse` operation](#tag/Search/operation/browse) or increase the `paginatedLimitedTo` index setting.\n *\n * Required API Key ACLs:\n * - search.\n *\n * @param searchSingleIndex - The searchSingleIndex object.\n * @param searchSingleIndex.indexName - Name of the index on which to perform the operation.\n * @param searchSingleIndex.searchParams - The searchParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchSingleIndex({ indexName, searchParams }, requestOptions) {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `searchSingleIndex`.');\n }\n const requestPath = '/1/indexes/{indexName}/query'.replace('{indexName}', encodeURIComponent(indexName));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchParams ? searchParams : {},\n useReadTransporter: true,\n cacheable: true,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Searches for synonyms in your index.\n *\n * Required API Key ACLs:\n * - settings.\n *\n * @param searchSynonyms - The searchSynonyms object.\n * @param searchSynonyms.indexName - Name of the index on which to perform the operation.\n * @param searchSynonyms.searchSynonymsParams - Body of the `searchSynonyms` operation.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchSynonyms({ indexName, searchSynonymsParams }, requestOptions) {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `searchSynonyms`.');\n }\n const requestPath = '/1/indexes/{indexName}/synonyms/search'.replace('{indexName}', encodeURIComponent(indexName));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchSynonymsParams ? searchSynonymsParams : {},\n useReadTransporter: true,\n cacheable: true,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Since it can take a few seconds to get the data from the different clusters, the response isn\\'t real-time. To ensure rapid updates, the user IDs index isn\\'t built at the same time as the mapping. Instead, it\\'s built every 12 hours, at the same time as the update of user ID usage. For example, if you add or move a user ID, the search will show an old value until the next time the mapping is rebuilt (every 12 hours).\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param searchUserIdsParams - The searchUserIdsParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchUserIds(searchUserIdsParams, requestOptions) {\n if (!searchUserIdsParams) {\n throw new Error('Parameter `searchUserIdsParams` is required when calling `searchUserIds`.');\n }\n if (!searchUserIdsParams.query) {\n throw new Error('Parameter `searchUserIdsParams.query` is required when calling `searchUserIds`.');\n }\n const requestPath = '/1/clusters/mapping/search';\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchUserIdsParams,\n useReadTransporter: true,\n cacheable: true,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Turns standard stop word dictionary entries on or off for a given language.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param dictionarySettingsParams - The dictionarySettingsParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n setDictionarySettings(dictionarySettingsParams, requestOptions) {\n if (!dictionarySettingsParams) {\n throw new Error('Parameter `dictionarySettingsParams` is required when calling `setDictionarySettings`.');\n }\n if (!dictionarySettingsParams.disableStandardEntries) {\n throw new Error('Parameter `dictionarySettingsParams.disableStandardEntries` is required when calling `setDictionarySettings`.');\n }\n const requestPath = '/1/dictionaries/*/settings';\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: dictionarySettingsParams,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Update the specified index settings. Index settings that you don\\'t specify are left unchanged. Specify `null` to reset a setting to its default value. For best performance, update the index settings before you add new records to your index.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param setSettings - The setSettings object.\n * @param setSettings.indexName - Name of the index on which to perform the operation.\n * @param setSettings.indexSettings - The indexSettings object.\n * @param setSettings.forwardToReplicas - Whether changes are applied to replica indices.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n setSettings({ indexName, indexSettings, forwardToReplicas }, requestOptions) {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `setSettings`.');\n }\n if (!indexSettings) {\n throw new Error('Parameter `indexSettings` is required when calling `setSettings`.');\n }\n const requestPath = '/1/indexes/{indexName}/settings'.replace('{indexName}', encodeURIComponent(indexName));\n const headers = {};\n const queryParameters = {};\n if (forwardToReplicas !== undefined) {\n queryParameters.forwardToReplicas = forwardToReplicas.toString();\n }\n const request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: indexSettings,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Replaces the permissions of an existing API key. Any unspecified attribute resets that attribute to its default value.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param updateApiKey - The updateApiKey object.\n * @param updateApiKey.key - API key.\n * @param updateApiKey.apiKey - The apiKey object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n updateApiKey({ key, apiKey }, requestOptions) {\n if (!key) {\n throw new Error('Parameter `key` is required when calling `updateApiKey`.');\n }\n if (!apiKey) {\n throw new Error('Parameter `apiKey` is required when calling `updateApiKey`.');\n }\n if (!apiKey.acl) {\n throw new Error('Parameter `apiKey.acl` is required when calling `updateApiKey`.');\n }\n const requestPath = '/1/keys/{key}'.replace('{key}', encodeURIComponent(key));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: apiKey,\n };\n return transporter.request(request, requestOptions);\n },\n };\n}\n\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// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nfunction searchClient(appId, apiKey, options) {\n if (!appId || typeof appId !== 'string') {\n throw new Error('`appId` is missing.');\n }\n if (!apiKey || typeof apiKey !== 'string') {\n throw new Error('`apiKey` is missing.');\n }\n return createSearchClient({\n appId,\n apiKey,\n timeouts: {\n connect: DEFAULT_CONNECT_TIMEOUT_BROWSER,\n read: DEFAULT_READ_TIMEOUT_BROWSER,\n write: DEFAULT_WRITE_TIMEOUT_BROWSER,\n },\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 ...options,\n });\n}\n\nexport { apiClientVersion, searchClient };\n","function createAuth(appId, apiKey, authMode = 'WithinHeaders') {\n const credentials = {\n 'x-algolia-api-key': apiKey,\n 'x-algolia-application-id': appId\n };\n return {\n headers() {\n return authMode === 'WithinHeaders' ? credentials : {};\n },\n queryParameters() {\n return authMode === 'WithinQueryParameters' ? credentials : {};\n }\n };\n}\n\nfunction createBrowserLocalStorageCache(options) {\n let storage;\n // We've changed the namespace to avoid conflicts with v4, as this version is a huge breaking change\n const namespaceKey = `algolia-client-js-${options.key}`;\n function getStorage() {\n if (storage === undefined) {\n storage = options.localStorage || window.localStorage;\n }\n return storage;\n }\n function getNamespace() {\n return JSON.parse(getStorage().getItem(namespaceKey) || '{}');\n }\n function setNamespace(namespace) {\n getStorage().setItem(namespaceKey, JSON.stringify(namespace));\n }\n function removeOutdatedCacheItems() {\n const timeToLive = options.timeToLive ? options.timeToLive * 1000 : null;\n const namespace = getNamespace();\n const filteredNamespaceWithoutOldFormattedCacheItems = Object.fromEntries(Object.entries(namespace).filter(([, cacheItem]) => {\n return cacheItem.timestamp !== undefined;\n }));\n setNamespace(filteredNamespaceWithoutOldFormattedCacheItems);\n if (!timeToLive) {\n return;\n }\n const filteredNamespaceWithoutExpiredItems = Object.fromEntries(Object.entries(filteredNamespaceWithoutOldFormattedCacheItems).filter(([, cacheItem]) => {\n const currentTimestamp = new Date().getTime();\n const isExpired = cacheItem.timestamp + timeToLive < currentTimestamp;\n return !isExpired;\n }));\n setNamespace(filteredNamespaceWithoutExpiredItems);\n }\n return {\n get(key, defaultValue, events = {\n miss: () => Promise.resolve()\n }) {\n return Promise.resolve().then(() => {\n removeOutdatedCacheItems();\n return getNamespace()[JSON.stringify(key)];\n }).then(value => {\n return Promise.all([value ? value.value : defaultValue(), value !== undefined]);\n }).then(([value, exists]) => {\n return Promise.all([value, exists || events.miss(value)]);\n }).then(([value]) => value);\n },\n set(key, value) {\n return Promise.resolve().then(() => {\n const namespace = getNamespace();\n namespace[JSON.stringify(key)] = {\n timestamp: new Date().getTime(),\n value\n };\n getStorage().setItem(namespaceKey, JSON.stringify(namespace));\n return value;\n });\n },\n delete(key) {\n return Promise.resolve().then(() => {\n const namespace = getNamespace();\n delete namespace[JSON.stringify(key)];\n getStorage().setItem(namespaceKey, JSON.stringify(namespace));\n });\n },\n clear() {\n return Promise.resolve().then(() => {\n getStorage().removeItem(namespaceKey);\n });\n }\n };\n}\n\nfunction createNullCache() {\n return {\n get(_key, defaultValue, events = {\n miss: () => Promise.resolve()\n }) {\n const value = defaultValue();\n return value.then(result => Promise.all([result, events.miss(result)])).then(([result]) => result);\n },\n set(_key, value) {\n return Promise.resolve(value);\n },\n delete(_key) {\n return Promise.resolve();\n },\n clear() {\n return Promise.resolve();\n }\n };\n}\n\nfunction createFallbackableCache(options) {\n const caches = [...options.caches];\n const current = caches.shift();\n if (current === undefined) {\n return createNullCache();\n }\n return {\n get(key, defaultValue, events = {\n miss: () => Promise.resolve()\n }) {\n return current.get(key, defaultValue, events).catch(() => {\n return createFallbackableCache({\n caches\n }).get(key, defaultValue, events);\n });\n },\n set(key, value) {\n return current.set(key, value).catch(() => {\n return createFallbackableCache({\n caches\n }).set(key, value);\n });\n },\n delete(key) {\n return current.delete(key).catch(() => {\n return createFallbackableCache({\n caches\n }).delete(key);\n });\n },\n clear() {\n return current.clear().catch(() => {\n return createFallbackableCache({\n caches\n }).clear();\n });\n }\n };\n}\n\nfunction createMemoryCache(options = {\n serializable: true\n}) {\n let cache = {};\n return {\n get(key, defaultValue, events = {\n miss: () => Promise.resolve()\n }) {\n const keyAsString = JSON.stringify(key);\n if (keyAsString in cache) {\n return Promise.resolve(options.serializable ? JSON.parse(cache[keyAsString]) : cache[keyAsString]);\n }\n const promise = defaultValue();\n return promise.then(value => events.miss(value)).then(() => promise);\n },\n set(key, value) {\n cache[JSON.stringify(key)] = options.serializable ? JSON.stringify(value) : value;\n return Promise.resolve(value);\n },\n delete(key) {\n delete cache[JSON.stringify(key)];\n return Promise.resolve();\n },\n clear() {\n cache = {};\n return Promise.resolve();\n }\n };\n}\n\n// By default, API Clients at Algolia have expiration delay of 5 mins.\n// In the JavaScript client, we have 2 mins.\nconst EXPIRATION_DELAY = 2 * 60 * 1000;\nfunction createStatefulHost(host, status = 'up') {\n const lastUpdate = Date.now();\n function isUp() {\n return status === 'up' || Date.now() - lastUpdate > EXPIRATION_DELAY;\n }\n function isTimedOut() {\n return status === 'timed out' && Date.now() - lastUpdate <= EXPIRATION_DELAY;\n }\n return {\n ...host,\n status,\n lastUpdate,\n isUp,\n isTimedOut\n };\n}\n\nfunction _defineProperty(e, r, t) {\n return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nfunction _toPrimitive(t, r) {\n if (\"object\" != typeof t || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != typeof i) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nfunction _toPropertyKey(t) {\n var i = _toPrimitive(t, \"string\");\n return \"symbol\" == typeof i ? i : i + \"\";\n}\n\nclass AlgoliaError extends Error {\n constructor(message, name) {\n super(message);\n _defineProperty(this, \"name\", 'AlgoliaError');\n if (name) {\n this.name = name;\n }\n }\n}\nclass ErrorWithStackTrace extends AlgoliaError {\n constructor(message, stackTrace, name) {\n super(message, name);\n // the array and object should be frozen to reflect the stackTrace at the time of the error\n _defineProperty(this, \"stackTrace\", void 0);\n this.stackTrace = stackTrace;\n }\n}\nclass RetryError extends ErrorWithStackTrace {\n constructor(stackTrace) {\n super('Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.', stackTrace, 'RetryError');\n }\n}\nclass ApiError extends ErrorWithStackTrace {\n constructor(message, status, stackTrace, name = 'ApiError') {\n super(message, stackTrace, name);\n _defineProperty(this, \"status\", void 0);\n this.status = status;\n }\n}\nclass DeserializationError extends AlgoliaError {\n constructor(message, response) {\n super(message, 'DeserializationError');\n _defineProperty(this, \"response\", void 0);\n this.response = response;\n }\n}\n// DetailedApiError is only used by the ingestion client to return more informative error, other clients will use ApiClient.\nclass DetailedApiError extends ApiError {\n constructor(message, status, error, stackTrace) {\n super(message, status, stackTrace, 'DetailedApiError');\n _defineProperty(this, \"error\", void 0);\n this.error = error;\n }\n}\n\nfunction shuffle(array) {\n const shuffledArray = array;\n for (let c = array.length - 1; c > 0; c--) {\n const b = Math.floor(Math.random() * (c + 1));\n const a = array[c];\n shuffledArray[c] = array[b];\n shuffledArray[b] = a;\n }\n return shuffledArray;\n}\nfunction serializeUrl(host, path, queryParameters) {\n const queryParametersAsString = serializeQueryParameters(queryParameters);\n let url = `${host.protocol}://${host.url}${host.port ? `:${host.port}` : ''}/${path.charAt(0) === '/' ? path.substring(1) : path}`;\n if (queryParametersAsString.length) {\n url += `?${queryParametersAsString}`;\n }\n return url;\n}\nfunction serializeQueryParameters(parameters) {\n return Object.keys(parameters).filter(key => parameters[key] !== undefined).sort().map(key => `${key}=${encodeURIComponent(Object.prototype.toString.call(parameters[key]) === '[object Array]' ? parameters[key].join(',') : parameters[key]).replaceAll('+', '%20')}`).join('&');\n}\nfunction serializeData(request, requestOptions) {\n if (request.method === 'GET' || request.data === undefined && requestOptions.data === undefined) {\n return undefined;\n }\n const data = Array.isArray(request.data) ? request.data : {\n ...request.data,\n ...requestOptions.data\n };\n return JSON.stringify(data);\n}\nfunction serializeHeaders(baseHeaders, requestHeaders, requestOptionsHeaders) {\n const headers = {\n Accept: 'application/json',\n ...baseHeaders,\n ...requestHeaders,\n ...requestOptionsHeaders\n };\n const serializedHeaders = {};\n Object.keys(headers).forEach(header => {\n const value = headers[header];\n serializedHeaders[header.toLowerCase()] = value;\n });\n return serializedHeaders;\n}\nfunction deserializeSuccess(response) {\n try {\n return JSON.parse(response.content);\n } catch (e) {\n throw new DeserializationError(e.message, response);\n }\n}\nfunction deserializeFailure({\n content,\n status\n}, stackFrame) {\n try {\n const parsed = JSON.parse(content);\n if ('error' in parsed) {\n return new DetailedApiError(parsed.message, status, parsed.error, stackFrame);\n }\n return new ApiError(parsed.message, status, stackFrame);\n } catch {\n // ..\n }\n return new ApiError(content, status, stackFrame);\n}\n\nfunction isNetworkError({\n isTimedOut,\n status\n}) {\n return !isTimedOut && ~~status === 0;\n}\nfunction isRetryable({\n isTimedOut,\n status\n}) {\n return isTimedOut || isNetworkError({\n isTimedOut,\n status\n }) || ~~(status / 100) !== 2 && ~~(status / 100) !== 4;\n}\nfunction isSuccess({\n status\n}) {\n return ~~(status / 100) === 2;\n}\n\nfunction stackTraceWithoutCredentials(stackTrace) {\n return stackTrace.map(stackFrame => stackFrameWithoutCredentials(stackFrame));\n}\nfunction stackFrameWithoutCredentials(stackFrame) {\n const modifiedHeaders = stackFrame.request.headers['x-algolia-api-key'] ? {\n 'x-algolia-api-key': '*****'\n } : {};\n return {\n ...stackFrame,\n request: {\n ...stackFrame.request,\n headers: {\n ...stackFrame.request.headers,\n ...modifiedHeaders\n }\n }\n };\n}\n\nfunction createTransporter({\n hosts,\n hostsCache,\n baseHeaders,\n baseQueryParameters,\n algoliaAgent,\n timeouts,\n requester,\n requestsCache,\n responsesCache\n}) {\n async function createRetryableOptions(compatibleHosts) {\n const statefulHosts = await Promise.all(compatibleHosts.map(compatibleHost => {\n return hostsCache.get(compatibleHost, () => {\n return Promise.resolve(createStatefulHost(compatibleHost));\n });\n }));\n const hostsUp = statefulHosts.filter(host => host.isUp());\n const hostsTimedOut = statefulHosts.filter(host => host.isTimedOut());\n // Note, we put the hosts that previously timed out on the end of the list.\n const hostsAvailable = [...hostsUp, ...hostsTimedOut];\n const compatibleHostsAvailable = hostsAvailable.length > 0 ? hostsAvailable : compatibleHosts;\n return {\n hosts: compatibleHostsAvailable,\n getTimeout(timeoutsCount, baseTimeout) {\n /**\n * Imagine that you have 4 hosts, if timeouts will increase\n * on the following way: 1 (timed out) > 4 (timed out) > 5 (200).\n *\n * Note that, the very next request, we start from the previous timeout.\n *\n * 5 (timed out) > 6 (timed out) > 7 ...\n *\n * This strategy may need to be reviewed, but is the strategy on the our\n * current v3 version.\n */\n const timeoutMultiplier = hostsTimedOut.length === 0 && timeoutsCount === 0 ? 1 : hostsTimedOut.length + 3 + timeoutsCount;\n return timeoutMultiplier * baseTimeout;\n }\n };\n }\n async function retryableRequest(request, requestOptions, isRead = true) {\n const stackTrace = [];\n /**\n * First we prepare the payload that do not depend from hosts.\n */\n const data = serializeData(request, requestOptions);\n const headers = serializeHeaders(baseHeaders, request.headers, requestOptions.headers);\n // On `GET`, the data is proxied to query parameters.\n const dataQueryParameters = request.method === 'GET' ? {\n ...request.data,\n ...requestOptions.data\n } : {};\n const queryParameters = {\n ...baseQueryParameters,\n ...request.queryParameters,\n ...dataQueryParameters\n };\n if (algoliaAgent.value) {\n queryParameters['x-algolia-agent'] = algoliaAgent.value;\n }\n if (requestOptions && requestOptions.queryParameters) {\n for (const key of Object.keys(requestOptions.queryParameters)) {\n // We want to keep `undefined` and `null` values,\n // but also avoid stringifying `object`s, as they are\n // handled in the `serializeUrl` step right after.\n if (!requestOptions.queryParameters[key] || Object.prototype.toString.call(requestOptions.queryParameters[key]) === '[object Object]') {\n queryParameters[key] = requestOptions.queryParameters[key];\n } else {\n queryParameters[key] = requestOptions.queryParameters[key].toString();\n }\n }\n }\n let timeoutsCount = 0;\n const retry = async (retryableHosts, getTimeout) => {\n /**\n * We iterate on each host, until there is no host left.\n */\n const host = retryableHosts.pop();\n if (host === undefined) {\n throw new RetryError(stackTraceWithoutCredentials(stackTrace));\n }\n const timeout = {\n ...timeouts,\n ...requestOptions.timeouts\n };\n const payload = {\n data,\n headers,\n method: request.method,\n url: serializeUrl(host, request.path, queryParameters),\n connectTimeout: getTimeout(timeoutsCount, timeout.connect),\n responseTimeout: getTimeout(timeoutsCount, isRead ? timeout.read : timeout.write)\n };\n /**\n * The stackFrame is pushed to the stackTrace so we\n * can have information about onRetry and onFailure\n * decisions.\n */\n const pushToStackTrace = response => {\n const stackFrame = {\n request: payload,\n response,\n host,\n triesLeft: retryableHosts.length\n };\n stackTrace.push(stackFrame);\n return stackFrame;\n };\n const response = await requester.send(payload);\n if (isRetryable(response)) {\n const stackFrame = pushToStackTrace(response);\n // If response is a timeout, we increase the number of timeouts so we can increase the timeout later.\n if (response.isTimedOut) {\n timeoutsCount++;\n }\n /**\n * Failures are individually sent to the logger, allowing\n * the end user to debug / store stack frames even\n * when a retry error does not happen.\n */\n // eslint-disable-next-line no-console -- this will be fixed by exposing a `logger` to the transporter\n console.log('Retryable failure', stackFrameWithoutCredentials(stackFrame));\n /**\n * We also store the state of the host in failure cases. If the host, is\n * down it will remain down for the next 2 minutes. In a timeout situation,\n * this host will be added end of the list of hosts on the next request.\n */\n await hostsCache.set(host, createStatefulHost(host, response.isTimedOut ? 'timed out' : 'down'));\n return retry(retryableHosts, getTimeout);\n }\n if (isSuccess(response)) {\n return deserializeSuccess(response);\n }\n pushToStackTrace(response);\n throw deserializeFailure(response, stackTrace);\n };\n /**\n * Finally, for each retryable host perform request until we got a non\n * retryable response. Some notes here:\n *\n * 1. The reverse here is applied so we can apply a `pop` later on => more performant.\n * 2. We also get from the retryable options a timeout multiplier that is tailored\n * for the current context.\n */\n const compatibleHosts = hosts.filter(host => host.accept === 'readWrite' || (isRead ? host.accept === 'read' : host.accept === 'write'));\n const options = await createRetryableOptions(compatibleHosts);\n return retry([...options.hosts].reverse(), options.getTimeout);\n }\n function createRequest(request, requestOptions = {}) {\n /**\n * A read request is either a `GET` request, or a request that we make\n * via the `read` transporter (e.g. `search`).\n */\n const isRead = request.useReadTransporter || request.method === 'GET';\n if (!isRead) {\n /**\n * On write requests, no cache mechanisms are applied, and we\n * proxy the request immediately to the requester.\n */\n return retryableRequest(request, requestOptions, isRead);\n }\n const createRetryableRequest = () => {\n /**\n * Then, we prepare a function factory that contains the construction of\n * the retryable request. At this point, we may *not* perform the actual\n * request. But we want to have the function factory ready.\n */\n return retryableRequest(request, requestOptions);\n };\n /**\n * Once we have the function factory ready, we need to determine of the\n * request is \"cacheable\" - should be cached. Note that, once again,\n * the user can force this option.\n */\n const cacheable = requestOptions.cacheable || request.cacheable;\n /**\n * If is not \"cacheable\", we immediately trigger the retryable request, no\n * need to check cache implementations.\n */\n if (cacheable !== true) {\n return createRetryableRequest();\n }\n /**\n * If the request is \"cacheable\", we need to first compute the key to ask\n * the cache implementations if this request is on progress or if the\n * response already exists on the cache.\n */\n const key = {\n request,\n requestOptions,\n transporter: {\n queryParameters: baseQueryParameters,\n headers: baseHeaders\n }\n };\n /**\n * With the computed key, we first ask the responses cache\n * implementation if this request was been resolved before.\n */\n return responsesCache.get(key, () => {\n /**\n * If the request has never resolved before, we actually ask if there\n * is a current request with the same key on progress.\n */\n return requestsCache.get(key, () =>\n /**\n * Finally, if there is no request in progress with the same key,\n * this `createRetryableRequest()` will actually trigger the\n * retryable request.\n */\n requestsCache.set(key, createRetryableRequest()).then(response => Promise.all([requestsCache.delete(key), response]), err => Promise.all([requestsCache.delete(key), Promise.reject(err)])).then(([_, response]) => response));\n }, {\n /**\n * Of course, once we get this response back from the server, we\n * tell response cache to actually store the received response\n * to be used later.\n */\n miss: response => responsesCache.set(key, response)\n });\n }\n return {\n hostsCache,\n requester,\n timeouts,\n algoliaAgent,\n baseHeaders,\n baseQueryParameters,\n hosts,\n request: createRequest,\n requestsCache,\n responsesCache\n };\n}\n\nfunction createAlgoliaAgent(version) {\n const algoliaAgent = {\n value: `Algolia for JavaScript (${version})`,\n add(options) {\n const addedAlgoliaAgent = `; ${options.segment}${options.version !== undefined ? ` (${options.version})` : ''}`;\n if (algoliaAgent.value.indexOf(addedAlgoliaAgent) === -1) {\n algoliaAgent.value = `${algoliaAgent.value}${addedAlgoliaAgent}`;\n }\n return algoliaAgent;\n }\n };\n return algoliaAgent;\n}\n\nfunction getAlgoliaAgent({\n algoliaAgents,\n client,\n version\n}) {\n const defaultAlgoliaAgent = createAlgoliaAgent(version).add({\n segment: client,\n version\n });\n algoliaAgents.forEach(algoliaAgent => defaultAlgoliaAgent.add(algoliaAgent));\n return defaultAlgoliaAgent;\n}\n\nconst DEFAULT_CONNECT_TIMEOUT_BROWSER = 1000;\nconst DEFAULT_READ_TIMEOUT_BROWSER = 2000;\nconst DEFAULT_WRITE_TIMEOUT_BROWSER = 30000;\n\nfunction createXhrRequester() {\n function send(request) {\n return new Promise((resolve) => {\n const baseRequester = new XMLHttpRequest();\n baseRequester.open(request.method, request.url, true);\n Object.keys(request.headers).forEach((key) => baseRequester.setRequestHeader(key, request.headers[key]));\n const createTimeout = (timeout, content) => {\n return setTimeout(() => {\n baseRequester.abort();\n resolve({\n status: 0,\n content,\n isTimedOut: true,\n });\n }, timeout);\n };\n const connectTimeout = createTimeout(request.connectTimeout, 'Connection timeout');\n let responseTimeout;\n baseRequester.onreadystatechange = () => {\n if (baseRequester.readyState > baseRequester.OPENED && responseTimeout === undefined) {\n clearTimeout(connectTimeout);\n responseTimeout = createTimeout(request.responseTimeout, 'Socket timeout');\n }\n };\n baseRequester.onerror = () => {\n // istanbul ignore next\n if (baseRequester.status === 0) {\n clearTimeout(connectTimeout);\n clearTimeout(responseTimeout);\n resolve({\n content: baseRequester.responseText || 'Network request failed',\n status: baseRequester.status,\n isTimedOut: false,\n });\n }\n };\n baseRequester.onload = () => {\n clearTimeout(connectTimeout);\n clearTimeout(responseTimeout);\n resolve({\n content: baseRequester.responseText,\n status: baseRequester.status,\n isTimedOut: false,\n });\n };\n baseRequester.send(request.data);\n });\n }\n return { send };\n}\n\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.\nconst apiClientVersion = '5.2.4';\nfunction getDefaultHosts(appId) {\n return [\n {\n url: `${appId}-dsn.algolia.net`,\n accept: 'read',\n protocol: 'https',\n },\n {\n url: `${appId}.algolia.net`,\n accept: 'write',\n protocol: 'https',\n },\n ].concat(shuffle([\n {\n url: `${appId}-1.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-2.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-3.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n ]));\n}\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nfunction createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(appIdOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Recommend',\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 return {\n transporter,\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache() {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua() {\n return transporter.algoliaAgent.value;\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, version) {\n transporter.algoliaAgent.add({ segment, version });\n },\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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({ path, parameters }, requestOptions) {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customDelete`.');\n }\n const requestPath = '/{path}'.replace('{path}', path);\n const headers = {};\n const queryParameters = parameters ? parameters : {};\n const request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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 }, requestOptions) {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customGet`.');\n }\n const requestPath = '/{path}'.replace('{path}', path);\n const headers = {};\n const queryParameters = parameters ? parameters : {};\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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({ path, parameters, body }, requestOptions) {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\n const requestPath = '/{path}'.replace('{path}', path);\n const headers = {};\n const queryParameters = parameters ? parameters : {};\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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({ path, parameters, body }, requestOptions) {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPut`.');\n }\n const requestPath = '/{path}'.replace('{path}', path);\n const headers = {};\n const queryParameters = parameters ? parameters : {};\n const request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Deletes a Recommend rule from a recommendation scenario.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param deleteRecommendRule - The deleteRecommendRule object.\n * @param deleteRecommendRule.indexName - Name of the index on which to perform the operation.\n * @param deleteRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).\n * @param deleteRecommendRule.objectID - Unique record identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteRecommendRule({ indexName, model, objectID }, requestOptions) {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `deleteRecommendRule`.');\n }\n if (!model) {\n throw new Error('Parameter `model` is required when calling `deleteRecommendRule`.');\n }\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `deleteRecommendRule`.');\n }\n const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/{objectID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{model}', encodeURIComponent(model))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves a Recommend rule that you previously created in the Algolia dashboard.\n *\n * Required API Key ACLs:\n * - settings.\n *\n * @param getRecommendRule - The getRecommendRule object.\n * @param getRecommendRule.indexName - Name of the index on which to perform the operation.\n * @param getRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).\n * @param getRecommendRule.objectID - Unique record identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRecommendRule({ indexName, model, objectID }, requestOptions) {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `getRecommendRule`.');\n }\n if (!model) {\n throw new Error('Parameter `model` is required when calling `getRecommendRule`.');\n }\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `getRecommendRule`.');\n }\n const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/{objectID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{model}', encodeURIComponent(model))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Checks the status of a given task. Deleting a Recommend rule is asynchronous. When you delete a rule, a task is created on a queue and completed depending on the load on the server. The API response includes a task ID that you can use to check the status.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param getRecommendStatus - The getRecommendStatus object.\n * @param getRecommendStatus.indexName - Name of the index on which to perform the operation.\n * @param getRecommendStatus.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).\n * @param getRecommendStatus.taskID - Unique task identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRecommendStatus({ indexName, model, taskID }, requestOptions) {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `getRecommendStatus`.');\n }\n if (!model) {\n throw new Error('Parameter `model` is required when calling `getRecommendStatus`.');\n }\n if (!taskID) {\n throw new Error('Parameter `taskID` is required when calling `getRecommendStatus`.');\n }\n const requestPath = '/1/indexes/{indexName}/{model}/task/{taskID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{model}', encodeURIComponent(model))\n .replace('{taskID}', encodeURIComponent(taskID));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves recommendations from selected AI models.\n *\n * Required API Key ACLs:\n * - search.\n *\n * @param getRecommendationsParams - The getRecommendationsParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRecommendations(getRecommendationsParams, requestOptions) {\n if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {\n const newSignatureRequest = {\n requests: getRecommendationsParams,\n };\n // eslint-disable-next-line no-param-reassign\n getRecommendationsParams = newSignatureRequest;\n }\n if (!getRecommendationsParams) {\n throw new Error('Parameter `getRecommendationsParams` is required when calling `getRecommendations`.');\n }\n if (!getRecommendationsParams.requests) {\n throw new Error('Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.');\n }\n const requestPath = '/1/indexes/*/recommendations';\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: getRecommendationsParams,\n useReadTransporter: true,\n cacheable: true,\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Searches for Recommend rules. Use an empty query to list all rules for this recommendation scenario.\n *\n * Required API Key ACLs:\n * - settings.\n *\n * @param searchRecommendRules - The searchRecommendRules object.\n * @param searchRecommendRules.indexName - Name of the index on which to perform the operation.\n * @param searchRecommendRules.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).\n * @param searchRecommendRules.searchRecommendRulesParams - The searchRecommendRulesParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchRecommendRules({ indexName, model, searchRecommendRulesParams }, requestOptions) {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `searchRecommendRules`.');\n }\n if (!model) {\n throw new Error('Parameter `model` is required when calling `searchRecommendRules`.');\n }\n const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/search'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{model}', encodeURIComponent(model));\n const headers = {};\n const queryParameters = {};\n const request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchRecommendRulesParams ? searchRecommendRulesParams : {},\n useReadTransporter: true,\n cacheable: true,\n };\n return transporter.request(request, requestOptions);\n },\n };\n}\n\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// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nfunction recommendClient(appId, apiKey, options) {\n if (!appId || typeof appId !== 'string') {\n throw new Error('`appId` is missing.');\n }\n if (!apiKey || typeof apiKey !== 'string') {\n throw new Error('`apiKey` is missing.');\n }\n return createRecommendClient({\n appId,\n apiKey,\n timeouts: {\n connect: DEFAULT_CONNECT_TIMEOUT_BROWSER,\n read: DEFAULT_READ_TIMEOUT_BROWSER,\n write: DEFAULT_WRITE_TIMEOUT_BROWSER,\n },\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 ...options,\n });\n}\n\nexport { apiClientVersion, recommendClient };\n","import { createEchoRequester } from '@algolia/client-common';\n\nfunction createXhrRequester() {\n function send(request) {\n return new Promise((resolve) => {\n const baseRequester = new XMLHttpRequest();\n baseRequester.open(request.method, request.url, true);\n Object.keys(request.headers).forEach((key) => baseRequester.setRequestHeader(key, request.headers[key]));\n const createTimeout = (timeout, content) => {\n return setTimeout(() => {\n baseRequester.abort();\n resolve({\n status: 0,\n content,\n isTimedOut: true,\n });\n }, timeout);\n };\n const connectTimeout = createTimeout(request.connectTimeout, 'Connection timeout');\n let responseTimeout;\n baseRequester.onreadystatechange = () => {\n if (baseRequester.readyState > baseRequester.OPENED && responseTimeout === undefined) {\n clearTimeout(connectTimeout);\n responseTimeout = createTimeout(request.responseTimeout, 'Socket timeout');\n }\n };\n baseRequester.onerror = () => {\n // istanbul ignore next\n if (baseRequester.status === 0) {\n clearTimeout(connectTimeout);\n clearTimeout(responseTimeout);\n resolve({\n content: baseRequester.responseText || 'Network request failed',\n status: baseRequester.status,\n isTimedOut: false,\n });\n }\n };\n baseRequester.onload = () => {\n clearTimeout(connectTimeout);\n clearTimeout(responseTimeout);\n resolve({\n content: baseRequester.responseText,\n status: baseRequester.status,\n isTimedOut: false,\n });\n };\n baseRequester.send(request.data);\n });\n }\n return { send };\n}\n\nfunction echoRequester(status = 200) {\n return createEchoRequester({ getURL: (url) => new URL(url), status });\n}\n\nexport { createXhrRequester, echoRequester };\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 { AbtestingClient, Region as AbtestingRegion } from '@algolia/client-abtesting';\nimport { abtestingClient } from '@algolia/client-abtesting';\nimport type { AnalyticsClient, Region as AnalyticsRegion } from '@algolia/client-analytics';\nimport { analyticsClient } from '@algolia/client-analytics';\nimport {\n DEFAULT_CONNECT_TIMEOUT_BROWSER,\n DEFAULT_READ_TIMEOUT_BROWSER,\n DEFAULT_WRITE_TIMEOUT_BROWSER,\n createBrowserLocalStorageCache,\n createFallbackableCache,\n createMemoryCache,\n} from '@algolia/client-common';\nimport type { ClientOptions } from '@algolia/client-common';\nimport type { PersonalizationClient, Region as PersonalizationRegion } from '@algolia/client-personalization';\nimport { personalizationClient } from '@algolia/client-personalization';\nimport { searchClient } from '@algolia/client-search';\nimport type { RecommendClient } from '@algolia/recommend';\nimport { recommendClient } from '@algolia/recommend';\nimport { createXhrRequester } from '@algolia/requester-browser-xhr';\n\nimport type { InitClientOptions, InitClientRegion } from './models';\nimport { apiClientVersion } from './models';\n\nexport * from './models';\n\n/**\n * The client type.\n */\nexport type Algoliasearch = ReturnType<typeof algoliasearch>;\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function algoliasearch(appId: string, apiKey: string, options?: ClientOptions) {\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 function initRecommend(initOptions: InitClientOptions = {}): RecommendClient {\n return recommendClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);\n }\n\n function initAnalytics(initOptions: InitClientOptions & InitClientRegion<AnalyticsRegion> = {}): AnalyticsClient {\n return analyticsClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n }\n\n function initAbtesting(initOptions: InitClientOptions & InitClientRegion<AbtestingRegion> = {}): AbtestingClient {\n return abtestingClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n }\n\n function initPersonalization(\n initOptions: InitClientOptions & Required<InitClientRegion<PersonalizationRegion>>,\n ): PersonalizationClient {\n return personalizationClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n }\n\n return {\n ...searchClient(appId, apiKey, {\n timeouts: {\n connect: DEFAULT_CONNECT_TIMEOUT_BROWSER,\n read: DEFAULT_READ_TIMEOUT_BROWSER,\n write: DEFAULT_WRITE_TIMEOUT_BROWSER,\n },\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 ...options,\n }),\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return this.transporter.algoliaAgent.value;\n },\n initAbtesting,\n initAnalytics,\n initPersonalization,\n initRecommend,\n };\n}\n"],"mappings":"AAAA,SAASA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K,GACLL,EAAY,OAASJ,EACrBI,EAAY,QAAUH,EACtBG,EAAY,OACZA,EAAY,OACd,CACF,CAEA,SAASM,EACPN,EACuB,CACvB,OAAOO,GACLP,EAAY,OAASJ,EACrBI,EAAY,QAAUH,EACtBG,EAAY,OACZA,EAAY,OACd,CACF,CAEA,MAAO,CACL,GAAGQ,GAAaZ,EAAOC,EAAQ,CAC7B,SAAU,CACR,QAASY,GACT,KAAMC,GACN,MAAOC,EACT,EACA,UAAWC,GAAmB,EAC9B,cAAe,CAAC,CAAE,QAAS,SAAU,CAAC,EACtC,SAAU,wBACV,eAAgBC,GAAkB,EAClC,cAAeA,GAAkB,CAAE,aAAc,EAAM,CAAC,EACxD,WAAYC,EAAwB,CAClC,OAAQ,CAACC,GAA+B,CAAE,IAAK,GAAGC,CAAgB,IAAIpB,CAAK,EAAG,CAAC,EAAGiB,GAAkB,CAAC,CACvG,CAAC,EACD,GAAGf,CACL,CAAC,EAID,IAAI,KAAc,CAChB,OAAO,KAAK,YAAY,aAAa,KACvC,EACA,cAAAM,EACA,cAAAF,EACA,oBAAAI,EACA,cAAAP,CACF,CACF","names":["createAuth","appId","apiKey","authMode","credentials","createBrowserLocalStorageCache","options","storage","namespaceKey","getStorage","getNamespace","setNamespace","namespace","removeOutdatedCacheItems","timeToLive","filteredNamespaceWithoutOldFormattedCacheItems","cacheItem","filteredNamespaceWithoutExpiredItems","currentTimestamp","key","defaultValue","events","value","exists","createNullCache","_key","result","createFallbackableCache","caches","current","createMemoryCache","cache","keyAsString","promise","EXPIRATION_DELAY","createStatefulHost","host","status","lastUpdate","isUp","isTimedOut","_defineProperty","e","r","t","_toPropertyKey","_toPrimitive","i","AlgoliaError","message","name","ErrorWithStackTrace","stackTrace","RetryError","ApiError","DeserializationError","response","DetailedApiError","error","serializeUrl","path","queryParameters","queryParametersAsString","serializeQueryParameters","url","parameters","serializeData","request","requestOptions","data","serializeHeaders","baseHeaders","requestHeaders","requestOptionsHeaders","headers","serializedHeaders","header","deserializeSuccess","deserializeFailure","content","stackFrame","parsed","isNetworkError","isRetryable","isSuccess","stackTraceWithoutCredentials","stackFrameWithoutCredentials","modifiedHeaders","createTransporter","hosts","hostsCache","baseQueryParameters","algoliaAgent","timeouts","requester","requestsCache","responsesCache","createRetryableOptions","compatibleHosts","statefulHosts","compatibleHost","hostsUp","hostsTimedOut","hostsAvailable","timeoutsCount","baseTimeout","retryableRequest","isRead","dataQueryParameters","retry","retryableHosts","getTimeout","timeout","payload","pushToStackTrace","createRequest","createRetryableRequest","err","_","createAlgoliaAgent","version","addedAlgoliaAgent","getAlgoliaAgent","algoliaAgents","client","defaultAlgoliaAgent","DEFAULT_CONNECT_TIMEOUT_BROWSER","DEFAULT_READ_TIMEOUT_BROWSER","DEFAULT_WRITE_TIMEOUT_BROWSER","createXhrRequester","send","resolve","baseRequester","createTimeout","connectTimeout","responseTimeout","apiClientVersion","REGIONS","getDefaultHosts","region","createAbtestingClient","appIdOption","apiKeyOption","regionOption","auth","transporter","segment","addABTestsRequest","body","id","offset","limit","indexPrefix","indexSuffix","requestPath","scheduleABTestsRequest","abtestingClient","createAuth","appId","apiKey","authMode","credentials","createBrowserLocalStorageCache","options","storage","namespaceKey","getStorage","getNamespace","setNamespace","namespace","removeOutdatedCacheItems","timeToLive","filteredNamespaceWithoutOldFormattedCacheItems","cacheItem","filteredNamespaceWithoutExpiredItems","currentTimestamp","key","defaultValue","events","value","exists","createNullCache","_key","result","createFallbackableCache","caches","current","createMemoryCache","cache","keyAsString","promise","EXPIRATION_DELAY","createStatefulHost","host","status","lastUpdate","isUp","isTimedOut","_defineProperty","e","r","t","_toPropertyKey","_toPrimitive","i","AlgoliaError","message","name","ErrorWithStackTrace","stackTrace","RetryError","ApiError","DeserializationError","response","DetailedApiError","error","serializeUrl","path","queryParameters","queryParametersAsString","serializeQueryParameters","url","parameters","serializeData","request","requestOptions","data","serializeHeaders","baseHeaders","requestHeaders","requestOptionsHeaders","headers","serializedHeaders","header","deserializeSuccess","deserializeFailure","content","stackFrame","parsed","isNetworkError","isRetryable","isSuccess","stackTraceWithoutCredentials","stackFrameWithoutCredentials","modifiedHeaders","createTransporter","hosts","hostsCache","baseQueryParameters","algoliaAgent","timeouts","requester","requestsCache","responsesCache","createRetryableOptions","compatibleHosts","statefulHosts","compatibleHost","hostsUp","hostsTimedOut","hostsAvailable","timeoutsCount","baseTimeout","retryableRequest","isRead","dataQueryParameters","retry","retryableHosts","getTimeout","timeout","payload","pushToStackTrace","createRequest","createRetryableRequest","err","_","createAlgoliaAgent","version","addedAlgoliaAgent","getAlgoliaAgent","algoliaAgents","client","defaultAlgoliaAgent","DEFAULT_CONNECT_TIMEOUT_BROWSER","DEFAULT_READ_TIMEOUT_BROWSER","DEFAULT_WRITE_TIMEOUT_BROWSER","createXhrRequester","send","resolve","baseRequester","createTimeout","connectTimeout","responseTimeout","apiClientVersion","REGIONS","getDefaultHosts","region","createAnalyticsClient","appIdOption","apiKeyOption","regionOption","auth","transporter","segment","body","index","startDate","endDate","tags","requestPath","limit","offset","search","attribute","clickAnalytics","revenueAnalytics","orderBy","direction","analyticsClient","createBrowserLocalStorageCache","options","storage","namespaceKey","getStorage","getNamespace","setNamespace","namespace","removeOutdatedCacheItems","timeToLive","filteredNamespaceWithoutOldFormattedCacheItems","cacheItem","filteredNamespaceWithoutExpiredItems","currentTimestamp","key","defaultValue","events","value","exists","createNullCache","_key","result","createFallbackableCache","caches","current","createMemoryCache","cache","keyAsString","promise","EXPIRATION_DELAY","DEFAULT_CONNECT_TIMEOUT_BROWSER","DEFAULT_READ_TIMEOUT_BROWSER","DEFAULT_WRITE_TIMEOUT_BROWSER","createAuth","appId","apiKey","authMode","credentials","createBrowserLocalStorageCache","options","storage","namespaceKey","getStorage","getNamespace","setNamespace","namespace","removeOutdatedCacheItems","timeToLive","filteredNamespaceWithoutOldFormattedCacheItems","cacheItem","filteredNamespaceWithoutExpiredItems","currentTimestamp","key","defaultValue","events","value","exists","createNullCache","_key","result","createFallbackableCache","caches","current","createMemoryCache","cache","keyAsString","promise","EXPIRATION_DELAY","createStatefulHost","host","status","lastUpdate","isUp","isTimedOut","_defineProperty","e","r","t","_toPropertyKey","_toPrimitive","i","AlgoliaError","message","name","ErrorWithStackTrace","stackTrace","RetryError","ApiError","DeserializationError","response","DetailedApiError","error","serializeUrl","path","queryParameters","queryParametersAsString","serializeQueryParameters","url","parameters","serializeData","request","requestOptions","data","serializeHeaders","baseHeaders","requestHeaders","requestOptionsHeaders","headers","serializedHeaders","header","deserializeSuccess","deserializeFailure","content","stackFrame","parsed","isNetworkError","isRetryable","isSuccess","stackTraceWithoutCredentials","stackFrameWithoutCredentials","modifiedHeaders","createTransporter","hosts","hostsCache","baseQueryParameters","algoliaAgent","timeouts","requester","requestsCache","responsesCache","createRetryableOptions","compatibleHosts","statefulHosts","compatibleHost","hostsUp","hostsTimedOut","hostsAvailable","timeoutsCount","baseTimeout","retryableRequest","isRead","dataQueryParameters","retry","retryableHosts","getTimeout","timeout","payload","pushToStackTrace","createRequest","createRetryableRequest","err","_","createAlgoliaAgent","version","addedAlgoliaAgent","getAlgoliaAgent","algoliaAgents","client","defaultAlgoliaAgent","DEFAULT_CONNECT_TIMEOUT_BROWSER","DEFAULT_READ_TIMEOUT_BROWSER","DEFAULT_WRITE_TIMEOUT_BROWSER","createXhrRequester","send","resolve","baseRequester","createTimeout","connectTimeout","responseTimeout","apiClientVersion","REGIONS","getDefaultHosts","region","createPersonalizationClient","appIdOption","apiKeyOption","regionOption","auth","transporter","segment","body","userToken","personalizationStrategyParams","personalizationClient","createAuth","appId","apiKey","authMode","credentials","createIterablePromise","func","validate","aggregator","error","timeout","retry","previousResponse","resolve","reject","response","err","createBrowserLocalStorageCache","options","storage","namespaceKey","getStorage","getNamespace","setNamespace","namespace","removeOutdatedCacheItems","timeToLive","filteredNamespaceWithoutOldFormattedCacheItems","cacheItem","filteredNamespaceWithoutExpiredItems","currentTimestamp","key","defaultValue","events","value","exists","createNullCache","_key","result","createFallbackableCache","caches","current","createMemoryCache","cache","keyAsString","promise","EXPIRATION_DELAY","createStatefulHost","host","status","lastUpdate","isUp","isTimedOut","_defineProperty","e","r","t","_toPropertyKey","_toPrimitive","i","AlgoliaError","message","name","ErrorWithStackTrace","stackTrace","RetryError","ApiError","DeserializationError","DetailedApiError","shuffle","array","shuffledArray","c","b","a","serializeUrl","path","queryParameters","queryParametersAsString","serializeQueryParameters","url","parameters","serializeData","request","requestOptions","data","serializeHeaders","baseHeaders","requestHeaders","requestOptionsHeaders","headers","serializedHeaders","header","deserializeSuccess","deserializeFailure","content","stackFrame","parsed","isNetworkError","isRetryable","isSuccess","stackTraceWithoutCredentials","stackFrameWithoutCredentials","modifiedHeaders","createTransporter","hosts","hostsCache","baseQueryParameters","algoliaAgent","timeouts","requester","requestsCache","responsesCache","createRetryableOptions","compatibleHosts","statefulHosts","compatibleHost","hostsUp","hostsTimedOut","hostsAvailable","timeoutsCount","baseTimeout","retryableRequest","isRead","dataQueryParameters","retryableHosts","getTimeout","payload","pushToStackTrace","createRequest","createRetryableRequest","_","createAlgoliaAgent","version","addedAlgoliaAgent","getAlgoliaAgent","algoliaAgents","client","defaultAlgoliaAgent","DEFAULT_CONNECT_TIMEOUT_BROWSER","DEFAULT_READ_TIMEOUT_BROWSER","DEFAULT_WRITE_TIMEOUT_BROWSER","createXhrRequester","send","baseRequester","createTimeout","connectTimeout","responseTimeout","apiClientVersion","getDefaultHosts","createSearchClient","appIdOption","apiKeyOption","auth","transporter","segment","indexName","taskID","maxRetries","retryCount","operation","baseIteratorOptions","field","resValue","v","index","browseParams","browseObjectsOptions","searchRulesParams","browseRulesOptions","params","searchSynonymsParams","browseSynonymsOptions","resp","objects","action","waitForTasks","batchSize","requests","responses","objectEntries","obj","objectIDs","objectID","createIfNotExists","randomSuffix","tmpIndexName","copyOperationResponse","batchResponses","moveOperationResponse","searchMethodParams","body","source","xAlgoliaUserID","assignUserIdParams","requestPath","batchWriteParams","batchAssignUserIdsParams","dictionaryName","batchDictionaryEntriesParams","forwardToReplicas","deleteByParams","offset","length","type","attributesToRetrieve","getObjectsParams","userID","getClusters","page","hitsPerPage","batchParams","operationIndexParams","attributesToUpdate","rule","rules","clearExistingRules","synonymHit","replaceExistingSynonyms","legacyRequest","searchDictionaryEntriesParams","facetName","searchForFacetValuesRequest","searchParams","searchUserIdsParams","dictionarySettingsParams","indexSettings","searchClient","createAuth","appId","apiKey","authMode","credentials","createBrowserLocalStorageCache","options","storage","namespaceKey","getStorage","getNamespace","setNamespace","namespace","removeOutdatedCacheItems","timeToLive","filteredNamespaceWithoutOldFormattedCacheItems","cacheItem","filteredNamespaceWithoutExpiredItems","currentTimestamp","key","defaultValue","events","value","exists","createNullCache","_key","result","createFallbackableCache","caches","current","createMemoryCache","cache","keyAsString","promise","EXPIRATION_DELAY","createStatefulHost","host","status","lastUpdate","isUp","isTimedOut","_defineProperty","e","r","t","_toPropertyKey","_toPrimitive","i","AlgoliaError","message","name","ErrorWithStackTrace","stackTrace","RetryError","ApiError","DeserializationError","response","DetailedApiError","error","shuffle","array","shuffledArray","c","b","a","serializeUrl","path","queryParameters","queryParametersAsString","serializeQueryParameters","url","parameters","serializeData","request","requestOptions","data","serializeHeaders","baseHeaders","requestHeaders","requestOptionsHeaders","headers","serializedHeaders","header","deserializeSuccess","deserializeFailure","content","stackFrame","parsed","isNetworkError","isRetryable","isSuccess","stackTraceWithoutCredentials","stackFrameWithoutCredentials","modifiedHeaders","createTransporter","hosts","hostsCache","baseQueryParameters","algoliaAgent","timeouts","requester","requestsCache","responsesCache","createRetryableOptions","compatibleHosts","statefulHosts","compatibleHost","hostsUp","hostsTimedOut","hostsAvailable","timeoutsCount","baseTimeout","retryableRequest","isRead","dataQueryParameters","retry","retryableHosts","getTimeout","timeout","payload","pushToStackTrace","createRequest","createRetryableRequest","err","_","createAlgoliaAgent","version","addedAlgoliaAgent","getAlgoliaAgent","algoliaAgents","client","defaultAlgoliaAgent","DEFAULT_CONNECT_TIMEOUT_BROWSER","DEFAULT_READ_TIMEOUT_BROWSER","DEFAULT_WRITE_TIMEOUT_BROWSER","createXhrRequester","send","resolve","baseRequester","createTimeout","connectTimeout","responseTimeout","apiClientVersion","getDefaultHosts","createRecommendClient","appIdOption","apiKeyOption","auth","transporter","segment","body","indexName","model","objectID","taskID","getRecommendationsParams","searchRecommendRulesParams","recommendClient","createXhrRequester","send","request","resolve","baseRequester","key","createTimeout","timeout","content","connectTimeout","responseTimeout","algoliasearch","appId","apiKey","options","initRecommend","initOptions","recommendClient","initAnalytics","analyticsClient","initAbtesting","abtestingClient","initPersonalization","personalizationClient","searchClient","DEFAULT_CONNECT_TIMEOUT_BROWSER","DEFAULT_READ_TIMEOUT_BROWSER","DEFAULT_WRITE_TIMEOUT_BROWSER","createXhrRequester","createMemoryCache","createFallbackableCache","createBrowserLocalStorageCache","apiClientVersion"]}
|
|
1
|
+
{"version":3,"sources":["../../client-common/src/createAuth.ts","../../client-common/src/createEchoRequester.ts","../../client-common/src/createIterablePromise.ts","../../client-common/src/cache/createBrowserLocalStorageCache.ts","../../client-common/src/cache/createNullCache.ts","../../client-common/src/cache/createFallbackableCache.ts","../../client-common/src/cache/createMemoryCache.ts","../../client-common/src/transporter/createStatefulHost.ts","../../client-common/src/transporter/errors.ts","../../client-common/src/transporter/helpers.ts","../../client-common/src/transporter/responses.ts","../../client-common/src/transporter/stackTrace.ts","../../client-common/src/transporter/createTransporter.ts","../../client-common/src/createAlgoliaAgent.ts","../../client-common/src/getAlgoliaAgent.ts","../../client-common/src/constants.ts","../../requester-browser-xhr/src/createXhrRequester.ts","../../requester-browser-xhr/src/echoRequester.ts","../../client-abtesting/builds/browser.ts","../../client-abtesting/src/abtestingClient.ts","../../client-analytics/builds/browser.ts","../../client-analytics/src/analyticsClient.ts","../../client-personalization/builds/browser.ts","../../client-personalization/src/personalizationClient.ts","../../client-search/builds/browser.ts","../../client-search/src/searchClient.ts","../../recommend/builds/browser.ts","../../recommend/src/recommendClient.ts","../builds/browser.ts"],"sourcesContent":["import type { AuthMode, Headers, QueryParameters } from './types';\n\nexport function createAuth(\n appId: string,\n apiKey: string,\n authMode: AuthMode = 'WithinHeaders',\n): {\n readonly headers: () => Headers;\n readonly queryParameters: () => QueryParameters;\n} {\n const credentials = {\n 'x-algolia-api-key': apiKey,\n 'x-algolia-application-id': appId,\n };\n\n return {\n headers(): Headers {\n return authMode === 'WithinHeaders' ? credentials : {};\n },\n\n queryParameters(): QueryParameters {\n return authMode === 'WithinQueryParameters' ? credentials : {};\n },\n };\n}\n","import type { EchoResponse, EndRequest, Requester, Response } from './types';\n\nexport type EchoRequesterParams = {\n getURL: (url: string) => URL;\n status?: number;\n};\n\nfunction getUrlParams({\n host,\n search,\n pathname,\n}: URL): Pick<EchoResponse, 'algoliaAgent' | 'host' | 'path' | 'searchParams'> {\n const urlSearchParams = search.split('?');\n if (urlSearchParams.length === 1) {\n return {\n host,\n algoliaAgent: '',\n searchParams: undefined,\n path: pathname,\n };\n }\n\n const splitSearchParams = urlSearchParams[1].split('&');\n let algoliaAgent = '';\n const searchParams: Record<string, string> = {};\n\n if (splitSearchParams.length > 0) {\n splitSearchParams.forEach((param) => {\n const [key, value] = param.split('=');\n if (key === 'x-algolia-agent') {\n algoliaAgent = value;\n return;\n }\n\n searchParams[key] = value;\n });\n }\n\n return {\n host,\n algoliaAgent,\n searchParams: Object.keys(searchParams).length === 0 ? undefined : searchParams,\n path: pathname,\n };\n}\n\nexport function createEchoRequester({ getURL, status = 200 }: EchoRequesterParams): Requester {\n function send(request: EndRequest): Promise<Response> {\n const { host, searchParams, algoliaAgent, path } = getUrlParams(getURL(request.url));\n\n const content: EchoResponse = {\n ...request,\n data: request.data ? JSON.parse(request.data) : undefined,\n path,\n host,\n algoliaAgent,\n searchParams,\n };\n\n return Promise.resolve({\n content: JSON.stringify(content),\n isTimedOut: false,\n status,\n });\n }\n\n return { send };\n}\n","import type { CreateIterablePromise } from './types/createIterablePromise';\n\n/**\n * Helper: Returns the promise of a given `func` to iterate on, based on a given `validate` condition.\n *\n * @param createIterator - The createIterator options.\n * @param createIterator.func - The function to run, which returns a promise.\n * @param createIterator.validate - The validator function. It receives the resolved return of `func`.\n * @param createIterator.aggregator - The function that runs right after the `func` method has been executed, allows you to do anything with the response before `validate`.\n * @param createIterator.error - The `validate` condition to throw an error, and its message.\n * @param createIterator.timeout - The function to decide how long to wait between iterations.\n */\nexport function createIterablePromise<TResponse>({\n func,\n validate,\n aggregator,\n error,\n timeout = (): number => 0,\n}: CreateIterablePromise<TResponse>): Promise<TResponse> {\n const retry = (previousResponse?: TResponse): Promise<TResponse> => {\n return new Promise<TResponse>((resolve, reject) => {\n func(previousResponse)\n .then((response) => {\n if (aggregator) {\n aggregator(response);\n }\n\n if (validate(response)) {\n return resolve(response);\n }\n\n if (error && error.validate(response)) {\n return reject(new Error(error.message(response)));\n }\n\n return setTimeout(() => {\n retry(response).then(resolve).catch(reject);\n }, timeout());\n })\n .catch((err) => {\n reject(err);\n });\n });\n };\n\n return retry();\n}\n","import type { BrowserLocalStorageCacheItem, BrowserLocalStorageOptions, Cache, CacheEvents } from '../types';\n\nexport function createBrowserLocalStorageCache(options: BrowserLocalStorageOptions): Cache {\n let storage: Storage;\n // We've changed the namespace to avoid conflicts with v4, as this version is a huge breaking change\n const namespaceKey = `algolia-client-js-${options.key}`;\n\n function getStorage(): Storage {\n if (storage === undefined) {\n storage = options.localStorage || window.localStorage;\n }\n\n return storage;\n }\n\n function getNamespace<TValue>(): Record<string, TValue> {\n return JSON.parse(getStorage().getItem(namespaceKey) || '{}');\n }\n\n function setNamespace(namespace: Record<string, any>): void {\n getStorage().setItem(namespaceKey, JSON.stringify(namespace));\n }\n\n function removeOutdatedCacheItems(): void {\n const timeToLive = options.timeToLive ? options.timeToLive * 1000 : null;\n const namespace = getNamespace<BrowserLocalStorageCacheItem>();\n\n const filteredNamespaceWithoutOldFormattedCacheItems = Object.fromEntries(\n Object.entries(namespace).filter(([, cacheItem]) => {\n return cacheItem.timestamp !== undefined;\n }),\n );\n\n setNamespace(filteredNamespaceWithoutOldFormattedCacheItems);\n\n if (!timeToLive) {\n return;\n }\n\n const filteredNamespaceWithoutExpiredItems = Object.fromEntries(\n Object.entries(filteredNamespaceWithoutOldFormattedCacheItems).filter(([, cacheItem]) => {\n const currentTimestamp = new Date().getTime();\n const isExpired = cacheItem.timestamp + timeToLive < currentTimestamp;\n\n return !isExpired;\n }),\n );\n\n setNamespace(filteredNamespaceWithoutExpiredItems);\n }\n\n return {\n get<TValue>(\n key: Record<string, any> | string,\n defaultValue: () => Promise<TValue>,\n events: CacheEvents<TValue> = {\n miss: () => Promise.resolve(),\n },\n ): Promise<TValue> {\n return Promise.resolve()\n .then(() => {\n removeOutdatedCacheItems();\n\n return getNamespace<Promise<BrowserLocalStorageCacheItem>>()[JSON.stringify(key)];\n })\n .then((value) => {\n return Promise.all([value ? value.value : defaultValue(), value !== undefined]);\n })\n .then(([value, exists]) => {\n return Promise.all([value, exists || events.miss(value)]);\n })\n .then(([value]) => value);\n },\n\n set<TValue>(key: Record<string, any> | string, value: TValue): Promise<TValue> {\n return Promise.resolve().then(() => {\n const namespace = getNamespace();\n\n namespace[JSON.stringify(key)] = {\n timestamp: new Date().getTime(),\n value,\n };\n\n getStorage().setItem(namespaceKey, JSON.stringify(namespace));\n\n return value;\n });\n },\n\n delete(key: Record<string, any> | string): Promise<void> {\n return Promise.resolve().then(() => {\n const namespace = getNamespace();\n\n delete namespace[JSON.stringify(key)];\n\n getStorage().setItem(namespaceKey, JSON.stringify(namespace));\n });\n },\n\n clear(): Promise<void> {\n return Promise.resolve().then(() => {\n getStorage().removeItem(namespaceKey);\n });\n },\n };\n}\n","import type { Cache, CacheEvents } from '../types';\n\nexport function createNullCache(): Cache {\n return {\n get<TValue>(\n _key: Record<string, any> | string,\n defaultValue: () => Promise<TValue>,\n events: CacheEvents<TValue> = {\n miss: (): Promise<void> => Promise.resolve(),\n },\n ): Promise<TValue> {\n const value = defaultValue();\n\n return value.then((result) => Promise.all([result, events.miss(result)])).then(([result]) => result);\n },\n\n set<TValue>(_key: Record<string, any> | string, value: TValue): Promise<TValue> {\n return Promise.resolve(value);\n },\n\n delete(_key: Record<string, any> | string): Promise<void> {\n return Promise.resolve();\n },\n\n clear(): Promise<void> {\n return Promise.resolve();\n },\n };\n}\n","import type { FallbackableCacheOptions, Cache, CacheEvents } from '../types';\n\nimport { createNullCache } from './createNullCache';\n\nexport function createFallbackableCache(options: FallbackableCacheOptions): Cache {\n const caches = [...options.caches];\n const current = caches.shift();\n\n if (current === undefined) {\n return createNullCache();\n }\n\n return {\n get<TValue>(\n key: Record<string, any> | string,\n defaultValue: () => Promise<TValue>,\n events: CacheEvents<TValue> = {\n miss: (): Promise<void> => Promise.resolve(),\n },\n ): Promise<TValue> {\n return current.get(key, defaultValue, events).catch(() => {\n return createFallbackableCache({ caches }).get(key, defaultValue, events);\n });\n },\n\n set<TValue>(key: Record<string, any> | string, value: TValue): Promise<TValue> {\n return current.set(key, value).catch(() => {\n return createFallbackableCache({ caches }).set(key, value);\n });\n },\n\n delete(key: Record<string, any> | string): Promise<void> {\n return current.delete(key).catch(() => {\n return createFallbackableCache({ caches }).delete(key);\n });\n },\n\n clear(): Promise<void> {\n return current.clear().catch(() => {\n return createFallbackableCache({ caches }).clear();\n });\n },\n };\n}\n","import type { Cache, CacheEvents, MemoryCacheOptions } from '../types';\n\nexport function createMemoryCache(options: MemoryCacheOptions = { serializable: true }): Cache {\n let cache: Record<string, any> = {};\n\n return {\n get<TValue>(\n key: Record<string, any> | string,\n defaultValue: () => Promise<TValue>,\n events: CacheEvents<TValue> = {\n miss: (): Promise<void> => Promise.resolve(),\n },\n ): Promise<TValue> {\n const keyAsString = JSON.stringify(key);\n\n if (keyAsString in cache) {\n return Promise.resolve(options.serializable ? JSON.parse(cache[keyAsString]) : cache[keyAsString]);\n }\n\n const promise = defaultValue();\n\n return promise.then((value: TValue) => events.miss(value)).then(() => promise);\n },\n\n set<TValue>(key: Record<string, any> | string, value: TValue): Promise<TValue> {\n cache[JSON.stringify(key)] = options.serializable ? JSON.stringify(value) : value;\n\n return Promise.resolve(value);\n },\n\n delete(key: Record<string, unknown> | string): Promise<void> {\n delete cache[JSON.stringify(key)];\n\n return Promise.resolve();\n },\n\n clear(): Promise<void> {\n cache = {};\n\n return Promise.resolve();\n },\n };\n}\n","import type { Host, StatefulHost } from '../types';\n\n// By default, API Clients at Algolia have expiration delay of 5 mins.\n// In the JavaScript client, we have 2 mins.\nconst EXPIRATION_DELAY = 2 * 60 * 1000;\n\nexport function createStatefulHost(host: Host, status: StatefulHost['status'] = 'up'): StatefulHost {\n const lastUpdate = Date.now();\n\n function isUp(): boolean {\n return status === 'up' || Date.now() - lastUpdate > EXPIRATION_DELAY;\n }\n\n function isTimedOut(): boolean {\n return status === 'timed out' && Date.now() - lastUpdate <= EXPIRATION_DELAY;\n }\n\n return { ...host, status, lastUpdate, isUp, isTimedOut };\n}\n","import type { Response, StackFrame } from '../types';\n\nexport class AlgoliaError extends Error {\n name: string = 'AlgoliaError';\n\n constructor(message: string, name: string) {\n super(message);\n\n if (name) {\n this.name = name;\n }\n }\n}\n\nexport class ErrorWithStackTrace extends AlgoliaError {\n stackTrace: StackFrame[];\n\n constructor(message: string, stackTrace: StackFrame[], name: string) {\n super(message, name);\n // the array and object should be frozen to reflect the stackTrace at the time of the error\n this.stackTrace = stackTrace;\n }\n}\n\nexport class RetryError extends ErrorWithStackTrace {\n constructor(stackTrace: StackFrame[]) {\n super(\n 'Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.',\n stackTrace,\n 'RetryError',\n );\n }\n}\n\nexport class ApiError extends ErrorWithStackTrace {\n status: number;\n\n constructor(message: string, status: number, stackTrace: StackFrame[], name = 'ApiError') {\n super(message, stackTrace, name);\n this.status = status;\n }\n}\n\nexport class DeserializationError extends AlgoliaError {\n response: Response;\n\n constructor(message: string, response: Response) {\n super(message, 'DeserializationError');\n this.response = response;\n }\n}\n\nexport type DetailedErrorWithMessage = {\n message: string;\n label: string;\n};\n\nexport type DetailedErrorWithTypeID = {\n id: string;\n type: string;\n name?: string;\n};\n\nexport type DetailedError = {\n code: string;\n details?: DetailedErrorWithMessage[] | DetailedErrorWithTypeID[];\n};\n\n// DetailedApiError is only used by the ingestion client to return more informative error, other clients will use ApiClient.\nexport class DetailedApiError extends ApiError {\n error: DetailedError;\n\n constructor(message: string, status: number, error: DetailedError, stackTrace: StackFrame[]) {\n super(message, status, stackTrace, 'DetailedApiError');\n this.error = error;\n }\n}\n","import type { Headers, Host, QueryParameters, Request, RequestOptions, Response, StackFrame } from '../types';\n\nimport { ApiError, DeserializationError, DetailedApiError } from './errors';\n\nexport function shuffle<TData>(array: TData[]): TData[] {\n const shuffledArray = array;\n\n for (let c = array.length - 1; c > 0; c--) {\n const b = Math.floor(Math.random() * (c + 1));\n const a = array[c];\n\n shuffledArray[c] = array[b];\n shuffledArray[b] = a;\n }\n\n return shuffledArray;\n}\n\nexport function serializeUrl(host: Host, path: string, queryParameters: QueryParameters): string {\n const queryParametersAsString = serializeQueryParameters(queryParameters);\n let url = `${host.protocol}://${host.url}${host.port ? `:${host.port}` : ''}/${\n path.charAt(0) === '/' ? path.substring(1) : path\n }`;\n\n if (queryParametersAsString.length) {\n url += `?${queryParametersAsString}`;\n }\n\n return url;\n}\n\nexport function serializeQueryParameters(parameters: QueryParameters): string {\n return Object.keys(parameters)\n .filter((key) => parameters[key] !== undefined)\n .sort()\n .map(\n (key) =>\n `${key}=${encodeURIComponent(\n Object.prototype.toString.call(parameters[key]) === '[object Array]'\n ? parameters[key].join(',')\n : parameters[key],\n ).replaceAll('+', '%20')}`,\n )\n .join('&');\n}\n\nexport function serializeData(request: Request, requestOptions: RequestOptions): string | undefined {\n if (request.method === 'GET' || (request.data === undefined && requestOptions.data === undefined)) {\n return undefined;\n }\n\n const data = Array.isArray(request.data) ? request.data : { ...request.data, ...requestOptions.data };\n\n return JSON.stringify(data);\n}\n\nexport function serializeHeaders(\n baseHeaders: Headers,\n requestHeaders: Headers,\n requestOptionsHeaders?: Headers,\n): Headers {\n const headers: Headers = {\n Accept: 'application/json',\n ...baseHeaders,\n ...requestHeaders,\n ...requestOptionsHeaders,\n };\n const serializedHeaders: Headers = {};\n\n Object.keys(headers).forEach((header) => {\n const value = headers[header];\n serializedHeaders[header.toLowerCase()] = value;\n });\n\n return serializedHeaders;\n}\n\nexport function deserializeSuccess<TObject>(response: Response): TObject {\n try {\n return JSON.parse(response.content);\n } catch (e) {\n throw new DeserializationError((e as Error).message, response);\n }\n}\n\nexport function deserializeFailure({ content, status }: Response, stackFrame: StackFrame[]): Error {\n try {\n const parsed = JSON.parse(content);\n if ('error' in parsed) {\n return new DetailedApiError(parsed.message, status, parsed.error, stackFrame);\n }\n return new ApiError(parsed.message, status, stackFrame);\n } catch {\n // ..\n }\n return new ApiError(content, status, stackFrame);\n}\n","import type { Response } from '../types';\n\nexport function isNetworkError({ isTimedOut, status }: Omit<Response, 'content'>): boolean {\n return !isTimedOut && ~~status === 0;\n}\n\nexport function isRetryable({ isTimedOut, status }: Omit<Response, 'content'>): boolean {\n return isTimedOut || isNetworkError({ isTimedOut, status }) || (~~(status / 100) !== 2 && ~~(status / 100) !== 4);\n}\n\nexport function isSuccess({ status }: Pick<Response, 'status'>): boolean {\n return ~~(status / 100) === 2;\n}\n","import type { Headers, StackFrame } from '../types';\n\nexport function stackTraceWithoutCredentials(stackTrace: StackFrame[]): StackFrame[] {\n return stackTrace.map((stackFrame) => stackFrameWithoutCredentials(stackFrame));\n}\n\nexport function stackFrameWithoutCredentials(stackFrame: StackFrame): StackFrame {\n const modifiedHeaders: Headers = stackFrame.request.headers['x-algolia-api-key']\n ? { 'x-algolia-api-key': '*****' }\n : {};\n\n return {\n ...stackFrame,\n request: {\n ...stackFrame.request,\n headers: {\n ...stackFrame.request.headers,\n ...modifiedHeaders,\n },\n },\n };\n}\n","import type {\n EndRequest,\n Host,\n Request,\n RequestOptions,\n Response,\n StackFrame,\n TransporterOptions,\n Transporter,\n QueryParameters,\n} from '../types';\n\nimport { createStatefulHost } from './createStatefulHost';\nimport { RetryError } from './errors';\nimport { deserializeFailure, deserializeSuccess, serializeData, serializeHeaders, serializeUrl } from './helpers';\nimport { isRetryable, isSuccess } from './responses';\nimport { stackTraceWithoutCredentials, stackFrameWithoutCredentials } from './stackTrace';\n\ntype RetryableOptions = {\n hosts: Host[];\n getTimeout: (retryCount: number, timeout: number) => number;\n};\n\nexport function createTransporter({\n hosts,\n hostsCache,\n baseHeaders,\n baseQueryParameters,\n algoliaAgent,\n timeouts,\n requester,\n requestsCache,\n responsesCache,\n}: TransporterOptions): Transporter {\n async function createRetryableOptions(compatibleHosts: Host[]): Promise<RetryableOptions> {\n const statefulHosts = await Promise.all(\n compatibleHosts.map((compatibleHost) => {\n return hostsCache.get(compatibleHost, () => {\n return Promise.resolve(createStatefulHost(compatibleHost));\n });\n }),\n );\n const hostsUp = statefulHosts.filter((host) => host.isUp());\n const hostsTimedOut = statefulHosts.filter((host) => host.isTimedOut());\n\n // Note, we put the hosts that previously timed out on the end of the list.\n const hostsAvailable = [...hostsUp, ...hostsTimedOut];\n const compatibleHostsAvailable = hostsAvailable.length > 0 ? hostsAvailable : compatibleHosts;\n\n return {\n hosts: compatibleHostsAvailable,\n getTimeout(timeoutsCount: number, baseTimeout: number): number {\n /**\n * Imagine that you have 4 hosts, if timeouts will increase\n * on the following way: 1 (timed out) > 4 (timed out) > 5 (200).\n *\n * Note that, the very next request, we start from the previous timeout.\n *\n * 5 (timed out) > 6 (timed out) > 7 ...\n *\n * This strategy may need to be reviewed, but is the strategy on the our\n * current v3 version.\n */\n const timeoutMultiplier =\n hostsTimedOut.length === 0 && timeoutsCount === 0 ? 1 : hostsTimedOut.length + 3 + timeoutsCount;\n\n return timeoutMultiplier * baseTimeout;\n },\n };\n }\n\n async function retryableRequest<TResponse>(\n request: Request,\n requestOptions: RequestOptions,\n isRead = true,\n ): Promise<TResponse> {\n const stackTrace: StackFrame[] = [];\n\n /**\n * First we prepare the payload that do not depend from hosts.\n */\n const data = serializeData(request, requestOptions);\n const headers = serializeHeaders(baseHeaders, request.headers, requestOptions.headers);\n\n // On `GET`, the data is proxied to query parameters.\n const dataQueryParameters: QueryParameters =\n request.method === 'GET'\n ? {\n ...request.data,\n ...requestOptions.data,\n }\n : {};\n\n const queryParameters: QueryParameters = {\n ...baseQueryParameters,\n ...request.queryParameters,\n ...dataQueryParameters,\n };\n\n if (algoliaAgent.value) {\n queryParameters['x-algolia-agent'] = algoliaAgent.value;\n }\n\n if (requestOptions && requestOptions.queryParameters) {\n for (const key of Object.keys(requestOptions.queryParameters)) {\n // We want to keep `undefined` and `null` values,\n // but also avoid stringifying `object`s, as they are\n // handled in the `serializeUrl` step right after.\n if (\n !requestOptions.queryParameters[key] ||\n Object.prototype.toString.call(requestOptions.queryParameters[key]) === '[object Object]'\n ) {\n queryParameters[key] = requestOptions.queryParameters[key];\n } else {\n queryParameters[key] = requestOptions.queryParameters[key].toString();\n }\n }\n }\n\n let timeoutsCount = 0;\n\n const retry = async (\n retryableHosts: Host[],\n getTimeout: (timeoutsCount: number, timeout: number) => number,\n ): Promise<TResponse> => {\n /**\n * We iterate on each host, until there is no host left.\n */\n const host = retryableHosts.pop();\n if (host === undefined) {\n throw new RetryError(stackTraceWithoutCredentials(stackTrace));\n }\n\n const timeout = { ...timeouts, ...requestOptions.timeouts };\n\n const payload: EndRequest = {\n data,\n headers,\n method: request.method,\n url: serializeUrl(host, request.path, queryParameters),\n connectTimeout: getTimeout(timeoutsCount, timeout.connect),\n responseTimeout: getTimeout(timeoutsCount, isRead ? timeout.read : timeout.write),\n };\n\n /**\n * The stackFrame is pushed to the stackTrace so we\n * can have information about onRetry and onFailure\n * decisions.\n */\n const pushToStackTrace = (response: Response): StackFrame => {\n const stackFrame: StackFrame = {\n request: payload,\n response,\n host,\n triesLeft: retryableHosts.length,\n };\n\n stackTrace.push(stackFrame);\n\n return stackFrame;\n };\n\n const response = await requester.send(payload);\n\n if (isRetryable(response)) {\n const stackFrame = pushToStackTrace(response);\n\n // If response is a timeout, we increase the number of timeouts so we can increase the timeout later.\n if (response.isTimedOut) {\n timeoutsCount++;\n }\n /**\n * Failures are individually sent to the logger, allowing\n * the end user to debug / store stack frames even\n * when a retry error does not happen.\n */\n // eslint-disable-next-line no-console -- this will be fixed by exposing a `logger` to the transporter\n console.log('Retryable failure', stackFrameWithoutCredentials(stackFrame));\n\n /**\n * We also store the state of the host in failure cases. If the host, is\n * down it will remain down for the next 2 minutes. In a timeout situation,\n * this host will be added end of the list of hosts on the next request.\n */\n await hostsCache.set(host, createStatefulHost(host, response.isTimedOut ? 'timed out' : 'down'));\n\n return retry(retryableHosts, getTimeout);\n }\n\n if (isSuccess(response)) {\n return deserializeSuccess(response);\n }\n\n pushToStackTrace(response);\n throw deserializeFailure(response, stackTrace);\n };\n\n /**\n * Finally, for each retryable host perform request until we got a non\n * retryable response. Some notes here:\n *\n * 1. The reverse here is applied so we can apply a `pop` later on => more performant.\n * 2. We also get from the retryable options a timeout multiplier that is tailored\n * for the current context.\n */\n const compatibleHosts = hosts.filter(\n (host) => host.accept === 'readWrite' || (isRead ? host.accept === 'read' : host.accept === 'write'),\n );\n const options = await createRetryableOptions(compatibleHosts);\n\n return retry([...options.hosts].reverse(), options.getTimeout);\n }\n\n function createRequest<TResponse>(request: Request, requestOptions: RequestOptions = {}): Promise<TResponse> {\n /**\n * A read request is either a `GET` request, or a request that we make\n * via the `read` transporter (e.g. `search`).\n */\n const isRead = request.useReadTransporter || request.method === 'GET';\n if (!isRead) {\n /**\n * On write requests, no cache mechanisms are applied, and we\n * proxy the request immediately to the requester.\n */\n return retryableRequest<TResponse>(request, requestOptions, isRead);\n }\n\n const createRetryableRequest = (): Promise<TResponse> => {\n /**\n * Then, we prepare a function factory that contains the construction of\n * the retryable request. At this point, we may *not* perform the actual\n * request. But we want to have the function factory ready.\n */\n return retryableRequest<TResponse>(request, requestOptions);\n };\n\n /**\n * Once we have the function factory ready, we need to determine of the\n * request is \"cacheable\" - should be cached. Note that, once again,\n * the user can force this option.\n */\n const cacheable = requestOptions.cacheable || request.cacheable;\n\n /**\n * If is not \"cacheable\", we immediately trigger the retryable request, no\n * need to check cache implementations.\n */\n if (cacheable !== true) {\n return createRetryableRequest();\n }\n\n /**\n * If the request is \"cacheable\", we need to first compute the key to ask\n * the cache implementations if this request is on progress or if the\n * response already exists on the cache.\n */\n const key = {\n request,\n requestOptions,\n transporter: {\n queryParameters: baseQueryParameters,\n headers: baseHeaders,\n },\n };\n\n /**\n * With the computed key, we first ask the responses cache\n * implementation if this request was been resolved before.\n */\n return responsesCache.get(\n key,\n () => {\n /**\n * If the request has never resolved before, we actually ask if there\n * is a current request with the same key on progress.\n */\n return requestsCache.get(key, () =>\n /**\n * Finally, if there is no request in progress with the same key,\n * this `createRetryableRequest()` will actually trigger the\n * retryable request.\n */\n requestsCache\n .set(key, createRetryableRequest())\n .then(\n (response) => Promise.all([requestsCache.delete(key), response]),\n (err) => Promise.all([requestsCache.delete(key), Promise.reject(err)]),\n )\n .then(([_, response]) => response),\n );\n },\n {\n /**\n * Of course, once we get this response back from the server, we\n * tell response cache to actually store the received response\n * to be used later.\n */\n miss: (response) => responsesCache.set(key, response),\n },\n );\n }\n\n return {\n hostsCache,\n requester,\n timeouts,\n algoliaAgent,\n baseHeaders,\n baseQueryParameters,\n hosts,\n request: createRequest,\n requestsCache,\n responsesCache,\n };\n}\n","import type { AlgoliaAgentOptions, AlgoliaAgent } from './types';\n\nexport function createAlgoliaAgent(version: string): AlgoliaAgent {\n const algoliaAgent = {\n value: `Algolia for JavaScript (${version})`,\n add(options: AlgoliaAgentOptions): AlgoliaAgent {\n const addedAlgoliaAgent = `; ${options.segment}${options.version !== undefined ? ` (${options.version})` : ''}`;\n\n if (algoliaAgent.value.indexOf(addedAlgoliaAgent) === -1) {\n algoliaAgent.value = `${algoliaAgent.value}${addedAlgoliaAgent}`;\n }\n\n return algoliaAgent;\n },\n };\n\n return algoliaAgent;\n}\n","import { createAlgoliaAgent } from './createAlgoliaAgent';\nimport type { AlgoliaAgentOptions, AlgoliaAgent } from './types';\n\nexport type GetAlgoliaAgent = {\n algoliaAgents: AlgoliaAgentOptions[];\n client: string;\n version: string;\n};\n\nexport function getAlgoliaAgent({ algoliaAgents, client, version }: GetAlgoliaAgent): AlgoliaAgent {\n const defaultAlgoliaAgent = createAlgoliaAgent(version).add({\n segment: client,\n version,\n });\n\n algoliaAgents.forEach((algoliaAgent) => defaultAlgoliaAgent.add(algoliaAgent));\n\n return defaultAlgoliaAgent;\n}\n","export const DEFAULT_CONNECT_TIMEOUT_BROWSER = 1000;\nexport const DEFAULT_READ_TIMEOUT_BROWSER = 2000;\nexport const DEFAULT_WRITE_TIMEOUT_BROWSER = 30000;\n\nexport const DEFAULT_CONNECT_TIMEOUT_NODE = 2000;\nexport const DEFAULT_READ_TIMEOUT_NODE = 5000;\nexport const DEFAULT_WRITE_TIMEOUT_NODE = 30000;\n","import type { EndRequest, Requester, Response } from '@algolia/client-common';\n\ntype Timeout = ReturnType<typeof setTimeout>;\n\nexport function createXhrRequester(): Requester {\n function send(request: EndRequest): Promise<Response> {\n return new Promise((resolve) => {\n const baseRequester = new XMLHttpRequest();\n baseRequester.open(request.method, request.url, true);\n\n Object.keys(request.headers).forEach((key) => baseRequester.setRequestHeader(key, request.headers[key]));\n\n const createTimeout = (timeout: number, content: string): Timeout => {\n return setTimeout(() => {\n baseRequester.abort();\n\n resolve({\n status: 0,\n content,\n isTimedOut: true,\n });\n }, timeout);\n };\n\n const connectTimeout = createTimeout(request.connectTimeout, 'Connection timeout');\n\n let responseTimeout: Timeout | undefined;\n\n baseRequester.onreadystatechange = (): void => {\n if (baseRequester.readyState > baseRequester.OPENED && responseTimeout === undefined) {\n clearTimeout(connectTimeout);\n\n responseTimeout = createTimeout(request.responseTimeout, 'Socket timeout');\n }\n };\n\n baseRequester.onerror = (): void => {\n // istanbul ignore next\n if (baseRequester.status === 0) {\n clearTimeout(connectTimeout);\n clearTimeout(responseTimeout!);\n\n resolve({\n content: baseRequester.responseText || 'Network request failed',\n status: baseRequester.status,\n isTimedOut: false,\n });\n }\n };\n\n baseRequester.onload = (): void => {\n clearTimeout(connectTimeout);\n clearTimeout(responseTimeout!);\n\n resolve({\n content: baseRequester.responseText,\n status: baseRequester.status,\n isTimedOut: false,\n });\n };\n\n baseRequester.send(request.data);\n });\n }\n\n return { send };\n}\n","import { createEchoRequester } from '@algolia/client-common';\nimport type { Requester } from '@algolia/client-common';\n\nexport function echoRequester(status: number = 200): Requester {\n return createEchoRequester({ getURL: (url: string) => new URL(url), status });\n}\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 { ClientOptions } from '@algolia/client-common';\nimport {\n createMemoryCache,\n createFallbackableCache,\n createBrowserLocalStorageCache,\n DEFAULT_CONNECT_TIMEOUT_BROWSER,\n DEFAULT_READ_TIMEOUT_BROWSER,\n DEFAULT_WRITE_TIMEOUT_BROWSER,\n} from '@algolia/client-common';\nimport { createXhrRequester } from '@algolia/requester-browser-xhr';\n\nimport type { Region } from '../src/abtestingClient';\nimport { createAbtestingClient, apiClientVersion, REGIONS } from '../src/abtestingClient';\n\nexport { apiClientVersion, Region } from '../src/abtestingClient';\nexport * from '../model';\n\n/**\n * The client type.\n */\nexport type AbtestingClient = ReturnType<typeof abtestingClient>;\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function abtestingClient(appId: string, apiKey: string, region?: Region, options?: ClientOptions) {\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 return createAbtestingClient({\n appId,\n apiKey,\n region,\n timeouts: {\n connect: DEFAULT_CONNECT_TIMEOUT_BROWSER,\n read: DEFAULT_READ_TIMEOUT_BROWSER,\n write: DEFAULT_WRITE_TIMEOUT_BROWSER,\n },\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 ...options,\n });\n}\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 { createAuth, createTransporter, getAlgoliaAgent } from '@algolia/client-common';\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} 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 {\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteABTestProps,\n GetABTestProps,\n ListABTestsProps,\n StopABTestProps,\n} from '../model/clientMethodProps';\nimport type { ListABTestsResponse } from '../model/listABTestsResponse';\nimport type { ScheduleABTestResponse } from '../model/scheduleABTestResponse';\nimport type { ScheduleABTestsRequest } from '../model/scheduleABTestsRequest';\n\nexport const apiClientVersion = '5.2.5';\n\nexport const REGIONS = ['de', 'us'] as const;\nexport type Region = (typeof REGIONS)[number];\n\nfunction getDefaultHosts(region?: Region): 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\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function createAbtestingClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n region: regionOption,\n ...options\n}: CreateClientOptions & { region?: Region }) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(regionOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Abtesting',\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 * 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): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * Creates a new A/B test.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\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 if (!addABTestsRequest) {\n throw new Error('Parameter `addABTestsRequest` is required when calling `addABTests`.');\n }\n\n if (!addABTestsRequest.name) {\n throw new Error('Parameter `addABTestsRequest.name` is required when calling `addABTests`.');\n }\n if (!addABTestsRequest.variants) {\n throw new Error('Parameter `addABTestsRequest.variants` is required when calling `addABTests`.');\n }\n if (!addABTestsRequest.endAt) {\n throw new Error('Parameter `addABTestsRequest.endAt` is required when calling `addABTests`.');\n }\n\n const requestPath = '/2/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 allow you to send requests to the Algolia REST API.\n *\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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 if (!path) {\n throw new Error('Parameter `path` is required when calling `customDelete`.');\n }\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 allow you to send requests to the Algolia REST API.\n *\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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 if (!path) {\n throw new Error('Parameter `path` is required when calling `customGet`.');\n }\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 allow you to send requests to the Algolia REST API.\n *\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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 if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\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 allow you to send requests to the Algolia REST API.\n *\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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 if (!path) {\n throw new Error('Parameter `path` is required when calling `customPut`.');\n }\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 *\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 if (!id) {\n throw new Error('Parameter `id` is required when calling `deleteABTest`.');\n }\n\n const requestPath = '/2/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 * Retrieves the details for an A/B test by its ID.\n *\n * Required API Key ACLs:\n * - analytics.\n *\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 if (!id) {\n throw new Error('Parameter `id` is required when calling `getABTest`.');\n }\n\n const requestPath = '/2/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 * Lists all A/B tests you configured for this application.\n *\n * Required API Key ACLs:\n * - analytics.\n *\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 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 }: ListABTestsProps = {},\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise<ListABTestsResponse> {\n const requestPath = '/2/abtests';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (offset !== undefined) {\n queryParameters.offset = offset.toString();\n }\n if (limit !== undefined) {\n queryParameters.limit = limit.toString();\n }\n\n if (indexPrefix !== undefined) {\n queryParameters.indexPrefix = indexPrefix.toString();\n }\n if (indexSuffix !== undefined) {\n queryParameters.indexSuffix = indexSuffix.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 * Schedule an A/B test to be started at a later time.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param scheduleABTestsRequest - The scheduleABTestsRequest object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n scheduleABTest(\n scheduleABTestsRequest: ScheduleABTestsRequest,\n requestOptions?: RequestOptions,\n ): Promise<ScheduleABTestResponse> {\n if (!scheduleABTestsRequest) {\n throw new Error('Parameter `scheduleABTestsRequest` is required when calling `scheduleABTest`.');\n }\n\n if (!scheduleABTestsRequest.name) {\n throw new Error('Parameter `scheduleABTestsRequest.name` is required when calling `scheduleABTest`.');\n }\n if (!scheduleABTestsRequest.variants) {\n throw new Error('Parameter `scheduleABTestsRequest.variants` is required when calling `scheduleABTest`.');\n }\n if (!scheduleABTestsRequest.scheduledAt) {\n throw new Error('Parameter `scheduleABTestsRequest.scheduledAt` is required when calling `scheduleABTest`.');\n }\n if (!scheduleABTestsRequest.endAt) {\n throw new Error('Parameter `scheduleABTestsRequest.endAt` is required when calling `scheduleABTest`.');\n }\n\n const requestPath = '/2/abtests/schedule';\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: scheduleABTestsRequest,\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 *\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 if (!id) {\n throw new Error('Parameter `id` is required when calling `stopABTest`.');\n }\n\n const requestPath = '/2/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","// 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 { ClientOptions } from '@algolia/client-common';\nimport {\n createMemoryCache,\n createFallbackableCache,\n createBrowserLocalStorageCache,\n DEFAULT_CONNECT_TIMEOUT_BROWSER,\n DEFAULT_READ_TIMEOUT_BROWSER,\n DEFAULT_WRITE_TIMEOUT_BROWSER,\n} from '@algolia/client-common';\nimport { createXhrRequester } from '@algolia/requester-browser-xhr';\n\nimport type { Region } from '../src/analyticsClient';\nimport { createAnalyticsClient, apiClientVersion, REGIONS } from '../src/analyticsClient';\n\nexport { apiClientVersion, Region } from '../src/analyticsClient';\nexport * from '../model';\n\n/**\n * The client type.\n */\nexport type AnalyticsClient = ReturnType<typeof analyticsClient>;\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function analyticsClient(appId: string, apiKey: string, region?: Region, options?: ClientOptions) {\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 return createAnalyticsClient({\n appId,\n apiKey,\n region,\n timeouts: {\n connect: DEFAULT_CONNECT_TIMEOUT_BROWSER,\n read: DEFAULT_READ_TIMEOUT_BROWSER,\n write: DEFAULT_WRITE_TIMEOUT_BROWSER,\n },\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 ...options,\n });\n}\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 { createAuth, createTransporter, getAlgoliaAgent } from '@algolia/client-common';\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\n\nimport type {\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n GetAddToCartRateProps,\n GetAverageClickPositionProps,\n GetClickPositionsProps,\n GetClickThroughRateProps,\n GetConversionRateProps,\n GetNoClickRateProps,\n GetNoResultsRateProps,\n GetPurchaseRateProps,\n GetRevenueProps,\n GetSearchesCountProps,\n GetSearchesNoClicksProps,\n GetSearchesNoResultsProps,\n GetStatusProps,\n GetTopCountriesProps,\n GetTopFilterAttributesProps,\n GetTopFilterForAttributeProps,\n GetTopFiltersNoResultsProps,\n GetTopHitsProps,\n GetTopSearchesProps,\n GetUsersCountProps,\n} from '../model/clientMethodProps';\nimport type { GetAddToCartRateResponse } from '../model/getAddToCartRateResponse';\nimport type { GetAverageClickPositionResponse } from '../model/getAverageClickPositionResponse';\nimport type { GetClickPositionsResponse } from '../model/getClickPositionsResponse';\nimport type { GetClickThroughRateResponse } from '../model/getClickThroughRateResponse';\nimport type { GetConversionRateResponse } from '../model/getConversionRateResponse';\nimport type { GetNoClickRateResponse } from '../model/getNoClickRateResponse';\nimport type { GetNoResultsRateResponse } from '../model/getNoResultsRateResponse';\nimport type { GetPurchaseRateResponse } from '../model/getPurchaseRateResponse';\nimport type { GetRevenue } from '../model/getRevenue';\nimport type { GetSearchesCountResponse } from '../model/getSearchesCountResponse';\nimport type { GetSearchesNoClicksResponse } from '../model/getSearchesNoClicksResponse';\nimport type { GetSearchesNoResultsResponse } from '../model/getSearchesNoResultsResponse';\nimport type { GetStatusResponse } from '../model/getStatusResponse';\nimport type { GetTopCountriesResponse } from '../model/getTopCountriesResponse';\nimport type { GetTopFilterAttributesResponse } from '../model/getTopFilterAttributesResponse';\nimport type { GetTopFilterForAttributeResponse } from '../model/getTopFilterForAttributeResponse';\nimport type { GetTopFiltersNoResultsResponse } from '../model/getTopFiltersNoResultsResponse';\nimport type { GetTopHitsResponse } from '../model/getTopHitsResponse';\nimport type { GetTopSearchesResponse } from '../model/getTopSearchesResponse';\nimport type { GetUsersCountResponse } from '../model/getUsersCountResponse';\n\nexport const apiClientVersion = '5.2.5';\n\nexport const REGIONS = ['de', 'us'] as const;\nexport type Region = (typeof REGIONS)[number];\n\nfunction getDefaultHosts(region?: Region): 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\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function createAnalyticsClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n region: regionOption,\n ...options\n}: CreateClientOptions & { region?: Region }) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(regionOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Analytics',\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 * 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): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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 if (!path) {\n throw new Error('Parameter `path` is required when calling `customDelete`.');\n }\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 allow you to send requests to the Algolia REST API.\n *\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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 if (!path) {\n throw new Error('Parameter `path` is required when calling `customGet`.');\n }\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 allow you to send requests to the Algolia REST API.\n *\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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 if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\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 allow you to send requests to the Algolia REST API.\n *\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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 if (!path) {\n throw new Error('Parameter `path` is required when calling `customPut`.');\n }\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 * Retrieves the add-to-cart rate for all of your searches with at least one add-to-cart event, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getAddToCartRate - The getAddToCartRate object.\n * @param getAddToCartRate.index - Index name.\n * @param getAddToCartRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getAddToCartRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getAddToCartRate.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getAddToCartRate(\n { index, startDate, endDate, tags }: GetAddToCartRateProps,\n requestOptions?: RequestOptions,\n ): Promise<GetAddToCartRateResponse> {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getAddToCartRate`.');\n }\n\n const requestPath = '/2/conversions/addToCartRate';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.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 * Retrieves the average click position of your search results, including a daily breakdown. The average click position is the average of all clicked search results\\' positions. For example, if users only ever click on the first result for any search, the average click position is 1. By default, the analyzed period includes the last eight days including the current day.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getAverageClickPosition - The getAverageClickPosition object.\n * @param getAverageClickPosition.index - Index name.\n * @param getAverageClickPosition.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getAverageClickPosition.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getAverageClickPosition.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getAverageClickPosition(\n { index, startDate, endDate, tags }: GetAverageClickPositionProps,\n requestOptions?: RequestOptions,\n ): Promise<GetAverageClickPositionResponse> {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getAverageClickPosition`.');\n }\n\n const requestPath = '/2/clicks/averageClickPosition';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.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 * Retrieves the positions in the search results and their associated number of clicks. This lets you check how many clicks the first, second, or tenth search results receive.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getClickPositions - The getClickPositions object.\n * @param getClickPositions.index - Index name.\n * @param getClickPositions.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getClickPositions.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getClickPositions.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getClickPositions(\n { index, startDate, endDate, tags }: GetClickPositionsProps,\n requestOptions?: RequestOptions,\n ): Promise<GetClickPositionsResponse> {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getClickPositions`.');\n }\n\n const requestPath = '/2/clicks/positions';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.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 * Retrieves the click-through rate for all of your searches with at least one click event, including a daily breakdown By default, the analyzed period includes the last eight days including the current day.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getClickThroughRate - The getClickThroughRate object.\n * @param getClickThroughRate.index - Index name.\n * @param getClickThroughRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getClickThroughRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getClickThroughRate.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getClickThroughRate(\n { index, startDate, endDate, tags }: GetClickThroughRateProps,\n requestOptions?: RequestOptions,\n ): Promise<GetClickThroughRateResponse> {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getClickThroughRate`.');\n }\n\n const requestPath = '/2/clicks/clickThroughRate';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.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 * Retrieves the conversion rate for all of your searches with at least one conversion event, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getConversionRate - The getConversionRate object.\n * @param getConversionRate.index - Index name.\n * @param getConversionRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getConversionRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getConversionRate.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getConversionRate(\n { index, startDate, endDate, tags }: GetConversionRateProps,\n requestOptions?: RequestOptions,\n ): Promise<GetConversionRateResponse> {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getConversionRate`.');\n }\n\n const requestPath = '/2/conversions/conversionRate';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.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 * Retrieves the fraction of searches that didn\\'t lead to any click within a time range, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getNoClickRate - The getNoClickRate object.\n * @param getNoClickRate.index - Index name.\n * @param getNoClickRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getNoClickRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getNoClickRate.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getNoClickRate(\n { index, startDate, endDate, tags }: GetNoClickRateProps,\n requestOptions?: RequestOptions,\n ): Promise<GetNoClickRateResponse> {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getNoClickRate`.');\n }\n\n const requestPath = '/2/searches/noClickRate';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.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 * Retrieves the fraction of searches that didn\\'t return any results within a time range, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getNoResultsRate - The getNoResultsRate object.\n * @param getNoResultsRate.index - Index name.\n * @param getNoResultsRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getNoResultsRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getNoResultsRate.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getNoResultsRate(\n { index, startDate, endDate, tags }: GetNoResultsRateProps,\n requestOptions?: RequestOptions,\n ): Promise<GetNoResultsRateResponse> {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getNoResultsRate`.');\n }\n\n const requestPath = '/2/searches/noResultRate';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n\n if (tags !== undefined) {\n queryParameters.tags = tags.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 * Retrieves the purchase rate for all of your searches with at least one purchase event, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getPurchaseRate - The getPurchaseRate object.\n * @param getPurchaseRate.index - Index name.\n * @param getPurchaseRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getPurchaseRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getPurchaseRate.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getPurchaseRate(\n { index, startDate, endDate, tags }: GetPurchaseRateProps,\n requestOptions?: RequestOptions,\n ): Promise<GetPurchaseRateResponse> {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getPurchaseRate`.');\n }\n\n const requestPath = '/2/conversions/purchaseRate';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.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 * Retrieves revenue-related metrics, such as the total revenue or the average order value. To retrieve revenue-related metrics, sent purchase events. By default, the analyzed period includes the last eight days including the current day.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getRevenue - The getRevenue object.\n * @param getRevenue.index - Index name.\n * @param getRevenue.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getRevenue.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getRevenue.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRevenue(\n { index, startDate, endDate, tags }: GetRevenueProps,\n requestOptions?: RequestOptions,\n ): Promise<GetRevenue> {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getRevenue`.');\n }\n\n const requestPath = '/2/conversions/revenue';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.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 * Retrieves the number of searches within a time range, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getSearchesCount - The getSearchesCount object.\n * @param getSearchesCount.index - Index name.\n * @param getSearchesCount.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getSearchesCount.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getSearchesCount.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getSearchesCount(\n { index, startDate, endDate, tags }: GetSearchesCountProps,\n requestOptions?: RequestOptions,\n ): Promise<GetSearchesCountResponse> {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getSearchesCount`.');\n }\n\n const requestPath = '/2/searches/count';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.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 * Retrieves the most popular searches that didn\\'t lead to any clicks, from the 1,000 most frequent searches.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getSearchesNoClicks - The getSearchesNoClicks object.\n * @param getSearchesNoClicks.index - Index name.\n * @param getSearchesNoClicks.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getSearchesNoClicks.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getSearchesNoClicks.limit - Number of items to return.\n * @param getSearchesNoClicks.offset - Position of the first item to return.\n * @param getSearchesNoClicks.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getSearchesNoClicks(\n { index, startDate, endDate, limit, offset, tags }: GetSearchesNoClicksProps,\n requestOptions?: RequestOptions,\n ): Promise<GetSearchesNoClicksResponse> {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getSearchesNoClicks`.');\n }\n\n const requestPath = '/2/searches/noClicks';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (limit !== undefined) {\n queryParameters.limit = limit.toString();\n }\n\n if (offset !== undefined) {\n queryParameters.offset = offset.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.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 * Retrieves the most popular searches that didn\\'t return any results.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getSearchesNoResults - The getSearchesNoResults object.\n * @param getSearchesNoResults.index - Index name.\n * @param getSearchesNoResults.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getSearchesNoResults.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getSearchesNoResults.limit - Number of items to return.\n * @param getSearchesNoResults.offset - Position of the first item to return.\n * @param getSearchesNoResults.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getSearchesNoResults(\n { index, startDate, endDate, limit, offset, tags }: GetSearchesNoResultsProps,\n requestOptions?: RequestOptions,\n ): Promise<GetSearchesNoResultsResponse> {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getSearchesNoResults`.');\n }\n\n const requestPath = '/2/searches/noResults';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (limit !== undefined) {\n queryParameters.limit = limit.toString();\n }\n\n if (offset !== undefined) {\n queryParameters.offset = offset.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.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 * Retrieves the time when the Analytics data for the specified index was last updated. The Analytics data is updated every 5 minutes.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getStatus - The getStatus object.\n * @param getStatus.index - Index name.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getStatus({ index }: GetStatusProps, requestOptions?: RequestOptions): Promise<GetStatusResponse> {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getStatus`.');\n }\n\n const requestPath = '/2/status';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.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 * Retrieves the countries with the most searches to your index.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getTopCountries - The getTopCountries object.\n * @param getTopCountries.index - Index name.\n * @param getTopCountries.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getTopCountries.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getTopCountries.limit - Number of items to return.\n * @param getTopCountries.offset - Position of the first item to return.\n * @param getTopCountries.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getTopCountries(\n { index, startDate, endDate, limit, offset, tags }: GetTopCountriesProps,\n requestOptions?: RequestOptions,\n ): Promise<GetTopCountriesResponse> {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getTopCountries`.');\n }\n\n const requestPath = '/2/countries';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (limit !== undefined) {\n queryParameters.limit = limit.toString();\n }\n\n if (offset !== undefined) {\n queryParameters.offset = offset.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.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 * Retrieves the most frequently used filter attributes. These are attributes of your records that you included in the `attributesForFaceting` setting.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getTopFilterAttributes - The getTopFilterAttributes object.\n * @param getTopFilterAttributes.index - Index name.\n * @param getTopFilterAttributes.search - Search query.\n * @param getTopFilterAttributes.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getTopFilterAttributes.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getTopFilterAttributes.limit - Number of items to return.\n * @param getTopFilterAttributes.offset - Position of the first item to return.\n * @param getTopFilterAttributes.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getTopFilterAttributes(\n { index, search, startDate, endDate, limit, offset, tags }: GetTopFilterAttributesProps,\n requestOptions?: RequestOptions,\n ): Promise<GetTopFilterAttributesResponse> {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getTopFilterAttributes`.');\n }\n\n const requestPath = '/2/filters';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n if (search !== undefined) {\n queryParameters.search = search.toString();\n }\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (limit !== undefined) {\n queryParameters.limit = limit.toString();\n }\n\n if (offset !== undefined) {\n queryParameters.offset = offset.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.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 * Retrieves the most frequent filter (facet) values for a filter attribute. These are attributes of your records that you included in the `attributesForFaceting` setting.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getTopFilterForAttribute - The getTopFilterForAttribute object.\n * @param getTopFilterForAttribute.attribute - Attribute name.\n * @param getTopFilterForAttribute.index - Index name.\n * @param getTopFilterForAttribute.search - Search query.\n * @param getTopFilterForAttribute.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getTopFilterForAttribute.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getTopFilterForAttribute.limit - Number of items to return.\n * @param getTopFilterForAttribute.offset - Position of the first item to return.\n * @param getTopFilterForAttribute.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getTopFilterForAttribute(\n { attribute, index, search, startDate, endDate, limit, offset, tags }: GetTopFilterForAttributeProps,\n requestOptions?: RequestOptions,\n ): Promise<GetTopFilterForAttributeResponse> {\n if (!attribute) {\n throw new Error('Parameter `attribute` is required when calling `getTopFilterForAttribute`.');\n }\n\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getTopFilterForAttribute`.');\n }\n\n const requestPath = '/2/filters/{attribute}'.replace('{attribute}', encodeURIComponent(attribute));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n if (search !== undefined) {\n queryParameters.search = search.toString();\n }\n\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (limit !== undefined) {\n queryParameters.limit = limit.toString();\n }\n if (offset !== undefined) {\n queryParameters.offset = offset.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.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 * Retrieves the most frequently used filters for a search that didn\\'t return any results. To get the most frequent searches without results, use the [Retrieve searches without results](#tag/search/operation/getSearchesNoResults) operation.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getTopFiltersNoResults - The getTopFiltersNoResults object.\n * @param getTopFiltersNoResults.index - Index name.\n * @param getTopFiltersNoResults.search - Search query.\n * @param getTopFiltersNoResults.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getTopFiltersNoResults.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getTopFiltersNoResults.limit - Number of items to return.\n * @param getTopFiltersNoResults.offset - Position of the first item to return.\n * @param getTopFiltersNoResults.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getTopFiltersNoResults(\n { index, search, startDate, endDate, limit, offset, tags }: GetTopFiltersNoResultsProps,\n requestOptions?: RequestOptions,\n ): Promise<GetTopFiltersNoResultsResponse> {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getTopFiltersNoResults`.');\n }\n\n const requestPath = '/2/filters/noResults';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n\n if (search !== undefined) {\n queryParameters.search = search.toString();\n }\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (limit !== undefined) {\n queryParameters.limit = limit.toString();\n }\n if (offset !== undefined) {\n queryParameters.offset = offset.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.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 * Retrieves the object IDs of the most frequent search results.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getTopHits - The getTopHits object.\n * @param getTopHits.index - Index name.\n * @param getTopHits.search - Search query.\n * @param getTopHits.clickAnalytics - Whether to include metrics related to click and conversion events in the response.\n * @param getTopHits.revenueAnalytics - Whether to include revenue-related metrics in the response. If true, metrics related to click and conversion events are also included in the response.\n * @param getTopHits.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getTopHits.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getTopHits.limit - Number of items to return.\n * @param getTopHits.offset - Position of the first item to return.\n * @param getTopHits.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getTopHits(\n { index, search, clickAnalytics, revenueAnalytics, startDate, endDate, limit, offset, tags }: GetTopHitsProps,\n requestOptions?: RequestOptions,\n ): Promise<GetTopHitsResponse> {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getTopHits`.');\n }\n\n const requestPath = '/2/hits';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n if (search !== undefined) {\n queryParameters.search = search.toString();\n }\n\n if (clickAnalytics !== undefined) {\n queryParameters.clickAnalytics = clickAnalytics.toString();\n }\n if (revenueAnalytics !== undefined) {\n queryParameters.revenueAnalytics = revenueAnalytics.toString();\n }\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n\n if (limit !== undefined) {\n queryParameters.limit = limit.toString();\n }\n if (offset !== undefined) {\n queryParameters.offset = offset.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.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 * Returns the most popular search terms.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getTopSearches - The getTopSearches object.\n * @param getTopSearches.index - Index name.\n * @param getTopSearches.clickAnalytics - Whether to include metrics related to click and conversion events in the response.\n * @param getTopSearches.revenueAnalytics - Whether to include revenue-related metrics in the response. If true, metrics related to click and conversion events are also included in the response.\n * @param getTopSearches.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getTopSearches.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getTopSearches.orderBy - Attribute by which to order the response items. If the `clickAnalytics` parameter is false, only `searchCount` is available.\n * @param getTopSearches.direction - Sorting direction of the results: ascending or descending.\n * @param getTopSearches.limit - Number of items to return.\n * @param getTopSearches.offset - Position of the first item to return.\n * @param getTopSearches.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getTopSearches(\n {\n index,\n clickAnalytics,\n revenueAnalytics,\n startDate,\n endDate,\n orderBy,\n direction,\n limit,\n offset,\n tags,\n }: GetTopSearchesProps,\n requestOptions?: RequestOptions,\n ): Promise<GetTopSearchesResponse> {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getTopSearches`.');\n }\n\n const requestPath = '/2/searches';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n\n if (clickAnalytics !== undefined) {\n queryParameters.clickAnalytics = clickAnalytics.toString();\n }\n if (revenueAnalytics !== undefined) {\n queryParameters.revenueAnalytics = revenueAnalytics.toString();\n }\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (orderBy !== undefined) {\n queryParameters.orderBy = orderBy.toString();\n }\n if (direction !== undefined) {\n queryParameters.direction = direction.toString();\n }\n if (limit !== undefined) {\n queryParameters.limit = limit.toString();\n }\n if (offset !== undefined) {\n queryParameters.offset = offset.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.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 * Retrieves the number of unique users within a time range, including a daily breakdown. Since this endpoint returns the number of unique users, the sum of the daily values might be different from the total number. By default, Algolia distinguishes search users by their IP address, _unless_ you include a pseudonymous user identifier in your search requests with the `userToken` API parameter or `x-algolia-usertoken` request header. By default, the analyzed period includes the last eight days including the current day.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getUsersCount - The getUsersCount object.\n * @param getUsersCount.index - Index name.\n * @param getUsersCount.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getUsersCount.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.\n * @param getUsersCount.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getUsersCount(\n { index, startDate, endDate, tags }: GetUsersCountProps,\n requestOptions?: RequestOptions,\n ): Promise<GetUsersCountResponse> {\n if (!index) {\n throw new Error('Parameter `index` is required when calling `getUsersCount`.');\n }\n\n const requestPath = '/2/users/count';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n if (index !== undefined) {\n queryParameters.index = index.toString();\n }\n\n if (startDate !== undefined) {\n queryParameters.startDate = startDate.toString();\n }\n\n if (endDate !== undefined) {\n queryParameters.endDate = endDate.toString();\n }\n if (tags !== undefined) {\n queryParameters.tags = tags.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","// 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 { ClientOptions } from '@algolia/client-common';\nimport {\n createMemoryCache,\n createFallbackableCache,\n createBrowserLocalStorageCache,\n DEFAULT_CONNECT_TIMEOUT_BROWSER,\n DEFAULT_READ_TIMEOUT_BROWSER,\n DEFAULT_WRITE_TIMEOUT_BROWSER,\n} from '@algolia/client-common';\nimport { createXhrRequester } from '@algolia/requester-browser-xhr';\n\nimport type { Region } from '../src/personalizationClient';\nimport { createPersonalizationClient, apiClientVersion, REGIONS } from '../src/personalizationClient';\n\nexport { apiClientVersion, Region } from '../src/personalizationClient';\nexport * from '../model';\n\n/**\n * The client type.\n */\nexport type PersonalizationClient = ReturnType<typeof personalizationClient>;\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function personalizationClient(appId: string, apiKey: string, region: Region, options?: ClientOptions) {\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 || (region && (typeof region !== 'string' || !REGIONS.includes(region)))) {\n throw new Error(`\\`region\\` is required and must be one of the following: ${REGIONS.join(', ')}`);\n }\n\n return createPersonalizationClient({\n appId,\n apiKey,\n region,\n timeouts: {\n connect: DEFAULT_CONNECT_TIMEOUT_BROWSER,\n read: DEFAULT_READ_TIMEOUT_BROWSER,\n write: DEFAULT_WRITE_TIMEOUT_BROWSER,\n },\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 ...options,\n });\n}\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 { createAuth, createTransporter, getAlgoliaAgent } from '@algolia/client-common';\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\n\nimport type {\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteUserProfileProps,\n GetUserTokenProfileProps,\n} from '../model/clientMethodProps';\nimport type { DeleteUserProfileResponse } from '../model/deleteUserProfileResponse';\nimport type { GetUserTokenResponse } from '../model/getUserTokenResponse';\nimport type { PersonalizationStrategyParams } from '../model/personalizationStrategyParams';\nimport type { SetPersonalizationStrategyResponse } from '../model/setPersonalizationStrategyResponse';\n\nexport const apiClientVersion = '5.2.5';\n\nexport const REGIONS = ['eu', 'us'] as const;\nexport type Region = (typeof REGIONS)[number];\n\nfunction getDefaultHosts(region: Region): Host[] {\n const url = 'personalization.{region}.algolia.com'.replace('{region}', region);\n\n return [{ url, accept: 'readWrite', protocol: 'https' }];\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function createPersonalizationClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n region: regionOption,\n ...options\n}: CreateClientOptions & { region: Region }) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(regionOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Personalization',\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 * 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): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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 if (!path) {\n throw new Error('Parameter `path` is required when calling `customDelete`.');\n }\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 allow you to send requests to the Algolia REST API.\n *\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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 if (!path) {\n throw new Error('Parameter `path` is required when calling `customGet`.');\n }\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 allow you to send requests to the Algolia REST API.\n *\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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 if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\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 allow you to send requests to the Algolia REST API.\n *\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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 if (!path) {\n throw new Error('Parameter `path` is required when calling `customPut`.');\n }\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 a user profile. The response includes a date and time when the user profile can safely be considered deleted.\n *\n * Required API Key ACLs:\n * - recommendation.\n *\n * @param deleteUserProfile - The deleteUserProfile object.\n * @param deleteUserProfile.userToken - Unique identifier representing a user for which to fetch the personalization profile.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteUserProfile(\n { userToken }: DeleteUserProfileProps,\n requestOptions?: RequestOptions,\n ): Promise<DeleteUserProfileResponse> {\n if (!userToken) {\n throw new Error('Parameter `userToken` is required when calling `deleteUserProfile`.');\n }\n\n const requestPath = '/1/profiles/{userToken}'.replace('{userToken}', encodeURIComponent(userToken));\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 * Retrieves the current personalization strategy.\n *\n * Required API Key ACLs:\n * - recommendation.\n *\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getPersonalizationStrategy(requestOptions?: RequestOptions): Promise<PersonalizationStrategyParams> {\n const requestPath = '/1/strategies/personalization';\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 a user profile and their affinities for different facets.\n *\n * Required API Key ACLs:\n * - recommendation.\n *\n * @param getUserTokenProfile - The getUserTokenProfile object.\n * @param getUserTokenProfile.userToken - Unique identifier representing a user for which to fetch the personalization profile.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getUserTokenProfile(\n { userToken }: GetUserTokenProfileProps,\n requestOptions?: RequestOptions,\n ): Promise<GetUserTokenResponse> {\n if (!userToken) {\n throw new Error('Parameter `userToken` is required when calling `getUserTokenProfile`.');\n }\n\n const requestPath = '/1/profiles/personalization/{userToken}'.replace(\n '{userToken}',\n encodeURIComponent(userToken),\n );\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 * Creates a new personalization strategy.\n *\n * Required API Key ACLs:\n * - recommendation.\n *\n * @param personalizationStrategyParams - The personalizationStrategyParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n setPersonalizationStrategy(\n personalizationStrategyParams: PersonalizationStrategyParams,\n requestOptions?: RequestOptions,\n ): Promise<SetPersonalizationStrategyResponse> {\n if (!personalizationStrategyParams) {\n throw new Error(\n 'Parameter `personalizationStrategyParams` is required when calling `setPersonalizationStrategy`.',\n );\n }\n\n if (!personalizationStrategyParams.eventScoring) {\n throw new Error(\n 'Parameter `personalizationStrategyParams.eventScoring` is required when calling `setPersonalizationStrategy`.',\n );\n }\n if (!personalizationStrategyParams.facetScoring) {\n throw new Error(\n 'Parameter `personalizationStrategyParams.facetScoring` is required when calling `setPersonalizationStrategy`.',\n );\n }\n if (!personalizationStrategyParams.personalizationImpact) {\n throw new Error(\n 'Parameter `personalizationStrategyParams.personalizationImpact` is required when calling `setPersonalizationStrategy`.',\n );\n }\n\n const requestPath = '/1/strategies/personalization';\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: personalizationStrategyParams,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\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 { ClientOptions } from '@algolia/client-common';\nimport {\n createMemoryCache,\n createFallbackableCache,\n createBrowserLocalStorageCache,\n DEFAULT_CONNECT_TIMEOUT_BROWSER,\n DEFAULT_READ_TIMEOUT_BROWSER,\n DEFAULT_WRITE_TIMEOUT_BROWSER,\n} from '@algolia/client-common';\nimport { createXhrRequester } from '@algolia/requester-browser-xhr';\n\nimport { createSearchClient, apiClientVersion } from '../src/searchClient';\n\nexport { apiClientVersion } from '../src/searchClient';\nexport * from '../model';\n\n/**\n * The client type.\n */\nexport type SearchClient = ReturnType<typeof searchClient>;\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function searchClient(appId: string, apiKey: string, options?: ClientOptions) {\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 return createSearchClient({\n appId,\n apiKey,\n timeouts: {\n connect: DEFAULT_CONNECT_TIMEOUT_BROWSER,\n read: DEFAULT_READ_TIMEOUT_BROWSER,\n write: DEFAULT_WRITE_TIMEOUT_BROWSER,\n },\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 ...options,\n });\n}\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 { createAuth, createTransporter, getAlgoliaAgent, shuffle, createIterablePromise } from '@algolia/client-common';\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n ApiError,\n IterableOptions,\n} from '@algolia/client-common';\n\nimport type { AddApiKeyResponse } from '../model/addApiKeyResponse';\nimport type { ApiKey } from '../model/apiKey';\nimport type { BatchParams } from '../model/batchParams';\nimport type { BatchRequest } from '../model/batchRequest';\nimport type { BatchResponse } from '../model/batchResponse';\nimport type { BrowseResponse } from '../model/browseResponse';\nimport type {\n BrowseOptions,\n ChunkedBatchOptions,\n DeleteObjectsOptions,\n PartialUpdateObjectsOptions,\n ReplaceAllObjectsOptions,\n SaveObjectsOptions,\n WaitForApiKeyOptions,\n WaitForAppTaskOptions,\n WaitForTaskOptions,\n AddOrUpdateObjectProps,\n AssignUserIdProps,\n BatchProps,\n BatchAssignUserIdsProps,\n BatchDictionaryEntriesProps,\n BrowseProps,\n ClearObjectsProps,\n ClearRulesProps,\n ClearSynonymsProps,\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteApiKeyProps,\n DeleteByProps,\n DeleteIndexProps,\n DeleteObjectProps,\n DeleteRuleProps,\n DeleteSourceProps,\n DeleteSynonymProps,\n GetApiKeyProps,\n GetAppTaskProps,\n GetLogsProps,\n GetObjectProps,\n GetRuleProps,\n GetSettingsProps,\n GetSynonymProps,\n GetTaskProps,\n GetUserIdProps,\n HasPendingMappingsProps,\n ListIndicesProps,\n ListUserIdsProps,\n OperationIndexProps,\n PartialUpdateObjectProps,\n RemoveUserIdProps,\n ReplaceSourcesProps,\n RestoreApiKeyProps,\n SaveObjectProps,\n SaveRuleProps,\n SaveRulesProps,\n SaveSynonymProps,\n SaveSynonymsProps,\n LegacySearchMethodProps,\n SearchDictionaryEntriesProps,\n SearchForFacetValuesProps,\n SearchRulesProps,\n SearchSingleIndexProps,\n SearchSynonymsProps,\n SetSettingsProps,\n UpdateApiKeyProps,\n} from '../model/clientMethodProps';\nimport type { CreatedAtResponse } from '../model/createdAtResponse';\nimport type { DeleteApiKeyResponse } from '../model/deleteApiKeyResponse';\nimport type { DeleteSourceResponse } from '../model/deleteSourceResponse';\nimport type { DeletedAtResponse } from '../model/deletedAtResponse';\nimport type { DictionarySettingsParams } from '../model/dictionarySettingsParams';\nimport type { GetApiKeyResponse } from '../model/getApiKeyResponse';\nimport type { GetDictionarySettingsResponse } from '../model/getDictionarySettingsResponse';\nimport type { GetLogsResponse } from '../model/getLogsResponse';\nimport type { GetObjectsParams } from '../model/getObjectsParams';\nimport type { GetObjectsResponse } from '../model/getObjectsResponse';\nimport type { GetTaskResponse } from '../model/getTaskResponse';\nimport type { GetTopUserIdsResponse } from '../model/getTopUserIdsResponse';\nimport type { HasPendingMappingsResponse } from '../model/hasPendingMappingsResponse';\nimport type { Languages } from '../model/languages';\nimport type { ListApiKeysResponse } from '../model/listApiKeysResponse';\nimport type { ListClustersResponse } from '../model/listClustersResponse';\nimport type { ListIndicesResponse } from '../model/listIndicesResponse';\nimport type { ListUserIdsResponse } from '../model/listUserIdsResponse';\nimport type { MultipleBatchResponse } from '../model/multipleBatchResponse';\nimport type { RemoveUserIdResponse } from '../model/removeUserIdResponse';\nimport type { ReplaceAllObjectsResponse } from '../model/replaceAllObjectsResponse';\nimport type { ReplaceSourceResponse } from '../model/replaceSourceResponse';\nimport type { Rule } from '../model/rule';\nimport type { SaveObjectResponse } from '../model/saveObjectResponse';\nimport type { SaveSynonymResponse } from '../model/saveSynonymResponse';\nimport type { SearchDictionaryEntriesResponse } from '../model/searchDictionaryEntriesResponse';\nimport type { SearchForFacetValuesResponse } from '../model/searchForFacetValuesResponse';\nimport type { SearchMethodParams } from '../model/searchMethodParams';\nimport type { SearchResponse } from '../model/searchResponse';\nimport type { SearchResponses } from '../model/searchResponses';\nimport type { SearchRulesResponse } from '../model/searchRulesResponse';\nimport type { SearchSynonymsResponse } from '../model/searchSynonymsResponse';\nimport type { SearchUserIdsParams } from '../model/searchUserIdsParams';\nimport type { SearchUserIdsResponse } from '../model/searchUserIdsResponse';\nimport type { SettingsResponse } from '../model/settingsResponse';\nimport type { Source } from '../model/source';\nimport type { SynonymHit } from '../model/synonymHit';\nimport type { UpdateApiKeyResponse } from '../model/updateApiKeyResponse';\nimport type { UpdatedAtResponse } from '../model/updatedAtResponse';\nimport type { UpdatedAtWithObjectIdResponse } from '../model/updatedAtWithObjectIdResponse';\nimport type { UpdatedRuleResponse } from '../model/updatedRuleResponse';\nimport type { UserId } from '../model/userId';\n\nexport const apiClientVersion = '5.2.5';\n\nfunction getDefaultHosts(appId: string): Host[] {\n return (\n [\n {\n url: `${appId}-dsn.algolia.net`,\n accept: 'read',\n protocol: 'https',\n },\n {\n url: `${appId}.algolia.net`,\n accept: 'write',\n protocol: 'https',\n },\n ] as Host[]\n ).concat(\n shuffle([\n {\n url: `${appId}-1.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-2.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-3.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n ]),\n );\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function createSearchClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n ...options\n}: CreateClientOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(appIdOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Search',\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 * 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): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * Helper: Wait for a task to be published (completed) for a given `indexName` and `taskID`.\n *\n * @summary Helper method that waits for a task to be published (completed).\n * @param waitForTaskOptions - The `waitForTaskOptions` object.\n * @param waitForTaskOptions.indexName - The `indexName` where the operation was performed.\n * @param waitForTaskOptions.taskID - The `taskID` returned in the method response.\n * @param waitForTaskOptions.maxRetries - The maximum number of retries. 50 by default.\n * @param waitForTaskOptions.timeout - The function to decide how long to wait between retries.\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.\n */\n waitForTask(\n {\n indexName,\n taskID,\n maxRetries = 50,\n timeout = (retryCount: number): number => Math.min(retryCount * 200, 5000),\n }: WaitForTaskOptions,\n requestOptions?: RequestOptions,\n ): Promise<GetTaskResponse> {\n let retryCount = 0;\n\n return createIterablePromise({\n func: () => this.getTask({ indexName, taskID }, requestOptions),\n validate: (response) => response.status === 'published',\n aggregator: () => (retryCount += 1),\n error: {\n validate: () => retryCount >= maxRetries,\n message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`,\n },\n timeout: () => timeout(retryCount),\n });\n },\n\n /**\n * Helper: Wait for an application-level task to complete for a given `taskID`.\n *\n * @summary Helper method that waits for a task to be published (completed).\n * @param waitForAppTaskOptions - The `waitForTaskOptions` object.\n * @param waitForAppTaskOptions.taskID - The `taskID` returned in the method response.\n * @param waitForAppTaskOptions.maxRetries - The maximum number of retries. 50 by default.\n * @param waitForAppTaskOptions.timeout - The function to decide how long to wait between retries.\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.\n */\n waitForAppTask(\n {\n taskID,\n maxRetries = 50,\n timeout = (retryCount: number): number => Math.min(retryCount * 200, 5000),\n }: WaitForAppTaskOptions,\n requestOptions?: RequestOptions,\n ): Promise<GetTaskResponse> {\n let retryCount = 0;\n\n return createIterablePromise({\n func: () => this.getAppTask({ taskID }, requestOptions),\n validate: (response) => response.status === 'published',\n aggregator: () => (retryCount += 1),\n error: {\n validate: () => retryCount >= maxRetries,\n message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`,\n },\n timeout: () => timeout(retryCount),\n });\n },\n\n /**\n * Helper: Wait for an API key to be added, updated or deleted based on a given `operation`.\n *\n * @summary Helper method that waits for an API key task to be processed.\n * @param waitForApiKeyOptions - The `waitForApiKeyOptions` object.\n * @param waitForApiKeyOptions.operation - The `operation` that was done on a `key`.\n * @param waitForApiKeyOptions.key - The `key` that has been added, deleted or updated.\n * @param waitForApiKeyOptions.apiKey - Necessary to know if an `update` operation has been processed, compare fields of the response with it.\n * @param waitForApiKeyOptions.maxRetries - The maximum number of retries. 50 by default.\n * @param waitForApiKeyOptions.timeout - The function to decide how long to wait between retries.\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getApikey` method and merged with the transporter requestOptions.\n */\n waitForApiKey(\n {\n operation,\n key,\n apiKey,\n maxRetries = 50,\n timeout = (retryCount: number): number => Math.min(retryCount * 200, 5000),\n }: WaitForApiKeyOptions,\n requestOptions?: RequestOptions,\n ): Promise<GetApiKeyResponse | undefined> {\n let retryCount = 0;\n const baseIteratorOptions: IterableOptions<GetApiKeyResponse | undefined> = {\n aggregator: () => (retryCount += 1),\n error: {\n validate: () => retryCount >= maxRetries,\n message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`,\n },\n timeout: () => timeout(retryCount),\n };\n\n if (operation === 'update') {\n if (!apiKey) {\n throw new Error('`apiKey` is required when waiting for an `update` operation.');\n }\n\n return createIterablePromise({\n ...baseIteratorOptions,\n func: () => this.getApiKey({ key }, requestOptions),\n validate: (response) => {\n for (const field of Object.keys(apiKey)) {\n const value = apiKey[field as keyof ApiKey];\n const resValue = response[field as keyof ApiKey];\n if (Array.isArray(value) && Array.isArray(resValue)) {\n if (value.length !== resValue.length || value.some((v, index) => v !== resValue[index])) {\n return false;\n }\n } else if (value !== resValue) {\n return false;\n }\n }\n return true;\n },\n });\n }\n\n return createIterablePromise({\n ...baseIteratorOptions,\n func: () =>\n this.getApiKey({ key }, requestOptions).catch((error: ApiError) => {\n if (error.status === 404) {\n return undefined;\n }\n\n throw error;\n }),\n validate: (response) => (operation === 'add' ? response !== undefined : response === undefined),\n });\n },\n\n /**\n * Helper: Iterate on the `browse` method of the client to allow aggregating objects of an index.\n *\n * @summary Helper method that iterates on the `browse` method.\n * @param browseObjects - The `browseObjects` object.\n * @param browseObjects.indexName - The index in which to perform the request.\n * @param browseObjects.browseParams - The `browse` parameters.\n * @param browseObjects.validate - The validator function. It receive the resolved return of the API call. By default, stops when there is no `cursor` in the response.\n * @param browseObjects.aggregator - The function that runs right after the API call has been resolved, allows you to do anything with the response before `validate`.\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `browse` method and merged with the transporter requestOptions.\n */\n browseObjects<T>(\n { indexName, browseParams, ...browseObjectsOptions }: BrowseOptions<BrowseResponse<T>> & BrowseProps,\n requestOptions?: RequestOptions,\n ): Promise<BrowseResponse<T>> {\n return createIterablePromise<BrowseResponse<T>>({\n func: (previousResponse) => {\n return this.browse(\n {\n indexName,\n browseParams: {\n cursor: previousResponse ? previousResponse.cursor : undefined,\n ...browseParams,\n },\n },\n requestOptions,\n );\n },\n validate: (response) => response.cursor === undefined,\n ...browseObjectsOptions,\n });\n },\n\n /**\n * Helper: Iterate on the `searchRules` method of the client to allow aggregating rules of an index.\n *\n * @summary Helper method that iterates on the `searchRules` method.\n * @param browseRules - The `browseRules` object.\n * @param browseRules.indexName - The index in which to perform the request.\n * @param browseRules.searchRulesParams - The `searchRules` method parameters.\n * @param browseRules.validate - The validator function. It receive the resolved return of the API call. By default, stops when there is less hits returned than the number of maximum hits (1000).\n * @param browseRules.aggregator - The function that runs right after the API call has been resolved, allows you to do anything with the response before `validate`.\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `searchRules` method and merged with the transporter requestOptions.\n */\n browseRules(\n { indexName, searchRulesParams, ...browseRulesOptions }: BrowseOptions<SearchRulesResponse> & SearchRulesProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchRulesResponse> {\n const params = {\n hitsPerPage: 1000,\n ...searchRulesParams,\n };\n\n return createIterablePromise<SearchRulesResponse>({\n func: (previousResponse) => {\n return this.searchRules(\n {\n indexName,\n searchRulesParams: {\n ...params,\n page: previousResponse ? previousResponse.page + 1 : params.page || 0,\n },\n },\n requestOptions,\n );\n },\n validate: (response) => response.nbHits < params.hitsPerPage,\n ...browseRulesOptions,\n });\n },\n\n /**\n * Helper: Iterate on the `searchSynonyms` method of the client to allow aggregating rules of an index.\n *\n * @summary Helper method that iterates on the `searchSynonyms` method.\n * @param browseSynonyms - The `browseSynonyms` object.\n * @param browseSynonyms.indexName - The index in which to perform the request.\n * @param browseSynonyms.validate - The validator function. It receive the resolved return of the API call. By default, stops when there is less hits returned than the number of maximum hits (1000).\n * @param browseSynonyms.aggregator - The function that runs right after the API call has been resolved, allows you to do anything with the response before `validate`.\n * @param browseSynonyms.searchSynonymsParams - The `searchSynonyms` method parameters.\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `searchSynonyms` method and merged with the transporter requestOptions.\n */\n browseSynonyms(\n {\n indexName,\n searchSynonymsParams,\n ...browseSynonymsOptions\n }: BrowseOptions<SearchSynonymsResponse> & SearchSynonymsProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchSynonymsResponse> {\n const params = {\n page: 0,\n ...searchSynonymsParams,\n hitsPerPage: 1000,\n };\n\n return createIterablePromise<SearchSynonymsResponse>({\n func: (_) => {\n const resp = this.searchSynonyms(\n {\n indexName,\n searchSynonymsParams: {\n ...params,\n page: params.page,\n },\n },\n requestOptions,\n );\n params.page += 1;\n return resp;\n },\n validate: (response) => response.nbHits < params.hitsPerPage,\n ...browseSynonymsOptions,\n });\n },\n\n /**\n * Helper: Chunks the given `objects` list in subset of 1000 elements max in order to make it fit in `batch` requests.\n *\n * @summary Helper: Chunks the given `objects` list in subset of 1000 elements max in order to make it fit in `batch` requests.\n * @param chunkedBatch - The `chunkedBatch` object.\n * @param chunkedBatch.indexName - The `indexName` to replace `objects` in.\n * @param chunkedBatch.objects - The array of `objects` to store in the given Algolia `indexName`.\n * @param chunkedBatch.action - The `batch` `action` to perform on the given array of `objects`, defaults to `addObject`.\n * @param chunkedBatch.waitForTasks - Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable.\n * @param chunkedBatch.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.\n */\n async chunkedBatch(\n { indexName, objects, action = 'addObject', waitForTasks, batchSize = 1000 }: ChunkedBatchOptions,\n requestOptions?: RequestOptions,\n ): Promise<BatchResponse[]> {\n let requests: BatchRequest[] = [];\n const responses: BatchResponse[] = [];\n\n const objectEntries = objects.entries();\n for (const [i, obj] of objectEntries) {\n requests.push({ action, body: obj });\n if (requests.length === batchSize || i === objects.length - 1) {\n responses.push(await this.batch({ indexName, batchWriteParams: { requests } }, requestOptions));\n requests = [];\n }\n }\n\n if (waitForTasks) {\n for (const resp of responses) {\n await this.waitForTask({ indexName, taskID: resp.taskID });\n }\n }\n\n return responses;\n },\n\n /**\n * Helper: Saves the given array of objects in the given index. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objects in it.\n *\n * @summary Helper: Saves the given array of objects in the given index. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objects in it.\n * @param saveObjects - The `saveObjects` object.\n * @param saveObjects.indexName - The `indexName` to save `objects` in.\n * @param saveObjects.objects - The array of `objects` to store in the given Algolia `indexName`.\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `batch` method and merged with the transporter requestOptions.\n */\n async saveObjects(\n { indexName, objects }: SaveObjectsOptions,\n requestOptions?: RequestOptions,\n ): Promise<BatchResponse[]> {\n return await this.chunkedBatch({ indexName, objects, action: 'addObject' }, requestOptions);\n },\n\n /**\n * Helper: Deletes every records for the given objectIDs. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objectIDs in it.\n *\n * @summary Helper: Deletes every records for the given objectIDs. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objectIDs in it.\n * @param deleteObjects - The `deleteObjects` object.\n * @param deleteObjects.indexName - The `indexName` to delete `objectIDs` from.\n * @param deleteObjects.objectIDs - The objectIDs to delete.\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `batch` method and merged with the transporter requestOptions.\n */\n async deleteObjects(\n { indexName, objectIDs }: DeleteObjectsOptions,\n requestOptions?: RequestOptions,\n ): Promise<BatchResponse[]> {\n return await this.chunkedBatch(\n {\n indexName,\n objects: objectIDs.map((objectID) => ({ objectID })),\n action: 'deleteObject',\n },\n requestOptions,\n );\n },\n\n /**\n * Helper: Replaces object content of all the given objects according to their respective `objectID` field. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objects in it.\n *\n * @summary Helper: Replaces object content of all the given objects according to their respective `objectID` field. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objects in it.\n * @param partialUpdateObjects - The `partialUpdateObjects` object.\n * @param partialUpdateObjects.indexName - The `indexName` to update `objects` in.\n * @param partialUpdateObjects.objects - The array of `objects` to update in the given Algolia `indexName`.\n * @param partialUpdateObjects.createIfNotExists - To be provided if non-existing objects are passed, otherwise, the call will fail..\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.\n */\n async partialUpdateObjects(\n { indexName, objects, createIfNotExists }: PartialUpdateObjectsOptions,\n requestOptions?: RequestOptions,\n ): Promise<BatchResponse[]> {\n return await this.chunkedBatch(\n {\n indexName,\n objects,\n action: createIfNotExists ? 'partialUpdateObject' : 'partialUpdateObjectNoCreate',\n },\n requestOptions,\n );\n },\n\n /**\n * Helper: Replaces all objects (records) in the given `index_name` with the given `objects`. A temporary index is created during this process in order to backup your data.\n * See https://api-clients-automation.netlify.app/docs/add-new-api-client#5-helpers for implementation details.\n *\n * @summary Helper: Replaces all objects (records) in the given `index_name` with the given `objects`. A temporary index is created during this process in order to backup your data.\n * @param replaceAllObjects - The `replaceAllObjects` object.\n * @param replaceAllObjects.indexName - The `indexName` to replace `objects` in.\n * @param replaceAllObjects.objects - The array of `objects` to store in the given Algolia `indexName`.\n * @param replaceAllObjects.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `objects.length / batchSize`. Defaults to 1000.\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `batch`, `operationIndex` and `getTask` method and merged with the transporter requestOptions.\n */\n async replaceAllObjects(\n { indexName, objects, batchSize }: ReplaceAllObjectsOptions,\n requestOptions?: RequestOptions,\n ): Promise<ReplaceAllObjectsResponse> {\n const randomSuffix = Math.floor(Math.random() * 1000000) + 100000;\n const tmpIndexName = `${indexName}_tmp_${randomSuffix}`;\n\n let copyOperationResponse = await this.operationIndex(\n {\n indexName,\n operationIndexParams: {\n operation: 'copy',\n destination: tmpIndexName,\n scope: ['settings', 'rules', 'synonyms'],\n },\n },\n requestOptions,\n );\n\n const batchResponses = await this.chunkedBatch(\n { indexName: tmpIndexName, objects, waitForTasks: true, batchSize },\n requestOptions,\n );\n\n await this.waitForTask({\n indexName: tmpIndexName,\n taskID: copyOperationResponse.taskID,\n });\n\n copyOperationResponse = await this.operationIndex(\n {\n indexName,\n operationIndexParams: {\n operation: 'copy',\n destination: tmpIndexName,\n scope: ['settings', 'rules', 'synonyms'],\n },\n },\n requestOptions,\n );\n await this.waitForTask({\n indexName: tmpIndexName,\n taskID: copyOperationResponse.taskID,\n });\n\n const moveOperationResponse = await this.operationIndex(\n {\n indexName: tmpIndexName,\n operationIndexParams: { operation: 'move', destination: indexName },\n },\n requestOptions,\n );\n await this.waitForTask({\n indexName: tmpIndexName,\n taskID: moveOperationResponse.taskID,\n });\n\n return { copyOperationResponse, batchResponses, moveOperationResponse };\n },\n\n /**\n * Helper: calls the `search` method but with certainty that we will only request Algolia records (hits) and not facets.\n * Disclaimer: We don't assert that the parameters you pass to this method only contains `hits` requests to prevent impacting search performances, this helper is purely for typing purposes.\n *\n * @summary Search multiple indices for `hits`.\n * @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForHits<T>(\n searchMethodParams: LegacySearchMethodProps | SearchMethodParams,\n requestOptions?: RequestOptions,\n ): Promise<{ results: Array<SearchResponse<T>> }> {\n return this.search(searchMethodParams, requestOptions) as Promise<{ results: Array<SearchResponse<T>> }>;\n },\n\n /**\n * Helper: calls the `search` method but with certainty that we will only request Algolia facets and not records (hits).\n * Disclaimer: We don't assert that the parameters you pass to this method only contains `facets` requests to prevent impacting search performances, this helper is purely for typing purposes.\n *\n * @summary Search multiple indices for `facets`.\n * @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForFacets(\n searchMethodParams: LegacySearchMethodProps | SearchMethodParams,\n requestOptions?: RequestOptions,\n ): Promise<{ results: SearchForFacetValuesResponse[] }> {\n return this.search(searchMethodParams, requestOptions) as Promise<{\n results: SearchForFacetValuesResponse[];\n }>;\n },\n /**\n * Creates a new API key with specific permissions and restrictions.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param apiKey - The apiKey object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n addApiKey(apiKey: ApiKey, requestOptions?: RequestOptions): Promise<AddApiKeyResponse> {\n if (!apiKey) {\n throw new Error('Parameter `apiKey` is required when calling `addApiKey`.');\n }\n\n if (!apiKey.acl) {\n throw new Error('Parameter `apiKey.acl` is required when calling `addApiKey`.');\n }\n\n const requestPath = '/1/keys';\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: apiKey,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * If a record with the specified object ID exists, the existing record is replaced. Otherwise, a new record is added to the index. To update _some_ attributes of an existing record, use the [`partial` operation](#tag/Records/operation/partialUpdateObject) instead. To add, update, or replace multiple records, use the [`batch` operation](#tag/Records/operation/batch).\n *\n * Required API Key ACLs:\n * - addObject.\n *\n * @param addOrUpdateObject - The addOrUpdateObject object.\n * @param addOrUpdateObject.indexName - Name of the index on which to perform the operation.\n * @param addOrUpdateObject.objectID - Unique record identifier.\n * @param addOrUpdateObject.body - The record, a schemaless object with attributes that are useful in the context of search and discovery.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n addOrUpdateObject(\n { indexName, objectID, body }: AddOrUpdateObjectProps,\n requestOptions?: RequestOptions,\n ): Promise<UpdatedAtWithObjectIdResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `addOrUpdateObject`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `addOrUpdateObject`.');\n }\n\n if (!body) {\n throw new Error('Parameter `body` is required when calling `addOrUpdateObject`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/{objectID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Adds a source to the list of allowed sources.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param source - Source to add.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n appendSource(source: Source, requestOptions?: RequestOptions): Promise<CreatedAtResponse> {\n if (!source) {\n throw new Error('Parameter `source` is required when calling `appendSource`.');\n }\n\n if (!source.source) {\n throw new Error('Parameter `source.source` is required when calling `appendSource`.');\n }\n\n const requestPath = '/1/security/sources/append';\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: source,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Assigns or moves a user ID to a cluster. The time it takes to move a user is proportional to the amount of data linked to the user ID.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param assignUserId - The assignUserId object.\n * @param assignUserId.xAlgoliaUserID - Unique identifier of the user who makes the search request.\n * @param assignUserId.assignUserIdParams - The assignUserIdParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n assignUserId(\n { xAlgoliaUserID, assignUserIdParams }: AssignUserIdProps,\n requestOptions?: RequestOptions,\n ): Promise<CreatedAtResponse> {\n if (!xAlgoliaUserID) {\n throw new Error('Parameter `xAlgoliaUserID` is required when calling `assignUserId`.');\n }\n\n if (!assignUserIdParams) {\n throw new Error('Parameter `assignUserIdParams` is required when calling `assignUserId`.');\n }\n\n if (!assignUserIdParams.cluster) {\n throw new Error('Parameter `assignUserIdParams.cluster` is required when calling `assignUserId`.');\n }\n\n const requestPath = '/1/clusters/mapping';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (xAlgoliaUserID !== undefined) {\n headers['X-Algolia-User-ID'] = xAlgoliaUserID.toString();\n }\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: assignUserIdParams,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Adds, updates, or deletes records in one index with a single API request. Batching index updates reduces latency and increases data integrity. - Actions are applied in the order they\\'re specified. - Actions are equivalent to the individual API requests of the same name.\n *\n * @param batch - The batch object.\n * @param batch.indexName - Name of the index on which to perform the operation.\n * @param batch.batchWriteParams - The batchWriteParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n batch({ indexName, batchWriteParams }: BatchProps, requestOptions?: RequestOptions): Promise<BatchResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `batch`.');\n }\n\n if (!batchWriteParams) {\n throw new Error('Parameter `batchWriteParams` is required when calling `batch`.');\n }\n\n if (!batchWriteParams.requests) {\n throw new Error('Parameter `batchWriteParams.requests` is required when calling `batch`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/batch'.replace('{indexName}', encodeURIComponent(indexName));\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: batchWriteParams,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Assigns multiple user IDs to a cluster. **You can\\'t move users with this operation**.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param batchAssignUserIds - The batchAssignUserIds object.\n * @param batchAssignUserIds.xAlgoliaUserID - Unique identifier of the user who makes the search request.\n * @param batchAssignUserIds.batchAssignUserIdsParams - The batchAssignUserIdsParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n batchAssignUserIds(\n { xAlgoliaUserID, batchAssignUserIdsParams }: BatchAssignUserIdsProps,\n requestOptions?: RequestOptions,\n ): Promise<CreatedAtResponse> {\n if (!xAlgoliaUserID) {\n throw new Error('Parameter `xAlgoliaUserID` is required when calling `batchAssignUserIds`.');\n }\n\n if (!batchAssignUserIdsParams) {\n throw new Error('Parameter `batchAssignUserIdsParams` is required when calling `batchAssignUserIds`.');\n }\n\n if (!batchAssignUserIdsParams.cluster) {\n throw new Error('Parameter `batchAssignUserIdsParams.cluster` is required when calling `batchAssignUserIds`.');\n }\n if (!batchAssignUserIdsParams.users) {\n throw new Error('Parameter `batchAssignUserIdsParams.users` is required when calling `batchAssignUserIds`.');\n }\n\n const requestPath = '/1/clusters/mapping/batch';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (xAlgoliaUserID !== undefined) {\n headers['X-Algolia-User-ID'] = xAlgoliaUserID.toString();\n }\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: batchAssignUserIdsParams,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Adds or deletes multiple entries from your plurals, segmentation, or stop word dictionaries.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param batchDictionaryEntries - The batchDictionaryEntries object.\n * @param batchDictionaryEntries.dictionaryName - Dictionary type in which to search.\n * @param batchDictionaryEntries.batchDictionaryEntriesParams - The batchDictionaryEntriesParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n batchDictionaryEntries(\n { dictionaryName, batchDictionaryEntriesParams }: BatchDictionaryEntriesProps,\n requestOptions?: RequestOptions,\n ): Promise<UpdatedAtResponse> {\n if (!dictionaryName) {\n throw new Error('Parameter `dictionaryName` is required when calling `batchDictionaryEntries`.');\n }\n\n if (!batchDictionaryEntriesParams) {\n throw new Error('Parameter `batchDictionaryEntriesParams` is required when calling `batchDictionaryEntries`.');\n }\n\n if (!batchDictionaryEntriesParams.requests) {\n throw new Error(\n 'Parameter `batchDictionaryEntriesParams.requests` is required when calling `batchDictionaryEntries`.',\n );\n }\n\n const requestPath = '/1/dictionaries/{dictionaryName}/batch'.replace(\n '{dictionaryName}',\n encodeURIComponent(dictionaryName),\n );\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: batchDictionaryEntriesParams,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves records from an index, up to 1,000 per request. While searching retrieves _hits_ (records augmented with attributes for highlighting and ranking details), browsing _just_ returns matching records. This can be useful if you want to export your indices. - The Analytics API doesn\\'t collect data when using `browse`. - Records are ranked by attributes and custom ranking. - There\\'s no ranking for: typo-tolerance, number of matched words, proximity, geo distance. Browse requests automatically apply these settings: - `advancedSyntax`: `false` - `attributesToHighlight`: `[]` - `attributesToSnippet`: `[]` - `distinct`: `false` - `enablePersonalization`: `false` - `enableRules`: `false` - `facets`: `[]` - `getRankingInfo`: `false` - `ignorePlurals`: `false` - `optionalFilters`: `[]` - `typoTolerance`: `true` or `false` (`min` and `strict` is evaluated to `true`) If you send these parameters with your browse requests, they\\'ll be ignored.\n *\n * Required API Key ACLs:\n * - browse.\n *\n * @param browse - The browse object.\n * @param browse.indexName - Name of the index on which to perform the operation.\n * @param browse.browseParams - The browseParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n browse<T>({ indexName, browseParams }: BrowseProps, requestOptions?: RequestOptions): Promise<BrowseResponse<T>> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `browse`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/browse'.replace('{indexName}', encodeURIComponent(indexName));\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: browseParams ? browseParams : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Deletes only the records from an index while keeping settings, synonyms, and rules.\n *\n * Required API Key ACLs:\n * - deleteIndex.\n *\n * @param clearObjects - The clearObjects object.\n * @param clearObjects.indexName - Name of the index on which to perform the operation.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n clearObjects({ indexName }: ClearObjectsProps, requestOptions?: RequestOptions): Promise<UpdatedAtResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `clearObjects`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/clear'.replace('{indexName}', encodeURIComponent(indexName));\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 * Deletes all rules from the index.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param clearRules - The clearRules object.\n * @param clearRules.indexName - Name of the index on which to perform the operation.\n * @param clearRules.forwardToReplicas - Whether changes are applied to replica indices.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n clearRules(\n { indexName, forwardToReplicas }: ClearRulesProps,\n requestOptions?: RequestOptions,\n ): Promise<UpdatedAtResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `clearRules`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/rules/clear'.replace('{indexName}', encodeURIComponent(indexName));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (forwardToReplicas !== undefined) {\n queryParameters.forwardToReplicas = forwardToReplicas.toString();\n }\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 * Deletes all synonyms from the index.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param clearSynonyms - The clearSynonyms object.\n * @param clearSynonyms.indexName - Name of the index on which to perform the operation.\n * @param clearSynonyms.forwardToReplicas - Whether changes are applied to replica indices.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n clearSynonyms(\n { indexName, forwardToReplicas }: ClearSynonymsProps,\n requestOptions?: RequestOptions,\n ): Promise<UpdatedAtResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `clearSynonyms`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/synonyms/clear'.replace('{indexName}', encodeURIComponent(indexName));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (forwardToReplicas !== undefined) {\n queryParameters.forwardToReplicas = forwardToReplicas.toString();\n }\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 * This method allow you to send requests to the Algolia REST API.\n *\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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 if (!path) {\n throw new Error('Parameter `path` is required when calling `customDelete`.');\n }\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 allow you to send requests to the Algolia REST API.\n *\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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 if (!path) {\n throw new Error('Parameter `path` is required when calling `customGet`.');\n }\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 allow you to send requests to the Algolia REST API.\n *\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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 if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\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 allow you to send requests to the Algolia REST API.\n *\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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 if (!path) {\n throw new Error('Parameter `path` is required when calling `customPut`.');\n }\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 the API key.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param deleteApiKey - The deleteApiKey object.\n * @param deleteApiKey.key - API key.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteApiKey({ key }: DeleteApiKeyProps, requestOptions?: RequestOptions): Promise<DeleteApiKeyResponse> {\n if (!key) {\n throw new Error('Parameter `key` is required when calling `deleteApiKey`.');\n }\n\n const requestPath = '/1/keys/{key}'.replace('{key}', encodeURIComponent(key));\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 * This operation doesn\\'t accept empty queries or filters. It\\'s more efficient to get a list of object IDs with the [`browse` operation](#tag/Search/operation/browse), and then delete the records using the [`batch` operation](#tag/Records/operation/batch).\n *\n * Required API Key ACLs:\n * - deleteIndex.\n *\n * @param deleteBy - The deleteBy object.\n * @param deleteBy.indexName - Name of the index on which to perform the operation.\n * @param deleteBy.deleteByParams - The deleteByParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteBy(\n { indexName, deleteByParams }: DeleteByProps,\n requestOptions?: RequestOptions,\n ): Promise<DeletedAtResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `deleteBy`.');\n }\n\n if (!deleteByParams) {\n throw new Error('Parameter `deleteByParams` is required when calling `deleteBy`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/deleteByQuery'.replace('{indexName}', encodeURIComponent(indexName));\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: deleteByParams,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Deletes an index and all its settings. - Deleting an index doesn\\'t delete its analytics data. - If you try to delete a non-existing index, the operation is ignored without warning. - If the index you want to delete has replica indices, the replicas become independent indices. - If the index you want to delete is a replica index, you must first unlink it from its primary index before you can delete it. For more information, see [Delete replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/how-to/deleting-replicas/).\n *\n * Required API Key ACLs:\n * - deleteIndex.\n *\n * @param deleteIndex - The deleteIndex object.\n * @param deleteIndex.indexName - Name of the index on which to perform the operation.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteIndex({ indexName }: DeleteIndexProps, requestOptions?: RequestOptions): Promise<DeletedAtResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `deleteIndex`.');\n }\n\n const requestPath = '/1/indexes/{indexName}'.replace('{indexName}', encodeURIComponent(indexName));\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 * Deletes a record by its object ID. To delete more than one record, use the [`batch` operation](#tag/Records/operation/batch). To delete records matching a query, use the [`deleteByQuery` operation](#tag/Records/operation/deleteBy).\n *\n * Required API Key ACLs:\n * - deleteObject.\n *\n * @param deleteObject - The deleteObject object.\n * @param deleteObject.indexName - Name of the index on which to perform the operation.\n * @param deleteObject.objectID - Unique record identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteObject(\n { indexName, objectID }: DeleteObjectProps,\n requestOptions?: RequestOptions,\n ): Promise<DeletedAtResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `deleteObject`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `deleteObject`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/{objectID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{objectID}', encodeURIComponent(objectID));\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 * Deletes a rule by its ID. To find the object ID for rules, use the [`search` operation](#tag/Rules/operation/searchRules).\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param deleteRule - The deleteRule object.\n * @param deleteRule.indexName - Name of the index on which to perform the operation.\n * @param deleteRule.objectID - Unique identifier of a rule object.\n * @param deleteRule.forwardToReplicas - Whether changes are applied to replica indices.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteRule(\n { indexName, objectID, forwardToReplicas }: DeleteRuleProps,\n requestOptions?: RequestOptions,\n ): Promise<UpdatedAtResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `deleteRule`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `deleteRule`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/rules/{objectID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n if (forwardToReplicas !== undefined) {\n queryParameters.forwardToReplicas = forwardToReplicas.toString();\n }\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 * Deletes a source from the list of allowed sources.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param deleteSource - The deleteSource object.\n * @param deleteSource.source - IP address range of the source.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteSource({ source }: DeleteSourceProps, requestOptions?: RequestOptions): Promise<DeleteSourceResponse> {\n if (!source) {\n throw new Error('Parameter `source` is required when calling `deleteSource`.');\n }\n\n const requestPath = '/1/security/sources/{source}'.replace('{source}', encodeURIComponent(source));\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 * Deletes a synonym by its ID. To find the object IDs of your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param deleteSynonym - The deleteSynonym object.\n * @param deleteSynonym.indexName - Name of the index on which to perform the operation.\n * @param deleteSynonym.objectID - Unique identifier of a synonym object.\n * @param deleteSynonym.forwardToReplicas - Whether changes are applied to replica indices.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteSynonym(\n { indexName, objectID, forwardToReplicas }: DeleteSynonymProps,\n requestOptions?: RequestOptions,\n ): Promise<DeletedAtResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `deleteSynonym`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `deleteSynonym`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/synonyms/{objectID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n if (forwardToReplicas !== undefined) {\n queryParameters.forwardToReplicas = forwardToReplicas.toString();\n }\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 * Gets the permissions and restrictions of an API key. When authenticating with the admin API key, you can request information for any of your application\\'s keys. When authenticating with other API keys, you can only retrieve information for that key.\n *\n * @param getApiKey - The getApiKey object.\n * @param getApiKey.key - API key.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getApiKey({ key }: GetApiKeyProps, requestOptions?: RequestOptions): Promise<GetApiKeyResponse> {\n if (!key) {\n throw new Error('Parameter `key` is required when calling `getApiKey`.');\n }\n\n const requestPath = '/1/keys/{key}'.replace('{key}', encodeURIComponent(key));\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 * Checks the status of a given application task.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param getAppTask - The getAppTask object.\n * @param getAppTask.taskID - Unique task identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getAppTask({ taskID }: GetAppTaskProps, requestOptions?: RequestOptions): Promise<GetTaskResponse> {\n if (!taskID) {\n throw new Error('Parameter `taskID` is required when calling `getAppTask`.');\n }\n\n const requestPath = '/1/task/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));\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 * Lists supported languages with their supported dictionary types and number of custom entries.\n *\n * Required API Key ACLs:\n * - settings.\n *\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getDictionaryLanguages(requestOptions?: RequestOptions): Promise<Record<string, Languages>> {\n const requestPath = '/1/dictionaries/*/languages';\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 the languages for which standard dictionary entries are turned off.\n *\n * Required API Key ACLs:\n * - settings.\n *\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getDictionarySettings(requestOptions?: RequestOptions): Promise<GetDictionarySettingsResponse> {\n const requestPath = '/1/dictionaries/*/settings';\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 * The request must be authenticated by an API key with the [`logs` ACL](https://www.algolia.com/doc/guides/security/api-keys/#access-control-list-acl). - Logs are held for the last seven days. - Up to 1,000 API requests per server are logged. - This request counts towards your [operations quota](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-) but doesn\\'t appear in the logs itself.\n *\n * Required API Key ACLs:\n * - logs.\n *\n * @param getLogs - The getLogs object.\n * @param getLogs.offset - First log entry to retrieve. The most recent entries are listed first.\n * @param getLogs.length - Maximum number of entries to retrieve.\n * @param getLogs.indexName - Index for which to retrieve log entries. By default, log entries are retrieved for all indices.\n * @param getLogs.type - Type of log entries to retrieve. By default, all log entries are retrieved.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getLogs(\n { offset, length, indexName, type }: GetLogsProps = {},\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise<GetLogsResponse> {\n const requestPath = '/1/logs';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n if (offset !== undefined) {\n queryParameters.offset = offset.toString();\n }\n if (length !== undefined) {\n queryParameters.length = length.toString();\n }\n\n if (indexName !== undefined) {\n queryParameters.indexName = indexName.toString();\n }\n if (type !== undefined) {\n queryParameters.type = type.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 * Retrieves one record by its object ID. To retrieve more than one record, use the [`objects` operation](#tag/Records/operation/getObjects).\n *\n * Required API Key ACLs:\n * - search.\n *\n * @param getObject - The getObject object.\n * @param getObject.indexName - Name of the index on which to perform the operation.\n * @param getObject.objectID - Unique record identifier.\n * @param getObject.attributesToRetrieve - Attributes to include with the records in the response. This is useful to reduce the size of the API response. By default, all retrievable attributes are returned. `objectID` is always retrieved. Attributes included in `unretrievableAttributes` won\\'t be retrieved unless the request is authenticated with the admin API key.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getObject(\n { indexName, objectID, attributesToRetrieve }: GetObjectProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `getObject`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `getObject`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/{objectID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n if (attributesToRetrieve !== undefined) {\n queryParameters.attributesToRetrieve = attributesToRetrieve.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 * Retrieves one or more records, potentially from different indices. Records are returned in the same order as the requests.\n *\n * Required API Key ACLs:\n * - search.\n *\n * @param getObjectsParams - Request object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getObjects<T>(getObjectsParams: GetObjectsParams, requestOptions?: RequestOptions): Promise<GetObjectsResponse<T>> {\n if (!getObjectsParams) {\n throw new Error('Parameter `getObjectsParams` is required when calling `getObjects`.');\n }\n\n if (!getObjectsParams.requests) {\n throw new Error('Parameter `getObjectsParams.requests` is required when calling `getObjects`.');\n }\n\n const requestPath = '/1/indexes/*/objects';\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: getObjectsParams,\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves a rule by its ID. To find the object ID of rules, use the [`search` operation](#tag/Rules/operation/searchRules).\n *\n * Required API Key ACLs:\n * - settings.\n *\n * @param getRule - The getRule object.\n * @param getRule.indexName - Name of the index on which to perform the operation.\n * @param getRule.objectID - Unique identifier of a rule object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRule({ indexName, objectID }: GetRuleProps, requestOptions?: RequestOptions): Promise<Rule> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `getRule`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `getRule`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/rules/{objectID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{objectID}', encodeURIComponent(objectID));\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 an object with non-null index settings.\n *\n * Required API Key ACLs:\n * - search.\n *\n * @param getSettings - The getSettings object.\n * @param getSettings.indexName - Name of the index on which to perform the operation.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getSettings({ indexName }: GetSettingsProps, requestOptions?: RequestOptions): Promise<SettingsResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `getSettings`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/settings'.replace('{indexName}', encodeURIComponent(indexName));\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 all allowed IP addresses with access to your application.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getSources(requestOptions?: RequestOptions): Promise<Source[]> {\n const requestPath = '/1/security/sources';\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 a syonym by its ID. To find the object IDs for your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).\n *\n * Required API Key ACLs:\n * - settings.\n *\n * @param getSynonym - The getSynonym object.\n * @param getSynonym.indexName - Name of the index on which to perform the operation.\n * @param getSynonym.objectID - Unique identifier of a synonym object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getSynonym({ indexName, objectID }: GetSynonymProps, requestOptions?: RequestOptions): Promise<SynonymHit> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `getSynonym`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `getSynonym`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/synonyms/{objectID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{objectID}', encodeURIComponent(objectID));\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 * Checks the status of a given task. Indexing tasks are asynchronous. When you add, update, or delete records or indices, a task is created on a queue and completed depending on the load on the server. The indexing tasks\\' responses include a task ID that you can use to check the status.\n *\n * Required API Key ACLs:\n * - addObject.\n *\n * @param getTask - The getTask object.\n * @param getTask.indexName - Name of the index on which to perform the operation.\n * @param getTask.taskID - Unique task identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getTask({ indexName, taskID }: GetTaskProps, requestOptions?: RequestOptions): Promise<GetTaskResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `getTask`.');\n }\n\n if (!taskID) {\n throw new Error('Parameter `taskID` is required when calling `getTask`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/task/{taskID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{taskID}', encodeURIComponent(taskID));\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 * Get the IDs of the 10 users with the highest number of records per cluster. Since it can take a few seconds to get the data from the different clusters, the response isn\\'t real-time.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getTopUserIds(requestOptions?: RequestOptions): Promise<GetTopUserIdsResponse> {\n const requestPath = '/1/clusters/mapping/top';\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 * Returns the user ID data stored in the mapping. Since it can take a few seconds to get the data from the different clusters, the response isn\\'t real-time.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param getUserId - The getUserId object.\n * @param getUserId.userID - Unique identifier of the user who makes the search request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getUserId({ userID }: GetUserIdProps, requestOptions?: RequestOptions): Promise<UserId> {\n if (!userID) {\n throw new Error('Parameter `userID` is required when calling `getUserId`.');\n }\n\n const requestPath = '/1/clusters/mapping/{userID}'.replace('{userID}', encodeURIComponent(userID));\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 * To determine when the time-consuming process of creating a large batch of users or migrating users from one cluster to another is complete, this operation retrieves the status of the process.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param hasPendingMappings - The hasPendingMappings object.\n * @param hasPendingMappings.getClusters - Whether to include the cluster\\'s pending mapping state in the response.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n hasPendingMappings(\n { getClusters }: HasPendingMappingsProps = {},\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise<HasPendingMappingsResponse> {\n const requestPath = '/1/clusters/mapping/pending';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n if (getClusters !== undefined) {\n queryParameters.getClusters = getClusters.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 API keys associated with your Algolia application, including their permissions and restrictions.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n listApiKeys(requestOptions?: RequestOptions): Promise<ListApiKeysResponse> {\n const requestPath = '/1/keys';\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 * Lists the available clusters in a multi-cluster setup.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n listClusters(requestOptions?: RequestOptions): Promise<ListClustersResponse> {\n const requestPath = '/1/clusters';\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 * Lists all indices in the current Algolia application. The request follows any index restrictions of the API key you use to make the request.\n *\n * Required API Key ACLs:\n * - listIndexes.\n *\n * @param listIndices - The listIndices object.\n * @param listIndices.page - Requested page of the API response. If `null`, the API response is not paginated.\n * @param listIndices.hitsPerPage - Number of hits per page.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n listIndices(\n { page, hitsPerPage }: ListIndicesProps = {},\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise<ListIndicesResponse> {\n const requestPath = '/1/indexes';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n if (page !== undefined) {\n queryParameters.page = page.toString();\n }\n\n if (hitsPerPage !== undefined) {\n queryParameters.hitsPerPage = hitsPerPage.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 the userIDs assigned to a multi-cluster application. Since it can take a few seconds to get the data from the different clusters, the response isn\\'t real-time.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param listUserIds - The listUserIds object.\n * @param listUserIds.page - Requested page of the API response. If `null`, the API response is not paginated.\n * @param listUserIds.hitsPerPage - Number of hits per page.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n listUserIds(\n { page, hitsPerPage }: ListUserIdsProps = {},\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise<ListUserIdsResponse> {\n const requestPath = '/1/clusters/mapping';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (page !== undefined) {\n queryParameters.page = page.toString();\n }\n if (hitsPerPage !== undefined) {\n queryParameters.hitsPerPage = hitsPerPage.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 * Adds, updates, or deletes records in multiple indices with a single API request. - Actions are applied in the order they are specified. - Actions are equivalent to the individual API requests of the same name.\n *\n * @param batchParams - The batchParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n multipleBatch(batchParams: BatchParams, requestOptions?: RequestOptions): Promise<MultipleBatchResponse> {\n if (!batchParams) {\n throw new Error('Parameter `batchParams` is required when calling `multipleBatch`.');\n }\n\n if (!batchParams.requests) {\n throw new Error('Parameter `batchParams.requests` is required when calling `multipleBatch`.');\n }\n\n const requestPath = '/1/indexes/*/batch';\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: batchParams,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Copies or moves (renames) an index within the same Algolia application. - Existing destination indices are overwritten, except for their analytics data. - If the destination index doesn\\'t exist yet, it\\'ll be created. **Copy** - Copying a source index that doesn\\'t exist creates a new index with 0 records and default settings. - The API keys of the source index are merged with the existing keys in the destination index. - You can\\'t copy the `enableReRanking`, `mode`, and `replicas` settings. - You can\\'t copy to a destination index that already has replicas. - Be aware of the [size limits](https://www.algolia.com/doc/guides/scaling/algolia-service-limits/#application-record-and-index-limits). - Related guide: [Copy indices](https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/how-to/copy-indices/) **Move** - Moving a source index that doesn\\'t exist is ignored without returning an error. - When moving an index, the analytics data keep their original name and a new set of analytics data is started for the new name. To access the original analytics in the dashboard, create an index with the original name. - If the destination index has replicas, moving will overwrite the existing index and copy the data to the replica indices. - Related guide: [Move indices](https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/how-to/move-indices/).\n *\n * Required API Key ACLs:\n * - addObject.\n *\n * @param operationIndex - The operationIndex object.\n * @param operationIndex.indexName - Name of the index on which to perform the operation.\n * @param operationIndex.operationIndexParams - The operationIndexParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n operationIndex(\n { indexName, operationIndexParams }: OperationIndexProps,\n requestOptions?: RequestOptions,\n ): Promise<UpdatedAtResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `operationIndex`.');\n }\n\n if (!operationIndexParams) {\n throw new Error('Parameter `operationIndexParams` is required when calling `operationIndex`.');\n }\n\n if (!operationIndexParams.operation) {\n throw new Error('Parameter `operationIndexParams.operation` is required when calling `operationIndex`.');\n }\n if (!operationIndexParams.destination) {\n throw new Error('Parameter `operationIndexParams.destination` is required when calling `operationIndex`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/operation'.replace('{indexName}', encodeURIComponent(indexName));\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: operationIndexParams,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Adds new attributes to a record, or update existing ones. - If a record with the specified object ID doesn\\'t exist, a new record is added to the index **if** `createIfNotExists` is true. - If the index doesn\\'t exist yet, this method creates a new index. - You can use any first-level attribute but not nested attributes. If you specify a nested attribute, the engine treats it as a replacement for its first-level ancestor. To update an attribute without pushing the entire record, you can use these built-in operations. These operations can be helpful if you don\\'t have access to your initial data. - Increment: increment a numeric attribute - Decrement: decrement a numeric attribute - Add: append a number or string element to an array attribute - Remove: remove all matching number or string elements from an array attribute made of numbers or strings - AddUnique: add a number or string element to an array attribute made of numbers or strings only if it\\'s not already present - IncrementFrom: increment a numeric integer attribute only if the provided value matches the current value, and otherwise ignore the whole object update. For example, if you pass an IncrementFrom value of 2 for the version attribute, but the current value of the attribute is 1, the engine ignores the update. If the object doesn\\'t exist, the engine only creates it if you pass an IncrementFrom value of 0. - IncrementSet: increment a numeric integer attribute only if the provided value is greater than the current value, and otherwise ignore the whole object update. For example, if you pass an IncrementSet value of 2 for the version attribute, and the current value of the attribute is 1, the engine updates the object. If the object doesn\\'t exist yet, the engine only creates it if you pass an IncrementSet value that\\'s greater than 0. You can specify an operation by providing an object with the attribute to update as the key and its value being an object with the following properties: - _operation: the operation to apply on the attribute - value: the right-hand side argument to the operation, for example, increment or decrement step, value to add or remove.\n *\n * Required API Key ACLs:\n * - addObject.\n *\n * @param partialUpdateObject - The partialUpdateObject object.\n * @param partialUpdateObject.indexName - Name of the index on which to perform the operation.\n * @param partialUpdateObject.objectID - Unique record identifier.\n * @param partialUpdateObject.attributesToUpdate - Attributes with their values.\n * @param partialUpdateObject.createIfNotExists - Whether to create a new record if it doesn\\'t exist.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n partialUpdateObject(\n { indexName, objectID, attributesToUpdate, createIfNotExists }: PartialUpdateObjectProps,\n requestOptions?: RequestOptions,\n ): Promise<UpdatedAtWithObjectIdResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `partialUpdateObject`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `partialUpdateObject`.');\n }\n\n if (!attributesToUpdate) {\n throw new Error('Parameter `attributesToUpdate` is required when calling `partialUpdateObject`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/{objectID}/partial'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n if (createIfNotExists !== undefined) {\n queryParameters.createIfNotExists = createIfNotExists.toString();\n }\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: attributesToUpdate,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Deletes a user ID and its associated data from the clusters.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param removeUserId - The removeUserId object.\n * @param removeUserId.userID - Unique identifier of the user who makes the search request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n removeUserId({ userID }: RemoveUserIdProps, requestOptions?: RequestOptions): Promise<RemoveUserIdResponse> {\n if (!userID) {\n throw new Error('Parameter `userID` is required when calling `removeUserId`.');\n }\n\n const requestPath = '/1/clusters/mapping/{userID}'.replace('{userID}', encodeURIComponent(userID));\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 * Replaces the list of allowed sources.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param replaceSources - The replaceSources object.\n * @param replaceSources.source - Allowed sources.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n replaceSources({ source }: ReplaceSourcesProps, requestOptions?: RequestOptions): Promise<ReplaceSourceResponse> {\n if (!source) {\n throw new Error('Parameter `source` is required when calling `replaceSources`.');\n }\n\n const requestPath = '/1/security/sources';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: source,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Restores a deleted API key. Restoring resets the `validity` attribute to `0`. Algolia stores up to 1,000 API keys per application. If you create more, the oldest API keys are deleted and can\\'t be restored.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param restoreApiKey - The restoreApiKey object.\n * @param restoreApiKey.key - API key.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n restoreApiKey({ key }: RestoreApiKeyProps, requestOptions?: RequestOptions): Promise<AddApiKeyResponse> {\n if (!key) {\n throw new Error('Parameter `key` is required when calling `restoreApiKey`.');\n }\n\n const requestPath = '/1/keys/{key}/restore'.replace('{key}', encodeURIComponent(key));\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 * Adds a record to an index or replace it. - If the record doesn\\'t have an object ID, a new record with an auto-generated object ID is added to your index. - If a record with the specified object ID exists, the existing record is replaced. - If a record with the specified object ID doesn\\'t exist, a new record is added to your index. - If you add a record to an index that doesn\\'t exist yet, a new index is created. To update _some_ attributes of a record, use the [`partial` operation](#tag/Records/operation/partialUpdateObject). To add, update, or replace multiple records, use the [`batch` operation](#tag/Records/operation/batch).\n *\n * Required API Key ACLs:\n * - addObject.\n *\n * @param saveObject - The saveObject object.\n * @param saveObject.indexName - Name of the index on which to perform the operation.\n * @param saveObject.body - The record, a schemaless object with attributes that are useful in the context of search and discovery.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n saveObject({ indexName, body }: SaveObjectProps, requestOptions?: RequestOptions): Promise<SaveObjectResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `saveObject`.');\n }\n\n if (!body) {\n throw new Error('Parameter `body` is required when calling `saveObject`.');\n }\n\n const requestPath = '/1/indexes/{indexName}'.replace('{indexName}', encodeURIComponent(indexName));\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: body,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * If a rule with the specified object ID doesn\\'t exist, it\\'s created. Otherwise, the existing rule is replaced. To create or update more than one rule, use the [`batch` operation](#tag/Rules/operation/saveRules).\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param saveRule - The saveRule object.\n * @param saveRule.indexName - Name of the index on which to perform the operation.\n * @param saveRule.objectID - Unique identifier of a rule object.\n * @param saveRule.rule - The rule object.\n * @param saveRule.forwardToReplicas - Whether changes are applied to replica indices.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n saveRule(\n { indexName, objectID, rule, forwardToReplicas }: SaveRuleProps,\n requestOptions?: RequestOptions,\n ): Promise<UpdatedRuleResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `saveRule`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `saveRule`.');\n }\n\n if (!rule) {\n throw new Error('Parameter `rule` is required when calling `saveRule`.');\n }\n\n if (!rule.objectID) {\n throw new Error('Parameter `rule.objectID` is required when calling `saveRule`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/rules/{objectID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (forwardToReplicas !== undefined) {\n queryParameters.forwardToReplicas = forwardToReplicas.toString();\n }\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: rule,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Create or update multiple rules. If a rule with the specified object ID doesn\\'t exist, Algolia creates a new one. Otherwise, existing rules are replaced.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param saveRules - The saveRules object.\n * @param saveRules.indexName - Name of the index on which to perform the operation.\n * @param saveRules.rules - The rules object.\n * @param saveRules.forwardToReplicas - Whether changes are applied to replica indices.\n * @param saveRules.clearExistingRules - Whether existing rules should be deleted before adding this batch.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n saveRules(\n { indexName, rules, forwardToReplicas, clearExistingRules }: SaveRulesProps,\n requestOptions?: RequestOptions,\n ): Promise<UpdatedAtResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `saveRules`.');\n }\n\n if (!rules) {\n throw new Error('Parameter `rules` is required when calling `saveRules`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/rules/batch'.replace('{indexName}', encodeURIComponent(indexName));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n if (forwardToReplicas !== undefined) {\n queryParameters.forwardToReplicas = forwardToReplicas.toString();\n }\n\n if (clearExistingRules !== undefined) {\n queryParameters.clearExistingRules = clearExistingRules.toString();\n }\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: rules,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * If a synonym with the specified object ID doesn\\'t exist, Algolia adds a new one. Otherwise, the existing synonym is replaced. To add multiple synonyms in a single API request, use the [`batch` operation](#tag/Synonyms/operation/saveSynonyms).\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param saveSynonym - The saveSynonym object.\n * @param saveSynonym.indexName - Name of the index on which to perform the operation.\n * @param saveSynonym.objectID - Unique identifier of a synonym object.\n * @param saveSynonym.synonymHit - The synonymHit object.\n * @param saveSynonym.forwardToReplicas - Whether changes are applied to replica indices.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n saveSynonym(\n { indexName, objectID, synonymHit, forwardToReplicas }: SaveSynonymProps,\n requestOptions?: RequestOptions,\n ): Promise<SaveSynonymResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `saveSynonym`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `saveSynonym`.');\n }\n\n if (!synonymHit) {\n throw new Error('Parameter `synonymHit` is required when calling `saveSynonym`.');\n }\n\n if (!synonymHit.objectID) {\n throw new Error('Parameter `synonymHit.objectID` is required when calling `saveSynonym`.');\n }\n if (!synonymHit.type) {\n throw new Error('Parameter `synonymHit.type` is required when calling `saveSynonym`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/synonyms/{objectID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n if (forwardToReplicas !== undefined) {\n queryParameters.forwardToReplicas = forwardToReplicas.toString();\n }\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: synonymHit,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * If a synonym with the `objectID` doesn\\'t exist, Algolia adds a new one. Otherwise, existing synonyms are replaced.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param saveSynonyms - The saveSynonyms object.\n * @param saveSynonyms.indexName - Name of the index on which to perform the operation.\n * @param saveSynonyms.synonymHit - The synonymHit object.\n * @param saveSynonyms.forwardToReplicas - Whether changes are applied to replica indices.\n * @param saveSynonyms.replaceExistingSynonyms - Whether to replace all synonyms in the index with the ones sent with this request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n saveSynonyms(\n { indexName, synonymHit, forwardToReplicas, replaceExistingSynonyms }: SaveSynonymsProps,\n requestOptions?: RequestOptions,\n ): Promise<UpdatedAtResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `saveSynonyms`.');\n }\n\n if (!synonymHit) {\n throw new Error('Parameter `synonymHit` is required when calling `saveSynonyms`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/synonyms/batch'.replace('{indexName}', encodeURIComponent(indexName));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n if (forwardToReplicas !== undefined) {\n queryParameters.forwardToReplicas = forwardToReplicas.toString();\n }\n\n if (replaceExistingSynonyms !== undefined) {\n queryParameters.replaceExistingSynonyms = replaceExistingSynonyms.toString();\n }\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: synonymHit,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Sends multiple search request to one or more indices. This can be useful in these cases: - Different indices for different purposes, such as, one index for products, another one for marketing content. - Multiple searches to the same index—for example, with different filters.\n *\n * Required API Key ACLs:\n * - search.\n *\n * @param searchMethodParams - Muli-search request body. Results are returned in the same order as the requests.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n search<T>(\n searchMethodParams: LegacySearchMethodProps | SearchMethodParams,\n requestOptions?: RequestOptions,\n ): Promise<SearchResponses<T>> {\n if (searchMethodParams && Array.isArray(searchMethodParams)) {\n const newSignatureRequest: SearchMethodParams = {\n requests: searchMethodParams.map(({ params, ...legacyRequest }) => {\n if (legacyRequest.type === 'facet') {\n return {\n ...legacyRequest,\n ...params,\n type: 'facet',\n };\n }\n\n return {\n ...legacyRequest,\n ...params,\n facet: undefined,\n maxFacetHits: undefined,\n facetQuery: undefined,\n };\n }),\n };\n\n // eslint-disable-next-line no-param-reassign\n searchMethodParams = newSignatureRequest;\n }\n\n if (!searchMethodParams) {\n throw new Error('Parameter `searchMethodParams` is required when calling `search`.');\n }\n\n if (!searchMethodParams.requests) {\n throw new Error('Parameter `searchMethodParams.requests` is required when calling `search`.');\n }\n\n const requestPath = '/1/indexes/*/queries';\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: searchMethodParams,\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Searches for standard and custom dictionary entries.\n *\n * Required API Key ACLs:\n * - settings.\n *\n * @param searchDictionaryEntries - The searchDictionaryEntries object.\n * @param searchDictionaryEntries.dictionaryName - Dictionary type in which to search.\n * @param searchDictionaryEntries.searchDictionaryEntriesParams - The searchDictionaryEntriesParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchDictionaryEntries(\n { dictionaryName, searchDictionaryEntriesParams }: SearchDictionaryEntriesProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchDictionaryEntriesResponse> {\n if (!dictionaryName) {\n throw new Error('Parameter `dictionaryName` is required when calling `searchDictionaryEntries`.');\n }\n\n if (!searchDictionaryEntriesParams) {\n throw new Error(\n 'Parameter `searchDictionaryEntriesParams` is required when calling `searchDictionaryEntries`.',\n );\n }\n\n if (!searchDictionaryEntriesParams.query) {\n throw new Error(\n 'Parameter `searchDictionaryEntriesParams.query` is required when calling `searchDictionaryEntries`.',\n );\n }\n\n const requestPath = '/1/dictionaries/{dictionaryName}/search'.replace(\n '{dictionaryName}',\n encodeURIComponent(dictionaryName),\n );\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: searchDictionaryEntriesParams,\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Searches for values of a specified facet attribute. - By default, facet values are sorted by decreasing count. You can adjust this with the `sortFacetValueBy` parameter. - Searching for facet values doesn\\'t work if you have **more than 65 searchable facets and searchable attributes combined**.\n *\n * Required API Key ACLs:\n * - search.\n *\n * @param searchForFacetValues - The searchForFacetValues object.\n * @param searchForFacetValues.indexName - Name of the index on which to perform the operation.\n * @param searchForFacetValues.facetName - Facet attribute in which to search for values. This attribute must be included in the `attributesForFaceting` index setting with the `searchable()` modifier.\n * @param searchForFacetValues.searchForFacetValuesRequest - The searchForFacetValuesRequest object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForFacetValues(\n { indexName, facetName, searchForFacetValuesRequest }: SearchForFacetValuesProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchForFacetValuesResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `searchForFacetValues`.');\n }\n\n if (!facetName) {\n throw new Error('Parameter `facetName` is required when calling `searchForFacetValues`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/facets/{facetName}/query'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{facetName}', encodeURIComponent(facetName));\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: searchForFacetValuesRequest ? searchForFacetValuesRequest : {},\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Searches for rules in your index.\n *\n * Required API Key ACLs:\n * - settings.\n *\n * @param searchRules - The searchRules object.\n * @param searchRules.indexName - Name of the index on which to perform the operation.\n * @param searchRules.searchRulesParams - The searchRulesParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchRules(\n { indexName, searchRulesParams }: SearchRulesProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchRulesResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `searchRules`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/rules/search'.replace('{indexName}', encodeURIComponent(indexName));\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: searchRulesParams ? searchRulesParams : {},\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Searches a single index and return matching search results (_hits_). This method lets you retrieve up to 1,000 hits. If you need more, use the [`browse` operation](#tag/Search/operation/browse) or increase the `paginatedLimitedTo` index setting.\n *\n * Required API Key ACLs:\n * - search.\n *\n * @param searchSingleIndex - The searchSingleIndex object.\n * @param searchSingleIndex.indexName - Name of the index on which to perform the operation.\n * @param searchSingleIndex.searchParams - The searchParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchSingleIndex<T>(\n { indexName, searchParams }: SearchSingleIndexProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchResponse<T>> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `searchSingleIndex`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/query'.replace('{indexName}', encodeURIComponent(indexName));\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: searchParams ? searchParams : {},\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Searches for synonyms in your index.\n *\n * Required API Key ACLs:\n * - settings.\n *\n * @param searchSynonyms - The searchSynonyms object.\n * @param searchSynonyms.indexName - Name of the index on which to perform the operation.\n * @param searchSynonyms.searchSynonymsParams - Body of the `searchSynonyms` operation.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchSynonyms(\n { indexName, searchSynonymsParams }: SearchSynonymsProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchSynonymsResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `searchSynonyms`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/synonyms/search'.replace(\n '{indexName}',\n encodeURIComponent(indexName),\n );\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: searchSynonymsParams ? searchSynonymsParams : {},\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Since it can take a few seconds to get the data from the different clusters, the response isn\\'t real-time. To ensure rapid updates, the user IDs index isn\\'t built at the same time as the mapping. Instead, it\\'s built every 12 hours, at the same time as the update of user ID usage. For example, if you add or move a user ID, the search will show an old value until the next time the mapping is rebuilt (every 12 hours).\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param searchUserIdsParams - The searchUserIdsParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchUserIds(\n searchUserIdsParams: SearchUserIdsParams,\n requestOptions?: RequestOptions,\n ): Promise<SearchUserIdsResponse> {\n if (!searchUserIdsParams) {\n throw new Error('Parameter `searchUserIdsParams` is required when calling `searchUserIds`.');\n }\n\n if (!searchUserIdsParams.query) {\n throw new Error('Parameter `searchUserIdsParams.query` is required when calling `searchUserIds`.');\n }\n\n const requestPath = '/1/clusters/mapping/search';\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: searchUserIdsParams,\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Turns standard stop word dictionary entries on or off for a given language.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param dictionarySettingsParams - The dictionarySettingsParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n setDictionarySettings(\n dictionarySettingsParams: DictionarySettingsParams,\n requestOptions?: RequestOptions,\n ): Promise<UpdatedAtResponse> {\n if (!dictionarySettingsParams) {\n throw new Error('Parameter `dictionarySettingsParams` is required when calling `setDictionarySettings`.');\n }\n\n if (!dictionarySettingsParams.disableStandardEntries) {\n throw new Error(\n 'Parameter `dictionarySettingsParams.disableStandardEntries` is required when calling `setDictionarySettings`.',\n );\n }\n\n const requestPath = '/1/dictionaries/*/settings';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: dictionarySettingsParams,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Update the specified index settings. Index settings that you don\\'t specify are left unchanged. Specify `null` to reset a setting to its default value. For best performance, update the index settings before you add new records to your index.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param setSettings - The setSettings object.\n * @param setSettings.indexName - Name of the index on which to perform the operation.\n * @param setSettings.indexSettings - The indexSettings object.\n * @param setSettings.forwardToReplicas - Whether changes are applied to replica indices.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n setSettings(\n { indexName, indexSettings, forwardToReplicas }: SetSettingsProps,\n requestOptions?: RequestOptions,\n ): Promise<UpdatedAtResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `setSettings`.');\n }\n\n if (!indexSettings) {\n throw new Error('Parameter `indexSettings` is required when calling `setSettings`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/settings'.replace('{indexName}', encodeURIComponent(indexName));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n if (forwardToReplicas !== undefined) {\n queryParameters.forwardToReplicas = forwardToReplicas.toString();\n }\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: indexSettings,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Replaces the permissions of an existing API key. Any unspecified attribute resets that attribute to its default value.\n *\n * Required API Key ACLs:\n * - admin.\n *\n * @param updateApiKey - The updateApiKey object.\n * @param updateApiKey.key - API key.\n * @param updateApiKey.apiKey - The apiKey object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n updateApiKey({ key, apiKey }: UpdateApiKeyProps, requestOptions?: RequestOptions): Promise<UpdateApiKeyResponse> {\n if (!key) {\n throw new Error('Parameter `key` is required when calling `updateApiKey`.');\n }\n\n if (!apiKey) {\n throw new Error('Parameter `apiKey` is required when calling `updateApiKey`.');\n }\n\n if (!apiKey.acl) {\n throw new Error('Parameter `apiKey.acl` is required when calling `updateApiKey`.');\n }\n\n const requestPath = '/1/keys/{key}'.replace('{key}', encodeURIComponent(key));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: apiKey,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\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 { ClientOptions } from '@algolia/client-common';\nimport {\n createMemoryCache,\n createFallbackableCache,\n createBrowserLocalStorageCache,\n DEFAULT_CONNECT_TIMEOUT_BROWSER,\n DEFAULT_READ_TIMEOUT_BROWSER,\n DEFAULT_WRITE_TIMEOUT_BROWSER,\n} from '@algolia/client-common';\nimport { createXhrRequester } from '@algolia/requester-browser-xhr';\n\nimport { createRecommendClient, apiClientVersion } from '../src/recommendClient';\n\nexport { apiClientVersion } from '../src/recommendClient';\nexport * from '../model';\n\n/**\n * The client type.\n */\nexport type RecommendClient = ReturnType<typeof recommendClient>;\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function recommendClient(appId: string, apiKey: string, options?: ClientOptions) {\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 return createRecommendClient({\n appId,\n apiKey,\n timeouts: {\n connect: DEFAULT_CONNECT_TIMEOUT_BROWSER,\n read: DEFAULT_READ_TIMEOUT_BROWSER,\n write: DEFAULT_WRITE_TIMEOUT_BROWSER,\n },\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 ...options,\n });\n}\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 { createAuth, createTransporter, getAlgoliaAgent, shuffle } from '@algolia/client-common';\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\n\nimport type {\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteRecommendRuleProps,\n GetRecommendRuleProps,\n GetRecommendStatusProps,\n LegacyGetRecommendationsParams,\n SearchRecommendRulesProps,\n} from '../model/clientMethodProps';\nimport type { DeletedAtResponse } from '../model/deletedAtResponse';\nimport type { GetRecommendTaskResponse } from '../model/getRecommendTaskResponse';\nimport type { GetRecommendationsParams } from '../model/getRecommendationsParams';\nimport type { GetRecommendationsResponse } from '../model/getRecommendationsResponse';\nimport type { RecommendRule } from '../model/recommendRule';\nimport type { SearchRecommendRulesResponse } from '../model/searchRecommendRulesResponse';\n\nexport const apiClientVersion = '5.2.5';\n\nfunction getDefaultHosts(appId: string): Host[] {\n return (\n [\n {\n url: `${appId}-dsn.algolia.net`,\n accept: 'read',\n protocol: 'https',\n },\n {\n url: `${appId}.algolia.net`,\n accept: 'write',\n protocol: 'https',\n },\n ] as Host[]\n ).concat(\n shuffle([\n {\n url: `${appId}-1.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-2.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-3.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n ]),\n );\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function createRecommendClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n ...options\n}: CreateClientOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(appIdOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Recommend',\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 * 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): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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 if (!path) {\n throw new Error('Parameter `path` is required when calling `customDelete`.');\n }\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 allow you to send requests to the Algolia REST API.\n *\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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 if (!path) {\n throw new Error('Parameter `path` is required when calling `customGet`.');\n }\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 allow you to send requests to the Algolia REST API.\n *\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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 if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\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 allow you to send requests to the Algolia REST API.\n *\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\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 if (!path) {\n throw new Error('Parameter `path` is required when calling `customPut`.');\n }\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 a Recommend rule from a recommendation scenario.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param deleteRecommendRule - The deleteRecommendRule object.\n * @param deleteRecommendRule.indexName - Name of the index on which to perform the operation.\n * @param deleteRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).\n * @param deleteRecommendRule.objectID - Unique record identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteRecommendRule(\n { indexName, model, objectID }: DeleteRecommendRuleProps,\n requestOptions?: RequestOptions,\n ): Promise<DeletedAtResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `deleteRecommendRule`.');\n }\n\n if (!model) {\n throw new Error('Parameter `model` is required when calling `deleteRecommendRule`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `deleteRecommendRule`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/{objectID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{model}', encodeURIComponent(model))\n .replace('{objectID}', encodeURIComponent(objectID));\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 * Retrieves a Recommend rule that you previously created in the Algolia dashboard.\n *\n * Required API Key ACLs:\n * - settings.\n *\n * @param getRecommendRule - The getRecommendRule object.\n * @param getRecommendRule.indexName - Name of the index on which to perform the operation.\n * @param getRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).\n * @param getRecommendRule.objectID - Unique record identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRecommendRule(\n { indexName, model, objectID }: GetRecommendRuleProps,\n requestOptions?: RequestOptions,\n ): Promise<RecommendRule> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `getRecommendRule`.');\n }\n\n if (!model) {\n throw new Error('Parameter `model` is required when calling `getRecommendRule`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `getRecommendRule`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/{objectID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{model}', encodeURIComponent(model))\n .replace('{objectID}', encodeURIComponent(objectID));\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 * Checks the status of a given task. Deleting a Recommend rule is asynchronous. When you delete a rule, a task is created on a queue and completed depending on the load on the server. The API response includes a task ID that you can use to check the status.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param getRecommendStatus - The getRecommendStatus object.\n * @param getRecommendStatus.indexName - Name of the index on which to perform the operation.\n * @param getRecommendStatus.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).\n * @param getRecommendStatus.taskID - Unique task identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRecommendStatus(\n { indexName, model, taskID }: GetRecommendStatusProps,\n requestOptions?: RequestOptions,\n ): Promise<GetRecommendTaskResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `getRecommendStatus`.');\n }\n\n if (!model) {\n throw new Error('Parameter `model` is required when calling `getRecommendStatus`.');\n }\n\n if (!taskID) {\n throw new Error('Parameter `taskID` is required when calling `getRecommendStatus`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/{model}/task/{taskID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{model}', encodeURIComponent(model))\n .replace('{taskID}', encodeURIComponent(taskID));\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 recommendations from selected AI models.\n *\n * Required API Key ACLs:\n * - search.\n *\n * @param getRecommendationsParams - The getRecommendationsParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRecommendations(\n getRecommendationsParams: GetRecommendationsParams | LegacyGetRecommendationsParams,\n requestOptions?: RequestOptions,\n ): Promise<GetRecommendationsResponse> {\n if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {\n const newSignatureRequest: GetRecommendationsParams = {\n requests: getRecommendationsParams,\n };\n\n // eslint-disable-next-line no-param-reassign\n getRecommendationsParams = newSignatureRequest;\n }\n\n if (!getRecommendationsParams) {\n throw new Error('Parameter `getRecommendationsParams` is required when calling `getRecommendations`.');\n }\n\n if (!getRecommendationsParams.requests) {\n throw new Error('Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.');\n }\n\n const requestPath = '/1/indexes/*/recommendations';\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: getRecommendationsParams,\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Searches for Recommend rules. Use an empty query to list all rules for this recommendation scenario.\n *\n * Required API Key ACLs:\n * - settings.\n *\n * @param searchRecommendRules - The searchRecommendRules object.\n * @param searchRecommendRules.indexName - Name of the index on which to perform the operation.\n * @param searchRecommendRules.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).\n * @param searchRecommendRules.searchRecommendRulesParams - The searchRecommendRulesParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchRecommendRules(\n { indexName, model, searchRecommendRulesParams }: SearchRecommendRulesProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchRecommendRulesResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `searchRecommendRules`.');\n }\n\n if (!model) {\n throw new Error('Parameter `model` is required when calling `searchRecommendRules`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/search'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{model}', encodeURIComponent(model));\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: searchRecommendRulesParams ? searchRecommendRulesParams : {},\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\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 { AbtestingClient, Region as AbtestingRegion } from '@algolia/client-abtesting';\nimport { abtestingClient } from '@algolia/client-abtesting';\nimport type { AnalyticsClient, Region as AnalyticsRegion } from '@algolia/client-analytics';\nimport { analyticsClient } from '@algolia/client-analytics';\nimport {\n DEFAULT_CONNECT_TIMEOUT_BROWSER,\n DEFAULT_READ_TIMEOUT_BROWSER,\n DEFAULT_WRITE_TIMEOUT_BROWSER,\n createBrowserLocalStorageCache,\n createFallbackableCache,\n createMemoryCache,\n} from '@algolia/client-common';\nimport type { ClientOptions } from '@algolia/client-common';\nimport type { PersonalizationClient, Region as PersonalizationRegion } from '@algolia/client-personalization';\nimport { personalizationClient } from '@algolia/client-personalization';\nimport { searchClient } from '@algolia/client-search';\nimport type { RecommendClient } from '@algolia/recommend';\nimport { recommendClient } from '@algolia/recommend';\nimport { createXhrRequester } from '@algolia/requester-browser-xhr';\n\nimport type { InitClientOptions, InitClientRegion } from './models';\nimport { apiClientVersion } from './models';\n\nexport * from './models';\n\n/**\n * The client type.\n */\nexport type Algoliasearch = ReturnType<typeof algoliasearch>;\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function algoliasearch(appId: string, apiKey: string, options?: ClientOptions) {\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 function initRecommend(initOptions: InitClientOptions = {}): RecommendClient {\n return recommendClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);\n }\n\n function initAnalytics(initOptions: InitClientOptions & InitClientRegion<AnalyticsRegion> = {}): AnalyticsClient {\n return analyticsClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n }\n\n function initAbtesting(initOptions: InitClientOptions & InitClientRegion<AbtestingRegion> = {}): AbtestingClient {\n return abtestingClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n }\n\n function initPersonalization(\n initOptions: InitClientOptions & Required<InitClientRegion<PersonalizationRegion>>,\n ): PersonalizationClient {\n return personalizationClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n }\n\n return {\n ...searchClient(appId, apiKey, {\n timeouts: {\n connect: DEFAULT_CONNECT_TIMEOUT_BROWSER,\n read: DEFAULT_READ_TIMEOUT_BROWSER,\n write: DEFAULT_WRITE_TIMEOUT_BROWSER,\n },\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 ...options,\n }),\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return this.transporter.algoliaAgent.value;\n },\n initAbtesting,\n initAnalytics,\n initPersonalization,\n initRecommend,\n };\n}\n"],"mappings":"AAEO,SAASA,EACdC,EACAC,EACAC,EAAqB,gBAIrB,CACA,IAAMC,EAAc,CAClB,oBAAqBF,EACrB,2BAA4BD,CAC9B,EAEA,MAAO,CACL,SAAmB,CACjB,OAAOE,IAAa,gBAAkBC,EAAc,CAAC,CACvD,EAEA,iBAAmC,CACjC,OAAOD,IAAa,wBAA0BC,EAAc,CAAC,CAC/D,CACF,CACF,CEZO,SAASC,EAAiC,CAC/C,KAAAC,EACA,SAAAC,EACA,WAAAC,EACA,MAAAC,EACA,QAAAC,EAAU,IAAc,CAC1B,EAAyD,CACvD,IAAMC,EAASC,GACN,IAAI,QAAmB,CAACC,EAASC,IAAW,CACjDR,EAAKM,CAAgB,EAClB,KAAMG,IACDP,GACFA,EAAWO,CAAQ,EAGjBR,EAASQ,CAAQ,EACZF,EAAQE,CAAQ,EAGrBN,GAASA,EAAM,SAASM,CAAQ,EAC3BD,EAAO,IAAI,MAAML,EAAM,QAAQM,CAAQ,CAAC,CAAC,EAG3C,WAAW,IAAM,CACtBJ,EAAMI,CAAQ,EAAE,KAAKF,CAAO,EAAE,MAAMC,CAAM,CAC5C,EAAGJ,EAAQ,CAAC,EACb,EACA,MAAOM,GAAQ,CACdF,EAAOE,CAAG,CACZ,CAAC,CACL,CAAC,EAGH,OAAOL,EAAM,CACf,C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F,CAEA,MAAO,CACL,GAAGQ,GAAaZ,EAAOC,EAAQ,CAC7B,SAAU,CACR,QAASY,EACT,KAAMC,EACN,MAAOC,CACT,EACA,UAAWC,EAAmB,EAC9B,cAAe,CAAC,CAAE,QAAS,SAAU,CAAC,EACtC,SAAU,wBACV,eAAgBC,EAAkB,EAClC,cAAeA,EAAkB,CAAE,aAAc,EAAM,CAAC,EACxD,WAAYC,EAAwB,CAClC,OAAQ,CAACC,EAA+B,CAAE,IAAK,GAAGC,CAAgB,IAAIpB,CAAK,EAAG,CAAC,EAAGiB,EAAkB,CAAC,CACvG,CAAC,EACD,GAAGf,CACL,CAAC,EAID,IAAI,KAAc,CAChB,OAAO,KAAK,YAAY,aAAa,KACvC,EACA,cAAAM,EACA,cAAAF,EACA,oBAAAI,EACA,cAAAP,CACF,CACF","names":["createAuth","appId","apiKey","authMode","credentials","createIterablePromise","func","validate","aggregator","error","timeout","retry","previousResponse","resolve","reject","response","err","createBrowserLocalStorageCache","options","storage","namespaceKey","getStorage","getNamespace","setNamespace","namespace","removeOutdatedCacheItems","timeToLive","filteredNamespaceWithoutOldFormattedCacheItems","cacheItem","filteredNamespaceWithoutExpiredItems","currentTimestamp","key","defaultValue","events","value","exists","createNullCache","_key","result","createFallbackableCache","caches","current","createMemoryCache","cache","keyAsString","promise","EXPIRATION_DELAY","createStatefulHost","host","status","lastUpdate","isUp","isTimedOut","AlgoliaError","message","name","ErrorWithStackTrace","stackTrace","RetryError","ApiError","DeserializationError","DetailedApiError","shuffle","array","shuffledArray","c","b","a","serializeUrl","path","queryParameters","queryParametersAsString","serializeQueryParameters","url","parameters","serializeData","request","requestOptions","data","serializeHeaders","baseHeaders","requestHeaders","requestOptionsHeaders","headers","serializedHeaders","header","deserializeSuccess","e","deserializeFailure","content","stackFrame","parsed","isNetworkError","isRetryable","isSuccess","stackTraceWithoutCredentials","stackFrameWithoutCredentials","modifiedHeaders","createTransporter","hosts","hostsCache","baseQueryParameters","algoliaAgent","timeouts","requester","requestsCache","responsesCache","createRetryableOptions","compatibleHosts","statefulHosts","compatibleHost","hostsUp","hostsTimedOut","hostsAvailable","timeoutsCount","baseTimeout","retryableRequest","isRead","dataQueryParameters","retryableHosts","getTimeout","payload","pushToStackTrace","createRequest","createRetryableRequest","_","createAlgoliaAgent","version","addedAlgoliaAgent","getAlgoliaAgent","algoliaAgents","client","defaultAlgoliaAgent","DEFAULT_CONNECT_TIMEOUT_BROWSER","DEFAULT_READ_TIMEOUT_BROWSER","DEFAULT_WRITE_TIMEOUT_BROWSER","createXhrRequester","send","request","resolve","baseRequester","key","createTimeout","timeout","content","connectTimeout","responseTimeout","apiClientVersion","REGIONS","getDefaultHosts","region","createAbtestingClient","appIdOption","apiKeyOption","authMode","algoliaAgents","regionOption","options","auth","createAuth","transporter","createTransporter","getAlgoliaAgent","segment","version","addABTestsRequest","requestOptions","request","path","parameters","body","id","offset","limit","indexPrefix","indexSuffix","requestPath","headers","queryParameters","scheduleABTestsRequest","abtestingClient","appId","apiKey","DEFAULT_CONNECT_TIMEOUT_BROWSER","DEFAULT_READ_TIMEOUT_BROWSER","DEFAULT_WRITE_TIMEOUT_BROWSER","c","createMemoryCache","createFallbackableCache","createBrowserLocalStorageCache","apiClientVersion","REGIONS","getDefaultHosts","region","createAnalyticsClient","appIdOption","apiKeyOption","authMode","algoliaAgents","regionOption","options","auth","createAuth","transporter","createTransporter","getAlgoliaAgent","segment","version","path","parameters","requestOptions","request","body","index","startDate","endDate","tags","requestPath","headers","queryParameters","limit","offset","search","attribute","clickAnalytics","revenueAnalytics","orderBy","direction","analyticsClient","appId","apiKey","DEFAULT_CONNECT_TIMEOUT_BROWSER","DEFAULT_READ_TIMEOUT_BROWSER","DEFAULT_WRITE_TIMEOUT_BROWSER","c","createMemoryCache","createFallbackableCache","createBrowserLocalStorageCache","apiClientVersion","REGIONS","getDefaultHosts","region","createPersonalizationClient","appIdOption","apiKeyOption","authMode","algoliaAgents","regionOption","options","auth","createAuth","transporter","createTransporter","getAlgoliaAgent","segment","version","path","parameters","requestOptions","request","body","userToken","personalizationStrategyParams","personalizationClient","appId","apiKey","DEFAULT_CONNECT_TIMEOUT_BROWSER","DEFAULT_READ_TIMEOUT_BROWSER","DEFAULT_WRITE_TIMEOUT_BROWSER","c","createMemoryCache","createFallbackableCache","createBrowserLocalStorageCache","apiClientVersion","getDefaultHosts","appId","shuffle","createSearchClient","appIdOption","apiKeyOption","authMode","algoliaAgents","options","auth","createAuth","transporter","createTransporter","getAlgoliaAgent","segment","version","indexName","taskID","maxRetries","timeout","retryCount","requestOptions","createIterablePromise","response","operation","key","apiKey","baseIteratorOptions","field","value","resValue","v","index","error","browseParams","browseObjectsOptions","previousResponse","searchRulesParams","browseRulesOptions","params","searchSynonymsParams","browseSynonymsOptions","_","resp","objects","action","waitForTasks","batchSize","requests","responses","objectEntries","i","obj","objectIDs","objectID","createIfNotExists","randomSuffix","tmpIndexName","copyOperationResponse","batchResponses","moveOperationResponse","searchMethodParams","request","body","source","xAlgoliaUserID","assignUserIdParams","requestPath","headers","queryParameters","batchWriteParams","batchAssignUserIdsParams","dictionaryName","batchDictionaryEntriesParams","forwardToReplicas","path","parameters","deleteByParams","offset","length","type","attributesToRetrieve","getObjectsParams","userID","getClusters","page","hitsPerPage","batchParams","operationIndexParams","attributesToUpdate","rule","rules","clearExistingRules","synonymHit","replaceExistingSynonyms","legacyRequest","searchDictionaryEntriesParams","facetName","searchForFacetValuesRequest","searchParams","searchUserIdsParams","dictionarySettingsParams","indexSettings","searchClient","DEFAULT_CONNECT_TIMEOUT_BROWSER","DEFAULT_READ_TIMEOUT_BROWSER","DEFAULT_WRITE_TIMEOUT_BROWSER","c","createMemoryCache","createFallbackableCache","createBrowserLocalStorageCache","apiClientVersion","getDefaultHosts","appId","shuffle","createRecommendClient","appIdOption","apiKeyOption","authMode","algoliaAgents","options","auth","createAuth","transporter","createTransporter","getAlgoliaAgent","segment","version","path","parameters","requestOptions","request","body","indexName","model","objectID","taskID","getRecommendationsParams","searchRecommendRulesParams","recommendClient","apiKey","DEFAULT_CONNECT_TIMEOUT_BROWSER","DEFAULT_READ_TIMEOUT_BROWSER","DEFAULT_WRITE_TIMEOUT_BROWSER","c","createMemoryCache","createFallbackableCache","createBrowserLocalStorageCache","algoliasearch","appId","apiKey","options","initRecommend","initOptions","recommendClient","initAnalytics","analyticsClient","initAbtesting","abtestingClient","initPersonalization","personalizationClient","searchClient","DEFAULT_CONNECT_TIMEOUT_BROWSER","DEFAULT_READ_TIMEOUT_BROWSER","DEFAULT_WRITE_TIMEOUT_BROWSER","c","createMemoryCache","createFallbackableCache","createBrowserLocalStorageCache","apiClientVersion"]}
|