mirror of
https://github.com/mivodev/mivodev.github.io.git
synced 2026-01-26 21:41:53 +07:00
Fix dependencies: Add flag-icons, tailwind directives, and postcss config
This commit is contained in:
21
node_modules/algoliasearch/LICENSE
generated
vendored
Normal file
21
node_modules/algoliasearch/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2013-Present Algolia
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
82
node_modules/algoliasearch/README.md
generated
vendored
Normal file
82
node_modules/algoliasearch/README.md
generated
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
<p align="center">
|
||||
<a href="https://www.algolia.com">
|
||||
<img alt="Algolia for JavaScript" src="https://raw.githubusercontent.com/algolia/algoliasearch-client-common/master/banners/javascript.png" >
|
||||
</a>
|
||||
|
||||
<h4 align="center">The perfect starting point to integrate <a href="https://algolia.com" target="_blank">Algolia</a> within your JavaScript project</h4>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://npmjs.com/package/algoliasearch"><img src="https://img.shields.io/npm/v/algoliasearch.svg?style=flat-square" alt="NPM version"></img></a>
|
||||
<a href="http://npm-stat.com/charts.html?package=algoliasearch"><img src="https://img.shields.io/npm/dm/algoliasearch.svg?style=flat-square" alt="NPM downloads"></a>
|
||||
<a href="https://www.jsdelivr.com/package/npm/algoliasearch"><img src="https://data.jsdelivr.com/v1/package/npm/algoliasearch/badge" alt="jsDelivr Downloads"></img></a>
|
||||
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg?style=flat-square" alt="License"></a>
|
||||
</p>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://www.algolia.com/doc/libraries/sdk/install#javascript" target="_blank">Documentation</a> •
|
||||
<a href="https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/" target="_blank">InstantSearch</a> •
|
||||
<a href="https://discourse.algolia.com" target="_blank">Community Forum</a> •
|
||||
<a href="http://stackoverflow.com/questions/tagged/algolia" target="_blank">Stack Overflow</a> •
|
||||
<a href="https://github.com/algolia/algoliasearch-client-javascript/issues" target="_blank">Report a bug</a> •
|
||||
<a href="https://alg.li/support" target="_blank">Support</a>
|
||||
</p>
|
||||
|
||||
## ✨ Features
|
||||
|
||||
- Thin & **minimal low-level HTTP client** to interact with Algolia's API
|
||||
- Works both on the **browser** and **node.js**
|
||||
- **UMD and ESM compatible**, you can use it with any module loader
|
||||
- Built with TypeScript
|
||||
|
||||
## 💡 Getting Started
|
||||
|
||||
To get started, you first need to install algoliasearch (or any other available API client package).
|
||||
All of our clients comes with type definition, and are available for both browser and node environments.
|
||||
|
||||
### With a package manager
|
||||
|
||||
```bash
|
||||
yarn add algoliasearch@5.46.3
|
||||
# or
|
||||
npm install algoliasearch@5.46.3
|
||||
# or
|
||||
pnpm add algoliasearch@5.46.3
|
||||
```
|
||||
|
||||
### Without a package manager
|
||||
|
||||
Add the following JavaScript snippet to the <head> of your website:
|
||||
|
||||
```html
|
||||
// for the full client
|
||||
<script src="https://cdn.jsdelivr.net/npm/algoliasearch@5.46.3/dist/algoliasearch.umd.js"></script>
|
||||
|
||||
// for the lite client
|
||||
<script src="https://cdn.jsdelivr.net/npm/algoliasearch@5.46.3/dist/lite/builds/browser.umd.js"></script>
|
||||
```
|
||||
|
||||
### Usage
|
||||
|
||||
You can now import the Algolia API client in your project and play with it.
|
||||
|
||||
```js
|
||||
import { algoliasearch } from 'algoliasearch';
|
||||
|
||||
const client = algoliasearch('YOUR_APP_ID', 'YOUR_API_KEY');
|
||||
|
||||
// or with the lite client
|
||||
import { liteClient } from 'algoliasearch/lite';
|
||||
|
||||
const client = liteClient('YOUR_APP_ID', 'YOUR_API_KEY');
|
||||
```
|
||||
|
||||
For full documentation, visit the **[Algolia JavaScript API Client](https://www.algolia.com/doc/libraries/sdk/methods/search/)**.
|
||||
|
||||
## ❓ Troubleshooting
|
||||
|
||||
Encountering an issue? Before reaching out to support, we recommend heading to our [FAQ](https://support.algolia.com/hc/en-us/sections/15061037630609-API-Client-FAQs) where you will find answers for the most common issues and gotchas with the client. You can also open [a GitHub issue](https://github.com/algolia/api-clients-automation/issues/new?assignees=&labels=&projects=&template=Bug_report.md)
|
||||
|
||||
## 📄 License
|
||||
|
||||
The Algolia JavaScript API Client is an open-sourced software licensed under the [MIT license](LICENSE).
|
||||
25
node_modules/algoliasearch/dist/algoliasearch.umd.js
generated
vendored
Normal file
25
node_modules/algoliasearch/dist/algoliasearch.umd.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
104
node_modules/algoliasearch/dist/browser.d.ts
generated
vendored
Normal file
104
node_modules/algoliasearch/dist/browser.d.ts
generated
vendored
Normal file
@@ -0,0 +1,104 @@
|
||||
import { ClientOptions, RequestOptions } from '@algolia/client-common';
|
||||
import { Region as Region$2, RegionOptions as RegionOptions$2, AbtestingV3Client } from '@algolia/abtesting';
|
||||
export * from '@algolia/abtesting';
|
||||
export { Region as AbtestingV3Region, RegionOptions as AbtestingV3RegionOptions } from '@algolia/abtesting';
|
||||
import { Region as Region$1, RegionOptions as RegionOptions$1, AbtestingClient } from '@algolia/client-abtesting';
|
||||
export * from '@algolia/client-abtesting';
|
||||
export { ABTest, ABTestConfiguration, ABTestResponse, AbTestsVariant, AbTestsVariantSearchParams, Region as AbtestingRegion, RegionOptions as AbtestingRegionOptions, AddABTestsRequest, AddABTestsVariant, CustomSearchParams, DeleteABTestProps, EffectMetric, EmptySearchFilter, EstimateABTestRequest, EstimateABTestResponse, EstimateConfiguration, FilterEffects, GetABTestProps, ListABTestsProps, ListABTestsResponse, MinimumDetectableEffect, OutliersFilter, Status, StopABTestProps, Variant } from '@algolia/client-abtesting';
|
||||
import { Region as Region$3, RegionOptions as RegionOptions$3, AnalyticsClient } from '@algolia/client-analytics';
|
||||
export * from '@algolia/client-analytics';
|
||||
export { Region as AnalyticsRegion, RegionOptions as AnalyticsRegionOptions, Direction } from '@algolia/client-analytics';
|
||||
import { Region as Region$5, RegionOptions as RegionOptions$5, 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$6, RegionOptions as RegionOptions$6, 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$7, RegionOptions as RegionOptions$7, 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$4, RegionOptions as RegionOptions$4, 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 | Region$7;
|
||||
type RegionOptions = RegionOptions$1 | RegionOptions$2 | RegionOptions$3 | RegionOptions$4 | RegionOptions$5 | RegionOptions$6 | RegionOptions$7;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
initAbtestingV3: (initOptions: InitClientOptions & RegionOptions$2) => AbtestingV3Client;
|
||||
initAnalytics: (initOptions: InitClientOptions & RegionOptions$3) => AnalyticsClient;
|
||||
initIngestion: (initOptions: InitClientOptions & RegionOptions$4) => IngestionClient;
|
||||
initInsights: (initOptions: InitClientOptions & RegionOptions$5) => InsightsClient;
|
||||
initMonitoring: (initOptions?: InitClientOptions) => MonitoringClient;
|
||||
initPersonalization: (initOptions: InitClientOptions & RegionOptions$6) => PersonalizationClient;
|
||||
initQuerySuggestions: (initOptions: InitClientOptions & RegionOptions$7) => 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$4;
|
||||
} | 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 };
|
||||
249
node_modules/algoliasearch/dist/browser.js
generated
vendored
Normal file
249
node_modules/algoliasearch/dist/browser.js
generated
vendored
Normal file
@@ -0,0 +1,249 @@
|
||||
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 { abtestingV3Client } from "@algolia/abtesting";
|
||||
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, abtesting_star);
|
||||
__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 abtesting_star from "@algolia/abtesting";
|
||||
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
|
||||
);
|
||||
},
|
||||
initAbtestingV3: (initOptions) => {
|
||||
return abtestingV3Client(
|
||||
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
104
node_modules/algoliasearch/dist/fetch.d.ts
generated
vendored
Normal file
104
node_modules/algoliasearch/dist/fetch.d.ts
generated
vendored
Normal file
@@ -0,0 +1,104 @@
|
||||
import { ClientOptions, RequestOptions } from '@algolia/client-common';
|
||||
import { Region as Region$2, RegionOptions as RegionOptions$2, AbtestingV3Client } from '@algolia/abtesting';
|
||||
export * from '@algolia/abtesting';
|
||||
export { Region as AbtestingV3Region, RegionOptions as AbtestingV3RegionOptions } from '@algolia/abtesting';
|
||||
import { Region as Region$1, RegionOptions as RegionOptions$1, AbtestingClient } from '@algolia/client-abtesting';
|
||||
export * from '@algolia/client-abtesting';
|
||||
export { ABTest, ABTestConfiguration, ABTestResponse, AbTestsVariant, AbTestsVariantSearchParams, Region as AbtestingRegion, RegionOptions as AbtestingRegionOptions, AddABTestsRequest, AddABTestsVariant, CustomSearchParams, DeleteABTestProps, EffectMetric, EmptySearchFilter, EstimateABTestRequest, EstimateABTestResponse, EstimateConfiguration, FilterEffects, GetABTestProps, ListABTestsProps, ListABTestsResponse, MinimumDetectableEffect, OutliersFilter, Status, StopABTestProps, Variant } from '@algolia/client-abtesting';
|
||||
import { Region as Region$3, RegionOptions as RegionOptions$3, AnalyticsClient } from '@algolia/client-analytics';
|
||||
export * from '@algolia/client-analytics';
|
||||
export { Region as AnalyticsRegion, RegionOptions as AnalyticsRegionOptions, Direction } from '@algolia/client-analytics';
|
||||
import { Region as Region$5, RegionOptions as RegionOptions$5, 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$6, RegionOptions as RegionOptions$6, 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$7, RegionOptions as RegionOptions$7, 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$4, RegionOptions as RegionOptions$4, 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 | Region$7;
|
||||
type RegionOptions = RegionOptions$1 | RegionOptions$2 | RegionOptions$3 | RegionOptions$4 | RegionOptions$5 | RegionOptions$6 | RegionOptions$7;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
initAbtestingV3: (initOptions: InitClientOptions & RegionOptions$2) => AbtestingV3Client;
|
||||
initAnalytics: (initOptions: InitClientOptions & RegionOptions$3) => AnalyticsClient;
|
||||
initIngestion: (initOptions: InitClientOptions & RegionOptions$4) => IngestionClient;
|
||||
initInsights: (initOptions: InitClientOptions & RegionOptions$5) => InsightsClient;
|
||||
initMonitoring: (initOptions?: InitClientOptions) => MonitoringClient;
|
||||
initPersonalization: (initOptions: InitClientOptions & RegionOptions$6) => PersonalizationClient;
|
||||
initQuerySuggestions: (initOptions: InitClientOptions & RegionOptions$7) => 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$4;
|
||||
} | 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 };
|
||||
252
node_modules/algoliasearch/dist/fetch.js
generated
vendored
Normal file
252
node_modules/algoliasearch/dist/fetch.js
generated
vendored
Normal file
@@ -0,0 +1,252 @@
|
||||
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 { abtestingV3Client } from "@algolia/abtesting";
|
||||
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, abtesting_star);
|
||||
__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 abtesting_star from "@algolia/abtesting";
|
||||
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
|
||||
);
|
||||
},
|
||||
initAbtestingV3: (initOptions) => {
|
||||
return abtestingV3Client(
|
||||
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
1757
node_modules/algoliasearch/dist/lite/browser.d.ts
generated
vendored
Normal file
1757
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.46.3";
|
||||
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.46.3";
|
||||
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.46.3";
|
||||
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
1758
node_modules/algoliasearch/dist/lite/node.d.cts
generated
vendored
Normal file
1758
node_modules/algoliasearch/dist/lite/node.d.cts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1758
node_modules/algoliasearch/dist/lite/node.d.ts
generated
vendored
Normal file
1758
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.46.3";
|
||||
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.46.3";
|
||||
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
246
node_modules/algoliasearch/dist/node.cjs
generated
vendored
Normal file
246
node_modules/algoliasearch/dist/node.cjs
generated
vendored
Normal file
@@ -0,0 +1,246 @@
|
||||
"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_abtesting = require("@algolia/abtesting");
|
||||
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/abtesting"));
|
||||
__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
|
||||
);
|
||||
},
|
||||
initAbtestingV3: (initOptions) => {
|
||||
return (0, import_abtesting.abtestingV3Client)(
|
||||
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
104
node_modules/algoliasearch/dist/node.d.cts
generated
vendored
Normal file
104
node_modules/algoliasearch/dist/node.d.cts
generated
vendored
Normal file
@@ -0,0 +1,104 @@
|
||||
import { ClientOptions, RequestOptions } from '@algolia/client-common';
|
||||
import { Region as Region$2, RegionOptions as RegionOptions$2, AbtestingV3Client } from '@algolia/abtesting';
|
||||
export * from '@algolia/abtesting';
|
||||
export { Region as AbtestingV3Region, RegionOptions as AbtestingV3RegionOptions } from '@algolia/abtesting';
|
||||
import { Region as Region$1, RegionOptions as RegionOptions$1, AbtestingClient } from '@algolia/client-abtesting';
|
||||
export * from '@algolia/client-abtesting';
|
||||
export { ABTest, ABTestConfiguration, ABTestResponse, AbTestsVariant, AbTestsVariantSearchParams, Region as AbtestingRegion, RegionOptions as AbtestingRegionOptions, AddABTestsRequest, AddABTestsVariant, CustomSearchParams, DeleteABTestProps, EffectMetric, EmptySearchFilter, EstimateABTestRequest, EstimateABTestResponse, EstimateConfiguration, FilterEffects, GetABTestProps, ListABTestsProps, ListABTestsResponse, MinimumDetectableEffect, OutliersFilter, Status, StopABTestProps, Variant } from '@algolia/client-abtesting';
|
||||
import { Region as Region$3, RegionOptions as RegionOptions$3, AnalyticsClient } from '@algolia/client-analytics';
|
||||
export * from '@algolia/client-analytics';
|
||||
export { Region as AnalyticsRegion, RegionOptions as AnalyticsRegionOptions, Direction } from '@algolia/client-analytics';
|
||||
import { Region as Region$5, RegionOptions as RegionOptions$5, 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$6, RegionOptions as RegionOptions$6, 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$7, RegionOptions as RegionOptions$7, 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$4, RegionOptions as RegionOptions$4, 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 | Region$7;
|
||||
type RegionOptions = RegionOptions$1 | RegionOptions$2 | RegionOptions$3 | RegionOptions$4 | RegionOptions$5 | RegionOptions$6 | RegionOptions$7;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
initAbtestingV3: (initOptions: InitClientOptions & RegionOptions$2) => AbtestingV3Client;
|
||||
initAnalytics: (initOptions: InitClientOptions & RegionOptions$3) => AnalyticsClient;
|
||||
initIngestion: (initOptions: InitClientOptions & RegionOptions$4) => IngestionClient;
|
||||
initInsights: (initOptions: InitClientOptions & RegionOptions$5) => InsightsClient;
|
||||
initMonitoring: (initOptions?: InitClientOptions) => MonitoringClient;
|
||||
initPersonalization: (initOptions: InitClientOptions & RegionOptions$6) => PersonalizationClient;
|
||||
initQuerySuggestions: (initOptions: InitClientOptions & RegionOptions$7) => 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$4;
|
||||
} | 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 };
|
||||
104
node_modules/algoliasearch/dist/node.d.ts
generated
vendored
Normal file
104
node_modules/algoliasearch/dist/node.d.ts
generated
vendored
Normal file
@@ -0,0 +1,104 @@
|
||||
import { ClientOptions, RequestOptions } from '@algolia/client-common';
|
||||
import { Region as Region$2, RegionOptions as RegionOptions$2, AbtestingV3Client } from '@algolia/abtesting';
|
||||
export * from '@algolia/abtesting';
|
||||
export { Region as AbtestingV3Region, RegionOptions as AbtestingV3RegionOptions } from '@algolia/abtesting';
|
||||
import { Region as Region$1, RegionOptions as RegionOptions$1, AbtestingClient } from '@algolia/client-abtesting';
|
||||
export * from '@algolia/client-abtesting';
|
||||
export { ABTest, ABTestConfiguration, ABTestResponse, AbTestsVariant, AbTestsVariantSearchParams, Region as AbtestingRegion, RegionOptions as AbtestingRegionOptions, AddABTestsRequest, AddABTestsVariant, CustomSearchParams, DeleteABTestProps, EffectMetric, EmptySearchFilter, EstimateABTestRequest, EstimateABTestResponse, EstimateConfiguration, FilterEffects, GetABTestProps, ListABTestsProps, ListABTestsResponse, MinimumDetectableEffect, OutliersFilter, Status, StopABTestProps, Variant } from '@algolia/client-abtesting';
|
||||
import { Region as Region$3, RegionOptions as RegionOptions$3, AnalyticsClient } from '@algolia/client-analytics';
|
||||
export * from '@algolia/client-analytics';
|
||||
export { Region as AnalyticsRegion, RegionOptions as AnalyticsRegionOptions, Direction } from '@algolia/client-analytics';
|
||||
import { Region as Region$5, RegionOptions as RegionOptions$5, 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$6, RegionOptions as RegionOptions$6, 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$7, RegionOptions as RegionOptions$7, 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$4, RegionOptions as RegionOptions$4, 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 | Region$7;
|
||||
type RegionOptions = RegionOptions$1 | RegionOptions$2 | RegionOptions$3 | RegionOptions$4 | RegionOptions$5 | RegionOptions$6 | RegionOptions$7;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
initAbtestingV3: (initOptions: InitClientOptions & RegionOptions$2) => AbtestingV3Client;
|
||||
initAnalytics: (initOptions: InitClientOptions & RegionOptions$3) => AnalyticsClient;
|
||||
initIngestion: (initOptions: InitClientOptions & RegionOptions$4) => IngestionClient;
|
||||
initInsights: (initOptions: InitClientOptions & RegionOptions$5) => InsightsClient;
|
||||
initMonitoring: (initOptions?: InitClientOptions) => MonitoringClient;
|
||||
initPersonalization: (initOptions: InitClientOptions & RegionOptions$6) => PersonalizationClient;
|
||||
initQuerySuggestions: (initOptions: InitClientOptions & RegionOptions$7) => 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$4;
|
||||
} | 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 };
|
||||
252
node_modules/algoliasearch/dist/node.js
generated
vendored
Normal file
252
node_modules/algoliasearch/dist/node.js
generated
vendored
Normal file
@@ -0,0 +1,252 @@
|
||||
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 { abtestingV3Client } from "@algolia/abtesting";
|
||||
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, abtesting_star);
|
||||
__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 abtesting_star from "@algolia/abtesting";
|
||||
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
|
||||
);
|
||||
},
|
||||
initAbtestingV3: (initOptions) => {
|
||||
return abtestingV3Client(
|
||||
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
104
node_modules/algoliasearch/dist/worker.d.ts
generated
vendored
Normal file
104
node_modules/algoliasearch/dist/worker.d.ts
generated
vendored
Normal file
@@ -0,0 +1,104 @@
|
||||
import { ClientOptions, RequestOptions } from '@algolia/client-common';
|
||||
import { Region as Region$2, RegionOptions as RegionOptions$2, AbtestingV3Client } from '@algolia/abtesting';
|
||||
export * from '@algolia/abtesting';
|
||||
export { Region as AbtestingV3Region, RegionOptions as AbtestingV3RegionOptions } from '@algolia/abtesting';
|
||||
import { Region as Region$1, RegionOptions as RegionOptions$1, AbtestingClient } from '@algolia/client-abtesting';
|
||||
export * from '@algolia/client-abtesting';
|
||||
export { ABTest, ABTestConfiguration, ABTestResponse, AbTestsVariant, AbTestsVariantSearchParams, Region as AbtestingRegion, RegionOptions as AbtestingRegionOptions, AddABTestsRequest, AddABTestsVariant, CustomSearchParams, DeleteABTestProps, EffectMetric, EmptySearchFilter, EstimateABTestRequest, EstimateABTestResponse, EstimateConfiguration, FilterEffects, GetABTestProps, ListABTestsProps, ListABTestsResponse, MinimumDetectableEffect, OutliersFilter, Status, StopABTestProps, Variant } from '@algolia/client-abtesting';
|
||||
import { Region as Region$3, RegionOptions as RegionOptions$3, AnalyticsClient } from '@algolia/client-analytics';
|
||||
export * from '@algolia/client-analytics';
|
||||
export { Region as AnalyticsRegion, RegionOptions as AnalyticsRegionOptions, Direction } from '@algolia/client-analytics';
|
||||
import { Region as Region$5, RegionOptions as RegionOptions$5, 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$6, RegionOptions as RegionOptions$6, 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$7, RegionOptions as RegionOptions$7, 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$4, RegionOptions as RegionOptions$4, 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 | Region$7;
|
||||
type RegionOptions = RegionOptions$1 | RegionOptions$2 | RegionOptions$3 | RegionOptions$4 | RegionOptions$5 | RegionOptions$6 | RegionOptions$7;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
initAbtestingV3: (initOptions: InitClientOptions & RegionOptions$2) => AbtestingV3Client;
|
||||
initAnalytics: (initOptions: InitClientOptions & RegionOptions$3) => AnalyticsClient;
|
||||
initIngestion: (initOptions: InitClientOptions & RegionOptions$4) => IngestionClient;
|
||||
initInsights: (initOptions: InitClientOptions & RegionOptions$5) => InsightsClient;
|
||||
initMonitoring: (initOptions?: InitClientOptions) => MonitoringClient;
|
||||
initPersonalization: (initOptions: InitClientOptions & RegionOptions$6) => PersonalizationClient;
|
||||
initQuerySuggestions: (initOptions: InitClientOptions & RegionOptions$7) => 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$4;
|
||||
} | 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 };
|
||||
252
node_modules/algoliasearch/dist/worker.js
generated
vendored
Normal file
252
node_modules/algoliasearch/dist/worker.js
generated
vendored
Normal file
@@ -0,0 +1,252 @@
|
||||
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 { abtestingV3Client } from "@algolia/abtesting";
|
||||
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, abtesting_star);
|
||||
__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 abtesting_star from "@algolia/abtesting";
|
||||
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
|
||||
);
|
||||
},
|
||||
initAbtestingV3: (initOptions) => {
|
||||
return abtestingV3Client(
|
||||
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
1
node_modules/algoliasearch/index.d.ts
generated
vendored
Normal file
1
node_modules/algoliasearch/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export * from './dist/node';
|
||||
1
node_modules/algoliasearch/index.js
generated
vendored
Normal file
1
node_modules/algoliasearch/index.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
module.exports = require('./dist/node.cjs');
|
||||
1
node_modules/algoliasearch/lite.d.ts
generated
vendored
Normal file
1
node_modules/algoliasearch/lite.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export * from './dist/lite/node';
|
||||
1
node_modules/algoliasearch/lite.js
generated
vendored
Normal file
1
node_modules/algoliasearch/lite.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
module.exports = require('./dist/lite/builds/node.cjs');
|
||||
109
node_modules/algoliasearch/package.json
generated
vendored
Normal file
109
node_modules/algoliasearch/package.json
generated
vendored
Normal file
@@ -0,0 +1,109 @@
|
||||
{
|
||||
"version": "5.46.3",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/algolia/algoliasearch-client-javascript.git"
|
||||
},
|
||||
"homepage": "https://github.com/algolia/algoliasearch-client-javascript/tree/main/packages/algoliasearch#readme",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"author": "Algolia",
|
||||
"scripts": {
|
||||
"build": "yarn clean && yarn tsup && yarn rollup -c rollup.config.js",
|
||||
"clean": "rm -rf ./dist || true",
|
||||
"test": "tsc -p __tests__/tsconfig.json && vitest --run",
|
||||
"test:bundle": "publint . && attw --pack ."
|
||||
},
|
||||
"name": "algoliasearch",
|
||||
"description": "A fully-featured and blazing-fast JavaScript API client to interact with Algolia API.",
|
||||
"exports": {
|
||||
".": {
|
||||
"node": {
|
||||
"types": {
|
||||
"import": "./dist/node.d.ts",
|
||||
"module": "./dist/node.d.ts",
|
||||
"require": "./dist/node.d.cts"
|
||||
},
|
||||
"import": "./dist/node.js",
|
||||
"module": "./dist/node.js",
|
||||
"require": "./dist/node.cjs"
|
||||
},
|
||||
"worker": {
|
||||
"types": "./dist/worker.d.ts",
|
||||
"default": "./dist/worker.js"
|
||||
},
|
||||
"default": {
|
||||
"types": "./dist/browser.d.ts",
|
||||
"module": "./dist/browser.js",
|
||||
"import": "./dist/browser.js",
|
||||
"default": "./dist/algoliasearch.umd.js"
|
||||
}
|
||||
},
|
||||
"./lite": {
|
||||
"node": {
|
||||
"types": {
|
||||
"import": "./dist/lite/node.d.ts",
|
||||
"module": "./dist/lite/node.d.ts",
|
||||
"require": "./dist/lite/node.d.cts"
|
||||
},
|
||||
"import": "./dist/lite/builds/node.js",
|
||||
"module": "./dist/lite/builds/node.js",
|
||||
"require": "./dist/lite/builds/node.cjs"
|
||||
},
|
||||
"default": {
|
||||
"types": "./dist/lite/browser.d.ts",
|
||||
"module": "./dist/lite/builds/browser.js",
|
||||
"import": "./dist/lite/builds/browser.js",
|
||||
"default": "./dist/lite/builds/browser.umd.js"
|
||||
}
|
||||
},
|
||||
"./dist/*": "./dist/*.js",
|
||||
"./dist/lite/builds/*": "./dist/lite/builds/*.js"
|
||||
},
|
||||
"jsdelivr": "./dist/algoliasearch.umd.js",
|
||||
"unpkg": "./dist/algoliasearch.umd.js",
|
||||
"react-native": {
|
||||
".": "./dist/browser.js",
|
||||
"./lite": "./dist/lite/builds/browser.js"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"index.js",
|
||||
"index.d.ts",
|
||||
"lite.js",
|
||||
"lite.d.ts"
|
||||
],
|
||||
"dependencies": {
|
||||
"@algolia/abtesting": "1.12.3",
|
||||
"@algolia/client-abtesting": "5.46.3",
|
||||
"@algolia/client-analytics": "5.46.3",
|
||||
"@algolia/client-common": "5.46.3",
|
||||
"@algolia/client-insights": "5.46.3",
|
||||
"@algolia/client-personalization": "5.46.3",
|
||||
"@algolia/client-query-suggestions": "5.46.3",
|
||||
"@algolia/client-search": "5.46.3",
|
||||
"@algolia/ingestion": "1.46.3",
|
||||
"@algolia/monitoring": "1.46.3",
|
||||
"@algolia/recommend": "5.46.3",
|
||||
"@algolia/requester-browser-xhr": "5.46.3",
|
||||
"@algolia/requester-fetch": "5.46.3",
|
||||
"@algolia/requester-node-http": "5.46.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@algolia/requester-testing": "5.46.3",
|
||||
"@arethetypeswrong/cli": "0.18.2",
|
||||
"@cloudflare/vitest-pool-workers": "0.12.1",
|
||||
"@cloudflare/workers-types": "4.20251115.0",
|
||||
"@types/node": "25.0.6",
|
||||
"jsdom": "27.4.0",
|
||||
"publint": "0.3.16",
|
||||
"rollup": "4.55.1",
|
||||
"tsup": "8.5.1",
|
||||
"typescript": "5.9.3",
|
||||
"vitest": "4.0.16"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 14.0.0"
|
||||
},
|
||||
"gitHead": "5be82d3f2ae7cd97f5d42c3451e966daa53fd06a"
|
||||
}
|
||||
Reference in New Issue
Block a user