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.
Files changed (517) hide show
  1. package/LICENSE +21 -0
  2. package/builds/browser.ts +13 -2
  3. package/builds/models.ts +140 -6
  4. package/builds/node.ts +37 -4
  5. package/dist/algoliasearch/builds/browser.d.ts +77 -70
  6. package/dist/algoliasearch/builds/browser.d.ts.map +1 -1
  7. package/dist/algoliasearch/builds/models.d.ts +4 -2
  8. package/dist/algoliasearch/builds/models.d.ts.map +1 -1
  9. package/dist/algoliasearch/builds/node.d.ts +77 -70
  10. package/dist/algoliasearch/builds/node.d.ts.map +1 -1
  11. package/dist/algoliasearch.cjs +531 -31
  12. package/dist/algoliasearch.esm.browser.js +524 -47
  13. package/dist/algoliasearch.esm.node.js +531 -31
  14. package/dist/algoliasearch.umd.js +2 -2
  15. package/dist/client-abtesting/src/abtestingClient.d.ts +1 -1
  16. package/dist/client-abtesting/src/abtestingClient.d.ts.map +1 -1
  17. package/dist/client-analytics/src/analyticsClient.d.ts +1 -1
  18. package/dist/client-analytics/src/analyticsClient.d.ts.map +1 -1
  19. package/dist/client-personalization/src/personalizationClient.d.ts +1 -1
  20. package/dist/client-personalization/src/personalizationClient.d.ts.map +1 -1
  21. package/dist/client-search/model/baseIndexSettings.d.ts +2 -2
  22. package/dist/client-search/model/baseIndexSettings.d.ts.map +1 -1
  23. package/dist/client-search/model/baseSearchResponse.d.ts +2 -18
  24. package/dist/client-search/model/baseSearchResponse.d.ts.map +1 -1
  25. package/dist/client-search/model/browsePagination.d.ts +19 -0
  26. package/dist/client-search/model/browsePagination.d.ts.map +1 -0
  27. package/dist/client-search/model/browseResponse.d.ts +2 -1
  28. package/dist/client-search/model/browseResponse.d.ts.map +1 -1
  29. package/dist/client-search/model/clientMethodProps.d.ts +31 -23
  30. package/dist/client-search/model/clientMethodProps.d.ts.map +1 -1
  31. package/dist/client-search/model/facetFilters.d.ts +1 -2
  32. package/dist/client-search/model/facetFilters.d.ts.map +1 -1
  33. package/dist/client-search/model/fetchedIndex.d.ts +4 -0
  34. package/dist/client-search/model/fetchedIndex.d.ts.map +1 -1
  35. package/dist/client-search/model/index.d.ts +5 -2
  36. package/dist/client-search/model/index.d.ts.map +1 -1
  37. package/dist/client-search/model/numericFilters.d.ts +1 -2
  38. package/dist/client-search/model/numericFilters.d.ts.map +1 -1
  39. package/dist/client-search/model/optionalFilters.d.ts +1 -2
  40. package/dist/client-search/model/optionalFilters.d.ts.map +1 -1
  41. package/dist/client-search/model/rankingInfo.d.ts +3 -3
  42. package/dist/client-search/model/rankingInfo.d.ts.map +1 -1
  43. package/dist/client-search/model/reRankingApplyFilter.d.ts +1 -2
  44. package/dist/client-search/model/reRankingApplyFilter.d.ts.map +1 -1
  45. package/dist/client-search/model/redirect.d.ts +1 -1
  46. package/dist/client-search/model/redirectURL.d.ts +7 -0
  47. package/dist/client-search/model/redirectURL.d.ts.map +1 -0
  48. package/dist/client-search/model/renderingContent.d.ts +2 -0
  49. package/dist/client-search/model/renderingContent.d.ts.map +1 -1
  50. package/dist/client-search/model/replaceAllObjectsResponse.d.ts +11 -0
  51. package/dist/client-search/model/replaceAllObjectsResponse.d.ts.map +1 -0
  52. package/dist/client-search/model/searchForFacetValuesResponse.d.ts +1 -1
  53. package/dist/client-search/model/searchPagination.d.ts +19 -0
  54. package/dist/client-search/model/searchPagination.d.ts.map +1 -0
  55. package/dist/client-search/model/searchResponse.d.ts +2 -1
  56. package/dist/client-search/model/searchResponse.d.ts.map +1 -1
  57. package/dist/{lite/model/securedAPIKeyRestrictions.d.ts → client-search/model/securedApiKeyRestrictions.d.ts} +2 -2
  58. package/dist/client-search/model/{securedAPIKeyRestrictions.d.ts.map → securedApiKeyRestrictions.d.ts.map} +1 -1
  59. package/dist/client-search/model/tagFilters.d.ts +1 -2
  60. package/dist/client-search/model/tagFilters.d.ts.map +1 -1
  61. package/dist/client-search/model/value.d.ts +4 -0
  62. package/dist/client-search/model/value.d.ts.map +1 -1
  63. package/dist/client-search/src/searchClient.d.ts +69 -14
  64. package/dist/client-search/src/searchClient.d.ts.map +1 -1
  65. package/dist/lite/builds/browser.d.ts +4 -3
  66. package/dist/lite/builds/browser.d.ts.map +1 -1
  67. package/dist/lite/builds/node.d.ts +4 -3
  68. package/dist/lite/builds/node.d.ts.map +1 -1
  69. package/dist/lite/lite.cjs +38 -1
  70. package/dist/lite/lite.esm.browser.js +48 -18
  71. package/dist/lite/lite.esm.node.js +38 -1
  72. package/dist/lite/lite.umd.js +2 -2
  73. package/dist/lite/model/baseIndexSettings.d.ts +2 -2
  74. package/dist/lite/model/baseIndexSettings.d.ts.map +1 -1
  75. package/dist/lite/model/baseRecommendRequest.d.ts +17 -0
  76. package/dist/lite/model/baseRecommendRequest.d.ts.map +1 -0
  77. package/dist/lite/model/baseSearchResponse.d.ts +2 -18
  78. package/dist/lite/model/baseSearchResponse.d.ts.map +1 -1
  79. package/dist/lite/model/boughtTogetherQuery.d.ts +4 -0
  80. package/dist/lite/model/boughtTogetherQuery.d.ts.map +1 -0
  81. package/dist/lite/model/browsePagination.d.ts +19 -0
  82. package/dist/lite/model/browsePagination.d.ts.map +1 -0
  83. package/dist/lite/model/browseResponse.d.ts +2 -1
  84. package/dist/lite/model/browseResponse.d.ts.map +1 -1
  85. package/dist/lite/model/clientMethodProps.d.ts +7 -0
  86. package/dist/lite/model/clientMethodProps.d.ts.map +1 -1
  87. package/dist/lite/model/facetFilters.d.ts +1 -2
  88. package/dist/lite/model/facetFilters.d.ts.map +1 -1
  89. package/dist/lite/model/fallbackParams.d.ts +3 -0
  90. package/dist/lite/model/fallbackParams.d.ts.map +1 -0
  91. package/dist/lite/model/fbtModel.d.ts +5 -0
  92. package/dist/lite/model/fbtModel.d.ts.map +1 -0
  93. package/dist/lite/model/frequentlyBoughtTogether.d.ts +9 -0
  94. package/dist/lite/model/frequentlyBoughtTogether.d.ts.map +1 -0
  95. package/dist/lite/model/getRecommendationsParams.d.ts +11 -0
  96. package/dist/lite/model/getRecommendationsParams.d.ts.map +1 -0
  97. package/dist/lite/model/getRecommendationsResponse.d.ts +5 -0
  98. package/dist/lite/model/getRecommendationsResponse.d.ts.map +1 -0
  99. package/dist/lite/model/index.d.ts +31 -40
  100. package/dist/lite/model/index.d.ts.map +1 -1
  101. package/dist/lite/model/lookingSimilar.d.ts +11 -0
  102. package/dist/lite/model/lookingSimilar.d.ts.map +1 -0
  103. package/dist/lite/model/lookingSimilarModel.d.ts +5 -0
  104. package/dist/lite/model/lookingSimilarModel.d.ts.map +1 -0
  105. package/dist/lite/model/lookingSimilarQuery.d.ts +4 -0
  106. package/dist/lite/model/lookingSimilarQuery.d.ts.map +1 -0
  107. package/dist/lite/model/numericFilters.d.ts +1 -2
  108. package/dist/lite/model/numericFilters.d.ts.map +1 -1
  109. package/dist/lite/model/optionalFilters.d.ts +1 -2
  110. package/dist/lite/model/optionalFilters.d.ts.map +1 -1
  111. package/dist/lite/model/rankingInfo.d.ts +3 -3
  112. package/dist/lite/model/rankingInfo.d.ts.map +1 -1
  113. package/dist/lite/model/reRankingApplyFilter.d.ts +1 -2
  114. package/dist/lite/model/reRankingApplyFilter.d.ts.map +1 -1
  115. package/dist/lite/model/recommendHit.d.ts +27 -0
  116. package/dist/lite/model/recommendHit.d.ts.map +1 -0
  117. package/dist/lite/model/recommendationsHit.d.ts +4 -0
  118. package/dist/lite/model/recommendationsHit.d.ts.map +1 -0
  119. package/dist/lite/model/recommendationsHits.d.ts +5 -0
  120. package/dist/lite/model/recommendationsHits.d.ts.map +1 -0
  121. package/dist/lite/model/recommendationsRequest.d.ts +8 -0
  122. package/dist/lite/model/recommendationsRequest.d.ts.map +1 -0
  123. package/dist/lite/model/recommendationsResults.d.ts +5 -0
  124. package/dist/lite/model/recommendationsResults.d.ts.map +1 -0
  125. package/dist/lite/model/recommendedForYou.d.ts +7 -0
  126. package/dist/lite/model/recommendedForYou.d.ts.map +1 -0
  127. package/dist/lite/model/recommendedForYouModel.d.ts +5 -0
  128. package/dist/lite/model/recommendedForYouModel.d.ts.map +1 -0
  129. package/dist/lite/model/recommendedForYouQuery.d.ts +4 -0
  130. package/dist/lite/model/recommendedForYouQuery.d.ts.map +1 -0
  131. package/dist/lite/model/redirect.d.ts +1 -1
  132. package/dist/lite/model/redirectURL.d.ts +7 -0
  133. package/dist/lite/model/redirectURL.d.ts.map +1 -0
  134. package/dist/lite/model/relatedModel.d.ts +5 -0
  135. package/dist/lite/model/relatedModel.d.ts.map +1 -0
  136. package/dist/lite/model/relatedProducts.d.ts +11 -0
  137. package/dist/lite/model/relatedProducts.d.ts.map +1 -0
  138. package/dist/lite/model/relatedQuery.d.ts +4 -0
  139. package/dist/lite/model/relatedQuery.d.ts.map +1 -0
  140. package/dist/lite/model/renderingContent.d.ts +2 -0
  141. package/dist/lite/model/renderingContent.d.ts.map +1 -1
  142. package/dist/lite/model/searchForFacetValuesResponse.d.ts +1 -1
  143. package/dist/lite/model/searchPagination.d.ts +19 -0
  144. package/dist/lite/model/searchPagination.d.ts.map +1 -0
  145. package/dist/lite/model/searchParams.d.ts +1 -2
  146. package/dist/lite/model/searchParams.d.ts.map +1 -1
  147. package/dist/lite/model/searchResponse.d.ts +2 -1
  148. package/dist/lite/model/searchResponse.d.ts.map +1 -1
  149. package/dist/lite/model/tagFilters.d.ts +1 -2
  150. package/dist/lite/model/tagFilters.d.ts.map +1 -1
  151. package/dist/lite/model/trendingFacetHit.d.ts +18 -0
  152. package/dist/lite/model/trendingFacetHit.d.ts.map +1 -0
  153. package/dist/lite/model/trendingFacets.d.ts +11 -0
  154. package/dist/lite/model/trendingFacets.d.ts.map +1 -0
  155. package/dist/lite/model/trendingFacetsModel.d.ts +5 -0
  156. package/dist/lite/model/trendingFacetsModel.d.ts.map +1 -0
  157. package/dist/lite/model/trendingFacetsQuery.d.ts +4 -0
  158. package/dist/lite/model/trendingFacetsQuery.d.ts.map +1 -0
  159. package/dist/lite/model/trendingItems.d.ts +15 -0
  160. package/dist/lite/model/trendingItems.d.ts.map +1 -0
  161. package/dist/lite/model/trendingItemsModel.d.ts +5 -0
  162. package/dist/lite/model/trendingItemsModel.d.ts.map +1 -0
  163. package/dist/lite/model/trendingItemsQuery.d.ts +4 -0
  164. package/dist/lite/model/trendingItemsQuery.d.ts.map +1 -0
  165. package/dist/lite/model/value.d.ts +4 -0
  166. package/dist/lite/model/value.d.ts.map +1 -1
  167. package/dist/lite/src/liteClient.d.ts +14 -2
  168. package/dist/lite/src/liteClient.d.ts.map +1 -1
  169. package/dist/recommend/model/advancedSyntaxFeatures.d.ts +2 -0
  170. package/dist/recommend/model/advancedSyntaxFeatures.d.ts.map +1 -0
  171. package/dist/recommend/model/alternativesAsExact.d.ts +2 -0
  172. package/dist/recommend/model/alternativesAsExact.d.ts.map +1 -0
  173. package/dist/recommend/model/aroundPrecision.d.ts +6 -0
  174. package/dist/recommend/model/aroundPrecision.d.ts.map +1 -0
  175. package/dist/recommend/model/aroundPrecisionFromValueInner.d.ts +14 -0
  176. package/dist/recommend/model/aroundPrecisionFromValueInner.d.ts.map +1 -0
  177. package/dist/recommend/model/aroundRadius.d.ts +6 -0
  178. package/dist/recommend/model/aroundRadius.d.ts.map +1 -0
  179. package/dist/recommend/model/aroundRadiusAll.d.ts +5 -0
  180. package/dist/recommend/model/aroundRadiusAll.d.ts.map +1 -0
  181. package/dist/recommend/model/autoFacetFilter.d.ts +14 -0
  182. package/dist/recommend/model/autoFacetFilter.d.ts.map +1 -0
  183. package/dist/recommend/model/baseRecommendRequest.d.ts +17 -0
  184. package/dist/recommend/model/baseRecommendRequest.d.ts.map +1 -0
  185. package/dist/recommend/model/baseSearchParams.d.ts +4 -0
  186. package/dist/recommend/model/baseSearchParams.d.ts.map +1 -0
  187. package/dist/recommend/model/baseSearchParamsWithoutQuery.d.ts +116 -0
  188. package/dist/recommend/model/baseSearchParamsWithoutQuery.d.ts.map +1 -0
  189. package/dist/recommend/model/baseSearchResponse.d.ts +94 -0
  190. package/dist/recommend/model/baseSearchResponse.d.ts.map +1 -0
  191. package/dist/recommend/model/boughtTogetherQuery.d.ts +4 -0
  192. package/dist/recommend/model/boughtTogetherQuery.d.ts.map +1 -0
  193. package/dist/recommend/model/clientMethodProps.d.ts +135 -0
  194. package/dist/recommend/model/clientMethodProps.d.ts.map +1 -0
  195. package/dist/recommend/model/condition.d.ts +14 -0
  196. package/dist/recommend/model/condition.d.ts.map +1 -0
  197. package/dist/recommend/model/consequence.d.ts +18 -0
  198. package/dist/recommend/model/consequence.d.ts.map +1 -0
  199. package/dist/{lite/model/updatedRuleResponse.d.ts → recommend/model/deletedAtResponse.d.ts} +9 -10
  200. package/dist/recommend/model/deletedAtResponse.d.ts.map +1 -0
  201. package/dist/recommend/model/distinct.d.ts +5 -0
  202. package/dist/recommend/model/distinct.d.ts.map +1 -0
  203. package/dist/recommend/model/errorBase.d.ts +7 -0
  204. package/dist/recommend/model/errorBase.d.ts.map +1 -0
  205. package/dist/recommend/model/exactOnSingleWordQuery.d.ts +5 -0
  206. package/dist/recommend/model/exactOnSingleWordQuery.d.ts.map +1 -0
  207. package/dist/recommend/model/exhaustive.d.ts +26 -0
  208. package/dist/recommend/model/exhaustive.d.ts.map +1 -0
  209. package/dist/recommend/model/facetFilters.d.ts +5 -0
  210. package/dist/recommend/model/facetFilters.d.ts.map +1 -0
  211. package/dist/recommend/model/facetOrdering.d.ts +13 -0
  212. package/dist/recommend/model/facetOrdering.d.ts.map +1 -0
  213. package/dist/recommend/model/facets.d.ts +10 -0
  214. package/dist/recommend/model/facets.d.ts.map +1 -0
  215. package/dist/recommend/model/facetsStats.d.ts +19 -0
  216. package/dist/recommend/model/facetsStats.d.ts.map +1 -0
  217. package/dist/recommend/model/fallbackParams.d.ts +3 -0
  218. package/dist/recommend/model/fallbackParams.d.ts.map +1 -0
  219. package/dist/recommend/model/fbtModel.d.ts +5 -0
  220. package/dist/recommend/model/fbtModel.d.ts.map +1 -0
  221. package/dist/recommend/model/frequentlyBoughtTogether.d.ts +9 -0
  222. package/dist/recommend/model/frequentlyBoughtTogether.d.ts.map +1 -0
  223. package/dist/recommend/model/getRecommendTaskResponse.d.ts +5 -0
  224. package/dist/recommend/model/getRecommendTaskResponse.d.ts.map +1 -0
  225. package/dist/recommend/model/getRecommendationsParams.d.ts +11 -0
  226. package/dist/recommend/model/getRecommendationsParams.d.ts.map +1 -0
  227. package/dist/recommend/model/getRecommendationsResponse.d.ts +5 -0
  228. package/dist/recommend/model/getRecommendationsResponse.d.ts.map +1 -0
  229. package/dist/recommend/model/hideConsequenceObject.d.ts +10 -0
  230. package/dist/recommend/model/hideConsequenceObject.d.ts.map +1 -0
  231. package/dist/recommend/model/highlightResult.d.ts +3 -0
  232. package/dist/recommend/model/highlightResult.d.ts.map +1 -0
  233. package/dist/recommend/model/highlightResultOption.d.ts +20 -0
  234. package/dist/recommend/model/highlightResultOption.d.ts.map +1 -0
  235. package/dist/recommend/model/ignorePlurals.d.ts +6 -0
  236. package/dist/recommend/model/ignorePlurals.d.ts.map +1 -0
  237. package/dist/recommend/model/index.d.ts +94 -0
  238. package/dist/recommend/model/index.d.ts.map +1 -0
  239. package/dist/recommend/model/indexSettingsAsSearchParams.d.ts +160 -0
  240. package/dist/recommend/model/indexSettingsAsSearchParams.d.ts.map +1 -0
  241. package/dist/recommend/model/lookingSimilar.d.ts +11 -0
  242. package/dist/recommend/model/lookingSimilar.d.ts.map +1 -0
  243. package/dist/recommend/model/lookingSimilarModel.d.ts +5 -0
  244. package/dist/recommend/model/lookingSimilarModel.d.ts.map +1 -0
  245. package/dist/recommend/model/lookingSimilarQuery.d.ts +4 -0
  246. package/dist/recommend/model/lookingSimilarQuery.d.ts.map +1 -0
  247. package/dist/recommend/model/matchLevel.d.ts +5 -0
  248. package/dist/recommend/model/matchLevel.d.ts.map +1 -0
  249. package/dist/recommend/model/matchedGeoLocation.d.ts +15 -0
  250. package/dist/recommend/model/matchedGeoLocation.d.ts.map +1 -0
  251. package/dist/recommend/model/mode.d.ts +5 -0
  252. package/dist/recommend/model/mode.d.ts.map +1 -0
  253. package/dist/recommend/model/numericFilters.d.ts +5 -0
  254. package/dist/recommend/model/numericFilters.d.ts.map +1 -0
  255. package/dist/recommend/model/optionalFilters.d.ts +5 -0
  256. package/dist/recommend/model/optionalFilters.d.ts.map +1 -0
  257. package/dist/recommend/model/paramsConsequence.d.ts +19 -0
  258. package/dist/recommend/model/paramsConsequence.d.ts.map +1 -0
  259. package/dist/recommend/model/personalization.d.ts +15 -0
  260. package/dist/recommend/model/personalization.d.ts.map +1 -0
  261. package/dist/recommend/model/promoteConsequenceObject.d.ts +14 -0
  262. package/dist/recommend/model/promoteConsequenceObject.d.ts.map +1 -0
  263. package/dist/recommend/model/queryType.d.ts +5 -0
  264. package/dist/recommend/model/queryType.d.ts.map +1 -0
  265. package/dist/recommend/model/rankingInfo.d.ts +54 -0
  266. package/dist/recommend/model/rankingInfo.d.ts.map +1 -0
  267. package/dist/recommend/model/reRankingApplyFilter.d.ts +5 -0
  268. package/dist/recommend/model/reRankingApplyFilter.d.ts.map +1 -0
  269. package/dist/recommend/model/recommendHit.d.ts +27 -0
  270. package/dist/recommend/model/recommendHit.d.ts.map +1 -0
  271. package/dist/recommend/model/recommendModels.d.ts +2 -0
  272. package/dist/recommend/model/recommendModels.d.ts.map +1 -0
  273. package/dist/recommend/model/recommendRule.d.ts +24 -0
  274. package/dist/recommend/model/recommendRule.d.ts.map +1 -0
  275. package/dist/recommend/model/recommendRuleMetadata.d.ts +10 -0
  276. package/dist/recommend/model/recommendRuleMetadata.d.ts.map +1 -0
  277. package/dist/recommend/model/recommendationsHit.d.ts +4 -0
  278. package/dist/recommend/model/recommendationsHit.d.ts.map +1 -0
  279. package/dist/recommend/model/recommendationsHits.d.ts +5 -0
  280. package/dist/recommend/model/recommendationsHits.d.ts.map +1 -0
  281. package/dist/recommend/model/recommendationsRequest.d.ts +8 -0
  282. package/dist/recommend/model/recommendationsRequest.d.ts.map +1 -0
  283. package/dist/recommend/model/recommendationsResults.d.ts +5 -0
  284. package/dist/recommend/model/recommendationsResults.d.ts.map +1 -0
  285. package/dist/recommend/model/recommendedForYou.d.ts +7 -0
  286. package/dist/recommend/model/recommendedForYou.d.ts.map +1 -0
  287. package/dist/recommend/model/recommendedForYouModel.d.ts +5 -0
  288. package/dist/recommend/model/recommendedForYouModel.d.ts.map +1 -0
  289. package/dist/recommend/model/recommendedForYouQuery.d.ts +4 -0
  290. package/dist/recommend/model/recommendedForYouQuery.d.ts.map +1 -0
  291. package/dist/recommend/model/redirect.d.ts +8 -0
  292. package/dist/recommend/model/redirect.d.ts.map +1 -0
  293. package/dist/recommend/model/redirectRuleIndexMetadata.d.ts +21 -0
  294. package/dist/recommend/model/redirectRuleIndexMetadata.d.ts.map +1 -0
  295. package/dist/recommend/model/redirectRuleIndexMetadataData.d.ts +7 -0
  296. package/dist/recommend/model/redirectRuleIndexMetadataData.d.ts.map +1 -0
  297. package/dist/recommend/model/redirectURL.d.ts +7 -0
  298. package/dist/recommend/model/redirectURL.d.ts.map +1 -0
  299. package/dist/recommend/model/relatedModel.d.ts +5 -0
  300. package/dist/recommend/model/relatedModel.d.ts.map +1 -0
  301. package/dist/recommend/model/relatedProducts.d.ts +11 -0
  302. package/dist/recommend/model/relatedProducts.d.ts.map +1 -0
  303. package/dist/recommend/model/relatedQuery.d.ts +4 -0
  304. package/dist/recommend/model/relatedQuery.d.ts.map +1 -0
  305. package/dist/recommend/model/removeStopWords.d.ts +6 -0
  306. package/dist/recommend/model/removeStopWords.d.ts.map +1 -0
  307. package/dist/recommend/model/removeWordsIfNoResults.d.ts +5 -0
  308. package/dist/recommend/model/removeWordsIfNoResults.d.ts.map +1 -0
  309. package/dist/recommend/model/renderingContent.d.ts +10 -0
  310. package/dist/recommend/model/renderingContent.d.ts.map +1 -0
  311. package/dist/recommend/model/searchPagination.d.ts +19 -0
  312. package/dist/recommend/model/searchPagination.d.ts.map +1 -0
  313. package/dist/recommend/model/searchParams.d.ts +3 -0
  314. package/dist/recommend/model/searchParams.d.ts.map +1 -0
  315. package/dist/recommend/model/searchParamsObject.d.ts +7 -0
  316. package/dist/recommend/model/searchParamsObject.d.ts.map +1 -0
  317. package/dist/recommend/model/searchParamsQuery.d.ts +7 -0
  318. package/dist/recommend/model/searchParamsQuery.d.ts.map +1 -0
  319. package/dist/recommend/model/searchRecommendRulesParams.d.ts +38 -0
  320. package/dist/recommend/model/searchRecommendRulesParams.d.ts.map +1 -0
  321. package/dist/recommend/model/searchRecommendRulesResponse.d.ts +20 -0
  322. package/dist/recommend/model/searchRecommendRulesResponse.d.ts.map +1 -0
  323. package/dist/recommend/model/semanticSearch.d.ts +10 -0
  324. package/dist/recommend/model/semanticSearch.d.ts.map +1 -0
  325. package/dist/recommend/model/snippetResult.d.ts +3 -0
  326. package/dist/recommend/model/snippetResult.d.ts.map +1 -0
  327. package/dist/recommend/model/snippetResultOption.d.ts +12 -0
  328. package/dist/recommend/model/snippetResultOption.d.ts.map +1 -0
  329. package/dist/recommend/model/sortRemainingBy.d.ts +5 -0
  330. package/dist/recommend/model/sortRemainingBy.d.ts.map +1 -0
  331. package/dist/recommend/model/supportedLanguage.d.ts +5 -0
  332. package/dist/recommend/model/supportedLanguage.d.ts.map +1 -0
  333. package/dist/recommend/model/tagFilters.d.ts +5 -0
  334. package/dist/recommend/model/tagFilters.d.ts.map +1 -0
  335. package/dist/recommend/model/taskStatus.d.ts.map +1 -0
  336. package/dist/recommend/model/trendingFacetHit.d.ts +18 -0
  337. package/dist/recommend/model/trendingFacetHit.d.ts.map +1 -0
  338. package/dist/recommend/model/trendingFacets.d.ts +11 -0
  339. package/dist/recommend/model/trendingFacets.d.ts.map +1 -0
  340. package/dist/recommend/model/trendingFacetsModel.d.ts +5 -0
  341. package/dist/recommend/model/trendingFacetsModel.d.ts.map +1 -0
  342. package/dist/recommend/model/trendingFacetsQuery.d.ts +4 -0
  343. package/dist/recommend/model/trendingFacetsQuery.d.ts.map +1 -0
  344. package/dist/recommend/model/trendingItems.d.ts +15 -0
  345. package/dist/recommend/model/trendingItems.d.ts.map +1 -0
  346. package/dist/recommend/model/trendingItemsModel.d.ts +5 -0
  347. package/dist/recommend/model/trendingItemsModel.d.ts.map +1 -0
  348. package/dist/recommend/model/trendingItemsQuery.d.ts +4 -0
  349. package/dist/recommend/model/trendingItemsQuery.d.ts.map +1 -0
  350. package/dist/recommend/model/typoTolerance.d.ts +6 -0
  351. package/dist/recommend/model/typoTolerance.d.ts.map +1 -0
  352. package/dist/recommend/model/typoToleranceEnum.d.ts +5 -0
  353. package/dist/recommend/model/typoToleranceEnum.d.ts.map +1 -0
  354. package/dist/recommend/model/value.d.ts +13 -0
  355. package/dist/recommend/model/value.d.ts.map +1 -0
  356. package/dist/recommend/src/recommendClient.d.ts +132 -0
  357. package/dist/recommend/src/recommendClient.d.ts.map +1 -0
  358. package/lite/model/baseIndexSettings.ts +2 -2
  359. package/lite/model/baseRecommendRequest.ts +22 -0
  360. package/lite/model/baseSearchResponse.ts +2 -22
  361. package/lite/model/boughtTogetherQuery.ts +7 -0
  362. package/lite/model/browsePagination.ts +23 -0
  363. package/lite/model/browseResponse.ts +2 -0
  364. package/lite/model/clientMethodProps.ts +8 -0
  365. package/lite/model/facetFilters.ts +1 -3
  366. package/lite/model/{attributeToUpdate.ts → fallbackParams.ts} +2 -2
  367. package/lite/model/{builtInOperationType.ts → fbtModel.ts} +2 -9
  368. package/lite/model/{consequenceHide.ts → frequentlyBoughtTogether.ts} +5 -4
  369. package/lite/model/getRecommendationsParams.ts +13 -0
  370. package/lite/model/{apiKeyOperation.ts → getRecommendationsResponse.ts} +5 -1
  371. package/lite/model/index.ts +31 -40
  372. package/lite/model/lookingSimilar.ts +15 -0
  373. package/lite/model/lookingSimilarModel.ts +6 -0
  374. package/lite/model/lookingSimilarQuery.ts +6 -0
  375. package/lite/model/numericFilters.ts +1 -3
  376. package/lite/model/optionalFilters.ts +1 -3
  377. package/lite/model/rankingInfo.ts +3 -3
  378. package/lite/model/reRankingApplyFilter.ts +1 -3
  379. package/lite/model/recommendHit.ts +34 -0
  380. package/lite/model/{promote.ts → recommendationsHit.ts} +3 -3
  381. package/lite/model/{searchParamsString.ts → recommendationsHits.ts} +4 -5
  382. package/lite/model/recommendationsRequest.ts +16 -0
  383. package/lite/model/recommendationsResults.ts +9 -0
  384. package/lite/model/recommendedForYou.ts +10 -0
  385. package/lite/model/{operationType.ts → recommendedForYouModel.ts} +2 -2
  386. package/lite/model/recommendedForYouQuery.ts +6 -0
  387. package/lite/model/redirect.ts +1 -1
  388. package/lite/model/{dictionaryAction.ts → redirectURL.ts} +4 -2
  389. package/lite/model/relatedModel.ts +6 -0
  390. package/lite/model/{promoteObjectID.ts → relatedProducts.ts} +7 -8
  391. package/lite/model/relatedQuery.ts +6 -0
  392. package/lite/model/renderingContent.ts +3 -0
  393. package/lite/model/searchForFacetValuesResponse.ts +1 -1
  394. package/lite/model/{searchDictionaryEntriesResponse.ts → searchPagination.ts} +7 -9
  395. package/lite/model/searchParams.ts +1 -2
  396. package/lite/model/searchResponse.ts +3 -1
  397. package/lite/model/tagFilters.ts +1 -3
  398. package/lite/model/trendingFacetHit.ts +21 -0
  399. package/lite/model/trendingFacets.ts +15 -0
  400. package/lite/model/trendingFacetsModel.ts +6 -0
  401. package/lite/model/trendingFacetsQuery.ts +6 -0
  402. package/lite/model/trendingItems.ts +20 -0
  403. package/lite/model/{dictionaryEntryState.ts → trendingItemsModel.ts} +2 -2
  404. package/lite/model/trendingItemsQuery.ts +6 -0
  405. package/lite/model/value.ts +5 -0
  406. package/lite/src/liteClient.ts +57 -1
  407. package/package.json +18 -14
  408. package/dist/client-search/model/mixedSearchFilters.d.ts +0 -2
  409. package/dist/client-search/model/mixedSearchFilters.d.ts.map +0 -1
  410. package/dist/client-search/model/securedAPIKeyRestrictions.d.ts +0 -25
  411. package/dist/lite/model/action.d.ts +0 -5
  412. package/dist/lite/model/action.d.ts.map +0 -1
  413. package/dist/lite/model/addApiKeyResponse.d.ts +0 -11
  414. package/dist/lite/model/addApiKeyResponse.d.ts.map +0 -1
  415. package/dist/lite/model/anchoring.d.ts +0 -5
  416. package/dist/lite/model/anchoring.d.ts.map +0 -1
  417. package/dist/lite/model/apiKeyOperation.d.ts +0 -2
  418. package/dist/lite/model/apiKeyOperation.d.ts.map +0 -1
  419. package/dist/lite/model/attributeToUpdate.d.ts +0 -3
  420. package/dist/lite/model/attributeToUpdate.d.ts.map +0 -1
  421. package/dist/lite/model/browseParams.d.ts +0 -4
  422. package/dist/lite/model/browseParams.d.ts.map +0 -1
  423. package/dist/lite/model/builtInOperation.d.ts +0 -12
  424. package/dist/lite/model/builtInOperation.d.ts.map +0 -1
  425. package/dist/lite/model/builtInOperationType.d.ts +0 -5
  426. package/dist/lite/model/builtInOperationType.d.ts.map +0 -1
  427. package/dist/lite/model/condition.d.ts +0 -21
  428. package/dist/lite/model/condition.d.ts.map +0 -1
  429. package/dist/lite/model/consequence.d.ts +0 -26
  430. package/dist/lite/model/consequence.d.ts.map +0 -1
  431. package/dist/lite/model/consequenceHide.d.ts +0 -10
  432. package/dist/lite/model/consequenceHide.d.ts.map +0 -1
  433. package/dist/lite/model/deleteByParams.d.ts +0 -27
  434. package/dist/lite/model/deleteByParams.d.ts.map +0 -1
  435. package/dist/lite/model/dictionaryAction.d.ts +0 -5
  436. package/dist/lite/model/dictionaryAction.d.ts.map +0 -1
  437. package/dist/lite/model/dictionaryEntry.d.ts +0 -26
  438. package/dist/lite/model/dictionaryEntry.d.ts.map +0 -1
  439. package/dist/lite/model/dictionaryEntryState.d.ts +0 -5
  440. package/dist/lite/model/dictionaryEntryState.d.ts.map +0 -1
  441. package/dist/lite/model/dictionaryLanguage.d.ts +0 -10
  442. package/dist/lite/model/dictionaryLanguage.d.ts.map +0 -1
  443. package/dist/lite/model/dictionaryType.d.ts +0 -2
  444. package/dist/lite/model/dictionaryType.d.ts.map +0 -1
  445. package/dist/lite/model/fetchedIndex.d.ts +0 -47
  446. package/dist/lite/model/fetchedIndex.d.ts.map +0 -1
  447. package/dist/lite/model/languages.d.ts +0 -10
  448. package/dist/lite/model/languages.d.ts.map +0 -1
  449. package/dist/lite/model/listIndicesResponse.d.ts +0 -12
  450. package/dist/lite/model/listIndicesResponse.d.ts.map +0 -1
  451. package/dist/lite/model/logType.d.ts +0 -2
  452. package/dist/lite/model/logType.d.ts.map +0 -1
  453. package/dist/lite/model/mixedSearchFilters.d.ts +0 -2
  454. package/dist/lite/model/mixedSearchFilters.d.ts.map +0 -1
  455. package/dist/lite/model/operationType.d.ts +0 -5
  456. package/dist/lite/model/operationType.d.ts.map +0 -1
  457. package/dist/lite/model/promote.d.ts +0 -4
  458. package/dist/lite/model/promote.d.ts.map +0 -1
  459. package/dist/lite/model/promoteObjectID.d.ts +0 -14
  460. package/dist/lite/model/promoteObjectID.d.ts.map +0 -1
  461. package/dist/lite/model/promoteObjectIDs.d.ts +0 -14
  462. package/dist/lite/model/promoteObjectIDs.d.ts.map +0 -1
  463. package/dist/lite/model/rule.d.ts +0 -30
  464. package/dist/lite/model/rule.d.ts.map +0 -1
  465. package/dist/lite/model/scopeType.d.ts +0 -2
  466. package/dist/lite/model/scopeType.d.ts.map +0 -1
  467. package/dist/lite/model/searchDictionaryEntriesResponse.d.ts +0 -20
  468. package/dist/lite/model/searchDictionaryEntriesResponse.d.ts.map +0 -1
  469. package/dist/lite/model/searchParamsString.d.ts +0 -7
  470. package/dist/lite/model/searchParamsString.d.ts.map +0 -1
  471. package/dist/lite/model/searchSynonymsResponse.d.ts +0 -12
  472. package/dist/lite/model/searchSynonymsResponse.d.ts.map +0 -1
  473. package/dist/lite/model/securedAPIKeyRestrictions.d.ts.map +0 -1
  474. package/dist/lite/model/source.d.ts +0 -14
  475. package/dist/lite/model/source.d.ts.map +0 -1
  476. package/dist/lite/model/standardEntries.d.ts +0 -18
  477. package/dist/lite/model/standardEntries.d.ts.map +0 -1
  478. package/dist/lite/model/synonymHit.d.ts +0 -36
  479. package/dist/lite/model/synonymHit.d.ts.map +0 -1
  480. package/dist/lite/model/synonymType.d.ts +0 -5
  481. package/dist/lite/model/synonymType.d.ts.map +0 -1
  482. package/dist/lite/model/taskStatus.d.ts.map +0 -1
  483. package/dist/lite/model/timeRange.d.ts +0 -11
  484. package/dist/lite/model/timeRange.d.ts.map +0 -1
  485. package/dist/lite/model/updatedRuleResponse.d.ts.map +0 -1
  486. package/dist/lite/model/userId.d.ts +0 -22
  487. package/dist/lite/model/userId.d.ts.map +0 -1
  488. package/lite/model/action.ts +0 -13
  489. package/lite/model/addApiKeyResponse.ts +0 -13
  490. package/lite/model/anchoring.ts +0 -6
  491. package/lite/model/browseParams.ts +0 -6
  492. package/lite/model/builtInOperation.ts +0 -15
  493. package/lite/model/condition.ts +0 -27
  494. package/lite/model/consequence.ts +0 -32
  495. package/lite/model/deleteByParams.ts +0 -36
  496. package/lite/model/dictionaryEntry.ts +0 -33
  497. package/lite/model/dictionaryLanguage.ts +0 -11
  498. package/lite/model/dictionaryType.ts +0 -3
  499. package/lite/model/fetchedIndex.ts +0 -58
  500. package/lite/model/languages.ts +0 -14
  501. package/lite/model/listIndicesResponse.ts +0 -15
  502. package/lite/model/logType.ts +0 -3
  503. package/lite/model/mixedSearchFilters.ts +0 -3
  504. package/lite/model/promoteObjectIDs.ts +0 -16
  505. package/lite/model/rule.ts +0 -37
  506. package/lite/model/scopeType.ts +0 -3
  507. package/lite/model/searchSynonymsResponse.ts +0 -15
  508. package/lite/model/securedAPIKeyRestrictions.ts +0 -32
  509. package/lite/model/source.ts +0 -16
  510. package/lite/model/standardEntries.ts +0 -21
  511. package/lite/model/synonymHit.ts +0 -45
  512. package/lite/model/synonymType.ts +0 -11
  513. package/lite/model/taskStatus.ts +0 -6
  514. package/lite/model/timeRange.ts +0 -13
  515. package/lite/model/updatedRuleResponse.ts +0 -18
  516. package/lite/model/userId.ts +0 -26
  517. /package/dist/{lite → recommend}/model/taskStatus.d.ts +0 -0
@@ -235,6 +235,14 @@ function createStatefulHost(host, status = 'up') {
235
235
  };
236
236
  }
237
237
 
238
+ function _defineProperty(e, r, t) {
239
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
240
+ value: t,
241
+ enumerable: !0,
242
+ configurable: !0,
243
+ writable: !0
244
+ }) : e[r] = t, e;
245
+ }
238
246
  function _toPrimitive(t, r) {
239
247
  if ("object" != typeof t || !t) return t;
240
248
  var e = t[Symbol.toPrimitive];
@@ -249,20 +257,6 @@ function _toPropertyKey(t) {
249
257
  var i = _toPrimitive(t, "string");
250
258
  return "symbol" == typeof i ? i : i + "";
251
259
  }
252
- function _defineProperty(obj, key, value) {
253
- key = _toPropertyKey(key);
254
- if (key in obj) {
255
- Object.defineProperty(obj, key, {
256
- value: value,
257
- enumerable: true,
258
- configurable: true,
259
- writable: true
260
- });
261
- } else {
262
- obj[key] = value;
263
- }
264
- return obj;
265
- }
266
260
 
267
261
  class AlgoliaError extends Error {
268
262
  constructor(message, name) {
@@ -283,7 +277,7 @@ class ErrorWithStackTrace extends AlgoliaError {
283
277
  }
284
278
  class RetryError extends ErrorWithStackTrace {
285
279
  constructor(stackTrace) {
286
- super('Unreachable hosts - your application id may be incorrect. If the error persists, please create a ticket at https://support.algolia.com/ sharing steps we can use to reproduce the issue.', stackTrace, 'RetryError');
280
+ super('Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.', stackTrace, 'RetryError');
287
281
  }
288
282
  }
289
283
  class ApiError extends ErrorWithStackTrace {
@@ -328,8 +322,7 @@ function serializeUrl(host, path, queryParameters) {
328
322
  return url;
329
323
  }
330
324
  function serializeQueryParameters(parameters) {
331
- const isObjectOrArray = value => Object.prototype.toString.call(value) === '[object Object]' || Object.prototype.toString.call(value) === '[object Array]';
332
- return Object.keys(parameters).map(key => `${key}=${encodeURIComponent(isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key]).replaceAll('+', '%20')}`).join('&');
325
+ return Object.keys(parameters).filter(key => parameters[key] !== undefined).sort().map(key => `${key}=${encodeURIComponent(Object.prototype.toString.call(parameters[key]) === '[object Array]' ? parameters[key].join(',') : parameters[key]).replaceAll('+', '%20')}`).join('&');
333
326
  }
334
327
  function serializeData(request, requestOptions) {
335
328
  if (request.method === 'GET' || request.data === undefined && requestOptions.data === undefined) {
@@ -682,9 +675,9 @@ const DEFAULT_READ_TIMEOUT_BROWSER = 2000;
682
675
  const DEFAULT_WRITE_TIMEOUT_BROWSER = 30000;
683
676
 
684
677
  // 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.
685
- const apiClientVersion$4 = '5.0.0-beta.1';
678
+ const apiClientVersion$5 = '5.0.0-beta.11';
686
679
  const REGIONS$2 = ['de', 'us'];
687
- function getDefaultHosts$3(region) {
680
+ function getDefaultHosts$4(region) {
688
681
  const url = !region
689
682
  ? 'analytics.algolia.com'
690
683
  : 'analytics.{region}.algolia.com'.replace('{region}', region);
@@ -694,12 +687,12 @@ function getDefaultHosts$3(region) {
694
687
  function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }) {
695
688
  const auth = createAuth(appIdOption, apiKeyOption, authMode);
696
689
  const transporter = createTransporter({
697
- hosts: getDefaultHosts$3(regionOption),
690
+ hosts: getDefaultHosts$4(regionOption),
698
691
  ...options,
699
692
  algoliaAgent: getAlgoliaAgent({
700
693
  algoliaAgents,
701
694
  client: 'Abtesting',
702
- version: apiClientVersion$4,
695
+ version: apiClientVersion$5,
703
696
  }),
704
697
  baseHeaders: {
705
698
  'content-type': 'text/plain',
@@ -987,9 +980,9 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
987
980
  }
988
981
 
989
982
  // 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.
990
- const apiClientVersion$3 = '5.0.0-beta.1';
983
+ const apiClientVersion$4 = '5.0.0-beta.11';
991
984
  const REGIONS$1 = ['de', 'us'];
992
- function getDefaultHosts$2(region) {
985
+ function getDefaultHosts$3(region) {
993
986
  const url = !region
994
987
  ? 'analytics.algolia.com'
995
988
  : 'analytics.{region}.algolia.com'.replace('{region}', region);
@@ -999,12 +992,12 @@ function getDefaultHosts$2(region) {
999
992
  function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }) {
1000
993
  const auth = createAuth(appIdOption, apiKeyOption, authMode);
1001
994
  const transporter = createTransporter({
1002
- hosts: getDefaultHosts$2(regionOption),
995
+ hosts: getDefaultHosts$3(regionOption),
1003
996
  ...options,
1004
997
  algoliaAgent: getAlgoliaAgent({
1005
998
  algoliaAgents,
1006
999
  client: 'Analytics',
1007
- version: apiClientVersion$3,
1000
+ version: apiClientVersion$4,
1008
1001
  }),
1009
1002
  baseHeaders: {
1010
1003
  'content-type': 'text/plain',
@@ -2042,9 +2035,9 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
2042
2035
  }
2043
2036
 
2044
2037
  // 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.
2045
- const apiClientVersion$2 = '5.0.0-beta.1';
2038
+ const apiClientVersion$3 = '5.0.0-beta.11';
2046
2039
  const REGIONS = ['eu', 'us'];
2047
- function getDefaultHosts$1(region) {
2040
+ function getDefaultHosts$2(region) {
2048
2041
  const url = 'personalization.{region}.algolia.com'.replace('{region}', region);
2049
2042
  return [{ url, accept: 'readWrite', protocol: 'https' }];
2050
2043
  }
@@ -2052,12 +2045,12 @@ function getDefaultHosts$1(region) {
2052
2045
  function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }) {
2053
2046
  const auth = createAuth(appIdOption, apiKeyOption, authMode);
2054
2047
  const transporter = createTransporter({
2055
- hosts: getDefaultHosts$1(regionOption),
2048
+ hosts: getDefaultHosts$2(regionOption),
2056
2049
  ...options,
2057
2050
  algoliaAgent: getAlgoliaAgent({
2058
2051
  algoliaAgents,
2059
2052
  client: 'Personalization',
2060
- version: apiClientVersion$2,
2053
+ version: apiClientVersion$3,
2061
2054
  }),
2062
2055
  baseHeaders: {
2063
2056
  'content-type': 'text/plain',
@@ -2303,8 +2296,8 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
2303
2296
  }
2304
2297
 
2305
2298
  // 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.
2306
- const apiClientVersion$1 = '5.0.0-beta.1';
2307
- function getDefaultHosts(appId) {
2299
+ const apiClientVersion$2 = '5.0.0-beta.11';
2300
+ function getDefaultHosts$1(appId) {
2308
2301
  return [
2309
2302
  {
2310
2303
  url: `${appId}-dsn.algolia.net`,
@@ -2338,12 +2331,12 @@ function getDefaultHosts(appId) {
2338
2331
  function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }) {
2339
2332
  const auth = createAuth(appIdOption, apiKeyOption, authMode);
2340
2333
  const transporter = createTransporter({
2341
- hosts: getDefaultHosts(appIdOption),
2334
+ hosts: getDefaultHosts$1(appIdOption),
2342
2335
  ...options,
2343
2336
  algoliaAgent: getAlgoliaAgent({
2344
2337
  algoliaAgents,
2345
2338
  client: 'Search',
2346
- version: apiClientVersion$1,
2339
+ version: apiClientVersion$2,
2347
2340
  }),
2348
2341
  baseHeaders: {
2349
2342
  'content-type': 'text/plain',
@@ -2409,6 +2402,29 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
2409
2402
  timeout: () => timeout(retryCount),
2410
2403
  });
2411
2404
  },
2405
+ /**
2406
+ * Helper: Wait for an application-level task to complete for a given `taskID`.
2407
+ *
2408
+ * @summary Helper method that waits for a task to be published (completed).
2409
+ * @param waitForAppTaskOptions - The `waitForTaskOptions` object.
2410
+ * @param waitForAppTaskOptions.taskID - The `taskID` returned in the method response.
2411
+ * @param waitForAppTaskOptions.maxRetries - The maximum number of retries. 50 by default.
2412
+ * @param waitForAppTaskOptions.timeout - The function to decide how long to wait between retries.
2413
+ * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
2414
+ */
2415
+ waitForAppTask({ taskID, maxRetries = 50, timeout = (retryCount) => Math.min(retryCount * 200, 5000), }, requestOptions) {
2416
+ let retryCount = 0;
2417
+ return createIterablePromise({
2418
+ func: () => this.getAppTask({ taskID }, requestOptions),
2419
+ validate: (response) => response.status === 'published',
2420
+ aggregator: () => (retryCount += 1),
2421
+ error: {
2422
+ validate: () => retryCount >= maxRetries,
2423
+ message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`,
2424
+ },
2425
+ timeout: () => timeout(retryCount),
2426
+ });
2427
+ },
2412
2428
  /**
2413
2429
  * Helper: Wait for an API key to be added, updated or deleted based on a given `operation`.
2414
2430
  *
@@ -2458,8 +2474,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
2458
2474
  }
2459
2475
  return createIterablePromise({
2460
2476
  ...baseIteratorOptions,
2461
- func: () => this.getApiKey({ key }, requestOptions).catch((error) => error),
2462
- validate: (error) => operation === 'add' ? error.status !== 404 : error.status === 404,
2477
+ func: () => this.getApiKey({ key }, requestOptions).catch((error) => {
2478
+ if (error.status === 404) {
2479
+ return undefined;
2480
+ }
2481
+ throw error;
2482
+ }),
2483
+ validate: (response) => operation === 'add' ? response !== undefined : response === undefined,
2463
2484
  });
2464
2485
  },
2465
2486
  /**
@@ -2590,9 +2611,10 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
2590
2611
  async chunkedBatch({ indexName, objects, action = 'addObject', waitForTasks, batchSize = 1000, }, requestOptions) {
2591
2612
  let requests = [];
2592
2613
  const responses = [];
2593
- for (const [i, obj] of objects.entries()) {
2614
+ const objectEntries = objects.entries();
2615
+ for (const [i, obj] of objectEntries) {
2594
2616
  requests.push({ action, body: obj });
2595
- if (i % batchSize === 0) {
2617
+ if (requests.length === batchSize || i === objects.length - 1) {
2596
2618
  responses.push(await this.batch({ indexName, batchWriteParams: { requests } }, requestOptions));
2597
2619
  requests = [];
2598
2620
  }
@@ -2604,20 +2626,68 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
2604
2626
  }
2605
2627
  return responses;
2606
2628
  },
2629
+ /**
2630
+ * 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.
2631
+ *
2632
+ * @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.
2633
+ * @param saveObjects - The `saveObjects` object.
2634
+ * @param saveObjects.indexName - The `indexName` to save `objects` in.
2635
+ * @param saveObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
2636
+ * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `batch` method and merged with the transporter requestOptions.
2637
+ */
2638
+ async saveObjects({ indexName, objects }, requestOptions) {
2639
+ return await this.chunkedBatch({ indexName, objects, action: 'addObject' }, requestOptions);
2640
+ },
2641
+ /**
2642
+ * 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.
2643
+ *
2644
+ * @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.
2645
+ * @param deleteObjects - The `deleteObjects` object.
2646
+ * @param deleteObjects.indexName - The `indexName` to delete `objectIDs` from.
2647
+ * @param deleteObjects.objectIDs - The objectIDs to delete.
2648
+ * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `batch` method and merged with the transporter requestOptions.
2649
+ */
2650
+ async deleteObjects({ indexName, objectIDs }, requestOptions) {
2651
+ return await this.chunkedBatch({
2652
+ indexName,
2653
+ objects: objectIDs.map((objectID) => ({ objectID })),
2654
+ action: 'deleteObject',
2655
+ }, requestOptions);
2656
+ },
2657
+ /**
2658
+ * 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.
2659
+ *
2660
+ * @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.
2661
+ * @param partialUpdateObjects - The `partialUpdateObjects` object.
2662
+ * @param partialUpdateObjects.indexName - The `indexName` to update `objects` in.
2663
+ * @param partialUpdateObjects.objects - The array of `objects` to update in the given Algolia `indexName`.
2664
+ * @param partialUpdateObjects.createIfNotExists - To be provided if non-existing objects are passed, otherwise, the call will fail..
2665
+ * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
2666
+ */
2667
+ async partialUpdateObjects({ indexName, objects, createIfNotExists }, requestOptions) {
2668
+ return await this.chunkedBatch({
2669
+ indexName,
2670
+ objects,
2671
+ action: createIfNotExists
2672
+ ? 'partialUpdateObject'
2673
+ : 'partialUpdateObjectNoCreate',
2674
+ }, requestOptions);
2675
+ },
2607
2676
  /**
2608
2677
  * 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.
2678
+ * See https://api-clients-automation.netlify.app/docs/contributing/add-new-api-client#5-helpers for implementation details.
2609
2679
  *
2610
2680
  * @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.
2611
2681
  * @param replaceAllObjects - The `replaceAllObjects` object.
2612
2682
  * @param replaceAllObjects.indexName - The `indexName` to replace `objects` in.
2613
2683
  * @param replaceAllObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
2614
- * @param replaceAllObjects.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.
2615
- * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
2684
+ * @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.
2685
+ * @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.
2616
2686
  */
2617
2687
  async replaceAllObjects({ indexName, objects, batchSize }, requestOptions) {
2618
- const randomSuffix = Math.random().toString(36).substring(7);
2688
+ const randomSuffix = Math.floor(Math.random() * 1000000) + 100000;
2619
2689
  const tmpIndexName = `${indexName}_tmp_${randomSuffix}`;
2620
- const copyOperationResponse = await this.operationIndex({
2690
+ let copyOperationResponse = await this.operationIndex({
2621
2691
  indexName,
2622
2692
  operationIndexParams: {
2623
2693
  operation: 'copy',
@@ -2625,17 +2695,29 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
2625
2695
  scope: ['settings', 'rules', 'synonyms'],
2626
2696
  },
2627
2697
  }, requestOptions);
2698
+ const batchResponses = await this.chunkedBatch({ indexName: tmpIndexName, objects, waitForTasks: true, batchSize }, requestOptions);
2628
2699
  await this.waitForTask({
2700
+ indexName: tmpIndexName,
2701
+ taskID: copyOperationResponse.taskID,
2702
+ });
2703
+ copyOperationResponse = await this.operationIndex({
2629
2704
  indexName,
2705
+ operationIndexParams: {
2706
+ operation: 'copy',
2707
+ destination: tmpIndexName,
2708
+ scope: ['settings', 'rules', 'synonyms'],
2709
+ },
2710
+ }, requestOptions);
2711
+ await this.waitForTask({
2712
+ indexName: tmpIndexName,
2630
2713
  taskID: copyOperationResponse.taskID,
2631
2714
  });
2632
- const batchResponses = await this.chunkedBatch({ indexName: tmpIndexName, objects, waitForTasks: true, batchSize }, requestOptions);
2633
2715
  const moveOperationResponse = await this.operationIndex({
2634
2716
  indexName: tmpIndexName,
2635
2717
  operationIndexParams: { operation: 'move', destination: indexName },
2636
2718
  }, requestOptions);
2637
2719
  await this.waitForTask({
2638
- indexName,
2720
+ indexName: tmpIndexName,
2639
2721
  taskID: moveOperationResponse.taskID,
2640
2722
  });
2641
2723
  return { copyOperationResponse, batchResponses, moveOperationResponse };
@@ -2871,7 +2953,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
2871
2953
  return transporter.request(request, requestOptions);
2872
2954
  },
2873
2955
  /**
2874
- * 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. - Deduplication (`distinct`) is turned off. - There\'s no ranking for: typo-tolerance, number of matched words, proximity, geo distance.
2956
+ * 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.
2875
2957
  *
2876
2958
  * Required API Key ACLs:
2877
2959
  * - browse.
@@ -3304,6 +3386,31 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
3304
3386
  };
3305
3387
  return transporter.request(request, requestOptions);
3306
3388
  },
3389
+ /**
3390
+ * Checks the status of a given application task.
3391
+ *
3392
+ * Required API Key ACLs:
3393
+ * - editSettings.
3394
+ *
3395
+ * @param getAppTask - The getAppTask object.
3396
+ * @param getAppTask.taskID - Unique task identifier.
3397
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
3398
+ */
3399
+ getAppTask({ taskID }, requestOptions) {
3400
+ if (!taskID) {
3401
+ throw new Error('Parameter `taskID` is required when calling `getAppTask`.');
3402
+ }
3403
+ const requestPath = '/1/task/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));
3404
+ const headers = {};
3405
+ const queryParameters = {};
3406
+ const request = {
3407
+ method: 'GET',
3408
+ path: requestPath,
3409
+ queryParameters,
3410
+ headers,
3411
+ };
3412
+ return transporter.request(request, requestOptions);
3413
+ },
3307
3414
  /**
3308
3415
  * Lists supported languages with their supported dictionary types and number of custom entries.
3309
3416
  *
@@ -3778,7 +3885,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
3778
3885
  return transporter.request(request, requestOptions);
3779
3886
  },
3780
3887
  /**
3781
- * Copies or moves (renames) an index within the same Algolia application. - Existing destination indices are overwritten, except for index-specific API keys and 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/).
3888
+ * 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/).
3782
3889
  *
3783
3890
  * Required API Key ACLs:
3784
3891
  * - addObject.
@@ -4462,6 +4569,368 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
4462
4569
  };
4463
4570
  }
4464
4571
 
4572
+ // 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.
4573
+ const apiClientVersion$1 = '5.0.0-beta.11';
4574
+ function getDefaultHosts(appId) {
4575
+ return [
4576
+ {
4577
+ url: `${appId}-dsn.algolia.net`,
4578
+ accept: 'read',
4579
+ protocol: 'https',
4580
+ },
4581
+ {
4582
+ url: `${appId}.algolia.net`,
4583
+ accept: 'write',
4584
+ protocol: 'https',
4585
+ },
4586
+ ].concat(shuffle([
4587
+ {
4588
+ url: `${appId}-1.algolianet.com`,
4589
+ accept: 'readWrite',
4590
+ protocol: 'https',
4591
+ },
4592
+ {
4593
+ url: `${appId}-2.algolianet.com`,
4594
+ accept: 'readWrite',
4595
+ protocol: 'https',
4596
+ },
4597
+ {
4598
+ url: `${appId}-3.algolianet.com`,
4599
+ accept: 'readWrite',
4600
+ protocol: 'https',
4601
+ },
4602
+ ]));
4603
+ }
4604
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
4605
+ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }) {
4606
+ const auth = createAuth(appIdOption, apiKeyOption, authMode);
4607
+ const transporter = createTransporter({
4608
+ hosts: getDefaultHosts(appIdOption),
4609
+ ...options,
4610
+ algoliaAgent: getAlgoliaAgent({
4611
+ algoliaAgents,
4612
+ client: 'Recommend',
4613
+ version: apiClientVersion$1,
4614
+ }),
4615
+ baseHeaders: {
4616
+ 'content-type': 'text/plain',
4617
+ ...auth.headers(),
4618
+ ...options.baseHeaders,
4619
+ },
4620
+ baseQueryParameters: {
4621
+ ...auth.queryParameters(),
4622
+ ...options.baseQueryParameters,
4623
+ },
4624
+ });
4625
+ return {
4626
+ transporter,
4627
+ /**
4628
+ * The `appId` currently in use.
4629
+ */
4630
+ appId: appIdOption,
4631
+ /**
4632
+ * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
4633
+ */
4634
+ clearCache() {
4635
+ return Promise.all([
4636
+ transporter.requestsCache.clear(),
4637
+ transporter.responsesCache.clear(),
4638
+ ]).then(() => undefined);
4639
+ },
4640
+ /**
4641
+ * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
4642
+ */
4643
+ get _ua() {
4644
+ return transporter.algoliaAgent.value;
4645
+ },
4646
+ /**
4647
+ * Adds a `segment` to the `x-algolia-agent` sent with every requests.
4648
+ *
4649
+ * @param segment - The algolia agent (user-agent) segment to add.
4650
+ * @param version - The version of the agent.
4651
+ */
4652
+ addAlgoliaAgent(segment, version) {
4653
+ transporter.algoliaAgent.add({ segment, version });
4654
+ },
4655
+ /**
4656
+ * This method allow you to send requests to the Algolia REST API.
4657
+ *
4658
+ * @param customDelete - The customDelete object.
4659
+ * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
4660
+ * @param customDelete.parameters - Query parameters to apply to the current query.
4661
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
4662
+ */
4663
+ customDelete({ path, parameters }, requestOptions) {
4664
+ if (!path) {
4665
+ throw new Error('Parameter `path` is required when calling `customDelete`.');
4666
+ }
4667
+ const requestPath = '/{path}'.replace('{path}', path);
4668
+ const headers = {};
4669
+ const queryParameters = parameters ? parameters : {};
4670
+ const request = {
4671
+ method: 'DELETE',
4672
+ path: requestPath,
4673
+ queryParameters,
4674
+ headers,
4675
+ };
4676
+ return transporter.request(request, requestOptions);
4677
+ },
4678
+ /**
4679
+ * This method allow you to send requests to the Algolia REST API.
4680
+ *
4681
+ * @param customGet - The customGet object.
4682
+ * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
4683
+ * @param customGet.parameters - Query parameters to apply to the current query.
4684
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
4685
+ */
4686
+ customGet({ path, parameters }, requestOptions) {
4687
+ if (!path) {
4688
+ throw new Error('Parameter `path` is required when calling `customGet`.');
4689
+ }
4690
+ const requestPath = '/{path}'.replace('{path}', path);
4691
+ const headers = {};
4692
+ const queryParameters = parameters ? parameters : {};
4693
+ const request = {
4694
+ method: 'GET',
4695
+ path: requestPath,
4696
+ queryParameters,
4697
+ headers,
4698
+ };
4699
+ return transporter.request(request, requestOptions);
4700
+ },
4701
+ /**
4702
+ * This method allow you to send requests to the Algolia REST API.
4703
+ *
4704
+ * @param customPost - The customPost object.
4705
+ * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
4706
+ * @param customPost.parameters - Query parameters to apply to the current query.
4707
+ * @param customPost.body - Parameters to send with the custom request.
4708
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
4709
+ */
4710
+ customPost({ path, parameters, body }, requestOptions) {
4711
+ if (!path) {
4712
+ throw new Error('Parameter `path` is required when calling `customPost`.');
4713
+ }
4714
+ const requestPath = '/{path}'.replace('{path}', path);
4715
+ const headers = {};
4716
+ const queryParameters = parameters ? parameters : {};
4717
+ const request = {
4718
+ method: 'POST',
4719
+ path: requestPath,
4720
+ queryParameters,
4721
+ headers,
4722
+ data: body ? body : {},
4723
+ };
4724
+ return transporter.request(request, requestOptions);
4725
+ },
4726
+ /**
4727
+ * This method allow you to send requests to the Algolia REST API.
4728
+ *
4729
+ * @param customPut - The customPut object.
4730
+ * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
4731
+ * @param customPut.parameters - Query parameters to apply to the current query.
4732
+ * @param customPut.body - Parameters to send with the custom request.
4733
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
4734
+ */
4735
+ customPut({ path, parameters, body }, requestOptions) {
4736
+ if (!path) {
4737
+ throw new Error('Parameter `path` is required when calling `customPut`.');
4738
+ }
4739
+ const requestPath = '/{path}'.replace('{path}', path);
4740
+ const headers = {};
4741
+ const queryParameters = parameters ? parameters : {};
4742
+ const request = {
4743
+ method: 'PUT',
4744
+ path: requestPath,
4745
+ queryParameters,
4746
+ headers,
4747
+ data: body ? body : {},
4748
+ };
4749
+ return transporter.request(request, requestOptions);
4750
+ },
4751
+ /**
4752
+ * Deletes a Recommend rule from a recommendation scenario.
4753
+ *
4754
+ * Required API Key ACLs:
4755
+ * - editSettings.
4756
+ *
4757
+ * @param deleteRecommendRule - The deleteRecommendRule object.
4758
+ * @param deleteRecommendRule.indexName - Name of the index on which to perform the operation.
4759
+ * @param deleteRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
4760
+ * @param deleteRecommendRule.objectID - Unique record identifier.
4761
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
4762
+ */
4763
+ deleteRecommendRule({ indexName, model, objectID }, requestOptions) {
4764
+ if (!indexName) {
4765
+ throw new Error('Parameter `indexName` is required when calling `deleteRecommendRule`.');
4766
+ }
4767
+ if (!model) {
4768
+ throw new Error('Parameter `model` is required when calling `deleteRecommendRule`.');
4769
+ }
4770
+ if (!objectID) {
4771
+ throw new Error('Parameter `objectID` is required when calling `deleteRecommendRule`.');
4772
+ }
4773
+ const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/{objectID}'
4774
+ .replace('{indexName}', encodeURIComponent(indexName))
4775
+ .replace('{model}', encodeURIComponent(model))
4776
+ .replace('{objectID}', encodeURIComponent(objectID));
4777
+ const headers = {};
4778
+ const queryParameters = {};
4779
+ const request = {
4780
+ method: 'DELETE',
4781
+ path: requestPath,
4782
+ queryParameters,
4783
+ headers,
4784
+ };
4785
+ return transporter.request(request, requestOptions);
4786
+ },
4787
+ /**
4788
+ * Retrieves a Recommend rule that you previously created in the Algolia dashboard.
4789
+ *
4790
+ * Required API Key ACLs:
4791
+ * - settings.
4792
+ *
4793
+ * @param getRecommendRule - The getRecommendRule object.
4794
+ * @param getRecommendRule.indexName - Name of the index on which to perform the operation.
4795
+ * @param getRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
4796
+ * @param getRecommendRule.objectID - Unique record identifier.
4797
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
4798
+ */
4799
+ getRecommendRule({ indexName, model, objectID }, requestOptions) {
4800
+ if (!indexName) {
4801
+ throw new Error('Parameter `indexName` is required when calling `getRecommendRule`.');
4802
+ }
4803
+ if (!model) {
4804
+ throw new Error('Parameter `model` is required when calling `getRecommendRule`.');
4805
+ }
4806
+ if (!objectID) {
4807
+ throw new Error('Parameter `objectID` is required when calling `getRecommendRule`.');
4808
+ }
4809
+ const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/{objectID}'
4810
+ .replace('{indexName}', encodeURIComponent(indexName))
4811
+ .replace('{model}', encodeURIComponent(model))
4812
+ .replace('{objectID}', encodeURIComponent(objectID));
4813
+ const headers = {};
4814
+ const queryParameters = {};
4815
+ const request = {
4816
+ method: 'GET',
4817
+ path: requestPath,
4818
+ queryParameters,
4819
+ headers,
4820
+ };
4821
+ return transporter.request(request, requestOptions);
4822
+ },
4823
+ /**
4824
+ * 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.
4825
+ *
4826
+ * Required API Key ACLs:
4827
+ * - editSettings.
4828
+ *
4829
+ * @param getRecommendStatus - The getRecommendStatus object.
4830
+ * @param getRecommendStatus.indexName - Name of the index on which to perform the operation.
4831
+ * @param getRecommendStatus.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
4832
+ * @param getRecommendStatus.taskID - Unique task identifier.
4833
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
4834
+ */
4835
+ getRecommendStatus({ indexName, model, taskID }, requestOptions) {
4836
+ if (!indexName) {
4837
+ throw new Error('Parameter `indexName` is required when calling `getRecommendStatus`.');
4838
+ }
4839
+ if (!model) {
4840
+ throw new Error('Parameter `model` is required when calling `getRecommendStatus`.');
4841
+ }
4842
+ if (!taskID) {
4843
+ throw new Error('Parameter `taskID` is required when calling `getRecommendStatus`.');
4844
+ }
4845
+ const requestPath = '/1/indexes/{indexName}/{model}/task/{taskID}'
4846
+ .replace('{indexName}', encodeURIComponent(indexName))
4847
+ .replace('{model}', encodeURIComponent(model))
4848
+ .replace('{taskID}', encodeURIComponent(taskID));
4849
+ const headers = {};
4850
+ const queryParameters = {};
4851
+ const request = {
4852
+ method: 'GET',
4853
+ path: requestPath,
4854
+ queryParameters,
4855
+ headers,
4856
+ };
4857
+ return transporter.request(request, requestOptions);
4858
+ },
4859
+ /**
4860
+ * Retrieves recommendations from selected AI models.
4861
+ *
4862
+ * Required API Key ACLs:
4863
+ * - search.
4864
+ *
4865
+ * @param getRecommendationsParams - The getRecommendationsParams object.
4866
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
4867
+ */
4868
+ getRecommendations(getRecommendationsParams, requestOptions) {
4869
+ if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {
4870
+ const newSignatureRequest = {
4871
+ requests: getRecommendationsParams,
4872
+ };
4873
+ // eslint-disable-next-line no-param-reassign
4874
+ getRecommendationsParams = newSignatureRequest;
4875
+ }
4876
+ if (!getRecommendationsParams) {
4877
+ throw new Error('Parameter `getRecommendationsParams` is required when calling `getRecommendations`.');
4878
+ }
4879
+ if (!getRecommendationsParams.requests) {
4880
+ throw new Error('Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.');
4881
+ }
4882
+ const requestPath = '/1/indexes/*/recommendations';
4883
+ const headers = {};
4884
+ const queryParameters = {};
4885
+ const request = {
4886
+ method: 'POST',
4887
+ path: requestPath,
4888
+ queryParameters,
4889
+ headers,
4890
+ data: getRecommendationsParams,
4891
+ useReadTransporter: true,
4892
+ cacheable: true,
4893
+ };
4894
+ return transporter.request(request, requestOptions);
4895
+ },
4896
+ /**
4897
+ * Searches for Recommend rules. Use an empty query to list all rules for this recommendation scenario.
4898
+ *
4899
+ * Required API Key ACLs:
4900
+ * - settings.
4901
+ *
4902
+ * @param searchRecommendRules - The searchRecommendRules object.
4903
+ * @param searchRecommendRules.indexName - Name of the index on which to perform the operation.
4904
+ * @param searchRecommendRules.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
4905
+ * @param searchRecommendRules.searchRecommendRulesParams - The searchRecommendRulesParams object.
4906
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
4907
+ */
4908
+ searchRecommendRules({ indexName, model, searchRecommendRulesParams, }, requestOptions) {
4909
+ if (!indexName) {
4910
+ throw new Error('Parameter `indexName` is required when calling `searchRecommendRules`.');
4911
+ }
4912
+ if (!model) {
4913
+ throw new Error('Parameter `model` is required when calling `searchRecommendRules`.');
4914
+ }
4915
+ const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/search'
4916
+ .replace('{indexName}', encodeURIComponent(indexName))
4917
+ .replace('{model}', encodeURIComponent(model));
4918
+ const headers = {};
4919
+ const queryParameters = {};
4920
+ const request = {
4921
+ method: 'POST',
4922
+ path: requestPath,
4923
+ queryParameters,
4924
+ headers,
4925
+ data: searchRecommendRulesParams ? searchRecommendRulesParams : {},
4926
+ useReadTransporter: true,
4927
+ cacheable: true,
4928
+ };
4929
+ return transporter.request(request, requestOptions);
4930
+ },
4931
+ };
4932
+ }
4933
+
4465
4934
  function createXhrRequester() {
4466
4935
  function send(request) {
4467
4936
  return new Promise((resolve) => {
@@ -4515,7 +4984,7 @@ function createXhrRequester() {
4515
4984
  }
4516
4985
 
4517
4986
  // 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.
4518
- const apiClientVersion = apiClientVersion$1;
4987
+ const apiClientVersion = apiClientVersion$2;
4519
4988
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
4520
4989
  function algoliasearch(appId, apiKey, options) {
4521
4990
  if (!appId || typeof appId !== 'string') {
@@ -4545,6 +5014,13 @@ function algoliasearch(appId, apiKey, options) {
4545
5014
  }),
4546
5015
  ...options,
4547
5016
  };
5017
+ function initRecommend(initOptions = {}) {
5018
+ return createRecommendClient({
5019
+ ...commonOptions,
5020
+ ...initOptions.options,
5021
+ ...initOptions,
5022
+ });
5023
+ }
4548
5024
  function initAnalytics(initOptions = {}) {
4549
5025
  if (initOptions.region &&
4550
5026
  (typeof initOptions.region !== 'string' ||
@@ -4590,9 +5066,10 @@ function algoliasearch(appId, apiKey, options) {
4590
5066
  get _ua() {
4591
5067
  return this.transporter.algoliaAgent.value;
4592
5068
  },
5069
+ initAbtesting,
4593
5070
  initAnalytics,
4594
5071
  initPersonalization,
4595
- initAbtesting,
5072
+ initRecommend,
4596
5073
  };
4597
5074
  }
4598
5075