algoliasearch 5.3.2 → 5.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/builds/browser.ts +3 -3
- package/builds/fetch.ts +80 -0
- package/builds/node.ts +3 -3
- package/dist/algoliasearch.umd.js +2 -2
- package/dist/browser.d.ts +3 -3
- package/dist/browser.js.map +1 -1
- package/dist/browser.min.js +1 -1
- package/dist/browser.min.js.map +1 -1
- package/dist/fetch.d.ts +47 -0
- package/dist/fetch.js +99 -0
- package/dist/fetch.js.map +1 -0
- package/dist/lite/browser.d.ts +5 -1
- package/dist/lite/builds/browser.js +1 -1
- package/dist/lite/builds/browser.js.map +1 -1
- package/dist/lite/builds/browser.min.js +1 -1
- package/dist/lite/builds/browser.min.js.map +1 -1
- package/dist/lite/builds/browser.umd.js +3 -3
- package/dist/lite/builds/node.cjs +1 -1
- package/dist/lite/builds/node.cjs.map +1 -1
- package/dist/lite/builds/node.js +1 -1
- package/dist/lite/builds/node.js.map +1 -1
- package/dist/lite/node.d.cts +5 -1
- package/dist/lite/node.d.ts +5 -1
- package/dist/lite/src/liteClient.cjs +1 -1
- package/dist/lite/src/liteClient.cjs.map +1 -1
- package/dist/lite/src/liteClient.js +1 -1
- package/dist/lite/src/liteClient.js.map +1 -1
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.cts +3 -3
- package/dist/node.d.ts +3 -3
- package/dist/node.js.map +1 -1
- package/lite/model/baseSearchResponse.ts +5 -0
- package/lite/src/liteClient.ts +1 -1
- package/package.json +20 -15
package/dist/lite/node.d.ts
CHANGED
|
@@ -830,6 +830,10 @@ type BaseSearchResponse = Record<string, any> & {
|
|
|
830
830
|
* Unique identifier for the query. This is used for [click analytics](https://www.algolia.com/doc/guides/analytics/click-analytics/).
|
|
831
831
|
*/
|
|
832
832
|
queryID?: string;
|
|
833
|
+
/**
|
|
834
|
+
* Whether automatic events collection is enabled for the application.
|
|
835
|
+
*/
|
|
836
|
+
_automaticInsights?: boolean;
|
|
833
837
|
};
|
|
834
838
|
|
|
835
839
|
/**
|
|
@@ -1119,7 +1123,7 @@ type SearchResponses<T = Record<string, any>> = {
|
|
|
1119
1123
|
results: Array<SearchResult<T>>;
|
|
1120
1124
|
};
|
|
1121
1125
|
|
|
1122
|
-
declare const apiClientVersion = "5.
|
|
1126
|
+
declare const apiClientVersion = "5.4.1";
|
|
1123
1127
|
declare function createLiteClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
|
|
1124
1128
|
transporter: _algolia_client_common.Transporter;
|
|
1125
1129
|
/**
|
|
@@ -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.
|
|
28
|
+
var apiClientVersion = "5.4.1";
|
|
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 { createAuth, createTransporter, getAlgoliaAgent, shuffle } from '@algolia/client-common';\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\n\nimport type {\n CustomPostProps,\n LegacyGetRecommendationsParams,\n LegacySearchMethodProps,\n} from '../model/clientMethodProps';\nimport type { GetRecommendationsParams } from '../model/getRecommendationsParams';\nimport type { GetRecommendationsResponse } from '../model/getRecommendationsResponse';\nimport type { SearchForFacetValuesResponse } from '../model/searchForFacetValuesResponse';\nimport type { SearchMethodParams } from '../model/searchMethodParams';\nimport type { SearchResponse } from '../model/searchResponse';\nimport type { SearchResponses } from '../model/searchResponses';\n\nexport const apiClientVersion = '5.3.2';\n\nfunction getDefaultHosts(appId: string): Host[] {\n return (\n [\n {\n url: `${appId}-dsn.algolia.net`,\n accept: 'read',\n protocol: 'https',\n },\n {\n url: `${appId}.algolia.net`,\n accept: 'write',\n protocol: 'https',\n },\n ] as Host[]\n ).concat(\n shuffle([\n {\n url: `${appId}-1.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-2.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-3.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n ]),\n );\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function 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 * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * Helper 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 * Helper: calls the `search` method but with certainty that we will only request Algolia records (hits) and not facets.\n * Disclaimer: We don't assert that the parameters you pass to this method only contains `hits` requests to prevent impacting search performances, this helper is purely for typing purposes.\n *\n * @summary Search multiple indices for `hits`.\n * @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForHits<T>(\n searchMethodParams: LegacySearchMethodProps | SearchMethodParams,\n requestOptions?: RequestOptions,\n ): Promise<{ results: Array<SearchResponse<T>> }> {\n return this.search(searchMethodParams, requestOptions) as Promise<{ results: Array<SearchResponse<T>> }>;\n },\n\n /**\n * Helper: calls the `search` method but with certainty that we will only request Algolia facets and not records (hits).\n * Disclaimer: We don't assert that the parameters you pass to this method only contains `facets` requests to prevent impacting search performances, this helper is purely for typing purposes.\n *\n * @summary Search multiple indices for `facets`.\n * @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForFacets(\n searchMethodParams: LegacySearchMethodProps | SearchMethodParams,\n requestOptions?: RequestOptions,\n ): Promise<{ results: SearchForFacetValuesResponse[] }> {\n return this.search(searchMethodParams, requestOptions) as Promise<{\n results: SearchForFacetValuesResponse[];\n }>;\n },\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves recommendations from selected AI models.\n *\n * Required API Key ACLs:\n * - search.\n *\n * @param getRecommendationsParams - The getRecommendationsParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRecommendations(\n getRecommendationsParams: GetRecommendationsParams | LegacyGetRecommendationsParams,\n requestOptions?: RequestOptions,\n ): Promise<GetRecommendationsResponse> {\n if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {\n const newSignatureRequest: GetRecommendationsParams = {\n requests: getRecommendationsParams,\n };\n\n // eslint-disable-next-line no-param-reassign\n getRecommendationsParams = newSignatureRequest;\n }\n\n if (!getRecommendationsParams) {\n throw new Error('Parameter `getRecommendationsParams` is required when calling `getRecommendations`.');\n }\n\n if (!getRecommendationsParams.requests) {\n throw new Error('Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.');\n }\n\n const requestPath = '/1/indexes/*/recommendations';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: getRecommendationsParams,\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Sends multiple search request to one or more indices. This can be useful in these cases: - Different indices for different purposes, such as, one index for products, another one for marketing content. - Multiple searches to the same index—for example, with different filters.\n *\n * Required API Key ACLs:\n * - search.\n *\n * @param searchMethodParams - Muli-search request body. Results are returned in the same order as the requests.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n search<T>(\n searchMethodParams: LegacySearchMethodProps | SearchMethodParams,\n requestOptions?: RequestOptions,\n ): Promise<SearchResponses<T>> {\n if (searchMethodParams && Array.isArray(searchMethodParams)) {\n const newSignatureRequest: SearchMethodParams = {\n requests: searchMethodParams.map(({ params, ...legacyRequest }) => {\n if (legacyRequest.type === 'facet') {\n return {\n ...legacyRequest,\n ...params,\n type: 'facet',\n };\n }\n\n return {\n ...legacyRequest,\n ...params,\n facet: undefined,\n maxFacetHits: undefined,\n facetQuery: undefined,\n };\n }),\n };\n\n // eslint-disable-next-line no-param-reassign\n searchMethodParams = newSignatureRequest;\n }\n\n if (!searchMethodParams) {\n throw new Error('Parameter `searchMethodParams` is required when calling `search`.');\n }\n\n if (!searchMethodParams.requests) {\n throw new Error('Parameter `searchMethodParams.requests` is required when calling `search`.');\n }\n\n const requestPath = '/1/indexes/*/queries';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchMethodParams,\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,2BAAwE;AAsBjE,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;AAA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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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAWA,OACE,oBACA,gBAC6B;AAC7B,UAAI,sBAAsB,MAAM,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;AAGA,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 { createAuth, createTransporter, getAlgoliaAgent, shuffle } from '@algolia/client-common';\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\n\nimport type {\n CustomPostProps,\n LegacyGetRecommendationsParams,\n LegacySearchMethodProps,\n} from '../model/clientMethodProps';\nimport type { GetRecommendationsParams } from '../model/getRecommendationsParams';\nimport type { GetRecommendationsResponse } from '../model/getRecommendationsResponse';\nimport type { SearchForFacetValuesResponse } from '../model/searchForFacetValuesResponse';\nimport type { SearchMethodParams } from '../model/searchMethodParams';\nimport type { SearchResponse } from '../model/searchResponse';\nimport type { SearchResponses } from '../model/searchResponses';\n\nexport const apiClientVersion = '5.4.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\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\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 * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * Helper 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 * Helper: calls the `search` method but with certainty that we will only request Algolia records (hits) and not facets.\n * Disclaimer: We don't assert that the parameters you pass to this method only contains `hits` requests to prevent impacting search performances, this helper is purely for typing purposes.\n *\n * @summary Search multiple indices for `hits`.\n * @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForHits<T>(\n searchMethodParams: LegacySearchMethodProps | SearchMethodParams,\n requestOptions?: RequestOptions,\n ): Promise<{ results: Array<SearchResponse<T>> }> {\n return this.search(searchMethodParams, requestOptions) as Promise<{ results: Array<SearchResponse<T>> }>;\n },\n\n /**\n * Helper: calls the `search` method but with certainty that we will only request Algolia facets and not records (hits).\n * Disclaimer: We don't assert that the parameters you pass to this method only contains `facets` requests to prevent impacting search performances, this helper is purely for typing purposes.\n *\n * @summary Search multiple indices for `facets`.\n * @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForFacets(\n searchMethodParams: LegacySearchMethodProps | SearchMethodParams,\n requestOptions?: RequestOptions,\n ): Promise<{ results: SearchForFacetValuesResponse[] }> {\n return this.search(searchMethodParams, requestOptions) as Promise<{\n results: SearchForFacetValuesResponse[];\n }>;\n },\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves recommendations from selected AI models.\n *\n * Required API Key ACLs:\n * - search.\n *\n * @param getRecommendationsParams - The getRecommendationsParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRecommendations(\n getRecommendationsParams: GetRecommendationsParams | LegacyGetRecommendationsParams,\n requestOptions?: RequestOptions,\n ): Promise<GetRecommendationsResponse> {\n if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {\n const newSignatureRequest: GetRecommendationsParams = {\n requests: getRecommendationsParams,\n };\n\n // eslint-disable-next-line no-param-reassign\n getRecommendationsParams = newSignatureRequest;\n }\n\n if (!getRecommendationsParams) {\n throw new Error('Parameter `getRecommendationsParams` is required when calling `getRecommendations`.');\n }\n\n if (!getRecommendationsParams.requests) {\n throw new Error('Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.');\n }\n\n const requestPath = '/1/indexes/*/recommendations';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: getRecommendationsParams,\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Sends multiple search request to one or more indices. This can be useful in these cases: - Different indices for different purposes, such as, one index for products, another one for marketing content. - Multiple searches to the same index—for example, with different filters.\n *\n * Required API Key ACLs:\n * - search.\n *\n * @param searchMethodParams - Muli-search request body. Results are returned in the same order as the requests.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n search<T>(\n searchMethodParams: LegacySearchMethodProps | SearchMethodParams,\n requestOptions?: RequestOptions,\n ): Promise<SearchResponses<T>> {\n if (searchMethodParams && Array.isArray(searchMethodParams)) {\n const newSignatureRequest: SearchMethodParams = {\n requests: searchMethodParams.map(({ params, ...legacyRequest }) => {\n if (legacyRequest.type === 'facet') {\n return {\n ...legacyRequest,\n ...params,\n type: 'facet',\n };\n }\n\n return {\n ...legacyRequest,\n ...params,\n facet: undefined,\n maxFacetHits: undefined,\n facetQuery: undefined,\n };\n }),\n };\n\n // eslint-disable-next-line no-param-reassign\n searchMethodParams = newSignatureRequest;\n }\n\n if (!searchMethodParams) {\n throw new Error('Parameter `searchMethodParams` is required when calling `search`.');\n }\n\n if (!searchMethodParams.requests) {\n throw new Error('Parameter `searchMethodParams.requests` is required when calling `search`.');\n }\n\n const requestPath = '/1/indexes/*/queries';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchMethodParams,\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA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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 +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 { createAuth, createTransporter, getAlgoliaAgent, shuffle } from '@algolia/client-common';\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\n\nimport type {\n CustomPostProps,\n LegacyGetRecommendationsParams,\n LegacySearchMethodProps,\n} from '../model/clientMethodProps';\nimport type { GetRecommendationsParams } from '../model/getRecommendationsParams';\nimport type { GetRecommendationsResponse } from '../model/getRecommendationsResponse';\nimport type { SearchForFacetValuesResponse } from '../model/searchForFacetValuesResponse';\nimport type { SearchMethodParams } from '../model/searchMethodParams';\nimport type { SearchResponse } from '../model/searchResponse';\nimport type { SearchResponses } from '../model/searchResponses';\n\nexport const apiClientVersion = '5.3.2';\n\nfunction getDefaultHosts(appId: string): Host[] {\n return (\n [\n {\n url: `${appId}-dsn.algolia.net`,\n accept: 'read',\n protocol: 'https',\n },\n {\n url: `${appId}.algolia.net`,\n accept: 'write',\n protocol: 'https',\n },\n ] as Host[]\n ).concat(\n shuffle([\n {\n url: `${appId}-1.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-2.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-3.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n ]),\n );\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function 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 * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * Helper 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 * Helper: calls the `search` method but with certainty that we will only request Algolia records (hits) and not facets.\n * Disclaimer: We don't assert that the parameters you pass to this method only contains `hits` requests to prevent impacting search performances, this helper is purely for typing purposes.\n *\n * @summary Search multiple indices for `hits`.\n * @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForHits<T>(\n searchMethodParams: LegacySearchMethodProps | SearchMethodParams,\n requestOptions?: RequestOptions,\n ): Promise<{ results: Array<SearchResponse<T>> }> {\n return this.search(searchMethodParams, requestOptions) as Promise<{ results: Array<SearchResponse<T>> }>;\n },\n\n /**\n * Helper: calls the `search` method but with certainty that we will only request Algolia facets and not records (hits).\n * Disclaimer: We don't assert that the parameters you pass to this method only contains `facets` requests to prevent impacting search performances, this helper is purely for typing purposes.\n *\n * @summary Search multiple indices for `facets`.\n * @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForFacets(\n searchMethodParams: LegacySearchMethodProps | SearchMethodParams,\n requestOptions?: RequestOptions,\n ): Promise<{ results: SearchForFacetValuesResponse[] }> {\n return this.search(searchMethodParams, requestOptions) as Promise<{\n results: SearchForFacetValuesResponse[];\n }>;\n },\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves recommendations from selected AI models.\n *\n * Required API Key ACLs:\n * - search.\n *\n * @param getRecommendationsParams - The getRecommendationsParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRecommendations(\n getRecommendationsParams: GetRecommendationsParams | LegacyGetRecommendationsParams,\n requestOptions?: RequestOptions,\n ): Promise<GetRecommendationsResponse> {\n if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {\n const newSignatureRequest: GetRecommendationsParams = {\n requests: getRecommendationsParams,\n };\n\n // eslint-disable-next-line no-param-reassign\n getRecommendationsParams = newSignatureRequest;\n }\n\n if (!getRecommendationsParams) {\n throw new Error('Parameter `getRecommendationsParams` is required when calling `getRecommendations`.');\n }\n\n if (!getRecommendationsParams.requests) {\n throw new Error('Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.');\n }\n\n const requestPath = '/1/indexes/*/recommendations';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: getRecommendationsParams,\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Sends multiple search request to one or more indices. This can be useful in these cases: - Different indices for different purposes, such as, one index for products, another one for marketing content. - Multiple searches to the same index—for example, with different filters.\n *\n * Required API Key ACLs:\n * - search.\n *\n * @param searchMethodParams - Muli-search request body. Results are returned in the same order as the requests.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n search<T>(\n searchMethodParams: LegacySearchMethodProps | SearchMethodParams,\n requestOptions?: RequestOptions,\n ): Promise<SearchResponses<T>> {\n if (searchMethodParams && Array.isArray(searchMethodParams)) {\n const newSignatureRequest: SearchMethodParams = {\n requests: searchMethodParams.map(({ params, ...legacyRequest }) => {\n if (legacyRequest.type === 'facet') {\n return {\n ...legacyRequest,\n ...params,\n type: 'facet',\n };\n }\n\n return {\n ...legacyRequest,\n ...params,\n facet: undefined,\n maxFacetHits: undefined,\n facetQuery: undefined,\n };\n }),\n };\n\n // eslint-disable-next-line no-param-reassign\n searchMethodParams = newSignatureRequest;\n }\n\n if (!searchMethodParams) {\n throw new Error('Parameter `searchMethodParams` is required when calling `search`.');\n }\n\n if (!searchMethodParams.requests) {\n throw new Error('Parameter `searchMethodParams.requests` is required when calling `search`.');\n }\n\n const requestPath = '/1/indexes/*/queries';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchMethodParams,\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";AAEA,SAAS,YAAY,mBAAmB,iBAAiB,eAAe;AAsBjE,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;AAGO,SAAS,iBAAiB;AAAA,EAC/B,OAAO;AAAA,EACP,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAwB;AACtB,QAAM,OAAO,WAAW,aAAa,cAAc,QA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AAC7B,UAAI,sBAAsB,MAAM,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;AAGA,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 { createAuth, createTransporter, getAlgoliaAgent, shuffle } from '@algolia/client-common';\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\n\nimport type {\n CustomPostProps,\n LegacyGetRecommendationsParams,\n LegacySearchMethodProps,\n} from '../model/clientMethodProps';\nimport type { GetRecommendationsParams } from '../model/getRecommendationsParams';\nimport type { GetRecommendationsResponse } from '../model/getRecommendationsResponse';\nimport type { SearchForFacetValuesResponse } from '../model/searchForFacetValuesResponse';\nimport type { SearchMethodParams } from '../model/searchMethodParams';\nimport type { SearchResponse } from '../model/searchResponse';\nimport type { SearchResponses } from '../model/searchResponses';\n\nexport const apiClientVersion = '5.4.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\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\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 * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * Helper 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 * Helper: calls the `search` method but with certainty that we will only request Algolia records (hits) and not facets.\n * Disclaimer: We don't assert that the parameters you pass to this method only contains `hits` requests to prevent impacting search performances, this helper is purely for typing purposes.\n *\n * @summary Search multiple indices for `hits`.\n * @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForHits<T>(\n searchMethodParams: LegacySearchMethodProps | SearchMethodParams,\n requestOptions?: RequestOptions,\n ): Promise<{ results: Array<SearchResponse<T>> }> {\n return this.search(searchMethodParams, requestOptions) as Promise<{ results: Array<SearchResponse<T>> }>;\n },\n\n /**\n * Helper: calls the `search` method but with certainty that we will only request Algolia facets and not records (hits).\n * Disclaimer: We don't assert that the parameters you pass to this method only contains `facets` requests to prevent impacting search performances, this helper is purely for typing purposes.\n *\n * @summary Search multiple indices for `facets`.\n * @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForFacets(\n searchMethodParams: LegacySearchMethodProps | SearchMethodParams,\n requestOptions?: RequestOptions,\n ): Promise<{ results: SearchForFacetValuesResponse[] }> {\n return this.search(searchMethodParams, requestOptions) as Promise<{\n results: SearchForFacetValuesResponse[];\n }>;\n },\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves recommendations from selected AI models.\n *\n * Required API Key ACLs:\n * - search.\n *\n * @param getRecommendationsParams - The getRecommendationsParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRecommendations(\n getRecommendationsParams: GetRecommendationsParams | LegacyGetRecommendationsParams,\n requestOptions?: RequestOptions,\n ): Promise<GetRecommendationsResponse> {\n if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {\n const newSignatureRequest: GetRecommendationsParams = {\n requests: getRecommendationsParams,\n };\n\n // eslint-disable-next-line no-param-reassign\n getRecommendationsParams = newSignatureRequest;\n }\n\n if (!getRecommendationsParams) {\n throw new Error('Parameter `getRecommendationsParams` is required when calling `getRecommendations`.');\n }\n\n if (!getRecommendationsParams.requests) {\n throw new Error('Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.');\n }\n\n const requestPath = '/1/indexes/*/recommendations';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: getRecommendationsParams,\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Sends multiple search request to one or more indices. This can be useful in these cases: - Different indices for different purposes, such as, one index for products, another one for marketing content. - Multiple searches to the same index—for example, with different filters.\n *\n * Required API Key ACLs:\n * - search.\n *\n * @param searchMethodParams - Muli-search request body. Results are returned in the same order as the requests.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n search<T>(\n searchMethodParams: LegacySearchMethodProps | SearchMethodParams,\n requestOptions?: RequestOptions,\n ): Promise<SearchResponses<T>> {\n if (searchMethodParams && Array.isArray(searchMethodParams)) {\n const newSignatureRequest: SearchMethodParams = {\n requests: searchMethodParams.map(({ params, ...legacyRequest }) => {\n if (legacyRequest.type === 'facet') {\n return {\n ...legacyRequest,\n ...params,\n type: 'facet',\n };\n }\n\n return {\n ...legacyRequest,\n ...params,\n facet: undefined,\n maxFacetHits: undefined,\n facetQuery: undefined,\n };\n }),\n };\n\n // eslint-disable-next-line no-param-reassign\n searchMethodParams = newSignatureRequest;\n }\n\n if (!searchMethodParams) {\n throw new Error('Parameter `searchMethodParams` is required when calling `search`.');\n }\n\n if (!searchMethodParams.requests) {\n throw new Error('Parameter `searchMethodParams.requests` is required when calling `search`.');\n }\n\n const requestPath = '/1/indexes/*/queries';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchMethodParams,\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";AAEA,SAAS,YAAY,mBAAmB,iBAAiB,eAAe;AAsBjE,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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ACb;AAEA,aAAO,YAAY,QAAQ,SAAS,cAAc;AAAA,IACpD;AAAA,EACF;AACF;","names":[]}
|
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 { AbtestingClient, Region as AbtestingRegion } from '@algolia/client-abtesting';\nimport { abtestingClient } from '@algolia/client-abtesting';\nimport type { AnalyticsClient, Region as AnalyticsRegion } from '@algolia/client-analytics';\nimport { analyticsClient } from '@algolia/client-analytics';\nimport type { ClientOptions } from '@algolia/client-common';\nimport type { PersonalizationClient, Region as PersonalizationRegion } from '@algolia/client-personalization';\nimport { personalizationClient } from '@algolia/client-personalization';\nimport type { SearchClient } from '@algolia/client-search';\nimport { searchClient } from '@algolia/client-search';\nimport type { RecommendClient } from '@algolia/recommend';\nimport { recommendClient } from '@algolia/recommend';\n\nimport type { InitClientOptions, InitClientRegion } from './models';\n\nexport * from './models';\n\nexport type Algoliasearch = SearchClient & {\n initRecommend: (initOptions
|
|
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 { AbtestingClient, Region as AbtestingRegion } from '@algolia/client-abtesting';\nimport { abtestingClient } from '@algolia/client-abtesting';\nimport type { AnalyticsClient, Region as AnalyticsRegion } from '@algolia/client-analytics';\nimport { analyticsClient } from '@algolia/client-analytics';\nimport type { ClientOptions } from '@algolia/client-common';\nimport type { PersonalizationClient, Region as PersonalizationRegion } from '@algolia/client-personalization';\nimport { personalizationClient } from '@algolia/client-personalization';\nimport type { SearchClient } from '@algolia/client-search';\nimport { searchClient } from '@algolia/client-search';\nimport type { RecommendClient } from '@algolia/recommend';\nimport { recommendClient } from '@algolia/recommend';\n\nimport type { InitClientOptions, InitClientRegion } from './models';\n\nexport * from './models';\n\nexport type Algoliasearch = SearchClient & {\n initRecommend: (initOptions?: InitClientOptions) => RecommendClient;\n initAnalytics: (initOptions?: InitClientOptions & InitClientRegion<AnalyticsRegion>) => AnalyticsClient;\n initAbtesting: (initOptions?: InitClientOptions & InitClientRegion<AbtestingRegion>) => AbtestingClient;\n initPersonalization: (\n initOptions: InitClientOptions & Required<InitClientRegion<PersonalizationRegion>>,\n ) => PersonalizationClient;\n};\n\nexport function algoliasearch(appId: string, apiKey: string, options?: ClientOptions): 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 return {\n ...client,\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 initRecommend: (initOptions: InitClientOptions = {}): RecommendClient => {\n return recommendClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);\n },\n\n initAnalytics: (initOptions: InitClientOptions & InitClientRegion<AnalyticsRegion> = {}): AnalyticsClient => {\n return analyticsClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n },\n\n initAbtesting: (initOptions: InitClientOptions & InitClientRegion<AbtestingRegion> = {}): AbtestingClient => {\n return abtestingClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n },\n\n initPersonalization: (\n initOptions: InitClientOptions & Required<InitClientRegion<PersonalizationRegion>>,\n ): PersonalizationClient => {\n return personalizationClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n },\n };\n}\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 } from '@algolia/client-abtesting';\nimport type { Region as AnalyticsRegion } from '@algolia/client-analytics';\nimport type { ClientOptions } from '@algolia/client-common';\nimport type {\n AdvancedSyntaxFeatures,\n AlternativesAsExact,\n Anchoring,\n AroundPrecision,\n AroundRadius,\n AroundRadiusAll,\n AutomaticFacetFilter,\n AutomaticFacetFilters,\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 DeletedAtResponse,\n Distinct,\n Edit,\n EditType,\n ErrorBase,\n ExactOnSingleWordQuery,\n Exhaustive,\n FacetFilters,\n FacetOrdering,\n Facets,\n FacetStats,\n HighlightResult,\n HighlightResultOption,\n IgnorePlurals,\n IndexSettingsAsSearchParams,\n MatchLevel,\n MatchedGeoLocation,\n Mode,\n NumericFilters,\n OptionalFilters,\n Params,\n Personalization,\n Promote,\n PromoteObjectID,\n PromoteObjectIDs,\n QueryType,\n Range,\n RankingInfo,\n ReRankingApplyFilter,\n Redirect,\n RedirectRuleIndexMetadata,\n RedirectRuleIndexData,\n RedirectURL,\n RemoveStopWords,\n RemoveWordsIfNoResults,\n RenderingContent,\n SearchPagination,\n SearchParams,\n SearchParamsObject,\n SearchParamsQuery,\n SemanticSearch,\n SnippetResult,\n SnippetResultOption,\n SortRemainingBy,\n SupportedLanguage,\n TagFilters,\n TaskStatus,\n TypoTolerance,\n TypoToleranceEnum,\n Value,\n} from '@algolia/client-search';\nimport { apiClientVersion } from '@algolia/client-search';\n\ntype Region = AbTestingRegion | AnalyticsRegion;\n\nexport * from '@algolia/client-search';\nexport * from '@algolia/recommend';\nexport * from '@algolia/client-personalization';\nexport * from '@algolia/client-analytics';\nexport * from '@algolia/client-abtesting';\n\nexport {\n AdvancedSyntaxFeatures,\n AlternativesAsExact,\n Anchoring,\n AroundPrecision,\n AroundRadius,\n AroundRadiusAll,\n AutomaticFacetFilter,\n AutomaticFacetFilters,\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 DeletedAtResponse,\n Distinct,\n Edit,\n EditType,\n ErrorBase,\n ExactOnSingleWordQuery,\n Exhaustive,\n FacetFilters,\n FacetOrdering,\n Facets,\n FacetStats,\n HighlightResult,\n HighlightResultOption,\n IgnorePlurals,\n IndexSettingsAsSearchParams,\n MatchLevel,\n MatchedGeoLocation,\n Mode,\n NumericFilters,\n OptionalFilters,\n Params,\n Personalization,\n Promote,\n PromoteObjectID,\n PromoteObjectIDs,\n QueryType,\n Range,\n RankingInfo,\n ReRankingApplyFilter,\n Redirect,\n RedirectRuleIndexMetadata,\n RedirectRuleIndexData,\n RedirectURL,\n RemoveStopWords,\n RemoveWordsIfNoResults,\n RenderingContent,\n SearchParams,\n SearchParamsObject,\n SearchParamsQuery,\n SemanticSearch,\n SearchPagination,\n SnippetResult,\n SnippetResultOption,\n SortRemainingBy,\n SupportedLanguage,\n TagFilters,\n TaskStatus,\n TypoTolerance,\n TypoToleranceEnum,\n Value,\n AnalyticsRegion,\n AbTestingRegion,\n Region,\n apiClientVersion,\n};\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\nexport type InitClientRegion<TRegion> = Partial<{\n /**\n * Available regions of the initialized client.\n */\n region: TRegion;\n}>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;A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","names":["import_client_search"]}
|
package/dist/node.d.cts
CHANGED
|
@@ -37,9 +37,9 @@ type InitClientRegion<TRegion> = Partial<{
|
|
|
37
37
|
}>;
|
|
38
38
|
|
|
39
39
|
type Algoliasearch = SearchClient & {
|
|
40
|
-
initRecommend: (initOptions
|
|
41
|
-
initAnalytics: (initOptions
|
|
42
|
-
initAbtesting: (initOptions
|
|
40
|
+
initRecommend: (initOptions?: InitClientOptions) => RecommendClient;
|
|
41
|
+
initAnalytics: (initOptions?: InitClientOptions & InitClientRegion<Region$2>) => AnalyticsClient;
|
|
42
|
+
initAbtesting: (initOptions?: InitClientOptions & InitClientRegion<Region$1>) => AbtestingClient;
|
|
43
43
|
initPersonalization: (initOptions: InitClientOptions & Required<InitClientRegion<Region$3>>) => PersonalizationClient;
|
|
44
44
|
};
|
|
45
45
|
declare function algoliasearch(appId: string, apiKey: string, options?: ClientOptions): Algoliasearch;
|
package/dist/node.d.ts
CHANGED
|
@@ -37,9 +37,9 @@ type InitClientRegion<TRegion> = Partial<{
|
|
|
37
37
|
}>;
|
|
38
38
|
|
|
39
39
|
type Algoliasearch = SearchClient & {
|
|
40
|
-
initRecommend: (initOptions
|
|
41
|
-
initAnalytics: (initOptions
|
|
42
|
-
initAbtesting: (initOptions
|
|
40
|
+
initRecommend: (initOptions?: InitClientOptions) => RecommendClient;
|
|
41
|
+
initAnalytics: (initOptions?: InitClientOptions & InitClientRegion<Region$2>) => AnalyticsClient;
|
|
42
|
+
initAbtesting: (initOptions?: InitClientOptions & InitClientRegion<Region$1>) => AbtestingClient;
|
|
43
43
|
initPersonalization: (initOptions: InitClientOptions & Required<InitClientRegion<Region$3>>) => PersonalizationClient;
|
|
44
44
|
};
|
|
45
45
|
declare function algoliasearch(appId: string, apiKey: string, options?: ClientOptions): Algoliasearch;
|
package/dist/node.js.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 { AbtestingClient, Region as AbtestingRegion } from '@algolia/client-abtesting';\nimport { abtestingClient } from '@algolia/client-abtesting';\nimport type { AnalyticsClient, Region as AnalyticsRegion } from '@algolia/client-analytics';\nimport { analyticsClient } from '@algolia/client-analytics';\nimport type { ClientOptions } from '@algolia/client-common';\nimport type { PersonalizationClient, Region as PersonalizationRegion } from '@algolia/client-personalization';\nimport { personalizationClient } from '@algolia/client-personalization';\nimport type { SearchClient } from '@algolia/client-search';\nimport { searchClient } from '@algolia/client-search';\nimport type { RecommendClient } from '@algolia/recommend';\nimport { recommendClient } from '@algolia/recommend';\n\nimport type { InitClientOptions, InitClientRegion } from './models';\n\nexport * from './models';\n\nexport type Algoliasearch = SearchClient & {\n initRecommend: (initOptions
|
|
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 { AbtestingClient, Region as AbtestingRegion } from '@algolia/client-abtesting';\nimport { abtestingClient } from '@algolia/client-abtesting';\nimport type { AnalyticsClient, Region as AnalyticsRegion } from '@algolia/client-analytics';\nimport { analyticsClient } from '@algolia/client-analytics';\nimport type { ClientOptions } from '@algolia/client-common';\nimport type { PersonalizationClient, Region as PersonalizationRegion } from '@algolia/client-personalization';\nimport { personalizationClient } from '@algolia/client-personalization';\nimport type { SearchClient } from '@algolia/client-search';\nimport { searchClient } from '@algolia/client-search';\nimport type { RecommendClient } from '@algolia/recommend';\nimport { recommendClient } from '@algolia/recommend';\n\nimport type { InitClientOptions, InitClientRegion } from './models';\n\nexport * from './models';\n\nexport type Algoliasearch = SearchClient & {\n initRecommend: (initOptions?: InitClientOptions) => RecommendClient;\n initAnalytics: (initOptions?: InitClientOptions & InitClientRegion<AnalyticsRegion>) => AnalyticsClient;\n initAbtesting: (initOptions?: InitClientOptions & InitClientRegion<AbtestingRegion>) => AbtestingClient;\n initPersonalization: (\n initOptions: InitClientOptions & Required<InitClientRegion<PersonalizationRegion>>,\n ) => PersonalizationClient;\n};\n\nexport function algoliasearch(appId: string, apiKey: string, options?: ClientOptions): 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 return {\n ...client,\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 initRecommend: (initOptions: InitClientOptions = {}): RecommendClient => {\n return recommendClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);\n },\n\n initAnalytics: (initOptions: InitClientOptions & InitClientRegion<AnalyticsRegion> = {}): AnalyticsClient => {\n return analyticsClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n },\n\n initAbtesting: (initOptions: InitClientOptions & InitClientRegion<AbtestingRegion> = {}): AbtestingClient => {\n return abtestingClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n },\n\n initPersonalization: (\n initOptions: InitClientOptions & Required<InitClientRegion<PersonalizationRegion>>,\n ): PersonalizationClient => {\n return personalizationClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n },\n };\n}\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 } from '@algolia/client-abtesting';\nimport type { Region as AnalyticsRegion } from '@algolia/client-analytics';\nimport type { ClientOptions } from '@algolia/client-common';\nimport type {\n AdvancedSyntaxFeatures,\n AlternativesAsExact,\n Anchoring,\n AroundPrecision,\n AroundRadius,\n AroundRadiusAll,\n AutomaticFacetFilter,\n AutomaticFacetFilters,\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 DeletedAtResponse,\n Distinct,\n Edit,\n EditType,\n ErrorBase,\n ExactOnSingleWordQuery,\n Exhaustive,\n FacetFilters,\n FacetOrdering,\n Facets,\n FacetStats,\n HighlightResult,\n HighlightResultOption,\n IgnorePlurals,\n IndexSettingsAsSearchParams,\n MatchLevel,\n MatchedGeoLocation,\n Mode,\n NumericFilters,\n OptionalFilters,\n Params,\n Personalization,\n Promote,\n PromoteObjectID,\n PromoteObjectIDs,\n QueryType,\n Range,\n RankingInfo,\n ReRankingApplyFilter,\n Redirect,\n RedirectRuleIndexMetadata,\n RedirectRuleIndexData,\n RedirectURL,\n RemoveStopWords,\n RemoveWordsIfNoResults,\n RenderingContent,\n SearchPagination,\n SearchParams,\n SearchParamsObject,\n SearchParamsQuery,\n SemanticSearch,\n SnippetResult,\n SnippetResultOption,\n SortRemainingBy,\n SupportedLanguage,\n TagFilters,\n TaskStatus,\n TypoTolerance,\n TypoToleranceEnum,\n Value,\n} from '@algolia/client-search';\nimport { apiClientVersion } from '@algolia/client-search';\n\ntype Region = AbTestingRegion | AnalyticsRegion;\n\nexport * from '@algolia/client-search';\nexport * from '@algolia/recommend';\nexport * from '@algolia/client-personalization';\nexport * from '@algolia/client-analytics';\nexport * from '@algolia/client-abtesting';\n\nexport {\n AdvancedSyntaxFeatures,\n AlternativesAsExact,\n Anchoring,\n AroundPrecision,\n AroundRadius,\n AroundRadiusAll,\n AutomaticFacetFilter,\n AutomaticFacetFilters,\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 DeletedAtResponse,\n Distinct,\n Edit,\n EditType,\n ErrorBase,\n ExactOnSingleWordQuery,\n Exhaustive,\n FacetFilters,\n FacetOrdering,\n Facets,\n FacetStats,\n HighlightResult,\n HighlightResultOption,\n IgnorePlurals,\n IndexSettingsAsSearchParams,\n MatchLevel,\n MatchedGeoLocation,\n Mode,\n NumericFilters,\n OptionalFilters,\n Params,\n Personalization,\n Promote,\n PromoteObjectID,\n PromoteObjectIDs,\n QueryType,\n Range,\n RankingInfo,\n ReRankingApplyFilter,\n Redirect,\n RedirectRuleIndexMetadata,\n RedirectRuleIndexData,\n RedirectURL,\n RemoveStopWords,\n RemoveWordsIfNoResults,\n RenderingContent,\n SearchParams,\n SearchParamsObject,\n SearchParamsQuery,\n SemanticSearch,\n SearchPagination,\n SnippetResult,\n SnippetResultOption,\n SortRemainingBy,\n SupportedLanguage,\n TagFilters,\n TaskStatus,\n TypoTolerance,\n TypoToleranceEnum,\n Value,\n AnalyticsRegion,\n AbTestingRegion,\n Region,\n apiClientVersion,\n};\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\nexport type InitClientRegion<TRegion> = Partial<{\n /**\n * Available regions of the initialized client.\n */\n region: TRegion;\n}>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,SAAS,uBAAuB;AAEhC,SAAS,uBAAuB;AAGhC,SAAS,6BAA6B;AAEtC,SAAS,oBAAoB;AAE7B,SAAS,uBAAuB;;;ACZhC;AAAA;AAAA;AAAA;AAmFA;AACA;AACA;AACA;AACA;AARA,SAAS,wBAAwB;AAIjC,oCAAc;AACd,gCAAc;AACd,6CAAc;AACd,uCAAc;AACd,uCAAc;;;ADvEd,yBAAc;AAWP,SAAS,cAAc,OAAe,QAAgB,SAAwC;AACnG,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,SAAS,aAAa,OAAO,QAAQ,OAAO;AAElD,SAAO;AAAA,IACL,GAAG;AAAA;AAAA;AAAA;AAAA,IAIH,IAAI,MAAc;AAChB,aAAO,OAAO,YAAY,aAAa;AAAA,IACzC;AAAA,IACA,eAAe,CAAC,cAAiC,CAAC,MAAuB;AACvE,aAAO,gBAAgB,YAAY,SAAS,OAAO,YAAY,UAAU,QAAQ,YAAY,OAAO;AAAA,IACtG;AAAA,IAEA,eAAe,CAAC,cAAqE,CAAC,MAAuB;AAC3G,aAAO;AAAA,QACL,YAAY,SAAS;AAAA,QACrB,YAAY,UAAU;AAAA,QACtB,YAAY;AAAA,QACZ,YAAY;AAAA,MACd;AAAA,IACF;AAAA,IAEA,eAAe,CAAC,cAAqE,CAAC,MAAuB;AAC3G,aAAO;AAAA,QACL,YAAY,SAAS;AAAA,QACrB,YAAY,UAAU;AAAA,QACtB,YAAY;AAAA,QACZ,YAAY;AAAA,MACd;AAAA,IACF;AAAA,IAEA,qBAAqB,CACnB,gBAC0B;AAC1B,aAAO;AAAA,QACL,YAAY,SAAS;AAAA,QACrB,YAAY,UAAU;AAAA,QACtB,YAAY;AAAA,QACZ,YAAY;AAAA,MACd;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
|
@@ -116,4 +116,9 @@ export type BaseSearchResponse = Record<string, any> & {
|
|
|
116
116
|
* Unique identifier for the query. This is used for [click analytics](https://www.algolia.com/doc/guides/analytics/click-analytics/).
|
|
117
117
|
*/
|
|
118
118
|
queryID?: string;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Whether automatic events collection is enabled for the application.
|
|
122
|
+
*/
|
|
123
|
+
_automaticInsights?: boolean;
|
|
119
124
|
};
|
package/lite/src/liteClient.ts
CHANGED
|
@@ -22,7 +22,7 @@ import type { SearchMethodParams } from '../model/searchMethodParams';
|
|
|
22
22
|
import type { SearchResponse } from '../model/searchResponse';
|
|
23
23
|
import type { SearchResponses } from '../model/searchResponses';
|
|
24
24
|
|
|
25
|
-
export const apiClientVersion = '5.
|
|
25
|
+
export const apiClientVersion = '5.4.1';
|
|
26
26
|
|
|
27
27
|
function getDefaultHosts(appId: string): Host[] {
|
|
28
28
|
return (
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "5.
|
|
2
|
+
"version": "5.4.1",
|
|
3
3
|
"repository": {
|
|
4
4
|
"type": "git",
|
|
5
5
|
"url": "git+https://github.com/algolia/algoliasearch-client-javascript.git"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "yarn clean && yarn tsup && yarn rollup -c rollup.config.js",
|
|
12
12
|
"clean": "rm -rf ./dist || true",
|
|
13
|
-
"test": "
|
|
13
|
+
"test": "vitest --run",
|
|
14
14
|
"test:bundle": "publint . && attw --pack ."
|
|
15
15
|
},
|
|
16
16
|
"name": "algoliasearch",
|
|
@@ -27,6 +27,10 @@
|
|
|
27
27
|
"module": "./dist/node.js",
|
|
28
28
|
"require": "./dist/node.cjs"
|
|
29
29
|
},
|
|
30
|
+
"worker": {
|
|
31
|
+
"types": "./dist/fetch.d.ts",
|
|
32
|
+
"default": "./dist/fetch.js"
|
|
33
|
+
},
|
|
30
34
|
"default": {
|
|
31
35
|
"types": "./dist/browser.d.ts",
|
|
32
36
|
"module": "./dist/browser.js",
|
|
@@ -65,26 +69,27 @@
|
|
|
65
69
|
"lite.d.ts"
|
|
66
70
|
],
|
|
67
71
|
"dependencies": {
|
|
68
|
-
"@algolia/client-abtesting": "5.
|
|
69
|
-
"@algolia/client-analytics": "5.
|
|
70
|
-
"@algolia/client-common": "5.
|
|
71
|
-
"@algolia/client-personalization": "5.
|
|
72
|
-
"@algolia/client-search": "5.
|
|
73
|
-
"@algolia/recommend": "5.
|
|
74
|
-
"@algolia/requester-browser-xhr": "5.
|
|
75
|
-
"@algolia/requester-
|
|
72
|
+
"@algolia/client-abtesting": "5.4.1",
|
|
73
|
+
"@algolia/client-analytics": "5.4.1",
|
|
74
|
+
"@algolia/client-common": "5.4.1",
|
|
75
|
+
"@algolia/client-personalization": "5.4.1",
|
|
76
|
+
"@algolia/client-search": "5.4.1",
|
|
77
|
+
"@algolia/recommend": "5.4.1",
|
|
78
|
+
"@algolia/requester-browser-xhr": "5.4.1",
|
|
79
|
+
"@algolia/requester-fetch": "5.4.1",
|
|
80
|
+
"@algolia/requester-node-http": "5.4.1"
|
|
76
81
|
},
|
|
77
82
|
"devDependencies": {
|
|
83
|
+
"@algolia/requester-testing": "5.4.1",
|
|
78
84
|
"@arethetypeswrong/cli": "0.15.4",
|
|
79
|
-
"@babel/preset-env": "7.25.4",
|
|
80
|
-
"@babel/preset-typescript": "7.24.7",
|
|
81
|
-
"@types/jest": "29.5.12",
|
|
82
85
|
"@types/node": "22.5.1",
|
|
83
|
-
"
|
|
86
|
+
"jsdom": "25.0.0",
|
|
84
87
|
"publint": "0.2.10",
|
|
85
88
|
"rollup": "4.21.2",
|
|
86
89
|
"tsup": "8.2.4",
|
|
87
|
-
"typescript": "5.5.4"
|
|
90
|
+
"typescript": "5.5.4",
|
|
91
|
+
"vitest": "2.0.5",
|
|
92
|
+
"vitest-environment-miniflare": "2.14.3"
|
|
88
93
|
},
|
|
89
94
|
"engines": {
|
|
90
95
|
"node": ">= 14.0.0"
|