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