algoliasearch 5.0.0-beta.1 → 5.0.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +524 -29
  12. package/dist/algoliasearch.esm.browser.js +517 -45
  13. package/dist/algoliasearch.esm.node.js +524 -29
  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 +67 -12
  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.10';
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.10';
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.10';
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.10';
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
  *
@@ -2590,9 +2606,10 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
2590
2606
  async chunkedBatch({ indexName, objects, action = 'addObject', waitForTasks, batchSize = 1000, }, requestOptions) {
2591
2607
  let requests = [];
2592
2608
  const responses = [];
2593
- for (const [i, obj] of objects.entries()) {
2609
+ const objectEntries = objects.entries();
2610
+ for (const [i, obj] of objectEntries) {
2594
2611
  requests.push({ action, body: obj });
2595
- if (i % batchSize === 0) {
2612
+ if (requests.length === batchSize || i === objects.length - 1) {
2596
2613
  responses.push(await this.batch({ indexName, batchWriteParams: { requests } }, requestOptions));
2597
2614
  requests = [];
2598
2615
  }
@@ -2604,20 +2621,68 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
2604
2621
  }
2605
2622
  return responses;
2606
2623
  },
2624
+ /**
2625
+ * 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.
2626
+ *
2627
+ * @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.
2628
+ * @param saveObjects - The `saveObjects` object.
2629
+ * @param saveObjects.indexName - The `indexName` to save `objects` in.
2630
+ * @param saveObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
2631
+ * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `batch` method and merged with the transporter requestOptions.
2632
+ */
2633
+ async saveObjects({ indexName, objects }, requestOptions) {
2634
+ return await this.chunkedBatch({ indexName, objects, action: 'addObject' }, requestOptions);
2635
+ },
2636
+ /**
2637
+ * 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.
2638
+ *
2639
+ * @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.
2640
+ * @param deleteObjects - The `deleteObjects` object.
2641
+ * @param deleteObjects.indexName - The `indexName` to delete `objectIDs` from.
2642
+ * @param deleteObjects.objectIDs - The objectIDs to delete.
2643
+ * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `batch` method and merged with the transporter requestOptions.
2644
+ */
2645
+ async deleteObjects({ indexName, objectIDs }, requestOptions) {
2646
+ return await this.chunkedBatch({
2647
+ indexName,
2648
+ objects: objectIDs.map((objectID) => ({ objectID })),
2649
+ action: 'deleteObject',
2650
+ }, requestOptions);
2651
+ },
2652
+ /**
2653
+ * 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.
2654
+ *
2655
+ * @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.
2656
+ * @param partialUpdateObjects - The `partialUpdateObjects` object.
2657
+ * @param partialUpdateObjects.indexName - The `indexName` to update `objects` in.
2658
+ * @param partialUpdateObjects.objects - The array of `objects` to update in the given Algolia `indexName`.
2659
+ * @param partialUpdateObjects.createIfNotExists - To be provided if non-existing objects are passed, otherwise, the call will fail..
2660
+ * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
2661
+ */
2662
+ async partialUpdateObjects({ indexName, objects, createIfNotExists }, requestOptions) {
2663
+ return await this.chunkedBatch({
2664
+ indexName,
2665
+ objects,
2666
+ action: createIfNotExists
2667
+ ? 'partialUpdateObject'
2668
+ : 'partialUpdateObjectNoCreate',
2669
+ }, requestOptions);
2670
+ },
2607
2671
  /**
2608
2672
  * 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.
2673
+ * See https://api-clients-automation.netlify.app/docs/contributing/add-new-api-client#5-helpers for implementation details.
2609
2674
  *
2610
2675
  * @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
2676
  * @param replaceAllObjects - The `replaceAllObjects` object.
2612
2677
  * @param replaceAllObjects.indexName - The `indexName` to replace `objects` in.
2613
2678
  * @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.
2679
+ * @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.
2680
+ * @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
2681
  */
2617
2682
  async replaceAllObjects({ indexName, objects, batchSize }, requestOptions) {
2618
- const randomSuffix = Math.random().toString(36).substring(7);
2683
+ const randomSuffix = Math.floor(Math.random() * 1000000) + 100000;
2619
2684
  const tmpIndexName = `${indexName}_tmp_${randomSuffix}`;
2620
- const copyOperationResponse = await this.operationIndex({
2685
+ let copyOperationResponse = await this.operationIndex({
2621
2686
  indexName,
2622
2687
  operationIndexParams: {
2623
2688
  operation: 'copy',
@@ -2625,17 +2690,29 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
2625
2690
  scope: ['settings', 'rules', 'synonyms'],
2626
2691
  },
2627
2692
  }, requestOptions);
2693
+ const batchResponses = await this.chunkedBatch({ indexName: tmpIndexName, objects, waitForTasks: true, batchSize }, requestOptions);
2628
2694
  await this.waitForTask({
2695
+ indexName: tmpIndexName,
2696
+ taskID: copyOperationResponse.taskID,
2697
+ });
2698
+ copyOperationResponse = await this.operationIndex({
2629
2699
  indexName,
2700
+ operationIndexParams: {
2701
+ operation: 'copy',
2702
+ destination: tmpIndexName,
2703
+ scope: ['settings', 'rules', 'synonyms'],
2704
+ },
2705
+ }, requestOptions);
2706
+ await this.waitForTask({
2707
+ indexName: tmpIndexName,
2630
2708
  taskID: copyOperationResponse.taskID,
2631
2709
  });
2632
- const batchResponses = await this.chunkedBatch({ indexName: tmpIndexName, objects, waitForTasks: true, batchSize }, requestOptions);
2633
2710
  const moveOperationResponse = await this.operationIndex({
2634
2711
  indexName: tmpIndexName,
2635
2712
  operationIndexParams: { operation: 'move', destination: indexName },
2636
2713
  }, requestOptions);
2637
2714
  await this.waitForTask({
2638
- indexName,
2715
+ indexName: tmpIndexName,
2639
2716
  taskID: moveOperationResponse.taskID,
2640
2717
  });
2641
2718
  return { copyOperationResponse, batchResponses, moveOperationResponse };
@@ -2871,7 +2948,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
2871
2948
  return transporter.request(request, requestOptions);
2872
2949
  },
2873
2950
  /**
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.
2951
+ * 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
2952
  *
2876
2953
  * Required API Key ACLs:
2877
2954
  * - browse.
@@ -3304,6 +3381,31 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
3304
3381
  };
3305
3382
  return transporter.request(request, requestOptions);
3306
3383
  },
3384
+ /**
3385
+ * Checks the status of a given application task.
3386
+ *
3387
+ * Required API Key ACLs:
3388
+ * - editSettings.
3389
+ *
3390
+ * @param getAppTask - The getAppTask object.
3391
+ * @param getAppTask.taskID - Unique task identifier.
3392
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
3393
+ */
3394
+ getAppTask({ taskID }, requestOptions) {
3395
+ if (!taskID) {
3396
+ throw new Error('Parameter `taskID` is required when calling `getAppTask`.');
3397
+ }
3398
+ const requestPath = '/1/task/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));
3399
+ const headers = {};
3400
+ const queryParameters = {};
3401
+ const request = {
3402
+ method: 'GET',
3403
+ path: requestPath,
3404
+ queryParameters,
3405
+ headers,
3406
+ };
3407
+ return transporter.request(request, requestOptions);
3408
+ },
3307
3409
  /**
3308
3410
  * Lists supported languages with their supported dictionary types and number of custom entries.
3309
3411
  *
@@ -3778,7 +3880,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
3778
3880
  return transporter.request(request, requestOptions);
3779
3881
  },
3780
3882
  /**
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/).
3883
+ * 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
3884
  *
3783
3885
  * Required API Key ACLs:
3784
3886
  * - addObject.
@@ -4462,6 +4564,368 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
4462
4564
  };
4463
4565
  }
4464
4566
 
4567
+ // 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.
4568
+ const apiClientVersion$1 = '5.0.0-beta.10';
4569
+ function getDefaultHosts(appId) {
4570
+ return [
4571
+ {
4572
+ url: `${appId}-dsn.algolia.net`,
4573
+ accept: 'read',
4574
+ protocol: 'https',
4575
+ },
4576
+ {
4577
+ url: `${appId}.algolia.net`,
4578
+ accept: 'write',
4579
+ protocol: 'https',
4580
+ },
4581
+ ].concat(shuffle([
4582
+ {
4583
+ url: `${appId}-1.algolianet.com`,
4584
+ accept: 'readWrite',
4585
+ protocol: 'https',
4586
+ },
4587
+ {
4588
+ url: `${appId}-2.algolianet.com`,
4589
+ accept: 'readWrite',
4590
+ protocol: 'https',
4591
+ },
4592
+ {
4593
+ url: `${appId}-3.algolianet.com`,
4594
+ accept: 'readWrite',
4595
+ protocol: 'https',
4596
+ },
4597
+ ]));
4598
+ }
4599
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
4600
+ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }) {
4601
+ const auth = createAuth(appIdOption, apiKeyOption, authMode);
4602
+ const transporter = createTransporter({
4603
+ hosts: getDefaultHosts(appIdOption),
4604
+ ...options,
4605
+ algoliaAgent: getAlgoliaAgent({
4606
+ algoliaAgents,
4607
+ client: 'Recommend',
4608
+ version: apiClientVersion$1,
4609
+ }),
4610
+ baseHeaders: {
4611
+ 'content-type': 'text/plain',
4612
+ ...auth.headers(),
4613
+ ...options.baseHeaders,
4614
+ },
4615
+ baseQueryParameters: {
4616
+ ...auth.queryParameters(),
4617
+ ...options.baseQueryParameters,
4618
+ },
4619
+ });
4620
+ return {
4621
+ transporter,
4622
+ /**
4623
+ * The `appId` currently in use.
4624
+ */
4625
+ appId: appIdOption,
4626
+ /**
4627
+ * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
4628
+ */
4629
+ clearCache() {
4630
+ return Promise.all([
4631
+ transporter.requestsCache.clear(),
4632
+ transporter.responsesCache.clear(),
4633
+ ]).then(() => undefined);
4634
+ },
4635
+ /**
4636
+ * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
4637
+ */
4638
+ get _ua() {
4639
+ return transporter.algoliaAgent.value;
4640
+ },
4641
+ /**
4642
+ * Adds a `segment` to the `x-algolia-agent` sent with every requests.
4643
+ *
4644
+ * @param segment - The algolia agent (user-agent) segment to add.
4645
+ * @param version - The version of the agent.
4646
+ */
4647
+ addAlgoliaAgent(segment, version) {
4648
+ transporter.algoliaAgent.add({ segment, version });
4649
+ },
4650
+ /**
4651
+ * This method allow you to send requests to the Algolia REST API.
4652
+ *
4653
+ * @param customDelete - The customDelete object.
4654
+ * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
4655
+ * @param customDelete.parameters - Query parameters to apply to the current query.
4656
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
4657
+ */
4658
+ customDelete({ path, parameters }, requestOptions) {
4659
+ if (!path) {
4660
+ throw new Error('Parameter `path` is required when calling `customDelete`.');
4661
+ }
4662
+ const requestPath = '/{path}'.replace('{path}', path);
4663
+ const headers = {};
4664
+ const queryParameters = parameters ? parameters : {};
4665
+ const request = {
4666
+ method: 'DELETE',
4667
+ path: requestPath,
4668
+ queryParameters,
4669
+ headers,
4670
+ };
4671
+ return transporter.request(request, requestOptions);
4672
+ },
4673
+ /**
4674
+ * This method allow you to send requests to the Algolia REST API.
4675
+ *
4676
+ * @param customGet - The customGet object.
4677
+ * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
4678
+ * @param customGet.parameters - Query parameters to apply to the current query.
4679
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
4680
+ */
4681
+ customGet({ path, parameters }, requestOptions) {
4682
+ if (!path) {
4683
+ throw new Error('Parameter `path` is required when calling `customGet`.');
4684
+ }
4685
+ const requestPath = '/{path}'.replace('{path}', path);
4686
+ const headers = {};
4687
+ const queryParameters = parameters ? parameters : {};
4688
+ const request = {
4689
+ method: 'GET',
4690
+ path: requestPath,
4691
+ queryParameters,
4692
+ headers,
4693
+ };
4694
+ return transporter.request(request, requestOptions);
4695
+ },
4696
+ /**
4697
+ * This method allow you to send requests to the Algolia REST API.
4698
+ *
4699
+ * @param customPost - The customPost object.
4700
+ * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
4701
+ * @param customPost.parameters - Query parameters to apply to the current query.
4702
+ * @param customPost.body - Parameters to send with the custom request.
4703
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
4704
+ */
4705
+ customPost({ path, parameters, body }, requestOptions) {
4706
+ if (!path) {
4707
+ throw new Error('Parameter `path` is required when calling `customPost`.');
4708
+ }
4709
+ const requestPath = '/{path}'.replace('{path}', path);
4710
+ const headers = {};
4711
+ const queryParameters = parameters ? parameters : {};
4712
+ const request = {
4713
+ method: 'POST',
4714
+ path: requestPath,
4715
+ queryParameters,
4716
+ headers,
4717
+ data: body ? body : {},
4718
+ };
4719
+ return transporter.request(request, requestOptions);
4720
+ },
4721
+ /**
4722
+ * This method allow you to send requests to the Algolia REST API.
4723
+ *
4724
+ * @param customPut - The customPut object.
4725
+ * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
4726
+ * @param customPut.parameters - Query parameters to apply to the current query.
4727
+ * @param customPut.body - Parameters to send with the custom request.
4728
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
4729
+ */
4730
+ customPut({ path, parameters, body }, requestOptions) {
4731
+ if (!path) {
4732
+ throw new Error('Parameter `path` is required when calling `customPut`.');
4733
+ }
4734
+ const requestPath = '/{path}'.replace('{path}', path);
4735
+ const headers = {};
4736
+ const queryParameters = parameters ? parameters : {};
4737
+ const request = {
4738
+ method: 'PUT',
4739
+ path: requestPath,
4740
+ queryParameters,
4741
+ headers,
4742
+ data: body ? body : {},
4743
+ };
4744
+ return transporter.request(request, requestOptions);
4745
+ },
4746
+ /**
4747
+ * Deletes a Recommend rule from a recommendation scenario.
4748
+ *
4749
+ * Required API Key ACLs:
4750
+ * - editSettings.
4751
+ *
4752
+ * @param deleteRecommendRule - The deleteRecommendRule object.
4753
+ * @param deleteRecommendRule.indexName - Name of the index on which to perform the operation.
4754
+ * @param deleteRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
4755
+ * @param deleteRecommendRule.objectID - Unique record identifier.
4756
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
4757
+ */
4758
+ deleteRecommendRule({ indexName, model, objectID }, requestOptions) {
4759
+ if (!indexName) {
4760
+ throw new Error('Parameter `indexName` is required when calling `deleteRecommendRule`.');
4761
+ }
4762
+ if (!model) {
4763
+ throw new Error('Parameter `model` is required when calling `deleteRecommendRule`.');
4764
+ }
4765
+ if (!objectID) {
4766
+ throw new Error('Parameter `objectID` is required when calling `deleteRecommendRule`.');
4767
+ }
4768
+ const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/{objectID}'
4769
+ .replace('{indexName}', encodeURIComponent(indexName))
4770
+ .replace('{model}', encodeURIComponent(model))
4771
+ .replace('{objectID}', encodeURIComponent(objectID));
4772
+ const headers = {};
4773
+ const queryParameters = {};
4774
+ const request = {
4775
+ method: 'DELETE',
4776
+ path: requestPath,
4777
+ queryParameters,
4778
+ headers,
4779
+ };
4780
+ return transporter.request(request, requestOptions);
4781
+ },
4782
+ /**
4783
+ * Retrieves a Recommend rule that you previously created in the Algolia dashboard.
4784
+ *
4785
+ * Required API Key ACLs:
4786
+ * - settings.
4787
+ *
4788
+ * @param getRecommendRule - The getRecommendRule object.
4789
+ * @param getRecommendRule.indexName - Name of the index on which to perform the operation.
4790
+ * @param getRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
4791
+ * @param getRecommendRule.objectID - Unique record identifier.
4792
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
4793
+ */
4794
+ getRecommendRule({ indexName, model, objectID }, requestOptions) {
4795
+ if (!indexName) {
4796
+ throw new Error('Parameter `indexName` is required when calling `getRecommendRule`.');
4797
+ }
4798
+ if (!model) {
4799
+ throw new Error('Parameter `model` is required when calling `getRecommendRule`.');
4800
+ }
4801
+ if (!objectID) {
4802
+ throw new Error('Parameter `objectID` is required when calling `getRecommendRule`.');
4803
+ }
4804
+ const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/{objectID}'
4805
+ .replace('{indexName}', encodeURIComponent(indexName))
4806
+ .replace('{model}', encodeURIComponent(model))
4807
+ .replace('{objectID}', encodeURIComponent(objectID));
4808
+ const headers = {};
4809
+ const queryParameters = {};
4810
+ const request = {
4811
+ method: 'GET',
4812
+ path: requestPath,
4813
+ queryParameters,
4814
+ headers,
4815
+ };
4816
+ return transporter.request(request, requestOptions);
4817
+ },
4818
+ /**
4819
+ * 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.
4820
+ *
4821
+ * Required API Key ACLs:
4822
+ * - editSettings.
4823
+ *
4824
+ * @param getRecommendStatus - The getRecommendStatus object.
4825
+ * @param getRecommendStatus.indexName - Name of the index on which to perform the operation.
4826
+ * @param getRecommendStatus.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
4827
+ * @param getRecommendStatus.taskID - Unique task identifier.
4828
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
4829
+ */
4830
+ getRecommendStatus({ indexName, model, taskID }, requestOptions) {
4831
+ if (!indexName) {
4832
+ throw new Error('Parameter `indexName` is required when calling `getRecommendStatus`.');
4833
+ }
4834
+ if (!model) {
4835
+ throw new Error('Parameter `model` is required when calling `getRecommendStatus`.');
4836
+ }
4837
+ if (!taskID) {
4838
+ throw new Error('Parameter `taskID` is required when calling `getRecommendStatus`.');
4839
+ }
4840
+ const requestPath = '/1/indexes/{indexName}/{model}/task/{taskID}'
4841
+ .replace('{indexName}', encodeURIComponent(indexName))
4842
+ .replace('{model}', encodeURIComponent(model))
4843
+ .replace('{taskID}', encodeURIComponent(taskID));
4844
+ const headers = {};
4845
+ const queryParameters = {};
4846
+ const request = {
4847
+ method: 'GET',
4848
+ path: requestPath,
4849
+ queryParameters,
4850
+ headers,
4851
+ };
4852
+ return transporter.request(request, requestOptions);
4853
+ },
4854
+ /**
4855
+ * Retrieves recommendations from selected AI models.
4856
+ *
4857
+ * Required API Key ACLs:
4858
+ * - search.
4859
+ *
4860
+ * @param getRecommendationsParams - The getRecommendationsParams object.
4861
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
4862
+ */
4863
+ getRecommendations(getRecommendationsParams, requestOptions) {
4864
+ if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {
4865
+ const newSignatureRequest = {
4866
+ requests: getRecommendationsParams,
4867
+ };
4868
+ // eslint-disable-next-line no-param-reassign
4869
+ getRecommendationsParams = newSignatureRequest;
4870
+ }
4871
+ if (!getRecommendationsParams) {
4872
+ throw new Error('Parameter `getRecommendationsParams` is required when calling `getRecommendations`.');
4873
+ }
4874
+ if (!getRecommendationsParams.requests) {
4875
+ throw new Error('Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.');
4876
+ }
4877
+ const requestPath = '/1/indexes/*/recommendations';
4878
+ const headers = {};
4879
+ const queryParameters = {};
4880
+ const request = {
4881
+ method: 'POST',
4882
+ path: requestPath,
4883
+ queryParameters,
4884
+ headers,
4885
+ data: getRecommendationsParams,
4886
+ useReadTransporter: true,
4887
+ cacheable: true,
4888
+ };
4889
+ return transporter.request(request, requestOptions);
4890
+ },
4891
+ /**
4892
+ * Searches for Recommend rules. Use an empty query to list all rules for this recommendation scenario.
4893
+ *
4894
+ * Required API Key ACLs:
4895
+ * - settings.
4896
+ *
4897
+ * @param searchRecommendRules - The searchRecommendRules object.
4898
+ * @param searchRecommendRules.indexName - Name of the index on which to perform the operation.
4899
+ * @param searchRecommendRules.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
4900
+ * @param searchRecommendRules.searchRecommendRulesParams - The searchRecommendRulesParams object.
4901
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
4902
+ */
4903
+ searchRecommendRules({ indexName, model, searchRecommendRulesParams, }, requestOptions) {
4904
+ if (!indexName) {
4905
+ throw new Error('Parameter `indexName` is required when calling `searchRecommendRules`.');
4906
+ }
4907
+ if (!model) {
4908
+ throw new Error('Parameter `model` is required when calling `searchRecommendRules`.');
4909
+ }
4910
+ const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/search'
4911
+ .replace('{indexName}', encodeURIComponent(indexName))
4912
+ .replace('{model}', encodeURIComponent(model));
4913
+ const headers = {};
4914
+ const queryParameters = {};
4915
+ const request = {
4916
+ method: 'POST',
4917
+ path: requestPath,
4918
+ queryParameters,
4919
+ headers,
4920
+ data: searchRecommendRulesParams ? searchRecommendRulesParams : {},
4921
+ useReadTransporter: true,
4922
+ cacheable: true,
4923
+ };
4924
+ return transporter.request(request, requestOptions);
4925
+ },
4926
+ };
4927
+ }
4928
+
4465
4929
  function createXhrRequester() {
4466
4930
  function send(request) {
4467
4931
  return new Promise((resolve) => {
@@ -4515,7 +4979,7 @@ function createXhrRequester() {
4515
4979
  }
4516
4980
 
4517
4981
  // 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;
4982
+ const apiClientVersion = apiClientVersion$2;
4519
4983
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
4520
4984
  function algoliasearch(appId, apiKey, options) {
4521
4985
  if (!appId || typeof appId !== 'string') {
@@ -4545,6 +5009,13 @@ function algoliasearch(appId, apiKey, options) {
4545
5009
  }),
4546
5010
  ...options,
4547
5011
  };
5012
+ function initRecommend(initOptions = {}) {
5013
+ return createRecommendClient({
5014
+ ...commonOptions,
5015
+ ...initOptions.options,
5016
+ ...initOptions,
5017
+ });
5018
+ }
4548
5019
  function initAnalytics(initOptions = {}) {
4549
5020
  if (initOptions.region &&
4550
5021
  (typeof initOptions.region !== 'string' ||
@@ -4590,9 +5061,10 @@ function algoliasearch(appId, apiKey, options) {
4590
5061
  get _ua() {
4591
5062
  return this.transporter.algoliaAgent.value;
4592
5063
  },
5064
+ initAbtesting,
4593
5065
  initAnalytics,
4594
5066
  initPersonalization,
4595
- initAbtesting,
5067
+ initRecommend,
4596
5068
  };
4597
5069
  }
4598
5070