{"version":3,"sources":["../../../requester-browser-xhr/src/createXhrRequester.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/constants.ts","../../../client-common/src/createAlgoliaAgent.ts","../../../client-common/src/createAuth.ts","../../../client-common/src/createIterablePromise.ts","../../../client-common/src/getAlgoliaAgent.ts","../../../client-common/src/logger/createNullLogger.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/types/logger.ts","../../src/ingestionClient.ts","../../builds/browser.ts"],"sourcesContent":["import type { EndRequest, Requester, Response } from '@algolia/client-common';\n\ntype Timeout = ReturnType;\n\nexport function createXhrRequester(): Requester {\n function send(request: EndRequest): Promise {\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 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(): Record {\n return JSON.parse(getStorage().getItem(namespaceKey) || '{}');\n }\n\n function setNamespace(namespace: Record): 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();\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(\n key: Record | string,\n defaultValue: () => Promise,\n events: CacheEvents = {\n miss: () => Promise.resolve(),\n },\n ): Promise {\n return Promise.resolve()\n .then(() => {\n removeOutdatedCacheItems();\n\n return getNamespace>()[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(key: Record | string, value: TValue): Promise {\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): Promise {\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 {\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(\n _key: Record | string,\n defaultValue: () => Promise,\n events: CacheEvents = {\n miss: (): Promise => Promise.resolve(),\n },\n ): Promise {\n const value = defaultValue();\n\n return value.then((result) => Promise.all([result, events.miss(result)])).then(([result]) => result);\n },\n\n set(_key: Record | string, value: TValue): Promise {\n return Promise.resolve(value);\n },\n\n delete(_key: Record | string): Promise {\n return Promise.resolve();\n },\n\n clear(): Promise {\n return Promise.resolve();\n },\n };\n}\n","import type { Cache, CacheEvents, FallbackableCacheOptions } from '../types';\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(\n key: Record | string,\n defaultValue: () => Promise,\n events: CacheEvents = {\n miss: (): Promise => Promise.resolve(),\n },\n ): Promise {\n return current.get(key, defaultValue, events).catch(() => {\n return createFallbackableCache({ caches }).get(key, defaultValue, events);\n });\n },\n\n set(key: Record | string, value: TValue): Promise {\n return current.set(key, value).catch(() => {\n return createFallbackableCache({ caches }).set(key, value);\n });\n },\n\n delete(key: Record | string): Promise {\n return current.delete(key).catch(() => {\n return createFallbackableCache({ caches }).delete(key);\n });\n },\n\n clear(): Promise {\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 = {};\n\n return {\n get(\n key: Record | string,\n defaultValue: () => Promise,\n events: CacheEvents = {\n miss: (): Promise => Promise.resolve(),\n },\n ): Promise {\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(key: Record | string, value: TValue): Promise {\n cache[JSON.stringify(key)] = options.serializable ? JSON.stringify(value) : value;\n\n return Promise.resolve(value);\n },\n\n delete(key: Record | string): Promise {\n delete cache[JSON.stringify(key)];\n\n return Promise.resolve();\n },\n\n clear(): Promise {\n cache = {};\n\n return Promise.resolve();\n },\n };\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 { AlgoliaAgent, AlgoliaAgentOptions } 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 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 { 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({\n func,\n validate,\n aggregator,\n error,\n timeout = (): number => 0,\n}: CreateIterablePromise): Promise {\n const retry = (previousResponse?: TResponse): Promise => {\n return new Promise((resolve, reject) => {\n func(previousResponse)\n .then(async (response) => {\n if (aggregator) {\n await aggregator(response);\n }\n\n if (await validate(response)) {\n return resolve(response);\n }\n\n if (error && (await error.validate(response))) {\n return reject(new Error(await error.message(response)));\n }\n\n return setTimeout(\n () => {\n retry(response).then(resolve).catch(reject);\n },\n await timeout(),\n );\n })\n .catch((err) => {\n reject(err);\n });\n });\n };\n\n return retry();\n}\n","import { createAlgoliaAgent } from './createAlgoliaAgent';\nimport type { AlgoliaAgent, AlgoliaAgentOptions } 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","import type { Logger } from '../types/logger';\n\nexport function createNullLogger(): Logger {\n return {\n debug(_message: string, _args?: any): Promise {\n return Promise.resolve();\n },\n info(_message: string, _args?: any): Promise {\n return Promise.resolve();\n },\n error(_message: string, _args?: any): Promise {\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 override 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';\nimport { ApiError, DeserializationError, DetailedApiError } from './errors';\n\nexport function shuffle(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 ).replace(/\\+/g, '%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(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): boolean {\n return !isTimedOut && ~~status === 0;\n}\n\nexport function isRetryable({ isTimedOut, status }: Omit): boolean {\n return isTimedOut || isNetworkError({ isTimedOut, status }) || (~~(status / 100) !== 2 && ~~(status / 100) !== 4);\n}\n\nexport function isSuccess({ status }: Pick): 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 QueryParameters,\n Request,\n RequestOptions,\n Response,\n StackFrame,\n Transporter,\n TransporterOptions,\n} from '../types';\nimport { createStatefulHost } from './createStatefulHost';\nimport { RetryError } from './errors';\nimport { deserializeFailure, deserializeSuccess, serializeData, serializeHeaders, serializeUrl } from './helpers';\nimport { isRetryable, isSuccess } from './responses';\nimport { stackFrameWithoutCredentials, stackTraceWithoutCredentials } 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 logger,\n baseQueryParameters,\n algoliaAgent,\n timeouts,\n requester,\n requestsCache,\n responsesCache,\n}: TransporterOptions): Transporter {\n async function createRetryableOptions(compatibleHosts: Host[]): Promise {\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(\n request: Request,\n requestOptions: RequestOptions,\n isRead = true,\n ): Promise {\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 => {\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 logger.info('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(request: Request, requestOptions: RequestOptions = {}): Promise {\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\n const createRetryableRequest = (): Promise => {\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 /**\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 logger,\n algoliaAgent,\n baseHeaders,\n baseQueryParameters,\n hosts,\n request: createRequest,\n requestsCache,\n responsesCache,\n };\n}\n","export const LogLevelEnum: Readonly> = {\n Debug: 1,\n Info: 2,\n Error: 3,\n};\n\nexport type LogLevelType = 1 | 2 | 3;\n\nexport type Logger = {\n /**\n * Logs debug messages.\n */\n debug: (message: string, args?: any) => Promise;\n\n /**\n * Logs info messages.\n */\n info: (message: string, args?: any) => Promise;\n\n /**\n * Logs error messages.\n */\n error: (message: string, args?: any) => Promise;\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 {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\nimport { createAuth, createTransporter, getAlgoliaAgent } from '@algolia/client-common';\n\nimport type { Authentication } from '../model/authentication';\nimport type { AuthenticationCreate } from '../model/authenticationCreate';\nimport type { AuthenticationCreateResponse } from '../model/authenticationCreateResponse';\nimport type { AuthenticationSearch } from '../model/authenticationSearch';\n\nimport type { AuthenticationUpdateResponse } from '../model/authenticationUpdateResponse';\nimport type { DeleteResponse } from '../model/deleteResponse';\nimport type { Destination } from '../model/destination';\nimport type { DestinationCreate } from '../model/destinationCreate';\nimport type { DestinationCreateResponse } from '../model/destinationCreateResponse';\nimport type { DestinationSearch } from '../model/destinationSearch';\n\nimport type { DestinationUpdateResponse } from '../model/destinationUpdateResponse';\n\nimport type { Event } from '../model/event';\n\nimport type { ListAuthenticationsResponse } from '../model/listAuthenticationsResponse';\nimport type { ListDestinationsResponse } from '../model/listDestinationsResponse';\nimport type { ListEventsResponse } from '../model/listEventsResponse';\nimport type { ListSourcesResponse } from '../model/listSourcesResponse';\nimport type { ListTasksResponse } from '../model/listTasksResponse';\nimport type { ListTasksResponseV1 } from '../model/listTasksResponseV1';\nimport type { ListTransformationsResponse } from '../model/listTransformationsResponse';\n\nimport type { Run } from '../model/run';\nimport type { RunListResponse } from '../model/runListResponse';\nimport type { RunResponse } from '../model/runResponse';\n\nimport type { RunSourceResponse } from '../model/runSourceResponse';\n\nimport type { Source } from '../model/source';\nimport type { SourceCreate } from '../model/sourceCreate';\nimport type { SourceCreateResponse } from '../model/sourceCreateResponse';\nimport type { SourceSearch } from '../model/sourceSearch';\n\nimport type { SourceUpdateResponse } from '../model/sourceUpdateResponse';\nimport type { Task } from '../model/task';\nimport type { TaskCreate } from '../model/taskCreate';\nimport type { TaskCreateResponse } from '../model/taskCreateResponse';\nimport type { TaskCreateV1 } from '../model/taskCreateV1';\nimport type { TaskSearch } from '../model/taskSearch';\n\nimport type { TaskUpdateResponse } from '../model/taskUpdateResponse';\n\nimport type { TaskV1 } from '../model/taskV1';\nimport type { Transformation } from '../model/transformation';\nimport type { TransformationCreate } from '../model/transformationCreate';\nimport type { TransformationCreateResponse } from '../model/transformationCreateResponse';\nimport type { TransformationSearch } from '../model/transformationSearch';\n\nimport type { TransformationTry } from '../model/transformationTry';\nimport type { TransformationTryResponse } from '../model/transformationTryResponse';\nimport type { TransformationUpdateResponse } from '../model/transformationUpdateResponse';\n\nimport type { WatchResponse } from '../model/watchResponse';\n\nimport type {\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteAuthenticationProps,\n DeleteDestinationProps,\n DeleteSourceProps,\n DeleteTaskProps,\n DeleteTaskV1Props,\n DeleteTransformationProps,\n DisableTaskProps,\n DisableTaskV1Props,\n EnableTaskProps,\n EnableTaskV1Props,\n GetAuthenticationProps,\n GetDestinationProps,\n GetEventProps,\n GetRunProps,\n GetSourceProps,\n GetTaskProps,\n GetTaskV1Props,\n GetTransformationProps,\n ListAuthenticationsProps,\n ListDestinationsProps,\n ListEventsProps,\n ListRunsProps,\n ListSourcesProps,\n ListTasksProps,\n ListTasksV1Props,\n ListTransformationsProps,\n PushTaskProps,\n RunSourceProps,\n RunTaskProps,\n RunTaskV1Props,\n TriggerDockerSourceDiscoverProps,\n TryTransformationBeforeUpdateProps,\n UpdateAuthenticationProps,\n UpdateDestinationProps,\n UpdateSourceProps,\n UpdateTaskProps,\n UpdateTaskV1Props,\n UpdateTransformationProps,\n ValidateSourceBeforeUpdateProps,\n} from '../model/clientMethodProps';\n\nimport type { OnDemandTrigger } from '../model/onDemandTrigger';\nimport type { ScheduleTrigger } from '../model/scheduleTrigger';\nimport type { SubscriptionTrigger } from '../model/subscriptionTrigger';\nimport type { TaskCreateTrigger } from '../model/taskCreateTrigger';\nimport type { Trigger } from '../model/trigger';\n\nexport const apiClientVersion = '1.20.3';\n\nexport const REGIONS = ['eu', 'us'] as const;\nexport type Region = (typeof REGIONS)[number];\nexport type RegionOptions = { region: Region };\n\nfunction getDefaultHosts(region: Region): Host[] {\n const url = 'data.{region}.algolia.com'.replace('{region}', region);\n\n return [{ url, accept: 'readWrite', protocol: 'https' }];\n}\n\n/**\n * Guard: Return strongly typed specific OnDemandTrigger for a given Trigger.\n *\n * @summary Guard method that returns a strongly typed specific OnDemandTrigger for a given Trigger.\n * @param trigger - The given Task Trigger.\n */\nexport function isOnDemandTrigger(trigger: TaskCreateTrigger | Trigger): trigger is OnDemandTrigger {\n return trigger.type === 'onDemand';\n}\n\n/**\n * Guard: Return strongly typed specific ScheduleTrigger for a given Trigger.\n *\n * @summary Guard method that returns a strongly typed specific ScheduleTrigger for a given Trigger.\n * @param trigger - The given Task Trigger.\n */\nexport function isScheduleTrigger(trigger: TaskCreateTrigger | Trigger): trigger is ScheduleTrigger {\n return trigger.type === 'schedule';\n}\n\n/**\n * Guard: Return strongly typed specific SubscriptionTrigger for a given Trigger.\n *\n * @summary Guard method that returns a strongly typed specific SubscriptionTrigger for a given Trigger.\n * @param trigger - The given Task Trigger.\n */\nexport function isSubscriptionTrigger(trigger: TaskCreateTrigger | Trigger): trigger is SubscriptionTrigger {\n return trigger.type === 'subscription';\n}\n\nexport function createIngestionClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n region: regionOption,\n ...options\n}: CreateClientOptions & RegionOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(regionOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Ingestion',\n version: apiClientVersion,\n }),\n baseHeaders: {\n 'content-type': 'text/plain',\n ...auth.headers(),\n ...options.baseHeaders,\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters,\n },\n });\n\n return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * The `apiKey` currently in use.\n */\n apiKey: apiKeyOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise {\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 method to switch the API key used to authenticate the requests.\n *\n * @param params - Method params.\n * @param params.apiKey - The new API Key to use.\n */\n setClientApiKey({ apiKey }: { apiKey: string }): void {\n if (!authMode || authMode === 'WithinHeaders') {\n transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n } else {\n transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;\n }\n },\n\n /**\n * Creates a new authentication resource.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param authenticationCreate -\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n createAuthentication(\n authenticationCreate: AuthenticationCreate,\n requestOptions?: RequestOptions,\n ): Promise {\n if (!authenticationCreate) {\n throw new Error('Parameter `authenticationCreate` is required when calling `createAuthentication`.');\n }\n\n if (!authenticationCreate.type) {\n throw new Error('Parameter `authenticationCreate.type` is required when calling `createAuthentication`.');\n }\n if (!authenticationCreate.name) {\n throw new Error('Parameter `authenticationCreate.name` is required when calling `createAuthentication`.');\n }\n if (!authenticationCreate.input) {\n throw new Error('Parameter `authenticationCreate.input` is required when calling `createAuthentication`.');\n }\n\n const requestPath = '/1/authentications';\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: authenticationCreate,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Creates a new destination.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param destinationCreate -\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n createDestination(\n destinationCreate: DestinationCreate,\n requestOptions?: RequestOptions,\n ): Promise {\n if (!destinationCreate) {\n throw new Error('Parameter `destinationCreate` is required when calling `createDestination`.');\n }\n\n if (!destinationCreate.type) {\n throw new Error('Parameter `destinationCreate.type` is required when calling `createDestination`.');\n }\n if (!destinationCreate.name) {\n throw new Error('Parameter `destinationCreate.name` is required when calling `createDestination`.');\n }\n if (!destinationCreate.input) {\n throw new Error('Parameter `destinationCreate.input` is required when calling `createDestination`.');\n }\n\n const requestPath = '/1/destinations';\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: destinationCreate,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Creates a new source.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param sourceCreate -\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n createSource(sourceCreate: SourceCreate, requestOptions?: RequestOptions): Promise {\n if (!sourceCreate) {\n throw new Error('Parameter `sourceCreate` is required when calling `createSource`.');\n }\n\n if (!sourceCreate.type) {\n throw new Error('Parameter `sourceCreate.type` is required when calling `createSource`.');\n }\n if (!sourceCreate.name) {\n throw new Error('Parameter `sourceCreate.name` is required when calling `createSource`.');\n }\n\n const requestPath = '/1/sources';\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: sourceCreate,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Creates a new task.\n * @param taskCreate - Request body for creating a task.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n createTask(taskCreate: TaskCreate, requestOptions?: RequestOptions): Promise {\n if (!taskCreate) {\n throw new Error('Parameter `taskCreate` is required when calling `createTask`.');\n }\n\n if (!taskCreate.sourceID) {\n throw new Error('Parameter `taskCreate.sourceID` is required when calling `createTask`.');\n }\n if (!taskCreate.destinationID) {\n throw new Error('Parameter `taskCreate.destinationID` is required when calling `createTask`.');\n }\n if (!taskCreate.action) {\n throw new Error('Parameter `taskCreate.action` is required when calling `createTask`.');\n }\n\n const requestPath = '/2/tasks';\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: taskCreate,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Creates a new task using the v1 endpoint, please use `createTask` instead.\n * @param taskCreate - Request body for creating a task.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n createTaskV1(taskCreate: TaskCreateV1, requestOptions?: RequestOptions): Promise {\n if (!taskCreate) {\n throw new Error('Parameter `taskCreate` is required when calling `createTaskV1`.');\n }\n\n if (!taskCreate.sourceID) {\n throw new Error('Parameter `taskCreate.sourceID` is required when calling `createTaskV1`.');\n }\n if (!taskCreate.destinationID) {\n throw new Error('Parameter `taskCreate.destinationID` is required when calling `createTaskV1`.');\n }\n if (!taskCreate.trigger) {\n throw new Error('Parameter `taskCreate.trigger` is required when calling `createTaskV1`.');\n }\n if (!taskCreate.action) {\n throw new Error('Parameter `taskCreate.action` is required when calling `createTaskV1`.');\n }\n\n const requestPath = '/1/tasks';\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: taskCreate,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Creates a new transformation.\n * @param transformationCreate - Request body for creating a transformation.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n createTransformation(\n transformationCreate: TransformationCreate,\n requestOptions?: RequestOptions,\n ): Promise {\n if (!transformationCreate) {\n throw new Error('Parameter `transformationCreate` is required when calling `createTransformation`.');\n }\n\n if (!transformationCreate.code) {\n throw new Error('Parameter `transformationCreate.code` is required when calling `createTransformation`.');\n }\n if (!transformationCreate.name) {\n throw new Error('Parameter `transformationCreate.name` is required when calling `createTransformation`.');\n }\n\n const requestPath = '/1/transformations';\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: transformationCreate,\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 * @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> {\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 * @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> {\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 * @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> {\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 * @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> {\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 authentication resource. You can\\'t delete authentication resources that are used by a source or a destination.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param deleteAuthentication - The deleteAuthentication object.\n * @param deleteAuthentication.authenticationID - Unique identifier of an authentication resource.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteAuthentication(\n { authenticationID }: DeleteAuthenticationProps,\n requestOptions?: RequestOptions,\n ): Promise {\n if (!authenticationID) {\n throw new Error('Parameter `authenticationID` is required when calling `deleteAuthentication`.');\n }\n\n const requestPath = '/1/authentications/{authenticationID}'.replace(\n '{authenticationID}',\n encodeURIComponent(authenticationID),\n );\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 destination by its ID. You can\\'t delete destinations that are referenced in tasks.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param deleteDestination - The deleteDestination object.\n * @param deleteDestination.destinationID - Unique identifier of a destination.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteDestination(\n { destinationID }: DeleteDestinationProps,\n requestOptions?: RequestOptions,\n ): Promise {\n if (!destinationID) {\n throw new Error('Parameter `destinationID` is required when calling `deleteDestination`.');\n }\n\n const requestPath = '/1/destinations/{destinationID}'.replace(\n '{destinationID}',\n encodeURIComponent(destinationID),\n );\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 source by its ID. You can\\'t delete sources that are referenced in tasks.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param deleteSource - The deleteSource object.\n * @param deleteSource.sourceID - Unique identifier of a source.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteSource({ sourceID }: DeleteSourceProps, requestOptions?: RequestOptions): Promise {\n if (!sourceID) {\n throw new Error('Parameter `sourceID` is required when calling `deleteSource`.');\n }\n\n const requestPath = '/1/sources/{sourceID}'.replace('{sourceID}', encodeURIComponent(sourceID));\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 task by its ID.\n * @param deleteTask - The deleteTask object.\n * @param deleteTask.taskID - Unique identifier of a task.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteTask({ taskID }: DeleteTaskProps, requestOptions?: RequestOptions): Promise {\n if (!taskID) {\n throw new Error('Parameter `taskID` is required when calling `deleteTask`.');\n }\n\n const requestPath = '/2/tasks/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));\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 task by its ID using the v1 endpoint, please use `deleteTask` instead.\n * @param deleteTaskV1 - The deleteTaskV1 object.\n * @param deleteTaskV1.taskID - Unique identifier of a task.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteTaskV1({ taskID }: DeleteTaskV1Props, requestOptions?: RequestOptions): Promise {\n if (!taskID) {\n throw new Error('Parameter `taskID` is required when calling `deleteTaskV1`.');\n }\n\n const requestPath = '/1/tasks/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));\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 transformation by its ID.\n * @param deleteTransformation - The deleteTransformation object.\n * @param deleteTransformation.transformationID - Unique identifier of a transformation.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteTransformation(\n { transformationID }: DeleteTransformationProps,\n requestOptions?: RequestOptions,\n ): Promise {\n if (!transformationID) {\n throw new Error('Parameter `transformationID` is required when calling `deleteTransformation`.');\n }\n\n const requestPath = '/1/transformations/{transformationID}'.replace(\n '{transformationID}',\n encodeURIComponent(transformationID),\n );\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 * Disables a task.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param disableTask - The disableTask object.\n * @param disableTask.taskID - Unique identifier of a task.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n disableTask({ taskID }: DisableTaskProps, requestOptions?: RequestOptions): Promise {\n if (!taskID) {\n throw new Error('Parameter `taskID` is required when calling `disableTask`.');\n }\n\n const requestPath = '/2/tasks/{taskID}/disable'.replace('{taskID}', encodeURIComponent(taskID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Disables a task using the v1 endpoint, please use `disableTask` instead.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param disableTaskV1 - The disableTaskV1 object.\n * @param disableTaskV1.taskID - Unique identifier of a task.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n disableTaskV1({ taskID }: DisableTaskV1Props, requestOptions?: RequestOptions): Promise {\n if (!taskID) {\n throw new Error('Parameter `taskID` is required when calling `disableTaskV1`.');\n }\n\n const requestPath = '/1/tasks/{taskID}/disable'.replace('{taskID}', encodeURIComponent(taskID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Enables a task.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param enableTask - The enableTask object.\n * @param enableTask.taskID - Unique identifier of a task.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n enableTask({ taskID }: EnableTaskProps, requestOptions?: RequestOptions): Promise {\n if (!taskID) {\n throw new Error('Parameter `taskID` is required when calling `enableTask`.');\n }\n\n const requestPath = '/2/tasks/{taskID}/enable'.replace('{taskID}', encodeURIComponent(taskID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Enables a task using the v1 endpoint, please use `enableTask` instead.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param enableTaskV1 - The enableTaskV1 object.\n * @param enableTaskV1.taskID - Unique identifier of a task.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n enableTaskV1({ taskID }: EnableTaskV1Props, requestOptions?: RequestOptions): Promise {\n if (!taskID) {\n throw new Error('Parameter `taskID` is required when calling `enableTaskV1`.');\n }\n\n const requestPath = '/1/tasks/{taskID}/enable'.replace('{taskID}', encodeURIComponent(taskID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves an authentication resource by its ID.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param getAuthentication - The getAuthentication object.\n * @param getAuthentication.authenticationID - Unique identifier of an authentication resource.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getAuthentication(\n { authenticationID }: GetAuthenticationProps,\n requestOptions?: RequestOptions,\n ): Promise {\n if (!authenticationID) {\n throw new Error('Parameter `authenticationID` is required when calling `getAuthentication`.');\n }\n\n const requestPath = '/1/authentications/{authenticationID}'.replace(\n '{authenticationID}',\n encodeURIComponent(authenticationID),\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 * Retrieves a destination by its ID.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param getDestination - The getDestination object.\n * @param getDestination.destinationID - Unique identifier of a destination.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getDestination({ destinationID }: GetDestinationProps, requestOptions?: RequestOptions): Promise {\n if (!destinationID) {\n throw new Error('Parameter `destinationID` is required when calling `getDestination`.');\n }\n\n const requestPath = '/1/destinations/{destinationID}'.replace(\n '{destinationID}',\n encodeURIComponent(destinationID),\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 * Retrieves a single task run event by its ID.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param getEvent - The getEvent object.\n * @param getEvent.runID - Unique identifier of a task run.\n * @param getEvent.eventID - Unique identifier of an event.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getEvent({ runID, eventID }: GetEventProps, requestOptions?: RequestOptions): Promise {\n if (!runID) {\n throw new Error('Parameter `runID` is required when calling `getEvent`.');\n }\n\n if (!eventID) {\n throw new Error('Parameter `eventID` is required when calling `getEvent`.');\n }\n\n const requestPath = '/1/runs/{runID}/events/{eventID}'\n .replace('{runID}', encodeURIComponent(runID))\n .replace('{eventID}', encodeURIComponent(eventID));\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 * Retrieve a single task run by its ID.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param getRun - The getRun object.\n * @param getRun.runID - Unique identifier of a task run.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRun({ runID }: GetRunProps, requestOptions?: RequestOptions): Promise {\n if (!runID) {\n throw new Error('Parameter `runID` is required when calling `getRun`.');\n }\n\n const requestPath = '/1/runs/{runID}'.replace('{runID}', encodeURIComponent(runID));\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 * Retrieve a source by its ID.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param getSource - The getSource object.\n * @param getSource.sourceID - Unique identifier of a source.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getSource({ sourceID }: GetSourceProps, requestOptions?: RequestOptions): Promise {\n if (!sourceID) {\n throw new Error('Parameter `sourceID` is required when calling `getSource`.');\n }\n\n const requestPath = '/1/sources/{sourceID}'.replace('{sourceID}', encodeURIComponent(sourceID));\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 task by its ID.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param getTask - The getTask object.\n * @param getTask.taskID - Unique identifier of a task.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getTask({ taskID }: GetTaskProps, requestOptions?: RequestOptions): Promise {\n if (!taskID) {\n throw new Error('Parameter `taskID` is required when calling `getTask`.');\n }\n\n const requestPath = '/2/tasks/{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 * Retrieves a task by its ID using the v1 endpoint, please use `getTask` instead.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param getTaskV1 - The getTaskV1 object.\n * @param getTaskV1.taskID - Unique identifier of a task.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getTaskV1({ taskID }: GetTaskV1Props, requestOptions?: RequestOptions): Promise {\n if (!taskID) {\n throw new Error('Parameter `taskID` is required when calling `getTaskV1`.');\n }\n\n const requestPath = '/1/tasks/{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 * Retrieves a transformation by its ID.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param getTransformation - The getTransformation object.\n * @param getTransformation.transformationID - Unique identifier of a transformation.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getTransformation(\n { transformationID }: GetTransformationProps,\n requestOptions?: RequestOptions,\n ): Promise {\n if (!transformationID) {\n throw new Error('Parameter `transformationID` is required when calling `getTransformation`.');\n }\n\n const requestPath = '/1/transformations/{transformationID}'.replace(\n '{transformationID}',\n encodeURIComponent(transformationID),\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 * Retrieves a list of all authentication resources.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param listAuthentications - The listAuthentications object.\n * @param listAuthentications.itemsPerPage - Number of items per page.\n * @param listAuthentications.page - Page number of the paginated API response.\n * @param listAuthentications.type - Type of authentication resource to retrieve.\n * @param listAuthentications.platform - Ecommerce platform for which to retrieve authentications.\n * @param listAuthentications.sort - Property by which to sort the list of authentications.\n * @param listAuthentications.order - Sort order of the response, ascending or descending.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n listAuthentications(\n { itemsPerPage, page, type, platform, sort, order }: ListAuthenticationsProps = {},\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise {\n const requestPath = '/1/authentications';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (itemsPerPage !== undefined) {\n queryParameters['itemsPerPage'] = itemsPerPage.toString();\n }\n\n if (page !== undefined) {\n queryParameters['page'] = page.toString();\n }\n\n if (type !== undefined) {\n queryParameters['type'] = type.toString();\n }\n\n if (platform !== undefined) {\n queryParameters['platform'] = platform.toString();\n }\n\n if (sort !== undefined) {\n queryParameters['sort'] = sort.toString();\n }\n\n if (order !== undefined) {\n queryParameters['order'] = order.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 a list of destinations.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param listDestinations - The listDestinations object.\n * @param listDestinations.itemsPerPage - Number of items per page.\n * @param listDestinations.page - Page number of the paginated API response.\n * @param listDestinations.type - Destination type.\n * @param listDestinations.authenticationID - Authentication ID used by destinations.\n * @param listDestinations.transformationID - Get the list of destinations used by a transformation.\n * @param listDestinations.sort - Property by which to sort the destinations.\n * @param listDestinations.order - Sort order of the response, ascending or descending.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n listDestinations(\n { itemsPerPage, page, type, authenticationID, transformationID, sort, order }: ListDestinationsProps = {},\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise {\n const requestPath = '/1/destinations';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (itemsPerPage !== undefined) {\n queryParameters['itemsPerPage'] = itemsPerPage.toString();\n }\n\n if (page !== undefined) {\n queryParameters['page'] = page.toString();\n }\n\n if (type !== undefined) {\n queryParameters['type'] = type.toString();\n }\n\n if (authenticationID !== undefined) {\n queryParameters['authenticationID'] = authenticationID.toString();\n }\n\n if (transformationID !== undefined) {\n queryParameters['transformationID'] = transformationID.toString();\n }\n\n if (sort !== undefined) {\n queryParameters['sort'] = sort.toString();\n }\n\n if (order !== undefined) {\n queryParameters['order'] = order.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 a list of events for a task run, identified by its ID.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param listEvents - The listEvents object.\n * @param listEvents.runID - Unique identifier of a task run.\n * @param listEvents.itemsPerPage - Number of items per page.\n * @param listEvents.page - Page number of the paginated API response.\n * @param listEvents.status - Event status for filtering the list of task runs.\n * @param listEvents.type - Event type for filtering the list of task runs.\n * @param listEvents.sort - Property by which to sort the list of task run events.\n * @param listEvents.order - Sort order of the response, ascending or descending.\n * @param listEvents.startDate - Date and time in RFC 3339 format for the earliest events to retrieve. By default, the current time minus three hours is used.\n * @param listEvents.endDate - Date and time in RFC 3339 format for the latest events to retrieve. By default, the current time is used.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n listEvents(\n { runID, itemsPerPage, page, status, type, sort, order, startDate, endDate }: ListEventsProps,\n requestOptions?: RequestOptions,\n ): Promise {\n if (!runID) {\n throw new Error('Parameter `runID` is required when calling `listEvents`.');\n }\n\n const requestPath = '/1/runs/{runID}/events'.replace('{runID}', encodeURIComponent(runID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (itemsPerPage !== undefined) {\n queryParameters['itemsPerPage'] = itemsPerPage.toString();\n }\n\n if (page !== undefined) {\n queryParameters['page'] = page.toString();\n }\n\n if (status !== undefined) {\n queryParameters['status'] = status.toString();\n }\n\n if (type !== undefined) {\n queryParameters['type'] = type.toString();\n }\n\n if (sort !== undefined) {\n queryParameters['sort'] = sort.toString();\n }\n\n if (order !== undefined) {\n queryParameters['order'] = order.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\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 * Retrieve a list of task runs.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param listRuns - The listRuns object.\n * @param listRuns.itemsPerPage - Number of items per page.\n * @param listRuns.page - Page number of the paginated API response.\n * @param listRuns.status - Run status for filtering the list of task runs.\n * @param listRuns.type - Run type for filtering the list of task runs.\n * @param listRuns.taskID - Task ID for filtering the list of task runs.\n * @param listRuns.sort - Property by which to sort the list of task runs.\n * @param listRuns.order - Sort order of the response, ascending or descending.\n * @param listRuns.startDate - Date in RFC 3339 format for the earliest run to retrieve. By default, the current day minus seven days is used.\n * @param listRuns.endDate - Date in RFC 3339 format for the latest run to retrieve. By default, the current day is used.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n listRuns(\n { itemsPerPage, page, status, type, taskID, sort, order, startDate, endDate }: ListRunsProps = {},\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise {\n const requestPath = '/1/runs';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (itemsPerPage !== undefined) {\n queryParameters['itemsPerPage'] = itemsPerPage.toString();\n }\n\n if (page !== undefined) {\n queryParameters['page'] = page.toString();\n }\n\n if (status !== undefined) {\n queryParameters['status'] = status.toString();\n }\n\n if (type !== undefined) {\n queryParameters['type'] = type.toString();\n }\n\n if (taskID !== undefined) {\n queryParameters['taskID'] = taskID.toString();\n }\n\n if (sort !== undefined) {\n queryParameters['sort'] = sort.toString();\n }\n\n if (order !== undefined) {\n queryParameters['order'] = order.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\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 list of sources.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param listSources - The listSources object.\n * @param listSources.itemsPerPage - Number of items per page.\n * @param listSources.page - Page number of the paginated API response.\n * @param listSources.type - Source type. Some sources require authentication.\n * @param listSources.authenticationID - Authentication IDs of the sources to retrieve. \\'none\\' returns sources that doesn\\'t have an authentication.\n * @param listSources.sort - Property by which to sort the list of sources.\n * @param listSources.order - Sort order of the response, ascending or descending.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n listSources(\n { itemsPerPage, page, type, authenticationID, sort, order }: ListSourcesProps = {},\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise {\n const requestPath = '/1/sources';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (itemsPerPage !== undefined) {\n queryParameters['itemsPerPage'] = itemsPerPage.toString();\n }\n\n if (page !== undefined) {\n queryParameters['page'] = page.toString();\n }\n\n if (type !== undefined) {\n queryParameters['type'] = type.toString();\n }\n\n if (authenticationID !== undefined) {\n queryParameters['authenticationID'] = authenticationID.toString();\n }\n\n if (sort !== undefined) {\n queryParameters['sort'] = sort.toString();\n }\n\n if (order !== undefined) {\n queryParameters['order'] = order.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 a list of tasks.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param listTasks - The listTasks object.\n * @param listTasks.itemsPerPage - Number of items per page.\n * @param listTasks.page - Page number of the paginated API response.\n * @param listTasks.action - Actions for filtering the list of tasks.\n * @param listTasks.enabled - Whether to filter the list of tasks by the `enabled` status.\n * @param listTasks.sourceID - Source IDs for filtering the list of tasks.\n * @param listTasks.sourceType - Filters the tasks with the specified source type.\n * @param listTasks.destinationID - Destination IDs for filtering the list of tasks.\n * @param listTasks.triggerType - Type of task trigger for filtering the list of tasks.\n * @param listTasks.withEmailNotifications - If specified, the response only includes tasks with notifications.email.enabled set to this value.\n * @param listTasks.sort - Property by which to sort the list of tasks.\n * @param listTasks.order - Sort order of the response, ascending or descending.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n listTasks(\n {\n itemsPerPage,\n page,\n action,\n enabled,\n sourceID,\n sourceType,\n destinationID,\n triggerType,\n withEmailNotifications,\n sort,\n order,\n }: ListTasksProps = {},\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise {\n const requestPath = '/2/tasks';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (itemsPerPage !== undefined) {\n queryParameters['itemsPerPage'] = itemsPerPage.toString();\n }\n\n if (page !== undefined) {\n queryParameters['page'] = page.toString();\n }\n\n if (action !== undefined) {\n queryParameters['action'] = action.toString();\n }\n\n if (enabled !== undefined) {\n queryParameters['enabled'] = enabled.toString();\n }\n\n if (sourceID !== undefined) {\n queryParameters['sourceID'] = sourceID.toString();\n }\n\n if (sourceType !== undefined) {\n queryParameters['sourceType'] = sourceType.toString();\n }\n\n if (destinationID !== undefined) {\n queryParameters['destinationID'] = destinationID.toString();\n }\n\n if (triggerType !== undefined) {\n queryParameters['triggerType'] = triggerType.toString();\n }\n\n if (withEmailNotifications !== undefined) {\n queryParameters['withEmailNotifications'] = withEmailNotifications.toString();\n }\n\n if (sort !== undefined) {\n queryParameters['sort'] = sort.toString();\n }\n\n if (order !== undefined) {\n queryParameters['order'] = order.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 a list of tasks using the v1 endpoint, please use `getTasks` instead.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param listTasksV1 - The listTasksV1 object.\n * @param listTasksV1.itemsPerPage - Number of items per page.\n * @param listTasksV1.page - Page number of the paginated API response.\n * @param listTasksV1.action - Actions for filtering the list of tasks.\n * @param listTasksV1.enabled - Whether to filter the list of tasks by the `enabled` status.\n * @param listTasksV1.sourceID - Source IDs for filtering the list of tasks.\n * @param listTasksV1.destinationID - Destination IDs for filtering the list of tasks.\n * @param listTasksV1.triggerType - Type of task trigger for filtering the list of tasks.\n * @param listTasksV1.sort - Property by which to sort the list of tasks.\n * @param listTasksV1.order - Sort order of the response, ascending or descending.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n listTasksV1(\n { itemsPerPage, page, action, enabled, sourceID, destinationID, triggerType, sort, order }: ListTasksV1Props = {},\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise {\n const requestPath = '/1/tasks';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (itemsPerPage !== undefined) {\n queryParameters['itemsPerPage'] = itemsPerPage.toString();\n }\n\n if (page !== undefined) {\n queryParameters['page'] = page.toString();\n }\n\n if (action !== undefined) {\n queryParameters['action'] = action.toString();\n }\n\n if (enabled !== undefined) {\n queryParameters['enabled'] = enabled.toString();\n }\n\n if (sourceID !== undefined) {\n queryParameters['sourceID'] = sourceID.toString();\n }\n\n if (destinationID !== undefined) {\n queryParameters['destinationID'] = destinationID.toString();\n }\n\n if (triggerType !== undefined) {\n queryParameters['triggerType'] = triggerType.toString();\n }\n\n if (sort !== undefined) {\n queryParameters['sort'] = sort.toString();\n }\n\n if (order !== undefined) {\n queryParameters['order'] = order.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 a list of transformations.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param listTransformations - The listTransformations object.\n * @param listTransformations.itemsPerPage - Number of items per page.\n * @param listTransformations.page - Page number of the paginated API response.\n * @param listTransformations.sort - Property by which to sort the list of transformations.\n * @param listTransformations.order - Sort order of the response, ascending or descending.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n listTransformations(\n { itemsPerPage, page, sort, order }: ListTransformationsProps = {},\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise {\n const requestPath = '/1/transformations';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (itemsPerPage !== undefined) {\n queryParameters['itemsPerPage'] = itemsPerPage.toString();\n }\n\n if (page !== undefined) {\n queryParameters['page'] = page.toString();\n }\n\n if (sort !== undefined) {\n queryParameters['sort'] = sort.toString();\n }\n\n if (order !== undefined) {\n queryParameters['order'] = order.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 * Push a `batch` request payload through the Pipeline. You can check the status of task pushes with the observability endpoints.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param pushTask - The pushTask object.\n * @param pushTask.taskID - Unique identifier of a task.\n * @param pushTask.pushTaskPayload - Request body of a Search API `batch` request that will be pushed in the Connectors pipeline.\n * @param pushTask.watch - When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n pushTask(\n { taskID, pushTaskPayload, watch }: PushTaskProps,\n requestOptions?: RequestOptions,\n ): Promise {\n if (!taskID) {\n throw new Error('Parameter `taskID` is required when calling `pushTask`.');\n }\n\n if (!pushTaskPayload) {\n throw new Error('Parameter `pushTaskPayload` is required when calling `pushTask`.');\n }\n\n if (!pushTaskPayload.action) {\n throw new Error('Parameter `pushTaskPayload.action` is required when calling `pushTask`.');\n }\n if (!pushTaskPayload.records) {\n throw new Error('Parameter `pushTaskPayload.records` is required when calling `pushTask`.');\n }\n\n const requestPath = '/2/tasks/{taskID}/push'.replace('{taskID}', encodeURIComponent(taskID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (watch !== undefined) {\n queryParameters['watch'] = watch.toString();\n }\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: pushTaskPayload,\n };\n\n requestOptions = {\n timeouts: {\n connect: 180000,\n read: 180000,\n write: 180000,\n ...requestOptions?.timeouts,\n },\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Runs all tasks linked to a source, only available for Shopify sources. It will create 1 run per task.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param runSource - The runSource object.\n * @param runSource.sourceID - Unique identifier of a source.\n * @param runSource.runSourcePayload -\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n runSource(\n { sourceID, runSourcePayload }: RunSourceProps,\n requestOptions?: RequestOptions,\n ): Promise {\n if (!sourceID) {\n throw new Error('Parameter `sourceID` is required when calling `runSource`.');\n }\n\n const requestPath = '/1/sources/{sourceID}/run'.replace('{sourceID}', encodeURIComponent(sourceID));\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: runSourcePayload ? runSourcePayload : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Runs a task. You can check the status of task runs with the observability endpoints.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param runTask - The runTask object.\n * @param runTask.taskID - Unique identifier of a task.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n runTask({ taskID }: RunTaskProps, requestOptions?: RequestOptions): Promise {\n if (!taskID) {\n throw new Error('Parameter `taskID` is required when calling `runTask`.');\n }\n\n const requestPath = '/2/tasks/{taskID}/run'.replace('{taskID}', encodeURIComponent(taskID));\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 * Runs a task using the v1 endpoint, please use `runTask` instead. You can check the status of task runs with the observability endpoints.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param runTaskV1 - The runTaskV1 object.\n * @param runTaskV1.taskID - Unique identifier of a task.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n runTaskV1({ taskID }: RunTaskV1Props, requestOptions?: RequestOptions): Promise {\n if (!taskID) {\n throw new Error('Parameter `taskID` is required when calling `runTaskV1`.');\n }\n\n const requestPath = '/1/tasks/{taskID}/run'.replace('{taskID}', encodeURIComponent(taskID));\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 * Searches for authentication resources.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param authenticationSearch - The authenticationSearch object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchAuthentications(\n authenticationSearch: AuthenticationSearch,\n requestOptions?: RequestOptions,\n ): Promise> {\n if (!authenticationSearch) {\n throw new Error('Parameter `authenticationSearch` is required when calling `searchAuthentications`.');\n }\n\n if (!authenticationSearch.authenticationIDs) {\n throw new Error(\n 'Parameter `authenticationSearch.authenticationIDs` is required when calling `searchAuthentications`.',\n );\n }\n\n const requestPath = '/1/authentications/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: authenticationSearch,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Searches for destinations.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param destinationSearch - The destinationSearch object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchDestinations(\n destinationSearch: DestinationSearch,\n requestOptions?: RequestOptions,\n ): Promise> {\n if (!destinationSearch) {\n throw new Error('Parameter `destinationSearch` is required when calling `searchDestinations`.');\n }\n\n if (!destinationSearch.destinationIDs) {\n throw new Error('Parameter `destinationSearch.destinationIDs` is required when calling `searchDestinations`.');\n }\n\n const requestPath = '/1/destinations/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: destinationSearch,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Searches for sources.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param sourceSearch - The sourceSearch object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchSources(sourceSearch: SourceSearch, requestOptions?: RequestOptions): Promise> {\n if (!sourceSearch) {\n throw new Error('Parameter `sourceSearch` is required when calling `searchSources`.');\n }\n\n if (!sourceSearch.sourceIDs) {\n throw new Error('Parameter `sourceSearch.sourceIDs` is required when calling `searchSources`.');\n }\n\n const requestPath = '/1/sources/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: sourceSearch,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Searches for tasks.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param taskSearch - The taskSearch object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchTasks(taskSearch: TaskSearch, requestOptions?: RequestOptions): Promise> {\n if (!taskSearch) {\n throw new Error('Parameter `taskSearch` is required when calling `searchTasks`.');\n }\n\n if (!taskSearch.taskIDs) {\n throw new Error('Parameter `taskSearch.taskIDs` is required when calling `searchTasks`.');\n }\n\n const requestPath = '/2/tasks/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: taskSearch,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Searches for tasks using the v1 endpoint, please use `searchTasks` instead.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param taskSearch - The taskSearch object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchTasksV1(taskSearch: TaskSearch, requestOptions?: RequestOptions): Promise> {\n if (!taskSearch) {\n throw new Error('Parameter `taskSearch` is required when calling `searchTasksV1`.');\n }\n\n if (!taskSearch.taskIDs) {\n throw new Error('Parameter `taskSearch.taskIDs` is required when calling `searchTasksV1`.');\n }\n\n const requestPath = '/1/tasks/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: taskSearch,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Searches for transformations.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param transformationSearch - The transformationSearch object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchTransformations(\n transformationSearch: TransformationSearch,\n requestOptions?: RequestOptions,\n ): Promise> {\n if (!transformationSearch) {\n throw new Error('Parameter `transformationSearch` is required when calling `searchTransformations`.');\n }\n\n if (!transformationSearch.transformationIDs) {\n throw new Error(\n 'Parameter `transformationSearch.transformationIDs` is required when calling `searchTransformations`.',\n );\n }\n\n const requestPath = '/1/transformations/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: transformationSearch,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Triggers a stream-listing request for a source. Triggering stream-listing requests only works with sources with `type: docker` and `imageType: airbyte`.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param triggerDockerSourceDiscover - The triggerDockerSourceDiscover object.\n * @param triggerDockerSourceDiscover.sourceID - Unique identifier of a source.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n triggerDockerSourceDiscover(\n { sourceID }: TriggerDockerSourceDiscoverProps,\n requestOptions?: RequestOptions,\n ): Promise {\n if (!sourceID) {\n throw new Error('Parameter `sourceID` is required when calling `triggerDockerSourceDiscover`.');\n }\n\n const requestPath = '/1/sources/{sourceID}/discover'.replace('{sourceID}', encodeURIComponent(sourceID));\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 requestOptions = {\n timeouts: {\n connect: 180000,\n read: 180000,\n write: 180000,\n ...requestOptions?.timeouts,\n },\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Try a transformation before creating it.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param transformationTry - The transformationTry object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n tryTransformation(\n transformationTry: TransformationTry,\n requestOptions?: RequestOptions,\n ): Promise {\n if (!transformationTry) {\n throw new Error('Parameter `transformationTry` is required when calling `tryTransformation`.');\n }\n\n if (!transformationTry.code) {\n throw new Error('Parameter `transformationTry.code` is required when calling `tryTransformation`.');\n }\n if (!transformationTry.sampleRecord) {\n throw new Error('Parameter `transformationTry.sampleRecord` is required when calling `tryTransformation`.');\n }\n\n const requestPath = '/1/transformations/try';\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: transformationTry,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Try a transformation before updating it.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param tryTransformationBeforeUpdate - The tryTransformationBeforeUpdate object.\n * @param tryTransformationBeforeUpdate.transformationID - Unique identifier of a transformation.\n * @param tryTransformationBeforeUpdate.transformationTry - The transformationTry object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n tryTransformationBeforeUpdate(\n { transformationID, transformationTry }: TryTransformationBeforeUpdateProps,\n requestOptions?: RequestOptions,\n ): Promise {\n if (!transformationID) {\n throw new Error('Parameter `transformationID` is required when calling `tryTransformationBeforeUpdate`.');\n }\n\n if (!transformationTry) {\n throw new Error('Parameter `transformationTry` is required when calling `tryTransformationBeforeUpdate`.');\n }\n\n if (!transformationTry.code) {\n throw new Error('Parameter `transformationTry.code` is required when calling `tryTransformationBeforeUpdate`.');\n }\n if (!transformationTry.sampleRecord) {\n throw new Error(\n 'Parameter `transformationTry.sampleRecord` is required when calling `tryTransformationBeforeUpdate`.',\n );\n }\n\n const requestPath = '/1/transformations/{transformationID}/try'.replace(\n '{transformationID}',\n encodeURIComponent(transformationID),\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: transformationTry,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Updates an authentication resource.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param updateAuthentication - The updateAuthentication object.\n * @param updateAuthentication.authenticationID - Unique identifier of an authentication resource.\n * @param updateAuthentication.authenticationUpdate - The authenticationUpdate object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n updateAuthentication(\n { authenticationID, authenticationUpdate }: UpdateAuthenticationProps,\n requestOptions?: RequestOptions,\n ): Promise {\n if (!authenticationID) {\n throw new Error('Parameter `authenticationID` is required when calling `updateAuthentication`.');\n }\n\n if (!authenticationUpdate) {\n throw new Error('Parameter `authenticationUpdate` is required when calling `updateAuthentication`.');\n }\n\n const requestPath = '/1/authentications/{authenticationID}'.replace(\n '{authenticationID}',\n encodeURIComponent(authenticationID),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'PATCH',\n path: requestPath,\n queryParameters,\n headers,\n data: authenticationUpdate,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Updates the destination by its ID.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param updateDestination - The updateDestination object.\n * @param updateDestination.destinationID - Unique identifier of a destination.\n * @param updateDestination.destinationUpdate - The destinationUpdate object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n updateDestination(\n { destinationID, destinationUpdate }: UpdateDestinationProps,\n requestOptions?: RequestOptions,\n ): Promise {\n if (!destinationID) {\n throw new Error('Parameter `destinationID` is required when calling `updateDestination`.');\n }\n\n if (!destinationUpdate) {\n throw new Error('Parameter `destinationUpdate` is required when calling `updateDestination`.');\n }\n\n const requestPath = '/1/destinations/{destinationID}'.replace(\n '{destinationID}',\n encodeURIComponent(destinationID),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'PATCH',\n path: requestPath,\n queryParameters,\n headers,\n data: destinationUpdate,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Updates a source by its ID.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param updateSource - The updateSource object.\n * @param updateSource.sourceID - Unique identifier of a source.\n * @param updateSource.sourceUpdate - The sourceUpdate object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n updateSource(\n { sourceID, sourceUpdate }: UpdateSourceProps,\n requestOptions?: RequestOptions,\n ): Promise {\n if (!sourceID) {\n throw new Error('Parameter `sourceID` is required when calling `updateSource`.');\n }\n\n if (!sourceUpdate) {\n throw new Error('Parameter `sourceUpdate` is required when calling `updateSource`.');\n }\n\n const requestPath = '/1/sources/{sourceID}'.replace('{sourceID}', encodeURIComponent(sourceID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'PATCH',\n path: requestPath,\n queryParameters,\n headers,\n data: sourceUpdate,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Updates a task by its ID.\n * @param updateTask - The updateTask object.\n * @param updateTask.taskID - Unique identifier of a task.\n * @param updateTask.taskUpdate - The taskUpdate object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n updateTask({ taskID, taskUpdate }: UpdateTaskProps, requestOptions?: RequestOptions): Promise {\n if (!taskID) {\n throw new Error('Parameter `taskID` is required when calling `updateTask`.');\n }\n\n if (!taskUpdate) {\n throw new Error('Parameter `taskUpdate` is required when calling `updateTask`.');\n }\n\n const requestPath = '/2/tasks/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'PATCH',\n path: requestPath,\n queryParameters,\n headers,\n data: taskUpdate,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Updates a task by its ID using the v1 endpoint, please use `updateTask` instead.\n * @param updateTaskV1 - The updateTaskV1 object.\n * @param updateTaskV1.taskID - Unique identifier of a task.\n * @param updateTaskV1.taskUpdate - The taskUpdate object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n updateTaskV1(\n { taskID, taskUpdate }: UpdateTaskV1Props,\n requestOptions?: RequestOptions,\n ): Promise {\n if (!taskID) {\n throw new Error('Parameter `taskID` is required when calling `updateTaskV1`.');\n }\n\n if (!taskUpdate) {\n throw new Error('Parameter `taskUpdate` is required when calling `updateTaskV1`.');\n }\n\n const requestPath = '/1/tasks/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'PATCH',\n path: requestPath,\n queryParameters,\n headers,\n data: taskUpdate,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Updates a transformation by its ID.\n * @param updateTransformation - The updateTransformation object.\n * @param updateTransformation.transformationID - Unique identifier of a transformation.\n * @param updateTransformation.transformationCreate - The transformationCreate object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n updateTransformation(\n { transformationID, transformationCreate }: UpdateTransformationProps,\n requestOptions?: RequestOptions,\n ): Promise {\n if (!transformationID) {\n throw new Error('Parameter `transformationID` is required when calling `updateTransformation`.');\n }\n\n if (!transformationCreate) {\n throw new Error('Parameter `transformationCreate` is required when calling `updateTransformation`.');\n }\n\n if (!transformationCreate.code) {\n throw new Error('Parameter `transformationCreate.code` is required when calling `updateTransformation`.');\n }\n if (!transformationCreate.name) {\n throw new Error('Parameter `transformationCreate.name` is required when calling `updateTransformation`.');\n }\n\n const requestPath = '/1/transformations/{transformationID}'.replace(\n '{transformationID}',\n encodeURIComponent(transformationID),\n );\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: transformationCreate,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Validates a source payload to ensure it can be created and that the data source can be reached by Algolia.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param sourceCreate -\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n validateSource(\n sourceCreate: SourceCreate,\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise {\n const requestPath = '/1/sources/validate';\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: sourceCreate ? sourceCreate : {},\n };\n\n requestOptions = {\n timeouts: {\n connect: 180000,\n read: 180000,\n write: 180000,\n ...requestOptions?.timeouts,\n },\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Validates an update of a source payload to ensure it can be created and that the data source can be reached by Algolia.\n *\n * Required API Key ACLs:\n * - addObject\n * - deleteIndex\n * - editSettings\n * @param validateSourceBeforeUpdate - The validateSourceBeforeUpdate object.\n * @param validateSourceBeforeUpdate.sourceID - Unique identifier of a source.\n * @param validateSourceBeforeUpdate.sourceUpdate - The sourceUpdate object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n validateSourceBeforeUpdate(\n { sourceID, sourceUpdate }: ValidateSourceBeforeUpdateProps,\n requestOptions?: RequestOptions,\n ): Promise {\n if (!sourceID) {\n throw new Error('Parameter `sourceID` is required when calling `validateSourceBeforeUpdate`.');\n }\n\n if (!sourceUpdate) {\n throw new Error('Parameter `sourceUpdate` is required when calling `validateSourceBeforeUpdate`.');\n }\n\n const requestPath = '/1/sources/{sourceID}/validate'.replace('{sourceID}', encodeURIComponent(sourceID));\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: sourceUpdate,\n };\n\n requestOptions = {\n timeouts: {\n connect: 180000,\n read: 180000,\n write: 180000,\n ...requestOptions?.timeouts,\n },\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 { createXhrRequester } from '@algolia/requester-browser-xhr';\n\nimport {\n createBrowserLocalStorageCache,\n createFallbackableCache,\n createMemoryCache,\n createNullLogger,\n} from '@algolia/client-common';\n\nimport type { ClientOptions } from '@algolia/client-common';\n\nimport { apiClientVersion, createIngestionClient } from '../src/ingestionClient';\n\nimport type { Region } from '../src/ingestionClient';\nimport { REGIONS } from '../src/ingestionClient';\n\nexport type { Region, RegionOptions } from '../src/ingestionClient';\n\nexport { apiClientVersion, isOnDemandTrigger, isScheduleTrigger, isSubscriptionTrigger } from '../src/ingestionClient';\n\nexport * from '../model';\n\nexport function ingestionClient(\n appId: string,\n apiKey: string,\n region: Region,\n options?: ClientOptions,\n): IngestionClient {\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 createIngestionClient({\n appId,\n apiKey,\n region,\n timeouts: {\n connect: 25000,\n read: 25000,\n write: 25000,\n },\n logger: createNullLogger(),\n requester: createXhrRequester(),\n algoliaAgents: [{ segment: 'Browser' }],\n authMode: 'WithinQueryParameters',\n responsesCache: createMemoryCache(),\n requestsCache: createMemoryCache({ serializable: false }),\n hostsCache: createFallbackableCache({\n caches: [createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }), createMemoryCache()],\n }),\n ...options,\n });\n}\n\nexport type IngestionClient = ReturnType;\n"],"mappings":"AAIO,SAASA,GAAgC,CAC9C,SAASC,EAAKC,EAAwC,CACpD,OAAO,IAAI,QAASC,GAAY,CAC9B,IAAMC,EAAgB,IAAI,eAC1BA,EAAc,KAAKF,EAAQ,OAAQA,EAAQ,IAAK,EAAI,EAEpD,OAAO,KAAKA,EAAQ,OAAO,EAAE,QAASG,GAAQD,EAAc,iBAAiBC,EAAKH,EAAQ,QAAQG,CAAG,CAAC,CAAC,EAEvG,IAAMC,EAAgB,CAACC,EAAiBC,IAC/B,WAAW,IAAM,CACtBJ,EAAc,MAAM,EAEpBD,EAAQ,CACN,OAAQ,EACR,QAAAK,EACA,WAAY,EACd,CAAC,CACH,EAAGD,CAAO,EAGNE,EAAiBH,EAAcJ,EAAQ,eAAgB,oBAAoB,EAE7EQ,EAEJN,EAAc,mBAAqB,IAAY,CACzCA,EAAc,WAAaA,EAAc,QAAUM,IAAoB,SACzE,aAAaD,CAAc,EAE3BC,EAAkBJ,EAAcJ,EAAQ,gBAAiB,gBAAgB,EAE7E,EAEAE,EAAc,QAAU,IAAY,CAE9BA,EAAc,SAAW,IAC3B,aAAaK,CAAc,EAC3B,aAAaC,CAAgB,EAE7BP,EAAQ,CACN,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ACH,GAAS,OAAOA,GAAU,SAC7B,MAAM,IAAI,MAAM,qBAAqB,EAGvC,GAAI,CAACC,GAAU,OAAOA,GAAW,SAC/B,MAAM,IAAI,MAAM,sBAAsB,EAGxC,GAAI,CAACC,GAAWA,IAAW,OAAOA,GAAW,UAAY,CAACE,EAAQ,SAASF,CAAM,GAC/E,MAAM,IAAI,MAAM,4DAA4DE,EAAQ,KAAK,IAAI,CAAC,EAAE,EAGlG,OAAOC,EAAsB,CAC3B,MAAAL,EACA,OAAAC,EACA,OAAAC,EACA,SAAU,CACR,QAAS,KACT,KAAM,KACN,MAAO,IACT,EACA,OAAQI,EAAiB,EACzB,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,IAAIX,CAAK,EAAG,CAAC,EAAGQ,EAAkB,CAAC,CACvG,CAAC,EACD,GAAGL,CACL,CAAC,CACH","names":["createXhrRequester","send","request","resolve","baseRequester","key","createTimeout","timeout","content","connectTimeout","responseTimeout","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","createAlgoliaAgent","version","algoliaAgent","options","addedAlgoliaAgent","createAuth","appId","apiKey","authMode","credentials","getAlgoliaAgent","algoliaAgents","client","version","defaultAlgoliaAgent","createAlgoliaAgent","algoliaAgent","createNullLogger","_message","_args","EXPIRATION_DELAY","createStatefulHost","host","status","lastUpdate","isUp","isTimedOut","AlgoliaError","message","name","ErrorWithStackTrace","stackTrace","RetryError","ApiError","DeserializationError","response","DetailedApiError","error","serializeUrl","host","path","queryParameters","queryParametersAsString","serializeQueryParameters","url","parameters","key","serializeData","request","requestOptions","data","serializeHeaders","baseHeaders","requestHeaders","requestOptionsHeaders","headers","serializedHeaders","header","value","deserializeSuccess","response","e","DeserializationError","deserializeFailure","content","status","stackFrame","parsed","DetailedApiError","ApiError","isNetworkError","isTimedOut","isRetryable","isSuccess","stackTraceWithoutCredentials","stackTrace","stackFrameWithoutCredentials","modifiedHeaders","createTransporter","hosts","hostsCache","logger","baseQueryParameters","algoliaAgent","timeouts","requester","requestsCache","responsesCache","createRetryableOptions","compatibleHosts","statefulHosts","compatibleHost","createStatefulHost","hostsUp","hostsTimedOut","hostsAvailable","timeoutsCount","baseTimeout","retryableRequest","isRead","dataQueryParameters","retry","retryableHosts","getTimeout","RetryError","timeout","payload","pushToStackTrace","options","createRequest","createRetryableRequest","err","_","apiClientVersion","REGIONS","getDefaultHosts","region","isOnDemandTrigger","trigger","isScheduleTrigger","isSubscriptionTrigger","createIngestionClient","appIdOption","apiKeyOption","authMode","algoliaAgents","regionOption","options","auth","createAuth","transporter","createTransporter","getAlgoliaAgent","segment","version","apiKey","authenticationCreate","requestOptions","request","destinationCreate","sourceCreate","taskCreate","transformationCreate","path","parameters","body","authenticationID","destinationID","sourceID","taskID","transformationID","runID","eventID","itemsPerPage","page","type","platform","sort","order","requestPath","headers","queryParameters","status","startDate","endDate","action","enabled","sourceType","triggerType","withEmailNotifications","pushTaskPayload","watch","runSourcePayload","authenticationSearch","destinationSearch","sourceSearch","taskSearch","transformationSearch","transformationTry","authenticationUpdate","destinationUpdate","sourceUpdate","taskUpdate","ingestionClient","appId","apiKey","region","options","REGIONS","createIngestionClient","createNullLogger","m","createMemoryCache","createFallbackableCache","createBrowserLocalStorageCache","apiClientVersion"]}