devstar插件
This commit is contained in:
24
node_modules/algoliasearch/dist/algoliasearch.umd.js
generated
vendored
Normal file
24
node_modules/algoliasearch/dist/algoliasearch.umd.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
100
node_modules/algoliasearch/dist/browser.d.ts
generated
vendored
Normal file
100
node_modules/algoliasearch/dist/browser.d.ts
generated
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
import { ClientOptions, RequestOptions } from '@algolia/client-common';
|
||||
import { Region as Region$1, RegionOptions as RegionOptions$1, AbtestingClient } from '@algolia/client-abtesting';
|
||||
export * from '@algolia/client-abtesting';
|
||||
export { Region as AbtestingRegion, RegionOptions as AbtestingRegionOptions, Status } from '@algolia/client-abtesting';
|
||||
import { Region as Region$2, RegionOptions as RegionOptions$2, AnalyticsClient } from '@algolia/client-analytics';
|
||||
export * from '@algolia/client-analytics';
|
||||
export { Region as AnalyticsRegion, RegionOptions as AnalyticsRegionOptions } from '@algolia/client-analytics';
|
||||
import { Region as Region$4, RegionOptions as RegionOptions$4, InsightsClient } from '@algolia/client-insights';
|
||||
export * from '@algolia/client-insights';
|
||||
export { Region as InsightsRegion, RegionOptions as InsightsRegionOptions } from '@algolia/client-insights';
|
||||
import { Region as Region$5, RegionOptions as RegionOptions$5, PersonalizationClient } from '@algolia/client-personalization';
|
||||
export * from '@algolia/client-personalization';
|
||||
export { EventType, Region as PersonalizationRegion, RegionOptions as PersonalizationRegionOptions } from '@algolia/client-personalization';
|
||||
import { Region as Region$6, RegionOptions as RegionOptions$6, QuerySuggestionsClient } from '@algolia/client-query-suggestions';
|
||||
export * from '@algolia/client-query-suggestions';
|
||||
export { Region as QuerySuggestionsRegion, RegionOptions as QuerySuggestionsRegionOptions } from '@algolia/client-query-suggestions';
|
||||
import { SearchClient, SaveObjectsOptions, PartialUpdateObjectsOptions, ReplaceAllObjectsOptions, ReplaceAllObjectsWithTransformationResponse } from '@algolia/client-search';
|
||||
export * from '@algolia/client-search';
|
||||
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';
|
||||
import { Region as Region$3, RegionOptions as RegionOptions$3, IngestionClient, WatchResponse } from '@algolia/ingestion';
|
||||
export * from '@algolia/ingestion';
|
||||
export { Event, EventStatus, Region as IngestionRegion, RegionOptions as IngestionRegionOptions, WatchResponse } from '@algolia/ingestion';
|
||||
import { MonitoringClient } from '@algolia/monitoring';
|
||||
export * from '@algolia/monitoring';
|
||||
import { RecommendClient } from '@algolia/recommend';
|
||||
export * from '@algolia/recommend';
|
||||
|
||||
type Region = Region$1 | Region$2 | Region$3 | Region$4 | Region$5 | Region$6;
|
||||
type RegionOptions = RegionOptions$1 | RegionOptions$2 | RegionOptions$3 | RegionOptions$4 | RegionOptions$5 | RegionOptions$6;
|
||||
|
||||
/**
|
||||
* Options forwarded to the client initialized via the `init` method.
|
||||
*/
|
||||
type InitClientOptions = Partial<{
|
||||
/**
|
||||
* App to target with the initialized client, defaults to the `algoliasearch` appId.
|
||||
*/
|
||||
appId: string;
|
||||
/**
|
||||
* API key of the targeted app ID, defaults to the `algoliasearch` apiKey.
|
||||
*/
|
||||
apiKey: string;
|
||||
options: ClientOptions;
|
||||
}>;
|
||||
|
||||
type Algoliasearch = SearchClient & {
|
||||
initAbtesting: (initOptions: InitClientOptions & RegionOptions$1) => AbtestingClient;
|
||||
initAnalytics: (initOptions: InitClientOptions & RegionOptions$2) => AnalyticsClient;
|
||||
initIngestion: (initOptions: InitClientOptions & RegionOptions$3) => IngestionClient;
|
||||
initInsights: (initOptions: InitClientOptions & RegionOptions$4) => InsightsClient;
|
||||
initMonitoring: (initOptions?: InitClientOptions) => MonitoringClient;
|
||||
initPersonalization: (initOptions: InitClientOptions & RegionOptions$5) => PersonalizationClient;
|
||||
initQuerySuggestions: (initOptions: InitClientOptions & RegionOptions$6) => QuerySuggestionsClient;
|
||||
initRecommend: (initOptions?: InitClientOptions) => RecommendClient;
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @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/).
|
||||
* @param saveObjects - The `saveObjects` object.
|
||||
* @param saveObjects.indexName - The `indexName` to save `objects` in.
|
||||
* @param saveObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
|
||||
* @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.
|
||||
* @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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `push` method and merged with the transporter requestOptions.
|
||||
*/
|
||||
saveObjectsWithTransformation: (options: SaveObjectsOptions, requestOptions?: RequestOptions | undefined) => Promise<Array<WatchResponse>>;
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @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/).
|
||||
* @param partialUpdateObjects - The `partialUpdateObjects` object.
|
||||
* @param partialUpdateObjects.indexName - The `indexName` to update `objects` in.
|
||||
* @param partialUpdateObjects.objects - The array of `objects` to update in the given Algolia `indexName`.
|
||||
* @param partialUpdateObjects.createIfNotExists - To be provided if non-existing objects are passed, otherwise, the call will fail..
|
||||
* @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.
|
||||
* @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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `push` method and merged with the transporter requestOptions.
|
||||
*/
|
||||
partialUpdateObjectsWithTransformation: (options: PartialUpdateObjectsOptions, requestOptions?: RequestOptions | undefined) => Promise<Array<WatchResponse>>;
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @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.
|
||||
* @param replaceAllObjects - The `replaceAllObjects` object.
|
||||
* @param replaceAllObjects.indexName - The `indexName` to replace `objects` in.
|
||||
* @param replaceAllObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
|
||||
* @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.
|
||||
* @param replaceAllObjects.scopes - The `scopes` to keep from the index. Defaults to ['settings', 'rules', 'synonyms'].
|
||||
* @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.
|
||||
*/
|
||||
replaceAllObjectsWithTransformation: (options: ReplaceAllObjectsOptions, requestOptions?: RequestOptions | undefined) => Promise<ReplaceAllObjectsWithTransformationResponse>;
|
||||
};
|
||||
type TransformationOptions = {
|
||||
transformation?: {
|
||||
region: Region$3;
|
||||
} | undefined;
|
||||
};
|
||||
declare function algoliasearch(appId: string, apiKey: string, options?: (ClientOptions & TransformationOptions) | undefined): Algoliasearch;
|
||||
|
||||
export { type Algoliasearch, type InitClientOptions, type Region, type RegionOptions, type TransformationOptions, algoliasearch };
|
238
node_modules/algoliasearch/dist/browser.js
generated
vendored
Normal file
238
node_modules/algoliasearch/dist/browser.js
generated
vendored
Normal file
@@ -0,0 +1,238 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
||||
|
||||
// builds/browser.ts
|
||||
var browser_exports = {};
|
||||
__export(browser_exports, {
|
||||
algoliasearch: () => algoliasearch,
|
||||
apiClientVersion: () => apiClientVersion
|
||||
});
|
||||
import { abtestingClient } from "@algolia/client-abtesting";
|
||||
import { analyticsClient } from "@algolia/client-analytics";
|
||||
import { insightsClient } from "@algolia/client-insights";
|
||||
import { personalizationClient } from "@algolia/client-personalization";
|
||||
import { querySuggestionsClient } from "@algolia/client-query-suggestions";
|
||||
import { searchClient } from "@algolia/client-search";
|
||||
import { ingestionClient } from "@algolia/ingestion";
|
||||
import { monitoringClient } from "@algolia/monitoring";
|
||||
import { recommendClient } from "@algolia/recommend";
|
||||
|
||||
// builds/models.ts
|
||||
var models_exports = {};
|
||||
__export(models_exports, {
|
||||
apiClientVersion: () => apiClientVersion
|
||||
});
|
||||
__reExport(models_exports, client_abtesting_star);
|
||||
__reExport(models_exports, client_analytics_star);
|
||||
__reExport(models_exports, client_insights_star);
|
||||
__reExport(models_exports, client_personalization_star);
|
||||
__reExport(models_exports, client_query_suggestions_star);
|
||||
__reExport(models_exports, client_search_star);
|
||||
__reExport(models_exports, ingestion_star);
|
||||
__reExport(models_exports, monitoring_star);
|
||||
__reExport(models_exports, recommend_star);
|
||||
import { apiClientVersion } from "@algolia/client-search";
|
||||
import * as client_abtesting_star from "@algolia/client-abtesting";
|
||||
import * as client_analytics_star from "@algolia/client-analytics";
|
||||
import * as client_insights_star from "@algolia/client-insights";
|
||||
import * as client_personalization_star from "@algolia/client-personalization";
|
||||
import * as client_query_suggestions_star from "@algolia/client-query-suggestions";
|
||||
import * as client_search_star from "@algolia/client-search";
|
||||
import * as ingestion_star from "@algolia/ingestion";
|
||||
import * as monitoring_star from "@algolia/monitoring";
|
||||
import * as recommend_star from "@algolia/recommend";
|
||||
|
||||
// builds/browser.ts
|
||||
__reExport(browser_exports, models_exports);
|
||||
function algoliasearch(appId, apiKey, options) {
|
||||
if (!appId || typeof appId !== "string") {
|
||||
throw new Error("`appId` is missing.");
|
||||
}
|
||||
if (!apiKey || typeof apiKey !== "string") {
|
||||
throw new Error("`apiKey` is missing.");
|
||||
}
|
||||
const client = searchClient(appId, apiKey, options);
|
||||
let ingestionTransporter;
|
||||
if (options?.transformation) {
|
||||
if (!options.transformation.region) {
|
||||
throw new Error("`region` must be provided when leveraging the transformation pipeline");
|
||||
}
|
||||
ingestionTransporter = ingestionClient(appId, apiKey, options.transformation.region, options);
|
||||
}
|
||||
return {
|
||||
...client,
|
||||
async saveObjectsWithTransformation({ indexName, objects, waitForTasks }, requestOptions) {
|
||||
if (!ingestionTransporter) {
|
||||
throw new Error("`transformation.region` must be provided at client instantiation before calling this method.");
|
||||
}
|
||||
if (!options?.transformation?.region) {
|
||||
throw new Error("`region` must be provided when leveraging the transformation pipeline");
|
||||
}
|
||||
return ingestionTransporter.chunkedPush(
|
||||
{ indexName, objects, action: "addObject", waitForTasks },
|
||||
requestOptions
|
||||
);
|
||||
},
|
||||
async partialUpdateObjectsWithTransformation({ indexName, objects, createIfNotExists, waitForTasks }, requestOptions) {
|
||||
if (!ingestionTransporter) {
|
||||
throw new Error("`transformation.region` must be provided at client instantiation before calling this method.");
|
||||
}
|
||||
if (!options?.transformation?.region) {
|
||||
throw new Error("`region` must be provided when leveraging the transformation pipeline");
|
||||
}
|
||||
return ingestionTransporter.chunkedPush(
|
||||
{
|
||||
indexName,
|
||||
objects,
|
||||
action: createIfNotExists ? "partialUpdateObject" : "partialUpdateObjectNoCreate",
|
||||
waitForTasks
|
||||
},
|
||||
requestOptions
|
||||
);
|
||||
},
|
||||
async replaceAllObjectsWithTransformation({ indexName, objects, batchSize, scopes }, requestOptions) {
|
||||
if (!ingestionTransporter) {
|
||||
throw new Error("`transformation.region` must be provided at client instantiation before calling this method.");
|
||||
}
|
||||
if (!options?.transformation?.region) {
|
||||
throw new Error("`region` must be provided when leveraging the transformation pipeline");
|
||||
}
|
||||
const randomSuffix = Math.floor(Math.random() * 1e6) + 1e5;
|
||||
const tmpIndexName = `${indexName}_tmp_${randomSuffix}`;
|
||||
if (scopes === void 0) {
|
||||
scopes = ["settings", "rules", "synonyms"];
|
||||
}
|
||||
try {
|
||||
let copyOperationResponse = await this.operationIndex(
|
||||
{
|
||||
indexName,
|
||||
operationIndexParams: {
|
||||
operation: "copy",
|
||||
destination: tmpIndexName,
|
||||
scope: scopes
|
||||
}
|
||||
},
|
||||
requestOptions
|
||||
);
|
||||
const watchResponses = await ingestionTransporter.chunkedPush(
|
||||
{ indexName: tmpIndexName, objects, waitForTasks: true, batchSize, referenceIndexName: indexName },
|
||||
requestOptions
|
||||
);
|
||||
await this.waitForTask({
|
||||
indexName: tmpIndexName,
|
||||
taskID: copyOperationResponse.taskID
|
||||
});
|
||||
copyOperationResponse = await this.operationIndex(
|
||||
{
|
||||
indexName,
|
||||
operationIndexParams: {
|
||||
operation: "copy",
|
||||
destination: tmpIndexName,
|
||||
scope: scopes
|
||||
}
|
||||
},
|
||||
requestOptions
|
||||
);
|
||||
await this.waitForTask({
|
||||
indexName: tmpIndexName,
|
||||
taskID: copyOperationResponse.taskID
|
||||
});
|
||||
const moveOperationResponse = await this.operationIndex(
|
||||
{
|
||||
indexName: tmpIndexName,
|
||||
operationIndexParams: { operation: "move", destination: indexName }
|
||||
},
|
||||
requestOptions
|
||||
);
|
||||
await this.waitForTask({
|
||||
indexName: tmpIndexName,
|
||||
taskID: moveOperationResponse.taskID
|
||||
});
|
||||
return { copyOperationResponse, watchResponses, moveOperationResponse };
|
||||
} catch (error) {
|
||||
await this.deleteIndex({ indexName: tmpIndexName });
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
||||
*/
|
||||
get _ua() {
|
||||
return client.transporter.algoliaAgent.value;
|
||||
},
|
||||
initAbtesting: (initOptions) => {
|
||||
return abtestingClient(
|
||||
initOptions.appId || appId,
|
||||
initOptions.apiKey || apiKey,
|
||||
initOptions.region,
|
||||
initOptions.options
|
||||
);
|
||||
},
|
||||
initAnalytics: (initOptions) => {
|
||||
return analyticsClient(
|
||||
initOptions.appId || appId,
|
||||
initOptions.apiKey || apiKey,
|
||||
initOptions.region,
|
||||
initOptions.options
|
||||
);
|
||||
},
|
||||
initIngestion: (initOptions) => {
|
||||
return ingestionClient(
|
||||
initOptions.appId || appId,
|
||||
initOptions.apiKey || apiKey,
|
||||
initOptions.region,
|
||||
initOptions.options
|
||||
);
|
||||
},
|
||||
initInsights: (initOptions) => {
|
||||
return insightsClient(
|
||||
initOptions.appId || appId,
|
||||
initOptions.apiKey || apiKey,
|
||||
initOptions.region,
|
||||
initOptions.options
|
||||
);
|
||||
},
|
||||
initMonitoring: (initOptions = {}) => {
|
||||
return monitoringClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);
|
||||
},
|
||||
initPersonalization: (initOptions) => {
|
||||
return personalizationClient(
|
||||
initOptions.appId || appId,
|
||||
initOptions.apiKey || apiKey,
|
||||
initOptions.region,
|
||||
initOptions.options
|
||||
);
|
||||
},
|
||||
initQuerySuggestions: (initOptions) => {
|
||||
return querySuggestionsClient(
|
||||
initOptions.appId || appId,
|
||||
initOptions.apiKey || apiKey,
|
||||
initOptions.region,
|
||||
initOptions.options
|
||||
);
|
||||
},
|
||||
initRecommend: (initOptions = {}) => {
|
||||
return recommendClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);
|
||||
}
|
||||
};
|
||||
}
|
||||
export {
|
||||
algoliasearch,
|
||||
apiClientVersion
|
||||
};
|
||||
//# sourceMappingURL=browser.js.map
|
1
node_modules/algoliasearch/dist/browser.js.map
generated
vendored
Normal file
1
node_modules/algoliasearch/dist/browser.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2
node_modules/algoliasearch/dist/browser.min.js
generated
vendored
Normal file
2
node_modules/algoliasearch/dist/browser.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
node_modules/algoliasearch/dist/browser.min.js.map
generated
vendored
Normal file
1
node_modules/algoliasearch/dist/browser.min.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
100
node_modules/algoliasearch/dist/fetch.d.ts
generated
vendored
Normal file
100
node_modules/algoliasearch/dist/fetch.d.ts
generated
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
import { ClientOptions, RequestOptions } from '@algolia/client-common';
|
||||
import { Region as Region$1, RegionOptions as RegionOptions$1, AbtestingClient } from '@algolia/client-abtesting';
|
||||
export * from '@algolia/client-abtesting';
|
||||
export { Region as AbtestingRegion, RegionOptions as AbtestingRegionOptions, Status } from '@algolia/client-abtesting';
|
||||
import { Region as Region$2, RegionOptions as RegionOptions$2, AnalyticsClient } from '@algolia/client-analytics';
|
||||
export * from '@algolia/client-analytics';
|
||||
export { Region as AnalyticsRegion, RegionOptions as AnalyticsRegionOptions } from '@algolia/client-analytics';
|
||||
import { Region as Region$4, RegionOptions as RegionOptions$4, InsightsClient } from '@algolia/client-insights';
|
||||
export * from '@algolia/client-insights';
|
||||
export { Region as InsightsRegion, RegionOptions as InsightsRegionOptions } from '@algolia/client-insights';
|
||||
import { Region as Region$5, RegionOptions as RegionOptions$5, PersonalizationClient } from '@algolia/client-personalization';
|
||||
export * from '@algolia/client-personalization';
|
||||
export { EventType, Region as PersonalizationRegion, RegionOptions as PersonalizationRegionOptions } from '@algolia/client-personalization';
|
||||
import { Region as Region$6, RegionOptions as RegionOptions$6, QuerySuggestionsClient } from '@algolia/client-query-suggestions';
|
||||
export * from '@algolia/client-query-suggestions';
|
||||
export { Region as QuerySuggestionsRegion, RegionOptions as QuerySuggestionsRegionOptions } from '@algolia/client-query-suggestions';
|
||||
import { SearchClient, SaveObjectsOptions, PartialUpdateObjectsOptions, ReplaceAllObjectsOptions, ReplaceAllObjectsWithTransformationResponse } from '@algolia/client-search';
|
||||
export * from '@algolia/client-search';
|
||||
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';
|
||||
import { Region as Region$3, RegionOptions as RegionOptions$3, IngestionClient, WatchResponse } from '@algolia/ingestion';
|
||||
export * from '@algolia/ingestion';
|
||||
export { Event, EventStatus, Region as IngestionRegion, RegionOptions as IngestionRegionOptions, WatchResponse } from '@algolia/ingestion';
|
||||
import { MonitoringClient } from '@algolia/monitoring';
|
||||
export * from '@algolia/monitoring';
|
||||
import { RecommendClient } from '@algolia/recommend';
|
||||
export * from '@algolia/recommend';
|
||||
|
||||
type Region = Region$1 | Region$2 | Region$3 | Region$4 | Region$5 | Region$6;
|
||||
type RegionOptions = RegionOptions$1 | RegionOptions$2 | RegionOptions$3 | RegionOptions$4 | RegionOptions$5 | RegionOptions$6;
|
||||
|
||||
/**
|
||||
* Options forwarded to the client initialized via the `init` method.
|
||||
*/
|
||||
type InitClientOptions = Partial<{
|
||||
/**
|
||||
* App to target with the initialized client, defaults to the `algoliasearch` appId.
|
||||
*/
|
||||
appId: string;
|
||||
/**
|
||||
* API key of the targeted app ID, defaults to the `algoliasearch` apiKey.
|
||||
*/
|
||||
apiKey: string;
|
||||
options: ClientOptions;
|
||||
}>;
|
||||
|
||||
type Algoliasearch = SearchClient & {
|
||||
initAbtesting: (initOptions: InitClientOptions & RegionOptions$1) => AbtestingClient;
|
||||
initAnalytics: (initOptions: InitClientOptions & RegionOptions$2) => AnalyticsClient;
|
||||
initIngestion: (initOptions: InitClientOptions & RegionOptions$3) => IngestionClient;
|
||||
initInsights: (initOptions: InitClientOptions & RegionOptions$4) => InsightsClient;
|
||||
initMonitoring: (initOptions?: InitClientOptions) => MonitoringClient;
|
||||
initPersonalization: (initOptions: InitClientOptions & RegionOptions$5) => PersonalizationClient;
|
||||
initQuerySuggestions: (initOptions: InitClientOptions & RegionOptions$6) => QuerySuggestionsClient;
|
||||
initRecommend: (initOptions?: InitClientOptions) => RecommendClient;
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @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/).
|
||||
* @param saveObjects - The `saveObjects` object.
|
||||
* @param saveObjects.indexName - The `indexName` to save `objects` in.
|
||||
* @param saveObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
|
||||
* @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.
|
||||
* @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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `push` method and merged with the transporter requestOptions.
|
||||
*/
|
||||
saveObjectsWithTransformation: (options: SaveObjectsOptions, requestOptions?: RequestOptions | undefined) => Promise<Array<WatchResponse>>;
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @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/).
|
||||
* @param partialUpdateObjects - The `partialUpdateObjects` object.
|
||||
* @param partialUpdateObjects.indexName - The `indexName` to update `objects` in.
|
||||
* @param partialUpdateObjects.objects - The array of `objects` to update in the given Algolia `indexName`.
|
||||
* @param partialUpdateObjects.createIfNotExists - To be provided if non-existing objects are passed, otherwise, the call will fail..
|
||||
* @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.
|
||||
* @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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `push` method and merged with the transporter requestOptions.
|
||||
*/
|
||||
partialUpdateObjectsWithTransformation: (options: PartialUpdateObjectsOptions, requestOptions?: RequestOptions | undefined) => Promise<Array<WatchResponse>>;
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @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.
|
||||
* @param replaceAllObjects - The `replaceAllObjects` object.
|
||||
* @param replaceAllObjects.indexName - The `indexName` to replace `objects` in.
|
||||
* @param replaceAllObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
|
||||
* @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.
|
||||
* @param replaceAllObjects.scopes - The `scopes` to keep from the index. Defaults to ['settings', 'rules', 'synonyms'].
|
||||
* @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.
|
||||
*/
|
||||
replaceAllObjectsWithTransformation: (options: ReplaceAllObjectsOptions, requestOptions?: RequestOptions | undefined) => Promise<ReplaceAllObjectsWithTransformationResponse>;
|
||||
};
|
||||
type TransformationOptions = {
|
||||
transformation?: {
|
||||
region: Region$3;
|
||||
} | undefined;
|
||||
};
|
||||
declare function algoliasearch(appId: string, apiKey: string, options?: (ClientOptions & TransformationOptions) | undefined): Algoliasearch;
|
||||
|
||||
export { type Algoliasearch, type InitClientOptions, type Region, type RegionOptions, type TransformationOptions, algoliasearch };
|
241
node_modules/algoliasearch/dist/fetch.js
generated
vendored
Normal file
241
node_modules/algoliasearch/dist/fetch.js
generated
vendored
Normal file
@@ -0,0 +1,241 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
||||
|
||||
// builds/fetch.ts
|
||||
var fetch_exports = {};
|
||||
__export(fetch_exports, {
|
||||
algoliasearch: () => algoliasearch,
|
||||
apiClientVersion: () => apiClientVersion
|
||||
});
|
||||
import { abtestingClient } from "@algolia/client-abtesting";
|
||||
import { analyticsClient } from "@algolia/client-analytics";
|
||||
import { insightsClient } from "@algolia/client-insights";
|
||||
import { personalizationClient } from "@algolia/client-personalization";
|
||||
import { querySuggestionsClient } from "@algolia/client-query-suggestions";
|
||||
import { searchClient } from "@algolia/client-search";
|
||||
import { ingestionClient } from "@algolia/ingestion";
|
||||
import { monitoringClient } from "@algolia/monitoring";
|
||||
import { recommendClient } from "@algolia/recommend";
|
||||
|
||||
// builds/models.ts
|
||||
var models_exports = {};
|
||||
__export(models_exports, {
|
||||
apiClientVersion: () => apiClientVersion
|
||||
});
|
||||
__reExport(models_exports, client_abtesting_star);
|
||||
__reExport(models_exports, client_analytics_star);
|
||||
__reExport(models_exports, client_insights_star);
|
||||
__reExport(models_exports, client_personalization_star);
|
||||
__reExport(models_exports, client_query_suggestions_star);
|
||||
__reExport(models_exports, client_search_star);
|
||||
__reExport(models_exports, ingestion_star);
|
||||
__reExport(models_exports, monitoring_star);
|
||||
__reExport(models_exports, recommend_star);
|
||||
import { apiClientVersion } from "@algolia/client-search";
|
||||
import * as client_abtesting_star from "@algolia/client-abtesting";
|
||||
import * as client_analytics_star from "@algolia/client-analytics";
|
||||
import * as client_insights_star from "@algolia/client-insights";
|
||||
import * as client_personalization_star from "@algolia/client-personalization";
|
||||
import * as client_query_suggestions_star from "@algolia/client-query-suggestions";
|
||||
import * as client_search_star from "@algolia/client-search";
|
||||
import * as ingestion_star from "@algolia/ingestion";
|
||||
import * as monitoring_star from "@algolia/monitoring";
|
||||
import * as recommend_star from "@algolia/recommend";
|
||||
|
||||
// builds/fetch.ts
|
||||
__reExport(fetch_exports, models_exports);
|
||||
function algoliasearch(appId, apiKey, options) {
|
||||
if (!appId || typeof appId !== "string") {
|
||||
throw new Error("`appId` is missing.");
|
||||
}
|
||||
if (!apiKey || typeof apiKey !== "string") {
|
||||
throw new Error("`apiKey` is missing.");
|
||||
}
|
||||
const client = searchClient(appId, apiKey, options);
|
||||
let ingestionTransporter;
|
||||
if (options == null ? void 0 : options.transformation) {
|
||||
if (!options.transformation.region) {
|
||||
throw new Error("`region` must be provided when leveraging the transformation pipeline");
|
||||
}
|
||||
ingestionTransporter = ingestionClient(appId, apiKey, options.transformation.region, options);
|
||||
}
|
||||
return {
|
||||
...client,
|
||||
async saveObjectsWithTransformation({ indexName, objects, waitForTasks }, requestOptions) {
|
||||
var _a;
|
||||
if (!ingestionTransporter) {
|
||||
throw new Error("`transformation.region` must be provided at client instantiation before calling this method.");
|
||||
}
|
||||
if (!((_a = options == null ? void 0 : options.transformation) == null ? void 0 : _a.region)) {
|
||||
throw new Error("`region` must be provided when leveraging the transformation pipeline");
|
||||
}
|
||||
return ingestionTransporter.chunkedPush(
|
||||
{ indexName, objects, action: "addObject", waitForTasks },
|
||||
requestOptions
|
||||
);
|
||||
},
|
||||
async partialUpdateObjectsWithTransformation({ indexName, objects, createIfNotExists, waitForTasks }, requestOptions) {
|
||||
var _a;
|
||||
if (!ingestionTransporter) {
|
||||
throw new Error("`transformation.region` must be provided at client instantiation before calling this method.");
|
||||
}
|
||||
if (!((_a = options == null ? void 0 : options.transformation) == null ? void 0 : _a.region)) {
|
||||
throw new Error("`region` must be provided when leveraging the transformation pipeline");
|
||||
}
|
||||
return ingestionTransporter.chunkedPush(
|
||||
{
|
||||
indexName,
|
||||
objects,
|
||||
action: createIfNotExists ? "partialUpdateObject" : "partialUpdateObjectNoCreate",
|
||||
waitForTasks
|
||||
},
|
||||
requestOptions
|
||||
);
|
||||
},
|
||||
async replaceAllObjectsWithTransformation({ indexName, objects, batchSize, scopes }, requestOptions) {
|
||||
var _a;
|
||||
if (!ingestionTransporter) {
|
||||
throw new Error("`transformation.region` must be provided at client instantiation before calling this method.");
|
||||
}
|
||||
if (!((_a = options == null ? void 0 : options.transformation) == null ? void 0 : _a.region)) {
|
||||
throw new Error("`region` must be provided when leveraging the transformation pipeline");
|
||||
}
|
||||
const randomSuffix = Math.floor(Math.random() * 1e6) + 1e5;
|
||||
const tmpIndexName = `${indexName}_tmp_${randomSuffix}`;
|
||||
if (scopes === void 0) {
|
||||
scopes = ["settings", "rules", "synonyms"];
|
||||
}
|
||||
try {
|
||||
let copyOperationResponse = await this.operationIndex(
|
||||
{
|
||||
indexName,
|
||||
operationIndexParams: {
|
||||
operation: "copy",
|
||||
destination: tmpIndexName,
|
||||
scope: scopes
|
||||
}
|
||||
},
|
||||
requestOptions
|
||||
);
|
||||
const watchResponses = await ingestionTransporter.chunkedPush(
|
||||
{ indexName: tmpIndexName, objects, waitForTasks: true, batchSize, referenceIndexName: indexName },
|
||||
requestOptions
|
||||
);
|
||||
await this.waitForTask({
|
||||
indexName: tmpIndexName,
|
||||
taskID: copyOperationResponse.taskID
|
||||
});
|
||||
copyOperationResponse = await this.operationIndex(
|
||||
{
|
||||
indexName,
|
||||
operationIndexParams: {
|
||||
operation: "copy",
|
||||
destination: tmpIndexName,
|
||||
scope: scopes
|
||||
}
|
||||
},
|
||||
requestOptions
|
||||
);
|
||||
await this.waitForTask({
|
||||
indexName: tmpIndexName,
|
||||
taskID: copyOperationResponse.taskID
|
||||
});
|
||||
const moveOperationResponse = await this.operationIndex(
|
||||
{
|
||||
indexName: tmpIndexName,
|
||||
operationIndexParams: { operation: "move", destination: indexName }
|
||||
},
|
||||
requestOptions
|
||||
);
|
||||
await this.waitForTask({
|
||||
indexName: tmpIndexName,
|
||||
taskID: moveOperationResponse.taskID
|
||||
});
|
||||
return { copyOperationResponse, watchResponses, moveOperationResponse };
|
||||
} catch (error) {
|
||||
await this.deleteIndex({ indexName: tmpIndexName });
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
||||
*/
|
||||
get _ua() {
|
||||
return client.transporter.algoliaAgent.value;
|
||||
},
|
||||
initAbtesting: (initOptions) => {
|
||||
return abtestingClient(
|
||||
initOptions.appId || appId,
|
||||
initOptions.apiKey || apiKey,
|
||||
initOptions.region,
|
||||
initOptions.options
|
||||
);
|
||||
},
|
||||
initAnalytics: (initOptions) => {
|
||||
return analyticsClient(
|
||||
initOptions.appId || appId,
|
||||
initOptions.apiKey || apiKey,
|
||||
initOptions.region,
|
||||
initOptions.options
|
||||
);
|
||||
},
|
||||
initIngestion: (initOptions) => {
|
||||
return ingestionClient(
|
||||
initOptions.appId || appId,
|
||||
initOptions.apiKey || apiKey,
|
||||
initOptions.region,
|
||||
initOptions.options
|
||||
);
|
||||
},
|
||||
initInsights: (initOptions) => {
|
||||
return insightsClient(
|
||||
initOptions.appId || appId,
|
||||
initOptions.apiKey || apiKey,
|
||||
initOptions.region,
|
||||
initOptions.options
|
||||
);
|
||||
},
|
||||
initMonitoring: (initOptions = {}) => {
|
||||
return monitoringClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);
|
||||
},
|
||||
initPersonalization: (initOptions) => {
|
||||
return personalizationClient(
|
||||
initOptions.appId || appId,
|
||||
initOptions.apiKey || apiKey,
|
||||
initOptions.region,
|
||||
initOptions.options
|
||||
);
|
||||
},
|
||||
initQuerySuggestions: (initOptions) => {
|
||||
return querySuggestionsClient(
|
||||
initOptions.appId || appId,
|
||||
initOptions.apiKey || apiKey,
|
||||
initOptions.region,
|
||||
initOptions.options
|
||||
);
|
||||
},
|
||||
initRecommend: (initOptions = {}) => {
|
||||
return recommendClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);
|
||||
}
|
||||
};
|
||||
}
|
||||
export {
|
||||
algoliasearch,
|
||||
apiClientVersion
|
||||
};
|
||||
//# sourceMappingURL=fetch.js.map
|
1
node_modules/algoliasearch/dist/fetch.js.map
generated
vendored
Normal file
1
node_modules/algoliasearch/dist/fetch.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1756
node_modules/algoliasearch/dist/lite/browser.d.ts
generated
vendored
Normal file
1756
node_modules/algoliasearch/dist/lite/browser.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
281
node_modules/algoliasearch/dist/lite/builds/browser.js
generated
vendored
Normal file
281
node_modules/algoliasearch/dist/lite/builds/browser.js
generated
vendored
Normal file
@@ -0,0 +1,281 @@
|
||||
// lite/builds/browser.ts
|
||||
import { createXhrRequester } from "@algolia/requester-browser-xhr";
|
||||
import {
|
||||
createBrowserLocalStorageCache,
|
||||
createFallbackableCache,
|
||||
createMemoryCache,
|
||||
createNullLogger
|
||||
} from "@algolia/client-common";
|
||||
|
||||
// lite/src/liteClient.ts
|
||||
import { createAuth, createTransporter, getAlgoliaAgent, shuffle } from "@algolia/client-common";
|
||||
var apiClientVersion = "5.34.1";
|
||||
function getDefaultHosts(appId) {
|
||||
return [
|
||||
{
|
||||
url: `${appId}-dsn.algolia.net`,
|
||||
accept: "read",
|
||||
protocol: "https"
|
||||
},
|
||||
{
|
||||
url: `${appId}.algolia.net`,
|
||||
accept: "write",
|
||||
protocol: "https"
|
||||
}
|
||||
].concat(
|
||||
shuffle([
|
||||
{
|
||||
url: `${appId}-1.algolianet.com`,
|
||||
accept: "readWrite",
|
||||
protocol: "https"
|
||||
},
|
||||
{
|
||||
url: `${appId}-2.algolianet.com`,
|
||||
accept: "readWrite",
|
||||
protocol: "https"
|
||||
},
|
||||
{
|
||||
url: `${appId}-3.algolianet.com`,
|
||||
accept: "readWrite",
|
||||
protocol: "https"
|
||||
}
|
||||
])
|
||||
);
|
||||
}
|
||||
function createLiteClient({
|
||||
appId: appIdOption,
|
||||
apiKey: apiKeyOption,
|
||||
authMode,
|
||||
algoliaAgents,
|
||||
...options
|
||||
}) {
|
||||
const auth = createAuth(appIdOption, apiKeyOption, authMode);
|
||||
const transporter = createTransporter({
|
||||
hosts: getDefaultHosts(appIdOption),
|
||||
...options,
|
||||
algoliaAgent: getAlgoliaAgent({
|
||||
algoliaAgents,
|
||||
client: "Lite",
|
||||
version: apiClientVersion
|
||||
}),
|
||||
baseHeaders: {
|
||||
"content-type": "text/plain",
|
||||
...auth.headers(),
|
||||
...options.baseHeaders
|
||||
},
|
||||
baseQueryParameters: {
|
||||
...auth.queryParameters(),
|
||||
...options.baseQueryParameters
|
||||
}
|
||||
});
|
||||
return {
|
||||
transporter,
|
||||
/**
|
||||
* The `appId` currently in use.
|
||||
*/
|
||||
appId: appIdOption,
|
||||
/**
|
||||
* The `apiKey` currently in use.
|
||||
*/
|
||||
apiKey: apiKeyOption,
|
||||
/**
|
||||
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
||||
*/
|
||||
clearCache() {
|
||||
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0);
|
||||
},
|
||||
/**
|
||||
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
||||
*/
|
||||
get _ua() {
|
||||
return transporter.algoliaAgent.value;
|
||||
},
|
||||
/**
|
||||
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
||||
*
|
||||
* @param segment - The algolia agent (user-agent) segment to add.
|
||||
* @param version - The version of the agent.
|
||||
*/
|
||||
addAlgoliaAgent(segment, version) {
|
||||
transporter.algoliaAgent.add({ segment, version });
|
||||
},
|
||||
/**
|
||||
* Helper method to switch the API key used to authenticate the requests.
|
||||
*
|
||||
* @param params - Method params.
|
||||
* @param params.apiKey - The new API Key to use.
|
||||
*/
|
||||
setClientApiKey({ apiKey }) {
|
||||
if (!authMode || authMode === "WithinHeaders") {
|
||||
transporter.baseHeaders["x-algolia-api-key"] = apiKey;
|
||||
} else {
|
||||
transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Helper: calls the `search` method but with certainty that we will only request Algolia records (hits) and not facets.
|
||||
* 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.
|
||||
*
|
||||
* @summary Search multiple indices for `hits`.
|
||||
* @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
searchForHits(searchMethodParams, requestOptions) {
|
||||
return this.search(searchMethodParams, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Helper: calls the `search` method but with certainty that we will only request Algolia facets and not records (hits).
|
||||
* 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.
|
||||
*
|
||||
* @summary Search multiple indices for `facets`.
|
||||
* @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
searchForFacets(searchMethodParams, requestOptions) {
|
||||
return this.search(searchMethodParams, requestOptions);
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customPost - The customPost object.
|
||||
* @param customPost.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customPost.parameters - Query parameters to apply to the current query.
|
||||
* @param customPost.body - Parameters to send with the custom request.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customPost({ path, parameters, body }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customPost`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "POST",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers,
|
||||
data: body ? body : {}
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves recommendations from selected AI models.
|
||||
*
|
||||
* Required API Key ACLs:
|
||||
* - search
|
||||
* @param getRecommendationsParams - The getRecommendationsParams object.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getRecommendations(getRecommendationsParams, requestOptions) {
|
||||
if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {
|
||||
const newSignatureRequest = {
|
||||
requests: getRecommendationsParams
|
||||
};
|
||||
getRecommendationsParams = newSignatureRequest;
|
||||
}
|
||||
if (!getRecommendationsParams) {
|
||||
throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");
|
||||
}
|
||||
if (!getRecommendationsParams.requests) {
|
||||
throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");
|
||||
}
|
||||
const requestPath = "/1/indexes/*/recommendations";
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "POST",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers,
|
||||
data: getRecommendationsParams,
|
||||
useReadTransporter: true,
|
||||
cacheable: true
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* Required API Key ACLs:
|
||||
* - search
|
||||
* @param searchMethodParams - Muli-search request body. Results are returned in the same order as the requests.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
search(searchMethodParams, requestOptions) {
|
||||
if (searchMethodParams && Array.isArray(searchMethodParams)) {
|
||||
const newSignatureRequest = {
|
||||
requests: searchMethodParams.map(({ params, ...legacyRequest }) => {
|
||||
if (legacyRequest.type === "facet") {
|
||||
return {
|
||||
...legacyRequest,
|
||||
...params,
|
||||
type: "facet"
|
||||
};
|
||||
}
|
||||
return {
|
||||
...legacyRequest,
|
||||
...params,
|
||||
facet: void 0,
|
||||
maxFacetHits: void 0,
|
||||
facetQuery: void 0
|
||||
};
|
||||
})
|
||||
};
|
||||
searchMethodParams = newSignatureRequest;
|
||||
}
|
||||
if (!searchMethodParams) {
|
||||
throw new Error("Parameter `searchMethodParams` is required when calling `search`.");
|
||||
}
|
||||
if (!searchMethodParams.requests) {
|
||||
throw new Error("Parameter `searchMethodParams.requests` is required when calling `search`.");
|
||||
}
|
||||
const requestPath = "/1/indexes/*/queries";
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "POST",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers,
|
||||
data: searchMethodParams,
|
||||
useReadTransporter: true,
|
||||
cacheable: true
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// lite/builds/browser.ts
|
||||
function liteClient(appId, apiKey, options) {
|
||||
if (!appId || typeof appId !== "string") {
|
||||
throw new Error("`appId` is missing.");
|
||||
}
|
||||
if (!apiKey || typeof apiKey !== "string") {
|
||||
throw new Error("`apiKey` is missing.");
|
||||
}
|
||||
return createLiteClient({
|
||||
appId,
|
||||
apiKey,
|
||||
timeouts: {
|
||||
connect: 1e3,
|
||||
read: 2e3,
|
||||
write: 3e4
|
||||
},
|
||||
logger: createNullLogger(),
|
||||
requester: createXhrRequester(),
|
||||
algoliaAgents: [{ segment: "Browser" }],
|
||||
authMode: "WithinQueryParameters",
|
||||
responsesCache: createMemoryCache(),
|
||||
requestsCache: createMemoryCache({ serializable: false }),
|
||||
hostsCache: createFallbackableCache({
|
||||
caches: [createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }), createMemoryCache()]
|
||||
}),
|
||||
...options
|
||||
});
|
||||
}
|
||||
export {
|
||||
apiClientVersion,
|
||||
liteClient
|
||||
};
|
||||
//# sourceMappingURL=browser.js.map
|
1
node_modules/algoliasearch/dist/lite/builds/browser.js.map
generated
vendored
Normal file
1
node_modules/algoliasearch/dist/lite/builds/browser.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2
node_modules/algoliasearch/dist/lite/builds/browser.min.js
generated
vendored
Normal file
2
node_modules/algoliasearch/dist/lite/builds/browser.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
node_modules/algoliasearch/dist/lite/builds/browser.min.js.map
generated
vendored
Normal file
1
node_modules/algoliasearch/dist/lite/builds/browser.min.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
12
node_modules/algoliasearch/dist/lite/builds/browser.umd.js
generated
vendored
Normal file
12
node_modules/algoliasearch/dist/lite/builds/browser.umd.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
299
node_modules/algoliasearch/dist/lite/builds/node.cjs
generated
vendored
Normal file
299
node_modules/algoliasearch/dist/lite/builds/node.cjs
generated
vendored
Normal file
@@ -0,0 +1,299 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// lite/builds/node.ts
|
||||
var node_exports = {};
|
||||
__export(node_exports, {
|
||||
apiClientVersion: () => apiClientVersion,
|
||||
liteClient: () => liteClient
|
||||
});
|
||||
module.exports = __toCommonJS(node_exports);
|
||||
var import_requester_node_http = require("@algolia/requester-node-http");
|
||||
var import_client_common2 = require("@algolia/client-common");
|
||||
|
||||
// lite/src/liteClient.ts
|
||||
var import_client_common = require("@algolia/client-common");
|
||||
var apiClientVersion = "5.34.1";
|
||||
function getDefaultHosts(appId) {
|
||||
return [
|
||||
{
|
||||
url: `${appId}-dsn.algolia.net`,
|
||||
accept: "read",
|
||||
protocol: "https"
|
||||
},
|
||||
{
|
||||
url: `${appId}.algolia.net`,
|
||||
accept: "write",
|
||||
protocol: "https"
|
||||
}
|
||||
].concat(
|
||||
(0, import_client_common.shuffle)([
|
||||
{
|
||||
url: `${appId}-1.algolianet.com`,
|
||||
accept: "readWrite",
|
||||
protocol: "https"
|
||||
},
|
||||
{
|
||||
url: `${appId}-2.algolianet.com`,
|
||||
accept: "readWrite",
|
||||
protocol: "https"
|
||||
},
|
||||
{
|
||||
url: `${appId}-3.algolianet.com`,
|
||||
accept: "readWrite",
|
||||
protocol: "https"
|
||||
}
|
||||
])
|
||||
);
|
||||
}
|
||||
function createLiteClient({
|
||||
appId: appIdOption,
|
||||
apiKey: apiKeyOption,
|
||||
authMode,
|
||||
algoliaAgents,
|
||||
...options
|
||||
}) {
|
||||
const auth = (0, import_client_common.createAuth)(appIdOption, apiKeyOption, authMode);
|
||||
const transporter = (0, import_client_common.createTransporter)({
|
||||
hosts: getDefaultHosts(appIdOption),
|
||||
...options,
|
||||
algoliaAgent: (0, import_client_common.getAlgoliaAgent)({
|
||||
algoliaAgents,
|
||||
client: "Lite",
|
||||
version: apiClientVersion
|
||||
}),
|
||||
baseHeaders: {
|
||||
"content-type": "text/plain",
|
||||
...auth.headers(),
|
||||
...options.baseHeaders
|
||||
},
|
||||
baseQueryParameters: {
|
||||
...auth.queryParameters(),
|
||||
...options.baseQueryParameters
|
||||
}
|
||||
});
|
||||
return {
|
||||
transporter,
|
||||
/**
|
||||
* The `appId` currently in use.
|
||||
*/
|
||||
appId: appIdOption,
|
||||
/**
|
||||
* The `apiKey` currently in use.
|
||||
*/
|
||||
apiKey: apiKeyOption,
|
||||
/**
|
||||
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
||||
*/
|
||||
clearCache() {
|
||||
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0);
|
||||
},
|
||||
/**
|
||||
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
||||
*/
|
||||
get _ua() {
|
||||
return transporter.algoliaAgent.value;
|
||||
},
|
||||
/**
|
||||
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
||||
*
|
||||
* @param segment - The algolia agent (user-agent) segment to add.
|
||||
* @param version - The version of the agent.
|
||||
*/
|
||||
addAlgoliaAgent(segment, version) {
|
||||
transporter.algoliaAgent.add({ segment, version });
|
||||
},
|
||||
/**
|
||||
* Helper method to switch the API key used to authenticate the requests.
|
||||
*
|
||||
* @param params - Method params.
|
||||
* @param params.apiKey - The new API Key to use.
|
||||
*/
|
||||
setClientApiKey({ apiKey }) {
|
||||
if (!authMode || authMode === "WithinHeaders") {
|
||||
transporter.baseHeaders["x-algolia-api-key"] = apiKey;
|
||||
} else {
|
||||
transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Helper: calls the `search` method but with certainty that we will only request Algolia records (hits) and not facets.
|
||||
* 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.
|
||||
*
|
||||
* @summary Search multiple indices for `hits`.
|
||||
* @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
searchForHits(searchMethodParams, requestOptions) {
|
||||
return this.search(searchMethodParams, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Helper: calls the `search` method but with certainty that we will only request Algolia facets and not records (hits).
|
||||
* 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.
|
||||
*
|
||||
* @summary Search multiple indices for `facets`.
|
||||
* @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
searchForFacets(searchMethodParams, requestOptions) {
|
||||
return this.search(searchMethodParams, requestOptions);
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customPost - The customPost object.
|
||||
* @param customPost.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customPost.parameters - Query parameters to apply to the current query.
|
||||
* @param customPost.body - Parameters to send with the custom request.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customPost({ path, parameters, body }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customPost`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "POST",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers,
|
||||
data: body ? body : {}
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves recommendations from selected AI models.
|
||||
*
|
||||
* Required API Key ACLs:
|
||||
* - search
|
||||
* @param getRecommendationsParams - The getRecommendationsParams object.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getRecommendations(getRecommendationsParams, requestOptions) {
|
||||
if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {
|
||||
const newSignatureRequest = {
|
||||
requests: getRecommendationsParams
|
||||
};
|
||||
getRecommendationsParams = newSignatureRequest;
|
||||
}
|
||||
if (!getRecommendationsParams) {
|
||||
throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");
|
||||
}
|
||||
if (!getRecommendationsParams.requests) {
|
||||
throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");
|
||||
}
|
||||
const requestPath = "/1/indexes/*/recommendations";
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "POST",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers,
|
||||
data: getRecommendationsParams,
|
||||
useReadTransporter: true,
|
||||
cacheable: true
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* Required API Key ACLs:
|
||||
* - search
|
||||
* @param searchMethodParams - Muli-search request body. Results are returned in the same order as the requests.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
search(searchMethodParams, requestOptions) {
|
||||
if (searchMethodParams && Array.isArray(searchMethodParams)) {
|
||||
const newSignatureRequest = {
|
||||
requests: searchMethodParams.map(({ params, ...legacyRequest }) => {
|
||||
if (legacyRequest.type === "facet") {
|
||||
return {
|
||||
...legacyRequest,
|
||||
...params,
|
||||
type: "facet"
|
||||
};
|
||||
}
|
||||
return {
|
||||
...legacyRequest,
|
||||
...params,
|
||||
facet: void 0,
|
||||
maxFacetHits: void 0,
|
||||
facetQuery: void 0
|
||||
};
|
||||
})
|
||||
};
|
||||
searchMethodParams = newSignatureRequest;
|
||||
}
|
||||
if (!searchMethodParams) {
|
||||
throw new Error("Parameter `searchMethodParams` is required when calling `search`.");
|
||||
}
|
||||
if (!searchMethodParams.requests) {
|
||||
throw new Error("Parameter `searchMethodParams.requests` is required when calling `search`.");
|
||||
}
|
||||
const requestPath = "/1/indexes/*/queries";
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "POST",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers,
|
||||
data: searchMethodParams,
|
||||
useReadTransporter: true,
|
||||
cacheable: true
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// lite/builds/node.ts
|
||||
function liteClient(appId, apiKey, options) {
|
||||
if (!appId || typeof appId !== "string") {
|
||||
throw new Error("`appId` is missing.");
|
||||
}
|
||||
if (!apiKey || typeof apiKey !== "string") {
|
||||
throw new Error("`apiKey` is missing.");
|
||||
}
|
||||
return createLiteClient({
|
||||
appId,
|
||||
apiKey,
|
||||
timeouts: {
|
||||
connect: 2e3,
|
||||
read: 5e3,
|
||||
write: 3e4
|
||||
},
|
||||
logger: (0, import_client_common2.createNullLogger)(),
|
||||
requester: (0, import_requester_node_http.createHttpRequester)(),
|
||||
algoliaAgents: [{ segment: "Node.js", version: process.versions.node }],
|
||||
responsesCache: (0, import_client_common2.createNullCache)(),
|
||||
requestsCache: (0, import_client_common2.createNullCache)(),
|
||||
hostsCache: (0, import_client_common2.createMemoryCache)(),
|
||||
...options
|
||||
});
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
apiClientVersion,
|
||||
liteClient
|
||||
});
|
||||
//# sourceMappingURL=node.cjs.map
|
1
node_modules/algoliasearch/dist/lite/builds/node.cjs.map
generated
vendored
Normal file
1
node_modules/algoliasearch/dist/lite/builds/node.cjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
273
node_modules/algoliasearch/dist/lite/builds/node.js
generated
vendored
Normal file
273
node_modules/algoliasearch/dist/lite/builds/node.js
generated
vendored
Normal file
@@ -0,0 +1,273 @@
|
||||
// lite/builds/node.ts
|
||||
import { createHttpRequester } from "@algolia/requester-node-http";
|
||||
import { createMemoryCache, createNullCache, createNullLogger } from "@algolia/client-common";
|
||||
|
||||
// lite/src/liteClient.ts
|
||||
import { createAuth, createTransporter, getAlgoliaAgent, shuffle } from "@algolia/client-common";
|
||||
var apiClientVersion = "5.34.1";
|
||||
function getDefaultHosts(appId) {
|
||||
return [
|
||||
{
|
||||
url: `${appId}-dsn.algolia.net`,
|
||||
accept: "read",
|
||||
protocol: "https"
|
||||
},
|
||||
{
|
||||
url: `${appId}.algolia.net`,
|
||||
accept: "write",
|
||||
protocol: "https"
|
||||
}
|
||||
].concat(
|
||||
shuffle([
|
||||
{
|
||||
url: `${appId}-1.algolianet.com`,
|
||||
accept: "readWrite",
|
||||
protocol: "https"
|
||||
},
|
||||
{
|
||||
url: `${appId}-2.algolianet.com`,
|
||||
accept: "readWrite",
|
||||
protocol: "https"
|
||||
},
|
||||
{
|
||||
url: `${appId}-3.algolianet.com`,
|
||||
accept: "readWrite",
|
||||
protocol: "https"
|
||||
}
|
||||
])
|
||||
);
|
||||
}
|
||||
function createLiteClient({
|
||||
appId: appIdOption,
|
||||
apiKey: apiKeyOption,
|
||||
authMode,
|
||||
algoliaAgents,
|
||||
...options
|
||||
}) {
|
||||
const auth = createAuth(appIdOption, apiKeyOption, authMode);
|
||||
const transporter = createTransporter({
|
||||
hosts: getDefaultHosts(appIdOption),
|
||||
...options,
|
||||
algoliaAgent: getAlgoliaAgent({
|
||||
algoliaAgents,
|
||||
client: "Lite",
|
||||
version: apiClientVersion
|
||||
}),
|
||||
baseHeaders: {
|
||||
"content-type": "text/plain",
|
||||
...auth.headers(),
|
||||
...options.baseHeaders
|
||||
},
|
||||
baseQueryParameters: {
|
||||
...auth.queryParameters(),
|
||||
...options.baseQueryParameters
|
||||
}
|
||||
});
|
||||
return {
|
||||
transporter,
|
||||
/**
|
||||
* The `appId` currently in use.
|
||||
*/
|
||||
appId: appIdOption,
|
||||
/**
|
||||
* The `apiKey` currently in use.
|
||||
*/
|
||||
apiKey: apiKeyOption,
|
||||
/**
|
||||
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
||||
*/
|
||||
clearCache() {
|
||||
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0);
|
||||
},
|
||||
/**
|
||||
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
||||
*/
|
||||
get _ua() {
|
||||
return transporter.algoliaAgent.value;
|
||||
},
|
||||
/**
|
||||
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
||||
*
|
||||
* @param segment - The algolia agent (user-agent) segment to add.
|
||||
* @param version - The version of the agent.
|
||||
*/
|
||||
addAlgoliaAgent(segment, version) {
|
||||
transporter.algoliaAgent.add({ segment, version });
|
||||
},
|
||||
/**
|
||||
* Helper method to switch the API key used to authenticate the requests.
|
||||
*
|
||||
* @param params - Method params.
|
||||
* @param params.apiKey - The new API Key to use.
|
||||
*/
|
||||
setClientApiKey({ apiKey }) {
|
||||
if (!authMode || authMode === "WithinHeaders") {
|
||||
transporter.baseHeaders["x-algolia-api-key"] = apiKey;
|
||||
} else {
|
||||
transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Helper: calls the `search` method but with certainty that we will only request Algolia records (hits) and not facets.
|
||||
* 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.
|
||||
*
|
||||
* @summary Search multiple indices for `hits`.
|
||||
* @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
searchForHits(searchMethodParams, requestOptions) {
|
||||
return this.search(searchMethodParams, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Helper: calls the `search` method but with certainty that we will only request Algolia facets and not records (hits).
|
||||
* 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.
|
||||
*
|
||||
* @summary Search multiple indices for `facets`.
|
||||
* @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
searchForFacets(searchMethodParams, requestOptions) {
|
||||
return this.search(searchMethodParams, requestOptions);
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customPost - The customPost object.
|
||||
* @param customPost.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customPost.parameters - Query parameters to apply to the current query.
|
||||
* @param customPost.body - Parameters to send with the custom request.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customPost({ path, parameters, body }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customPost`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "POST",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers,
|
||||
data: body ? body : {}
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves recommendations from selected AI models.
|
||||
*
|
||||
* Required API Key ACLs:
|
||||
* - search
|
||||
* @param getRecommendationsParams - The getRecommendationsParams object.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getRecommendations(getRecommendationsParams, requestOptions) {
|
||||
if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {
|
||||
const newSignatureRequest = {
|
||||
requests: getRecommendationsParams
|
||||
};
|
||||
getRecommendationsParams = newSignatureRequest;
|
||||
}
|
||||
if (!getRecommendationsParams) {
|
||||
throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");
|
||||
}
|
||||
if (!getRecommendationsParams.requests) {
|
||||
throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");
|
||||
}
|
||||
const requestPath = "/1/indexes/*/recommendations";
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "POST",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers,
|
||||
data: getRecommendationsParams,
|
||||
useReadTransporter: true,
|
||||
cacheable: true
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* Required API Key ACLs:
|
||||
* - search
|
||||
* @param searchMethodParams - Muli-search request body. Results are returned in the same order as the requests.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
search(searchMethodParams, requestOptions) {
|
||||
if (searchMethodParams && Array.isArray(searchMethodParams)) {
|
||||
const newSignatureRequest = {
|
||||
requests: searchMethodParams.map(({ params, ...legacyRequest }) => {
|
||||
if (legacyRequest.type === "facet") {
|
||||
return {
|
||||
...legacyRequest,
|
||||
...params,
|
||||
type: "facet"
|
||||
};
|
||||
}
|
||||
return {
|
||||
...legacyRequest,
|
||||
...params,
|
||||
facet: void 0,
|
||||
maxFacetHits: void 0,
|
||||
facetQuery: void 0
|
||||
};
|
||||
})
|
||||
};
|
||||
searchMethodParams = newSignatureRequest;
|
||||
}
|
||||
if (!searchMethodParams) {
|
||||
throw new Error("Parameter `searchMethodParams` is required when calling `search`.");
|
||||
}
|
||||
if (!searchMethodParams.requests) {
|
||||
throw new Error("Parameter `searchMethodParams.requests` is required when calling `search`.");
|
||||
}
|
||||
const requestPath = "/1/indexes/*/queries";
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "POST",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers,
|
||||
data: searchMethodParams,
|
||||
useReadTransporter: true,
|
||||
cacheable: true
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// lite/builds/node.ts
|
||||
function liteClient(appId, apiKey, options) {
|
||||
if (!appId || typeof appId !== "string") {
|
||||
throw new Error("`appId` is missing.");
|
||||
}
|
||||
if (!apiKey || typeof apiKey !== "string") {
|
||||
throw new Error("`apiKey` is missing.");
|
||||
}
|
||||
return createLiteClient({
|
||||
appId,
|
||||
apiKey,
|
||||
timeouts: {
|
||||
connect: 2e3,
|
||||
read: 5e3,
|
||||
write: 3e4
|
||||
},
|
||||
logger: createNullLogger(),
|
||||
requester: createHttpRequester(),
|
||||
algoliaAgents: [{ segment: "Node.js", version: process.versions.node }],
|
||||
responsesCache: createNullCache(),
|
||||
requestsCache: createNullCache(),
|
||||
hostsCache: createMemoryCache(),
|
||||
...options
|
||||
});
|
||||
}
|
||||
export {
|
||||
apiClientVersion,
|
||||
liteClient
|
||||
};
|
||||
//# sourceMappingURL=node.js.map
|
1
node_modules/algoliasearch/dist/lite/builds/node.js.map
generated
vendored
Normal file
1
node_modules/algoliasearch/dist/lite/builds/node.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1757
node_modules/algoliasearch/dist/lite/node.d.cts
generated
vendored
Normal file
1757
node_modules/algoliasearch/dist/lite/node.d.cts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1757
node_modules/algoliasearch/dist/lite/node.d.ts
generated
vendored
Normal file
1757
node_modules/algoliasearch/dist/lite/node.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
269
node_modules/algoliasearch/dist/lite/src/liteClient.cjs
generated
vendored
Normal file
269
node_modules/algoliasearch/dist/lite/src/liteClient.cjs
generated
vendored
Normal file
@@ -0,0 +1,269 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// lite/src/liteClient.ts
|
||||
var liteClient_exports = {};
|
||||
__export(liteClient_exports, {
|
||||
apiClientVersion: () => apiClientVersion,
|
||||
createLiteClient: () => createLiteClient
|
||||
});
|
||||
module.exports = __toCommonJS(liteClient_exports);
|
||||
var import_client_common = require("@algolia/client-common");
|
||||
var apiClientVersion = "5.34.1";
|
||||
function getDefaultHosts(appId) {
|
||||
return [
|
||||
{
|
||||
url: `${appId}-dsn.algolia.net`,
|
||||
accept: "read",
|
||||
protocol: "https"
|
||||
},
|
||||
{
|
||||
url: `${appId}.algolia.net`,
|
||||
accept: "write",
|
||||
protocol: "https"
|
||||
}
|
||||
].concat(
|
||||
(0, import_client_common.shuffle)([
|
||||
{
|
||||
url: `${appId}-1.algolianet.com`,
|
||||
accept: "readWrite",
|
||||
protocol: "https"
|
||||
},
|
||||
{
|
||||
url: `${appId}-2.algolianet.com`,
|
||||
accept: "readWrite",
|
||||
protocol: "https"
|
||||
},
|
||||
{
|
||||
url: `${appId}-3.algolianet.com`,
|
||||
accept: "readWrite",
|
||||
protocol: "https"
|
||||
}
|
||||
])
|
||||
);
|
||||
}
|
||||
function createLiteClient({
|
||||
appId: appIdOption,
|
||||
apiKey: apiKeyOption,
|
||||
authMode,
|
||||
algoliaAgents,
|
||||
...options
|
||||
}) {
|
||||
const auth = (0, import_client_common.createAuth)(appIdOption, apiKeyOption, authMode);
|
||||
const transporter = (0, import_client_common.createTransporter)({
|
||||
hosts: getDefaultHosts(appIdOption),
|
||||
...options,
|
||||
algoliaAgent: (0, import_client_common.getAlgoliaAgent)({
|
||||
algoliaAgents,
|
||||
client: "Lite",
|
||||
version: apiClientVersion
|
||||
}),
|
||||
baseHeaders: {
|
||||
"content-type": "text/plain",
|
||||
...auth.headers(),
|
||||
...options.baseHeaders
|
||||
},
|
||||
baseQueryParameters: {
|
||||
...auth.queryParameters(),
|
||||
...options.baseQueryParameters
|
||||
}
|
||||
});
|
||||
return {
|
||||
transporter,
|
||||
/**
|
||||
* The `appId` currently in use.
|
||||
*/
|
||||
appId: appIdOption,
|
||||
/**
|
||||
* The `apiKey` currently in use.
|
||||
*/
|
||||
apiKey: apiKeyOption,
|
||||
/**
|
||||
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
||||
*/
|
||||
clearCache() {
|
||||
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0);
|
||||
},
|
||||
/**
|
||||
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
||||
*/
|
||||
get _ua() {
|
||||
return transporter.algoliaAgent.value;
|
||||
},
|
||||
/**
|
||||
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
||||
*
|
||||
* @param segment - The algolia agent (user-agent) segment to add.
|
||||
* @param version - The version of the agent.
|
||||
*/
|
||||
addAlgoliaAgent(segment, version) {
|
||||
transporter.algoliaAgent.add({ segment, version });
|
||||
},
|
||||
/**
|
||||
* Helper method to switch the API key used to authenticate the requests.
|
||||
*
|
||||
* @param params - Method params.
|
||||
* @param params.apiKey - The new API Key to use.
|
||||
*/
|
||||
setClientApiKey({ apiKey }) {
|
||||
if (!authMode || authMode === "WithinHeaders") {
|
||||
transporter.baseHeaders["x-algolia-api-key"] = apiKey;
|
||||
} else {
|
||||
transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Helper: calls the `search` method but with certainty that we will only request Algolia records (hits) and not facets.
|
||||
* 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.
|
||||
*
|
||||
* @summary Search multiple indices for `hits`.
|
||||
* @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
searchForHits(searchMethodParams, requestOptions) {
|
||||
return this.search(searchMethodParams, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Helper: calls the `search` method but with certainty that we will only request Algolia facets and not records (hits).
|
||||
* 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.
|
||||
*
|
||||
* @summary Search multiple indices for `facets`.
|
||||
* @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
searchForFacets(searchMethodParams, requestOptions) {
|
||||
return this.search(searchMethodParams, requestOptions);
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customPost - The customPost object.
|
||||
* @param customPost.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customPost.parameters - Query parameters to apply to the current query.
|
||||
* @param customPost.body - Parameters to send with the custom request.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customPost({ path, parameters, body }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customPost`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "POST",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers,
|
||||
data: body ? body : {}
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves recommendations from selected AI models.
|
||||
*
|
||||
* Required API Key ACLs:
|
||||
* - search
|
||||
* @param getRecommendationsParams - The getRecommendationsParams object.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getRecommendations(getRecommendationsParams, requestOptions) {
|
||||
if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {
|
||||
const newSignatureRequest = {
|
||||
requests: getRecommendationsParams
|
||||
};
|
||||
getRecommendationsParams = newSignatureRequest;
|
||||
}
|
||||
if (!getRecommendationsParams) {
|
||||
throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");
|
||||
}
|
||||
if (!getRecommendationsParams.requests) {
|
||||
throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");
|
||||
}
|
||||
const requestPath = "/1/indexes/*/recommendations";
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "POST",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers,
|
||||
data: getRecommendationsParams,
|
||||
useReadTransporter: true,
|
||||
cacheable: true
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* Required API Key ACLs:
|
||||
* - search
|
||||
* @param searchMethodParams - Muli-search request body. Results are returned in the same order as the requests.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
search(searchMethodParams, requestOptions) {
|
||||
if (searchMethodParams && Array.isArray(searchMethodParams)) {
|
||||
const newSignatureRequest = {
|
||||
requests: searchMethodParams.map(({ params, ...legacyRequest }) => {
|
||||
if (legacyRequest.type === "facet") {
|
||||
return {
|
||||
...legacyRequest,
|
||||
...params,
|
||||
type: "facet"
|
||||
};
|
||||
}
|
||||
return {
|
||||
...legacyRequest,
|
||||
...params,
|
||||
facet: void 0,
|
||||
maxFacetHits: void 0,
|
||||
facetQuery: void 0
|
||||
};
|
||||
})
|
||||
};
|
||||
searchMethodParams = newSignatureRequest;
|
||||
}
|
||||
if (!searchMethodParams) {
|
||||
throw new Error("Parameter `searchMethodParams` is required when calling `search`.");
|
||||
}
|
||||
if (!searchMethodParams.requests) {
|
||||
throw new Error("Parameter `searchMethodParams.requests` is required when calling `search`.");
|
||||
}
|
||||
const requestPath = "/1/indexes/*/queries";
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "POST",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers,
|
||||
data: searchMethodParams,
|
||||
useReadTransporter: true,
|
||||
cacheable: true
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
}
|
||||
};
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
apiClientVersion,
|
||||
createLiteClient
|
||||
});
|
||||
//# sourceMappingURL=liteClient.cjs.map
|
1
node_modules/algoliasearch/dist/lite/src/liteClient.cjs.map
generated
vendored
Normal file
1
node_modules/algoliasearch/dist/lite/src/liteClient.cjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
243
node_modules/algoliasearch/dist/lite/src/liteClient.js
generated
vendored
Normal file
243
node_modules/algoliasearch/dist/lite/src/liteClient.js
generated
vendored
Normal file
@@ -0,0 +1,243 @@
|
||||
// lite/src/liteClient.ts
|
||||
import { createAuth, createTransporter, getAlgoliaAgent, shuffle } from "@algolia/client-common";
|
||||
var apiClientVersion = "5.34.1";
|
||||
function getDefaultHosts(appId) {
|
||||
return [
|
||||
{
|
||||
url: `${appId}-dsn.algolia.net`,
|
||||
accept: "read",
|
||||
protocol: "https"
|
||||
},
|
||||
{
|
||||
url: `${appId}.algolia.net`,
|
||||
accept: "write",
|
||||
protocol: "https"
|
||||
}
|
||||
].concat(
|
||||
shuffle([
|
||||
{
|
||||
url: `${appId}-1.algolianet.com`,
|
||||
accept: "readWrite",
|
||||
protocol: "https"
|
||||
},
|
||||
{
|
||||
url: `${appId}-2.algolianet.com`,
|
||||
accept: "readWrite",
|
||||
protocol: "https"
|
||||
},
|
||||
{
|
||||
url: `${appId}-3.algolianet.com`,
|
||||
accept: "readWrite",
|
||||
protocol: "https"
|
||||
}
|
||||
])
|
||||
);
|
||||
}
|
||||
function createLiteClient({
|
||||
appId: appIdOption,
|
||||
apiKey: apiKeyOption,
|
||||
authMode,
|
||||
algoliaAgents,
|
||||
...options
|
||||
}) {
|
||||
const auth = createAuth(appIdOption, apiKeyOption, authMode);
|
||||
const transporter = createTransporter({
|
||||
hosts: getDefaultHosts(appIdOption),
|
||||
...options,
|
||||
algoliaAgent: getAlgoliaAgent({
|
||||
algoliaAgents,
|
||||
client: "Lite",
|
||||
version: apiClientVersion
|
||||
}),
|
||||
baseHeaders: {
|
||||
"content-type": "text/plain",
|
||||
...auth.headers(),
|
||||
...options.baseHeaders
|
||||
},
|
||||
baseQueryParameters: {
|
||||
...auth.queryParameters(),
|
||||
...options.baseQueryParameters
|
||||
}
|
||||
});
|
||||
return {
|
||||
transporter,
|
||||
/**
|
||||
* The `appId` currently in use.
|
||||
*/
|
||||
appId: appIdOption,
|
||||
/**
|
||||
* The `apiKey` currently in use.
|
||||
*/
|
||||
apiKey: apiKeyOption,
|
||||
/**
|
||||
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
||||
*/
|
||||
clearCache() {
|
||||
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0);
|
||||
},
|
||||
/**
|
||||
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
||||
*/
|
||||
get _ua() {
|
||||
return transporter.algoliaAgent.value;
|
||||
},
|
||||
/**
|
||||
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
||||
*
|
||||
* @param segment - The algolia agent (user-agent) segment to add.
|
||||
* @param version - The version of the agent.
|
||||
*/
|
||||
addAlgoliaAgent(segment, version) {
|
||||
transporter.algoliaAgent.add({ segment, version });
|
||||
},
|
||||
/**
|
||||
* Helper method to switch the API key used to authenticate the requests.
|
||||
*
|
||||
* @param params - Method params.
|
||||
* @param params.apiKey - The new API Key to use.
|
||||
*/
|
||||
setClientApiKey({ apiKey }) {
|
||||
if (!authMode || authMode === "WithinHeaders") {
|
||||
transporter.baseHeaders["x-algolia-api-key"] = apiKey;
|
||||
} else {
|
||||
transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Helper: calls the `search` method but with certainty that we will only request Algolia records (hits) and not facets.
|
||||
* 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.
|
||||
*
|
||||
* @summary Search multiple indices for `hits`.
|
||||
* @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
searchForHits(searchMethodParams, requestOptions) {
|
||||
return this.search(searchMethodParams, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Helper: calls the `search` method but with certainty that we will only request Algolia facets and not records (hits).
|
||||
* 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.
|
||||
*
|
||||
* @summary Search multiple indices for `facets`.
|
||||
* @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
searchForFacets(searchMethodParams, requestOptions) {
|
||||
return this.search(searchMethodParams, requestOptions);
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customPost - The customPost object.
|
||||
* @param customPost.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customPost.parameters - Query parameters to apply to the current query.
|
||||
* @param customPost.body - Parameters to send with the custom request.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customPost({ path, parameters, body }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customPost`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "POST",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers,
|
||||
data: body ? body : {}
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves recommendations from selected AI models.
|
||||
*
|
||||
* Required API Key ACLs:
|
||||
* - search
|
||||
* @param getRecommendationsParams - The getRecommendationsParams object.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getRecommendations(getRecommendationsParams, requestOptions) {
|
||||
if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {
|
||||
const newSignatureRequest = {
|
||||
requests: getRecommendationsParams
|
||||
};
|
||||
getRecommendationsParams = newSignatureRequest;
|
||||
}
|
||||
if (!getRecommendationsParams) {
|
||||
throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");
|
||||
}
|
||||
if (!getRecommendationsParams.requests) {
|
||||
throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");
|
||||
}
|
||||
const requestPath = "/1/indexes/*/recommendations";
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "POST",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers,
|
||||
data: getRecommendationsParams,
|
||||
useReadTransporter: true,
|
||||
cacheable: true
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* Required API Key ACLs:
|
||||
* - search
|
||||
* @param searchMethodParams - Muli-search request body. Results are returned in the same order as the requests.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
search(searchMethodParams, requestOptions) {
|
||||
if (searchMethodParams && Array.isArray(searchMethodParams)) {
|
||||
const newSignatureRequest = {
|
||||
requests: searchMethodParams.map(({ params, ...legacyRequest }) => {
|
||||
if (legacyRequest.type === "facet") {
|
||||
return {
|
||||
...legacyRequest,
|
||||
...params,
|
||||
type: "facet"
|
||||
};
|
||||
}
|
||||
return {
|
||||
...legacyRequest,
|
||||
...params,
|
||||
facet: void 0,
|
||||
maxFacetHits: void 0,
|
||||
facetQuery: void 0
|
||||
};
|
||||
})
|
||||
};
|
||||
searchMethodParams = newSignatureRequest;
|
||||
}
|
||||
if (!searchMethodParams) {
|
||||
throw new Error("Parameter `searchMethodParams` is required when calling `search`.");
|
||||
}
|
||||
if (!searchMethodParams.requests) {
|
||||
throw new Error("Parameter `searchMethodParams.requests` is required when calling `search`.");
|
||||
}
|
||||
const requestPath = "/1/indexes/*/queries";
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "POST",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers,
|
||||
data: searchMethodParams,
|
||||
useReadTransporter: true,
|
||||
cacheable: true
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
}
|
||||
};
|
||||
}
|
||||
export {
|
||||
apiClientVersion,
|
||||
createLiteClient
|
||||
};
|
||||
//# sourceMappingURL=liteClient.js.map
|
1
node_modules/algoliasearch/dist/lite/src/liteClient.js.map
generated
vendored
Normal file
1
node_modules/algoliasearch/dist/lite/src/liteClient.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
236
node_modules/algoliasearch/dist/node.cjs
generated
vendored
Normal file
236
node_modules/algoliasearch/dist/node.cjs
generated
vendored
Normal file
@@ -0,0 +1,236 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// builds/node.ts
|
||||
var node_exports = {};
|
||||
__export(node_exports, {
|
||||
algoliasearch: () => algoliasearch,
|
||||
apiClientVersion: () => import_client_search.apiClientVersion
|
||||
});
|
||||
module.exports = __toCommonJS(node_exports);
|
||||
var import_client_abtesting = require("@algolia/client-abtesting");
|
||||
var import_client_analytics = require("@algolia/client-analytics");
|
||||
var import_client_insights = require("@algolia/client-insights");
|
||||
var import_client_personalization = require("@algolia/client-personalization");
|
||||
var import_client_query_suggestions = require("@algolia/client-query-suggestions");
|
||||
var import_client_search2 = require("@algolia/client-search");
|
||||
var import_ingestion = require("@algolia/ingestion");
|
||||
var import_monitoring = require("@algolia/monitoring");
|
||||
var import_recommend = require("@algolia/recommend");
|
||||
|
||||
// builds/models.ts
|
||||
var models_exports = {};
|
||||
__export(models_exports, {
|
||||
apiClientVersion: () => import_client_search.apiClientVersion
|
||||
});
|
||||
var import_client_search = require("@algolia/client-search");
|
||||
__reExport(models_exports, require("@algolia/client-abtesting"));
|
||||
__reExport(models_exports, require("@algolia/client-analytics"));
|
||||
__reExport(models_exports, require("@algolia/client-insights"));
|
||||
__reExport(models_exports, require("@algolia/client-personalization"));
|
||||
__reExport(models_exports, require("@algolia/client-query-suggestions"));
|
||||
__reExport(models_exports, require("@algolia/client-search"));
|
||||
__reExport(models_exports, require("@algolia/ingestion"));
|
||||
__reExport(models_exports, require("@algolia/monitoring"));
|
||||
__reExport(models_exports, require("@algolia/recommend"));
|
||||
|
||||
// builds/node.ts
|
||||
__reExport(node_exports, models_exports, module.exports);
|
||||
function algoliasearch(appId, apiKey, options) {
|
||||
if (!appId || typeof appId !== "string") {
|
||||
throw new Error("`appId` is missing.");
|
||||
}
|
||||
if (!apiKey || typeof apiKey !== "string") {
|
||||
throw new Error("`apiKey` is missing.");
|
||||
}
|
||||
const client = (0, import_client_search2.searchClient)(appId, apiKey, options);
|
||||
let ingestionTransporter;
|
||||
if (options == null ? void 0 : options.transformation) {
|
||||
if (!options.transformation.region) {
|
||||
throw new Error("`region` must be provided when leveraging the transformation pipeline");
|
||||
}
|
||||
ingestionTransporter = (0, import_ingestion.ingestionClient)(appId, apiKey, options.transformation.region, options);
|
||||
}
|
||||
return {
|
||||
...client,
|
||||
async saveObjectsWithTransformation({ indexName, objects, waitForTasks }, requestOptions) {
|
||||
var _a;
|
||||
if (!ingestionTransporter) {
|
||||
throw new Error("`transformation.region` must be provided at client instantiation before calling this method.");
|
||||
}
|
||||
if (!((_a = options == null ? void 0 : options.transformation) == null ? void 0 : _a.region)) {
|
||||
throw new Error("`region` must be provided when leveraging the transformation pipeline");
|
||||
}
|
||||
return ingestionTransporter.chunkedPush(
|
||||
{ indexName, objects, action: "addObject", waitForTasks },
|
||||
requestOptions
|
||||
);
|
||||
},
|
||||
async partialUpdateObjectsWithTransformation({ indexName, objects, createIfNotExists, waitForTasks }, requestOptions) {
|
||||
var _a;
|
||||
if (!ingestionTransporter) {
|
||||
throw new Error("`transformation.region` must be provided at client instantiation before calling this method.");
|
||||
}
|
||||
if (!((_a = options == null ? void 0 : options.transformation) == null ? void 0 : _a.region)) {
|
||||
throw new Error("`region` must be provided when leveraging the transformation pipeline");
|
||||
}
|
||||
return ingestionTransporter.chunkedPush(
|
||||
{
|
||||
indexName,
|
||||
objects,
|
||||
action: createIfNotExists ? "partialUpdateObject" : "partialUpdateObjectNoCreate",
|
||||
waitForTasks
|
||||
},
|
||||
requestOptions
|
||||
);
|
||||
},
|
||||
async replaceAllObjectsWithTransformation({ indexName, objects, batchSize, scopes }, requestOptions) {
|
||||
var _a;
|
||||
if (!ingestionTransporter) {
|
||||
throw new Error("`transformation.region` must be provided at client instantiation before calling this method.");
|
||||
}
|
||||
if (!((_a = options == null ? void 0 : options.transformation) == null ? void 0 : _a.region)) {
|
||||
throw new Error("`region` must be provided when leveraging the transformation pipeline");
|
||||
}
|
||||
const randomSuffix = Math.floor(Math.random() * 1e6) + 1e5;
|
||||
const tmpIndexName = `${indexName}_tmp_${randomSuffix}`;
|
||||
if (scopes === void 0) {
|
||||
scopes = ["settings", "rules", "synonyms"];
|
||||
}
|
||||
try {
|
||||
let copyOperationResponse = await this.operationIndex(
|
||||
{
|
||||
indexName,
|
||||
operationIndexParams: {
|
||||
operation: "copy",
|
||||
destination: tmpIndexName,
|
||||
scope: scopes
|
||||
}
|
||||
},
|
||||
requestOptions
|
||||
);
|
||||
const watchResponses = await ingestionTransporter.chunkedPush(
|
||||
{ indexName: tmpIndexName, objects, waitForTasks: true, batchSize, referenceIndexName: indexName },
|
||||
requestOptions
|
||||
);
|
||||
await this.waitForTask({
|
||||
indexName: tmpIndexName,
|
||||
taskID: copyOperationResponse.taskID
|
||||
});
|
||||
copyOperationResponse = await this.operationIndex(
|
||||
{
|
||||
indexName,
|
||||
operationIndexParams: {
|
||||
operation: "copy",
|
||||
destination: tmpIndexName,
|
||||
scope: scopes
|
||||
}
|
||||
},
|
||||
requestOptions
|
||||
);
|
||||
await this.waitForTask({
|
||||
indexName: tmpIndexName,
|
||||
taskID: copyOperationResponse.taskID
|
||||
});
|
||||
const moveOperationResponse = await this.operationIndex(
|
||||
{
|
||||
indexName: tmpIndexName,
|
||||
operationIndexParams: { operation: "move", destination: indexName }
|
||||
},
|
||||
requestOptions
|
||||
);
|
||||
await this.waitForTask({
|
||||
indexName: tmpIndexName,
|
||||
taskID: moveOperationResponse.taskID
|
||||
});
|
||||
return { copyOperationResponse, watchResponses, moveOperationResponse };
|
||||
} catch (error) {
|
||||
await this.deleteIndex({ indexName: tmpIndexName });
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
||||
*/
|
||||
get _ua() {
|
||||
return client.transporter.algoliaAgent.value;
|
||||
},
|
||||
initAbtesting: (initOptions) => {
|
||||
return (0, import_client_abtesting.abtestingClient)(
|
||||
initOptions.appId || appId,
|
||||
initOptions.apiKey || apiKey,
|
||||
initOptions.region,
|
||||
initOptions.options
|
||||
);
|
||||
},
|
||||
initAnalytics: (initOptions) => {
|
||||
return (0, import_client_analytics.analyticsClient)(
|
||||
initOptions.appId || appId,
|
||||
initOptions.apiKey || apiKey,
|
||||
initOptions.region,
|
||||
initOptions.options
|
||||
);
|
||||
},
|
||||
initIngestion: (initOptions) => {
|
||||
return (0, import_ingestion.ingestionClient)(
|
||||
initOptions.appId || appId,
|
||||
initOptions.apiKey || apiKey,
|
||||
initOptions.region,
|
||||
initOptions.options
|
||||
);
|
||||
},
|
||||
initInsights: (initOptions) => {
|
||||
return (0, import_client_insights.insightsClient)(
|
||||
initOptions.appId || appId,
|
||||
initOptions.apiKey || apiKey,
|
||||
initOptions.region,
|
||||
initOptions.options
|
||||
);
|
||||
},
|
||||
initMonitoring: (initOptions = {}) => {
|
||||
return (0, import_monitoring.monitoringClient)(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);
|
||||
},
|
||||
initPersonalization: (initOptions) => {
|
||||
return (0, import_client_personalization.personalizationClient)(
|
||||
initOptions.appId || appId,
|
||||
initOptions.apiKey || apiKey,
|
||||
initOptions.region,
|
||||
initOptions.options
|
||||
);
|
||||
},
|
||||
initQuerySuggestions: (initOptions) => {
|
||||
return (0, import_client_query_suggestions.querySuggestionsClient)(
|
||||
initOptions.appId || appId,
|
||||
initOptions.apiKey || apiKey,
|
||||
initOptions.region,
|
||||
initOptions.options
|
||||
);
|
||||
},
|
||||
initRecommend: (initOptions = {}) => {
|
||||
return (0, import_recommend.recommendClient)(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);
|
||||
}
|
||||
};
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
algoliasearch,
|
||||
apiClientVersion
|
||||
});
|
||||
//# sourceMappingURL=node.cjs.map
|
1
node_modules/algoliasearch/dist/node.cjs.map
generated
vendored
Normal file
1
node_modules/algoliasearch/dist/node.cjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
100
node_modules/algoliasearch/dist/node.d.cts
generated
vendored
Normal file
100
node_modules/algoliasearch/dist/node.d.cts
generated
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
import { ClientOptions, RequestOptions } from '@algolia/client-common';
|
||||
import { Region as Region$1, RegionOptions as RegionOptions$1, AbtestingClient } from '@algolia/client-abtesting';
|
||||
export * from '@algolia/client-abtesting';
|
||||
export { Region as AbtestingRegion, RegionOptions as AbtestingRegionOptions, Status } from '@algolia/client-abtesting';
|
||||
import { Region as Region$2, RegionOptions as RegionOptions$2, AnalyticsClient } from '@algolia/client-analytics';
|
||||
export * from '@algolia/client-analytics';
|
||||
export { Region as AnalyticsRegion, RegionOptions as AnalyticsRegionOptions } from '@algolia/client-analytics';
|
||||
import { Region as Region$4, RegionOptions as RegionOptions$4, InsightsClient } from '@algolia/client-insights';
|
||||
export * from '@algolia/client-insights';
|
||||
export { Region as InsightsRegion, RegionOptions as InsightsRegionOptions } from '@algolia/client-insights';
|
||||
import { Region as Region$5, RegionOptions as RegionOptions$5, PersonalizationClient } from '@algolia/client-personalization';
|
||||
export * from '@algolia/client-personalization';
|
||||
export { EventType, Region as PersonalizationRegion, RegionOptions as PersonalizationRegionOptions } from '@algolia/client-personalization';
|
||||
import { Region as Region$6, RegionOptions as RegionOptions$6, QuerySuggestionsClient } from '@algolia/client-query-suggestions';
|
||||
export * from '@algolia/client-query-suggestions';
|
||||
export { Region as QuerySuggestionsRegion, RegionOptions as QuerySuggestionsRegionOptions } from '@algolia/client-query-suggestions';
|
||||
import { SearchClient, SaveObjectsOptions, PartialUpdateObjectsOptions, ReplaceAllObjectsOptions, ReplaceAllObjectsWithTransformationResponse } from '@algolia/client-search';
|
||||
export * from '@algolia/client-search';
|
||||
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';
|
||||
import { Region as Region$3, RegionOptions as RegionOptions$3, IngestionClient, WatchResponse } from '@algolia/ingestion';
|
||||
export * from '@algolia/ingestion';
|
||||
export { Event, EventStatus, Region as IngestionRegion, RegionOptions as IngestionRegionOptions, WatchResponse } from '@algolia/ingestion';
|
||||
import { MonitoringClient } from '@algolia/monitoring';
|
||||
export * from '@algolia/monitoring';
|
||||
import { RecommendClient } from '@algolia/recommend';
|
||||
export * from '@algolia/recommend';
|
||||
|
||||
type Region = Region$1 | Region$2 | Region$3 | Region$4 | Region$5 | Region$6;
|
||||
type RegionOptions = RegionOptions$1 | RegionOptions$2 | RegionOptions$3 | RegionOptions$4 | RegionOptions$5 | RegionOptions$6;
|
||||
|
||||
/**
|
||||
* Options forwarded to the client initialized via the `init` method.
|
||||
*/
|
||||
type InitClientOptions = Partial<{
|
||||
/**
|
||||
* App to target with the initialized client, defaults to the `algoliasearch` appId.
|
||||
*/
|
||||
appId: string;
|
||||
/**
|
||||
* API key of the targeted app ID, defaults to the `algoliasearch` apiKey.
|
||||
*/
|
||||
apiKey: string;
|
||||
options: ClientOptions;
|
||||
}>;
|
||||
|
||||
type Algoliasearch = SearchClient & {
|
||||
initAbtesting: (initOptions: InitClientOptions & RegionOptions$1) => AbtestingClient;
|
||||
initAnalytics: (initOptions: InitClientOptions & RegionOptions$2) => AnalyticsClient;
|
||||
initIngestion: (initOptions: InitClientOptions & RegionOptions$3) => IngestionClient;
|
||||
initInsights: (initOptions: InitClientOptions & RegionOptions$4) => InsightsClient;
|
||||
initMonitoring: (initOptions?: InitClientOptions) => MonitoringClient;
|
||||
initPersonalization: (initOptions: InitClientOptions & RegionOptions$5) => PersonalizationClient;
|
||||
initQuerySuggestions: (initOptions: InitClientOptions & RegionOptions$6) => QuerySuggestionsClient;
|
||||
initRecommend: (initOptions?: InitClientOptions) => RecommendClient;
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @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/).
|
||||
* @param saveObjects - The `saveObjects` object.
|
||||
* @param saveObjects.indexName - The `indexName` to save `objects` in.
|
||||
* @param saveObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
|
||||
* @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.
|
||||
* @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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `push` method and merged with the transporter requestOptions.
|
||||
*/
|
||||
saveObjectsWithTransformation: (options: SaveObjectsOptions, requestOptions?: RequestOptions | undefined) => Promise<Array<WatchResponse>>;
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @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/).
|
||||
* @param partialUpdateObjects - The `partialUpdateObjects` object.
|
||||
* @param partialUpdateObjects.indexName - The `indexName` to update `objects` in.
|
||||
* @param partialUpdateObjects.objects - The array of `objects` to update in the given Algolia `indexName`.
|
||||
* @param partialUpdateObjects.createIfNotExists - To be provided if non-existing objects are passed, otherwise, the call will fail..
|
||||
* @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.
|
||||
* @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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `push` method and merged with the transporter requestOptions.
|
||||
*/
|
||||
partialUpdateObjectsWithTransformation: (options: PartialUpdateObjectsOptions, requestOptions?: RequestOptions | undefined) => Promise<Array<WatchResponse>>;
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @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.
|
||||
* @param replaceAllObjects - The `replaceAllObjects` object.
|
||||
* @param replaceAllObjects.indexName - The `indexName` to replace `objects` in.
|
||||
* @param replaceAllObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
|
||||
* @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.
|
||||
* @param replaceAllObjects.scopes - The `scopes` to keep from the index. Defaults to ['settings', 'rules', 'synonyms'].
|
||||
* @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.
|
||||
*/
|
||||
replaceAllObjectsWithTransformation: (options: ReplaceAllObjectsOptions, requestOptions?: RequestOptions | undefined) => Promise<ReplaceAllObjectsWithTransformationResponse>;
|
||||
};
|
||||
type TransformationOptions = {
|
||||
transformation?: {
|
||||
region: Region$3;
|
||||
} | undefined;
|
||||
};
|
||||
declare function algoliasearch(appId: string, apiKey: string, options?: (ClientOptions & TransformationOptions) | undefined): Algoliasearch;
|
||||
|
||||
export { type Algoliasearch, type InitClientOptions, type Region, type RegionOptions, type TransformationOptions, algoliasearch };
|
100
node_modules/algoliasearch/dist/node.d.ts
generated
vendored
Normal file
100
node_modules/algoliasearch/dist/node.d.ts
generated
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
import { ClientOptions, RequestOptions } from '@algolia/client-common';
|
||||
import { Region as Region$1, RegionOptions as RegionOptions$1, AbtestingClient } from '@algolia/client-abtesting';
|
||||
export * from '@algolia/client-abtesting';
|
||||
export { Region as AbtestingRegion, RegionOptions as AbtestingRegionOptions, Status } from '@algolia/client-abtesting';
|
||||
import { Region as Region$2, RegionOptions as RegionOptions$2, AnalyticsClient } from '@algolia/client-analytics';
|
||||
export * from '@algolia/client-analytics';
|
||||
export { Region as AnalyticsRegion, RegionOptions as AnalyticsRegionOptions } from '@algolia/client-analytics';
|
||||
import { Region as Region$4, RegionOptions as RegionOptions$4, InsightsClient } from '@algolia/client-insights';
|
||||
export * from '@algolia/client-insights';
|
||||
export { Region as InsightsRegion, RegionOptions as InsightsRegionOptions } from '@algolia/client-insights';
|
||||
import { Region as Region$5, RegionOptions as RegionOptions$5, PersonalizationClient } from '@algolia/client-personalization';
|
||||
export * from '@algolia/client-personalization';
|
||||
export { EventType, Region as PersonalizationRegion, RegionOptions as PersonalizationRegionOptions } from '@algolia/client-personalization';
|
||||
import { Region as Region$6, RegionOptions as RegionOptions$6, QuerySuggestionsClient } from '@algolia/client-query-suggestions';
|
||||
export * from '@algolia/client-query-suggestions';
|
||||
export { Region as QuerySuggestionsRegion, RegionOptions as QuerySuggestionsRegionOptions } from '@algolia/client-query-suggestions';
|
||||
import { SearchClient, SaveObjectsOptions, PartialUpdateObjectsOptions, ReplaceAllObjectsOptions, ReplaceAllObjectsWithTransformationResponse } from '@algolia/client-search';
|
||||
export * from '@algolia/client-search';
|
||||
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';
|
||||
import { Region as Region$3, RegionOptions as RegionOptions$3, IngestionClient, WatchResponse } from '@algolia/ingestion';
|
||||
export * from '@algolia/ingestion';
|
||||
export { Event, EventStatus, Region as IngestionRegion, RegionOptions as IngestionRegionOptions, WatchResponse } from '@algolia/ingestion';
|
||||
import { MonitoringClient } from '@algolia/monitoring';
|
||||
export * from '@algolia/monitoring';
|
||||
import { RecommendClient } from '@algolia/recommend';
|
||||
export * from '@algolia/recommend';
|
||||
|
||||
type Region = Region$1 | Region$2 | Region$3 | Region$4 | Region$5 | Region$6;
|
||||
type RegionOptions = RegionOptions$1 | RegionOptions$2 | RegionOptions$3 | RegionOptions$4 | RegionOptions$5 | RegionOptions$6;
|
||||
|
||||
/**
|
||||
* Options forwarded to the client initialized via the `init` method.
|
||||
*/
|
||||
type InitClientOptions = Partial<{
|
||||
/**
|
||||
* App to target with the initialized client, defaults to the `algoliasearch` appId.
|
||||
*/
|
||||
appId: string;
|
||||
/**
|
||||
* API key of the targeted app ID, defaults to the `algoliasearch` apiKey.
|
||||
*/
|
||||
apiKey: string;
|
||||
options: ClientOptions;
|
||||
}>;
|
||||
|
||||
type Algoliasearch = SearchClient & {
|
||||
initAbtesting: (initOptions: InitClientOptions & RegionOptions$1) => AbtestingClient;
|
||||
initAnalytics: (initOptions: InitClientOptions & RegionOptions$2) => AnalyticsClient;
|
||||
initIngestion: (initOptions: InitClientOptions & RegionOptions$3) => IngestionClient;
|
||||
initInsights: (initOptions: InitClientOptions & RegionOptions$4) => InsightsClient;
|
||||
initMonitoring: (initOptions?: InitClientOptions) => MonitoringClient;
|
||||
initPersonalization: (initOptions: InitClientOptions & RegionOptions$5) => PersonalizationClient;
|
||||
initQuerySuggestions: (initOptions: InitClientOptions & RegionOptions$6) => QuerySuggestionsClient;
|
||||
initRecommend: (initOptions?: InitClientOptions) => RecommendClient;
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @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/).
|
||||
* @param saveObjects - The `saveObjects` object.
|
||||
* @param saveObjects.indexName - The `indexName` to save `objects` in.
|
||||
* @param saveObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
|
||||
* @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.
|
||||
* @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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `push` method and merged with the transporter requestOptions.
|
||||
*/
|
||||
saveObjectsWithTransformation: (options: SaveObjectsOptions, requestOptions?: RequestOptions | undefined) => Promise<Array<WatchResponse>>;
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @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/).
|
||||
* @param partialUpdateObjects - The `partialUpdateObjects` object.
|
||||
* @param partialUpdateObjects.indexName - The `indexName` to update `objects` in.
|
||||
* @param partialUpdateObjects.objects - The array of `objects` to update in the given Algolia `indexName`.
|
||||
* @param partialUpdateObjects.createIfNotExists - To be provided if non-existing objects are passed, otherwise, the call will fail..
|
||||
* @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.
|
||||
* @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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `push` method and merged with the transporter requestOptions.
|
||||
*/
|
||||
partialUpdateObjectsWithTransformation: (options: PartialUpdateObjectsOptions, requestOptions?: RequestOptions | undefined) => Promise<Array<WatchResponse>>;
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @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.
|
||||
* @param replaceAllObjects - The `replaceAllObjects` object.
|
||||
* @param replaceAllObjects.indexName - The `indexName` to replace `objects` in.
|
||||
* @param replaceAllObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
|
||||
* @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.
|
||||
* @param replaceAllObjects.scopes - The `scopes` to keep from the index. Defaults to ['settings', 'rules', 'synonyms'].
|
||||
* @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.
|
||||
*/
|
||||
replaceAllObjectsWithTransformation: (options: ReplaceAllObjectsOptions, requestOptions?: RequestOptions | undefined) => Promise<ReplaceAllObjectsWithTransformationResponse>;
|
||||
};
|
||||
type TransformationOptions = {
|
||||
transformation?: {
|
||||
region: Region$3;
|
||||
} | undefined;
|
||||
};
|
||||
declare function algoliasearch(appId: string, apiKey: string, options?: (ClientOptions & TransformationOptions) | undefined): Algoliasearch;
|
||||
|
||||
export { type Algoliasearch, type InitClientOptions, type Region, type RegionOptions, type TransformationOptions, algoliasearch };
|
241
node_modules/algoliasearch/dist/node.js
generated
vendored
Normal file
241
node_modules/algoliasearch/dist/node.js
generated
vendored
Normal file
@@ -0,0 +1,241 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
||||
|
||||
// builds/node.ts
|
||||
var node_exports = {};
|
||||
__export(node_exports, {
|
||||
algoliasearch: () => algoliasearch,
|
||||
apiClientVersion: () => apiClientVersion
|
||||
});
|
||||
import { abtestingClient } from "@algolia/client-abtesting";
|
||||
import { analyticsClient } from "@algolia/client-analytics";
|
||||
import { insightsClient } from "@algolia/client-insights";
|
||||
import { personalizationClient } from "@algolia/client-personalization";
|
||||
import { querySuggestionsClient } from "@algolia/client-query-suggestions";
|
||||
import { searchClient } from "@algolia/client-search";
|
||||
import { ingestionClient } from "@algolia/ingestion";
|
||||
import { monitoringClient } from "@algolia/monitoring";
|
||||
import { recommendClient } from "@algolia/recommend";
|
||||
|
||||
// builds/models.ts
|
||||
var models_exports = {};
|
||||
__export(models_exports, {
|
||||
apiClientVersion: () => apiClientVersion
|
||||
});
|
||||
__reExport(models_exports, client_abtesting_star);
|
||||
__reExport(models_exports, client_analytics_star);
|
||||
__reExport(models_exports, client_insights_star);
|
||||
__reExport(models_exports, client_personalization_star);
|
||||
__reExport(models_exports, client_query_suggestions_star);
|
||||
__reExport(models_exports, client_search_star);
|
||||
__reExport(models_exports, ingestion_star);
|
||||
__reExport(models_exports, monitoring_star);
|
||||
__reExport(models_exports, recommend_star);
|
||||
import { apiClientVersion } from "@algolia/client-search";
|
||||
import * as client_abtesting_star from "@algolia/client-abtesting";
|
||||
import * as client_analytics_star from "@algolia/client-analytics";
|
||||
import * as client_insights_star from "@algolia/client-insights";
|
||||
import * as client_personalization_star from "@algolia/client-personalization";
|
||||
import * as client_query_suggestions_star from "@algolia/client-query-suggestions";
|
||||
import * as client_search_star from "@algolia/client-search";
|
||||
import * as ingestion_star from "@algolia/ingestion";
|
||||
import * as monitoring_star from "@algolia/monitoring";
|
||||
import * as recommend_star from "@algolia/recommend";
|
||||
|
||||
// builds/node.ts
|
||||
__reExport(node_exports, models_exports);
|
||||
function algoliasearch(appId, apiKey, options) {
|
||||
if (!appId || typeof appId !== "string") {
|
||||
throw new Error("`appId` is missing.");
|
||||
}
|
||||
if (!apiKey || typeof apiKey !== "string") {
|
||||
throw new Error("`apiKey` is missing.");
|
||||
}
|
||||
const client = searchClient(appId, apiKey, options);
|
||||
let ingestionTransporter;
|
||||
if (options == null ? void 0 : options.transformation) {
|
||||
if (!options.transformation.region) {
|
||||
throw new Error("`region` must be provided when leveraging the transformation pipeline");
|
||||
}
|
||||
ingestionTransporter = ingestionClient(appId, apiKey, options.transformation.region, options);
|
||||
}
|
||||
return {
|
||||
...client,
|
||||
async saveObjectsWithTransformation({ indexName, objects, waitForTasks }, requestOptions) {
|
||||
var _a;
|
||||
if (!ingestionTransporter) {
|
||||
throw new Error("`transformation.region` must be provided at client instantiation before calling this method.");
|
||||
}
|
||||
if (!((_a = options == null ? void 0 : options.transformation) == null ? void 0 : _a.region)) {
|
||||
throw new Error("`region` must be provided when leveraging the transformation pipeline");
|
||||
}
|
||||
return ingestionTransporter.chunkedPush(
|
||||
{ indexName, objects, action: "addObject", waitForTasks },
|
||||
requestOptions
|
||||
);
|
||||
},
|
||||
async partialUpdateObjectsWithTransformation({ indexName, objects, createIfNotExists, waitForTasks }, requestOptions) {
|
||||
var _a;
|
||||
if (!ingestionTransporter) {
|
||||
throw new Error("`transformation.region` must be provided at client instantiation before calling this method.");
|
||||
}
|
||||
if (!((_a = options == null ? void 0 : options.transformation) == null ? void 0 : _a.region)) {
|
||||
throw new Error("`region` must be provided when leveraging the transformation pipeline");
|
||||
}
|
||||
return ingestionTransporter.chunkedPush(
|
||||
{
|
||||
indexName,
|
||||
objects,
|
||||
action: createIfNotExists ? "partialUpdateObject" : "partialUpdateObjectNoCreate",
|
||||
waitForTasks
|
||||
},
|
||||
requestOptions
|
||||
);
|
||||
},
|
||||
async replaceAllObjectsWithTransformation({ indexName, objects, batchSize, scopes }, requestOptions) {
|
||||
var _a;
|
||||
if (!ingestionTransporter) {
|
||||
throw new Error("`transformation.region` must be provided at client instantiation before calling this method.");
|
||||
}
|
||||
if (!((_a = options == null ? void 0 : options.transformation) == null ? void 0 : _a.region)) {
|
||||
throw new Error("`region` must be provided when leveraging the transformation pipeline");
|
||||
}
|
||||
const randomSuffix = Math.floor(Math.random() * 1e6) + 1e5;
|
||||
const tmpIndexName = `${indexName}_tmp_${randomSuffix}`;
|
||||
if (scopes === void 0) {
|
||||
scopes = ["settings", "rules", "synonyms"];
|
||||
}
|
||||
try {
|
||||
let copyOperationResponse = await this.operationIndex(
|
||||
{
|
||||
indexName,
|
||||
operationIndexParams: {
|
||||
operation: "copy",
|
||||
destination: tmpIndexName,
|
||||
scope: scopes
|
||||
}
|
||||
},
|
||||
requestOptions
|
||||
);
|
||||
const watchResponses = await ingestionTransporter.chunkedPush(
|
||||
{ indexName: tmpIndexName, objects, waitForTasks: true, batchSize, referenceIndexName: indexName },
|
||||
requestOptions
|
||||
);
|
||||
await this.waitForTask({
|
||||
indexName: tmpIndexName,
|
||||
taskID: copyOperationResponse.taskID
|
||||
});
|
||||
copyOperationResponse = await this.operationIndex(
|
||||
{
|
||||
indexName,
|
||||
operationIndexParams: {
|
||||
operation: "copy",
|
||||
destination: tmpIndexName,
|
||||
scope: scopes
|
||||
}
|
||||
},
|
||||
requestOptions
|
||||
);
|
||||
await this.waitForTask({
|
||||
indexName: tmpIndexName,
|
||||
taskID: copyOperationResponse.taskID
|
||||
});
|
||||
const moveOperationResponse = await this.operationIndex(
|
||||
{
|
||||
indexName: tmpIndexName,
|
||||
operationIndexParams: { operation: "move", destination: indexName }
|
||||
},
|
||||
requestOptions
|
||||
);
|
||||
await this.waitForTask({
|
||||
indexName: tmpIndexName,
|
||||
taskID: moveOperationResponse.taskID
|
||||
});
|
||||
return { copyOperationResponse, watchResponses, moveOperationResponse };
|
||||
} catch (error) {
|
||||
await this.deleteIndex({ indexName: tmpIndexName });
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
||||
*/
|
||||
get _ua() {
|
||||
return client.transporter.algoliaAgent.value;
|
||||
},
|
||||
initAbtesting: (initOptions) => {
|
||||
return abtestingClient(
|
||||
initOptions.appId || appId,
|
||||
initOptions.apiKey || apiKey,
|
||||
initOptions.region,
|
||||
initOptions.options
|
||||
);
|
||||
},
|
||||
initAnalytics: (initOptions) => {
|
||||
return analyticsClient(
|
||||
initOptions.appId || appId,
|
||||
initOptions.apiKey || apiKey,
|
||||
initOptions.region,
|
||||
initOptions.options
|
||||
);
|
||||
},
|
||||
initIngestion: (initOptions) => {
|
||||
return ingestionClient(
|
||||
initOptions.appId || appId,
|
||||
initOptions.apiKey || apiKey,
|
||||
initOptions.region,
|
||||
initOptions.options
|
||||
);
|
||||
},
|
||||
initInsights: (initOptions) => {
|
||||
return insightsClient(
|
||||
initOptions.appId || appId,
|
||||
initOptions.apiKey || apiKey,
|
||||
initOptions.region,
|
||||
initOptions.options
|
||||
);
|
||||
},
|
||||
initMonitoring: (initOptions = {}) => {
|
||||
return monitoringClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);
|
||||
},
|
||||
initPersonalization: (initOptions) => {
|
||||
return personalizationClient(
|
||||
initOptions.appId || appId,
|
||||
initOptions.apiKey || apiKey,
|
||||
initOptions.region,
|
||||
initOptions.options
|
||||
);
|
||||
},
|
||||
initQuerySuggestions: (initOptions) => {
|
||||
return querySuggestionsClient(
|
||||
initOptions.appId || appId,
|
||||
initOptions.apiKey || apiKey,
|
||||
initOptions.region,
|
||||
initOptions.options
|
||||
);
|
||||
},
|
||||
initRecommend: (initOptions = {}) => {
|
||||
return recommendClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);
|
||||
}
|
||||
};
|
||||
}
|
||||
export {
|
||||
algoliasearch,
|
||||
apiClientVersion
|
||||
};
|
||||
//# sourceMappingURL=node.js.map
|
1
node_modules/algoliasearch/dist/node.js.map
generated
vendored
Normal file
1
node_modules/algoliasearch/dist/node.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
100
node_modules/algoliasearch/dist/worker.d.ts
generated
vendored
Normal file
100
node_modules/algoliasearch/dist/worker.d.ts
generated
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
import { ClientOptions, RequestOptions } from '@algolia/client-common';
|
||||
import { Region as Region$1, RegionOptions as RegionOptions$1, AbtestingClient } from '@algolia/client-abtesting';
|
||||
export * from '@algolia/client-abtesting';
|
||||
export { Region as AbtestingRegion, RegionOptions as AbtestingRegionOptions, Status } from '@algolia/client-abtesting';
|
||||
import { Region as Region$2, RegionOptions as RegionOptions$2, AnalyticsClient } from '@algolia/client-analytics';
|
||||
export * from '@algolia/client-analytics';
|
||||
export { Region as AnalyticsRegion, RegionOptions as AnalyticsRegionOptions } from '@algolia/client-analytics';
|
||||
import { Region as Region$4, RegionOptions as RegionOptions$4, InsightsClient } from '@algolia/client-insights';
|
||||
export * from '@algolia/client-insights';
|
||||
export { Region as InsightsRegion, RegionOptions as InsightsRegionOptions } from '@algolia/client-insights';
|
||||
import { Region as Region$5, RegionOptions as RegionOptions$5, PersonalizationClient } from '@algolia/client-personalization';
|
||||
export * from '@algolia/client-personalization';
|
||||
export { EventType, Region as PersonalizationRegion, RegionOptions as PersonalizationRegionOptions } from '@algolia/client-personalization';
|
||||
import { Region as Region$6, RegionOptions as RegionOptions$6, QuerySuggestionsClient } from '@algolia/client-query-suggestions';
|
||||
export * from '@algolia/client-query-suggestions';
|
||||
export { Region as QuerySuggestionsRegion, RegionOptions as QuerySuggestionsRegionOptions } from '@algolia/client-query-suggestions';
|
||||
import { SearchClient, SaveObjectsOptions, PartialUpdateObjectsOptions, ReplaceAllObjectsOptions, ReplaceAllObjectsWithTransformationResponse } from '@algolia/client-search';
|
||||
export * from '@algolia/client-search';
|
||||
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';
|
||||
import { Region as Region$3, RegionOptions as RegionOptions$3, IngestionClient, WatchResponse } from '@algolia/ingestion';
|
||||
export * from '@algolia/ingestion';
|
||||
export { Event, EventStatus, Region as IngestionRegion, RegionOptions as IngestionRegionOptions, WatchResponse } from '@algolia/ingestion';
|
||||
import { MonitoringClient } from '@algolia/monitoring';
|
||||
export * from '@algolia/monitoring';
|
||||
import { RecommendClient } from '@algolia/recommend';
|
||||
export * from '@algolia/recommend';
|
||||
|
||||
type Region = Region$1 | Region$2 | Region$3 | Region$4 | Region$5 | Region$6;
|
||||
type RegionOptions = RegionOptions$1 | RegionOptions$2 | RegionOptions$3 | RegionOptions$4 | RegionOptions$5 | RegionOptions$6;
|
||||
|
||||
/**
|
||||
* Options forwarded to the client initialized via the `init` method.
|
||||
*/
|
||||
type InitClientOptions = Partial<{
|
||||
/**
|
||||
* App to target with the initialized client, defaults to the `algoliasearch` appId.
|
||||
*/
|
||||
appId: string;
|
||||
/**
|
||||
* API key of the targeted app ID, defaults to the `algoliasearch` apiKey.
|
||||
*/
|
||||
apiKey: string;
|
||||
options: ClientOptions;
|
||||
}>;
|
||||
|
||||
type Algoliasearch = SearchClient & {
|
||||
initAbtesting: (initOptions: InitClientOptions & RegionOptions$1) => AbtestingClient;
|
||||
initAnalytics: (initOptions: InitClientOptions & RegionOptions$2) => AnalyticsClient;
|
||||
initIngestion: (initOptions: InitClientOptions & RegionOptions$3) => IngestionClient;
|
||||
initInsights: (initOptions: InitClientOptions & RegionOptions$4) => InsightsClient;
|
||||
initMonitoring: (initOptions?: InitClientOptions) => MonitoringClient;
|
||||
initPersonalization: (initOptions: InitClientOptions & RegionOptions$5) => PersonalizationClient;
|
||||
initQuerySuggestions: (initOptions: InitClientOptions & RegionOptions$6) => QuerySuggestionsClient;
|
||||
initRecommend: (initOptions?: InitClientOptions) => RecommendClient;
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @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/).
|
||||
* @param saveObjects - The `saveObjects` object.
|
||||
* @param saveObjects.indexName - The `indexName` to save `objects` in.
|
||||
* @param saveObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
|
||||
* @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.
|
||||
* @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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `push` method and merged with the transporter requestOptions.
|
||||
*/
|
||||
saveObjectsWithTransformation: (options: SaveObjectsOptions, requestOptions?: RequestOptions | undefined) => Promise<Array<WatchResponse>>;
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @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/).
|
||||
* @param partialUpdateObjects - The `partialUpdateObjects` object.
|
||||
* @param partialUpdateObjects.indexName - The `indexName` to update `objects` in.
|
||||
* @param partialUpdateObjects.objects - The array of `objects` to update in the given Algolia `indexName`.
|
||||
* @param partialUpdateObjects.createIfNotExists - To be provided if non-existing objects are passed, otherwise, the call will fail..
|
||||
* @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.
|
||||
* @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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `push` method and merged with the transporter requestOptions.
|
||||
*/
|
||||
partialUpdateObjectsWithTransformation: (options: PartialUpdateObjectsOptions, requestOptions?: RequestOptions | undefined) => Promise<Array<WatchResponse>>;
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @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.
|
||||
* @param replaceAllObjects - The `replaceAllObjects` object.
|
||||
* @param replaceAllObjects.indexName - The `indexName` to replace `objects` in.
|
||||
* @param replaceAllObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
|
||||
* @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.
|
||||
* @param replaceAllObjects.scopes - The `scopes` to keep from the index. Defaults to ['settings', 'rules', 'synonyms'].
|
||||
* @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.
|
||||
*/
|
||||
replaceAllObjectsWithTransformation: (options: ReplaceAllObjectsOptions, requestOptions?: RequestOptions | undefined) => Promise<ReplaceAllObjectsWithTransformationResponse>;
|
||||
};
|
||||
type TransformationOptions = {
|
||||
transformation?: {
|
||||
region: Region$3;
|
||||
} | undefined;
|
||||
};
|
||||
declare function algoliasearch(appId: string, apiKey: string, options?: (ClientOptions & TransformationOptions) | undefined): Algoliasearch;
|
||||
|
||||
export { type Algoliasearch, type InitClientOptions, type Region, type RegionOptions, type TransformationOptions, algoliasearch };
|
241
node_modules/algoliasearch/dist/worker.js
generated
vendored
Normal file
241
node_modules/algoliasearch/dist/worker.js
generated
vendored
Normal file
@@ -0,0 +1,241 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
||||
|
||||
// builds/worker.ts
|
||||
var worker_exports = {};
|
||||
__export(worker_exports, {
|
||||
algoliasearch: () => algoliasearch,
|
||||
apiClientVersion: () => apiClientVersion
|
||||
});
|
||||
import { abtestingClient } from "@algolia/client-abtesting";
|
||||
import { analyticsClient } from "@algolia/client-analytics";
|
||||
import { insightsClient } from "@algolia/client-insights";
|
||||
import { personalizationClient } from "@algolia/client-personalization";
|
||||
import { querySuggestionsClient } from "@algolia/client-query-suggestions";
|
||||
import { searchClient } from "@algolia/client-search";
|
||||
import { ingestionClient } from "@algolia/ingestion";
|
||||
import { monitoringClient } from "@algolia/monitoring";
|
||||
import { recommendClient } from "@algolia/recommend";
|
||||
|
||||
// builds/models.ts
|
||||
var models_exports = {};
|
||||
__export(models_exports, {
|
||||
apiClientVersion: () => apiClientVersion
|
||||
});
|
||||
__reExport(models_exports, client_abtesting_star);
|
||||
__reExport(models_exports, client_analytics_star);
|
||||
__reExport(models_exports, client_insights_star);
|
||||
__reExport(models_exports, client_personalization_star);
|
||||
__reExport(models_exports, client_query_suggestions_star);
|
||||
__reExport(models_exports, client_search_star);
|
||||
__reExport(models_exports, ingestion_star);
|
||||
__reExport(models_exports, monitoring_star);
|
||||
__reExport(models_exports, recommend_star);
|
||||
import { apiClientVersion } from "@algolia/client-search";
|
||||
import * as client_abtesting_star from "@algolia/client-abtesting";
|
||||
import * as client_analytics_star from "@algolia/client-analytics";
|
||||
import * as client_insights_star from "@algolia/client-insights";
|
||||
import * as client_personalization_star from "@algolia/client-personalization";
|
||||
import * as client_query_suggestions_star from "@algolia/client-query-suggestions";
|
||||
import * as client_search_star from "@algolia/client-search";
|
||||
import * as ingestion_star from "@algolia/ingestion";
|
||||
import * as monitoring_star from "@algolia/monitoring";
|
||||
import * as recommend_star from "@algolia/recommend";
|
||||
|
||||
// builds/worker.ts
|
||||
__reExport(worker_exports, models_exports);
|
||||
function algoliasearch(appId, apiKey, options) {
|
||||
if (!appId || typeof appId !== "string") {
|
||||
throw new Error("`appId` is missing.");
|
||||
}
|
||||
if (!apiKey || typeof apiKey !== "string") {
|
||||
throw new Error("`apiKey` is missing.");
|
||||
}
|
||||
const client = searchClient(appId, apiKey, options);
|
||||
let ingestionTransporter;
|
||||
if (options == null ? void 0 : options.transformation) {
|
||||
if (!options.transformation.region) {
|
||||
throw new Error("`region` must be provided when leveraging the transformation pipeline");
|
||||
}
|
||||
ingestionTransporter = ingestionClient(appId, apiKey, options.transformation.region, options);
|
||||
}
|
||||
return {
|
||||
...client,
|
||||
async saveObjectsWithTransformation({ indexName, objects, waitForTasks }, requestOptions) {
|
||||
var _a;
|
||||
if (!ingestionTransporter) {
|
||||
throw new Error("`transformation.region` must be provided at client instantiation before calling this method.");
|
||||
}
|
||||
if (!((_a = options == null ? void 0 : options.transformation) == null ? void 0 : _a.region)) {
|
||||
throw new Error("`region` must be provided when leveraging the transformation pipeline");
|
||||
}
|
||||
return ingestionTransporter.chunkedPush(
|
||||
{ indexName, objects, action: "addObject", waitForTasks },
|
||||
requestOptions
|
||||
);
|
||||
},
|
||||
async partialUpdateObjectsWithTransformation({ indexName, objects, createIfNotExists, waitForTasks }, requestOptions) {
|
||||
var _a;
|
||||
if (!ingestionTransporter) {
|
||||
throw new Error("`transformation.region` must be provided at client instantiation before calling this method.");
|
||||
}
|
||||
if (!((_a = options == null ? void 0 : options.transformation) == null ? void 0 : _a.region)) {
|
||||
throw new Error("`region` must be provided when leveraging the transformation pipeline");
|
||||
}
|
||||
return ingestionTransporter.chunkedPush(
|
||||
{
|
||||
indexName,
|
||||
objects,
|
||||
action: createIfNotExists ? "partialUpdateObject" : "partialUpdateObjectNoCreate",
|
||||
waitForTasks
|
||||
},
|
||||
requestOptions
|
||||
);
|
||||
},
|
||||
async replaceAllObjectsWithTransformation({ indexName, objects, batchSize, scopes }, requestOptions) {
|
||||
var _a;
|
||||
if (!ingestionTransporter) {
|
||||
throw new Error("`transformation.region` must be provided at client instantiation before calling this method.");
|
||||
}
|
||||
if (!((_a = options == null ? void 0 : options.transformation) == null ? void 0 : _a.region)) {
|
||||
throw new Error("`region` must be provided when leveraging the transformation pipeline");
|
||||
}
|
||||
const randomSuffix = Math.floor(Math.random() * 1e6) + 1e5;
|
||||
const tmpIndexName = `${indexName}_tmp_${randomSuffix}`;
|
||||
if (scopes === void 0) {
|
||||
scopes = ["settings", "rules", "synonyms"];
|
||||
}
|
||||
try {
|
||||
let copyOperationResponse = await this.operationIndex(
|
||||
{
|
||||
indexName,
|
||||
operationIndexParams: {
|
||||
operation: "copy",
|
||||
destination: tmpIndexName,
|
||||
scope: scopes
|
||||
}
|
||||
},
|
||||
requestOptions
|
||||
);
|
||||
const watchResponses = await ingestionTransporter.chunkedPush(
|
||||
{ indexName: tmpIndexName, objects, waitForTasks: true, batchSize, referenceIndexName: indexName },
|
||||
requestOptions
|
||||
);
|
||||
await this.waitForTask({
|
||||
indexName: tmpIndexName,
|
||||
taskID: copyOperationResponse.taskID
|
||||
});
|
||||
copyOperationResponse = await this.operationIndex(
|
||||
{
|
||||
indexName,
|
||||
operationIndexParams: {
|
||||
operation: "copy",
|
||||
destination: tmpIndexName,
|
||||
scope: scopes
|
||||
}
|
||||
},
|
||||
requestOptions
|
||||
);
|
||||
await this.waitForTask({
|
||||
indexName: tmpIndexName,
|
||||
taskID: copyOperationResponse.taskID
|
||||
});
|
||||
const moveOperationResponse = await this.operationIndex(
|
||||
{
|
||||
indexName: tmpIndexName,
|
||||
operationIndexParams: { operation: "move", destination: indexName }
|
||||
},
|
||||
requestOptions
|
||||
);
|
||||
await this.waitForTask({
|
||||
indexName: tmpIndexName,
|
||||
taskID: moveOperationResponse.taskID
|
||||
});
|
||||
return { copyOperationResponse, watchResponses, moveOperationResponse };
|
||||
} catch (error) {
|
||||
await this.deleteIndex({ indexName: tmpIndexName });
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
||||
*/
|
||||
get _ua() {
|
||||
return client.transporter.algoliaAgent.value;
|
||||
},
|
||||
initAbtesting: (initOptions) => {
|
||||
return abtestingClient(
|
||||
initOptions.appId || appId,
|
||||
initOptions.apiKey || apiKey,
|
||||
initOptions.region,
|
||||
initOptions.options
|
||||
);
|
||||
},
|
||||
initAnalytics: (initOptions) => {
|
||||
return analyticsClient(
|
||||
initOptions.appId || appId,
|
||||
initOptions.apiKey || apiKey,
|
||||
initOptions.region,
|
||||
initOptions.options
|
||||
);
|
||||
},
|
||||
initIngestion: (initOptions) => {
|
||||
return ingestionClient(
|
||||
initOptions.appId || appId,
|
||||
initOptions.apiKey || apiKey,
|
||||
initOptions.region,
|
||||
initOptions.options
|
||||
);
|
||||
},
|
||||
initInsights: (initOptions) => {
|
||||
return insightsClient(
|
||||
initOptions.appId || appId,
|
||||
initOptions.apiKey || apiKey,
|
||||
initOptions.region,
|
||||
initOptions.options
|
||||
);
|
||||
},
|
||||
initMonitoring: (initOptions = {}) => {
|
||||
return monitoringClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);
|
||||
},
|
||||
initPersonalization: (initOptions) => {
|
||||
return personalizationClient(
|
||||
initOptions.appId || appId,
|
||||
initOptions.apiKey || apiKey,
|
||||
initOptions.region,
|
||||
initOptions.options
|
||||
);
|
||||
},
|
||||
initQuerySuggestions: (initOptions) => {
|
||||
return querySuggestionsClient(
|
||||
initOptions.appId || appId,
|
||||
initOptions.apiKey || apiKey,
|
||||
initOptions.region,
|
||||
initOptions.options
|
||||
);
|
||||
},
|
||||
initRecommend: (initOptions = {}) => {
|
||||
return recommendClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);
|
||||
}
|
||||
};
|
||||
}
|
||||
export {
|
||||
algoliasearch,
|
||||
apiClientVersion
|
||||
};
|
||||
//# sourceMappingURL=worker.js.map
|
1
node_modules/algoliasearch/dist/worker.js.map
generated
vendored
Normal file
1
node_modules/algoliasearch/dist/worker.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user