algoliasearch 5.0.0-beta.1 → 5.0.0-beta.11
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 +531 -31
- package/dist/algoliasearch.esm.browser.js +524 -47
- package/dist/algoliasearch.esm.node.js +531 -31
- 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 +69 -14
- 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.11';
|
|
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.11';
|
|
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.11';
|
|
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.11';
|
|
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
|
*
|
|
@@ -1781,8 +1804,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1781
1804
|
}
|
|
1782
1805
|
return clientCommon.createIterablePromise({
|
|
1783
1806
|
...baseIteratorOptions,
|
|
1784
|
-
func: () => this.getApiKey({ key }, requestOptions).catch((error) =>
|
|
1785
|
-
|
|
1807
|
+
func: () => this.getApiKey({ key }, requestOptions).catch((error) => {
|
|
1808
|
+
if (error.status === 404) {
|
|
1809
|
+
return undefined;
|
|
1810
|
+
}
|
|
1811
|
+
throw error;
|
|
1812
|
+
}),
|
|
1813
|
+
validate: (response) => operation === 'add' ? response !== undefined : response === undefined,
|
|
1786
1814
|
});
|
|
1787
1815
|
},
|
|
1788
1816
|
/**
|
|
@@ -1913,9 +1941,10 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1913
1941
|
async chunkedBatch({ indexName, objects, action = 'addObject', waitForTasks, batchSize = 1000, }, requestOptions) {
|
|
1914
1942
|
let requests = [];
|
|
1915
1943
|
const responses = [];
|
|
1916
|
-
|
|
1944
|
+
const objectEntries = objects.entries();
|
|
1945
|
+
for (const [i, obj] of objectEntries) {
|
|
1917
1946
|
requests.push({ action, body: obj });
|
|
1918
|
-
if (
|
|
1947
|
+
if (requests.length === batchSize || i === objects.length - 1) {
|
|
1919
1948
|
responses.push(await this.batch({ indexName, batchWriteParams: { requests } }, requestOptions));
|
|
1920
1949
|
requests = [];
|
|
1921
1950
|
}
|
|
@@ -1927,20 +1956,68 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1927
1956
|
}
|
|
1928
1957
|
return responses;
|
|
1929
1958
|
},
|
|
1959
|
+
/**
|
|
1960
|
+
* 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.
|
|
1961
|
+
*
|
|
1962
|
+
* @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.
|
|
1963
|
+
* @param saveObjects - The `saveObjects` object.
|
|
1964
|
+
* @param saveObjects.indexName - The `indexName` to save `objects` in.
|
|
1965
|
+
* @param saveObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
|
|
1966
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `batch` method and merged with the transporter requestOptions.
|
|
1967
|
+
*/
|
|
1968
|
+
async saveObjects({ indexName, objects }, requestOptions) {
|
|
1969
|
+
return await this.chunkedBatch({ indexName, objects, action: 'addObject' }, requestOptions);
|
|
1970
|
+
},
|
|
1971
|
+
/**
|
|
1972
|
+
* 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.
|
|
1973
|
+
*
|
|
1974
|
+
* @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.
|
|
1975
|
+
* @param deleteObjects - The `deleteObjects` object.
|
|
1976
|
+
* @param deleteObjects.indexName - The `indexName` to delete `objectIDs` from.
|
|
1977
|
+
* @param deleteObjects.objectIDs - The objectIDs to delete.
|
|
1978
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `batch` method and merged with the transporter requestOptions.
|
|
1979
|
+
*/
|
|
1980
|
+
async deleteObjects({ indexName, objectIDs }, requestOptions) {
|
|
1981
|
+
return await this.chunkedBatch({
|
|
1982
|
+
indexName,
|
|
1983
|
+
objects: objectIDs.map((objectID) => ({ objectID })),
|
|
1984
|
+
action: 'deleteObject',
|
|
1985
|
+
}, requestOptions);
|
|
1986
|
+
},
|
|
1987
|
+
/**
|
|
1988
|
+
* 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.
|
|
1989
|
+
*
|
|
1990
|
+
* @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.
|
|
1991
|
+
* @param partialUpdateObjects - The `partialUpdateObjects` object.
|
|
1992
|
+
* @param partialUpdateObjects.indexName - The `indexName` to update `objects` in.
|
|
1993
|
+
* @param partialUpdateObjects.objects - The array of `objects` to update in the given Algolia `indexName`.
|
|
1994
|
+
* @param partialUpdateObjects.createIfNotExists - To be provided if non-existing objects are passed, otherwise, the call will fail..
|
|
1995
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
|
|
1996
|
+
*/
|
|
1997
|
+
async partialUpdateObjects({ indexName, objects, createIfNotExists }, requestOptions) {
|
|
1998
|
+
return await this.chunkedBatch({
|
|
1999
|
+
indexName,
|
|
2000
|
+
objects,
|
|
2001
|
+
action: createIfNotExists
|
|
2002
|
+
? 'partialUpdateObject'
|
|
2003
|
+
: 'partialUpdateObjectNoCreate',
|
|
2004
|
+
}, requestOptions);
|
|
2005
|
+
},
|
|
1930
2006
|
/**
|
|
1931
2007
|
* 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.
|
|
2008
|
+
* See https://api-clients-automation.netlify.app/docs/contributing/add-new-api-client#5-helpers for implementation details.
|
|
1932
2009
|
*
|
|
1933
2010
|
* @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
2011
|
* @param replaceAllObjects - The `replaceAllObjects` object.
|
|
1935
2012
|
* @param replaceAllObjects.indexName - The `indexName` to replace `objects` in.
|
|
1936
2013
|
* @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.
|
|
2014
|
+
* @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.
|
|
2015
|
+
* @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
2016
|
*/
|
|
1940
2017
|
async replaceAllObjects({ indexName, objects, batchSize }, requestOptions) {
|
|
1941
|
-
const randomSuffix = Math.
|
|
2018
|
+
const randomSuffix = Math.floor(Math.random() * 1000000) + 100000;
|
|
1942
2019
|
const tmpIndexName = `${indexName}_tmp_${randomSuffix}`;
|
|
1943
|
-
|
|
2020
|
+
let copyOperationResponse = await this.operationIndex({
|
|
1944
2021
|
indexName,
|
|
1945
2022
|
operationIndexParams: {
|
|
1946
2023
|
operation: 'copy',
|
|
@@ -1948,17 +2025,29 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1948
2025
|
scope: ['settings', 'rules', 'synonyms'],
|
|
1949
2026
|
},
|
|
1950
2027
|
}, requestOptions);
|
|
2028
|
+
const batchResponses = await this.chunkedBatch({ indexName: tmpIndexName, objects, waitForTasks: true, batchSize }, requestOptions);
|
|
1951
2029
|
await this.waitForTask({
|
|
2030
|
+
indexName: tmpIndexName,
|
|
2031
|
+
taskID: copyOperationResponse.taskID,
|
|
2032
|
+
});
|
|
2033
|
+
copyOperationResponse = await this.operationIndex({
|
|
1952
2034
|
indexName,
|
|
2035
|
+
operationIndexParams: {
|
|
2036
|
+
operation: 'copy',
|
|
2037
|
+
destination: tmpIndexName,
|
|
2038
|
+
scope: ['settings', 'rules', 'synonyms'],
|
|
2039
|
+
},
|
|
2040
|
+
}, requestOptions);
|
|
2041
|
+
await this.waitForTask({
|
|
2042
|
+
indexName: tmpIndexName,
|
|
1953
2043
|
taskID: copyOperationResponse.taskID,
|
|
1954
2044
|
});
|
|
1955
|
-
const batchResponses = await this.chunkedBatch({ indexName: tmpIndexName, objects, waitForTasks: true, batchSize }, requestOptions);
|
|
1956
2045
|
const moveOperationResponse = await this.operationIndex({
|
|
1957
2046
|
indexName: tmpIndexName,
|
|
1958
2047
|
operationIndexParams: { operation: 'move', destination: indexName },
|
|
1959
2048
|
}, requestOptions);
|
|
1960
2049
|
await this.waitForTask({
|
|
1961
|
-
indexName,
|
|
2050
|
+
indexName: tmpIndexName,
|
|
1962
2051
|
taskID: moveOperationResponse.taskID,
|
|
1963
2052
|
});
|
|
1964
2053
|
return { copyOperationResponse, batchResponses, moveOperationResponse };
|
|
@@ -2194,7 +2283,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2194
2283
|
return transporter.request(request, requestOptions);
|
|
2195
2284
|
},
|
|
2196
2285
|
/**
|
|
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. -
|
|
2286
|
+
* 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
2287
|
*
|
|
2199
2288
|
* Required API Key ACLs:
|
|
2200
2289
|
* - browse.
|
|
@@ -2627,6 +2716,31 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2627
2716
|
};
|
|
2628
2717
|
return transporter.request(request, requestOptions);
|
|
2629
2718
|
},
|
|
2719
|
+
/**
|
|
2720
|
+
* Checks the status of a given application task.
|
|
2721
|
+
*
|
|
2722
|
+
* Required API Key ACLs:
|
|
2723
|
+
* - editSettings.
|
|
2724
|
+
*
|
|
2725
|
+
* @param getAppTask - The getAppTask object.
|
|
2726
|
+
* @param getAppTask.taskID - Unique task identifier.
|
|
2727
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2728
|
+
*/
|
|
2729
|
+
getAppTask({ taskID }, requestOptions) {
|
|
2730
|
+
if (!taskID) {
|
|
2731
|
+
throw new Error('Parameter `taskID` is required when calling `getAppTask`.');
|
|
2732
|
+
}
|
|
2733
|
+
const requestPath = '/1/task/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));
|
|
2734
|
+
const headers = {};
|
|
2735
|
+
const queryParameters = {};
|
|
2736
|
+
const request = {
|
|
2737
|
+
method: 'GET',
|
|
2738
|
+
path: requestPath,
|
|
2739
|
+
queryParameters,
|
|
2740
|
+
headers,
|
|
2741
|
+
};
|
|
2742
|
+
return transporter.request(request, requestOptions);
|
|
2743
|
+
},
|
|
2630
2744
|
/**
|
|
2631
2745
|
* Lists supported languages with their supported dictionary types and number of custom entries.
|
|
2632
2746
|
*
|
|
@@ -3101,7 +3215,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3101
3215
|
return transporter.request(request, requestOptions);
|
|
3102
3216
|
},
|
|
3103
3217
|
/**
|
|
3104
|
-
* Copies or moves (renames) an index within the same Algolia application. - Existing destination indices are overwritten, except for
|
|
3218
|
+
* 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
3219
|
*
|
|
3106
3220
|
* Required API Key ACLs:
|
|
3107
3221
|
* - addObject.
|
|
@@ -3786,7 +3900,369 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3786
3900
|
}
|
|
3787
3901
|
|
|
3788
3902
|
// 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 =
|
|
3903
|
+
const apiClientVersion$1 = '5.0.0-beta.11';
|
|
3904
|
+
function getDefaultHosts(appId) {
|
|
3905
|
+
return [
|
|
3906
|
+
{
|
|
3907
|
+
url: `${appId}-dsn.algolia.net`,
|
|
3908
|
+
accept: 'read',
|
|
3909
|
+
protocol: 'https',
|
|
3910
|
+
},
|
|
3911
|
+
{
|
|
3912
|
+
url: `${appId}.algolia.net`,
|
|
3913
|
+
accept: 'write',
|
|
3914
|
+
protocol: 'https',
|
|
3915
|
+
},
|
|
3916
|
+
].concat(clientCommon.shuffle([
|
|
3917
|
+
{
|
|
3918
|
+
url: `${appId}-1.algolianet.com`,
|
|
3919
|
+
accept: 'readWrite',
|
|
3920
|
+
protocol: 'https',
|
|
3921
|
+
},
|
|
3922
|
+
{
|
|
3923
|
+
url: `${appId}-2.algolianet.com`,
|
|
3924
|
+
accept: 'readWrite',
|
|
3925
|
+
protocol: 'https',
|
|
3926
|
+
},
|
|
3927
|
+
{
|
|
3928
|
+
url: `${appId}-3.algolianet.com`,
|
|
3929
|
+
accept: 'readWrite',
|
|
3930
|
+
protocol: 'https',
|
|
3931
|
+
},
|
|
3932
|
+
]));
|
|
3933
|
+
}
|
|
3934
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
3935
|
+
function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }) {
|
|
3936
|
+
const auth = clientCommon.createAuth(appIdOption, apiKeyOption, authMode);
|
|
3937
|
+
const transporter = clientCommon.createTransporter({
|
|
3938
|
+
hosts: getDefaultHosts(appIdOption),
|
|
3939
|
+
...options,
|
|
3940
|
+
algoliaAgent: clientCommon.getAlgoliaAgent({
|
|
3941
|
+
algoliaAgents,
|
|
3942
|
+
client: 'Recommend',
|
|
3943
|
+
version: apiClientVersion$1,
|
|
3944
|
+
}),
|
|
3945
|
+
baseHeaders: {
|
|
3946
|
+
'content-type': 'text/plain',
|
|
3947
|
+
...auth.headers(),
|
|
3948
|
+
...options.baseHeaders,
|
|
3949
|
+
},
|
|
3950
|
+
baseQueryParameters: {
|
|
3951
|
+
...auth.queryParameters(),
|
|
3952
|
+
...options.baseQueryParameters,
|
|
3953
|
+
},
|
|
3954
|
+
});
|
|
3955
|
+
return {
|
|
3956
|
+
transporter,
|
|
3957
|
+
/**
|
|
3958
|
+
* The `appId` currently in use.
|
|
3959
|
+
*/
|
|
3960
|
+
appId: appIdOption,
|
|
3961
|
+
/**
|
|
3962
|
+
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
3963
|
+
*/
|
|
3964
|
+
clearCache() {
|
|
3965
|
+
return Promise.all([
|
|
3966
|
+
transporter.requestsCache.clear(),
|
|
3967
|
+
transporter.responsesCache.clear(),
|
|
3968
|
+
]).then(() => undefined);
|
|
3969
|
+
},
|
|
3970
|
+
/**
|
|
3971
|
+
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
3972
|
+
*/
|
|
3973
|
+
get _ua() {
|
|
3974
|
+
return transporter.algoliaAgent.value;
|
|
3975
|
+
},
|
|
3976
|
+
/**
|
|
3977
|
+
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
|
3978
|
+
*
|
|
3979
|
+
* @param segment - The algolia agent (user-agent) segment to add.
|
|
3980
|
+
* @param version - The version of the agent.
|
|
3981
|
+
*/
|
|
3982
|
+
addAlgoliaAgent(segment, version) {
|
|
3983
|
+
transporter.algoliaAgent.add({ segment, version });
|
|
3984
|
+
},
|
|
3985
|
+
/**
|
|
3986
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
3987
|
+
*
|
|
3988
|
+
* @param customDelete - The customDelete object.
|
|
3989
|
+
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
3990
|
+
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
3991
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
3992
|
+
*/
|
|
3993
|
+
customDelete({ path, parameters }, requestOptions) {
|
|
3994
|
+
if (!path) {
|
|
3995
|
+
throw new Error('Parameter `path` is required when calling `customDelete`.');
|
|
3996
|
+
}
|
|
3997
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
3998
|
+
const headers = {};
|
|
3999
|
+
const queryParameters = parameters ? parameters : {};
|
|
4000
|
+
const request = {
|
|
4001
|
+
method: 'DELETE',
|
|
4002
|
+
path: requestPath,
|
|
4003
|
+
queryParameters,
|
|
4004
|
+
headers,
|
|
4005
|
+
};
|
|
4006
|
+
return transporter.request(request, requestOptions);
|
|
4007
|
+
},
|
|
4008
|
+
/**
|
|
4009
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
4010
|
+
*
|
|
4011
|
+
* @param customGet - The customGet object.
|
|
4012
|
+
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
4013
|
+
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
4014
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
4015
|
+
*/
|
|
4016
|
+
customGet({ path, parameters }, requestOptions) {
|
|
4017
|
+
if (!path) {
|
|
4018
|
+
throw new Error('Parameter `path` is required when calling `customGet`.');
|
|
4019
|
+
}
|
|
4020
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
4021
|
+
const headers = {};
|
|
4022
|
+
const queryParameters = parameters ? parameters : {};
|
|
4023
|
+
const request = {
|
|
4024
|
+
method: 'GET',
|
|
4025
|
+
path: requestPath,
|
|
4026
|
+
queryParameters,
|
|
4027
|
+
headers,
|
|
4028
|
+
};
|
|
4029
|
+
return transporter.request(request, requestOptions);
|
|
4030
|
+
},
|
|
4031
|
+
/**
|
|
4032
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
4033
|
+
*
|
|
4034
|
+
* @param customPost - The customPost object.
|
|
4035
|
+
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
4036
|
+
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
4037
|
+
* @param customPost.body - Parameters to send with the custom request.
|
|
4038
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
4039
|
+
*/
|
|
4040
|
+
customPost({ path, parameters, body }, requestOptions) {
|
|
4041
|
+
if (!path) {
|
|
4042
|
+
throw new Error('Parameter `path` is required when calling `customPost`.');
|
|
4043
|
+
}
|
|
4044
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
4045
|
+
const headers = {};
|
|
4046
|
+
const queryParameters = parameters ? parameters : {};
|
|
4047
|
+
const request = {
|
|
4048
|
+
method: 'POST',
|
|
4049
|
+
path: requestPath,
|
|
4050
|
+
queryParameters,
|
|
4051
|
+
headers,
|
|
4052
|
+
data: body ? body : {},
|
|
4053
|
+
};
|
|
4054
|
+
return transporter.request(request, requestOptions);
|
|
4055
|
+
},
|
|
4056
|
+
/**
|
|
4057
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
4058
|
+
*
|
|
4059
|
+
* @param customPut - The customPut object.
|
|
4060
|
+
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
4061
|
+
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
4062
|
+
* @param customPut.body - Parameters to send with the custom request.
|
|
4063
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
4064
|
+
*/
|
|
4065
|
+
customPut({ path, parameters, body }, requestOptions) {
|
|
4066
|
+
if (!path) {
|
|
4067
|
+
throw new Error('Parameter `path` is required when calling `customPut`.');
|
|
4068
|
+
}
|
|
4069
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
4070
|
+
const headers = {};
|
|
4071
|
+
const queryParameters = parameters ? parameters : {};
|
|
4072
|
+
const request = {
|
|
4073
|
+
method: 'PUT',
|
|
4074
|
+
path: requestPath,
|
|
4075
|
+
queryParameters,
|
|
4076
|
+
headers,
|
|
4077
|
+
data: body ? body : {},
|
|
4078
|
+
};
|
|
4079
|
+
return transporter.request(request, requestOptions);
|
|
4080
|
+
},
|
|
4081
|
+
/**
|
|
4082
|
+
* Deletes a Recommend rule from a recommendation scenario.
|
|
4083
|
+
*
|
|
4084
|
+
* Required API Key ACLs:
|
|
4085
|
+
* - editSettings.
|
|
4086
|
+
*
|
|
4087
|
+
* @param deleteRecommendRule - The deleteRecommendRule object.
|
|
4088
|
+
* @param deleteRecommendRule.indexName - Name of the index on which to perform the operation.
|
|
4089
|
+
* @param deleteRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
4090
|
+
* @param deleteRecommendRule.objectID - Unique record identifier.
|
|
4091
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
4092
|
+
*/
|
|
4093
|
+
deleteRecommendRule({ indexName, model, objectID }, requestOptions) {
|
|
4094
|
+
if (!indexName) {
|
|
4095
|
+
throw new Error('Parameter `indexName` is required when calling `deleteRecommendRule`.');
|
|
4096
|
+
}
|
|
4097
|
+
if (!model) {
|
|
4098
|
+
throw new Error('Parameter `model` is required when calling `deleteRecommendRule`.');
|
|
4099
|
+
}
|
|
4100
|
+
if (!objectID) {
|
|
4101
|
+
throw new Error('Parameter `objectID` is required when calling `deleteRecommendRule`.');
|
|
4102
|
+
}
|
|
4103
|
+
const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/{objectID}'
|
|
4104
|
+
.replace('{indexName}', encodeURIComponent(indexName))
|
|
4105
|
+
.replace('{model}', encodeURIComponent(model))
|
|
4106
|
+
.replace('{objectID}', encodeURIComponent(objectID));
|
|
4107
|
+
const headers = {};
|
|
4108
|
+
const queryParameters = {};
|
|
4109
|
+
const request = {
|
|
4110
|
+
method: 'DELETE',
|
|
4111
|
+
path: requestPath,
|
|
4112
|
+
queryParameters,
|
|
4113
|
+
headers,
|
|
4114
|
+
};
|
|
4115
|
+
return transporter.request(request, requestOptions);
|
|
4116
|
+
},
|
|
4117
|
+
/**
|
|
4118
|
+
* Retrieves a Recommend rule that you previously created in the Algolia dashboard.
|
|
4119
|
+
*
|
|
4120
|
+
* Required API Key ACLs:
|
|
4121
|
+
* - settings.
|
|
4122
|
+
*
|
|
4123
|
+
* @param getRecommendRule - The getRecommendRule object.
|
|
4124
|
+
* @param getRecommendRule.indexName - Name of the index on which to perform the operation.
|
|
4125
|
+
* @param getRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
4126
|
+
* @param getRecommendRule.objectID - Unique record identifier.
|
|
4127
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
4128
|
+
*/
|
|
4129
|
+
getRecommendRule({ indexName, model, objectID }, requestOptions) {
|
|
4130
|
+
if (!indexName) {
|
|
4131
|
+
throw new Error('Parameter `indexName` is required when calling `getRecommendRule`.');
|
|
4132
|
+
}
|
|
4133
|
+
if (!model) {
|
|
4134
|
+
throw new Error('Parameter `model` is required when calling `getRecommendRule`.');
|
|
4135
|
+
}
|
|
4136
|
+
if (!objectID) {
|
|
4137
|
+
throw new Error('Parameter `objectID` is required when calling `getRecommendRule`.');
|
|
4138
|
+
}
|
|
4139
|
+
const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/{objectID}'
|
|
4140
|
+
.replace('{indexName}', encodeURIComponent(indexName))
|
|
4141
|
+
.replace('{model}', encodeURIComponent(model))
|
|
4142
|
+
.replace('{objectID}', encodeURIComponent(objectID));
|
|
4143
|
+
const headers = {};
|
|
4144
|
+
const queryParameters = {};
|
|
4145
|
+
const request = {
|
|
4146
|
+
method: 'GET',
|
|
4147
|
+
path: requestPath,
|
|
4148
|
+
queryParameters,
|
|
4149
|
+
headers,
|
|
4150
|
+
};
|
|
4151
|
+
return transporter.request(request, requestOptions);
|
|
4152
|
+
},
|
|
4153
|
+
/**
|
|
4154
|
+
* 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.
|
|
4155
|
+
*
|
|
4156
|
+
* Required API Key ACLs:
|
|
4157
|
+
* - editSettings.
|
|
4158
|
+
*
|
|
4159
|
+
* @param getRecommendStatus - The getRecommendStatus object.
|
|
4160
|
+
* @param getRecommendStatus.indexName - Name of the index on which to perform the operation.
|
|
4161
|
+
* @param getRecommendStatus.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
4162
|
+
* @param getRecommendStatus.taskID - Unique task identifier.
|
|
4163
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
4164
|
+
*/
|
|
4165
|
+
getRecommendStatus({ indexName, model, taskID }, requestOptions) {
|
|
4166
|
+
if (!indexName) {
|
|
4167
|
+
throw new Error('Parameter `indexName` is required when calling `getRecommendStatus`.');
|
|
4168
|
+
}
|
|
4169
|
+
if (!model) {
|
|
4170
|
+
throw new Error('Parameter `model` is required when calling `getRecommendStatus`.');
|
|
4171
|
+
}
|
|
4172
|
+
if (!taskID) {
|
|
4173
|
+
throw new Error('Parameter `taskID` is required when calling `getRecommendStatus`.');
|
|
4174
|
+
}
|
|
4175
|
+
const requestPath = '/1/indexes/{indexName}/{model}/task/{taskID}'
|
|
4176
|
+
.replace('{indexName}', encodeURIComponent(indexName))
|
|
4177
|
+
.replace('{model}', encodeURIComponent(model))
|
|
4178
|
+
.replace('{taskID}', encodeURIComponent(taskID));
|
|
4179
|
+
const headers = {};
|
|
4180
|
+
const queryParameters = {};
|
|
4181
|
+
const request = {
|
|
4182
|
+
method: 'GET',
|
|
4183
|
+
path: requestPath,
|
|
4184
|
+
queryParameters,
|
|
4185
|
+
headers,
|
|
4186
|
+
};
|
|
4187
|
+
return transporter.request(request, requestOptions);
|
|
4188
|
+
},
|
|
4189
|
+
/**
|
|
4190
|
+
* Retrieves recommendations from selected AI models.
|
|
4191
|
+
*
|
|
4192
|
+
* Required API Key ACLs:
|
|
4193
|
+
* - search.
|
|
4194
|
+
*
|
|
4195
|
+
* @param getRecommendationsParams - The getRecommendationsParams object.
|
|
4196
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
4197
|
+
*/
|
|
4198
|
+
getRecommendations(getRecommendationsParams, requestOptions) {
|
|
4199
|
+
if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {
|
|
4200
|
+
const newSignatureRequest = {
|
|
4201
|
+
requests: getRecommendationsParams,
|
|
4202
|
+
};
|
|
4203
|
+
// eslint-disable-next-line no-param-reassign
|
|
4204
|
+
getRecommendationsParams = newSignatureRequest;
|
|
4205
|
+
}
|
|
4206
|
+
if (!getRecommendationsParams) {
|
|
4207
|
+
throw new Error('Parameter `getRecommendationsParams` is required when calling `getRecommendations`.');
|
|
4208
|
+
}
|
|
4209
|
+
if (!getRecommendationsParams.requests) {
|
|
4210
|
+
throw new Error('Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.');
|
|
4211
|
+
}
|
|
4212
|
+
const requestPath = '/1/indexes/*/recommendations';
|
|
4213
|
+
const headers = {};
|
|
4214
|
+
const queryParameters = {};
|
|
4215
|
+
const request = {
|
|
4216
|
+
method: 'POST',
|
|
4217
|
+
path: requestPath,
|
|
4218
|
+
queryParameters,
|
|
4219
|
+
headers,
|
|
4220
|
+
data: getRecommendationsParams,
|
|
4221
|
+
useReadTransporter: true,
|
|
4222
|
+
cacheable: true,
|
|
4223
|
+
};
|
|
4224
|
+
return transporter.request(request, requestOptions);
|
|
4225
|
+
},
|
|
4226
|
+
/**
|
|
4227
|
+
* Searches for Recommend rules. Use an empty query to list all rules for this recommendation scenario.
|
|
4228
|
+
*
|
|
4229
|
+
* Required API Key ACLs:
|
|
4230
|
+
* - settings.
|
|
4231
|
+
*
|
|
4232
|
+
* @param searchRecommendRules - The searchRecommendRules object.
|
|
4233
|
+
* @param searchRecommendRules.indexName - Name of the index on which to perform the operation.
|
|
4234
|
+
* @param searchRecommendRules.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
4235
|
+
* @param searchRecommendRules.searchRecommendRulesParams - The searchRecommendRulesParams object.
|
|
4236
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
4237
|
+
*/
|
|
4238
|
+
searchRecommendRules({ indexName, model, searchRecommendRulesParams, }, requestOptions) {
|
|
4239
|
+
if (!indexName) {
|
|
4240
|
+
throw new Error('Parameter `indexName` is required when calling `searchRecommendRules`.');
|
|
4241
|
+
}
|
|
4242
|
+
if (!model) {
|
|
4243
|
+
throw new Error('Parameter `model` is required when calling `searchRecommendRules`.');
|
|
4244
|
+
}
|
|
4245
|
+
const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/search'
|
|
4246
|
+
.replace('{indexName}', encodeURIComponent(indexName))
|
|
4247
|
+
.replace('{model}', encodeURIComponent(model));
|
|
4248
|
+
const headers = {};
|
|
4249
|
+
const queryParameters = {};
|
|
4250
|
+
const request = {
|
|
4251
|
+
method: 'POST',
|
|
4252
|
+
path: requestPath,
|
|
4253
|
+
queryParameters,
|
|
4254
|
+
headers,
|
|
4255
|
+
data: searchRecommendRulesParams ? searchRecommendRulesParams : {},
|
|
4256
|
+
useReadTransporter: true,
|
|
4257
|
+
cacheable: true,
|
|
4258
|
+
};
|
|
4259
|
+
return transporter.request(request, requestOptions);
|
|
4260
|
+
},
|
|
4261
|
+
};
|
|
4262
|
+
}
|
|
4263
|
+
|
|
4264
|
+
// 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.
|
|
4265
|
+
const apiClientVersion = apiClientVersion$2;
|
|
3790
4266
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
3791
4267
|
function algoliasearch(appId, apiKey, options) {
|
|
3792
4268
|
if (!appId || typeof appId !== 'string') {
|
|
@@ -3810,6 +4286,13 @@ function algoliasearch(appId, apiKey, options) {
|
|
|
3810
4286
|
hostsCache: clientCommon.createMemoryCache(),
|
|
3811
4287
|
...options,
|
|
3812
4288
|
};
|
|
4289
|
+
function initRecommend(initOptions = {}) {
|
|
4290
|
+
return createRecommendClient({
|
|
4291
|
+
...commonOptions,
|
|
4292
|
+
...initOptions.options,
|
|
4293
|
+
...initOptions,
|
|
4294
|
+
});
|
|
4295
|
+
}
|
|
3813
4296
|
function initAnalytics(initOptions = {}) {
|
|
3814
4297
|
if (initOptions.region &&
|
|
3815
4298
|
(typeof initOptions.region !== 'string' ||
|
|
@@ -3855,9 +4338,10 @@ function algoliasearch(appId, apiKey, options) {
|
|
|
3855
4338
|
get _ua() {
|
|
3856
4339
|
return this.transporter.algoliaAgent.value;
|
|
3857
4340
|
},
|
|
4341
|
+
initAbtesting,
|
|
3858
4342
|
initAnalytics,
|
|
3859
4343
|
initPersonalization,
|
|
3860
|
-
|
|
4344
|
+
initRecommend,
|
|
3861
4345
|
/**
|
|
3862
4346
|
* Helper: Generates a secured API key based on the given `parentApiKey` and given `restrictions`.
|
|
3863
4347
|
*
|
|
@@ -3867,7 +4351,23 @@ function algoliasearch(appId, apiKey, options) {
|
|
|
3867
4351
|
* @param generateSecuredApiKey.restrictions - A set of properties defining the restrictions of the secured API key.
|
|
3868
4352
|
*/
|
|
3869
4353
|
generateSecuredApiKey({ parentApiKey, restrictions = {}, }) {
|
|
3870
|
-
|
|
4354
|
+
let mergedRestrictions = restrictions;
|
|
4355
|
+
if (restrictions.searchParams) {
|
|
4356
|
+
// merge searchParams with the root restrictions
|
|
4357
|
+
mergedRestrictions = {
|
|
4358
|
+
...restrictions,
|
|
4359
|
+
...restrictions.searchParams,
|
|
4360
|
+
};
|
|
4361
|
+
delete mergedRestrictions.searchParams;
|
|
4362
|
+
}
|
|
4363
|
+
mergedRestrictions = Object.keys(mergedRestrictions)
|
|
4364
|
+
.sort()
|
|
4365
|
+
.reduce((acc, key) => {
|
|
4366
|
+
// eslint-disable-next-line no-param-reassign
|
|
4367
|
+
acc[key] = mergedRestrictions[key];
|
|
4368
|
+
return acc;
|
|
4369
|
+
}, {});
|
|
4370
|
+
const queryParameters = clientCommon.serializeQueryParameters(mergedRestrictions);
|
|
3871
4371
|
return Buffer.from(crypto.createHmac('sha256', parentApiKey)
|
|
3872
4372
|
.update(queryParameters)
|
|
3873
4373
|
.digest('hex') + queryParameters).toString('base64');
|