algoliasearch 5.34.1 → 5.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,7 +25,7 @@ __export(liteClient_exports, {
25
25
  });
26
26
  module.exports = __toCommonJS(liteClient_exports);
27
27
  var import_client_common = require("@algolia/client-common");
28
- var apiClientVersion = "5.34.1";
28
+ var apiClientVersion = "5.35.0";
29
29
  function getDefaultHosts(appId) {
30
30
  return [
31
31
  {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../lite/src/liteClient.ts"],"sourcesContent":["// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\nimport { createAuth, createTransporter, getAlgoliaAgent, shuffle } from '@algolia/client-common';\n\nimport type { GetRecommendationsParams } from '../model/getRecommendationsParams';\nimport type { GetRecommendationsResponse } from '../model/getRecommendationsResponse';\nimport type { SearchMethodParams } from '../model/searchMethodParams';\nimport type { SearchResponses } from '../model/searchResponses';\n\nimport type {\n CustomPostProps,\n LegacyGetRecommendationsParams,\n LegacySearchMethodProps,\n} from '../model/clientMethodProps';\n\nimport type { SearchForFacetValuesResponse } from '../model/searchForFacetValuesResponse';\nimport type { SearchResponse } from '../model/searchResponse';\n\nexport const apiClientVersion = '5.34.1';\n\nfunction getDefaultHosts(appId: string): Host[] {\n return (\n [\n {\n url: `${appId}-dsn.algolia.net`,\n accept: 'read',\n protocol: 'https',\n },\n {\n url: `${appId}.algolia.net`,\n accept: 'write',\n protocol: 'https',\n },\n ] as Host[]\n ).concat(\n shuffle([\n {\n url: `${appId}-1.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-2.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-3.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n ]),\n );\n}\n\nexport function createLiteClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n ...options\n}: CreateClientOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(appIdOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Lite',\n version: apiClientVersion,\n }),\n baseHeaders: {\n 'content-type': 'text/plain',\n ...auth.headers(),\n ...options.baseHeaders,\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters,\n },\n });\n\n return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * The `apiKey` currently in use.\n */\n apiKey: apiKeyOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string | undefined): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * Helper method to switch the API key used to authenticate the requests.\n *\n * @param params - Method params.\n * @param params.apiKey - The new API Key to use.\n */\n setClientApiKey({ apiKey }: { apiKey: string }): void {\n if (!authMode || authMode === 'WithinHeaders') {\n transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n } else {\n transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;\n }\n },\n\n /**\n * Helper: calls the `search` method but with certainty that we will only request Algolia records (hits) and not facets.\n * Disclaimer: We don't assert that the parameters you pass to this method only contains `hits` requests to prevent impacting search performances, this helper is purely for typing purposes.\n *\n * @summary Search multiple indices for `hits`.\n * @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForHits<T>(\n searchMethodParams: LegacySearchMethodProps | SearchMethodParams,\n requestOptions?: RequestOptions | undefined,\n ): Promise<{ results: Array<SearchResponse<T>> }> {\n return this.search(searchMethodParams, requestOptions) as Promise<{ results: Array<SearchResponse<T>> }>;\n },\n\n /**\n * Helper: calls the `search` method but with certainty that we will only request Algolia facets and not records (hits).\n * Disclaimer: We don't assert that the parameters you pass to this method only contains `facets` requests to prevent impacting search performances, this helper is purely for typing purposes.\n *\n * @summary Search multiple indices for `facets`.\n * @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForFacets(\n searchMethodParams: LegacySearchMethodProps | SearchMethodParams,\n requestOptions?: RequestOptions | undefined,\n ): Promise<{ results: Array<SearchForFacetValuesResponse> }> {\n return this.search(searchMethodParams, requestOptions) as Promise<{\n results: Array<SearchForFacetValuesResponse>;\n }>;\n },\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, for example `1/newFeature`.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n 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 * Retrieves recommendations from selected AI models.\n *\n * Required API Key ACLs:\n * - search\n * @param getRecommendationsParams - The getRecommendationsParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRecommendations(\n getRecommendationsParams: GetRecommendationsParams | LegacyGetRecommendationsParams,\n requestOptions?: RequestOptions,\n ): Promise<GetRecommendationsResponse> {\n if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {\n const newSignatureRequest: GetRecommendationsParams = {\n requests: getRecommendationsParams,\n };\n\n getRecommendationsParams = newSignatureRequest;\n }\n\n if (!getRecommendationsParams) {\n throw new Error('Parameter `getRecommendationsParams` is required when calling `getRecommendations`.');\n }\n\n if (!getRecommendationsParams.requests) {\n throw new Error('Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.');\n }\n\n const requestPath = '/1/indexes/*/recommendations';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: getRecommendationsParams,\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Sends multiple search requests to one or more indices. This can be useful in these cases: - Different indices for different purposes, such as, one index for products, another one for marketing content. - Multiple searches to the same index—for example, with different filters. Use the helper `searchForHits` or `searchForFacets` to get the results in a more convenient format, if you already know the return type you want.\n *\n * Required API Key ACLs:\n * - search\n * @param searchMethodParams - Muli-search request body. Results are returned in the same order as the requests.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n search<T>(\n searchMethodParams: SearchMethodParams | LegacySearchMethodProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchResponses<T>> {\n if (searchMethodParams && Array.isArray(searchMethodParams)) {\n const newSignatureRequest: SearchMethodParams = {\n requests: searchMethodParams.map(({ params, ...legacyRequest }) => {\n if (legacyRequest.type === 'facet') {\n return {\n ...legacyRequest,\n ...params,\n type: 'facet',\n };\n }\n\n return {\n ...legacyRequest,\n ...params,\n facet: undefined,\n maxFacetHits: undefined,\n facetQuery: undefined,\n };\n }),\n };\n\n searchMethodParams = newSignatureRequest;\n }\n\n if (!searchMethodParams) {\n throw new Error('Parameter `searchMethodParams` is required when calling `search`.');\n }\n\n if (!searchMethodParams.requests) {\n throw new Error('Parameter `searchMethodParams.requests` is required when calling `search`.');\n }\n\n const requestPath = '/1/indexes/*/queries';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchMethodParams,\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,2BAAwE;AAgBjE,IAAM,mBAAmB;AAEhC,SAAS,gBAAgB,OAAuB;AAC9C,SACE;AAAA,IACE;AAAA,MACE,KAAK,GAAG,KAAK;AAAA,MACb,QAAQ;AAAA,MACR,UAAU;AAAA,IACZ;AAAA,IACA;AAAA,MACE,KAAK,GAAG,KAAK;AAAA,MACb,QAAQ;AAAA,MACR,UAAU;AAAA,IACZ;AAAA,EACF,EACA;AAAA,QACA,8BAAQ;AAAA,MACN;AAAA,QACE,KAAK,GAAG,KAAK;AAAA,QACb,QAAQ;AAAA,QACR,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,KAAK,GAAG,KAAK;AAAA,QACb,QAAQ;AAAA,QACR,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,KAAK,GAAG,KAAK;AAAA,QACb,QAAQ;AAAA,QACR,UAAU;AAAA,MACZ;AAAA,IACF,CAAC;AAAA,EACH;AACF;AAEO,SAAS,iBAAiB;AAAA,EAC/B,OAAO;AAAA,EACP,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAwB;AACtB,QAAM,WAAO,iCAAW,aAAa,cAAc,QAAQ;AAC3D,QAAM,kBAAc,wCAAkB;AAAA,IACpC,OAA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M,QAAQ,kBAAkB,GAAG;AAC3D,cAAM,sBAA0C;AAAA,UAC9C,UAAU,mBAAmB,IAAI,CAAC,EAAE,QAAQ,GAAG,cAAc,MAAM;AACjE,gBAAI,cAAc,SAAS,SAAS;AAClC,qBAAO;AAAA,gBACL,GAAG;AAAA,gBACH,GAAG;AAAA,gBACH,MAAM;AAAA,cACR;AAAA,YACF;AAEA,mBAAO;AAAA,cACL,GAAG;AAAA,cACH,GAAG;AAAA,cACH,OAAO;AAAA,cACP,cAAc;AAAA,cACd,YAAY;AAAA,YACd;AAAA,UACF,CAAC;AAAA,QACH;AAEA,6BAAqB;AAAA,MACvB;AAEA,UAAI,CAAC,oBAAoB;AACvB,cAAM,IAAI,MAAM,mEAAmE;AAAA,MACrF;AAEA,UAAI,CAAC,mBAAmB,UAAU;AAChC,cAAM,IAAI,MAAM,4EAA4E;AAAA,MAC9F;AAEA,YAAM,cAAc;AACpB,YAAM,UAAmB,CAAC;AAC1B,YAAM,kBAAmC,CAAC;AAE1C,YAAM,UAAmB;AAAA,QACvB,QAAQ;AAAA,QACR,MAAM;AAAA,QACN;AAAA,QACA;AAAA,QACA,MAAM;AAAA,QACN,oBAAoB;AAAA,QACpB,WAAW;AAAA,MACb;AAEA,aAAO,YAAY,QAAQ,SAAS,cAAc;AAAA,IACpD;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../lite/src/liteClient.ts"],"sourcesContent":["// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\nimport { createAuth, createTransporter, getAlgoliaAgent, shuffle } from '@algolia/client-common';\n\nimport type { GetRecommendationsParams } from '../model/getRecommendationsParams';\nimport type { GetRecommendationsResponse } from '../model/getRecommendationsResponse';\nimport type { SearchMethodParams } from '../model/searchMethodParams';\nimport type { SearchResponses } from '../model/searchResponses';\n\nimport type {\n CustomPostProps,\n LegacyGetRecommendationsParams,\n LegacySearchMethodProps,\n} from '../model/clientMethodProps';\n\nimport type { SearchForFacetValuesResponse } from '../model/searchForFacetValuesResponse';\nimport type { SearchResponse } from '../model/searchResponse';\n\nexport const apiClientVersion = '5.35.0';\n\nfunction getDefaultHosts(appId: string): Host[] {\n return (\n [\n {\n url: `${appId}-dsn.algolia.net`,\n accept: 'read',\n protocol: 'https',\n },\n {\n url: `${appId}.algolia.net`,\n accept: 'write',\n protocol: 'https',\n },\n ] as Host[]\n ).concat(\n shuffle([\n {\n url: `${appId}-1.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-2.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-3.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n ]),\n );\n}\n\nexport function createLiteClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n ...options\n}: CreateClientOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(appIdOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Lite',\n version: apiClientVersion,\n }),\n baseHeaders: {\n 'content-type': 'text/plain',\n ...auth.headers(),\n ...options.baseHeaders,\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters,\n },\n });\n\n return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * The `apiKey` currently in use.\n */\n apiKey: apiKeyOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string | undefined): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * Helper method to switch the API key used to authenticate the requests.\n *\n * @param params - Method params.\n * @param params.apiKey - The new API Key to use.\n */\n setClientApiKey({ apiKey }: { apiKey: string }): void {\n if (!authMode || authMode === 'WithinHeaders') {\n transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n } else {\n transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;\n }\n },\n\n /**\n * Helper: calls the `search` method but with certainty that we will only request Algolia records (hits) and not facets.\n * Disclaimer: We don't assert that the parameters you pass to this method only contains `hits` requests to prevent impacting search performances, this helper is purely for typing purposes.\n *\n * @summary Search multiple indices for `hits`.\n * @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForHits<T>(\n searchMethodParams: LegacySearchMethodProps | SearchMethodParams,\n requestOptions?: RequestOptions | undefined,\n ): Promise<{ results: Array<SearchResponse<T>> }> {\n return this.search(searchMethodParams, requestOptions) as Promise<{ results: Array<SearchResponse<T>> }>;\n },\n\n /**\n * Helper: calls the `search` method but with certainty that we will only request Algolia facets and not records (hits).\n * Disclaimer: We don't assert that the parameters you pass to this method only contains `facets` requests to prevent impacting search performances, this helper is purely for typing purposes.\n *\n * @summary Search multiple indices for `facets`.\n * @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForFacets(\n searchMethodParams: LegacySearchMethodProps | SearchMethodParams,\n requestOptions?: RequestOptions | undefined,\n ): Promise<{ results: Array<SearchForFacetValuesResponse> }> {\n return this.search(searchMethodParams, requestOptions) as Promise<{\n results: Array<SearchForFacetValuesResponse>;\n }>;\n },\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, for example `1/newFeature`.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n 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 * Retrieves recommendations from selected AI models.\n *\n * Required API Key ACLs:\n * - search\n * @param getRecommendationsParams - The getRecommendationsParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRecommendations(\n getRecommendationsParams: GetRecommendationsParams | LegacyGetRecommendationsParams,\n requestOptions?: RequestOptions,\n ): Promise<GetRecommendationsResponse> {\n if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {\n const newSignatureRequest: GetRecommendationsParams = {\n requests: getRecommendationsParams,\n };\n\n getRecommendationsParams = newSignatureRequest;\n }\n\n if (!getRecommendationsParams) {\n throw new Error('Parameter `getRecommendationsParams` is required when calling `getRecommendations`.');\n }\n\n if (!getRecommendationsParams.requests) {\n throw new Error('Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.');\n }\n\n const requestPath = '/1/indexes/*/recommendations';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: getRecommendationsParams,\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Sends multiple search requests to one or more indices. This can be useful in these cases: - Different indices for different purposes, such as, one index for products, another one for marketing content. - Multiple searches to the same index—for example, with different filters. Use the helper `searchForHits` or `searchForFacets` to get the results in a more convenient format, if you already know the return type you want.\n *\n * Required API Key ACLs:\n * - search\n * @param searchMethodParams - Muli-search request body. Results are returned in the same order as the requests.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n search<T>(\n searchMethodParams: SearchMethodParams | LegacySearchMethodProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchResponses<T>> {\n if (searchMethodParams && Array.isArray(searchMethodParams)) {\n const newSignatureRequest: SearchMethodParams = {\n requests: searchMethodParams.map(({ params, ...legacyRequest }) => {\n if (legacyRequest.type === 'facet') {\n return {\n ...legacyRequest,\n ...params,\n type: 'facet',\n };\n }\n\n return {\n ...legacyRequest,\n ...params,\n facet: undefined,\n maxFacetHits: undefined,\n facetQuery: undefined,\n };\n }),\n };\n\n searchMethodParams = newSignatureRequest;\n }\n\n if (!searchMethodParams) {\n throw new Error('Parameter `searchMethodParams` is required when calling `search`.');\n }\n\n if (!searchMethodParams.requests) {\n throw new Error('Parameter `searchMethodParams.requests` is required when calling `search`.');\n }\n\n const requestPath = '/1/indexes/*/queries';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchMethodParams,\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,2BAAwE;AAgBjE,IAAM,mBAAmB;AAEhC,SAAS,gBAAgB,OAAuB;AAC9C,SACE;AAAA,IACE;AAAA,MACE,KAAK,GAAG,KAAK;AAAA,MACb,QAAQ;AAAA,MACR,UAAU;AAAA,IACZ;AAAA,IACA;AAAA,MACE,KAAK,GAAG,KAAK;AAAA,MACb,QAAQ;AAAA,MACR,UAAU;AAAA,IACZ;AAAA,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;AAAA,QACN,oBAAoB;AAAA,QACpB,WAAW;AAAA,MACb;AAEA,aAAO,YAAY,QAAQ,SAAS,cAAc;AAAA,IACpD;AAAA,EACF;AACF;","names":[]}
@@ -1,6 +1,6 @@
1
1
  // lite/src/liteClient.ts
2
2
  import { createAuth, createTransporter, getAlgoliaAgent, shuffle } from "@algolia/client-common";
3
- var apiClientVersion = "5.34.1";
3
+ var apiClientVersion = "5.35.0";
4
4
  function getDefaultHosts(appId) {
5
5
  return [
6
6
  {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../lite/src/liteClient.ts"],"sourcesContent":["// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\nimport { createAuth, createTransporter, getAlgoliaAgent, shuffle } from '@algolia/client-common';\n\nimport type { GetRecommendationsParams } from '../model/getRecommendationsParams';\nimport type { GetRecommendationsResponse } from '../model/getRecommendationsResponse';\nimport type { SearchMethodParams } from '../model/searchMethodParams';\nimport type { SearchResponses } from '../model/searchResponses';\n\nimport type {\n CustomPostProps,\n LegacyGetRecommendationsParams,\n LegacySearchMethodProps,\n} from '../model/clientMethodProps';\n\nimport type { SearchForFacetValuesResponse } from '../model/searchForFacetValuesResponse';\nimport type { SearchResponse } from '../model/searchResponse';\n\nexport const apiClientVersion = '5.34.1';\n\nfunction getDefaultHosts(appId: string): Host[] {\n return (\n [\n {\n url: `${appId}-dsn.algolia.net`,\n accept: 'read',\n protocol: 'https',\n },\n {\n url: `${appId}.algolia.net`,\n accept: 'write',\n protocol: 'https',\n },\n ] as Host[]\n ).concat(\n shuffle([\n {\n url: `${appId}-1.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-2.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-3.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n ]),\n );\n}\n\nexport function createLiteClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n ...options\n}: CreateClientOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(appIdOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Lite',\n version: apiClientVersion,\n }),\n baseHeaders: {\n 'content-type': 'text/plain',\n ...auth.headers(),\n ...options.baseHeaders,\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters,\n },\n });\n\n return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * The `apiKey` currently in use.\n */\n apiKey: apiKeyOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string | undefined): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * Helper method to switch the API key used to authenticate the requests.\n *\n * @param params - Method params.\n * @param params.apiKey - The new API Key to use.\n */\n setClientApiKey({ apiKey }: { apiKey: string }): void {\n if (!authMode || authMode === 'WithinHeaders') {\n transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n } else {\n transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;\n }\n },\n\n /**\n * Helper: calls the `search` method but with certainty that we will only request Algolia records (hits) and not facets.\n * Disclaimer: We don't assert that the parameters you pass to this method only contains `hits` requests to prevent impacting search performances, this helper is purely for typing purposes.\n *\n * @summary Search multiple indices for `hits`.\n * @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForHits<T>(\n searchMethodParams: LegacySearchMethodProps | SearchMethodParams,\n requestOptions?: RequestOptions | undefined,\n ): Promise<{ results: Array<SearchResponse<T>> }> {\n return this.search(searchMethodParams, requestOptions) as Promise<{ results: Array<SearchResponse<T>> }>;\n },\n\n /**\n * Helper: calls the `search` method but with certainty that we will only request Algolia facets and not records (hits).\n * Disclaimer: We don't assert that the parameters you pass to this method only contains `facets` requests to prevent impacting search performances, this helper is purely for typing purposes.\n *\n * @summary Search multiple indices for `facets`.\n * @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForFacets(\n searchMethodParams: LegacySearchMethodProps | SearchMethodParams,\n requestOptions?: RequestOptions | undefined,\n ): Promise<{ results: Array<SearchForFacetValuesResponse> }> {\n return this.search(searchMethodParams, requestOptions) as Promise<{\n results: Array<SearchForFacetValuesResponse>;\n }>;\n },\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, for example `1/newFeature`.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n 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 * Retrieves recommendations from selected AI models.\n *\n * Required API Key ACLs:\n * - search\n * @param getRecommendationsParams - The getRecommendationsParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRecommendations(\n getRecommendationsParams: GetRecommendationsParams | LegacyGetRecommendationsParams,\n requestOptions?: RequestOptions,\n ): Promise<GetRecommendationsResponse> {\n if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {\n const newSignatureRequest: GetRecommendationsParams = {\n requests: getRecommendationsParams,\n };\n\n getRecommendationsParams = newSignatureRequest;\n }\n\n if (!getRecommendationsParams) {\n throw new Error('Parameter `getRecommendationsParams` is required when calling `getRecommendations`.');\n }\n\n if (!getRecommendationsParams.requests) {\n throw new Error('Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.');\n }\n\n const requestPath = '/1/indexes/*/recommendations';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: getRecommendationsParams,\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Sends multiple search requests to one or more indices. This can be useful in these cases: - Different indices for different purposes, such as, one index for products, another one for marketing content. - Multiple searches to the same index—for example, with different filters. Use the helper `searchForHits` or `searchForFacets` to get the results in a more convenient format, if you already know the return type you want.\n *\n * Required API Key ACLs:\n * - search\n * @param searchMethodParams - Muli-search request body. Results are returned in the same order as the requests.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n search<T>(\n searchMethodParams: SearchMethodParams | LegacySearchMethodProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchResponses<T>> {\n if (searchMethodParams && Array.isArray(searchMethodParams)) {\n const newSignatureRequest: SearchMethodParams = {\n requests: searchMethodParams.map(({ params, ...legacyRequest }) => {\n if (legacyRequest.type === 'facet') {\n return {\n ...legacyRequest,\n ...params,\n type: 'facet',\n };\n }\n\n return {\n ...legacyRequest,\n ...params,\n facet: undefined,\n maxFacetHits: undefined,\n facetQuery: undefined,\n };\n }),\n };\n\n searchMethodParams = newSignatureRequest;\n }\n\n if (!searchMethodParams) {\n throw new Error('Parameter `searchMethodParams` is required when calling `search`.');\n }\n\n if (!searchMethodParams.requests) {\n throw new Error('Parameter `searchMethodParams.requests` is required when calling `search`.');\n }\n\n const requestPath = '/1/indexes/*/queries';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchMethodParams,\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";AAUA,SAAS,YAAY,mBAAmB,iBAAiB,eAAe;AAgBjE,IAAM,mBAAmB;AAEhC,SAAS,gBAAgB,OAAuB;AAC9C,SACE;AAAA,IACE;AAAA,MACE,KAAK,GAAG,KAAK;AAAA,MACb,QAAQ;AAAA,MACR,UAAU;AAAA,IACZ;AAAA,IACA;AAAA,MACE,KAAK,GAAG,KAAK;AAAA,MACb,QAAQ;AAAA,MACR,UAAU;AAAA,IACZ;AAAA,EACF,EACA;AAAA,IACA,QAAQ;AAAA,MACN;AAAA,QACE,KAAK,GAAG,KAAK;AAAA,QACb,QAAQ;AAAA,QACR,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,KAAK,GAAG,KAAK;AAAA,QACb,QAAQ;AAAA,QACR,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,KAAK,GAAG,KAAK;AAAA,QACb,QAAQ;AAAA,QACR,UAAU;AAAA,MACZ;AAAA,IACF,CAAC;AAAA,EACH;AACF;AAEO,SAAS,iBAAiB;AAAA,EAC/B,OAAO;AAAA,EACP,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAwB;AACtB,QAAM,OAAO,WAAW,aAAa,cAAc,QAAQ;AAC3D,QAAM,cAAc,kBAAkB;AAAA,IACpC,OAAO,gBAAgB,WAAW;AAAA,IAClC,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,cAAM,sBAA0C;AAAA,UAC9C,UAAU,mBAAmB,IAAI,CAAC,EAAE,QAAQ,GAAG,cAAc,MAAM;AACjE,gBAAI,cAAc,SAAS,SAAS;AAClC,qBAAO;AAAA,gBACL,GAAG;AAAA,gBACH,GAAG;AAAA,gBACH,MAAM;AAAA,cACR;AAAA,YACF;AAEA,mBAAO;AAAA,cACL,GAAG;AAAA,cACH,GAAG;AAAA,cACH,OAAO;AAAA,cACP,cAAc;AAAA,cACd,YAAY;AAAA,YACd;AAAA,UACF,CAAC;AAAA,QACH;AAEA,6BAAqB;AAAA,MACvB;AAEA,UAAI,CAAC,oBAAoB;AACvB,cAAM,IAAI,MAAM,mEAAmE;AAAA,MACrF;AAEA,UAAI,CAAC,mBAAmB,UAAU;AAChC,cAAM,IAAI,MAAM,4EAA4E;AAAA,MAC9F;AAEA,YAAM,cAAc;AACpB,YAAM,UAAmB,CAAC;AAC1B,YAAM,kBAAmC,CAAC;AAE1C,YAAM,UAAmB;AAAA,QACvB,QAAQ;AAAA,QACR,MAAM;AAAA,QACN;AAAA,QACA;AAAA,QACA,MAAM;AAAA,QACN,oBAAoB;AAAA,QACpB,WAAW;AAAA,MACb;AAEA,aAAO,YAAY,QAAQ,SAAS,cAAc;AAAA,IACpD;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../lite/src/liteClient.ts"],"sourcesContent":["// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\nimport { createAuth, createTransporter, getAlgoliaAgent, shuffle } from '@algolia/client-common';\n\nimport type { GetRecommendationsParams } from '../model/getRecommendationsParams';\nimport type { GetRecommendationsResponse } from '../model/getRecommendationsResponse';\nimport type { SearchMethodParams } from '../model/searchMethodParams';\nimport type { SearchResponses } from '../model/searchResponses';\n\nimport type {\n CustomPostProps,\n LegacyGetRecommendationsParams,\n LegacySearchMethodProps,\n} from '../model/clientMethodProps';\n\nimport type { SearchForFacetValuesResponse } from '../model/searchForFacetValuesResponse';\nimport type { SearchResponse } from '../model/searchResponse';\n\nexport const apiClientVersion = '5.35.0';\n\nfunction getDefaultHosts(appId: string): Host[] {\n return (\n [\n {\n url: `${appId}-dsn.algolia.net`,\n accept: 'read',\n protocol: 'https',\n },\n {\n url: `${appId}.algolia.net`,\n accept: 'write',\n protocol: 'https',\n },\n ] as Host[]\n ).concat(\n shuffle([\n {\n url: `${appId}-1.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-2.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-3.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n ]),\n );\n}\n\nexport function createLiteClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n ...options\n}: CreateClientOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(appIdOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Lite',\n version: apiClientVersion,\n }),\n baseHeaders: {\n 'content-type': 'text/plain',\n ...auth.headers(),\n ...options.baseHeaders,\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters,\n },\n });\n\n return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * The `apiKey` currently in use.\n */\n apiKey: apiKeyOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string | undefined): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * Helper method to switch the API key used to authenticate the requests.\n *\n * @param params - Method params.\n * @param params.apiKey - The new API Key to use.\n */\n setClientApiKey({ apiKey }: { apiKey: string }): void {\n if (!authMode || authMode === 'WithinHeaders') {\n transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n } else {\n transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;\n }\n },\n\n /**\n * Helper: calls the `search` method but with certainty that we will only request Algolia records (hits) and not facets.\n * Disclaimer: We don't assert that the parameters you pass to this method only contains `hits` requests to prevent impacting search performances, this helper is purely for typing purposes.\n *\n * @summary Search multiple indices for `hits`.\n * @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForHits<T>(\n searchMethodParams: LegacySearchMethodProps | SearchMethodParams,\n requestOptions?: RequestOptions | undefined,\n ): Promise<{ results: Array<SearchResponse<T>> }> {\n return this.search(searchMethodParams, requestOptions) as Promise<{ results: Array<SearchResponse<T>> }>;\n },\n\n /**\n * Helper: calls the `search` method but with certainty that we will only request Algolia facets and not records (hits).\n * Disclaimer: We don't assert that the parameters you pass to this method only contains `facets` requests to prevent impacting search performances, this helper is purely for typing purposes.\n *\n * @summary Search multiple indices for `facets`.\n * @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForFacets(\n searchMethodParams: LegacySearchMethodProps | SearchMethodParams,\n requestOptions?: RequestOptions | undefined,\n ): Promise<{ results: Array<SearchForFacetValuesResponse> }> {\n return this.search(searchMethodParams, requestOptions) as Promise<{\n results: Array<SearchForFacetValuesResponse>;\n }>;\n },\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, for example `1/newFeature`.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n 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 * Retrieves recommendations from selected AI models.\n *\n * Required API Key ACLs:\n * - search\n * @param getRecommendationsParams - The getRecommendationsParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRecommendations(\n getRecommendationsParams: GetRecommendationsParams | LegacyGetRecommendationsParams,\n requestOptions?: RequestOptions,\n ): Promise<GetRecommendationsResponse> {\n if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {\n const newSignatureRequest: GetRecommendationsParams = {\n requests: getRecommendationsParams,\n };\n\n getRecommendationsParams = newSignatureRequest;\n }\n\n if (!getRecommendationsParams) {\n throw new Error('Parameter `getRecommendationsParams` is required when calling `getRecommendations`.');\n }\n\n if (!getRecommendationsParams.requests) {\n throw new Error('Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.');\n }\n\n const requestPath = '/1/indexes/*/recommendations';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: getRecommendationsParams,\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Sends multiple search requests to one or more indices. This can be useful in these cases: - Different indices for different purposes, such as, one index for products, another one for marketing content. - Multiple searches to the same index—for example, with different filters. Use the helper `searchForHits` or `searchForFacets` to get the results in a more convenient format, if you already know the return type you want.\n *\n * Required API Key ACLs:\n * - search\n * @param searchMethodParams - Muli-search request body. Results are returned in the same order as the requests.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n search<T>(\n searchMethodParams: SearchMethodParams | LegacySearchMethodProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchResponses<T>> {\n if (searchMethodParams && Array.isArray(searchMethodParams)) {\n const newSignatureRequest: SearchMethodParams = {\n requests: searchMethodParams.map(({ params, ...legacyRequest }) => {\n if (legacyRequest.type === 'facet') {\n return {\n ...legacyRequest,\n ...params,\n type: 'facet',\n };\n }\n\n return {\n ...legacyRequest,\n ...params,\n facet: undefined,\n maxFacetHits: undefined,\n facetQuery: undefined,\n };\n }),\n };\n\n searchMethodParams = newSignatureRequest;\n }\n\n if (!searchMethodParams) {\n throw new Error('Parameter `searchMethodParams` is required when calling `search`.');\n }\n\n if (!searchMethodParams.requests) {\n throw new Error('Parameter `searchMethodParams.requests` is required when calling `search`.');\n }\n\n const requestPath = '/1/indexes/*/queries';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchMethodParams,\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";AAUA,SAAS,YAAY,mBAAmB,iBAAiB,eAAe;AAgBjE,IAAM,mBAAmB;AAEhC,SAAS,gBAAgB,OAAuB;AAC9C,SACE;AAAA,IACE;AAAA,MACE,KAAK,GAAG,KAAK;AAAA,MACb,QAAQ;AAAA,MACR,UAAU;AAAA,IACZ;AAAA,IACA;AAAA,MACE,KAAK,GAAG,KAAK;AAAA,MACb,QAAQ;AAAA,MACR,UAAU;AAAA,IACZ;AAAA,EACF,EACA;AAAA,IACA,QAAQ;AAAA,MACN;AAAA,QACE,KAAK,GAAG,K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QAAQ,SAAS,cAAc;AAAA,IACpD;AAAA,EACF;AACF;","names":[]}
package/dist/node.cjs CHANGED
@@ -25,6 +25,7 @@ __export(node_exports, {
25
25
  apiClientVersion: () => import_client_search.apiClientVersion
26
26
  });
27
27
  module.exports = __toCommonJS(node_exports);
28
+ var import_abtesting = require("@algolia/abtesting");
28
29
  var import_client_abtesting = require("@algolia/client-abtesting");
29
30
  var import_client_analytics = require("@algolia/client-analytics");
30
31
  var import_client_insights = require("@algolia/client-insights");
@@ -41,6 +42,7 @@ __export(models_exports, {
41
42
  apiClientVersion: () => import_client_search.apiClientVersion
42
43
  });
43
44
  var import_client_search = require("@algolia/client-search");
45
+ __reExport(models_exports, require("@algolia/abtesting"));
44
46
  __reExport(models_exports, require("@algolia/client-abtesting"));
45
47
  __reExport(models_exports, require("@algolia/client-analytics"));
46
48
  __reExport(models_exports, require("@algolia/client-insights"));
@@ -180,6 +182,14 @@ function algoliasearch(appId, apiKey, options) {
180
182
  initOptions.options
181
183
  );
182
184
  },
185
+ initAbtestingV3: (initOptions) => {
186
+ return (0, import_abtesting.abtestingV3Client)(
187
+ initOptions.appId || appId,
188
+ initOptions.apiKey || apiKey,
189
+ initOptions.region,
190
+ initOptions.options
191
+ );
192
+ },
183
193
  initAnalytics: (initOptions) => {
184
194
  return (0, import_client_analytics.analyticsClient)(
185
195
  initOptions.appId || appId,
package/dist/node.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../builds/node.ts","../builds/models.ts"],"sourcesContent":["// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nimport type { ClientOptions, RequestOptions } from '@algolia/client-common';\n\nimport type { AbtestingClient } from '@algolia/client-abtesting';\nimport { abtestingClient } from '@algolia/client-abtesting';\nimport type { AnalyticsClient } from '@algolia/client-analytics';\nimport { analyticsClient } from '@algolia/client-analytics';\nimport type { InsightsClient } from '@algolia/client-insights';\nimport { insightsClient } from '@algolia/client-insights';\nimport type { PersonalizationClient } from '@algolia/client-personalization';\nimport { personalizationClient } from '@algolia/client-personalization';\nimport type { QuerySuggestionsClient } from '@algolia/client-query-suggestions';\nimport { querySuggestionsClient } from '@algolia/client-query-suggestions';\nimport type { SearchClient } from '@algolia/client-search';\nimport { searchClient } from '@algolia/client-search';\nimport type { IngestionClient } from '@algolia/ingestion';\nimport { ingestionClient } from '@algolia/ingestion';\nimport type { MonitoringClient } from '@algolia/monitoring';\nimport { monitoringClient } from '@algolia/monitoring';\nimport type { RecommendClient } from '@algolia/recommend';\nimport { recommendClient } from '@algolia/recommend';\n\nimport type {\n PartialUpdateObjectsOptions,\n ReplaceAllObjectsOptions,\n ReplaceAllObjectsWithTransformationResponse,\n SaveObjectsOptions,\n} from '@algolia/client-search';\nimport type { WatchResponse } from '@algolia/ingestion';\n\nimport type {\n AbtestingRegionOptions,\n AnalyticsRegionOptions,\n IngestionRegion,\n IngestionRegionOptions,\n InitClientOptions,\n InsightsRegionOptions,\n PersonalizationRegionOptions,\n QuerySuggestionsRegionOptions,\n} from './models';\n\nexport * from './models';\n\nexport type Algoliasearch = SearchClient & {\n initAbtesting: (initOptions: InitClientOptions & AbtestingRegionOptions) => AbtestingClient;\n initAnalytics: (initOptions: InitClientOptions & AnalyticsRegionOptions) => AnalyticsClient;\n initIngestion: (initOptions: InitClientOptions & IngestionRegionOptions) => IngestionClient;\n initInsights: (initOptions: InitClientOptions & InsightsRegionOptions) => InsightsClient;\n initMonitoring: (initOptions?: InitClientOptions) => MonitoringClient;\n initPersonalization: (initOptions: InitClientOptions & PersonalizationRegionOptions) => PersonalizationClient;\n initQuerySuggestions: (initOptions: InitClientOptions & QuerySuggestionsRegionOptions) => QuerySuggestionsClient;\n initRecommend: (initOptions?: InitClientOptions) => RecommendClient;\n\n // Bridge helpers to expose along with the search endpoints at the root of the API client\n\n /**\n * Helper: Similar to the `saveObjects` method but requires a Push connector (https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/connectors/push/) to be created first, in order to transform records before indexing them to Algolia. The `region` must have been passed to the client instantiation method.\n *\n * @summary Save objects to an Algolia index by leveraging the Transformation pipeline setup using the Push connector (https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/connectors/push/).\n * @param saveObjects - The `saveObjects` object.\n * @param saveObjects.indexName - The `indexName` to save `objects` in.\n * @param saveObjects.objects - The array of `objects` to store in the given Algolia `indexName`.\n * @param saveObjects.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.\n * @param saveObjects.waitForTasks - Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable.\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `push` method and merged with the transporter requestOptions.\n */\n saveObjectsWithTransformation: (\n options: SaveObjectsOptions,\n requestOptions?: RequestOptions | undefined,\n ) => Promise<Array<WatchResponse>>;\n\n /**\n * Helper: Similar to the `partialUpdateObjects` method but requires a Push connector (https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/connectors/push/) to be created first, in order to transform records before indexing them to Algolia. The `region` must have been passed to the client instantiation method.\n *\n * @summary Save objects to an Algolia index by leveraging the Transformation pipeline setup in the Push connector (https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/connectors/push/).\n * @param partialUpdateObjects - The `partialUpdateObjects` object.\n * @param partialUpdateObjects.indexName - The `indexName` to update `objects` in.\n * @param partialUpdateObjects.objects - The array of `objects` to update in the given Algolia `indexName`.\n * @param partialUpdateObjects.createIfNotExists - To be provided if non-existing objects are passed, otherwise, the call will fail..\n * @param partialUpdateObjects.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.\n * @param partialUpdateObjects.waitForTasks - Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable.\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `push` method and merged with the transporter requestOptions.\n */\n partialUpdateObjectsWithTransformation: (\n options: PartialUpdateObjectsOptions,\n requestOptions?: RequestOptions | undefined,\n ) => Promise<Array<WatchResponse>>;\n\n /**\n * Helper: Similar to the `replaceAllObjects` method but requires a Push connector (https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/connectors/push/) to be created first, in order to transform records before indexing them to Algolia. The `region` must have been passed to the client instantiation method.\n *\n * @summary Helper: Replaces all objects (records) in the given `index_name` by leveraging the Transformation pipeline setup in the Push connector (https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/connectors/push/) with the given `objects`. A temporary index is created during this process in order to backup your data.\n * @param replaceAllObjects - The `replaceAllObjects` object.\n * @param replaceAllObjects.indexName - The `indexName` to replace `objects` in.\n * @param replaceAllObjects.objects - The array of `objects` to store in the given Algolia `indexName`.\n * @param replaceAllObjects.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `objects.length / batchSize`. Defaults to 1000.\n * @param replaceAllObjects.scopes - The `scopes` to keep from the index. Defaults to ['settings', 'rules', 'synonyms'].\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `push`, `operationIndex` and `getEvent` method and merged with the transporter requestOptions.\n */\n replaceAllObjectsWithTransformation: (\n options: ReplaceAllObjectsOptions,\n requestOptions?: RequestOptions | undefined,\n ) => Promise<ReplaceAllObjectsWithTransformationResponse>;\n};\n\nexport type TransformationOptions = {\n // When provided, a second transporter will be created in order to leverage the `*WithTransformation` methods exposed by the Push connector (https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/connectors/push/).\n transformation?:\n | {\n // The region of your Algolia application ID, used to target the correct hosts of the transformation service.\n region: IngestionRegion;\n }\n | undefined;\n};\n\nexport function algoliasearch(\n appId: string,\n apiKey: string,\n options?: (ClientOptions & TransformationOptions) | undefined,\n): Algoliasearch {\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 const client = searchClient(appId, apiKey, options);\n\n let ingestionTransporter: IngestionClient | undefined;\n\n if (options?.transformation) {\n if (!options.transformation.region) {\n throw new Error('`region` must be provided when leveraging the transformation pipeline');\n }\n\n ingestionTransporter = ingestionClient(appId, apiKey, options.transformation.region, options);\n }\n\n return {\n ...client,\n\n async saveObjectsWithTransformation(\n { indexName, objects, waitForTasks },\n requestOptions,\n ): Promise<Array<WatchResponse>> {\n if (!ingestionTransporter) {\n throw new Error('`transformation.region` must be provided at client instantiation before calling this method.');\n }\n\n if (!options?.transformation?.region) {\n throw new Error('`region` must be provided when leveraging the transformation pipeline');\n }\n\n return ingestionTransporter.chunkedPush(\n { indexName, objects, action: 'addObject', waitForTasks },\n requestOptions,\n );\n },\n\n async partialUpdateObjectsWithTransformation(\n { indexName, objects, createIfNotExists, waitForTasks },\n requestOptions,\n ): Promise<Array<WatchResponse>> {\n if (!ingestionTransporter) {\n throw new Error('`transformation.region` must be provided at client instantiation before calling this method.');\n }\n\n if (!options?.transformation?.region) {\n throw new Error('`region` must be provided when leveraging the transformation pipeline');\n }\n\n return ingestionTransporter.chunkedPush(\n {\n indexName,\n objects,\n action: createIfNotExists ? 'partialUpdateObject' : 'partialUpdateObjectNoCreate',\n waitForTasks,\n },\n requestOptions,\n );\n },\n\n async replaceAllObjectsWithTransformation(\n { indexName, objects, batchSize, scopes }: ReplaceAllObjectsOptions,\n requestOptions?: RequestOptions | undefined,\n ): Promise<ReplaceAllObjectsWithTransformationResponse> {\n if (!ingestionTransporter) {\n throw new Error('`transformation.region` must be provided at client instantiation before calling this method.');\n }\n\n if (!options?.transformation?.region) {\n throw new Error('`region` must be provided when leveraging the transformation pipeline');\n }\n\n const randomSuffix = Math.floor(Math.random() * 1000000) + 100000;\n const tmpIndexName = `${indexName}_tmp_${randomSuffix}`;\n\n if (scopes === undefined) {\n scopes = ['settings', 'rules', 'synonyms'];\n }\n\n try {\n let copyOperationResponse = await this.operationIndex(\n {\n indexName,\n operationIndexParams: {\n operation: 'copy',\n destination: tmpIndexName,\n scope: scopes,\n },\n },\n requestOptions,\n );\n\n const watchResponses = await ingestionTransporter.chunkedPush(\n { indexName: tmpIndexName, objects, waitForTasks: true, batchSize, referenceIndexName: indexName },\n requestOptions,\n );\n\n await this.waitForTask({\n indexName: tmpIndexName,\n taskID: copyOperationResponse.taskID,\n });\n\n copyOperationResponse = await this.operationIndex(\n {\n indexName,\n operationIndexParams: {\n operation: 'copy',\n destination: tmpIndexName,\n scope: scopes,\n },\n },\n requestOptions,\n );\n await this.waitForTask({\n indexName: tmpIndexName,\n taskID: copyOperationResponse.taskID,\n });\n\n const moveOperationResponse = await this.operationIndex(\n {\n indexName: tmpIndexName,\n operationIndexParams: { operation: 'move', destination: indexName },\n },\n requestOptions,\n );\n await this.waitForTask({\n indexName: tmpIndexName,\n taskID: moveOperationResponse.taskID,\n });\n\n return { copyOperationResponse, watchResponses, moveOperationResponse };\n } catch (error) {\n await this.deleteIndex({ indexName: tmpIndexName });\n\n throw error;\n }\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 client.transporter.algoliaAgent.value;\n },\n\n initAbtesting: (initOptions: InitClientOptions & AbtestingRegionOptions): AbtestingClient => {\n return abtestingClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n },\n\n initAnalytics: (initOptions: InitClientOptions & AnalyticsRegionOptions): AnalyticsClient => {\n return analyticsClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n },\n\n initIngestion: (initOptions: InitClientOptions & IngestionRegionOptions): IngestionClient => {\n return ingestionClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n },\n\n initInsights: (initOptions: InitClientOptions & InsightsRegionOptions): InsightsClient => {\n return insightsClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n },\n\n initMonitoring: (initOptions: InitClientOptions = {}): MonitoringClient => {\n return monitoringClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);\n },\n\n initPersonalization: (initOptions: InitClientOptions & PersonalizationRegionOptions): PersonalizationClient => {\n return personalizationClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n },\n\n initQuerySuggestions: (initOptions: InitClientOptions & QuerySuggestionsRegionOptions): QuerySuggestionsClient => {\n return querySuggestionsClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n },\n\n initRecommend: (initOptions: InitClientOptions = {}): RecommendClient => {\n return recommendClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);\n },\n };\n}\n","// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nimport type { Region as AbtestingRegion, RegionOptions as AbtestingRegionOptions } from '@algolia/client-abtesting';\nimport type { Region as AnalyticsRegion, RegionOptions as AnalyticsRegionOptions } from '@algolia/client-analytics';\nimport type { Region as InsightsRegion, RegionOptions as InsightsRegionOptions } from '@algolia/client-insights';\nimport type { Region as IngestionRegion, RegionOptions as IngestionRegionOptions } from '@algolia/ingestion';\n\nimport type {\n Region as PersonalizationRegion,\n RegionOptions as PersonalizationRegionOptions,\n} from '@algolia/client-personalization';\nimport type {\n Region as QuerySuggestionsRegion,\n RegionOptions as QuerySuggestionsRegionOptions,\n} from '@algolia/client-query-suggestions';\n\nimport type { Status } from '@algolia/client-abtesting';\nimport type { ClientOptions } from '@algolia/client-common';\nimport type { EventType } from '@algolia/client-personalization';\nimport type {\n Action,\n AdvancedSyntaxFeatures,\n AlternativesAsExact,\n Anchoring,\n AroundPrecision,\n AroundRadius,\n AroundRadiusAll,\n AutomaticFacetFilter,\n AutomaticFacetFilters,\n Banner,\n BannerImage,\n BannerImageUrl,\n BannerLink,\n BaseIndexSettings,\n BaseSearchParams,\n BaseSearchParamsWithoutQuery,\n BaseSearchResponse,\n BooleanString,\n Condition,\n Consequence,\n ConsequenceHide,\n ConsequenceParams,\n ConsequenceQuery,\n ConsequenceQueryObject,\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteSourceProps,\n DeletedAtResponse,\n Distinct,\n Edit,\n EditType,\n ErrorBase,\n ExactOnSingleWordQuery,\n Exhaustive,\n FacetFilters,\n FacetHits,\n FacetOrdering,\n FacetStats,\n Facets,\n GetTaskProps,\n HighlightResult,\n HighlightResultOption,\n Hit,\n IgnorePlurals,\n IndexSettingsAsSearchParams,\n InsideBoundingBox,\n Languages,\n MatchLevel,\n MatchedGeoLocation,\n Mode,\n NumericFilters,\n OptionalFilters,\n OptionalWords,\n Params,\n Personalization,\n Promote,\n PromoteObjectID,\n PromoteObjectIDs,\n QueryType,\n Range,\n RankingInfo,\n ReRankingApplyFilter,\n Redirect,\n RedirectRuleIndexData,\n RedirectRuleIndexMetadata,\n RedirectURL,\n RemoveStopWords,\n RemoveWordsIfNoResults,\n RenderingContent,\n SearchForFacetValuesProps,\n SearchForFacetValuesRequest,\n SearchForFacetValuesResponse,\n SearchHits,\n SearchPagination,\n SearchParams,\n SearchParamsObject,\n SearchParamsQuery,\n SearchResponse,\n SemanticSearch,\n SnippetResult,\n SnippetResultOption,\n SortRemainingBy,\n Source,\n SupportedLanguage,\n TagFilters,\n TaskStatus,\n TimeRange,\n TypoTolerance,\n TypoToleranceEnum,\n Value,\n Widgets,\n} from '@algolia/client-search';\nimport { apiClientVersion } from '@algolia/client-search';\nimport type { Event, EventStatus, WatchResponse } from '@algolia/ingestion';\n\nexport * from '@algolia/client-abtesting';\nexport * from '@algolia/client-analytics';\nexport * from '@algolia/client-insights';\nexport * from '@algolia/client-personalization';\nexport * from '@algolia/client-query-suggestions';\nexport * from '@algolia/client-search';\nexport * from '@algolia/ingestion';\nexport * from '@algolia/monitoring';\nexport * from '@algolia/recommend';\n\nexport type Region =\n | AbtestingRegion\n | AnalyticsRegion\n | IngestionRegion\n | InsightsRegion\n | PersonalizationRegion\n | QuerySuggestionsRegion;\nexport type RegionOptions =\n | AbtestingRegionOptions\n | AnalyticsRegionOptions\n | IngestionRegionOptions\n | InsightsRegionOptions\n | PersonalizationRegionOptions\n | QuerySuggestionsRegionOptions;\n\nexport type {\n AbtestingRegion,\n AbtestingRegionOptions,\n AnalyticsRegion,\n AnalyticsRegionOptions,\n EventType,\n IngestionRegion,\n IngestionRegionOptions,\n InsightsRegion,\n InsightsRegionOptions,\n PersonalizationRegion,\n PersonalizationRegionOptions,\n QuerySuggestionsRegion,\n QuerySuggestionsRegionOptions,\n Status,\n};\n\nexport type {\n Action,\n AdvancedSyntaxFeatures,\n AlternativesAsExact,\n Anchoring,\n AroundPrecision,\n AroundRadius,\n AroundRadiusAll,\n AutomaticFacetFilter,\n AutomaticFacetFilters,\n Banner,\n BannerImage,\n BannerImageUrl,\n BannerLink,\n BaseIndexSettings,\n BaseSearchParams,\n BaseSearchParamsWithoutQuery,\n BaseSearchResponse,\n BooleanString,\n Condition,\n Consequence,\n ConsequenceHide,\n ConsequenceParams,\n ConsequenceQuery,\n ConsequenceQueryObject,\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteSourceProps,\n DeletedAtResponse,\n Distinct,\n Edit,\n EditType,\n ErrorBase,\n Event,\n EventStatus,\n ExactOnSingleWordQuery,\n Exhaustive,\n FacetFilters,\n FacetHits,\n FacetOrdering,\n FacetStats,\n Facets,\n GetTaskProps,\n HighlightResult,\n HighlightResultOption,\n Hit,\n IgnorePlurals,\n IndexSettingsAsSearchParams,\n InsideBoundingBox,\n Languages,\n MatchLevel,\n MatchedGeoLocation,\n Mode,\n NumericFilters,\n OptionalFilters,\n OptionalWords,\n Params,\n Personalization,\n Promote,\n PromoteObjectID,\n PromoteObjectIDs,\n QueryType,\n Range,\n RankingInfo,\n ReRankingApplyFilter,\n Redirect,\n RedirectRuleIndexData,\n RedirectRuleIndexMetadata,\n RedirectURL,\n RemoveStopWords,\n RemoveWordsIfNoResults,\n RenderingContent,\n SearchForFacetValuesProps,\n SearchForFacetValuesRequest,\n SearchForFacetValuesResponse,\n SearchHits,\n SearchPagination,\n SearchParams,\n SearchParamsObject,\n SearchParamsQuery,\n SearchResponse,\n SemanticSearch,\n SnippetResult,\n SnippetResultOption,\n SortRemainingBy,\n Source,\n SupportedLanguage,\n TagFilters,\n TaskStatus,\n TimeRange,\n TypoTolerance,\n TypoToleranceEnum,\n Value,\n WatchResponse,\n Widgets,\n};\n\nexport { apiClientVersion };\n\n/**\n * Options forwarded to the client initialized via the `init` method.\n */\nexport type InitClientOptions = Partial<{\n /**\n * App to target with the initialized client, defaults to the `algoliasearch` appId.\n */\n appId: string;\n /**\n * API key of the targeted app ID, defaults to the `algoliasearch` apiKey.\n */\n apiKey: string;\n options: ClientOptions;\n}>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,8BAAgC;AAEhC,8BAAgC;AAEhC,6BAA+B;AAE/B,oCAAsC;AAEtC,sCAAuC;AAEvC,IAAAA,wBAA6B;AAE7B,uBAAgC;AAEhC,wBAAiC;AAEjC,uBAAgC;;;ACrBhC;AAAA;AAAA;AAAA;AAkHA,2BAAiC;AAGjC,2BAAc;AACd,2BAAc;AACd,2BAAc;AACd,2BAAc;AACd,2BAAc;AACd,2BAAc;AACd,2BAAc;AACd,2BAAc;AACd,2BAAc;;;ADnFd,yBAAc,gBA1Cd;AAoHO,SAAS,cACd,OACA,QACA,SACe;AACf,MAAI,CAAC,SAAS,OAAO,UAAU,UAAU;AACvC,UAAM,IAAI,MAAM,qBAAqB;AAAA,EACvC;AAEA,MAAI,CAAC,UAAU,OAAO,WAAW,UAAU;AACzC,UAAM,IAAI,MAAM,sBAAsB;AAAA,EACxC;AAEA,QAAM,aAAS,oCAAa,OAAO,QA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1
+ {"version":3,"sources":["../builds/node.ts","../builds/models.ts"],"sourcesContent":["// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nimport type { ClientOptions, RequestOptions } from '@algolia/client-common';\n\nimport type { AbtestingV3Client } from '@algolia/abtesting';\nimport { abtestingV3Client } from '@algolia/abtesting';\nimport type { AbtestingClient } from '@algolia/client-abtesting';\nimport { abtestingClient } from '@algolia/client-abtesting';\nimport type { AnalyticsClient } from '@algolia/client-analytics';\nimport { analyticsClient } from '@algolia/client-analytics';\nimport type { InsightsClient } from '@algolia/client-insights';\nimport { insightsClient } from '@algolia/client-insights';\nimport type { PersonalizationClient } from '@algolia/client-personalization';\nimport { personalizationClient } from '@algolia/client-personalization';\nimport type { QuerySuggestionsClient } from '@algolia/client-query-suggestions';\nimport { querySuggestionsClient } from '@algolia/client-query-suggestions';\nimport type { SearchClient } from '@algolia/client-search';\nimport { searchClient } from '@algolia/client-search';\nimport type { IngestionClient } from '@algolia/ingestion';\nimport { ingestionClient } from '@algolia/ingestion';\nimport type { MonitoringClient } from '@algolia/monitoring';\nimport { monitoringClient } from '@algolia/monitoring';\nimport type { RecommendClient } from '@algolia/recommend';\nimport { recommendClient } from '@algolia/recommend';\n\nimport type {\n PartialUpdateObjectsOptions,\n ReplaceAllObjectsOptions,\n ReplaceAllObjectsWithTransformationResponse,\n SaveObjectsOptions,\n} from '@algolia/client-search';\nimport type { WatchResponse } from '@algolia/ingestion';\n\nimport type {\n AbtestingRegionOptions,\n AbtestingV3RegionOptions,\n AnalyticsRegionOptions,\n IngestionRegion,\n IngestionRegionOptions,\n InitClientOptions,\n InsightsRegionOptions,\n PersonalizationRegionOptions,\n QuerySuggestionsRegionOptions,\n} from './models';\n\nexport * from './models';\n\nexport type Algoliasearch = SearchClient & {\n initAbtesting: (initOptions: InitClientOptions & AbtestingRegionOptions) => AbtestingClient;\n initAbtestingV3: (initOptions: InitClientOptions & AbtestingV3RegionOptions) => AbtestingV3Client;\n initAnalytics: (initOptions: InitClientOptions & AnalyticsRegionOptions) => AnalyticsClient;\n initIngestion: (initOptions: InitClientOptions & IngestionRegionOptions) => IngestionClient;\n initInsights: (initOptions: InitClientOptions & InsightsRegionOptions) => InsightsClient;\n initMonitoring: (initOptions?: InitClientOptions) => MonitoringClient;\n initPersonalization: (initOptions: InitClientOptions & PersonalizationRegionOptions) => PersonalizationClient;\n initQuerySuggestions: (initOptions: InitClientOptions & QuerySuggestionsRegionOptions) => QuerySuggestionsClient;\n initRecommend: (initOptions?: InitClientOptions) => RecommendClient;\n\n // Bridge helpers to expose along with the search endpoints at the root of the API client\n\n /**\n * Helper: Similar to the `saveObjects` method but requires a Push connector (https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/connectors/push/) to be created first, in order to transform records before indexing them to Algolia. The `region` must have been passed to the client instantiation method.\n *\n * @summary Save objects to an Algolia index by leveraging the Transformation pipeline setup using the Push connector (https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/connectors/push/).\n * @param saveObjects - The `saveObjects` object.\n * @param saveObjects.indexName - The `indexName` to save `objects` in.\n * @param saveObjects.objects - The array of `objects` to store in the given Algolia `indexName`.\n * @param saveObjects.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.\n * @param saveObjects.waitForTasks - Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable.\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `push` method and merged with the transporter requestOptions.\n */\n saveObjectsWithTransformation: (\n options: SaveObjectsOptions,\n requestOptions?: RequestOptions | undefined,\n ) => Promise<Array<WatchResponse>>;\n\n /**\n * Helper: Similar to the `partialUpdateObjects` method but requires a Push connector (https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/connectors/push/) to be created first, in order to transform records before indexing them to Algolia. The `region` must have been passed to the client instantiation method.\n *\n * @summary Save objects to an Algolia index by leveraging the Transformation pipeline setup in the Push connector (https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/connectors/push/).\n * @param partialUpdateObjects - The `partialUpdateObjects` object.\n * @param partialUpdateObjects.indexName - The `indexName` to update `objects` in.\n * @param partialUpdateObjects.objects - The array of `objects` to update in the given Algolia `indexName`.\n * @param partialUpdateObjects.createIfNotExists - To be provided if non-existing objects are passed, otherwise, the call will fail..\n * @param partialUpdateObjects.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.\n * @param partialUpdateObjects.waitForTasks - Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable.\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `push` method and merged with the transporter requestOptions.\n */\n partialUpdateObjectsWithTransformation: (\n options: PartialUpdateObjectsOptions,\n requestOptions?: RequestOptions | undefined,\n ) => Promise<Array<WatchResponse>>;\n\n /**\n * Helper: Similar to the `replaceAllObjects` method but requires a Push connector (https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/connectors/push/) to be created first, in order to transform records before indexing them to Algolia. The `region` must have been passed to the client instantiation method.\n *\n * @summary Helper: Replaces all objects (records) in the given `index_name` by leveraging the Transformation pipeline setup in the Push connector (https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/connectors/push/) with the given `objects`. A temporary index is created during this process in order to backup your data.\n * @param replaceAllObjects - The `replaceAllObjects` object.\n * @param replaceAllObjects.indexName - The `indexName` to replace `objects` in.\n * @param replaceAllObjects.objects - The array of `objects` to store in the given Algolia `indexName`.\n * @param replaceAllObjects.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `objects.length / batchSize`. Defaults to 1000.\n * @param replaceAllObjects.scopes - The `scopes` to keep from the index. Defaults to ['settings', 'rules', 'synonyms'].\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `push`, `operationIndex` and `getEvent` method and merged with the transporter requestOptions.\n */\n replaceAllObjectsWithTransformation: (\n options: ReplaceAllObjectsOptions,\n requestOptions?: RequestOptions | undefined,\n ) => Promise<ReplaceAllObjectsWithTransformationResponse>;\n};\n\nexport type TransformationOptions = {\n // When provided, a second transporter will be created in order to leverage the `*WithTransformation` methods exposed by the Push connector (https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/connectors/push/).\n transformation?:\n | {\n // The region of your Algolia application ID, used to target the correct hosts of the transformation service.\n region: IngestionRegion;\n }\n | undefined;\n};\n\nexport function algoliasearch(\n appId: string,\n apiKey: string,\n options?: (ClientOptions & TransformationOptions) | undefined,\n): Algoliasearch {\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 const client = searchClient(appId, apiKey, options);\n\n let ingestionTransporter: IngestionClient | undefined;\n\n if (options?.transformation) {\n if (!options.transformation.region) {\n throw new Error('`region` must be provided when leveraging the transformation pipeline');\n }\n\n ingestionTransporter = ingestionClient(appId, apiKey, options.transformation.region, options);\n }\n\n return {\n ...client,\n\n async saveObjectsWithTransformation(\n { indexName, objects, waitForTasks },\n requestOptions,\n ): Promise<Array<WatchResponse>> {\n if (!ingestionTransporter) {\n throw new Error('`transformation.region` must be provided at client instantiation before calling this method.');\n }\n\n if (!options?.transformation?.region) {\n throw new Error('`region` must be provided when leveraging the transformation pipeline');\n }\n\n return ingestionTransporter.chunkedPush(\n { indexName, objects, action: 'addObject', waitForTasks },\n requestOptions,\n );\n },\n\n async partialUpdateObjectsWithTransformation(\n { indexName, objects, createIfNotExists, waitForTasks },\n requestOptions,\n ): Promise<Array<WatchResponse>> {\n if (!ingestionTransporter) {\n throw new Error('`transformation.region` must be provided at client instantiation before calling this method.');\n }\n\n if (!options?.transformation?.region) {\n throw new Error('`region` must be provided when leveraging the transformation pipeline');\n }\n\n return ingestionTransporter.chunkedPush(\n {\n indexName,\n objects,\n action: createIfNotExists ? 'partialUpdateObject' : 'partialUpdateObjectNoCreate',\n waitForTasks,\n },\n requestOptions,\n );\n },\n\n async replaceAllObjectsWithTransformation(\n { indexName, objects, batchSize, scopes }: ReplaceAllObjectsOptions,\n requestOptions?: RequestOptions | undefined,\n ): Promise<ReplaceAllObjectsWithTransformationResponse> {\n if (!ingestionTransporter) {\n throw new Error('`transformation.region` must be provided at client instantiation before calling this method.');\n }\n\n if (!options?.transformation?.region) {\n throw new Error('`region` must be provided when leveraging the transformation pipeline');\n }\n\n const randomSuffix = Math.floor(Math.random() * 1000000) + 100000;\n const tmpIndexName = `${indexName}_tmp_${randomSuffix}`;\n\n if (scopes === undefined) {\n scopes = ['settings', 'rules', 'synonyms'];\n }\n\n try {\n let copyOperationResponse = await this.operationIndex(\n {\n indexName,\n operationIndexParams: {\n operation: 'copy',\n destination: tmpIndexName,\n scope: scopes,\n },\n },\n requestOptions,\n );\n\n const watchResponses = await ingestionTransporter.chunkedPush(\n { indexName: tmpIndexName, objects, waitForTasks: true, batchSize, referenceIndexName: indexName },\n requestOptions,\n );\n\n await this.waitForTask({\n indexName: tmpIndexName,\n taskID: copyOperationResponse.taskID,\n });\n\n copyOperationResponse = await this.operationIndex(\n {\n indexName,\n operationIndexParams: {\n operation: 'copy',\n destination: tmpIndexName,\n scope: scopes,\n },\n },\n requestOptions,\n );\n await this.waitForTask({\n indexName: tmpIndexName,\n taskID: copyOperationResponse.taskID,\n });\n\n const moveOperationResponse = await this.operationIndex(\n {\n indexName: tmpIndexName,\n operationIndexParams: { operation: 'move', destination: indexName },\n },\n requestOptions,\n );\n await this.waitForTask({\n indexName: tmpIndexName,\n taskID: moveOperationResponse.taskID,\n });\n\n return { copyOperationResponse, watchResponses, moveOperationResponse };\n } catch (error) {\n await this.deleteIndex({ indexName: tmpIndexName });\n\n throw error;\n }\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 client.transporter.algoliaAgent.value;\n },\n\n initAbtesting: (initOptions: InitClientOptions & AbtestingRegionOptions): AbtestingClient => {\n return abtestingClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n },\n\n initAbtestingV3: (initOptions: InitClientOptions & AbtestingV3RegionOptions): AbtestingV3Client => {\n return abtestingV3Client(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n },\n\n initAnalytics: (initOptions: InitClientOptions & AnalyticsRegionOptions): AnalyticsClient => {\n return analyticsClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n },\n\n initIngestion: (initOptions: InitClientOptions & IngestionRegionOptions): IngestionClient => {\n return ingestionClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n },\n\n initInsights: (initOptions: InitClientOptions & InsightsRegionOptions): InsightsClient => {\n return insightsClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n },\n\n initMonitoring: (initOptions: InitClientOptions = {}): MonitoringClient => {\n return monitoringClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);\n },\n\n initPersonalization: (initOptions: InitClientOptions & PersonalizationRegionOptions): PersonalizationClient => {\n return personalizationClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n },\n\n initQuerySuggestions: (initOptions: InitClientOptions & QuerySuggestionsRegionOptions): QuerySuggestionsClient => {\n return querySuggestionsClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n },\n\n initRecommend: (initOptions: InitClientOptions = {}): RecommendClient => {\n return recommendClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);\n },\n };\n}\n","// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nimport type { Region as AbtestingV3Region, RegionOptions as AbtestingV3RegionOptions } from '@algolia/abtesting';\nimport type { Region as AbtestingRegion, RegionOptions as AbtestingRegionOptions } from '@algolia/client-abtesting';\nimport type { Region as AnalyticsRegion, RegionOptions as AnalyticsRegionOptions } from '@algolia/client-analytics';\nimport type { Region as InsightsRegion, RegionOptions as InsightsRegionOptions } from '@algolia/client-insights';\nimport type { Region as IngestionRegion, RegionOptions as IngestionRegionOptions } from '@algolia/ingestion';\n\nimport type {\n Region as PersonalizationRegion,\n RegionOptions as PersonalizationRegionOptions,\n} from '@algolia/client-personalization';\nimport type {\n Region as QuerySuggestionsRegion,\n RegionOptions as QuerySuggestionsRegionOptions,\n} from '@algolia/client-query-suggestions';\n\nimport type { Direction } from '@algolia/client-analytics';\nimport type { ClientOptions } from '@algolia/client-common';\nimport type { EventType } from '@algolia/client-personalization';\nimport type {\n Action,\n AdvancedSyntaxFeatures,\n AlternativesAsExact,\n Anchoring,\n AroundPrecision,\n AroundRadius,\n AroundRadiusAll,\n AutomaticFacetFilter,\n AutomaticFacetFilters,\n Banner,\n BannerImage,\n BannerImageUrl,\n BannerLink,\n BaseIndexSettings,\n BaseSearchParams,\n BaseSearchParamsWithoutQuery,\n BaseSearchResponse,\n BooleanString,\n Condition,\n Consequence,\n ConsequenceHide,\n ConsequenceParams,\n ConsequenceQuery,\n ConsequenceQueryObject,\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteSourceProps,\n DeletedAtResponse,\n Distinct,\n Edit,\n EditType,\n ErrorBase,\n ExactOnSingleWordQuery,\n Exhaustive,\n FacetFilters,\n FacetHits,\n FacetOrdering,\n FacetStats,\n Facets,\n GetTaskProps,\n HighlightResult,\n HighlightResultOption,\n Hit,\n IgnorePlurals,\n IndexSettingsAsSearchParams,\n InsideBoundingBox,\n Languages,\n MatchLevel,\n MatchedGeoLocation,\n Mode,\n NumericFilters,\n OptionalFilters,\n OptionalWords,\n Params,\n Personalization,\n Promote,\n PromoteObjectID,\n PromoteObjectIDs,\n QueryType,\n Range,\n RankingInfo,\n ReRankingApplyFilter,\n Redirect,\n RedirectRuleIndexData,\n RedirectRuleIndexMetadata,\n RedirectURL,\n RemoveStopWords,\n RemoveWordsIfNoResults,\n RenderingContent,\n SearchForFacetValuesProps,\n SearchForFacetValuesRequest,\n SearchForFacetValuesResponse,\n SearchHits,\n SearchPagination,\n SearchParams,\n SearchParamsObject,\n SearchParamsQuery,\n SearchResponse,\n SemanticSearch,\n SnippetResult,\n SnippetResultOption,\n SortRemainingBy,\n Source,\n SupportedLanguage,\n TagFilters,\n TaskStatus,\n TimeRange,\n TypoTolerance,\n TypoToleranceEnum,\n Value,\n Widgets,\n} from '@algolia/client-search';\nimport { apiClientVersion } from '@algolia/client-search';\nimport type { Event, EventStatus, WatchResponse } from '@algolia/ingestion';\n\nimport type {\n ABTest,\n ABTestConfiguration,\n ABTestResponse,\n AbTestsVariant,\n AbTestsVariantSearchParams,\n AddABTestsRequest,\n AddABTestsVariant,\n CustomSearchParams,\n DeleteABTestProps,\n EffectMetric,\n EmptySearchFilter,\n EstimateABTestRequest,\n EstimateABTestResponse,\n EstimateConfiguration,\n FilterEffects,\n GetABTestProps,\n ListABTestsProps,\n ListABTestsResponse,\n MinimumDetectableEffect,\n OutliersFilter,\n ScheduleABTestResponse,\n ScheduleABTestsRequest,\n Status,\n StopABTestProps,\n Variant,\n} from '@algolia/client-abtesting';\n\nexport * from '@algolia/abtesting';\nexport * from '@algolia/client-abtesting';\nexport * from '@algolia/client-analytics';\nexport * from '@algolia/client-insights';\nexport * from '@algolia/client-personalization';\nexport * from '@algolia/client-query-suggestions';\nexport * from '@algolia/client-search';\nexport * from '@algolia/ingestion';\nexport * from '@algolia/monitoring';\nexport * from '@algolia/recommend';\n\nexport type Region =\n | AbtestingRegion\n | AbtestingV3Region\n | AnalyticsRegion\n | IngestionRegion\n | InsightsRegion\n | PersonalizationRegion\n | QuerySuggestionsRegion;\nexport type RegionOptions =\n | AbtestingRegionOptions\n | AbtestingV3RegionOptions\n | AnalyticsRegionOptions\n | IngestionRegionOptions\n | InsightsRegionOptions\n | PersonalizationRegionOptions\n | QuerySuggestionsRegionOptions;\n\nexport type {\n AbtestingRegion,\n AbtestingRegionOptions,\n AbtestingV3Region,\n AbtestingV3RegionOptions,\n AnalyticsRegion,\n AnalyticsRegionOptions,\n EventType,\n IngestionRegion,\n IngestionRegionOptions,\n InsightsRegion,\n InsightsRegionOptions,\n PersonalizationRegion,\n PersonalizationRegionOptions,\n QuerySuggestionsRegion,\n QuerySuggestionsRegionOptions,\n Status,\n};\n\nexport type {\n ABTest,\n ABTestConfiguration,\n ABTestResponse,\n AbTestsVariant,\n AbTestsVariantSearchParams,\n Action,\n AddABTestsRequest,\n AddABTestsVariant,\n AdvancedSyntaxFeatures,\n AlternativesAsExact,\n Anchoring,\n AroundPrecision,\n AroundRadius,\n AroundRadiusAll,\n AutomaticFacetFilter,\n AutomaticFacetFilters,\n Banner,\n BannerImage,\n BannerImageUrl,\n BannerLink,\n BaseIndexSettings,\n BaseSearchParams,\n BaseSearchParamsWithoutQuery,\n BaseSearchResponse,\n BooleanString,\n Condition,\n Consequence,\n ConsequenceHide,\n ConsequenceParams,\n ConsequenceQuery,\n ConsequenceQueryObject,\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n CustomSearchParams,\n DeleteABTestProps,\n DeleteSourceProps,\n DeletedAtResponse,\n Direction,\n Distinct,\n Edit,\n EditType,\n EffectMetric,\n EmptySearchFilter,\n ErrorBase,\n EstimateABTestRequest,\n EstimateABTestResponse,\n EstimateConfiguration,\n Event,\n EventStatus,\n ExactOnSingleWordQuery,\n Exhaustive,\n FacetFilters,\n FacetHits,\n FacetOrdering,\n FacetStats,\n Facets,\n FilterEffects,\n GetABTestProps,\n GetTaskProps,\n HighlightResult,\n HighlightResultOption,\n Hit,\n IgnorePlurals,\n IndexSettingsAsSearchParams,\n InsideBoundingBox,\n Languages,\n ListABTestsProps,\n ListABTestsResponse,\n MatchLevel,\n MatchedGeoLocation,\n MinimumDetectableEffect,\n Mode,\n NumericFilters,\n OptionalFilters,\n OptionalWords,\n OutliersFilter,\n Params,\n Personalization,\n Promote,\n PromoteObjectID,\n PromoteObjectIDs,\n QueryType,\n Range,\n RankingInfo,\n ReRankingApplyFilter,\n Redirect,\n RedirectRuleIndexData,\n RedirectRuleIndexMetadata,\n RedirectURL,\n RemoveStopWords,\n RemoveWordsIfNoResults,\n RenderingContent,\n ScheduleABTestResponse,\n ScheduleABTestsRequest,\n SearchForFacetValuesProps,\n SearchForFacetValuesRequest,\n SearchForFacetValuesResponse,\n SearchHits,\n SearchPagination,\n SearchParams,\n SearchParamsObject,\n SearchParamsQuery,\n SearchResponse,\n SemanticSearch,\n SnippetResult,\n SnippetResultOption,\n SortRemainingBy,\n Source,\n StopABTestProps,\n SupportedLanguage,\n TagFilters,\n TaskStatus,\n TimeRange,\n TypoTolerance,\n TypoToleranceEnum,\n Value,\n Variant,\n WatchResponse,\n Widgets,\n};\n\nexport { apiClientVersion };\n\n/**\n * Options forwarded to the client initialized via the `init` method.\n */\nexport type InitClientOptions = Partial<{\n /**\n * App to target with the initialized client, defaults to the `algoliasearch` appId.\n */\n appId: string;\n /**\n * API key of the targeted app ID, defaults to the `algoliasearch` apiKey.\n */\n apiKey: string;\n options: ClientOptions;\n}>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,uBAAkC;AAElC,8BAAgC;AAEhC,8BAAgC;AAEhC,6BAA+B;AAE/B,oCAAsC;AAEtC,sCAAuC;AAEvC,IAAAA,wBAA6B;AAE7B,uBAAgC;AAEhC,wBAAiC;AAEjC,uBAAgC;;;ACvBhC;AAAA;AAAA;AAAA;AAmHA,2BAAiC;AA+BjC,2BAAc;AACd,2BAAc;AACd,2BAAc;AACd,2BAAc;AACd,2BAAc;AACd,2BAAc;AACd,2BAAc;AACd,2BAAc;AACd,2BA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AyF;AAC7G,iBAAO;AAAA,QACL,YAAY,SAAS;AAAA,QACrB,YAAY,UAAU;AAAA,QACtB,YAAY;AAAA,QACZ,YAAY;AAAA,MACd;AAAA,IACF;AAAA,IAEA,sBAAsB,CAAC,gBAA2F;AAChH,iBAAO;AAAA,QACL,YAAY,SAAS;AAAA,QACrB,YAAY,UAAU;AAAA,QACtB,YAAY;AAAA,QACZ,YAAY;AAAA,MACd;AAAA,IACF;AAAA,IAEA,eAAe,CAAC,cAAiC,CAAC,MAAuB;AACvE,iBAAO,kCAAgB,YAAY,SAAS,OAAO,YAAY,UAAU,QAAQ,YAAY,OAAO;AAAA,IACtG;AAAA,EACF;AACF;","names":["import_client_search"]}
package/dist/node.d.cts CHANGED
@@ -1,23 +1,26 @@
1
1
  import { ClientOptions, RequestOptions } from '@algolia/client-common';
2
+ import { Region as Region$2, RegionOptions as RegionOptions$2, AbtestingV3Client } from '@algolia/abtesting';
3
+ export * from '@algolia/abtesting';
4
+ export { Region as AbtestingV3Region, RegionOptions as AbtestingV3RegionOptions } from '@algolia/abtesting';
2
5
  import { Region as Region$1, RegionOptions as RegionOptions$1, AbtestingClient } from '@algolia/client-abtesting';
3
6
  export * from '@algolia/client-abtesting';
4
- export { Region as AbtestingRegion, RegionOptions as AbtestingRegionOptions, Status } from '@algolia/client-abtesting';
5
- import { Region as Region$2, RegionOptions as RegionOptions$2, AnalyticsClient } from '@algolia/client-analytics';
7
+ export { ABTest, ABTestConfiguration, ABTestResponse, AbTestsVariant, AbTestsVariantSearchParams, Region as AbtestingRegion, RegionOptions as AbtestingRegionOptions, AddABTestsRequest, AddABTestsVariant, CustomSearchParams, DeleteABTestProps, EffectMetric, EmptySearchFilter, EstimateABTestRequest, EstimateABTestResponse, EstimateConfiguration, FilterEffects, GetABTestProps, ListABTestsProps, ListABTestsResponse, MinimumDetectableEffect, OutliersFilter, ScheduleABTestResponse, ScheduleABTestsRequest, Status, StopABTestProps, Variant } from '@algolia/client-abtesting';
8
+ import { Region as Region$3, RegionOptions as RegionOptions$3, AnalyticsClient } from '@algolia/client-analytics';
6
9
  export * from '@algolia/client-analytics';
7
- export { Region as AnalyticsRegion, RegionOptions as AnalyticsRegionOptions } from '@algolia/client-analytics';
8
- import { Region as Region$4, RegionOptions as RegionOptions$4, InsightsClient } from '@algolia/client-insights';
10
+ export { Region as AnalyticsRegion, RegionOptions as AnalyticsRegionOptions, Direction } from '@algolia/client-analytics';
11
+ import { Region as Region$5, RegionOptions as RegionOptions$5, InsightsClient } from '@algolia/client-insights';
9
12
  export * from '@algolia/client-insights';
10
13
  export { Region as InsightsRegion, RegionOptions as InsightsRegionOptions } from '@algolia/client-insights';
11
- import { Region as Region$5, RegionOptions as RegionOptions$5, PersonalizationClient } from '@algolia/client-personalization';
14
+ import { Region as Region$6, RegionOptions as RegionOptions$6, PersonalizationClient } from '@algolia/client-personalization';
12
15
  export * from '@algolia/client-personalization';
13
16
  export { EventType, Region as PersonalizationRegion, RegionOptions as PersonalizationRegionOptions } from '@algolia/client-personalization';
14
- import { Region as Region$6, RegionOptions as RegionOptions$6, QuerySuggestionsClient } from '@algolia/client-query-suggestions';
17
+ import { Region as Region$7, RegionOptions as RegionOptions$7, QuerySuggestionsClient } from '@algolia/client-query-suggestions';
15
18
  export * from '@algolia/client-query-suggestions';
16
19
  export { Region as QuerySuggestionsRegion, RegionOptions as QuerySuggestionsRegionOptions } from '@algolia/client-query-suggestions';
17
20
  import { SearchClient, SaveObjectsOptions, PartialUpdateObjectsOptions, ReplaceAllObjectsOptions, ReplaceAllObjectsWithTransformationResponse } from '@algolia/client-search';
18
21
  export * from '@algolia/client-search';
19
22
  export { Action, AdvancedSyntaxFeatures, AlternativesAsExact, Anchoring, AroundPrecision, AroundRadius, AroundRadiusAll, AutomaticFacetFilter, AutomaticFacetFilters, Banner, BannerImage, BannerImageUrl, BannerLink, BaseIndexSettings, BaseSearchParams, BaseSearchParamsWithoutQuery, BaseSearchResponse, BooleanString, Condition, Consequence, ConsequenceHide, ConsequenceParams, ConsequenceQuery, ConsequenceQueryObject, CustomDeleteProps, CustomGetProps, CustomPostProps, CustomPutProps, DeleteSourceProps, DeletedAtResponse, Distinct, Edit, EditType, ErrorBase, ExactOnSingleWordQuery, Exhaustive, FacetFilters, FacetHits, FacetOrdering, FacetStats, Facets, GetTaskProps, HighlightResult, HighlightResultOption, Hit, IgnorePlurals, IndexSettingsAsSearchParams, InsideBoundingBox, Languages, MatchLevel, MatchedGeoLocation, Mode, NumericFilters, OptionalFilters, OptionalWords, Params, Personalization, Promote, PromoteObjectID, PromoteObjectIDs, QueryType, Range, RankingInfo, ReRankingApplyFilter, Redirect, RedirectRuleIndexData, RedirectRuleIndexMetadata, RedirectURL, RemoveStopWords, RemoveWordsIfNoResults, RenderingContent, SearchForFacetValuesProps, SearchForFacetValuesRequest, SearchForFacetValuesResponse, SearchHits, SearchPagination, SearchParams, SearchParamsObject, SearchParamsQuery, SearchResponse, SemanticSearch, SnippetResult, SnippetResultOption, SortRemainingBy, Source, SupportedLanguage, TagFilters, TaskStatus, TimeRange, TypoTolerance, TypoToleranceEnum, Value, Widgets, apiClientVersion } from '@algolia/client-search';
20
- import { Region as Region$3, RegionOptions as RegionOptions$3, IngestionClient, WatchResponse } from '@algolia/ingestion';
23
+ import { Region as Region$4, RegionOptions as RegionOptions$4, IngestionClient, WatchResponse } from '@algolia/ingestion';
21
24
  export * from '@algolia/ingestion';
22
25
  export { Event, EventStatus, Region as IngestionRegion, RegionOptions as IngestionRegionOptions, WatchResponse } from '@algolia/ingestion';
23
26
  import { MonitoringClient } from '@algolia/monitoring';
@@ -25,8 +28,8 @@ export * from '@algolia/monitoring';
25
28
  import { RecommendClient } from '@algolia/recommend';
26
29
  export * from '@algolia/recommend';
27
30
 
28
- type Region = Region$1 | Region$2 | Region$3 | Region$4 | Region$5 | Region$6;
29
- type RegionOptions = RegionOptions$1 | RegionOptions$2 | RegionOptions$3 | RegionOptions$4 | RegionOptions$5 | RegionOptions$6;
31
+ type Region = Region$1 | Region$2 | Region$3 | Region$4 | Region$5 | Region$6 | Region$7;
32
+ type RegionOptions = RegionOptions$1 | RegionOptions$2 | RegionOptions$3 | RegionOptions$4 | RegionOptions$5 | RegionOptions$6 | RegionOptions$7;
30
33
 
31
34
  /**
32
35
  * Options forwarded to the client initialized via the `init` method.
@@ -45,12 +48,13 @@ type InitClientOptions = Partial<{
45
48
 
46
49
  type Algoliasearch = SearchClient & {
47
50
  initAbtesting: (initOptions: InitClientOptions & RegionOptions$1) => AbtestingClient;
48
- initAnalytics: (initOptions: InitClientOptions & RegionOptions$2) => AnalyticsClient;
49
- initIngestion: (initOptions: InitClientOptions & RegionOptions$3) => IngestionClient;
50
- initInsights: (initOptions: InitClientOptions & RegionOptions$4) => InsightsClient;
51
+ initAbtestingV3: (initOptions: InitClientOptions & RegionOptions$2) => AbtestingV3Client;
52
+ initAnalytics: (initOptions: InitClientOptions & RegionOptions$3) => AnalyticsClient;
53
+ initIngestion: (initOptions: InitClientOptions & RegionOptions$4) => IngestionClient;
54
+ initInsights: (initOptions: InitClientOptions & RegionOptions$5) => InsightsClient;
51
55
  initMonitoring: (initOptions?: InitClientOptions) => MonitoringClient;
52
- initPersonalization: (initOptions: InitClientOptions & RegionOptions$5) => PersonalizationClient;
53
- initQuerySuggestions: (initOptions: InitClientOptions & RegionOptions$6) => QuerySuggestionsClient;
56
+ initPersonalization: (initOptions: InitClientOptions & RegionOptions$6) => PersonalizationClient;
57
+ initQuerySuggestions: (initOptions: InitClientOptions & RegionOptions$7) => QuerySuggestionsClient;
54
58
  initRecommend: (initOptions?: InitClientOptions) => RecommendClient;
55
59
  /**
56
60
  * Helper: Similar to the `saveObjects` method but requires a Push connector (https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/connectors/push/) to be created first, in order to transform records before indexing them to Algolia. The `region` must have been passed to the client instantiation method.
@@ -92,7 +96,7 @@ type Algoliasearch = SearchClient & {
92
96
  };
93
97
  type TransformationOptions = {
94
98
  transformation?: {
95
- region: Region$3;
99
+ region: Region$4;
96
100
  } | undefined;
97
101
  };
98
102
  declare function algoliasearch(appId: string, apiKey: string, options?: (ClientOptions & TransformationOptions) | undefined): Algoliasearch;
package/dist/node.d.ts CHANGED
@@ -1,23 +1,26 @@
1
1
  import { ClientOptions, RequestOptions } from '@algolia/client-common';
2
+ import { Region as Region$2, RegionOptions as RegionOptions$2, AbtestingV3Client } from '@algolia/abtesting';
3
+ export * from '@algolia/abtesting';
4
+ export { Region as AbtestingV3Region, RegionOptions as AbtestingV3RegionOptions } from '@algolia/abtesting';
2
5
  import { Region as Region$1, RegionOptions as RegionOptions$1, AbtestingClient } from '@algolia/client-abtesting';
3
6
  export * from '@algolia/client-abtesting';
4
- export { Region as AbtestingRegion, RegionOptions as AbtestingRegionOptions, Status } from '@algolia/client-abtesting';
5
- import { Region as Region$2, RegionOptions as RegionOptions$2, AnalyticsClient } from '@algolia/client-analytics';
7
+ export { ABTest, ABTestConfiguration, ABTestResponse, AbTestsVariant, AbTestsVariantSearchParams, Region as AbtestingRegion, RegionOptions as AbtestingRegionOptions, AddABTestsRequest, AddABTestsVariant, CustomSearchParams, DeleteABTestProps, EffectMetric, EmptySearchFilter, EstimateABTestRequest, EstimateABTestResponse, EstimateConfiguration, FilterEffects, GetABTestProps, ListABTestsProps, ListABTestsResponse, MinimumDetectableEffect, OutliersFilter, ScheduleABTestResponse, ScheduleABTestsRequest, Status, StopABTestProps, Variant } from '@algolia/client-abtesting';
8
+ import { Region as Region$3, RegionOptions as RegionOptions$3, AnalyticsClient } from '@algolia/client-analytics';
6
9
  export * from '@algolia/client-analytics';
7
- export { Region as AnalyticsRegion, RegionOptions as AnalyticsRegionOptions } from '@algolia/client-analytics';
8
- import { Region as Region$4, RegionOptions as RegionOptions$4, InsightsClient } from '@algolia/client-insights';
10
+ export { Region as AnalyticsRegion, RegionOptions as AnalyticsRegionOptions, Direction } from '@algolia/client-analytics';
11
+ import { Region as Region$5, RegionOptions as RegionOptions$5, InsightsClient } from '@algolia/client-insights';
9
12
  export * from '@algolia/client-insights';
10
13
  export { Region as InsightsRegion, RegionOptions as InsightsRegionOptions } from '@algolia/client-insights';
11
- import { Region as Region$5, RegionOptions as RegionOptions$5, PersonalizationClient } from '@algolia/client-personalization';
14
+ import { Region as Region$6, RegionOptions as RegionOptions$6, PersonalizationClient } from '@algolia/client-personalization';
12
15
  export * from '@algolia/client-personalization';
13
16
  export { EventType, Region as PersonalizationRegion, RegionOptions as PersonalizationRegionOptions } from '@algolia/client-personalization';
14
- import { Region as Region$6, RegionOptions as RegionOptions$6, QuerySuggestionsClient } from '@algolia/client-query-suggestions';
17
+ import { Region as Region$7, RegionOptions as RegionOptions$7, QuerySuggestionsClient } from '@algolia/client-query-suggestions';
15
18
  export * from '@algolia/client-query-suggestions';
16
19
  export { Region as QuerySuggestionsRegion, RegionOptions as QuerySuggestionsRegionOptions } from '@algolia/client-query-suggestions';
17
20
  import { SearchClient, SaveObjectsOptions, PartialUpdateObjectsOptions, ReplaceAllObjectsOptions, ReplaceAllObjectsWithTransformationResponse } from '@algolia/client-search';
18
21
  export * from '@algolia/client-search';
19
22
  export { Action, AdvancedSyntaxFeatures, AlternativesAsExact, Anchoring, AroundPrecision, AroundRadius, AroundRadiusAll, AutomaticFacetFilter, AutomaticFacetFilters, Banner, BannerImage, BannerImageUrl, BannerLink, BaseIndexSettings, BaseSearchParams, BaseSearchParamsWithoutQuery, BaseSearchResponse, BooleanString, Condition, Consequence, ConsequenceHide, ConsequenceParams, ConsequenceQuery, ConsequenceQueryObject, CustomDeleteProps, CustomGetProps, CustomPostProps, CustomPutProps, DeleteSourceProps, DeletedAtResponse, Distinct, Edit, EditType, ErrorBase, ExactOnSingleWordQuery, Exhaustive, FacetFilters, FacetHits, FacetOrdering, FacetStats, Facets, GetTaskProps, HighlightResult, HighlightResultOption, Hit, IgnorePlurals, IndexSettingsAsSearchParams, InsideBoundingBox, Languages, MatchLevel, MatchedGeoLocation, Mode, NumericFilters, OptionalFilters, OptionalWords, Params, Personalization, Promote, PromoteObjectID, PromoteObjectIDs, QueryType, Range, RankingInfo, ReRankingApplyFilter, Redirect, RedirectRuleIndexData, RedirectRuleIndexMetadata, RedirectURL, RemoveStopWords, RemoveWordsIfNoResults, RenderingContent, SearchForFacetValuesProps, SearchForFacetValuesRequest, SearchForFacetValuesResponse, SearchHits, SearchPagination, SearchParams, SearchParamsObject, SearchParamsQuery, SearchResponse, SemanticSearch, SnippetResult, SnippetResultOption, SortRemainingBy, Source, SupportedLanguage, TagFilters, TaskStatus, TimeRange, TypoTolerance, TypoToleranceEnum, Value, Widgets, apiClientVersion } from '@algolia/client-search';
20
- import { Region as Region$3, RegionOptions as RegionOptions$3, IngestionClient, WatchResponse } from '@algolia/ingestion';
23
+ import { Region as Region$4, RegionOptions as RegionOptions$4, IngestionClient, WatchResponse } from '@algolia/ingestion';
21
24
  export * from '@algolia/ingestion';
22
25
  export { Event, EventStatus, Region as IngestionRegion, RegionOptions as IngestionRegionOptions, WatchResponse } from '@algolia/ingestion';
23
26
  import { MonitoringClient } from '@algolia/monitoring';
@@ -25,8 +28,8 @@ export * from '@algolia/monitoring';
25
28
  import { RecommendClient } from '@algolia/recommend';
26
29
  export * from '@algolia/recommend';
27
30
 
28
- type Region = Region$1 | Region$2 | Region$3 | Region$4 | Region$5 | Region$6;
29
- type RegionOptions = RegionOptions$1 | RegionOptions$2 | RegionOptions$3 | RegionOptions$4 | RegionOptions$5 | RegionOptions$6;
31
+ type Region = Region$1 | Region$2 | Region$3 | Region$4 | Region$5 | Region$6 | Region$7;
32
+ type RegionOptions = RegionOptions$1 | RegionOptions$2 | RegionOptions$3 | RegionOptions$4 | RegionOptions$5 | RegionOptions$6 | RegionOptions$7;
30
33
 
31
34
  /**
32
35
  * Options forwarded to the client initialized via the `init` method.
@@ -45,12 +48,13 @@ type InitClientOptions = Partial<{
45
48
 
46
49
  type Algoliasearch = SearchClient & {
47
50
  initAbtesting: (initOptions: InitClientOptions & RegionOptions$1) => AbtestingClient;
48
- initAnalytics: (initOptions: InitClientOptions & RegionOptions$2) => AnalyticsClient;
49
- initIngestion: (initOptions: InitClientOptions & RegionOptions$3) => IngestionClient;
50
- initInsights: (initOptions: InitClientOptions & RegionOptions$4) => InsightsClient;
51
+ initAbtestingV3: (initOptions: InitClientOptions & RegionOptions$2) => AbtestingV3Client;
52
+ initAnalytics: (initOptions: InitClientOptions & RegionOptions$3) => AnalyticsClient;
53
+ initIngestion: (initOptions: InitClientOptions & RegionOptions$4) => IngestionClient;
54
+ initInsights: (initOptions: InitClientOptions & RegionOptions$5) => InsightsClient;
51
55
  initMonitoring: (initOptions?: InitClientOptions) => MonitoringClient;
52
- initPersonalization: (initOptions: InitClientOptions & RegionOptions$5) => PersonalizationClient;
53
- initQuerySuggestions: (initOptions: InitClientOptions & RegionOptions$6) => QuerySuggestionsClient;
56
+ initPersonalization: (initOptions: InitClientOptions & RegionOptions$6) => PersonalizationClient;
57
+ initQuerySuggestions: (initOptions: InitClientOptions & RegionOptions$7) => QuerySuggestionsClient;
54
58
  initRecommend: (initOptions?: InitClientOptions) => RecommendClient;
55
59
  /**
56
60
  * Helper: Similar to the `saveObjects` method but requires a Push connector (https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/connectors/push/) to be created first, in order to transform records before indexing them to Algolia. The `region` must have been passed to the client instantiation method.
@@ -92,7 +96,7 @@ type Algoliasearch = SearchClient & {
92
96
  };
93
97
  type TransformationOptions = {
94
98
  transformation?: {
95
- region: Region$3;
99
+ region: Region$4;
96
100
  } | undefined;
97
101
  };
98
102
  declare function algoliasearch(appId: string, apiKey: string, options?: (ClientOptions & TransformationOptions) | undefined): Algoliasearch;
package/dist/node.js CHANGED
@@ -22,6 +22,7 @@ __export(node_exports, {
22
22
  algoliasearch: () => algoliasearch,
23
23
  apiClientVersion: () => apiClientVersion
24
24
  });
25
+ import { abtestingV3Client } from "@algolia/abtesting";
25
26
  import { abtestingClient } from "@algolia/client-abtesting";
26
27
  import { analyticsClient } from "@algolia/client-analytics";
27
28
  import { insightsClient } from "@algolia/client-insights";
@@ -37,6 +38,7 @@ var models_exports = {};
37
38
  __export(models_exports, {
38
39
  apiClientVersion: () => apiClientVersion
39
40
  });
41
+ __reExport(models_exports, abtesting_star);
40
42
  __reExport(models_exports, client_abtesting_star);
41
43
  __reExport(models_exports, client_analytics_star);
42
44
  __reExport(models_exports, client_insights_star);
@@ -47,6 +49,7 @@ __reExport(models_exports, ingestion_star);
47
49
  __reExport(models_exports, monitoring_star);
48
50
  __reExport(models_exports, recommend_star);
49
51
  import { apiClientVersion } from "@algolia/client-search";
52
+ import * as abtesting_star from "@algolia/abtesting";
50
53
  import * as client_abtesting_star from "@algolia/client-abtesting";
51
54
  import * as client_analytics_star from "@algolia/client-analytics";
52
55
  import * as client_insights_star from "@algolia/client-insights";
@@ -186,6 +189,14 @@ function algoliasearch(appId, apiKey, options) {
186
189
  initOptions.options
187
190
  );
188
191
  },
192
+ initAbtestingV3: (initOptions) => {
193
+ return abtestingV3Client(
194
+ initOptions.appId || appId,
195
+ initOptions.apiKey || apiKey,
196
+ initOptions.region,
197
+ initOptions.options
198
+ );
199
+ },
189
200
  initAnalytics: (initOptions) => {
190
201
  return analyticsClient(
191
202
  initOptions.appId || appId,