@algolia/recommend 5.2.4 → 5.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.d.ts +1300 -0
- package/dist/builds/browser.js +398 -0
- package/dist/builds/browser.js.map +1 -0
- package/dist/builds/browser.min.js +2 -0
- package/dist/builds/browser.min.js.map +1 -0
- package/dist/builds/browser.umd.js +12 -0
- package/dist/builds/node.cjs +416 -0
- package/dist/builds/node.cjs.map +1 -0
- package/dist/builds/node.js +396 -0
- package/dist/builds/node.js.map +1 -0
- package/dist/node.d.cts +1300 -0
- package/dist/node.d.ts +1300 -0
- package/dist/src/recommendClient.cjs +385 -0
- package/dist/src/recommendClient.cjs.map +1 -0
- package/dist/src/recommendClient.js +359 -0
- package/dist/src/recommendClient.js.map +1 -0
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +28 -25
- package/dist/builds/browser.d.ts +0 -24
- package/dist/builds/browser.d.ts.map +0 -1
- package/dist/builds/node.d.ts +0 -24
- package/dist/builds/node.d.ts.map +0 -1
- package/dist/model/advancedSyntaxFeatures.d.ts +0 -2
- package/dist/model/advancedSyntaxFeatures.d.ts.map +0 -1
- package/dist/model/alternativesAsExact.d.ts +0 -2
- package/dist/model/alternativesAsExact.d.ts.map +0 -1
- package/dist/model/aroundPrecision.d.ts +0 -6
- package/dist/model/aroundPrecision.d.ts.map +0 -1
- package/dist/model/aroundRadius.d.ts +0 -6
- package/dist/model/aroundRadius.d.ts.map +0 -1
- package/dist/model/aroundRadiusAll.d.ts +0 -5
- package/dist/model/aroundRadiusAll.d.ts.map +0 -1
- package/dist/model/autoFacetFilter.d.ts +0 -14
- package/dist/model/autoFacetFilter.d.ts.map +0 -1
- package/dist/model/baseRecommendRequest.d.ts +0 -17
- package/dist/model/baseRecommendRequest.d.ts.map +0 -1
- package/dist/model/baseSearchParams.d.ts +0 -4
- package/dist/model/baseSearchParams.d.ts.map +0 -1
- package/dist/model/baseSearchParamsWithoutQuery.d.ts +0 -116
- package/dist/model/baseSearchParamsWithoutQuery.d.ts.map +0 -1
- package/dist/model/baseSearchResponse.d.ts +0 -94
- package/dist/model/baseSearchResponse.d.ts.map +0 -1
- package/dist/model/booleanString.d.ts +0 -2
- package/dist/model/booleanString.d.ts.map +0 -1
- package/dist/model/boughtTogetherQuery.d.ts +0 -4
- package/dist/model/boughtTogetherQuery.d.ts.map +0 -1
- package/dist/model/clientMethodProps.d.ts +0 -135
- package/dist/model/clientMethodProps.d.ts.map +0 -1
- package/dist/model/condition.d.ts +0 -14
- package/dist/model/condition.d.ts.map +0 -1
- package/dist/model/consequence.d.ts +0 -18
- package/dist/model/consequence.d.ts.map +0 -1
- package/dist/model/deletedAtResponse.d.ts +0 -14
- package/dist/model/deletedAtResponse.d.ts.map +0 -1
- package/dist/model/distinct.d.ts +0 -5
- package/dist/model/distinct.d.ts.map +0 -1
- package/dist/model/errorBase.d.ts +0 -7
- package/dist/model/errorBase.d.ts.map +0 -1
- package/dist/model/exactOnSingleWordQuery.d.ts +0 -5
- package/dist/model/exactOnSingleWordQuery.d.ts.map +0 -1
- package/dist/model/exhaustive.d.ts +0 -26
- package/dist/model/exhaustive.d.ts.map +0 -1
- package/dist/model/facetFilters.d.ts +0 -5
- package/dist/model/facetFilters.d.ts.map +0 -1
- package/dist/model/facetOrdering.d.ts +0 -13
- package/dist/model/facetOrdering.d.ts.map +0 -1
- package/dist/model/facetStats.d.ts +0 -19
- package/dist/model/facetStats.d.ts.map +0 -1
- package/dist/model/facets.d.ts +0 -10
- package/dist/model/facets.d.ts.map +0 -1
- package/dist/model/fallbackParams.d.ts +0 -3
- package/dist/model/fallbackParams.d.ts.map +0 -1
- package/dist/model/fbtModel.d.ts +0 -5
- package/dist/model/fbtModel.d.ts.map +0 -1
- package/dist/model/frequentlyBoughtTogether.d.ts +0 -9
- package/dist/model/frequentlyBoughtTogether.d.ts.map +0 -1
- package/dist/model/getRecommendTaskResponse.d.ts +0 -5
- package/dist/model/getRecommendTaskResponse.d.ts.map +0 -1
- package/dist/model/getRecommendationsParams.d.ts +0 -11
- package/dist/model/getRecommendationsParams.d.ts.map +0 -1
- package/dist/model/getRecommendationsResponse.d.ts +0 -5
- package/dist/model/getRecommendationsResponse.d.ts.map +0 -1
- package/dist/model/hideConsequenceObject.d.ts +0 -10
- package/dist/model/hideConsequenceObject.d.ts.map +0 -1
- package/dist/model/highlightResult.d.ts +0 -5
- package/dist/model/highlightResult.d.ts.map +0 -1
- package/dist/model/highlightResultOption.d.ts +0 -20
- package/dist/model/highlightResultOption.d.ts.map +0 -1
- package/dist/model/ignorePlurals.d.ts +0 -7
- package/dist/model/ignorePlurals.d.ts.map +0 -1
- package/dist/model/index.d.ts +0 -95
- package/dist/model/index.d.ts.map +0 -1
- package/dist/model/indexSettingsAsSearchParams.d.ts +0 -160
- package/dist/model/indexSettingsAsSearchParams.d.ts.map +0 -1
- package/dist/model/lookingSimilar.d.ts +0 -11
- package/dist/model/lookingSimilar.d.ts.map +0 -1
- package/dist/model/lookingSimilarModel.d.ts +0 -5
- package/dist/model/lookingSimilarModel.d.ts.map +0 -1
- package/dist/model/lookingSimilarQuery.d.ts +0 -4
- package/dist/model/lookingSimilarQuery.d.ts.map +0 -1
- package/dist/model/matchLevel.d.ts +0 -5
- package/dist/model/matchLevel.d.ts.map +0 -1
- package/dist/model/matchedGeoLocation.d.ts +0 -15
- package/dist/model/matchedGeoLocation.d.ts.map +0 -1
- package/dist/model/mode.d.ts +0 -5
- package/dist/model/mode.d.ts.map +0 -1
- package/dist/model/numericFilters.d.ts +0 -5
- package/dist/model/numericFilters.d.ts.map +0 -1
- package/dist/model/optionalFilters.d.ts +0 -5
- package/dist/model/optionalFilters.d.ts.map +0 -1
- package/dist/model/paramsConsequence.d.ts +0 -19
- package/dist/model/paramsConsequence.d.ts.map +0 -1
- package/dist/model/personalization.d.ts +0 -15
- package/dist/model/personalization.d.ts.map +0 -1
- package/dist/model/promoteConsequenceObject.d.ts +0 -14
- package/dist/model/promoteConsequenceObject.d.ts.map +0 -1
- package/dist/model/queryType.d.ts +0 -5
- package/dist/model/queryType.d.ts.map +0 -1
- package/dist/model/range.d.ts +0 -14
- package/dist/model/range.d.ts.map +0 -1
- package/dist/model/rankingInfo.d.ts +0 -54
- package/dist/model/rankingInfo.d.ts.map +0 -1
- package/dist/model/reRankingApplyFilter.d.ts +0 -5
- package/dist/model/reRankingApplyFilter.d.ts.map +0 -1
- package/dist/model/recommendHit.d.ts +0 -27
- package/dist/model/recommendHit.d.ts.map +0 -1
- package/dist/model/recommendModels.d.ts +0 -2
- package/dist/model/recommendModels.d.ts.map +0 -1
- package/dist/model/recommendRule.d.ts +0 -24
- package/dist/model/recommendRule.d.ts.map +0 -1
- package/dist/model/recommendationsHit.d.ts +0 -4
- package/dist/model/recommendationsHit.d.ts.map +0 -1
- package/dist/model/recommendationsHits.d.ts +0 -5
- package/dist/model/recommendationsHits.d.ts.map +0 -1
- package/dist/model/recommendationsRequest.d.ts +0 -8
- package/dist/model/recommendationsRequest.d.ts.map +0 -1
- package/dist/model/recommendationsResults.d.ts +0 -5
- package/dist/model/recommendationsResults.d.ts.map +0 -1
- package/dist/model/recommendedForYou.d.ts +0 -7
- package/dist/model/recommendedForYou.d.ts.map +0 -1
- package/dist/model/recommendedForYouModel.d.ts +0 -5
- package/dist/model/recommendedForYouModel.d.ts.map +0 -1
- package/dist/model/recommendedForYouQuery.d.ts +0 -4
- package/dist/model/recommendedForYouQuery.d.ts.map +0 -1
- package/dist/model/redirect.d.ts +0 -8
- package/dist/model/redirect.d.ts.map +0 -1
- package/dist/model/redirectRuleIndexData.d.ts +0 -7
- package/dist/model/redirectRuleIndexData.d.ts.map +0 -1
- package/dist/model/redirectRuleIndexMetadata.d.ts +0 -21
- package/dist/model/redirectRuleIndexMetadata.d.ts.map +0 -1
- package/dist/model/redirectURL.d.ts +0 -7
- package/dist/model/redirectURL.d.ts.map +0 -1
- package/dist/model/relatedModel.d.ts +0 -5
- package/dist/model/relatedModel.d.ts.map +0 -1
- package/dist/model/relatedProducts.d.ts +0 -11
- package/dist/model/relatedProducts.d.ts.map +0 -1
- package/dist/model/relatedQuery.d.ts +0 -4
- package/dist/model/relatedQuery.d.ts.map +0 -1
- package/dist/model/removeStopWords.d.ts +0 -6
- package/dist/model/removeStopWords.d.ts.map +0 -1
- package/dist/model/removeWordsIfNoResults.d.ts +0 -5
- package/dist/model/removeWordsIfNoResults.d.ts.map +0 -1
- package/dist/model/renderingContent.d.ts +0 -10
- package/dist/model/renderingContent.d.ts.map +0 -1
- package/dist/model/ruleMetadata.d.ts +0 -10
- package/dist/model/ruleMetadata.d.ts.map +0 -1
- package/dist/model/searchPagination.d.ts +0 -19
- package/dist/model/searchPagination.d.ts.map +0 -1
- package/dist/model/searchParams.d.ts +0 -3
- package/dist/model/searchParams.d.ts.map +0 -1
- package/dist/model/searchParamsObject.d.ts +0 -7
- package/dist/model/searchParamsObject.d.ts.map +0 -1
- package/dist/model/searchParamsQuery.d.ts +0 -7
- package/dist/model/searchParamsQuery.d.ts.map +0 -1
- package/dist/model/searchRecommendRulesParams.d.ts +0 -38
- package/dist/model/searchRecommendRulesParams.d.ts.map +0 -1
- package/dist/model/searchRecommendRulesResponse.d.ts +0 -20
- package/dist/model/searchRecommendRulesResponse.d.ts.map +0 -1
- package/dist/model/semanticSearch.d.ts +0 -10
- package/dist/model/semanticSearch.d.ts.map +0 -1
- package/dist/model/snippetResult.d.ts +0 -5
- package/dist/model/snippetResult.d.ts.map +0 -1
- package/dist/model/snippetResultOption.d.ts +0 -12
- package/dist/model/snippetResultOption.d.ts.map +0 -1
- package/dist/model/sortRemainingBy.d.ts +0 -5
- package/dist/model/sortRemainingBy.d.ts.map +0 -1
- package/dist/model/supportedLanguage.d.ts +0 -5
- package/dist/model/supportedLanguage.d.ts.map +0 -1
- package/dist/model/tagFilters.d.ts +0 -5
- package/dist/model/tagFilters.d.ts.map +0 -1
- package/dist/model/taskStatus.d.ts +0 -5
- package/dist/model/taskStatus.d.ts.map +0 -1
- package/dist/model/trendingFacetHit.d.ts +0 -18
- package/dist/model/trendingFacetHit.d.ts.map +0 -1
- package/dist/model/trendingFacets.d.ts +0 -11
- package/dist/model/trendingFacets.d.ts.map +0 -1
- package/dist/model/trendingFacetsModel.d.ts +0 -5
- package/dist/model/trendingFacetsModel.d.ts.map +0 -1
- package/dist/model/trendingFacetsQuery.d.ts +0 -4
- package/dist/model/trendingFacetsQuery.d.ts.map +0 -1
- package/dist/model/trendingItems.d.ts +0 -15
- package/dist/model/trendingItems.d.ts.map +0 -1
- package/dist/model/trendingItemsModel.d.ts +0 -5
- package/dist/model/trendingItemsModel.d.ts.map +0 -1
- package/dist/model/trendingItemsQuery.d.ts +0 -4
- package/dist/model/trendingItemsQuery.d.ts.map +0 -1
- package/dist/model/typoTolerance.d.ts +0 -6
- package/dist/model/typoTolerance.d.ts.map +0 -1
- package/dist/model/typoToleranceEnum.d.ts +0 -5
- package/dist/model/typoToleranceEnum.d.ts.map +0 -1
- package/dist/model/value.d.ts +0 -13
- package/dist/model/value.d.ts.map +0 -1
- package/dist/recommend.cjs +0 -394
- package/dist/recommend.esm.browser.js +0 -1079
- package/dist/recommend.esm.node.js +0 -391
- package/dist/recommend.umd.js +0 -2
- package/dist/src/recommendClient.d.ts +0 -132
- package/dist/src/recommendClient.d.ts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trendingFacetHit.d.ts","sourceRoot":"","sources":["../../model/trendingFacetHit.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { FallbackParams } from './fallbackParams';
|
|
2
|
-
import type { TrendingFacetsModel } from './trendingFacetsModel';
|
|
3
|
-
export type TrendingFacets = {
|
|
4
|
-
/**
|
|
5
|
-
* Facet attribute for which to retrieve trending facet values.
|
|
6
|
-
*/
|
|
7
|
-
facetName: any | null;
|
|
8
|
-
model: TrendingFacetsModel;
|
|
9
|
-
fallbackParameters?: FallbackParams;
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=trendingFacets.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trendingFacets.d.ts","sourceRoot":"","sources":["../../model/trendingFacets.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,SAAS,EAAE,GAAG,GAAG,IAAI,CAAC;IAEtB,KAAK,EAAE,mBAAmB,CAAC;IAE3B,kBAAkB,CAAC,EAAE,cAAc,CAAC;CACrC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trendingFacetsModel.d.ts","sourceRoot":"","sources":["../../model/trendingFacetsModel.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trendingFacetsQuery.d.ts","sourceRoot":"","sources":["../../model/trendingFacetsQuery.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,MAAM,MAAM,mBAAmB,GAAG,oBAAoB,GAAG,cAAc,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { SearchParamsObject } from './searchParamsObject';
|
|
2
|
-
import type { TrendingItemsModel } from './trendingItemsModel';
|
|
3
|
-
export type TrendingItems = {
|
|
4
|
-
/**
|
|
5
|
-
* Facet attribute. To be used in combination with `facetValue`. If specified, only recommendations matching the facet filter will be returned.
|
|
6
|
-
*/
|
|
7
|
-
facetName?: string;
|
|
8
|
-
/**
|
|
9
|
-
* Facet value. To be used in combination with `facetName`. If specified, only recommendations matching the facet filter will be returned.
|
|
10
|
-
*/
|
|
11
|
-
facetValue?: string;
|
|
12
|
-
model: TrendingItemsModel;
|
|
13
|
-
fallbackParameters?: SearchParamsObject;
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=trendingItems.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trendingItems.d.ts","sourceRoot":"","sources":["../../model/trendingItems.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,KAAK,EAAE,kBAAkB,CAAC;IAE1B,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACzC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trendingItemsModel.d.ts","sourceRoot":"","sources":["../../model/trendingItemsModel.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,gBAAgB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trendingItemsQuery.d.ts","sourceRoot":"","sources":["../../model/trendingItemsQuery.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,GAAG,aAAa,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { TypoToleranceEnum } from './typoToleranceEnum';
|
|
2
|
-
/**
|
|
3
|
-
* Whether [typo tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/) is enabled and how it is applied. If typo tolerance is true, `min`, or `strict`, [word splitting and concetenation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/splitting-and-concatenation/) is also active.
|
|
4
|
-
*/
|
|
5
|
-
export type TypoTolerance = TypoToleranceEnum | boolean;
|
|
6
|
-
//# sourceMappingURL=typoTolerance.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typoTolerance.d.ts","sourceRoot":"","sources":["../../model/typoTolerance.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG,OAAO,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* - `min`. Return matches with the lowest number of typos. For example, if you have matches without typos, only include those. But if there are no matches without typos (with 1 typo), include matches with 1 typo (2 typos). - `strict`. Return matches with the two lowest numbers of typos. With `strict`, the Typo ranking criterion is applied first in the `ranking` setting.
|
|
3
|
-
*/
|
|
4
|
-
export type TypoToleranceEnum = 'min' | 'strict';
|
|
5
|
-
//# sourceMappingURL=typoToleranceEnum.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typoToleranceEnum.d.ts","sourceRoot":"","sources":["../../model/typoToleranceEnum.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,QAAQ,CAAC"}
|
package/dist/model/value.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { SortRemainingBy } from './sortRemainingBy';
|
|
2
|
-
export type Value = {
|
|
3
|
-
/**
|
|
4
|
-
* Explicit order of facets or facet values. This setting lets you always show specific facets or facet values at the top of the list.
|
|
5
|
-
*/
|
|
6
|
-
order?: string[];
|
|
7
|
-
sortRemainingBy?: SortRemainingBy;
|
|
8
|
-
/**
|
|
9
|
-
* Hide facet values.
|
|
10
|
-
*/
|
|
11
|
-
hide?: string[];
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=value.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"value.d.ts","sourceRoot":"","sources":["../../model/value.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,MAAM,MAAM,KAAK,GAAG;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IAEjB,eAAe,CAAC,EAAE,eAAe,CAAC;IAElC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC"}
|
package/dist/recommend.cjs
DELETED
|
@@ -1,394 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var clientCommon = require('@algolia/client-common');
|
|
4
|
-
var requesterNodeHttp = require('@algolia/requester-node-http');
|
|
5
|
-
|
|
6
|
-
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
|
7
|
-
const apiClientVersion = '5.2.4';
|
|
8
|
-
function getDefaultHosts(appId) {
|
|
9
|
-
return [
|
|
10
|
-
{
|
|
11
|
-
url: `${appId}-dsn.algolia.net`,
|
|
12
|
-
accept: 'read',
|
|
13
|
-
protocol: 'https',
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
url: `${appId}.algolia.net`,
|
|
17
|
-
accept: 'write',
|
|
18
|
-
protocol: 'https',
|
|
19
|
-
},
|
|
20
|
-
].concat(clientCommon.shuffle([
|
|
21
|
-
{
|
|
22
|
-
url: `${appId}-1.algolianet.com`,
|
|
23
|
-
accept: 'readWrite',
|
|
24
|
-
protocol: 'https',
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
url: `${appId}-2.algolianet.com`,
|
|
28
|
-
accept: 'readWrite',
|
|
29
|
-
protocol: 'https',
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
url: `${appId}-3.algolianet.com`,
|
|
33
|
-
accept: 'readWrite',
|
|
34
|
-
protocol: 'https',
|
|
35
|
-
},
|
|
36
|
-
]));
|
|
37
|
-
}
|
|
38
|
-
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
39
|
-
function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }) {
|
|
40
|
-
const auth = clientCommon.createAuth(appIdOption, apiKeyOption, authMode);
|
|
41
|
-
const transporter = clientCommon.createTransporter({
|
|
42
|
-
hosts: getDefaultHosts(appIdOption),
|
|
43
|
-
...options,
|
|
44
|
-
algoliaAgent: clientCommon.getAlgoliaAgent({
|
|
45
|
-
algoliaAgents,
|
|
46
|
-
client: 'Recommend',
|
|
47
|
-
version: apiClientVersion,
|
|
48
|
-
}),
|
|
49
|
-
baseHeaders: {
|
|
50
|
-
'content-type': 'text/plain',
|
|
51
|
-
...auth.headers(),
|
|
52
|
-
...options.baseHeaders,
|
|
53
|
-
},
|
|
54
|
-
baseQueryParameters: {
|
|
55
|
-
...auth.queryParameters(),
|
|
56
|
-
...options.baseQueryParameters,
|
|
57
|
-
},
|
|
58
|
-
});
|
|
59
|
-
return {
|
|
60
|
-
transporter,
|
|
61
|
-
/**
|
|
62
|
-
* The `appId` currently in use.
|
|
63
|
-
*/
|
|
64
|
-
appId: appIdOption,
|
|
65
|
-
/**
|
|
66
|
-
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
67
|
-
*/
|
|
68
|
-
clearCache() {
|
|
69
|
-
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);
|
|
70
|
-
},
|
|
71
|
-
/**
|
|
72
|
-
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
73
|
-
*/
|
|
74
|
-
get _ua() {
|
|
75
|
-
return transporter.algoliaAgent.value;
|
|
76
|
-
},
|
|
77
|
-
/**
|
|
78
|
-
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
|
79
|
-
*
|
|
80
|
-
* @param segment - The algolia agent (user-agent) segment to add.
|
|
81
|
-
* @param version - The version of the agent.
|
|
82
|
-
*/
|
|
83
|
-
addAlgoliaAgent(segment, version) {
|
|
84
|
-
transporter.algoliaAgent.add({ segment, version });
|
|
85
|
-
},
|
|
86
|
-
/**
|
|
87
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
88
|
-
*
|
|
89
|
-
* @param customDelete - The customDelete object.
|
|
90
|
-
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
91
|
-
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
92
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
93
|
-
*/
|
|
94
|
-
customDelete({ path, parameters }, requestOptions) {
|
|
95
|
-
if (!path) {
|
|
96
|
-
throw new Error('Parameter `path` is required when calling `customDelete`.');
|
|
97
|
-
}
|
|
98
|
-
const requestPath = '/{path}'.replace('{path}', path);
|
|
99
|
-
const headers = {};
|
|
100
|
-
const queryParameters = parameters ? parameters : {};
|
|
101
|
-
const request = {
|
|
102
|
-
method: 'DELETE',
|
|
103
|
-
path: requestPath,
|
|
104
|
-
queryParameters,
|
|
105
|
-
headers,
|
|
106
|
-
};
|
|
107
|
-
return transporter.request(request, requestOptions);
|
|
108
|
-
},
|
|
109
|
-
/**
|
|
110
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
111
|
-
*
|
|
112
|
-
* @param customGet - The customGet object.
|
|
113
|
-
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
114
|
-
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
115
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
116
|
-
*/
|
|
117
|
-
customGet({ path, parameters }, requestOptions) {
|
|
118
|
-
if (!path) {
|
|
119
|
-
throw new Error('Parameter `path` is required when calling `customGet`.');
|
|
120
|
-
}
|
|
121
|
-
const requestPath = '/{path}'.replace('{path}', path);
|
|
122
|
-
const headers = {};
|
|
123
|
-
const queryParameters = parameters ? parameters : {};
|
|
124
|
-
const request = {
|
|
125
|
-
method: 'GET',
|
|
126
|
-
path: requestPath,
|
|
127
|
-
queryParameters,
|
|
128
|
-
headers,
|
|
129
|
-
};
|
|
130
|
-
return transporter.request(request, requestOptions);
|
|
131
|
-
},
|
|
132
|
-
/**
|
|
133
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
134
|
-
*
|
|
135
|
-
* @param customPost - The customPost object.
|
|
136
|
-
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
137
|
-
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
138
|
-
* @param customPost.body - Parameters to send with the custom request.
|
|
139
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
140
|
-
*/
|
|
141
|
-
customPost({ path, parameters, body }, requestOptions) {
|
|
142
|
-
if (!path) {
|
|
143
|
-
throw new Error('Parameter `path` is required when calling `customPost`.');
|
|
144
|
-
}
|
|
145
|
-
const requestPath = '/{path}'.replace('{path}', path);
|
|
146
|
-
const headers = {};
|
|
147
|
-
const queryParameters = parameters ? parameters : {};
|
|
148
|
-
const request = {
|
|
149
|
-
method: 'POST',
|
|
150
|
-
path: requestPath,
|
|
151
|
-
queryParameters,
|
|
152
|
-
headers,
|
|
153
|
-
data: body ? body : {},
|
|
154
|
-
};
|
|
155
|
-
return transporter.request(request, requestOptions);
|
|
156
|
-
},
|
|
157
|
-
/**
|
|
158
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
159
|
-
*
|
|
160
|
-
* @param customPut - The customPut object.
|
|
161
|
-
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
162
|
-
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
163
|
-
* @param customPut.body - Parameters to send with the custom request.
|
|
164
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
165
|
-
*/
|
|
166
|
-
customPut({ path, parameters, body }, requestOptions) {
|
|
167
|
-
if (!path) {
|
|
168
|
-
throw new Error('Parameter `path` is required when calling `customPut`.');
|
|
169
|
-
}
|
|
170
|
-
const requestPath = '/{path}'.replace('{path}', path);
|
|
171
|
-
const headers = {};
|
|
172
|
-
const queryParameters = parameters ? parameters : {};
|
|
173
|
-
const request = {
|
|
174
|
-
method: 'PUT',
|
|
175
|
-
path: requestPath,
|
|
176
|
-
queryParameters,
|
|
177
|
-
headers,
|
|
178
|
-
data: body ? body : {},
|
|
179
|
-
};
|
|
180
|
-
return transporter.request(request, requestOptions);
|
|
181
|
-
},
|
|
182
|
-
/**
|
|
183
|
-
* Deletes a Recommend rule from a recommendation scenario.
|
|
184
|
-
*
|
|
185
|
-
* Required API Key ACLs:
|
|
186
|
-
* - editSettings.
|
|
187
|
-
*
|
|
188
|
-
* @param deleteRecommendRule - The deleteRecommendRule object.
|
|
189
|
-
* @param deleteRecommendRule.indexName - Name of the index on which to perform the operation.
|
|
190
|
-
* @param deleteRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
191
|
-
* @param deleteRecommendRule.objectID - Unique record identifier.
|
|
192
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
193
|
-
*/
|
|
194
|
-
deleteRecommendRule({ indexName, model, objectID }, requestOptions) {
|
|
195
|
-
if (!indexName) {
|
|
196
|
-
throw new Error('Parameter `indexName` is required when calling `deleteRecommendRule`.');
|
|
197
|
-
}
|
|
198
|
-
if (!model) {
|
|
199
|
-
throw new Error('Parameter `model` is required when calling `deleteRecommendRule`.');
|
|
200
|
-
}
|
|
201
|
-
if (!objectID) {
|
|
202
|
-
throw new Error('Parameter `objectID` is required when calling `deleteRecommendRule`.');
|
|
203
|
-
}
|
|
204
|
-
const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/{objectID}'
|
|
205
|
-
.replace('{indexName}', encodeURIComponent(indexName))
|
|
206
|
-
.replace('{model}', encodeURIComponent(model))
|
|
207
|
-
.replace('{objectID}', encodeURIComponent(objectID));
|
|
208
|
-
const headers = {};
|
|
209
|
-
const queryParameters = {};
|
|
210
|
-
const request = {
|
|
211
|
-
method: 'DELETE',
|
|
212
|
-
path: requestPath,
|
|
213
|
-
queryParameters,
|
|
214
|
-
headers,
|
|
215
|
-
};
|
|
216
|
-
return transporter.request(request, requestOptions);
|
|
217
|
-
},
|
|
218
|
-
/**
|
|
219
|
-
* Retrieves a Recommend rule that you previously created in the Algolia dashboard.
|
|
220
|
-
*
|
|
221
|
-
* Required API Key ACLs:
|
|
222
|
-
* - settings.
|
|
223
|
-
*
|
|
224
|
-
* @param getRecommendRule - The getRecommendRule object.
|
|
225
|
-
* @param getRecommendRule.indexName - Name of the index on which to perform the operation.
|
|
226
|
-
* @param getRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
227
|
-
* @param getRecommendRule.objectID - Unique record identifier.
|
|
228
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
229
|
-
*/
|
|
230
|
-
getRecommendRule({ indexName, model, objectID }, requestOptions) {
|
|
231
|
-
if (!indexName) {
|
|
232
|
-
throw new Error('Parameter `indexName` is required when calling `getRecommendRule`.');
|
|
233
|
-
}
|
|
234
|
-
if (!model) {
|
|
235
|
-
throw new Error('Parameter `model` is required when calling `getRecommendRule`.');
|
|
236
|
-
}
|
|
237
|
-
if (!objectID) {
|
|
238
|
-
throw new Error('Parameter `objectID` is required when calling `getRecommendRule`.');
|
|
239
|
-
}
|
|
240
|
-
const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/{objectID}'
|
|
241
|
-
.replace('{indexName}', encodeURIComponent(indexName))
|
|
242
|
-
.replace('{model}', encodeURIComponent(model))
|
|
243
|
-
.replace('{objectID}', encodeURIComponent(objectID));
|
|
244
|
-
const headers = {};
|
|
245
|
-
const queryParameters = {};
|
|
246
|
-
const request = {
|
|
247
|
-
method: 'GET',
|
|
248
|
-
path: requestPath,
|
|
249
|
-
queryParameters,
|
|
250
|
-
headers,
|
|
251
|
-
};
|
|
252
|
-
return transporter.request(request, requestOptions);
|
|
253
|
-
},
|
|
254
|
-
/**
|
|
255
|
-
* Checks the status of a given task. Deleting a Recommend rule is asynchronous. When you delete a rule, a task is created on a queue and completed depending on the load on the server. The API response includes a task ID that you can use to check the status.
|
|
256
|
-
*
|
|
257
|
-
* Required API Key ACLs:
|
|
258
|
-
* - editSettings.
|
|
259
|
-
*
|
|
260
|
-
* @param getRecommendStatus - The getRecommendStatus object.
|
|
261
|
-
* @param getRecommendStatus.indexName - Name of the index on which to perform the operation.
|
|
262
|
-
* @param getRecommendStatus.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
263
|
-
* @param getRecommendStatus.taskID - Unique task identifier.
|
|
264
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
265
|
-
*/
|
|
266
|
-
getRecommendStatus({ indexName, model, taskID }, requestOptions) {
|
|
267
|
-
if (!indexName) {
|
|
268
|
-
throw new Error('Parameter `indexName` is required when calling `getRecommendStatus`.');
|
|
269
|
-
}
|
|
270
|
-
if (!model) {
|
|
271
|
-
throw new Error('Parameter `model` is required when calling `getRecommendStatus`.');
|
|
272
|
-
}
|
|
273
|
-
if (!taskID) {
|
|
274
|
-
throw new Error('Parameter `taskID` is required when calling `getRecommendStatus`.');
|
|
275
|
-
}
|
|
276
|
-
const requestPath = '/1/indexes/{indexName}/{model}/task/{taskID}'
|
|
277
|
-
.replace('{indexName}', encodeURIComponent(indexName))
|
|
278
|
-
.replace('{model}', encodeURIComponent(model))
|
|
279
|
-
.replace('{taskID}', encodeURIComponent(taskID));
|
|
280
|
-
const headers = {};
|
|
281
|
-
const queryParameters = {};
|
|
282
|
-
const request = {
|
|
283
|
-
method: 'GET',
|
|
284
|
-
path: requestPath,
|
|
285
|
-
queryParameters,
|
|
286
|
-
headers,
|
|
287
|
-
};
|
|
288
|
-
return transporter.request(request, requestOptions);
|
|
289
|
-
},
|
|
290
|
-
/**
|
|
291
|
-
* Retrieves recommendations from selected AI models.
|
|
292
|
-
*
|
|
293
|
-
* Required API Key ACLs:
|
|
294
|
-
* - search.
|
|
295
|
-
*
|
|
296
|
-
* @param getRecommendationsParams - The getRecommendationsParams object.
|
|
297
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
298
|
-
*/
|
|
299
|
-
getRecommendations(getRecommendationsParams, requestOptions) {
|
|
300
|
-
if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {
|
|
301
|
-
const newSignatureRequest = {
|
|
302
|
-
requests: getRecommendationsParams,
|
|
303
|
-
};
|
|
304
|
-
// eslint-disable-next-line no-param-reassign
|
|
305
|
-
getRecommendationsParams = newSignatureRequest;
|
|
306
|
-
}
|
|
307
|
-
if (!getRecommendationsParams) {
|
|
308
|
-
throw new Error('Parameter `getRecommendationsParams` is required when calling `getRecommendations`.');
|
|
309
|
-
}
|
|
310
|
-
if (!getRecommendationsParams.requests) {
|
|
311
|
-
throw new Error('Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.');
|
|
312
|
-
}
|
|
313
|
-
const requestPath = '/1/indexes/*/recommendations';
|
|
314
|
-
const headers = {};
|
|
315
|
-
const queryParameters = {};
|
|
316
|
-
const request = {
|
|
317
|
-
method: 'POST',
|
|
318
|
-
path: requestPath,
|
|
319
|
-
queryParameters,
|
|
320
|
-
headers,
|
|
321
|
-
data: getRecommendationsParams,
|
|
322
|
-
useReadTransporter: true,
|
|
323
|
-
cacheable: true,
|
|
324
|
-
};
|
|
325
|
-
return transporter.request(request, requestOptions);
|
|
326
|
-
},
|
|
327
|
-
/**
|
|
328
|
-
* Searches for Recommend rules. Use an empty query to list all rules for this recommendation scenario.
|
|
329
|
-
*
|
|
330
|
-
* Required API Key ACLs:
|
|
331
|
-
* - settings.
|
|
332
|
-
*
|
|
333
|
-
* @param searchRecommendRules - The searchRecommendRules object.
|
|
334
|
-
* @param searchRecommendRules.indexName - Name of the index on which to perform the operation.
|
|
335
|
-
* @param searchRecommendRules.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
336
|
-
* @param searchRecommendRules.searchRecommendRulesParams - The searchRecommendRulesParams object.
|
|
337
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
338
|
-
*/
|
|
339
|
-
searchRecommendRules({ indexName, model, searchRecommendRulesParams }, requestOptions) {
|
|
340
|
-
if (!indexName) {
|
|
341
|
-
throw new Error('Parameter `indexName` is required when calling `searchRecommendRules`.');
|
|
342
|
-
}
|
|
343
|
-
if (!model) {
|
|
344
|
-
throw new Error('Parameter `model` is required when calling `searchRecommendRules`.');
|
|
345
|
-
}
|
|
346
|
-
const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/search'
|
|
347
|
-
.replace('{indexName}', encodeURIComponent(indexName))
|
|
348
|
-
.replace('{model}', encodeURIComponent(model));
|
|
349
|
-
const headers = {};
|
|
350
|
-
const queryParameters = {};
|
|
351
|
-
const request = {
|
|
352
|
-
method: 'POST',
|
|
353
|
-
path: requestPath,
|
|
354
|
-
queryParameters,
|
|
355
|
-
headers,
|
|
356
|
-
data: searchRecommendRulesParams ? searchRecommendRulesParams : {},
|
|
357
|
-
useReadTransporter: true,
|
|
358
|
-
cacheable: true,
|
|
359
|
-
};
|
|
360
|
-
return transporter.request(request, requestOptions);
|
|
361
|
-
},
|
|
362
|
-
};
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
|
366
|
-
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
367
|
-
function recommendClient(appId, apiKey, options) {
|
|
368
|
-
if (!appId || typeof appId !== 'string') {
|
|
369
|
-
throw new Error('`appId` is missing.');
|
|
370
|
-
}
|
|
371
|
-
if (!apiKey || typeof apiKey !== 'string') {
|
|
372
|
-
throw new Error('`apiKey` is missing.');
|
|
373
|
-
}
|
|
374
|
-
return {
|
|
375
|
-
...createRecommendClient({
|
|
376
|
-
appId,
|
|
377
|
-
apiKey,
|
|
378
|
-
timeouts: {
|
|
379
|
-
connect: clientCommon.DEFAULT_CONNECT_TIMEOUT_NODE,
|
|
380
|
-
read: clientCommon.DEFAULT_READ_TIMEOUT_NODE,
|
|
381
|
-
write: clientCommon.DEFAULT_WRITE_TIMEOUT_NODE,
|
|
382
|
-
},
|
|
383
|
-
requester: requesterNodeHttp.createHttpRequester(),
|
|
384
|
-
algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
|
|
385
|
-
responsesCache: clientCommon.createNullCache(),
|
|
386
|
-
requestsCache: clientCommon.createNullCache(),
|
|
387
|
-
hostsCache: clientCommon.createMemoryCache(),
|
|
388
|
-
...options,
|
|
389
|
-
}),
|
|
390
|
-
};
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
exports.apiClientVersion = apiClientVersion;
|
|
394
|
-
exports.recommendClient = recommendClient;
|