algoliasearch 5.0.0-beta.1 → 5.0.0-beta.10
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/LICENSE +21 -0
- package/builds/browser.ts +13 -2
- package/builds/models.ts +140 -6
- package/builds/node.ts +37 -4
- package/dist/algoliasearch/builds/browser.d.ts +77 -70
- package/dist/algoliasearch/builds/browser.d.ts.map +1 -1
- package/dist/algoliasearch/builds/models.d.ts +4 -2
- package/dist/algoliasearch/builds/models.d.ts.map +1 -1
- package/dist/algoliasearch/builds/node.d.ts +77 -70
- package/dist/algoliasearch/builds/node.d.ts.map +1 -1
- package/dist/algoliasearch.cjs +524 -29
- package/dist/algoliasearch.esm.browser.js +517 -45
- package/dist/algoliasearch.esm.node.js +524 -29
- package/dist/algoliasearch.umd.js +2 -2
- package/dist/client-abtesting/src/abtestingClient.d.ts +1 -1
- package/dist/client-abtesting/src/abtestingClient.d.ts.map +1 -1
- package/dist/client-analytics/src/analyticsClient.d.ts +1 -1
- package/dist/client-analytics/src/analyticsClient.d.ts.map +1 -1
- package/dist/client-personalization/src/personalizationClient.d.ts +1 -1
- package/dist/client-personalization/src/personalizationClient.d.ts.map +1 -1
- package/dist/client-search/model/baseIndexSettings.d.ts +2 -2
- package/dist/client-search/model/baseIndexSettings.d.ts.map +1 -1
- package/dist/client-search/model/baseSearchResponse.d.ts +2 -18
- package/dist/client-search/model/baseSearchResponse.d.ts.map +1 -1
- package/dist/client-search/model/browsePagination.d.ts +19 -0
- package/dist/client-search/model/browsePagination.d.ts.map +1 -0
- package/dist/client-search/model/browseResponse.d.ts +2 -1
- package/dist/client-search/model/browseResponse.d.ts.map +1 -1
- package/dist/client-search/model/clientMethodProps.d.ts +31 -23
- package/dist/client-search/model/clientMethodProps.d.ts.map +1 -1
- package/dist/client-search/model/facetFilters.d.ts +1 -2
- package/dist/client-search/model/facetFilters.d.ts.map +1 -1
- package/dist/client-search/model/fetchedIndex.d.ts +4 -0
- package/dist/client-search/model/fetchedIndex.d.ts.map +1 -1
- package/dist/client-search/model/index.d.ts +5 -2
- package/dist/client-search/model/index.d.ts.map +1 -1
- package/dist/client-search/model/numericFilters.d.ts +1 -2
- package/dist/client-search/model/numericFilters.d.ts.map +1 -1
- package/dist/client-search/model/optionalFilters.d.ts +1 -2
- package/dist/client-search/model/optionalFilters.d.ts.map +1 -1
- package/dist/client-search/model/rankingInfo.d.ts +3 -3
- package/dist/client-search/model/rankingInfo.d.ts.map +1 -1
- package/dist/client-search/model/reRankingApplyFilter.d.ts +1 -2
- package/dist/client-search/model/reRankingApplyFilter.d.ts.map +1 -1
- package/dist/client-search/model/redirect.d.ts +1 -1
- package/dist/client-search/model/redirectURL.d.ts +7 -0
- package/dist/client-search/model/redirectURL.d.ts.map +1 -0
- package/dist/client-search/model/renderingContent.d.ts +2 -0
- package/dist/client-search/model/renderingContent.d.ts.map +1 -1
- package/dist/client-search/model/replaceAllObjectsResponse.d.ts +11 -0
- package/dist/client-search/model/replaceAllObjectsResponse.d.ts.map +1 -0
- package/dist/client-search/model/searchForFacetValuesResponse.d.ts +1 -1
- package/dist/client-search/model/searchPagination.d.ts +19 -0
- package/dist/client-search/model/searchPagination.d.ts.map +1 -0
- package/dist/client-search/model/searchResponse.d.ts +2 -1
- package/dist/client-search/model/searchResponse.d.ts.map +1 -1
- package/dist/{lite/model/securedAPIKeyRestrictions.d.ts → client-search/model/securedApiKeyRestrictions.d.ts} +2 -2
- package/dist/client-search/model/{securedAPIKeyRestrictions.d.ts.map → securedApiKeyRestrictions.d.ts.map} +1 -1
- package/dist/client-search/model/tagFilters.d.ts +1 -2
- package/dist/client-search/model/tagFilters.d.ts.map +1 -1
- package/dist/client-search/model/value.d.ts +4 -0
- package/dist/client-search/model/value.d.ts.map +1 -1
- package/dist/client-search/src/searchClient.d.ts +67 -12
- package/dist/client-search/src/searchClient.d.ts.map +1 -1
- package/dist/lite/builds/browser.d.ts +4 -3
- package/dist/lite/builds/browser.d.ts.map +1 -1
- package/dist/lite/builds/node.d.ts +4 -3
- package/dist/lite/builds/node.d.ts.map +1 -1
- package/dist/lite/lite.cjs +38 -1
- package/dist/lite/lite.esm.browser.js +48 -18
- package/dist/lite/lite.esm.node.js +38 -1
- package/dist/lite/lite.umd.js +2 -2
- package/dist/lite/model/baseIndexSettings.d.ts +2 -2
- package/dist/lite/model/baseIndexSettings.d.ts.map +1 -1
- package/dist/lite/model/baseRecommendRequest.d.ts +17 -0
- package/dist/lite/model/baseRecommendRequest.d.ts.map +1 -0
- package/dist/lite/model/baseSearchResponse.d.ts +2 -18
- package/dist/lite/model/baseSearchResponse.d.ts.map +1 -1
- package/dist/lite/model/boughtTogetherQuery.d.ts +4 -0
- package/dist/lite/model/boughtTogetherQuery.d.ts.map +1 -0
- package/dist/lite/model/browsePagination.d.ts +19 -0
- package/dist/lite/model/browsePagination.d.ts.map +1 -0
- package/dist/lite/model/browseResponse.d.ts +2 -1
- package/dist/lite/model/browseResponse.d.ts.map +1 -1
- package/dist/lite/model/clientMethodProps.d.ts +7 -0
- package/dist/lite/model/clientMethodProps.d.ts.map +1 -1
- package/dist/lite/model/facetFilters.d.ts +1 -2
- package/dist/lite/model/facetFilters.d.ts.map +1 -1
- package/dist/lite/model/fallbackParams.d.ts +3 -0
- package/dist/lite/model/fallbackParams.d.ts.map +1 -0
- package/dist/lite/model/fbtModel.d.ts +5 -0
- package/dist/lite/model/fbtModel.d.ts.map +1 -0
- package/dist/lite/model/frequentlyBoughtTogether.d.ts +9 -0
- package/dist/lite/model/frequentlyBoughtTogether.d.ts.map +1 -0
- package/dist/lite/model/getRecommendationsParams.d.ts +11 -0
- package/dist/lite/model/getRecommendationsParams.d.ts.map +1 -0
- package/dist/lite/model/getRecommendationsResponse.d.ts +5 -0
- package/dist/lite/model/getRecommendationsResponse.d.ts.map +1 -0
- package/dist/lite/model/index.d.ts +31 -40
- package/dist/lite/model/index.d.ts.map +1 -1
- package/dist/lite/model/lookingSimilar.d.ts +11 -0
- package/dist/lite/model/lookingSimilar.d.ts.map +1 -0
- package/dist/lite/model/lookingSimilarModel.d.ts +5 -0
- package/dist/lite/model/lookingSimilarModel.d.ts.map +1 -0
- package/dist/lite/model/lookingSimilarQuery.d.ts +4 -0
- package/dist/lite/model/lookingSimilarQuery.d.ts.map +1 -0
- package/dist/lite/model/numericFilters.d.ts +1 -2
- package/dist/lite/model/numericFilters.d.ts.map +1 -1
- package/dist/lite/model/optionalFilters.d.ts +1 -2
- package/dist/lite/model/optionalFilters.d.ts.map +1 -1
- package/dist/lite/model/rankingInfo.d.ts +3 -3
- package/dist/lite/model/rankingInfo.d.ts.map +1 -1
- package/dist/lite/model/reRankingApplyFilter.d.ts +1 -2
- package/dist/lite/model/reRankingApplyFilter.d.ts.map +1 -1
- package/dist/lite/model/recommendHit.d.ts +27 -0
- package/dist/lite/model/recommendHit.d.ts.map +1 -0
- package/dist/lite/model/recommendationsHit.d.ts +4 -0
- package/dist/lite/model/recommendationsHit.d.ts.map +1 -0
- package/dist/lite/model/recommendationsHits.d.ts +5 -0
- package/dist/lite/model/recommendationsHits.d.ts.map +1 -0
- package/dist/lite/model/recommendationsRequest.d.ts +8 -0
- package/dist/lite/model/recommendationsRequest.d.ts.map +1 -0
- package/dist/lite/model/recommendationsResults.d.ts +5 -0
- package/dist/lite/model/recommendationsResults.d.ts.map +1 -0
- package/dist/lite/model/recommendedForYou.d.ts +7 -0
- package/dist/lite/model/recommendedForYou.d.ts.map +1 -0
- package/dist/lite/model/recommendedForYouModel.d.ts +5 -0
- package/dist/lite/model/recommendedForYouModel.d.ts.map +1 -0
- package/dist/lite/model/recommendedForYouQuery.d.ts +4 -0
- package/dist/lite/model/recommendedForYouQuery.d.ts.map +1 -0
- package/dist/lite/model/redirect.d.ts +1 -1
- package/dist/lite/model/redirectURL.d.ts +7 -0
- package/dist/lite/model/redirectURL.d.ts.map +1 -0
- package/dist/lite/model/relatedModel.d.ts +5 -0
- package/dist/lite/model/relatedModel.d.ts.map +1 -0
- package/dist/lite/model/relatedProducts.d.ts +11 -0
- package/dist/lite/model/relatedProducts.d.ts.map +1 -0
- package/dist/lite/model/relatedQuery.d.ts +4 -0
- package/dist/lite/model/relatedQuery.d.ts.map +1 -0
- package/dist/lite/model/renderingContent.d.ts +2 -0
- package/dist/lite/model/renderingContent.d.ts.map +1 -1
- package/dist/lite/model/searchForFacetValuesResponse.d.ts +1 -1
- package/dist/lite/model/searchPagination.d.ts +19 -0
- package/dist/lite/model/searchPagination.d.ts.map +1 -0
- package/dist/lite/model/searchParams.d.ts +1 -2
- package/dist/lite/model/searchParams.d.ts.map +1 -1
- package/dist/lite/model/searchResponse.d.ts +2 -1
- package/dist/lite/model/searchResponse.d.ts.map +1 -1
- package/dist/lite/model/tagFilters.d.ts +1 -2
- package/dist/lite/model/tagFilters.d.ts.map +1 -1
- package/dist/lite/model/trendingFacetHit.d.ts +18 -0
- package/dist/lite/model/trendingFacetHit.d.ts.map +1 -0
- package/dist/lite/model/trendingFacets.d.ts +11 -0
- package/dist/lite/model/trendingFacets.d.ts.map +1 -0
- package/dist/lite/model/trendingFacetsModel.d.ts +5 -0
- package/dist/lite/model/trendingFacetsModel.d.ts.map +1 -0
- package/dist/lite/model/trendingFacetsQuery.d.ts +4 -0
- package/dist/lite/model/trendingFacetsQuery.d.ts.map +1 -0
- package/dist/lite/model/trendingItems.d.ts +15 -0
- package/dist/lite/model/trendingItems.d.ts.map +1 -0
- package/dist/lite/model/trendingItemsModel.d.ts +5 -0
- package/dist/lite/model/trendingItemsModel.d.ts.map +1 -0
- package/dist/lite/model/trendingItemsQuery.d.ts +4 -0
- package/dist/lite/model/trendingItemsQuery.d.ts.map +1 -0
- package/dist/lite/model/value.d.ts +4 -0
- package/dist/lite/model/value.d.ts.map +1 -1
- package/dist/lite/src/liteClient.d.ts +14 -2
- package/dist/lite/src/liteClient.d.ts.map +1 -1
- package/dist/recommend/model/advancedSyntaxFeatures.d.ts +2 -0
- package/dist/recommend/model/advancedSyntaxFeatures.d.ts.map +1 -0
- package/dist/recommend/model/alternativesAsExact.d.ts +2 -0
- package/dist/recommend/model/alternativesAsExact.d.ts.map +1 -0
- package/dist/recommend/model/aroundPrecision.d.ts +6 -0
- package/dist/recommend/model/aroundPrecision.d.ts.map +1 -0
- package/dist/recommend/model/aroundPrecisionFromValueInner.d.ts +14 -0
- package/dist/recommend/model/aroundPrecisionFromValueInner.d.ts.map +1 -0
- package/dist/recommend/model/aroundRadius.d.ts +6 -0
- package/dist/recommend/model/aroundRadius.d.ts.map +1 -0
- package/dist/recommend/model/aroundRadiusAll.d.ts +5 -0
- package/dist/recommend/model/aroundRadiusAll.d.ts.map +1 -0
- package/dist/recommend/model/autoFacetFilter.d.ts +14 -0
- package/dist/recommend/model/autoFacetFilter.d.ts.map +1 -0
- package/dist/recommend/model/baseRecommendRequest.d.ts +17 -0
- package/dist/recommend/model/baseRecommendRequest.d.ts.map +1 -0
- package/dist/recommend/model/baseSearchParams.d.ts +4 -0
- package/dist/recommend/model/baseSearchParams.d.ts.map +1 -0
- package/dist/recommend/model/baseSearchParamsWithoutQuery.d.ts +116 -0
- package/dist/recommend/model/baseSearchParamsWithoutQuery.d.ts.map +1 -0
- package/dist/recommend/model/baseSearchResponse.d.ts +94 -0
- package/dist/recommend/model/baseSearchResponse.d.ts.map +1 -0
- package/dist/recommend/model/boughtTogetherQuery.d.ts +4 -0
- package/dist/recommend/model/boughtTogetherQuery.d.ts.map +1 -0
- package/dist/recommend/model/clientMethodProps.d.ts +135 -0
- package/dist/recommend/model/clientMethodProps.d.ts.map +1 -0
- package/dist/recommend/model/condition.d.ts +14 -0
- package/dist/recommend/model/condition.d.ts.map +1 -0
- package/dist/recommend/model/consequence.d.ts +18 -0
- package/dist/recommend/model/consequence.d.ts.map +1 -0
- package/dist/{lite/model/updatedRuleResponse.d.ts → recommend/model/deletedAtResponse.d.ts} +9 -10
- package/dist/recommend/model/deletedAtResponse.d.ts.map +1 -0
- package/dist/recommend/model/distinct.d.ts +5 -0
- package/dist/recommend/model/distinct.d.ts.map +1 -0
- package/dist/recommend/model/errorBase.d.ts +7 -0
- package/dist/recommend/model/errorBase.d.ts.map +1 -0
- package/dist/recommend/model/exactOnSingleWordQuery.d.ts +5 -0
- package/dist/recommend/model/exactOnSingleWordQuery.d.ts.map +1 -0
- package/dist/recommend/model/exhaustive.d.ts +26 -0
- package/dist/recommend/model/exhaustive.d.ts.map +1 -0
- package/dist/recommend/model/facetFilters.d.ts +5 -0
- package/dist/recommend/model/facetFilters.d.ts.map +1 -0
- package/dist/recommend/model/facetOrdering.d.ts +13 -0
- package/dist/recommend/model/facetOrdering.d.ts.map +1 -0
- package/dist/recommend/model/facets.d.ts +10 -0
- package/dist/recommend/model/facets.d.ts.map +1 -0
- package/dist/recommend/model/facetsStats.d.ts +19 -0
- package/dist/recommend/model/facetsStats.d.ts.map +1 -0
- package/dist/recommend/model/fallbackParams.d.ts +3 -0
- package/dist/recommend/model/fallbackParams.d.ts.map +1 -0
- package/dist/recommend/model/fbtModel.d.ts +5 -0
- package/dist/recommend/model/fbtModel.d.ts.map +1 -0
- package/dist/recommend/model/frequentlyBoughtTogether.d.ts +9 -0
- package/dist/recommend/model/frequentlyBoughtTogether.d.ts.map +1 -0
- package/dist/recommend/model/getRecommendTaskResponse.d.ts +5 -0
- package/dist/recommend/model/getRecommendTaskResponse.d.ts.map +1 -0
- package/dist/recommend/model/getRecommendationsParams.d.ts +11 -0
- package/dist/recommend/model/getRecommendationsParams.d.ts.map +1 -0
- package/dist/recommend/model/getRecommendationsResponse.d.ts +5 -0
- package/dist/recommend/model/getRecommendationsResponse.d.ts.map +1 -0
- package/dist/recommend/model/hideConsequenceObject.d.ts +10 -0
- package/dist/recommend/model/hideConsequenceObject.d.ts.map +1 -0
- package/dist/recommend/model/highlightResult.d.ts +3 -0
- package/dist/recommend/model/highlightResult.d.ts.map +1 -0
- package/dist/recommend/model/highlightResultOption.d.ts +20 -0
- package/dist/recommend/model/highlightResultOption.d.ts.map +1 -0
- package/dist/recommend/model/ignorePlurals.d.ts +6 -0
- package/dist/recommend/model/ignorePlurals.d.ts.map +1 -0
- package/dist/recommend/model/index.d.ts +94 -0
- package/dist/recommend/model/index.d.ts.map +1 -0
- package/dist/recommend/model/indexSettingsAsSearchParams.d.ts +160 -0
- package/dist/recommend/model/indexSettingsAsSearchParams.d.ts.map +1 -0
- package/dist/recommend/model/lookingSimilar.d.ts +11 -0
- package/dist/recommend/model/lookingSimilar.d.ts.map +1 -0
- package/dist/recommend/model/lookingSimilarModel.d.ts +5 -0
- package/dist/recommend/model/lookingSimilarModel.d.ts.map +1 -0
- package/dist/recommend/model/lookingSimilarQuery.d.ts +4 -0
- package/dist/recommend/model/lookingSimilarQuery.d.ts.map +1 -0
- package/dist/recommend/model/matchLevel.d.ts +5 -0
- package/dist/recommend/model/matchLevel.d.ts.map +1 -0
- package/dist/recommend/model/matchedGeoLocation.d.ts +15 -0
- package/dist/recommend/model/matchedGeoLocation.d.ts.map +1 -0
- package/dist/recommend/model/mode.d.ts +5 -0
- package/dist/recommend/model/mode.d.ts.map +1 -0
- package/dist/recommend/model/numericFilters.d.ts +5 -0
- package/dist/recommend/model/numericFilters.d.ts.map +1 -0
- package/dist/recommend/model/optionalFilters.d.ts +5 -0
- package/dist/recommend/model/optionalFilters.d.ts.map +1 -0
- package/dist/recommend/model/paramsConsequence.d.ts +19 -0
- package/dist/recommend/model/paramsConsequence.d.ts.map +1 -0
- package/dist/recommend/model/personalization.d.ts +15 -0
- package/dist/recommend/model/personalization.d.ts.map +1 -0
- package/dist/recommend/model/promoteConsequenceObject.d.ts +14 -0
- package/dist/recommend/model/promoteConsequenceObject.d.ts.map +1 -0
- package/dist/recommend/model/queryType.d.ts +5 -0
- package/dist/recommend/model/queryType.d.ts.map +1 -0
- package/dist/recommend/model/rankingInfo.d.ts +54 -0
- package/dist/recommend/model/rankingInfo.d.ts.map +1 -0
- package/dist/recommend/model/reRankingApplyFilter.d.ts +5 -0
- package/dist/recommend/model/reRankingApplyFilter.d.ts.map +1 -0
- package/dist/recommend/model/recommendHit.d.ts +27 -0
- package/dist/recommend/model/recommendHit.d.ts.map +1 -0
- package/dist/recommend/model/recommendModels.d.ts +2 -0
- package/dist/recommend/model/recommendModels.d.ts.map +1 -0
- package/dist/recommend/model/recommendRule.d.ts +24 -0
- package/dist/recommend/model/recommendRule.d.ts.map +1 -0
- package/dist/recommend/model/recommendRuleMetadata.d.ts +10 -0
- package/dist/recommend/model/recommendRuleMetadata.d.ts.map +1 -0
- package/dist/recommend/model/recommendationsHit.d.ts +4 -0
- package/dist/recommend/model/recommendationsHit.d.ts.map +1 -0
- package/dist/recommend/model/recommendationsHits.d.ts +5 -0
- package/dist/recommend/model/recommendationsHits.d.ts.map +1 -0
- package/dist/recommend/model/recommendationsRequest.d.ts +8 -0
- package/dist/recommend/model/recommendationsRequest.d.ts.map +1 -0
- package/dist/recommend/model/recommendationsResults.d.ts +5 -0
- package/dist/recommend/model/recommendationsResults.d.ts.map +1 -0
- package/dist/recommend/model/recommendedForYou.d.ts +7 -0
- package/dist/recommend/model/recommendedForYou.d.ts.map +1 -0
- package/dist/recommend/model/recommendedForYouModel.d.ts +5 -0
- package/dist/recommend/model/recommendedForYouModel.d.ts.map +1 -0
- package/dist/recommend/model/recommendedForYouQuery.d.ts +4 -0
- package/dist/recommend/model/recommendedForYouQuery.d.ts.map +1 -0
- package/dist/recommend/model/redirect.d.ts +8 -0
- package/dist/recommend/model/redirect.d.ts.map +1 -0
- package/dist/recommend/model/redirectRuleIndexMetadata.d.ts +21 -0
- package/dist/recommend/model/redirectRuleIndexMetadata.d.ts.map +1 -0
- package/dist/recommend/model/redirectRuleIndexMetadataData.d.ts +7 -0
- package/dist/recommend/model/redirectRuleIndexMetadataData.d.ts.map +1 -0
- package/dist/recommend/model/redirectURL.d.ts +7 -0
- package/dist/recommend/model/redirectURL.d.ts.map +1 -0
- package/dist/recommend/model/relatedModel.d.ts +5 -0
- package/dist/recommend/model/relatedModel.d.ts.map +1 -0
- package/dist/recommend/model/relatedProducts.d.ts +11 -0
- package/dist/recommend/model/relatedProducts.d.ts.map +1 -0
- package/dist/recommend/model/relatedQuery.d.ts +4 -0
- package/dist/recommend/model/relatedQuery.d.ts.map +1 -0
- package/dist/recommend/model/removeStopWords.d.ts +6 -0
- package/dist/recommend/model/removeStopWords.d.ts.map +1 -0
- package/dist/recommend/model/removeWordsIfNoResults.d.ts +5 -0
- package/dist/recommend/model/removeWordsIfNoResults.d.ts.map +1 -0
- package/dist/recommend/model/renderingContent.d.ts +10 -0
- package/dist/recommend/model/renderingContent.d.ts.map +1 -0
- package/dist/recommend/model/searchPagination.d.ts +19 -0
- package/dist/recommend/model/searchPagination.d.ts.map +1 -0
- package/dist/recommend/model/searchParams.d.ts +3 -0
- package/dist/recommend/model/searchParams.d.ts.map +1 -0
- package/dist/recommend/model/searchParamsObject.d.ts +7 -0
- package/dist/recommend/model/searchParamsObject.d.ts.map +1 -0
- package/dist/recommend/model/searchParamsQuery.d.ts +7 -0
- package/dist/recommend/model/searchParamsQuery.d.ts.map +1 -0
- package/dist/recommend/model/searchRecommendRulesParams.d.ts +38 -0
- package/dist/recommend/model/searchRecommendRulesParams.d.ts.map +1 -0
- package/dist/recommend/model/searchRecommendRulesResponse.d.ts +20 -0
- package/dist/recommend/model/searchRecommendRulesResponse.d.ts.map +1 -0
- package/dist/recommend/model/semanticSearch.d.ts +10 -0
- package/dist/recommend/model/semanticSearch.d.ts.map +1 -0
- package/dist/recommend/model/snippetResult.d.ts +3 -0
- package/dist/recommend/model/snippetResult.d.ts.map +1 -0
- package/dist/recommend/model/snippetResultOption.d.ts +12 -0
- package/dist/recommend/model/snippetResultOption.d.ts.map +1 -0
- package/dist/recommend/model/sortRemainingBy.d.ts +5 -0
- package/dist/recommend/model/sortRemainingBy.d.ts.map +1 -0
- package/dist/recommend/model/supportedLanguage.d.ts +5 -0
- package/dist/recommend/model/supportedLanguage.d.ts.map +1 -0
- package/dist/recommend/model/tagFilters.d.ts +5 -0
- package/dist/recommend/model/tagFilters.d.ts.map +1 -0
- package/dist/recommend/model/taskStatus.d.ts.map +1 -0
- package/dist/recommend/model/trendingFacetHit.d.ts +18 -0
- package/dist/recommend/model/trendingFacetHit.d.ts.map +1 -0
- package/dist/recommend/model/trendingFacets.d.ts +11 -0
- package/dist/recommend/model/trendingFacets.d.ts.map +1 -0
- package/dist/recommend/model/trendingFacetsModel.d.ts +5 -0
- package/dist/recommend/model/trendingFacetsModel.d.ts.map +1 -0
- package/dist/recommend/model/trendingFacetsQuery.d.ts +4 -0
- package/dist/recommend/model/trendingFacetsQuery.d.ts.map +1 -0
- package/dist/recommend/model/trendingItems.d.ts +15 -0
- package/dist/recommend/model/trendingItems.d.ts.map +1 -0
- package/dist/recommend/model/trendingItemsModel.d.ts +5 -0
- package/dist/recommend/model/trendingItemsModel.d.ts.map +1 -0
- package/dist/recommend/model/trendingItemsQuery.d.ts +4 -0
- package/dist/recommend/model/trendingItemsQuery.d.ts.map +1 -0
- package/dist/recommend/model/typoTolerance.d.ts +6 -0
- package/dist/recommend/model/typoTolerance.d.ts.map +1 -0
- package/dist/recommend/model/typoToleranceEnum.d.ts +5 -0
- package/dist/recommend/model/typoToleranceEnum.d.ts.map +1 -0
- package/dist/recommend/model/value.d.ts +13 -0
- package/dist/recommend/model/value.d.ts.map +1 -0
- package/dist/recommend/src/recommendClient.d.ts +132 -0
- package/dist/recommend/src/recommendClient.d.ts.map +1 -0
- package/lite/model/baseIndexSettings.ts +2 -2
- package/lite/model/baseRecommendRequest.ts +22 -0
- package/lite/model/baseSearchResponse.ts +2 -22
- package/lite/model/boughtTogetherQuery.ts +7 -0
- package/lite/model/browsePagination.ts +23 -0
- package/lite/model/browseResponse.ts +2 -0
- package/lite/model/clientMethodProps.ts +8 -0
- package/lite/model/facetFilters.ts +1 -3
- package/lite/model/{attributeToUpdate.ts → fallbackParams.ts} +2 -2
- package/lite/model/{builtInOperationType.ts → fbtModel.ts} +2 -9
- package/lite/model/{consequenceHide.ts → frequentlyBoughtTogether.ts} +5 -4
- package/lite/model/getRecommendationsParams.ts +13 -0
- package/lite/model/{apiKeyOperation.ts → getRecommendationsResponse.ts} +5 -1
- package/lite/model/index.ts +31 -40
- package/lite/model/lookingSimilar.ts +15 -0
- package/lite/model/lookingSimilarModel.ts +6 -0
- package/lite/model/lookingSimilarQuery.ts +6 -0
- package/lite/model/numericFilters.ts +1 -3
- package/lite/model/optionalFilters.ts +1 -3
- package/lite/model/rankingInfo.ts +3 -3
- package/lite/model/reRankingApplyFilter.ts +1 -3
- package/lite/model/recommendHit.ts +34 -0
- package/lite/model/{promote.ts → recommendationsHit.ts} +3 -3
- package/lite/model/{searchParamsString.ts → recommendationsHits.ts} +4 -5
- package/lite/model/recommendationsRequest.ts +16 -0
- package/lite/model/recommendationsResults.ts +9 -0
- package/lite/model/recommendedForYou.ts +10 -0
- package/lite/model/{operationType.ts → recommendedForYouModel.ts} +2 -2
- package/lite/model/recommendedForYouQuery.ts +6 -0
- package/lite/model/redirect.ts +1 -1
- package/lite/model/{dictionaryAction.ts → redirectURL.ts} +4 -2
- package/lite/model/relatedModel.ts +6 -0
- package/lite/model/{promoteObjectID.ts → relatedProducts.ts} +7 -8
- package/lite/model/relatedQuery.ts +6 -0
- package/lite/model/renderingContent.ts +3 -0
- package/lite/model/searchForFacetValuesResponse.ts +1 -1
- package/lite/model/{searchDictionaryEntriesResponse.ts → searchPagination.ts} +7 -9
- package/lite/model/searchParams.ts +1 -2
- package/lite/model/searchResponse.ts +3 -1
- package/lite/model/tagFilters.ts +1 -3
- package/lite/model/trendingFacetHit.ts +21 -0
- package/lite/model/trendingFacets.ts +15 -0
- package/lite/model/trendingFacetsModel.ts +6 -0
- package/lite/model/trendingFacetsQuery.ts +6 -0
- package/lite/model/trendingItems.ts +20 -0
- package/lite/model/{dictionaryEntryState.ts → trendingItemsModel.ts} +2 -2
- package/lite/model/trendingItemsQuery.ts +6 -0
- package/lite/model/value.ts +5 -0
- package/lite/src/liteClient.ts +57 -1
- package/package.json +18 -14
- package/dist/client-search/model/mixedSearchFilters.d.ts +0 -2
- package/dist/client-search/model/mixedSearchFilters.d.ts.map +0 -1
- package/dist/client-search/model/securedAPIKeyRestrictions.d.ts +0 -25
- package/dist/lite/model/action.d.ts +0 -5
- package/dist/lite/model/action.d.ts.map +0 -1
- package/dist/lite/model/addApiKeyResponse.d.ts +0 -11
- package/dist/lite/model/addApiKeyResponse.d.ts.map +0 -1
- package/dist/lite/model/anchoring.d.ts +0 -5
- package/dist/lite/model/anchoring.d.ts.map +0 -1
- package/dist/lite/model/apiKeyOperation.d.ts +0 -2
- package/dist/lite/model/apiKeyOperation.d.ts.map +0 -1
- package/dist/lite/model/attributeToUpdate.d.ts +0 -3
- package/dist/lite/model/attributeToUpdate.d.ts.map +0 -1
- package/dist/lite/model/browseParams.d.ts +0 -4
- package/dist/lite/model/browseParams.d.ts.map +0 -1
- package/dist/lite/model/builtInOperation.d.ts +0 -12
- package/dist/lite/model/builtInOperation.d.ts.map +0 -1
- package/dist/lite/model/builtInOperationType.d.ts +0 -5
- package/dist/lite/model/builtInOperationType.d.ts.map +0 -1
- package/dist/lite/model/condition.d.ts +0 -21
- package/dist/lite/model/condition.d.ts.map +0 -1
- package/dist/lite/model/consequence.d.ts +0 -26
- package/dist/lite/model/consequence.d.ts.map +0 -1
- package/dist/lite/model/consequenceHide.d.ts +0 -10
- package/dist/lite/model/consequenceHide.d.ts.map +0 -1
- package/dist/lite/model/deleteByParams.d.ts +0 -27
- package/dist/lite/model/deleteByParams.d.ts.map +0 -1
- package/dist/lite/model/dictionaryAction.d.ts +0 -5
- package/dist/lite/model/dictionaryAction.d.ts.map +0 -1
- package/dist/lite/model/dictionaryEntry.d.ts +0 -26
- package/dist/lite/model/dictionaryEntry.d.ts.map +0 -1
- package/dist/lite/model/dictionaryEntryState.d.ts +0 -5
- package/dist/lite/model/dictionaryEntryState.d.ts.map +0 -1
- package/dist/lite/model/dictionaryLanguage.d.ts +0 -10
- package/dist/lite/model/dictionaryLanguage.d.ts.map +0 -1
- package/dist/lite/model/dictionaryType.d.ts +0 -2
- package/dist/lite/model/dictionaryType.d.ts.map +0 -1
- package/dist/lite/model/fetchedIndex.d.ts +0 -47
- package/dist/lite/model/fetchedIndex.d.ts.map +0 -1
- package/dist/lite/model/languages.d.ts +0 -10
- package/dist/lite/model/languages.d.ts.map +0 -1
- package/dist/lite/model/listIndicesResponse.d.ts +0 -12
- package/dist/lite/model/listIndicesResponse.d.ts.map +0 -1
- package/dist/lite/model/logType.d.ts +0 -2
- package/dist/lite/model/logType.d.ts.map +0 -1
- package/dist/lite/model/mixedSearchFilters.d.ts +0 -2
- package/dist/lite/model/mixedSearchFilters.d.ts.map +0 -1
- package/dist/lite/model/operationType.d.ts +0 -5
- package/dist/lite/model/operationType.d.ts.map +0 -1
- package/dist/lite/model/promote.d.ts +0 -4
- package/dist/lite/model/promote.d.ts.map +0 -1
- package/dist/lite/model/promoteObjectID.d.ts +0 -14
- package/dist/lite/model/promoteObjectID.d.ts.map +0 -1
- package/dist/lite/model/promoteObjectIDs.d.ts +0 -14
- package/dist/lite/model/promoteObjectIDs.d.ts.map +0 -1
- package/dist/lite/model/rule.d.ts +0 -30
- package/dist/lite/model/rule.d.ts.map +0 -1
- package/dist/lite/model/scopeType.d.ts +0 -2
- package/dist/lite/model/scopeType.d.ts.map +0 -1
- package/dist/lite/model/searchDictionaryEntriesResponse.d.ts +0 -20
- package/dist/lite/model/searchDictionaryEntriesResponse.d.ts.map +0 -1
- package/dist/lite/model/searchParamsString.d.ts +0 -7
- package/dist/lite/model/searchParamsString.d.ts.map +0 -1
- package/dist/lite/model/searchSynonymsResponse.d.ts +0 -12
- package/dist/lite/model/searchSynonymsResponse.d.ts.map +0 -1
- package/dist/lite/model/securedAPIKeyRestrictions.d.ts.map +0 -1
- package/dist/lite/model/source.d.ts +0 -14
- package/dist/lite/model/source.d.ts.map +0 -1
- package/dist/lite/model/standardEntries.d.ts +0 -18
- package/dist/lite/model/standardEntries.d.ts.map +0 -1
- package/dist/lite/model/synonymHit.d.ts +0 -36
- package/dist/lite/model/synonymHit.d.ts.map +0 -1
- package/dist/lite/model/synonymType.d.ts +0 -5
- package/dist/lite/model/synonymType.d.ts.map +0 -1
- package/dist/lite/model/taskStatus.d.ts.map +0 -1
- package/dist/lite/model/timeRange.d.ts +0 -11
- package/dist/lite/model/timeRange.d.ts.map +0 -1
- package/dist/lite/model/updatedRuleResponse.d.ts.map +0 -1
- package/dist/lite/model/userId.d.ts +0 -22
- package/dist/lite/model/userId.d.ts.map +0 -1
- package/lite/model/action.ts +0 -13
- package/lite/model/addApiKeyResponse.ts +0 -13
- package/lite/model/anchoring.ts +0 -6
- package/lite/model/browseParams.ts +0 -6
- package/lite/model/builtInOperation.ts +0 -15
- package/lite/model/condition.ts +0 -27
- package/lite/model/consequence.ts +0 -32
- package/lite/model/deleteByParams.ts +0 -36
- package/lite/model/dictionaryEntry.ts +0 -33
- package/lite/model/dictionaryLanguage.ts +0 -11
- package/lite/model/dictionaryType.ts +0 -3
- package/lite/model/fetchedIndex.ts +0 -58
- package/lite/model/languages.ts +0 -14
- package/lite/model/listIndicesResponse.ts +0 -15
- package/lite/model/logType.ts +0 -3
- package/lite/model/mixedSearchFilters.ts +0 -3
- package/lite/model/promoteObjectIDs.ts +0 -16
- package/lite/model/rule.ts +0 -37
- package/lite/model/scopeType.ts +0 -3
- package/lite/model/searchSynonymsResponse.ts +0 -15
- package/lite/model/securedAPIKeyRestrictions.ts +0 -32
- package/lite/model/source.ts +0 -16
- package/lite/model/standardEntries.ts +0 -21
- package/lite/model/synonymHit.ts +0 -45
- package/lite/model/synonymType.ts +0 -11
- package/lite/model/taskStatus.ts +0 -6
- package/lite/model/timeRange.ts +0 -13
- package/lite/model/updatedRuleResponse.ts +0 -18
- package/lite/model/userId.ts +0 -26
- /package/dist/{lite → recommend}/model/taskStatus.d.ts +0 -0
package/dist/algoliasearch.cjs
CHANGED
|
@@ -5,9 +5,9 @@ var clientCommon = require('@algolia/client-common');
|
|
|
5
5
|
var requesterNodeHttp = require('@algolia/requester-node-http');
|
|
6
6
|
|
|
7
7
|
// 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.
|
|
8
|
-
const apiClientVersion$
|
|
8
|
+
const apiClientVersion$5 = '5.0.0-beta.10';
|
|
9
9
|
const REGIONS$2 = ['de', 'us'];
|
|
10
|
-
function getDefaultHosts$
|
|
10
|
+
function getDefaultHosts$4(region) {
|
|
11
11
|
const url = !region
|
|
12
12
|
? 'analytics.algolia.com'
|
|
13
13
|
: 'analytics.{region}.algolia.com'.replace('{region}', region);
|
|
@@ -17,12 +17,12 @@ function getDefaultHosts$3(region) {
|
|
|
17
17
|
function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }) {
|
|
18
18
|
const auth = clientCommon.createAuth(appIdOption, apiKeyOption, authMode);
|
|
19
19
|
const transporter = clientCommon.createTransporter({
|
|
20
|
-
hosts: getDefaultHosts$
|
|
20
|
+
hosts: getDefaultHosts$4(regionOption),
|
|
21
21
|
...options,
|
|
22
22
|
algoliaAgent: clientCommon.getAlgoliaAgent({
|
|
23
23
|
algoliaAgents,
|
|
24
24
|
client: 'Abtesting',
|
|
25
|
-
version: apiClientVersion$
|
|
25
|
+
version: apiClientVersion$5,
|
|
26
26
|
}),
|
|
27
27
|
baseHeaders: {
|
|
28
28
|
'content-type': 'text/plain',
|
|
@@ -310,9 +310,9 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
310
310
|
}
|
|
311
311
|
|
|
312
312
|
// 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.
|
|
313
|
-
const apiClientVersion$
|
|
313
|
+
const apiClientVersion$4 = '5.0.0-beta.10';
|
|
314
314
|
const REGIONS$1 = ['de', 'us'];
|
|
315
|
-
function getDefaultHosts$
|
|
315
|
+
function getDefaultHosts$3(region) {
|
|
316
316
|
const url = !region
|
|
317
317
|
? 'analytics.algolia.com'
|
|
318
318
|
: 'analytics.{region}.algolia.com'.replace('{region}', region);
|
|
@@ -322,12 +322,12 @@ function getDefaultHosts$2(region) {
|
|
|
322
322
|
function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }) {
|
|
323
323
|
const auth = clientCommon.createAuth(appIdOption, apiKeyOption, authMode);
|
|
324
324
|
const transporter = clientCommon.createTransporter({
|
|
325
|
-
hosts: getDefaultHosts$
|
|
325
|
+
hosts: getDefaultHosts$3(regionOption),
|
|
326
326
|
...options,
|
|
327
327
|
algoliaAgent: clientCommon.getAlgoliaAgent({
|
|
328
328
|
algoliaAgents,
|
|
329
329
|
client: 'Analytics',
|
|
330
|
-
version: apiClientVersion$
|
|
330
|
+
version: apiClientVersion$4,
|
|
331
331
|
}),
|
|
332
332
|
baseHeaders: {
|
|
333
333
|
'content-type': 'text/plain',
|
|
@@ -1365,9 +1365,9 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
1365
1365
|
}
|
|
1366
1366
|
|
|
1367
1367
|
// 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.
|
|
1368
|
-
const apiClientVersion$
|
|
1368
|
+
const apiClientVersion$3 = '5.0.0-beta.10';
|
|
1369
1369
|
const REGIONS = ['eu', 'us'];
|
|
1370
|
-
function getDefaultHosts$
|
|
1370
|
+
function getDefaultHosts$2(region) {
|
|
1371
1371
|
const url = 'personalization.{region}.algolia.com'.replace('{region}', region);
|
|
1372
1372
|
return [{ url, accept: 'readWrite', protocol: 'https' }];
|
|
1373
1373
|
}
|
|
@@ -1375,12 +1375,12 @@ function getDefaultHosts$1(region) {
|
|
|
1375
1375
|
function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }) {
|
|
1376
1376
|
const auth = clientCommon.createAuth(appIdOption, apiKeyOption, authMode);
|
|
1377
1377
|
const transporter = clientCommon.createTransporter({
|
|
1378
|
-
hosts: getDefaultHosts$
|
|
1378
|
+
hosts: getDefaultHosts$2(regionOption),
|
|
1379
1379
|
...options,
|
|
1380
1380
|
algoliaAgent: clientCommon.getAlgoliaAgent({
|
|
1381
1381
|
algoliaAgents,
|
|
1382
1382
|
client: 'Personalization',
|
|
1383
|
-
version: apiClientVersion$
|
|
1383
|
+
version: apiClientVersion$3,
|
|
1384
1384
|
}),
|
|
1385
1385
|
baseHeaders: {
|
|
1386
1386
|
'content-type': 'text/plain',
|
|
@@ -1626,8 +1626,8 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
1626
1626
|
}
|
|
1627
1627
|
|
|
1628
1628
|
// 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.
|
|
1629
|
-
const apiClientVersion$
|
|
1630
|
-
function getDefaultHosts(appId) {
|
|
1629
|
+
const apiClientVersion$2 = '5.0.0-beta.10';
|
|
1630
|
+
function getDefaultHosts$1(appId) {
|
|
1631
1631
|
return [
|
|
1632
1632
|
{
|
|
1633
1633
|
url: `${appId}-dsn.algolia.net`,
|
|
@@ -1661,12 +1661,12 @@ function getDefaultHosts(appId) {
|
|
|
1661
1661
|
function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }) {
|
|
1662
1662
|
const auth = clientCommon.createAuth(appIdOption, apiKeyOption, authMode);
|
|
1663
1663
|
const transporter = clientCommon.createTransporter({
|
|
1664
|
-
hosts: getDefaultHosts(appIdOption),
|
|
1664
|
+
hosts: getDefaultHosts$1(appIdOption),
|
|
1665
1665
|
...options,
|
|
1666
1666
|
algoliaAgent: clientCommon.getAlgoliaAgent({
|
|
1667
1667
|
algoliaAgents,
|
|
1668
1668
|
client: 'Search',
|
|
1669
|
-
version: apiClientVersion$
|
|
1669
|
+
version: apiClientVersion$2,
|
|
1670
1670
|
}),
|
|
1671
1671
|
baseHeaders: {
|
|
1672
1672
|
'content-type': 'text/plain',
|
|
@@ -1732,6 +1732,29 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1732
1732
|
timeout: () => timeout(retryCount),
|
|
1733
1733
|
});
|
|
1734
1734
|
},
|
|
1735
|
+
/**
|
|
1736
|
+
* Helper: Wait for an application-level task to complete for a given `taskID`.
|
|
1737
|
+
*
|
|
1738
|
+
* @summary Helper method that waits for a task to be published (completed).
|
|
1739
|
+
* @param waitForAppTaskOptions - The `waitForTaskOptions` object.
|
|
1740
|
+
* @param waitForAppTaskOptions.taskID - The `taskID` returned in the method response.
|
|
1741
|
+
* @param waitForAppTaskOptions.maxRetries - The maximum number of retries. 50 by default.
|
|
1742
|
+
* @param waitForAppTaskOptions.timeout - The function to decide how long to wait between retries.
|
|
1743
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
|
|
1744
|
+
*/
|
|
1745
|
+
waitForAppTask({ taskID, maxRetries = 50, timeout = (retryCount) => Math.min(retryCount * 200, 5000), }, requestOptions) {
|
|
1746
|
+
let retryCount = 0;
|
|
1747
|
+
return clientCommon.createIterablePromise({
|
|
1748
|
+
func: () => this.getAppTask({ taskID }, requestOptions),
|
|
1749
|
+
validate: (response) => response.status === 'published',
|
|
1750
|
+
aggregator: () => (retryCount += 1),
|
|
1751
|
+
error: {
|
|
1752
|
+
validate: () => retryCount >= maxRetries,
|
|
1753
|
+
message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`,
|
|
1754
|
+
},
|
|
1755
|
+
timeout: () => timeout(retryCount),
|
|
1756
|
+
});
|
|
1757
|
+
},
|
|
1735
1758
|
/**
|
|
1736
1759
|
* Helper: Wait for an API key to be added, updated or deleted based on a given `operation`.
|
|
1737
1760
|
*
|
|
@@ -1913,9 +1936,10 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1913
1936
|
async chunkedBatch({ indexName, objects, action = 'addObject', waitForTasks, batchSize = 1000, }, requestOptions) {
|
|
1914
1937
|
let requests = [];
|
|
1915
1938
|
const responses = [];
|
|
1916
|
-
|
|
1939
|
+
const objectEntries = objects.entries();
|
|
1940
|
+
for (const [i, obj] of objectEntries) {
|
|
1917
1941
|
requests.push({ action, body: obj });
|
|
1918
|
-
if (
|
|
1942
|
+
if (requests.length === batchSize || i === objects.length - 1) {
|
|
1919
1943
|
responses.push(await this.batch({ indexName, batchWriteParams: { requests } }, requestOptions));
|
|
1920
1944
|
requests = [];
|
|
1921
1945
|
}
|
|
@@ -1927,20 +1951,68 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1927
1951
|
}
|
|
1928
1952
|
return responses;
|
|
1929
1953
|
},
|
|
1954
|
+
/**
|
|
1955
|
+
* Helper: Saves the given array of objects in the given index. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objects in it.
|
|
1956
|
+
*
|
|
1957
|
+
* @summary Helper: Saves the given array of objects in the given index. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objects in it.
|
|
1958
|
+
* @param saveObjects - The `saveObjects` object.
|
|
1959
|
+
* @param saveObjects.indexName - The `indexName` to save `objects` in.
|
|
1960
|
+
* @param saveObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
|
|
1961
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `batch` method and merged with the transporter requestOptions.
|
|
1962
|
+
*/
|
|
1963
|
+
async saveObjects({ indexName, objects }, requestOptions) {
|
|
1964
|
+
return await this.chunkedBatch({ indexName, objects, action: 'addObject' }, requestOptions);
|
|
1965
|
+
},
|
|
1966
|
+
/**
|
|
1967
|
+
* Helper: Deletes every records for the given objectIDs. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objectIDs in it.
|
|
1968
|
+
*
|
|
1969
|
+
* @summary Helper: Deletes every records for the given objectIDs. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objectIDs in it.
|
|
1970
|
+
* @param deleteObjects - The `deleteObjects` object.
|
|
1971
|
+
* @param deleteObjects.indexName - The `indexName` to delete `objectIDs` from.
|
|
1972
|
+
* @param deleteObjects.objectIDs - The objectIDs to delete.
|
|
1973
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `batch` method and merged with the transporter requestOptions.
|
|
1974
|
+
*/
|
|
1975
|
+
async deleteObjects({ indexName, objectIDs }, requestOptions) {
|
|
1976
|
+
return await this.chunkedBatch({
|
|
1977
|
+
indexName,
|
|
1978
|
+
objects: objectIDs.map((objectID) => ({ objectID })),
|
|
1979
|
+
action: 'deleteObject',
|
|
1980
|
+
}, requestOptions);
|
|
1981
|
+
},
|
|
1982
|
+
/**
|
|
1983
|
+
* Helper: Replaces object content of all the given objects according to their respective `objectID` field. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objects in it.
|
|
1984
|
+
*
|
|
1985
|
+
* @summary Helper: Replaces object content of all the given objects according to their respective `objectID` field. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objects in it.
|
|
1986
|
+
* @param partialUpdateObjects - The `partialUpdateObjects` object.
|
|
1987
|
+
* @param partialUpdateObjects.indexName - The `indexName` to update `objects` in.
|
|
1988
|
+
* @param partialUpdateObjects.objects - The array of `objects` to update in the given Algolia `indexName`.
|
|
1989
|
+
* @param partialUpdateObjects.createIfNotExists - To be provided if non-existing objects are passed, otherwise, the call will fail..
|
|
1990
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
|
|
1991
|
+
*/
|
|
1992
|
+
async partialUpdateObjects({ indexName, objects, createIfNotExists }, requestOptions) {
|
|
1993
|
+
return await this.chunkedBatch({
|
|
1994
|
+
indexName,
|
|
1995
|
+
objects,
|
|
1996
|
+
action: createIfNotExists
|
|
1997
|
+
? 'partialUpdateObject'
|
|
1998
|
+
: 'partialUpdateObjectNoCreate',
|
|
1999
|
+
}, requestOptions);
|
|
2000
|
+
},
|
|
1930
2001
|
/**
|
|
1931
2002
|
* Helper: Replaces all objects (records) in the given `index_name` with the given `objects`. A temporary index is created during this process in order to backup your data.
|
|
2003
|
+
* See https://api-clients-automation.netlify.app/docs/contributing/add-new-api-client#5-helpers for implementation details.
|
|
1932
2004
|
*
|
|
1933
2005
|
* @summary Helper: Replaces all objects (records) in the given `index_name` with the given `objects`. A temporary index is created during this process in order to backup your data.
|
|
1934
2006
|
* @param replaceAllObjects - The `replaceAllObjects` object.
|
|
1935
2007
|
* @param replaceAllObjects.indexName - The `indexName` to replace `objects` in.
|
|
1936
2008
|
* @param replaceAllObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
|
|
1937
|
-
* @param replaceAllObjects.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `length
|
|
1938
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
|
|
2009
|
+
* @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.
|
|
2010
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `batch`, `operationIndex` and `getTask` method and merged with the transporter requestOptions.
|
|
1939
2011
|
*/
|
|
1940
2012
|
async replaceAllObjects({ indexName, objects, batchSize }, requestOptions) {
|
|
1941
|
-
const randomSuffix = Math.
|
|
2013
|
+
const randomSuffix = Math.floor(Math.random() * 1000000) + 100000;
|
|
1942
2014
|
const tmpIndexName = `${indexName}_tmp_${randomSuffix}`;
|
|
1943
|
-
|
|
2015
|
+
let copyOperationResponse = await this.operationIndex({
|
|
1944
2016
|
indexName,
|
|
1945
2017
|
operationIndexParams: {
|
|
1946
2018
|
operation: 'copy',
|
|
@@ -1948,17 +2020,29 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1948
2020
|
scope: ['settings', 'rules', 'synonyms'],
|
|
1949
2021
|
},
|
|
1950
2022
|
}, requestOptions);
|
|
2023
|
+
const batchResponses = await this.chunkedBatch({ indexName: tmpIndexName, objects, waitForTasks: true, batchSize }, requestOptions);
|
|
1951
2024
|
await this.waitForTask({
|
|
2025
|
+
indexName: tmpIndexName,
|
|
2026
|
+
taskID: copyOperationResponse.taskID,
|
|
2027
|
+
});
|
|
2028
|
+
copyOperationResponse = await this.operationIndex({
|
|
1952
2029
|
indexName,
|
|
2030
|
+
operationIndexParams: {
|
|
2031
|
+
operation: 'copy',
|
|
2032
|
+
destination: tmpIndexName,
|
|
2033
|
+
scope: ['settings', 'rules', 'synonyms'],
|
|
2034
|
+
},
|
|
2035
|
+
}, requestOptions);
|
|
2036
|
+
await this.waitForTask({
|
|
2037
|
+
indexName: tmpIndexName,
|
|
1953
2038
|
taskID: copyOperationResponse.taskID,
|
|
1954
2039
|
});
|
|
1955
|
-
const batchResponses = await this.chunkedBatch({ indexName: tmpIndexName, objects, waitForTasks: true, batchSize }, requestOptions);
|
|
1956
2040
|
const moveOperationResponse = await this.operationIndex({
|
|
1957
2041
|
indexName: tmpIndexName,
|
|
1958
2042
|
operationIndexParams: { operation: 'move', destination: indexName },
|
|
1959
2043
|
}, requestOptions);
|
|
1960
2044
|
await this.waitForTask({
|
|
1961
|
-
indexName,
|
|
2045
|
+
indexName: tmpIndexName,
|
|
1962
2046
|
taskID: moveOperationResponse.taskID,
|
|
1963
2047
|
});
|
|
1964
2048
|
return { copyOperationResponse, batchResponses, moveOperationResponse };
|
|
@@ -2194,7 +2278,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2194
2278
|
return transporter.request(request, requestOptions);
|
|
2195
2279
|
},
|
|
2196
2280
|
/**
|
|
2197
|
-
* Retrieves records from an index, up to 1,000 per request. While searching retrieves _hits_ (records augmented with attributes for highlighting and ranking details), browsing _just_ returns matching records. This can be useful if you want to export your indices. - The Analytics API doesn\'t collect data when using `browse`. - Records are ranked by attributes and custom ranking. -
|
|
2281
|
+
* Retrieves records from an index, up to 1,000 per request. While searching retrieves _hits_ (records augmented with attributes for highlighting and ranking details), browsing _just_ returns matching records. This can be useful if you want to export your indices. - The Analytics API doesn\'t collect data when using `browse`. - Records are ranked by attributes and custom ranking. - There\'s no ranking for: typo-tolerance, number of matched words, proximity, geo distance. Browse requests automatically apply these settings: - `advancedSyntax`: `false` - `attributesToHighlight`: `[]` - `attributesToSnippet`: `[]` - `distinct`: `false` - `enablePersonalization`: `false` - `enableRules`: `false` - `facets`: `[]` - `getRankingInfo`: `false` - `ignorePlurals`: `false` - `optionalFilters`: `[]` - `typoTolerance`: `true` or `false` (`min` and `strict` is evaluated to `true`) If you send these parameters with your browse requests, they\'ll be ignored.
|
|
2198
2282
|
*
|
|
2199
2283
|
* Required API Key ACLs:
|
|
2200
2284
|
* - browse.
|
|
@@ -2627,6 +2711,31 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2627
2711
|
};
|
|
2628
2712
|
return transporter.request(request, requestOptions);
|
|
2629
2713
|
},
|
|
2714
|
+
/**
|
|
2715
|
+
* Checks the status of a given application task.
|
|
2716
|
+
*
|
|
2717
|
+
* Required API Key ACLs:
|
|
2718
|
+
* - editSettings.
|
|
2719
|
+
*
|
|
2720
|
+
* @param getAppTask - The getAppTask object.
|
|
2721
|
+
* @param getAppTask.taskID - Unique task identifier.
|
|
2722
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2723
|
+
*/
|
|
2724
|
+
getAppTask({ taskID }, requestOptions) {
|
|
2725
|
+
if (!taskID) {
|
|
2726
|
+
throw new Error('Parameter `taskID` is required when calling `getAppTask`.');
|
|
2727
|
+
}
|
|
2728
|
+
const requestPath = '/1/task/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));
|
|
2729
|
+
const headers = {};
|
|
2730
|
+
const queryParameters = {};
|
|
2731
|
+
const request = {
|
|
2732
|
+
method: 'GET',
|
|
2733
|
+
path: requestPath,
|
|
2734
|
+
queryParameters,
|
|
2735
|
+
headers,
|
|
2736
|
+
};
|
|
2737
|
+
return transporter.request(request, requestOptions);
|
|
2738
|
+
},
|
|
2630
2739
|
/**
|
|
2631
2740
|
* Lists supported languages with their supported dictionary types and number of custom entries.
|
|
2632
2741
|
*
|
|
@@ -3101,7 +3210,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3101
3210
|
return transporter.request(request, requestOptions);
|
|
3102
3211
|
},
|
|
3103
3212
|
/**
|
|
3104
|
-
* Copies or moves (renames) an index within the same Algolia application. - Existing destination indices are overwritten, except for
|
|
3213
|
+
* Copies or moves (renames) an index within the same Algolia application. - Existing destination indices are overwritten, except for their analytics data. - If the destination index doesn\'t exist yet, it\'ll be created. **Copy** - Copying a source index that doesn\'t exist creates a new index with 0 records and default settings. - The API keys of the source index are merged with the existing keys in the destination index. - You can\'t copy the `enableReRanking`, `mode`, and `replicas` settings. - You can\'t copy to a destination index that already has replicas. - Be aware of the [size limits](https://www.algolia.com/doc/guides/scaling/algolia-service-limits/#application-record-and-index-limits). - Related guide: [Copy indices](https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/how-to/copy-indices/) **Move** - Moving a source index that doesn\'t exist is ignored without returning an error. - When moving an index, the analytics data keep their original name and a new set of analytics data is started for the new name. To access the original analytics in the dashboard, create an index with the original name. - If the destination index has replicas, moving will overwrite the existing index and copy the data to the replica indices. - Related guide: [Move indices](https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/how-to/move-indices/).
|
|
3105
3214
|
*
|
|
3106
3215
|
* Required API Key ACLs:
|
|
3107
3216
|
* - addObject.
|
|
@@ -3786,7 +3895,369 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3786
3895
|
}
|
|
3787
3896
|
|
|
3788
3897
|
// 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.
|
|
3789
|
-
const apiClientVersion =
|
|
3898
|
+
const apiClientVersion$1 = '5.0.0-beta.10';
|
|
3899
|
+
function getDefaultHosts(appId) {
|
|
3900
|
+
return [
|
|
3901
|
+
{
|
|
3902
|
+
url: `${appId}-dsn.algolia.net`,
|
|
3903
|
+
accept: 'read',
|
|
3904
|
+
protocol: 'https',
|
|
3905
|
+
},
|
|
3906
|
+
{
|
|
3907
|
+
url: `${appId}.algolia.net`,
|
|
3908
|
+
accept: 'write',
|
|
3909
|
+
protocol: 'https',
|
|
3910
|
+
},
|
|
3911
|
+
].concat(clientCommon.shuffle([
|
|
3912
|
+
{
|
|
3913
|
+
url: `${appId}-1.algolianet.com`,
|
|
3914
|
+
accept: 'readWrite',
|
|
3915
|
+
protocol: 'https',
|
|
3916
|
+
},
|
|
3917
|
+
{
|
|
3918
|
+
url: `${appId}-2.algolianet.com`,
|
|
3919
|
+
accept: 'readWrite',
|
|
3920
|
+
protocol: 'https',
|
|
3921
|
+
},
|
|
3922
|
+
{
|
|
3923
|
+
url: `${appId}-3.algolianet.com`,
|
|
3924
|
+
accept: 'readWrite',
|
|
3925
|
+
protocol: 'https',
|
|
3926
|
+
},
|
|
3927
|
+
]));
|
|
3928
|
+
}
|
|
3929
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
3930
|
+
function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }) {
|
|
3931
|
+
const auth = clientCommon.createAuth(appIdOption, apiKeyOption, authMode);
|
|
3932
|
+
const transporter = clientCommon.createTransporter({
|
|
3933
|
+
hosts: getDefaultHosts(appIdOption),
|
|
3934
|
+
...options,
|
|
3935
|
+
algoliaAgent: clientCommon.getAlgoliaAgent({
|
|
3936
|
+
algoliaAgents,
|
|
3937
|
+
client: 'Recommend',
|
|
3938
|
+
version: apiClientVersion$1,
|
|
3939
|
+
}),
|
|
3940
|
+
baseHeaders: {
|
|
3941
|
+
'content-type': 'text/plain',
|
|
3942
|
+
...auth.headers(),
|
|
3943
|
+
...options.baseHeaders,
|
|
3944
|
+
},
|
|
3945
|
+
baseQueryParameters: {
|
|
3946
|
+
...auth.queryParameters(),
|
|
3947
|
+
...options.baseQueryParameters,
|
|
3948
|
+
},
|
|
3949
|
+
});
|
|
3950
|
+
return {
|
|
3951
|
+
transporter,
|
|
3952
|
+
/**
|
|
3953
|
+
* The `appId` currently in use.
|
|
3954
|
+
*/
|
|
3955
|
+
appId: appIdOption,
|
|
3956
|
+
/**
|
|
3957
|
+
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
3958
|
+
*/
|
|
3959
|
+
clearCache() {
|
|
3960
|
+
return Promise.all([
|
|
3961
|
+
transporter.requestsCache.clear(),
|
|
3962
|
+
transporter.responsesCache.clear(),
|
|
3963
|
+
]).then(() => undefined);
|
|
3964
|
+
},
|
|
3965
|
+
/**
|
|
3966
|
+
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
3967
|
+
*/
|
|
3968
|
+
get _ua() {
|
|
3969
|
+
return transporter.algoliaAgent.value;
|
|
3970
|
+
},
|
|
3971
|
+
/**
|
|
3972
|
+
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
|
3973
|
+
*
|
|
3974
|
+
* @param segment - The algolia agent (user-agent) segment to add.
|
|
3975
|
+
* @param version - The version of the agent.
|
|
3976
|
+
*/
|
|
3977
|
+
addAlgoliaAgent(segment, version) {
|
|
3978
|
+
transporter.algoliaAgent.add({ segment, version });
|
|
3979
|
+
},
|
|
3980
|
+
/**
|
|
3981
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
3982
|
+
*
|
|
3983
|
+
* @param customDelete - The customDelete object.
|
|
3984
|
+
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
3985
|
+
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
3986
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
3987
|
+
*/
|
|
3988
|
+
customDelete({ path, parameters }, requestOptions) {
|
|
3989
|
+
if (!path) {
|
|
3990
|
+
throw new Error('Parameter `path` is required when calling `customDelete`.');
|
|
3991
|
+
}
|
|
3992
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
3993
|
+
const headers = {};
|
|
3994
|
+
const queryParameters = parameters ? parameters : {};
|
|
3995
|
+
const request = {
|
|
3996
|
+
method: 'DELETE',
|
|
3997
|
+
path: requestPath,
|
|
3998
|
+
queryParameters,
|
|
3999
|
+
headers,
|
|
4000
|
+
};
|
|
4001
|
+
return transporter.request(request, requestOptions);
|
|
4002
|
+
},
|
|
4003
|
+
/**
|
|
4004
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
4005
|
+
*
|
|
4006
|
+
* @param customGet - The customGet object.
|
|
4007
|
+
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
4008
|
+
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
4009
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
4010
|
+
*/
|
|
4011
|
+
customGet({ path, parameters }, requestOptions) {
|
|
4012
|
+
if (!path) {
|
|
4013
|
+
throw new Error('Parameter `path` is required when calling `customGet`.');
|
|
4014
|
+
}
|
|
4015
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
4016
|
+
const headers = {};
|
|
4017
|
+
const queryParameters = parameters ? parameters : {};
|
|
4018
|
+
const request = {
|
|
4019
|
+
method: 'GET',
|
|
4020
|
+
path: requestPath,
|
|
4021
|
+
queryParameters,
|
|
4022
|
+
headers,
|
|
4023
|
+
};
|
|
4024
|
+
return transporter.request(request, requestOptions);
|
|
4025
|
+
},
|
|
4026
|
+
/**
|
|
4027
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
4028
|
+
*
|
|
4029
|
+
* @param customPost - The customPost object.
|
|
4030
|
+
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
4031
|
+
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
4032
|
+
* @param customPost.body - Parameters to send with the custom request.
|
|
4033
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
4034
|
+
*/
|
|
4035
|
+
customPost({ path, parameters, body }, requestOptions) {
|
|
4036
|
+
if (!path) {
|
|
4037
|
+
throw new Error('Parameter `path` is required when calling `customPost`.');
|
|
4038
|
+
}
|
|
4039
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
4040
|
+
const headers = {};
|
|
4041
|
+
const queryParameters = parameters ? parameters : {};
|
|
4042
|
+
const request = {
|
|
4043
|
+
method: 'POST',
|
|
4044
|
+
path: requestPath,
|
|
4045
|
+
queryParameters,
|
|
4046
|
+
headers,
|
|
4047
|
+
data: body ? body : {},
|
|
4048
|
+
};
|
|
4049
|
+
return transporter.request(request, requestOptions);
|
|
4050
|
+
},
|
|
4051
|
+
/**
|
|
4052
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
4053
|
+
*
|
|
4054
|
+
* @param customPut - The customPut object.
|
|
4055
|
+
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
4056
|
+
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
4057
|
+
* @param customPut.body - Parameters to send with the custom request.
|
|
4058
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
4059
|
+
*/
|
|
4060
|
+
customPut({ path, parameters, body }, requestOptions) {
|
|
4061
|
+
if (!path) {
|
|
4062
|
+
throw new Error('Parameter `path` is required when calling `customPut`.');
|
|
4063
|
+
}
|
|
4064
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
4065
|
+
const headers = {};
|
|
4066
|
+
const queryParameters = parameters ? parameters : {};
|
|
4067
|
+
const request = {
|
|
4068
|
+
method: 'PUT',
|
|
4069
|
+
path: requestPath,
|
|
4070
|
+
queryParameters,
|
|
4071
|
+
headers,
|
|
4072
|
+
data: body ? body : {},
|
|
4073
|
+
};
|
|
4074
|
+
return transporter.request(request, requestOptions);
|
|
4075
|
+
},
|
|
4076
|
+
/**
|
|
4077
|
+
* Deletes a Recommend rule from a recommendation scenario.
|
|
4078
|
+
*
|
|
4079
|
+
* Required API Key ACLs:
|
|
4080
|
+
* - editSettings.
|
|
4081
|
+
*
|
|
4082
|
+
* @param deleteRecommendRule - The deleteRecommendRule object.
|
|
4083
|
+
* @param deleteRecommendRule.indexName - Name of the index on which to perform the operation.
|
|
4084
|
+
* @param deleteRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
4085
|
+
* @param deleteRecommendRule.objectID - Unique record identifier.
|
|
4086
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
4087
|
+
*/
|
|
4088
|
+
deleteRecommendRule({ indexName, model, objectID }, requestOptions) {
|
|
4089
|
+
if (!indexName) {
|
|
4090
|
+
throw new Error('Parameter `indexName` is required when calling `deleteRecommendRule`.');
|
|
4091
|
+
}
|
|
4092
|
+
if (!model) {
|
|
4093
|
+
throw new Error('Parameter `model` is required when calling `deleteRecommendRule`.');
|
|
4094
|
+
}
|
|
4095
|
+
if (!objectID) {
|
|
4096
|
+
throw new Error('Parameter `objectID` is required when calling `deleteRecommendRule`.');
|
|
4097
|
+
}
|
|
4098
|
+
const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/{objectID}'
|
|
4099
|
+
.replace('{indexName}', encodeURIComponent(indexName))
|
|
4100
|
+
.replace('{model}', encodeURIComponent(model))
|
|
4101
|
+
.replace('{objectID}', encodeURIComponent(objectID));
|
|
4102
|
+
const headers = {};
|
|
4103
|
+
const queryParameters = {};
|
|
4104
|
+
const request = {
|
|
4105
|
+
method: 'DELETE',
|
|
4106
|
+
path: requestPath,
|
|
4107
|
+
queryParameters,
|
|
4108
|
+
headers,
|
|
4109
|
+
};
|
|
4110
|
+
return transporter.request(request, requestOptions);
|
|
4111
|
+
},
|
|
4112
|
+
/**
|
|
4113
|
+
* Retrieves a Recommend rule that you previously created in the Algolia dashboard.
|
|
4114
|
+
*
|
|
4115
|
+
* Required API Key ACLs:
|
|
4116
|
+
* - settings.
|
|
4117
|
+
*
|
|
4118
|
+
* @param getRecommendRule - The getRecommendRule object.
|
|
4119
|
+
* @param getRecommendRule.indexName - Name of the index on which to perform the operation.
|
|
4120
|
+
* @param getRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
4121
|
+
* @param getRecommendRule.objectID - Unique record identifier.
|
|
4122
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
4123
|
+
*/
|
|
4124
|
+
getRecommendRule({ indexName, model, objectID }, requestOptions) {
|
|
4125
|
+
if (!indexName) {
|
|
4126
|
+
throw new Error('Parameter `indexName` is required when calling `getRecommendRule`.');
|
|
4127
|
+
}
|
|
4128
|
+
if (!model) {
|
|
4129
|
+
throw new Error('Parameter `model` is required when calling `getRecommendRule`.');
|
|
4130
|
+
}
|
|
4131
|
+
if (!objectID) {
|
|
4132
|
+
throw new Error('Parameter `objectID` is required when calling `getRecommendRule`.');
|
|
4133
|
+
}
|
|
4134
|
+
const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/{objectID}'
|
|
4135
|
+
.replace('{indexName}', encodeURIComponent(indexName))
|
|
4136
|
+
.replace('{model}', encodeURIComponent(model))
|
|
4137
|
+
.replace('{objectID}', encodeURIComponent(objectID));
|
|
4138
|
+
const headers = {};
|
|
4139
|
+
const queryParameters = {};
|
|
4140
|
+
const request = {
|
|
4141
|
+
method: 'GET',
|
|
4142
|
+
path: requestPath,
|
|
4143
|
+
queryParameters,
|
|
4144
|
+
headers,
|
|
4145
|
+
};
|
|
4146
|
+
return transporter.request(request, requestOptions);
|
|
4147
|
+
},
|
|
4148
|
+
/**
|
|
4149
|
+
* 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.
|
|
4150
|
+
*
|
|
4151
|
+
* Required API Key ACLs:
|
|
4152
|
+
* - editSettings.
|
|
4153
|
+
*
|
|
4154
|
+
* @param getRecommendStatus - The getRecommendStatus object.
|
|
4155
|
+
* @param getRecommendStatus.indexName - Name of the index on which to perform the operation.
|
|
4156
|
+
* @param getRecommendStatus.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
4157
|
+
* @param getRecommendStatus.taskID - Unique task identifier.
|
|
4158
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
4159
|
+
*/
|
|
4160
|
+
getRecommendStatus({ indexName, model, taskID }, requestOptions) {
|
|
4161
|
+
if (!indexName) {
|
|
4162
|
+
throw new Error('Parameter `indexName` is required when calling `getRecommendStatus`.');
|
|
4163
|
+
}
|
|
4164
|
+
if (!model) {
|
|
4165
|
+
throw new Error('Parameter `model` is required when calling `getRecommendStatus`.');
|
|
4166
|
+
}
|
|
4167
|
+
if (!taskID) {
|
|
4168
|
+
throw new Error('Parameter `taskID` is required when calling `getRecommendStatus`.');
|
|
4169
|
+
}
|
|
4170
|
+
const requestPath = '/1/indexes/{indexName}/{model}/task/{taskID}'
|
|
4171
|
+
.replace('{indexName}', encodeURIComponent(indexName))
|
|
4172
|
+
.replace('{model}', encodeURIComponent(model))
|
|
4173
|
+
.replace('{taskID}', encodeURIComponent(taskID));
|
|
4174
|
+
const headers = {};
|
|
4175
|
+
const queryParameters = {};
|
|
4176
|
+
const request = {
|
|
4177
|
+
method: 'GET',
|
|
4178
|
+
path: requestPath,
|
|
4179
|
+
queryParameters,
|
|
4180
|
+
headers,
|
|
4181
|
+
};
|
|
4182
|
+
return transporter.request(request, requestOptions);
|
|
4183
|
+
},
|
|
4184
|
+
/**
|
|
4185
|
+
* Retrieves recommendations from selected AI models.
|
|
4186
|
+
*
|
|
4187
|
+
* Required API Key ACLs:
|
|
4188
|
+
* - search.
|
|
4189
|
+
*
|
|
4190
|
+
* @param getRecommendationsParams - The getRecommendationsParams object.
|
|
4191
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
4192
|
+
*/
|
|
4193
|
+
getRecommendations(getRecommendationsParams, requestOptions) {
|
|
4194
|
+
if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {
|
|
4195
|
+
const newSignatureRequest = {
|
|
4196
|
+
requests: getRecommendationsParams,
|
|
4197
|
+
};
|
|
4198
|
+
// eslint-disable-next-line no-param-reassign
|
|
4199
|
+
getRecommendationsParams = newSignatureRequest;
|
|
4200
|
+
}
|
|
4201
|
+
if (!getRecommendationsParams) {
|
|
4202
|
+
throw new Error('Parameter `getRecommendationsParams` is required when calling `getRecommendations`.');
|
|
4203
|
+
}
|
|
4204
|
+
if (!getRecommendationsParams.requests) {
|
|
4205
|
+
throw new Error('Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.');
|
|
4206
|
+
}
|
|
4207
|
+
const requestPath = '/1/indexes/*/recommendations';
|
|
4208
|
+
const headers = {};
|
|
4209
|
+
const queryParameters = {};
|
|
4210
|
+
const request = {
|
|
4211
|
+
method: 'POST',
|
|
4212
|
+
path: requestPath,
|
|
4213
|
+
queryParameters,
|
|
4214
|
+
headers,
|
|
4215
|
+
data: getRecommendationsParams,
|
|
4216
|
+
useReadTransporter: true,
|
|
4217
|
+
cacheable: true,
|
|
4218
|
+
};
|
|
4219
|
+
return transporter.request(request, requestOptions);
|
|
4220
|
+
},
|
|
4221
|
+
/**
|
|
4222
|
+
* Searches for Recommend rules. Use an empty query to list all rules for this recommendation scenario.
|
|
4223
|
+
*
|
|
4224
|
+
* Required API Key ACLs:
|
|
4225
|
+
* - settings.
|
|
4226
|
+
*
|
|
4227
|
+
* @param searchRecommendRules - The searchRecommendRules object.
|
|
4228
|
+
* @param searchRecommendRules.indexName - Name of the index on which to perform the operation.
|
|
4229
|
+
* @param searchRecommendRules.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
4230
|
+
* @param searchRecommendRules.searchRecommendRulesParams - The searchRecommendRulesParams object.
|
|
4231
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
4232
|
+
*/
|
|
4233
|
+
searchRecommendRules({ indexName, model, searchRecommendRulesParams, }, requestOptions) {
|
|
4234
|
+
if (!indexName) {
|
|
4235
|
+
throw new Error('Parameter `indexName` is required when calling `searchRecommendRules`.');
|
|
4236
|
+
}
|
|
4237
|
+
if (!model) {
|
|
4238
|
+
throw new Error('Parameter `model` is required when calling `searchRecommendRules`.');
|
|
4239
|
+
}
|
|
4240
|
+
const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/search'
|
|
4241
|
+
.replace('{indexName}', encodeURIComponent(indexName))
|
|
4242
|
+
.replace('{model}', encodeURIComponent(model));
|
|
4243
|
+
const headers = {};
|
|
4244
|
+
const queryParameters = {};
|
|
4245
|
+
const request = {
|
|
4246
|
+
method: 'POST',
|
|
4247
|
+
path: requestPath,
|
|
4248
|
+
queryParameters,
|
|
4249
|
+
headers,
|
|
4250
|
+
data: searchRecommendRulesParams ? searchRecommendRulesParams : {},
|
|
4251
|
+
useReadTransporter: true,
|
|
4252
|
+
cacheable: true,
|
|
4253
|
+
};
|
|
4254
|
+
return transporter.request(request, requestOptions);
|
|
4255
|
+
},
|
|
4256
|
+
};
|
|
4257
|
+
}
|
|
4258
|
+
|
|
4259
|
+
// 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.
|
|
4260
|
+
const apiClientVersion = apiClientVersion$2;
|
|
3790
4261
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
3791
4262
|
function algoliasearch(appId, apiKey, options) {
|
|
3792
4263
|
if (!appId || typeof appId !== 'string') {
|
|
@@ -3810,6 +4281,13 @@ function algoliasearch(appId, apiKey, options) {
|
|
|
3810
4281
|
hostsCache: clientCommon.createMemoryCache(),
|
|
3811
4282
|
...options,
|
|
3812
4283
|
};
|
|
4284
|
+
function initRecommend(initOptions = {}) {
|
|
4285
|
+
return createRecommendClient({
|
|
4286
|
+
...commonOptions,
|
|
4287
|
+
...initOptions.options,
|
|
4288
|
+
...initOptions,
|
|
4289
|
+
});
|
|
4290
|
+
}
|
|
3813
4291
|
function initAnalytics(initOptions = {}) {
|
|
3814
4292
|
if (initOptions.region &&
|
|
3815
4293
|
(typeof initOptions.region !== 'string' ||
|
|
@@ -3855,9 +4333,10 @@ function algoliasearch(appId, apiKey, options) {
|
|
|
3855
4333
|
get _ua() {
|
|
3856
4334
|
return this.transporter.algoliaAgent.value;
|
|
3857
4335
|
},
|
|
4336
|
+
initAbtesting,
|
|
3858
4337
|
initAnalytics,
|
|
3859
4338
|
initPersonalization,
|
|
3860
|
-
|
|
4339
|
+
initRecommend,
|
|
3861
4340
|
/**
|
|
3862
4341
|
* Helper: Generates a secured API key based on the given `parentApiKey` and given `restrictions`.
|
|
3863
4342
|
*
|
|
@@ -3867,7 +4346,23 @@ function algoliasearch(appId, apiKey, options) {
|
|
|
3867
4346
|
* @param generateSecuredApiKey.restrictions - A set of properties defining the restrictions of the secured API key.
|
|
3868
4347
|
*/
|
|
3869
4348
|
generateSecuredApiKey({ parentApiKey, restrictions = {}, }) {
|
|
3870
|
-
|
|
4349
|
+
let mergedRestrictions = restrictions;
|
|
4350
|
+
if (restrictions.searchParams) {
|
|
4351
|
+
// merge searchParams with the root restrictions
|
|
4352
|
+
mergedRestrictions = {
|
|
4353
|
+
...restrictions,
|
|
4354
|
+
...restrictions.searchParams,
|
|
4355
|
+
};
|
|
4356
|
+
delete mergedRestrictions.searchParams;
|
|
4357
|
+
}
|
|
4358
|
+
mergedRestrictions = Object.keys(mergedRestrictions)
|
|
4359
|
+
.sort()
|
|
4360
|
+
.reduce((acc, key) => {
|
|
4361
|
+
// eslint-disable-next-line no-param-reassign
|
|
4362
|
+
acc[key] = mergedRestrictions[key];
|
|
4363
|
+
return acc;
|
|
4364
|
+
}, {});
|
|
4365
|
+
const queryParameters = clientCommon.serializeQueryParameters(mergedRestrictions);
|
|
3871
4366
|
return Buffer.from(crypto.createHmac('sha256', parentApiKey)
|
|
3872
4367
|
.update(queryParameters)
|
|
3873
4368
|
.digest('hex') + queryParameters).toString('base64');
|